meteor / meteor-feature-requests

A tracker for Meteor issues that are requests for new functionality, not bugs.
Other
89 stars 3 forks source link

Investigate swapping Underscore w/ Lo-Dash or upgrading Underscore #48

Open vlasky opened 7 years ago

vlasky commented 7 years ago

Migrated from: meteor/meteor#1009

mjmasn commented 7 years ago

Would be good to see lodash as the default!

abernix commented 7 years ago

(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.

jdalton commented 7 years ago

@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.

john-osullivan commented 7 years ago

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.

tennox commented 4 years ago

bump :sweat_smile:

evolross commented 4 years ago

Why isn't underscore or lodash updated to be like jquery@3.0.0 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?

StorytellerCZ commented 4 years ago

@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.

derwaldgeist commented 4 years ago

bump

vlasky commented 4 years ago

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?