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

WIP: explain babel process of adding a plugin/proposal #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -466,3 +466,17 @@ Babel will accept any PR for a proposal that is intended to go through the TC39
It's our intention (and one of our main goals) as a project to help TC39 get feedback from the community through using the new syntax in their codebases. There is however a balance between supporting new proposals and informing users that any proposal is still just a proposal and subject to change. In order to move the community forward, we will continously make changes to adhere to the spec as patches. If bigger changes require a major version, we will deprecate older versions of plugins, document those changes, and see if we can automate the upgrade via a codemod. This way everyone is moving towards Stage 4 and closer to what will be in the spec if the proposal makes it to the end.

This means we will also include proposals in this repo that haven't been presented to the committee yet if they are concrete enough and someone on TC39 is planning on presenting it (and marked appropriately).

### What's the process?

- Find a TC39 Champion

Choose a reason for hiding this comment

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

Maybe the wording here could be made more specific, e.g.,

"Either choose a proposal which has been presented at TC39 or will be presented soon, or convince a TC39 member to champion a new proposal."

- Create an issue in this repo to point to the proposal repo (e.g. https://github.com/babel/proposals/issues/7)
- Purpose is to track everything about this proposal: champion, spec link, stage, examples, possible implementation strategies, history/progress. Plan to update as things happen so people can follow along.
- Create a Slack channel for discussion like `#proposal-xyz` (e.g. `#proposal-class-fields`)
- Create a PR to Babylon for parser support: https://github.com/babel/babylon/blob/master/CONTRIBUTING.md#creating-a-new-plugin-spec-new
- May need to create a new plugin if the spec changes significantly (e.g. `decorators` and `decorators2`
- Create a PR to Babel https://github.com/babel/babel/wiki/Adding-a-new-Proposal-to-Babel
- In the future: name the package `babel-plugin-proposal-` instead of `babel-plugin-transform-`
- Rename to `babel-plugin-transform-year-x` once Stage 4.
- Proposals should be versioned independently because we know that they inherently will change so we want to allow for breaking changes, changelog, codemods, and easy upgrade path (deprecate old versions, bump stage presets).
- Add to a Stage preset if necessary