Skip to content

[babel 8] Remove support for the 2018-09 decorators proposal#12712

Merged
nicolo-ribaudo merged 10 commits intobabel:mainfrom
nicolo-ribaudo:breaking/remove-decorators
Jun 26, 2022
Merged

[babel 8] Remove support for the 2018-09 decorators proposal#12712
nicolo-ribaudo merged 10 commits intobabel:mainfrom
nicolo-ribaudo:breaking/remove-decorators

Conversation

@nicolo-ribaudo
Copy link
Copy Markdown
Member

@nicolo-ribaudo nicolo-ribaudo commented Jan 29, 2021

Q                       A
Fixed Issues? Closes #8750, closes #9454, closes #9220, closes #9602, closes #9999, closes #12591
Patch: Bug Fix?
Major: Breaking Change? Yes, behind the BABEL_8_BREAKING flag
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link babel/website#2765
Any Dependency Changes?
License MIT

This PR completely removes support for the second decorators proposal (the one with the big runtime code).

  1. We never fully supported the proposal (decorated private elements were left as a todo)
  2. That proposal version has been dropped on 2019-03-15, which is almost two years ago (tc39/proposal-decorators@a043d4b)
  3. After that version (which was the second) there have been other two versions

I'm not removing support for legacy decorators because many JS libraries depend on them.

Please review this PR with whitespace diff disabled, since different parts have been indented one level more (because of the if (BABEL_8_BREAKING) { statements).

@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Jan 29, 2021

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

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented Jan 29, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit faf85ff:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration
babel-repl-custom-plugin Issue #12591

Copy link
Copy Markdown
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

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

We should also remove decoratorsBeforeExport from @babel/standalone.

EDIT by @nicolo-ribaudo: the new proposal version still supports this option

@nicolo-ribaudo nicolo-ribaudo force-pushed the breaking/remove-decorators branch from 1d99d03 to cd4d22d Compare February 11, 2021 23:28
@nicolo-ribaudo nicolo-ribaudo force-pushed the breaking/remove-decorators branch from fa70f22 to 8093d87 Compare March 3, 2021 23:10
@nicolo-ribaudo nicolo-ribaudo force-pushed the breaking/remove-decorators branch 2 times, most recently from 940e6de to 70963b0 Compare June 19, 2021 01:05
@nicolo-ribaudo nicolo-ribaudo force-pushed the breaking/remove-decorators branch from 70963b0 to faf85ff Compare June 23, 2021 23:55
@mbrowne
Copy link
Copy Markdown

mbrowne commented Jul 18, 2021

Just curious, when will work begin on an implementation of the latest decorators proposal? Or is it still not stable enough yet to be worth doing that at this point?

@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

I'm in contact with the proposal authors, and it looks like it's becoming stable enough that we can implement it in the next months.

@wvq
Copy link
Copy Markdown

wvq commented Jan 2, 2022

For now, Is there any progress on stage 2 ?

@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

We are working on it at #14004

@nicolo-ribaudo nicolo-ribaudo force-pushed the breaking/remove-decorators branch from faf85ff to 7b7fd25 Compare February 13, 2022 20:08
@nicolo-ribaudo nicolo-ribaudo changed the title [babel 8] Remove support for the second decorators proposal [babel 8] Remove support for the 2018-09 decorators proposal Feb 13, 2022
@nicolo-ribaudo nicolo-ribaudo force-pushed the breaking/remove-decorators branch 2 times, most recently from 04d0c3a to 083c58a Compare February 15, 2022 22:58
@nicolo-ribaudo nicolo-ribaudo force-pushed the breaking/remove-decorators branch from 53c7543 to b4c6551 Compare February 21, 2022 23:04
@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

The CI failure looks valid, I'll investigate.

@nicolo-ribaudo nicolo-ribaudo force-pushed the breaking/remove-decorators branch from b4c6551 to 2cca925 Compare March 24, 2022 17:17
@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

CI failure fixed!

@nicolo-ribaudo nicolo-ribaudo mentioned this pull request Mar 25, 2022
34 tasks
@nicolo-ribaudo nicolo-ribaudo requested a review from JLHwung April 13, 2022 21:27
@nicolo-ribaudo nicolo-ribaudo force-pushed the breaking/remove-decorators branch from 17e1e3b to 54dd997 Compare May 26, 2022 16:33
@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

Rebased, this is ready for review!

@nicolo-ribaudo nicolo-ribaudo force-pushed the breaking/remove-decorators branch 2 times, most recently from 68c71a5 to f849a44 Compare June 5, 2022 17:50
@nicolo-ribaudo nicolo-ribaudo force-pushed the breaking/remove-decorators branch from f849a44 to 112c49f Compare June 11, 2022 14:41
@nicolo-ribaudo nicolo-ribaudo force-pushed the breaking/remove-decorators branch from 112c49f to 220e638 Compare June 24, 2022 16:52
@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

Rebased again

" requires a 'decoratorsBeforeExport' option, whose value must be a boolean.",
);
if (version === "2021-12") {
decoratorsBeforeExport = false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does it mean we can remove the decoratorsBeforeExport generator option in Babel 8?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This PR still keeps the decoratorsBeforeExport option but makes it default to false, I think I can just remove it given the proposal is now stage 3.

@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

@JLHwung I removed decoratorsBeforeExport from the plugin and from generator. I didn't remove it in the parser yet because I first want to make it optional in Babel 7 (so that I don't have to duplicate all the tests between Babel 7 and Babel 8), but it needs to wait for the next minor.

@nicolo-ribaudo nicolo-ribaudo force-pushed the breaking/remove-decorators branch from 7be1083 to 197415b Compare June 25, 2022 10:33
@nicolo-ribaudo nicolo-ribaudo force-pushed the breaking/remove-decorators branch from 197415b to b847696 Compare June 25, 2022 15:43
@nicolo-ribaudo nicolo-ribaudo merged commit a7c438c into babel:main Jun 26, 2022
@nicolo-ribaudo nicolo-ribaudo deleted the breaking/remove-decorators branch June 26, 2022 09:25
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Sep 26, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2022
@JLHwung JLHwung added PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release and removed babel 8 labels Aug 8, 2023
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: Breaking Change 💥 A type of pull request used for our changelog categories for next major release Spec: Decorators

Projects

None yet

6 participants