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

Break out dependencies? #64

Open
kevinburkeshyp opened this issue Apr 12, 2016 · 2 comments
Open

Break out dependencies? #64

kevinburkeshyp opened this issue Apr 12, 2016 · 2 comments

Comments

@kevinburkeshyp
Copy link

As a rough measure of how "big" the project is in terms of dependencies, when shrinkwrapped bootprint-openapi has 2000 lines of dependencies, and roughly 500 distinct packages.

Is there anything that can be done to reduce the size or scope of what must be installed to use this project?

@kevinburkeshyp kevinburkeshyp changed the title load fewer dependencies Break out dependencies? Apr 12, 2016
@nknapp
Copy link
Member

nknapp commented Apr 13, 2016

Are you talking about devDependencies or dependencies.
The only normal dependency is actually bootprint-json-schema which uses bootprint-base.
bootprint-base uses

  • marked: For markdown processing
  • json-stable-stringify: To render examples in a stable fashion
  • hightlight.js: To allow code-highlighting in markdown texts and to highlight JSON-examples.
  • cheerio: For postprocessing HTML generated by marked
  • handlebars: Mostly to use Handlebars.SafeString for HTML generated by marked
  • bootstrap: To include the boostrap-less-files.

I don't think that there is a lot to be left out. If you have any ideas, go ahead and tell me. I would also like to reduce the overall size of the packages.
I have tried to encourage some of the dependency-maintainers to add a files-section to their package.json to reduce the size of the dependencies, but that hasn't always been heard.

The dependency-tree for the production files isn't actually that big.

└─┬ [email protected] 
  ├─┬ [email protected] 
  │ └─┬ [email protected] 
  │   ├── [email protected] 
  │   ├─┬ [email protected] 
  │   │ ├─┬ [email protected] 
  │   │ │ ├── [email protected] 
  │   │ │ ├── [email protected] 
  │   │ │ ├── [email protected] 
  │   │ │ └── [email protected] 
  │   │ ├─┬ [email protected] 
  │   │ │ └── [email protected] 
  │   │ ├── [email protected] 
  │   │ └─┬ [email protected] 
  │   │   ├── [email protected] 
  │   │   ├── [email protected] 
  │   │   ├── [email protected] 
  │   │   ├── [email protected] 
  │   │   └─┬ [email protected] 
  │   │     ├── [email protected] 
  │   │     ├── [email protected] 
  │   │     ├── [email protected] 
  │   │     └── [email protected] 
  │   ├─┬ [email protected] 
  │   │ ├─┬ [email protected] 
  │   │ │ ├── [email protected] 
  │   │ │ └── [email protected] 
  │   │ ├─┬ [email protected] 
  │   │ │ └── [email protected] 
  │   │ └─┬ [email protected] 
  │   │   ├── [email protected] 
  │   │   └── [email protected] 
  │   ├── [email protected] 
  │   ├─┬ [email protected] 
  │   │ └── [email protected] 
  │   └── [email protected] 
  └── [email protected] 

Now, the dependency-tree of bootprint is huge, I agree. And that is not a good thing. But a large portion is covered by

  • the less-compiler, which is essential
  • chokidar: This is the file-watcher used in development-mode. I had the feeling it's the best one, but maybe there is a smaller one (gaze??). But a file-watcher should definitely be in there.
  • live-server: If you find another live-reload-capable embedded http-server for use in development-mode let me know. It also has plenty of dependencies.

Maybe it is possible, to use watchr as a dependencies of customize-watch instead of chokidar. watchr is already used by live-server so it is in the node_modules and can be reused (with npm>=3).

Oh and: I have intentionally split bootprint-openapi in bootprint-openapi, bootprint-json-schema and bootprint-base to allow reuse for other purpose. I have also intentionally split up the functionality of bootprint into all the customize-* packages, also to be able to reuse them.

Of course, this adds dependencies, if you just count the lines of the npm ls-output. But it does not add code.

@nknapp
Copy link
Member

nknapp commented Jul 12, 2016

It might be helpful here to break out the dev-mode (file-watcher and live-server) into a separate package, so that dev-mode option only works, if this package is present as well. It would reduce the size of the bootprint-core which is probably used by more people than the dev-mode.

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

No branches or pull requests

2 participants