Comments (5)
I think there's no reason for us to compile the legacy bundle in development, so build time increase should not be an issue.
The main thing I'm gathering from these discussions is that applying babel-loader
to the entire node_modules
might not be safe, which I would agree.
We will only need to apply it to @gandi
scoped packages, over which we have control.
from babel-preset-gandi.
This could be easily done in our Apps webpack config. Just add that plugin for the production build.
But I'm afraid the size gain might be negligible.
Especially if we envision that they should progressively be removed anyway. (Flow, new context API).
For libs it's not really worst it.
node_modules
are excluded from the babel-loader
(for good reasons I guess).
So if we add it here, there won't be proptypes for dev, which is the main goal of proptypes.
As for libs shipping a dev and prod versions that feels like a lot of complexity ahead for again small gains.
To me the most significant size gain we can have are:
- React 16
- Webpack 4
- Babel 7 (smaller produced code)
- ESM everywhere
- Maybe Rollup (at least on large libs like ui) (already tested here)
- https://github.com/GoogleChromeLabs/webpack-libs-optimizations
- ...
from babel-preset-gandi.
Yeah, I forgot about our libs...
But, about:
node_modules are excluded from the babel-loader (for good reasons I guess).
If we move forward with #5
Then we will apply babel-loader to all our internal libraries in our bundles compilation.
So applying this plugin only in bundle compilation will result in propTypes being stripped:
- from the app code
- from our libraries code
So we can use this plugin in our webpack config today, and it'll be ~really worth it the day we tackle #5
Thanks for sharing your insights, we definitely to get on these
from babel-preset-gandi.
Then we will apply babel-loader to all our internal libraries in our bundles compilation.
I'm concerned about build time, especially in dev, but everything's open.
Food for thoughts:
facebook/create-react-app#1125
gatsbyjs/gatsby#2114
from babel-preset-gandi.
Closing this as no longer relevant.
We are applying babel-plugin-transform-react-remove-prop-types
on a limited set of node_modules packages, during the production client-side bundle compilation, with little gains.
from babel-preset-gandi.
Related Issues (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 babel-preset-gandi.