Live data from Hacker News

If you write JavaScript tools or libraries, bundle your code before publishing

medium.com

21–25 of 25 posts

Re: If you write JavaScript tools or libraries, bundle your code before publishing

#21

Leaving aside all the advertisement and marketing. JSPM -> sounds like a good idea until you try using it, and SystemJS is just sad. Its not the fault of the specs, its just that the creator is having difficulty with funding - as with any other good open source projects. Webpack -> Slow, unstable and documentation is incomplete. RollUp -> I am not going to listen to the author's comment on how awesome his product is…

No one also cares if you think browserify is awesome. Everyone has their favorites, deal with it.

Re: If you write JavaScript tools or libraries, bundle your code before publishing

#22
post #9

Earlier quoted context omitted.

you missed the biggest one: browserify 2,218,006 downloads in the last month But my prediction is Rollup will take off in a big way at some point in the next 2 years. It's not quite stable enough yet, but it's just fundamentally better designed than everything else. Rollup is the only tool I'm aware of that properly exploits static analysis of ES6 module syntax. Every other bundler is full of hacks and moving parts,…

Webpack v2 also tries to use the static part of es6 modules (for DCE ?)

Yes, Webpack is also trying out "tree shaking" https://github.com/webpack/webpack/tree/master/examples/harm...

Re: If you write JavaScript tools or libraries, bundle your code before publishing

#23

Ugh, no. Bundling should be done at the very end, when you're trying to build maintainable software. It's a mistake to bundle in the middle, because then even loosely-dependent modules will be limited to updating only when every intermediate dependency updates. Don't take these decisions out of the hands of the coders who are actually coding software.

Are you aware that jQuery bundles Sizzle? I guess not.

https://github.com/jquery/jquery#modules

https://github.com/jquery/sizzle

Re: If you write JavaScript tools or libraries, bundle your code before publishing

#24

Can someone clarify what would happen in this scenario: - My app requires React. - My app also requires FooBarComponent whose dist is just a giant index.js which includes its own copy of React. - Now I get a bunch of errors because FooBarComponent and MyApp can't share anything between themselves. React really doesn't like it when two copies are running.

The root of the problem is why FooBarComponent is a giant index.js. Also, why does it have React bundled if it expects to be a reusable component? Also, frameworks like React etc. shouldn't be a bundled dependency. They should be an external dependency or a top-level dependency.

Re: If you write JavaScript tools or libraries, bundle your code before publishing

#25

Ugh, no. Bundling should be done at the very end, when you're trying to build maintainable software. It's a mistake to bundle in the middle, because then even loosely-dependent modules will be limited to updating only when every intermediate dependency updates. Don't take these decisions out of the hands of the coders who are actually coding software.

Are you aware that jQuery bundles Sizzle? I guess not. https://github.com/jquery/jquery#modules https://github.com/jquery/sizzle

I was under the impression that jquery bundles the kitchen sink, as well. It's sort of a special case. Those who use it, know what they're getting. The average npm module doesn't emulate jquery.
Post reply on HN