Skip to content

feat(transformer): add StatementInjectorStore::move_insertions method#9951

Merged
graphite-app[bot] merged 1 commit intomainfrom
03-21-feat_transformer_add_statementinjectorstore_move_insertions_method
Mar 21, 2025
Merged

feat(transformer): add StatementInjectorStore::move_insertions method#9951
graphite-app[bot] merged 1 commit intomainfrom
03-21-feat_transformer_add_statementinjectorstore_move_insertions_method

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 21, 2025

Introduce a new method on StatementInjectorStore to move any injections attached to one statement to another statement. This is used in #9952.

@github-actions github-actions bot added the A-transformer Area - Transformer / Transpiler label Mar 21, 2025
Copy link
Member Author

overlookmotel commented Mar 21, 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.

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 21, 2025

CodSpeed Instrumentation Performance Report

Merging #9951 will create unknown performance changes

Comparing 03-21-feat_transformer_add_statementinjectorstore_move_insertions_method (af78acb) with main (ffd4d13)

Summary

🆕 33 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 codegen[checker.ts] N/A 22.6 ms N/A
🆕 codegen_sourcemap[checker.ts] N/A 65.7 ms N/A
🆕 isolated-declarations[vue-id.ts] N/A 58.3 ms N/A
🆕 lexer[RadixUIAdoptionSection.jsx] N/A 21.4 µs N/A
🆕 lexer[antd.js] N/A 24.8 ms N/A
🆕 lexer[cal.com.tsx] N/A 5.9 ms N/A
🆕 lexer[checker.ts] N/A 14.8 ms N/A
🆕 lexer[pdf.mjs] N/A 3.9 ms N/A
🆕 linter[RadixUIAdoptionSection.jsx] N/A 2.7 ms N/A
🆕 linter[cal.com.tsx] N/A 1.2 s N/A
🆕 linter[checker.ts] N/A 3 s N/A
🆕 mangler[antd.js] N/A 15.8 ms N/A
🆕 mangler[react.development.js] N/A 291 µs N/A
🆕 mangler[typescript.js] N/A 39.2 ms N/A
🆕 minifier[antd.js] N/A 165.2 ms N/A
🆕 minifier[react.development.js] N/A 1.8 ms N/A
🆕 minifier[typescript.js] N/A 290.9 ms N/A
🆕 estree[checker.ts] N/A 96.1 ms N/A
🆕 parser[RadixUIAdoptionSection.jsx] N/A 92.4 µs N/A
🆕 parser[antd.js] N/A 113.3 ms N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Copy link
Member

@Dunqing Dunqing left a comment

Choose a reason for hiding this comment

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

This is what I was thinking about API!

@overlookmotel overlookmotel marked this pull request as draft March 21, 2025 12:29
@overlookmotel overlookmotel marked this pull request as ready for review March 21, 2025 12:44
@overlookmotel
Copy link
Member Author

overlookmotel commented Mar 21, 2025

I'm not sure if this is the best way or not. But... it works!

If we're going with this, I guess we should probably go through all the other transforms and insert a call to move_insertions whenever you replace a Statement with another Statement. There are probably other bugs like #9171 lurking, but we just haven't found them yet.

@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Mar 21, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Mar 21, 2025

Merge activity

…od (#9951)

Introduce a new method on `StatementInjectorStore` to move any injections attached to one statement to another statement. This is used in #9952.
@graphite-app graphite-app bot force-pushed the 03-21-refactor_transformer_decorator_rename_enter_statement_to_exit_statement_ branch from 0fe2d0c to ffd4d13 Compare March 21, 2025 14:08
@graphite-app graphite-app bot force-pushed the 03-21-feat_transformer_add_statementinjectorstore_move_insertions_method branch from 9bdd489 to af78acb Compare March 21, 2025 14:08
Base automatically changed from 03-21-refactor_transformer_decorator_rename_enter_statement_to_exit_statement_ to main March 21, 2025 14:14
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 21, 2025
@graphite-app graphite-app bot merged commit af78acb into main Mar 21, 2025
26 checks passed
@graphite-app graphite-app bot deleted the 03-21-feat_transformer_add_statementinjectorstore_move_insertions_method branch March 21, 2025 14:16
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-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants