Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove direct options to @babel/plugin-class-features #9050

Conversation

nicolo-ribaudo
Copy link
Member

Q                       A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change? ⚠️ We should merge this before the next release
Minor: New Feature?
Tests Added + Pass?
Documentation PR Link
Any Dependency Changes?
License MIT

This PR removes the ability of using the class-features plugin like this:

{
  "plugins": [
    ["@babel/plugin-class-features", { "decorators": true }]
  ]
}

Since it could cause problems because it behaves differently from how other plugins behave (see #8130 (comment)).
With this PR only the old packages (@babel/plugin-proposal-class-properties, etc) can be used to configure @babel/plugin-class-features.

@nicolo-ribaudo nicolo-ribaudo added the PR: Internal 🏠 A type of pull request used for our changelog categories label Nov 20, 2018
@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/9417/

@Andarist
Copy link
Member

What's going to happen when somebody is going to use this plugin directly? As in:

{
  "plugins": [
    "@babel/plugin-class-features"
  ]
}

@nicolo-ribaudo
Copy link
Member Author

It is a noop. I could throw if you prefer, but I don't think that it is needed.

@Andarist
Copy link
Member

IMHO would be good to throw or at least warn the user - somebody mind find this plugin and try to use it manually and be surprised that it's not working.

@nicolo-ribaudo nicolo-ribaudo added this to In progress in Class features Nov 21, 2018
@andrewmiller1
Copy link

It's pretty straightforward to declare what class features you want using plugin-class-features. Why not make this the new way of doing it? I just spent an hour trying to figure out how to do it the "old way" and now I have to give up. Can't see what options could even map to this using what existed before (it had been confusing before anyway). Just a random user's two cents

@nicolo-ribaudo
Copy link
Member Author

Before that @babel/plugin-class-features you had a configuration similar to this:

{
  plugins: [
    "@babel/plugin-proposal-private-properties",
    "@babel/plugin-proposal-decorators"
  ]
}

Now you should have the same identical config:

{
  plugins: [
    "@babel/plugin-proposal-private-properties",
    "@babel/plugin-proposal-decorators"
  ]
}

The two plugins internally use @babel/plugin-class-features, but you shouldn't care since it is an implementation detail.

@nicolo-ribaudo
Copy link
Member Author

@babel/babel If it won't be possible to use this plugin directly, I think that its exisence only creates confusion. WDYT about renaming it to @babel/helper-transform-class-features?

@nicolo-ribaudo
Copy link
Member Author

Closing, #9083 is better

Class features automation moved this from In progress to Discarded Nov 29, 2018
@nicolo-ribaudo nicolo-ribaudo deleted the disallowed-class-features-direct-usage branch November 29, 2018 14:40
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Internal 🏠 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants