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

Rename ES2018/ES2019 plugins (proposal -> transform) #9106

Closed
wants to merge 7 commits into from

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Nov 30, 2018

Q                       A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

This is quite annoying to do, hopefully it needs to be done only once per year 😆 Follows up to #8448.

  • The first commit is just a find-replace of strings, only subsequent commits need to be reviewed.
  • Is 0116876 breaking? I don't think so, but I can revert it. Yes, it is for preset-env. I removed that commit.
  • This is probably the first time I modified preset-env. Do I need to regenerate other files?
  • Should I add the ES2018 and ES2019 presets to Babel standalone, so that they can be used in the repl?
  • TODO: Add the removed plugins to https://github.com/babel/babel-archive/tree/master/packages
  • TODO: Deprecate the -(syntax|proposal)- packages on npm?

I replaced the following regex:
    proposal-(object-rest-spread|async-generator-functions|optional-catch-binding|json-strings,unicode-property-regex)
with
    transform-$1

I excluded the following files from the replacement:
    babel.config.js, CHANGELOG.md, CONTRIBUTING.md,
    missing-plugin-helper.js, yarn.lock, babel-standalone/,
    babel-preset-env-standalone/, babel-preset-env/

I will update babel-standalone and preset-env later
Note: old blugins can't be removed, it would be a breaking change
@@ -2,7 +2,7 @@ import { availablePlugins, registerPlugin } from "@babel/standalone";

const notIncludedPlugins = {
"transform-new-target": require("@babel/plugin-transform-new-target"),
"proposal-json-strings": require("@babel/plugin-proposal-json-strings"),
"transform-json-strings": require("@babel/plugin-transform-json-strings"),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@existentialism What is this object for?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a mapping of packages not included in babel-standalone.

@babel-bot
Copy link
Collaborator

babel-bot commented Nov 30, 2018

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

@babel-bot
Copy link
Collaborator

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

@hzoo
Copy link
Member

hzoo commented Nov 30, 2018

Thanks for adding the PR although.. so I feel like it's not worth changing the name and going through all this, as once it's standardized you shouldn't need to use the individual plugins alone and rely on preset-env anyway?

@nicolo-ribaudo
Copy link
Member Author

nicolo-ribaudo commented Nov 30, 2018

I mainly did it for consistency, I didn't have a strong reason.

@loganfsmyth
Copy link
Member

Hmm, idk, I support the proposal- prefix as an indication to users that something was not standardized proposal. If we're not going to rename things, we should go back to transform- for everything.

@nicolo-ribaudo nicolo-ribaudo deleted the rename-plugins branch February 14, 2019 21:20
@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: Polish 💅 A type of pull request used for our changelog categories Spec: Async Generators Spec: Object Rest/Spread Spec: Optional Catch Binding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants