dojo / cli-build-webpack

🚀 **DEPRECATED** Dojo 2 - cli command for building applications
http://dojo.io
Other
4 stars 19 forks source link

noEmitHelpers and including helpers uniquely #159

Closed kitsonk closed 6 years ago

kitsonk commented 7 years ago

Enhancement

We should consider using the --noEmitHelpers compiler flag and including the global helpers directly in our builds. This should make for slightly more efficient bundles and more granular control of the down emit helpers if needed in the future.

kitsonk commented 7 years ago

Instead of deprecating forOf() let's go ahead and just take the hit on the breaking change, since downstream adoption is likely very low.

rorticus commented 7 years ago

So, I added importsHelper and tslib to todo-mvc, and took a look at the un-minified bundle (to make sure all the helpers were out of there). I noticed that, for todo-mvc, we've only got an un-minified gain of about 3k (w/ helpers 383kb, w/o helpers 380k). I guess I was wondering if this was worth it for such a small gain 😄

kitsonk commented 7 years ago

todo-mvc is a small application, the size could be a lot more in larger applications... every little bit helps and the worth it is a bigger impact on us for a transparent impact on the downstream... so yeah... I think it is worth it.

kitsonk commented 7 years ago

I think instead of using the importsHelper flag, we should fold it into a solution that works like dojo/shim#106

rorticus commented 6 years ago

This has evolved a bit, but in the end we ended up using importsHelpers, and patching the tslib __values helper. noEmitHelpers wouldn't work from webpack. cli-build-webpack was changed to automatically load @dojo/shim/main (for shims) and @dojo/shim/browser (for polyfills).