Skip to content

fix(wasm): transfer AST to JS as JSON string in oxc-wasm#9269

Merged
Boshen merged 1 commit intomainfrom
02-21-fix_wasm_transfer_ast_to_js_as_json_string_in_oxc-wasm_
Feb 21, 2025
Merged

fix(wasm): transfer AST to JS as JSON string in oxc-wasm#9269
Boshen merged 1 commit intomainfrom
02-21-fix_wasm_transfer_ast_to_js_as_json_string_in_oxc-wasm_

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Feb 21, 2025

Same as #9259, but for oxc-wasm package.

This fixes a couple of bugs - previously RegExps and BigInts were deserialized as null.

Only differences from the implementation in @oxc-parser/wasm are:

  1. Getter for ast does not cache the result of JSON.parse. I couldn't quite get my head around Playground code, but I think the Oxc class instance is being used as a singleton, and therefore the value may change as the user updates the source code.

  2. JSON is pretty-printed. This is so that when "Raw" is ticked, the JSON can be displayed exactly as it came out of the parser (rather than stringifying the AST object again).

@github-actions github-actions bot added the C-bug Category - Bug label Feb 21, 2025
Copy link
Member Author


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.

@overlookmotel overlookmotel marked this pull request as ready for review February 21, 2025 13:37
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 21, 2025

CodSpeed Performance Report

Merging #9269 will not alter performance

Comparing 02-21-fix_wasm_transfer_ast_to_js_as_json_string_in_oxc-wasm_ (c26955e) with main (2501c63)

Summary

✅ 33 untouched benchmarks

@Boshen Boshen merged commit b9c8a10 into main Feb 21, 2025
30 checks passed
@Boshen Boshen deleted the 02-21-fix_wasm_transfer_ast_to_js_as_json_string_in_oxc-wasm_ branch February 21, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants