Skip to content

[WIP] Add support for decorators with private properties#8248

Closed
nicolo-ribaudo wants to merge 34 commits intobabel:masterfrom
nicolo-ribaudo:decorators-private-properties
Closed

[WIP] Add support for decorators with private properties#8248
nicolo-ribaudo wants to merge 34 commits intobabel:masterfrom
nicolo-ribaudo:decorators-private-properties

Conversation

@nicolo-ribaudo
Copy link
Copy Markdown
Member

@nicolo-ribaudo nicolo-ribaudo commented Jul 1, 2018

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

I opened this PR before getting the other one merged because I wanted to test what decorated private fields are capable of in the repl 😝

Example: repl

As usual, I will slit this PR in multiple smaller ones. This is mainly to show how things work together and how @babel/plugin-proposal-enhanced-classes (from #8130) is useful.

Depends on #7976 and #8130 (many commits in this PR are actually from those PRs).

@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Jul 1, 2018

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

@nicolo-ribaudo nicolo-ribaudo force-pushed the decorators-private-properties branch from 458857c to ef8de88 Compare July 11, 2018 22:36
@littledan
Copy link
Copy Markdown

Great work! You might want to change the repl link in the description above to point to the newer build at https://babeljs.io/repl/build/8593/ .

This has a few advantages:
1) GitHub highlights the helper code, making it easier to review
2) ESLint <3 (it caught an undeclared variable)
I also added flow types to help understanding what the functions do.

Thanks @Kovensky for the idea!
NOTE: This doesn't work for decorators inside the class body, like in
      babel#8300
@nicolo-ribaudo nicolo-ribaudo force-pushed the decorators-private-properties branch from ef8de88 to 3f703ad Compare July 28, 2018 07:22
@nicolo-ribaudo nicolo-ribaudo mentioned this pull request Nov 8, 2018
5 tasks
@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

nicolo-ribaudo commented Dec 9, 2018

This PR is too outdated, I will open a new one

@nicolo-ribaudo nicolo-ribaudo deleted the decorators-private-properties branch December 9, 2018 11:28
@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 Priority: Low Spec: Decorators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants