Giter Site home page Giter Site logo

Comments (7)

oliviertassinari avatar oliviertassinari commented on May 24, 2024

Is it removing both versions of PropTypes?

What are the two versions?

From what I understand its also working by default for whole node_modules.

It' working on your whole Babel setup. If you let babel traverse the node_modules, this plugin will too. Noticed that most people only let babel traverse their source code.

what exactly is stopping this transform to work?

I don't understand, nothing is supposed to stop that transform to work.

from babel-plugin-transform-react-remove-prop-types.

Andarist avatar Andarist commented on May 24, 2024

What are the two versions?

I mean those imported from prop-types package and those imported from react.

It' working on your whole Babel setup. If you let babel traverse the node_modules, this plugin will too. Noticed that most people only let babel traverse their source code.

Would be cool then if we can have include option here in this package to overwrite global setting.

I don't understand, nothing is supposed to stop that transform to work.

skip this one for now, its probably my fault as i exclude node_modules in my babel transform

from babel-plugin-transform-react-remove-prop-types.

oliviertassinari avatar oliviertassinari commented on May 24, 2024

I mean those imported from prop-types package and those imported from react.

We don't touch that for now by default. You can try the removeImport option out. react. is a deprecated pattern, we don't handle it.

Would be cool then if we can have include option here in this package to overwrite global setting.

I guess you are referring to the include option of babel-loader, not the same story here. You can ignore the node_modules with that option: https://github.com/oliviertassinari/babel-plugin-transform-react-remove-prop-types#ignorefilenames.

All of that should be in the README. If something isn't clear. Feel free to improve it πŸ˜„ .

from babel-plugin-transform-react-remove-prop-types.

Andarist avatar Andarist commented on May 24, 2024

We don't touch that for now by default. You can try the removeImport option out. react. is a deprecated pattern, we don't handle it.

Ok, hopefully libraries will catch up soon with the change. Ive already setup removeImport :)

I guess you are referring to the include option of babel-loader, not the same story here. You can ignore the node_modules with that option: https://github.com/oliviertassinari/babel-plugin-transform-react-remove-prop-types#ignorefilenames.

I had in mind rather reversed scenario. I dont want to run any babel transformations on libraries code, except this one. So I would need something like includeFilenames

from babel-plugin-transform-react-remove-prop-types.

oliviertassinari avatar oliviertassinari commented on May 24, 2024

I had in mind rather reversed scenario. I dont want to run any babel transformations on libraries code, except this one.

I don't see how an includeFilenames option would be of any help. Babel plugins are not supposed to choose which files to parse. It's supposed to be on userland. This ignoreFilenames option is already an exception. You can run this only plugin programmatically with the Babel API (see the tests for instance). I don't see any better option.

from babel-plugin-transform-react-remove-prop-types.

Andarist avatar Andarist commented on May 24, 2024

from babel-plugin-transform-react-remove-prop-types.

oliviertassinari avatar oliviertassinari commented on May 24, 2024

@Andarist Well, we would accept a PR for that. But in order to work, you need to configure Babel to traverse that file.

from babel-plugin-transform-react-remove-prop-types.

Related Issues (20)

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.