Giter Club home page Giter Club logo

Comments (5)

ziir avatar ziir commented on September 18, 2024 1

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.

pascalduez avatar pascalduez commented on September 18, 2024

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:

from babel-preset-gandi.

ziir avatar ziir commented on September 18, 2024

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.

pascalduez avatar pascalduez commented on September 18, 2024

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.

ziir avatar ziir commented on September 18, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.