Meteor-feature-requests: Investigate swapping Underscore w/ Lo-Dash or upgrading Underscore

Created on 8 Jun 2017  路  9Comments  路  Source: meteor/meteor-feature-requests

Migrated from: meteor/meteor#1009

Imported Packages

Most helpful comment

(Reposting from my update in https://github.com/meteor/meteor/issues/1009#issuecomment-307090385)

Just as an update on the status of this (important) task...

I did complete the work to replace underscore with lodash in Meteor. The only hesitation to applying that officially was that it actually _increased_ the resulting client-side bundle size by slightly more than we would have liked. This was particularly true since the realization was had during the 1.5-push which was directly focused on _decreasing_ client bundle sizes.

I'm aware of the reasons and I will develop a plan soon to resolve that and get this released. This will be even easier with the bundle-visualizer in Meteor 1.5.

All 9 comments

Would be good to see lodash as the default!

(Reposting from my update in https://github.com/meteor/meteor/issues/1009#issuecomment-307090385)

Just as an update on the status of this (important) task...

I did complete the work to replace underscore with lodash in Meteor. The only hesitation to applying that officially was that it actually _increased_ the resulting client-side bundle size by slightly more than we would have liked. This was particularly true since the realization was had during the 1.5-push which was directly focused on _decreasing_ client bundle sizes.

I'm aware of the reasons and I will develop a plan soon to resolve that and get this released. This will be even easier with the bundle-visualizer in Meteor 1.5.

@abernix Awesome! Let me know if you have any questions. There are plugins like babel-plugin-lodash and lodash-webpack-plugin to help reduce bundle size by ensuring modules are cherry-picked or simplified.

Just looked this up after dealing with a weird bug in my Meteor-React app where the _ token is getting replaced by lodash somewhere in the compilation. Super frustrating having to swap method names because I'm not sure what the token will be set as in different places. Thanks for putting in the dev work to swap Meteor over, @abernix , you the MVP.

bump :sweat_smile:

Why isn't underscore or lodash updated to be like [email protected] and simply reference an NPM version? Instead of wrapping such a common package?

If any app has an NPM underscore or lodash dependency, then underscore or lodash would be included twice in the client bundle just like jquery used to be.

Shouldn't we go that route?

@evolross I've checked into this and the main blocker with this approach are the modifications that Meteor made to underscore. There seems to be an issue when collections come into the picture.

bump

Can we incorporate @abernix's Meteor lodash enhancements now? It's been almost 3 years since he announced them. Surely the client size bundle size shouldn't be an issue now?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SachaG picture SachaG  路  50Comments

mwarren2 picture mwarren2  路  31Comments

mitar picture mitar  路  22Comments

Dev1an picture Dev1an  路  24Comments

StorytellerCZ picture StorytellerCZ  路  21Comments