Bundling Dependencies #1385
Unanswered
bennypowers
asked this question in
Ideas
Replies: 1 comment 5 replies
-
@bennypowers would it be possible to share some example repo facing the problem this proposal is trying to solve? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TL;DR:
@davidclark87 From Adobe mentioned recently on the Polymer slack an interest in automatically bundling dependencies in order to reduce waterfall times when using
@web/dev-server
. This reignited a previous discussion of the feature among @LarsDenBakker @daKmoR, @Westbrook and myself. @justinfagnani also expressed interest in such a tool. I'll try to summarize the points raised here in this post, and we can continue the discussion here:Problem
In large apps, the request waterfall can get exceedingly deep for dependencies, and this severely impacts page reload performance even when those dependencies are cached by the browser. In some cases it can get to the point where the benefits of buildless development vs bundled development become questionable.
Straw Solution
Bundle dependencies in a separate thread to reduce the waterfall depth.
Preferably, this would also still enable users to edit
node_modules/**/*.*
in-place (i.e. a patch-package workflow and see their changes reflected on the reloaded page.We'd also prefer to use (and/or contribute to) a lower-level 'dependency bundler' that could be shared among the different toolchains in the broader JS and web ecosystem, e.g. https://www.npmjs.com/package/esinstall which powers snowpack.
Alternative Solutions
HMR might address the problem of development cycle time (i.e. the time it takes to observe a code change after hitting "save"). HMR is not appropriate to every project though and also isn't bulletproof, the occasional page reload is still advised.
Beta Was this translation helpful? Give feedback.
All reactions