Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should have a customizabe build #2368

Closed
11 tasks
bwl21 opened this issue Mar 29, 2019 · 5 comments
Closed
11 tasks

Should have a customizabe build #2368

bwl21 opened this issue Mar 29, 2019 · 5 comments

Comments

@bwl21
Copy link
Contributor

bwl21 commented Mar 29, 2019

Usecase

When integrating JSPdf in other projects, not all features will be necessary. The required feature set depends on the application and on the platform (browser, cli)

Request

  • There should be an interactive feature builder which allows to select the intended Features. An initial version of this is already there as builder.html
  • the feature Bulider shall be able to save the feature selection file which can subsequently be used to be version controlled, used in a build pipline etc.
  • the feature Builder shall be able to load the feature selection file as a baseline for an updated configuration.
  • The feature builder shall load the configuration of available features from a configuration file which might also be used by the custom_builder
  • There shall be a custom_builder which takes the aforehead mentioned feature selection file and generates a JSPdf.{featureset}.debug.js
  • the generated JSPdf.{featureset}.debug.js shall contain the selected features as comment (maybe even retrievable via the api by JSPdf clients)
  • the generated JSPdf shall contain version number and git SHA for reference purposes

Solution approach

  • jspdf.features.js - this is a json file which contains the available features and the dependant modules.
  • builder.html - this is the editor for the feature selection based on jspdf.features.js. builder.html can upload/download the feature selection file as well as the result of a build (which is a shortcut ...)
  • custom_builder.js this script builds a jspdf.{featureset}.debug.js where featureset is the basename of the featureselection file.
  • feature selection file: this file is maintained by builder.html. It takes all the information provided by the user. The feature selection file is intended to be kept in the vcl of integrator projects.
@simonbengtsson
Copy link
Contributor

Wouldn't an easier approach be supporting tree shaking? Ie letting module bundlers take the code that is used and remove everything else. Related to this #839

@Uzlopak
Copy link
Collaborator

Uzlopak commented Apr 6, 2019

@simonbengtsson
The builder i made was just made as a gimmick. Not really for productive use, but more like a test which parts are maybe depending on each other.

So I will maybe remove the cli.js and other non working builder parts or hide for now, as maybe people will complain that it wont work etc. ;)

Tbh I think jsPDF will be longer a monolith.

@bwl21
Copy link
Contributor Author

bwl21 commented Apr 9, 2019

There are different requirements depending on the use case that we should have a customizable build providing a monolithic, easy to integrate jspdf. Therefore something like build.cli will be necessary.

@github-actions
Copy link

This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

@HackbrettXXX
Copy link
Collaborator

Kind of a duplicate of #839.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants