Comments (6)
I'll start seeing how we can refactor from top-down. For compatibility and not-reinventing-the-wheel reasons, I'd like to probably keep these:
isEqual
(unless we find a smaller implementation)get
(for its path support)toPath
We can probably find a simpler implementation of mapValues
since it's only used internally, and not in the public API.
I'll take a look at what else (besides lodash) can be contributing to the size that we can probably shrink down.
Thanks for taking a look at this!
from react-redux-form.
I added a simple remake of mapValues that follows the current usage of it.
https://github.com/chrisblossom/react-redux-form/tree/feature/bundle_size
from react-redux-form.
Other lodash modules must share the same functions that are being used with mapValues.
Before:
Info: main.js 291.89 kB (~82.07 kB gzipped)
lodash: 127.35 KB (12.1%)
react-redux-form: 35.47 KB (3.38%)
mapValues feature/bundle_size
Info: main.js 291.25 kB (~81.65 kB gzipped)
lodash: 124.01 KB (11.8%)
react-redux-form: 35.59 KB (3.40%)
from react-redux-form.
I've used https://github.com/substack/node-deep-equal instead of lodash's isEqual and it is fairly small (but not sure if it is smaller than the lodash implementation)
from react-redux-form.
Webpack v2 will include tree shaking and only bundle the lodash functions you really used :-)
https://medium.com/modus-create-front-end-development/webpack-2-tree-shaking-configuration-9f1de90f3233
from react-redux-form.
@acidicX Yes, that'll be really helpful, though I anticipate many developers will still be using Webpack 1.
I am actively working on reducing the bundle size in V1, and you can check out the current work in the v1
branch.
from react-redux-form.
Related Issues (20)
- `retouched` is not set to true if user changes fields while `pending==true`
- FieldArray getAll method returns undefined
- Library broken when update to react-redux >= 6.0.0.
- forms-reducer contains trailing comma after rest property, preventing transpiling for Jest HOT 1
- Adding examples of how to test the form with jest
- Question: Access LocalForm State
- Cutom Controls with react-redux
- Trigger validations manually
- allow nested thunk actions in LocalForm
- react-redux-form performance is slow when redux store is large HOT 1
- question: Form-level vals validator trigger error message
- TypeError: Cannot read property 'length' of undefined HOT 1
- Warning: componentWillReceiveProps has been renamed HOT 2
- 'react-redux-form'- element loosing focus after everytime I type a character HOT 2
- $form.valid is false when async error appears on any form field
- react-redux-form - access form values inside another component HOT 1
- Using valid and invalid attributes from reactstrap Input component with Control component in form validation
- Control.radio default check in localform
- Imported JSX component text must be in PascalCase or SCREAMING_SNAKE_CASE HOT 2
- Rename lifecycle methods for React v. 17+
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 react-redux-form.