Comments (14)
+1 to this so that I don't need an extra copy of lodash in my distributed bundle
from velocity-react.
from velocity-react.
Presumably we could upgrade to 4, though I don't see why you'd be getting an error now. In my tests, NPM installed lodash 3.10 into velocity-react's node_modules folder.
You may need to wipe your node_modules directory and do a re-install to get that, though.
from velocity-react.
Yeah you're right..
I got the error when upgraded the package.
Reinstalling velocity-react will solve it..
Thanks!
from velocity-react.
Not sure what the error is… we're pegged to the 3.10 implementation.
from velocity-react.
It seems that the only problem is the "namespace" isn't it?
From: lodash/lang/isEqual
To: lodash/isEqual
Pluck has been deprecated also, will it be hard to upgrade?
from velocity-react.
+1 to this so that I don't need an extra copy of lodash in my distributed bundle
True!
from velocity-react.
Note that velocity-react doesn't require all of lodash, just a handful of functions. So, you're not getting a full extra copy in your bundle.
from velocity-react.
Then why not only require the lodash packages you are using?
from velocity-react.
from velocity-react.
Not really. All of lodash is still included. This only installs the ones that are actually used: #219
from velocity-react.
from velocity-react.
It gains not having to install all of lodash since its a dependency and gets installed when this does. Its not only about the production environment but also dev. Faster installs, less file size overhead. Why not be explicit?
from velocity-react.
@finneganh -- I'm also having this Lodash issue, though I'm not 100% confident that it's velocity-react (50/50 chance at this point). But regarding the explicit imports in Lodash and webpack only requiring the necessary modules -- I don't think you get that for free with Webpack.
My understanding is that if you were to import all of your lodash statements namespaced, i.e.:
import { merge } from 'lodash';
... then Webpack would, as part of optimizing the dependency graph, only create a module out of merge
.
But if you import all of lodash, i.e.:
import _ from 'lodash';
... then you've got all of lodash coming your way.
You can validate the weight of lodash in velocity-react using the bundle-analyzer-tool
:
https://github.com/th0r/webpack-bundle-analyzer
To get Webpack to optimize your lodash build, you need to run a Babel transform:
https://www.npmjs.com/package/babel-plugin-lodash
from velocity-react.
Related Issues (20)
- Conditional rendering inside VelocityTransitionGroup error in 1.4.0 HOT 2
- velocityHelpers is exported with a lowercase starting letter.
- examples
- Can't resolve velocity on create-react-app v2 HOT 5
- Update react-transition-group dep version
- No way to set duration or speed on VelocityTransitionGroup
- TypeError Cannot read property 'length' of null in velocity-component.js (v1.4.1) HOT 5
- Error caused by require TransitionGroup module directly HOT 4
- velocity-animate@^2.0.0 compatibility HOT 1
- next is not a function HOT 1
- slideDown finishes "too early" HOT 1
- Missing typings HOT 2
- Is this project still being developed? HOT 5
- Update react-transition-group HOT 3
- TransitionGroup CJS require not valid HOT 1
- Issue in Webpack production build
- VelocityTransitionGroup throws Strict Mode warnings HOT 3
- How to use sequences?
- TypeError: this.updater.enqueueCallback is not a function
- Upgrading to react 17 gives error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from velocity-react.