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
Other misc tweaks to discuss #10
Comments
Basically, I believe, recommending this plugin puts the developers at too much risk for not that much gain. I won’t do this. (The plugin might be useful for library authors, as it mentions in the README – but I think we target app developers here.)
AFAIK Babel 7 does this annotation for classes too. Or is this a different one?
This sounds cool! There’re too few downloads though – I’m not sure it’s fully safe :–( Have you used this in production (or heard of anyone using it)?
Would love to see a benchmark here. Generally, I’d prefer bundle size to runtime performance:
The plugin is not compatible with webpack 4 :–( As to Prepack – do you know how safe it is? Last time I checked, it wasn’t production-ready yet.
Cool thing! Probably out of scope for this repo though – as it doesn’t immediately make your bundle smaller. |
Sounds reasonable.
Do you have a source for that? I picked the code from a gist some when, don't know if that changed. Let's look it up :)
I use it in my Chrome extensions, but those are fairly easy to test and the target is Chrome only. So can't really tell you much.
True, so we keep this plugin in this issue only :)
Yup, unfortunate :/
I'm not sure. Some options definitely aren't. However, they also have great plans: https://twitter.com/trueadm/status/991725785038942210 |
Just tested with
Dan Abramov also mentions that Prepack can’t be just enabled like Babel or UglifyJS: https://gist.github.com/gaearon/d85dccba72b809f56a9553972e5c33c4#before-we-dive-in-. So it seems like Prepack is not safe enough for mentioning it right now. In the future, when Prepack becomes more stable and gains more React-specific optimizations, we might mention it under the “React” section. |
I guess we should leave this open until we can mention Prepack - some experimentation friendly developers might also stumble over the other stuff in meanwhile :) |
Another thing to discuss: https://medium.com/@okcdz/better-tree-shaking-with-deep-scope-analysis-a0b788c0ce77 It shaves off 7 kB (90 kB -> 83 kB) in my bundle. Worth to mention I'd say. What do you think @iamakulov? |
That‘s an interesting plugin :)
Summing up: I think let’s wait for a couple of months until it stabilizes and gains popularity, and then we can add it into the article (or another place if we find it). Thanks for suggesting this! |
Pure Annotation
https://www.npmjs.com/package/babel-plugin-annotate-pure-calls
This helps reducing the bundle size, however it could break your code. I'd say we should mention it.
Plus: https://github.com/kurtextrem/Improved-for-Instagram/blob/master/pure-plugin.js - this annotates classes.
We can take it even further: https://www.npmjs.com/package/side-effects-safe
babel-plugin-closure-elimination
https://github.com/codemix/babel-plugin-closure-elimination - I haven't benched it, however it makes sense as it reduces function/obj allocation and small functions are also inlined easily.
(probably makes the bundle bigger though)
Prepack
https://prepack.io / https://github.com/gajus/prepack-webpack-plugin speaks for itself :)
etc
https://npmjs.com/package/duplicate-package-checker-webpack-plugin
The text was updated successfully, but these errors were encountered: