-
-
Notifications
You must be signed in to change notification settings - Fork 486
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
fix(transformer/class-properties): run other transforms on static properties, static blocks, and computed keys #7982
Merged
graphite-app
merged 1 commit into
main
from
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
Dec 20, 2024
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Dec 18, 2024
This was referenced Dec 18, 2024
github-actions
bot
added
A-transformer
Area - Transformer / Transpiler
C-cleanup
Category - technical debt or refactoring. Solution not expected to change behavior
labels
Dec 18, 2024
CodSpeed Performance ReportMerging #7982 will degrade performances by 11.28%Comparing Summary
Benchmarks breakdown
|
Dunqing
changed the base branch from
12-17-refactor_transformer_class-properties_store_temp_var_is_created_on_classbindings_
to
graphite-base/7982
December 18, 2024 02:46
Dunqing
force-pushed
the
graphite-base/7982
branch
from
December 18, 2024 03:17
f5ff4c6
to
2e5ffd3
Compare
Dunqing
force-pushed
the
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
branch
from
December 18, 2024 03:17
6f010d0
to
2cf9697
Compare
Dunqing
changed the base branch from
graphite-base/7982
to
12-17-refactor_transformer_class-properties_store_temp_var_is_created_on_classbindings_
December 18, 2024 03:17
Dunqing
force-pushed
the
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
branch
from
December 18, 2024 03:17
2cf9697
to
40b830c
Compare
Base automatically changed from
12-17-refactor_transformer_class-properties_store_temp_var_is_created_on_classbindings_
to
main
December 18, 2024 03:26
overlookmotel
force-pushed
the
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
branch
from
December 18, 2024 16:07
40b830c
to
99dc16b
Compare
overlookmotel
changed the base branch from
main
to
12-18-feat_ast_add_astbulder_move_property_key_
December 18, 2024 16:07
This was referenced Dec 18, 2024
overlookmotel
force-pushed
the
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
branch
from
December 18, 2024 16:51
99dc16b
to
f069dc2
Compare
overlookmotel
changed the base branch from
12-18-feat_ast_add_astbulder_move_property_key_
to
12-18-refactor_transformer_class-properties_do_not_pass_scopeid_into_insert_instance_inits_
December 18, 2024 16:51
overlookmotel
force-pushed
the
12-18-refactor_transformer_class-properties_do_not_pass_scopeid_into_insert_instance_inits_
branch
from
December 18, 2024 16:59
766179d
to
51061df
Compare
overlookmotel
force-pushed
the
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
branch
from
December 18, 2024 16:59
f069dc2
to
63a5e8e
Compare
overlookmotel
force-pushed
the
12-18-refactor_transformer_class-properties_do_not_pass_scopeid_into_insert_instance_inits_
branch
from
December 18, 2024 23:08
51061df
to
2e88a2e
Compare
overlookmotel
force-pushed
the
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
branch
from
December 18, 2024 23:08
ce65a26
to
702569e
Compare
overlookmotel
force-pushed
the
12-18-refactor_transformer_class-properties_do_not_pass_scopeid_into_insert_instance_inits_
branch
from
December 18, 2024 23:11
2e88a2e
to
7c732bd
Compare
overlookmotel
force-pushed
the
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
branch
from
December 18, 2024 23:11
702569e
to
bde1e67
Compare
overlookmotel
force-pushed
the
12-18-refactor_transformer_class-properties_do_not_pass_scopeid_into_insert_instance_inits_
branch
from
December 18, 2024 23:23
7c732bd
to
972fdb1
Compare
overlookmotel
force-pushed
the
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
branch
from
December 18, 2024 23:23
bde1e67
to
18f04ec
Compare
overlookmotel
force-pushed
the
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
branch
from
December 20, 2024 00:15
584af96
to
1c750cf
Compare
overlookmotel
force-pushed
the
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
branch
2 times, most recently
from
December 20, 2024 00:26
a20e7a2
to
0177ee9
Compare
overlookmotel
removed
the
C-cleanup
Category - technical debt or refactoring. Solution not expected to change behavior
label
Dec 20, 2024
overlookmotel
force-pushed
the
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
branch
4 times, most recently
from
December 20, 2024 01:16
a61ee83
to
3913f9f
Compare
overlookmotel
force-pushed
the
12-19-feat_traverse_record_current_block_scope
branch
from
December 20, 2024 03:13
4f684f1
to
2e7b343
Compare
overlookmotel
force-pushed
the
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
branch
from
December 20, 2024 03:13
3913f9f
to
3cb7ed5
Compare
overlookmotel
commented
Dec 20, 2024
Dunqing
force-pushed
the
12-19-feat_traverse_record_current_block_scope
branch
from
December 20, 2024 03:42
2e7b343
to
c1bc867
Compare
Dunqing
force-pushed
the
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
branch
from
December 20, 2024 03:42
3cb7ed5
to
75c91ea
Compare
Dunqing
changed the base branch from
12-19-feat_traverse_record_current_block_scope
to
graphite-base/7982
December 20, 2024 03:50
Dunqing
force-pushed
the
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
branch
from
December 20, 2024 03:59
75c91ea
to
f6aec27
Compare
Dunqing
force-pushed
the
graphite-base/7982
branch
from
December 20, 2024 03:59
c1bc867
to
6b6444b
Compare
Dunqing
force-pushed
the
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
branch
from
December 20, 2024 04:00
f6aec27
to
808956a
Compare
Merge activity
|
…perties, static blocks, and computed keys (#7982) Large re-architecting of class properties transform. Split transform into 3 phases: 1. Transform instance properties when entering class. 2. Transform private fields during traversal of class body. 3. Transform static properties and static blocks when exiting class. This ensures that code which has to be moved outside of the class (static property initializers, static blocks, computed keys) can get transformed by other transforms before they're moved out. Also fixes a problem where we previously registered private properties too early - on entering the class, rather than the class *body*, so private fields in `extends` clause of a nested class were misinterpretted.
Dunqing
force-pushed
the
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
branch
from
December 20, 2024 10:07
808956a
to
273795d
Compare
graphite-app
bot
deleted the
12-18-refactor_transformer_class-properties_transform_class_in_2_phases
branch
December 20, 2024 10:11
Boshen
added a commit
that referenced
this pull request
Dec 21, 2024
## [0.43.0] - 2024-12-21 - de4c772 traverse: [**BREAKING**] Rename `Ancestor::is_via_*` methods to `is_parent_of_*` (#8031) (overlookmotel) - ed75e42 semantic: [**BREAKING**] Make SymbolTable fields `pub(crate)` instead of `pub` (#7999) (Boshen) ### Features - 75b775c allocator: `Vec<u8>::into_string` (#8017) (overlookmotel) - 8547e02 ast: Implement `allocator_api2` for `Allocator` (#8043) (Boshen) - 63a95e4 ast: Add `AstBulder::move_property_key` (#7998) (overlookmotel) - 897a1a8 transformer/class-properties: Exit faster from super replacement visitor (#8028) (overlookmotel) - 3ea4109 transformer/class-properties: Transform super update expressions within static prop initializer (#7997) (Dunqing) - cc57db3 transformer/class-properties: Transform super assignment expressions within static prop initializer (#7991) (Dunqing) - 6b6444b traverse: Record current block scope (#8007) (overlookmotel) ### Bug Fixes - 043252d transformer/class-properties: Replace `this` and class name in static blocks (#8035) (overlookmotel) - 273795d transformer/class-properties: Run other transforms on static properties, static blocks, and computed keys (#7982) (overlookmotel) ### Performance - c0dd3f8 ast: `move_expression` and `move_statement` produce dummy with no span (#7995) (overlookmotel) - 862838f codegen: Remove useless to_owned (#8014) (Dunqing) - 2736657 semantic: Allocate `UnresolvedReferences` in allocator (#8046) (Boshen) - 2e8872c semantic: Allocate child scope in allocator (#8045) (Boshen) - 414e828 semantic: Allocate symbol data in Allocator (#8012) (Boshen) - 7aebed0 semantic: Allocate `Bindings` in allocator (#8021) (Boshen) - 0f9308f transformer/react-refresh: Reduce allocations (#8018) (overlookmotel) - 0deb9e6 transformer/react-refresh: Reserve capacity in hook key string (#8016) (overlookmotel) - 7b70347 transformer/react-refresh: Avoid allocating string in each hook call (#8013) (Dunqing) ### Documentation - df5c341 ast: Improve docs for `AstBuilder::move_*` methods (#7994) (overlookmotel) ### Refactor - f1adf9f semantic: `ScopeTree::rename_binding` remove old binding first (#8020) (overlookmotel) - 02f968d semantic: Change `Bindings` to a plain `FxHashMap` (#8019) (Boshen) - e7476a1 semantic: Remove `serialize` (#8015) (Boshen) - 1cf7b83 semantic: Simplify handling namespace stack (#7987) (Dunqing) - 48cb52b semantic: Remove resetting `current_reference_flags` in visit functions (#7986) (Dunqing) - 3250a47 semantic: Remove unused current_symbol_flags (#7985) (Dunqing) - efe96ec semantic: Use `Stack` for function stack node ids (#7984) (Dunqing) - ac097e9 transformer/class-properties: Rename file (#8036) (overlookmotel) - 059a5dd transformer/class-properties: Do not pass `ScopeId` into `insert_instance_inits` (#8001) (overlookmotel) - 0a38eea transformer/class-properties: Use `temp_var_name_base` to generate temp var names for `super` transform (#8004) (overlookmotel) - d1b7181 transformer/class-properties: Rename var (#8006) (overlookmotel) - 5a23d72 transformer/class-properties: Remove outdated comment (#8000) (overlookmotel) - b3a5f3e transformer/class-properties: Mark `transform_assignment_expression_if_super_member_assignment_target` as inline (#7993) (Dunqing) ### Testing - bcb33c0 semantic: Add a test for catch parameters reference (#7988) (Dunqing) Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
0-merge
Merge with Graphite Merge Queue
A-transformer
Area - Transformer / Transpiler
C-bug
Category - Bug
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Large re-architecting of class properties transform. Split transform into 3 phases:
This ensures that code which has to be moved outside of the class (static property initializers, static blocks, computed keys) can get transformed by other transforms before they're moved out.
Also fixes a problem where we previously registered private properties too early - on entering the class, rather than the class body, so private fields in
extends
clause of a nested class were misinterpretted.