Thanks to visit codestin.com
Credit goes to github.com

Skip to content

7.24.0 fields & decorators improvement#16252

Merged
nicolo-ribaudo merged 23 commits into
mainfrom
feat-7.24.0/decorators
Feb 27, 2024
Merged

7.24.0 fields & decorators improvement#16252
nicolo-ribaudo merged 23 commits into
mainfrom
feat-7.24.0/decorators

Conversation

@JLHwung
Copy link
Copy Markdown
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 JLHwung force-pushed the feat-7.24.0/decorators branch from e9fd071 to ff2288d Compare February 14, 2024 15:07
@JLHwung
Copy link
Copy Markdown
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
Copy Markdown
Member

Rebased

@babel-bot
Copy link
Copy Markdown
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
* Do not define `ctx.access.set` for setter decorators

* chore

---------

Co-authored-by: Babel Bot <[email protected]>
* fix: handle symbol key class elements decoration

* update generated helpers

* Expand test cases
Co-authored-by: Nicolò Ribaudo <[email protected]>
* 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 <[email protected]>

* lint

---------

Co-authored-by: Nicolò Ribaudo <[email protected]>
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 <[email protected]>

* review

* fix types

---------

Co-authored-by: Nicolò Ribaudo <[email protected]>
@nicolo-ribaudo nicolo-ribaudo merged commit 1a030ad into main Feb 27, 2024
@nicolo-ribaudo nicolo-ribaudo deleted the feat-7.24.0/decorators branch February 27, 2024 20:57
@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 May 29, 2024
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 29, 2024
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 umbrella ☂️

Projects

None yet

4 participants