-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
chore: Migrate build tool #270
Conversation
Signed-off-by: Matt Roberts <[email protected]>
Signed-off-by: Matt Roberts <[email protected]>
Signed-off-by: Matt Roberts <[email protected]>
Signed-off-by: Matt Roberts <[email protected]>
Signed-off-by: Matt Roberts <[email protected]>
This looks nice, but also slightly disconcerting. A bit curious about:
|
There are lots of comparisons out there, e.g. https://betterprogramming.pub/the-battle-of-bundlers-6333a4e3eda9
By bundling and performing optimisations such as tree-shaking and minimisation, all dependencies of concerto benefit from reduced package sizes. Optimising here also gives us greater control than relying than on upstream dependants. Our npmjs listing today, says that our package size is >1MB which is misleading at best (the compressed version of the UMD bundle is ~80kB), and suggests many other poor things at worst. As the root package in the AP stack, I wanted to start my investigations here because it will give us the biggest ROI.
I originally attempted to solve a different problem, then rolled-back and this PR is what remained. Currently, in the npm package that is published by this repo, we include two things that are redundant:
UMD is compatible with Node JS and browsers, but other formats are preferable (ESM for Node, and IIFE for browsers). However, after investigation, I wasn't confident that I had a solution that solved this problem and retained CommonJS for developing / testing locally. I might pick this up again, but I need to move onto other things now. I was also hoping that a switch to Rollup would give us an improvement in the size of the UMD bundle; it didn't, it's broadly the same. Another conclusion was that to really benefit from a performance optimisation, changing the bundle format (UMD vs IIFE vs CommonJS vs ESM) makes margin impact because of the dominance of the parser which is more than 90% of the total package size. This is further motivation for #55 (comment) |
Another benefit of WebAssembly was staring us in the face all along.
gotcha.
Understood, but clearly this looks like an investigation and if we like it, it feels like we are signing up for applying this to the rest of the AP stack (or feels like we should which is a pretty significant effort).
Looks nice all around though, I'll approve and let's see how it goes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice as a migration away from webpack.
Migrate from
webpack
torollup
for bundling. Rollup is more appropriate for a library such as this, whereas webpack is better suited to web apps. This also aligns this repo with @accordproject/web-compoenntsChanges
umd/concerto.js
todist/concerto.min.js
..npmignore
.