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

7.24.0 fields & decorators improvement #16252

Merged
merged 23 commits into from Feb 27, 2024
Merged

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Jan 31, 2024

This umbrella PR tracks decorators improvement progress

Needs Docs

Fixes: #16257
Fixes: #16292

⚠️ Use the "Rebase and merge" button!

@JLHwung JLHwung added this to the v7.24.0 milestone Jan 31, 2024
@JLHwung
Copy link
Contributor Author

JLHwung commented Feb 14, 2024

The feature branch is now rebased to include the quality-of-life change #16278.

@nicolo-ribaudo nicolo-ribaudo changed the title 7.24.0 decorators improvement 7.24.0 fields & decorators improvement Feb 14, 2024
@nicolo-ribaudo
Copy link
Member

Rebased

@babel-bot
Copy link
Collaborator

babel-bot commented Feb 27, 2024

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

JLHwung and others added 20 commits February 27, 2024 21:44
* copy test cases from 2023-05

* update 2023-11 test options

* copy applyDecs2305 to applyDecs2311

* allow 2023-11 decorator version

* feat: support per-field intitializers

* update test fixtures

OVERWRITE=1 yarn jest decorators -t "2023 11"

* update generated helpers

* update other class tests

* expand field-initializers-after-methods case

* Add failing private flavour test

* update pipeline operator tests

* Don't run Babel 8 test with 2023-05 decorator

* add release todo item
* refactor: reuse staticFieldInitializerAssignments

* refactor: rename fieldInitializerAssignments to expressions

* test: expand replacement-static-installed-on-correct-class case

* chore: maybePrivateBrandName typo

* wrap version "2023-05" check within Babel 7 branch
Co-authored-by: Nicolò Ribaudo <hello@nicr.dev>
* Do not define `ctx.access.set` for setter decorators

* chore

---------

Co-authored-by: Babel Bot <30521560+liuxingbaoyu@users.noreply.github.com>
* fix: handle symbol key class elements decoration

* update generated helpers

* Expand test cases
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* optimize: allocate temp variable for every decorated element

* update test fixtures

* refactor: sort decorator info once

* refactor: simplify maybeExtractDecorators interface

Also improve decoratorThis storage. It turns out we don't have to maintain the map from decorator to its this value.

* refactor: rename maybeExtractDecorators to handleDecoratorExpressions

* unify haveThis and hasThis
* Add failing test

* Fix evaluation order of decorators with cached receiver

* Use one temp var per decorated element

* Use one temp var per class
* improve

* fix new test

* fix test

* add test

* Apply suggestions from code review

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>

* lint

---------

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
nicolo-ribaudo and others added 2 commits February 27, 2024 21:44
* fix arguments

* Update packages/babel-plugin-transform-private-methods/test/fixtures/accessors/arguments/exec.js

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>

* review

* fix types

---------

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
@nicolo-ribaudo nicolo-ribaudo merged commit 1a030ad into main Feb 27, 2024
82 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the feat-7.24.0/decorators branch February 27, 2024 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants