Skip to content

Conversation

overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 11, 2025

Add a failing test for using transform where exported class has a reference to itself within the class body, and the external class binding is mutated.

This is something of an edge case, but it'd be ideal to handle it correctly.

Babel has the same bug: babel/babel#17172

Copy link
Member Author

overlookmotel commented Mar 11, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good find! - out of interest, how did you notices this issue, was it just from reading code, or testing or something else?

@camc314 camc314 force-pushed the 03-11-refactor_transformer_using_rename_vars branch from 890413f to 9743ebb Compare March 11, 2025 09:45
@camc314 camc314 requested a review from Dunqing as a code owner March 11, 2025 09:46
@camc314 camc314 force-pushed the 03-11-test_transformer_using_failing_test_for_class_name branch from 24ebeb0 to e136646 Compare March 11, 2025 09:50
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Mar 11, 2025
Copy link
Contributor

graphite-app bot commented Mar 11, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 03-11-refactor_transformer_using_rename_vars branch from 9743ebb to acac461 Compare March 11, 2025 10:16
graphite-app bot pushed a commit that referenced this pull request Mar 11, 2025
Add a failing test for `using` transform where exported class has a reference to itself within the class body, and the external class binding is mutated.

This is something of an edge case, but it'd be ideal to handle it correctly.

Babel has the same bug: babel/babel#17172
@graphite-app graphite-app bot force-pushed the 03-11-test_transformer_using_failing_test_for_class_name branch from e136646 to 4cee555 Compare March 11, 2025 10:16
@overlookmotel
Copy link
Member Author

overlookmotel commented Mar 11, 2025

good find! - out of interest, how did you notices this issue, was it just from reading code, or testing or something else?

Reading the code. But I'm familiar with these edge cases from working on the class properties transform.

We've found during past months on transformer that Babel's test cases often don't cover as much as you'd like. Sometimes there are bugs in edge cases which are rare in practice, so no-one has noticed. But also some things are really simple to do in JS, so Babel probably didn't see the need to add tests for things which are obvious - but they're not nearly as simple or obvious in Rust. So we've had to add quite a lot of extra tests on some transforms.

@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 11, 2025
@graphite-app graphite-app bot force-pushed the 03-11-refactor_transformer_using_rename_vars branch from acac461 to 26499ec Compare March 11, 2025 10:43
@graphite-app graphite-app bot force-pushed the 03-11-test_transformer_using_failing_test_for_class_name branch from 4cee555 to 76df73e Compare March 11, 2025 10:44
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Mar 11, 2025
Add a failing test for `using` transform where exported class has a reference to itself within the class body, and the external class binding is mutated.

This is something of an edge case, but it'd be ideal to handle it correctly.

Babel has the same bug: babel/babel#17172
@graphite-app graphite-app bot force-pushed the 03-11-refactor_transformer_using_rename_vars branch from 26499ec to 664c6f8 Compare March 11, 2025 12:13
@graphite-app graphite-app bot force-pushed the 03-11-test_transformer_using_failing_test_for_class_name branch from 76df73e to 4dc32db Compare March 11, 2025 12:14
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 11, 2025
Base automatically changed from 03-11-refactor_transformer_using_rename_vars to main March 11, 2025 12:36
@graphite-app graphite-app bot merged commit 4dc32db into main Mar 11, 2025
17 checks passed
@graphite-app graphite-app bot deleted the 03-11-test_transformer_using_failing_test_for_class_name branch March 11, 2025 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-transformer Area - Transformer / Transpiler C-test Category - Testing. Code is missing test cases, or a PR is adding them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants