-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
feat(transformer): class properties transform #7011
feat(transformer): class properties transform #7011
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
0eb3ad7
to
906e8fd
Compare
CodSpeed Performance ReportMerging #7011 will degrade performances by 19.21%Comparing Summary
Benchmarks breakdown
|
7b2ad83
to
1f4eef9
Compare
366cc8f
to
65400df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too much fixtures committed to this repo, let me think about #4048
96a98ba
to
2a57a66
Compare
5663771
to
0c69972
Compare
0c69972
to
3970e03
Compare
Yes, I hope there's a better solution. I just wanted some working tests while I'm building the transform. |
Skeleton of class properties transform. #7011 contains WIP implementation.
c71dda8
to
78b7bed
Compare
7f0dd2c
to
eeeccba
Compare
3629c39
to
139ac62
Compare
3d4a890
to
8d1ea70
Compare
139ac62
to
c986cf7
Compare
8d1ea70
to
b4c5bea
Compare
303e42d
to
11d7479
Compare
b4c5bea
to
8248e29
Compare
84b9b88
to
7a52127
Compare
7a52127
to
f8bcbcc
Compare
8248e29
to
2c34991
Compare
f8bcbcc
to
5247d52
Compare
2c34991
to
25f2a20
Compare
5247d52
to
1fdf61f
Compare
Merge activity
|
Add class properties transform. Implementation is incomplete. Notable missing parts: * Scopes are not updated where property initializers move from class body into class constructor / `_super` function. * Does not handle binding shadowing problems when property initializers move from class body into class constructor. * `this` and references to class name in static property initializers need to be transformed to point to a temp var. * Not all usages of private properties are supported (see below). * Code which is moved to outside of class body is not transformed by other transforms for class declarations (works OK for class expressions). This includes static property initializers, static blocks, and computed property/method keys. * Only basic checks for whether computed property/method keys may have side effects. * Numerous other small issues noted in TODO comments through the code. ### Private properties Currently does not handle the following usages of private properties: ```js class Class { #prop; static #static; method() { object?.#prop; object?.#prop(); [object.#prop] = [1]; ({x: object.#prop} = {x: 1}); object.#prop`xyz`; object?.#static; object?.#static(); [object.#static] = [1]; ({x: object.#static} = {x: 1}); object.#static`xyz`; } } ```
25f2a20
to
3b2a347
Compare
1fdf61f
to
9778298
Compare
Add class properties transform.
Implementation is incomplete. Notable missing parts:
_super
function.this
and references to class name in static property initializers need to be transformed to point to a temp var.Private properties
Currently does not handle the following usages of private properties: