Skip to content
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(ast): change ImportExpression::attributes to options #9665

Conversation

Copy link
Member Author

Boshen 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.

@Boshen
Copy link
Member Author

Boshen commented Mar 11, 2025

@overlookmotel simply changing this field breaks raw_transfer, am I missing something?

[tasks/ast_tools/src/generators/raw_transfer.rs:772:9] field_name = "arguments"

thread '<unnamed>' panicked at tasks/ast_tools/src/generators/raw_transfer.rs:773:87:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@github-actions github-actions bot added A-ast Area - AST C-bug Category - Bug labels Mar 11, 2025
Base automatically changed from 03-11-fix_ast_align_tsimporttype_field_names_with_ts-eslint to main March 11, 2025 03:41
@github-actions github-actions bot added A-transformer Area - Transformer / Transpiler A-codegen Area - Code Generation A-prettier Area - Prettier labels Mar 11, 2025
Copy link

codspeed-hq bot commented Mar 11, 2025

CodSpeed Performance Report

Merging #9665 will not alter performance

Comparing 03-11-fix_ast_change_importexpression_attributes_to_options_ (475b48f) with main (a7b6b60)

Summary

✅ 33 untouched benchmarks

@overlookmotel
Copy link
Contributor

@overlookmotel simply changing this field breaks raw_transfer, am I missing something?

Sorry. Not a very helpful error message!

Usually, just changing the field name is enough. But where there's a custom serializer (#[estree(via = Converter)]), you have to implement serialization/deserialization twice - once in Rust in ESTree impl on the "converter" type, and second time in JS in the #[estree(raw_deser = "...")] attribute on that same type. The fragment of JS in raw_deser attr gets inserted into the JS-side deserializer code.

This is the commit that fixes it: 2c4af1b

The syntax of the raw_deser code is pretty dreadful and is going to be largely incomprehensible to anyone but me. I'll try to improve it.

@Boshen Boshen marked this pull request as ready for review March 11, 2025 10:21
@Boshen Boshen requested review from Dunqing and leaysgur as code owners March 11, 2025 10:21
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Mar 11, 2025
Copy link
Member Author

Boshen commented Mar 11, 2025

Merge activity

  • Mar 11, 6:22 AM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 11, 6:22 AM EDT: A user added this pull request to the Graphite merge queue.
  • Mar 11, 11:08 AM UTC: The Graphite merge queue couldn't merge this PR because it timed out.
  • Mar 11, 8:09 PM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 11, 8:09 PM EDT: A user added this pull request to the Graphite merge queue.
  • Mar 11, 8:16 PM EDT: A user merged this pull request with the Graphite merge queue.

@graphite-app graphite-app bot force-pushed the 03-11-fix_ast_change_importexpression_attributes_to_options_ branch from 6667820 to c635aa5 Compare March 11, 2025 10:48
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 11, 2025
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Mar 12, 2025
@graphite-app graphite-app bot force-pushed the 03-11-fix_ast_change_importexpression_attributes_to_options_ branch from c635aa5 to 475b48f Compare March 12, 2025 00:09
@graphite-app graphite-app bot merged commit 475b48f into main Mar 12, 2025
26 checks passed
@graphite-app graphite-app bot deleted the 03-11-fix_ast_change_importexpression_attributes_to_options_ branch March 12, 2025 00:16
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ast Area - AST A-codegen Area - Code Generation A-prettier Area - Prettier A-transformer Area - Transformer / Transpiler C-bug Category - Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants