Closed kitsonk closed 6 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.
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 😄
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.
I think instead of using the importsHelper
flag, we should fold it into a solution that works like dojo/shim#106
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).
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.