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(napi): do not support raw transfer on WASM32 #9566

Merged

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Mar 5, 2025

Prevent compilation errors on 32-bit platforms by avoiding calculating usize: 1 << 32 unless on a 64-bit platform.

parseSync will throw an error if called with experimentalRawTransfer on an unsupported system.

Add a function rawTransferSupported to check if raw transfer is supported on current system or not, so user can avoid these errors.

Copy link
Contributor Author

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

@github-actions github-actions bot added the C-bug Category - Bug label Mar 5, 2025
@overlookmotel overlookmotel force-pushed the 03-05-fix_napi_do_not_support_raw_transfer_on_wasm32 branch from d3762a7 to 7c9ae6f Compare March 5, 2025 13:37
@overlookmotel overlookmotel marked this pull request as ready for review March 5, 2025 13:39
@overlookmotel overlookmotel force-pushed the 03-05-fix_napi_do_not_support_raw_transfer_on_wasm32 branch 3 times, most recently from 92b4ace to 10ed2d0 Compare March 5, 2025 15:57
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Mar 6, 2025
Copy link

graphite-app bot commented Mar 6, 2025

Merge activity

Prevent compilation errors on 32-bit platforms by avoiding calculating `usize: 1 << 32` unless on a 64-bit platform.

`parseSync` will throw an error if called with `experimentalRawTransfer` on an unsupported system.

Add a function `rawTransferSupported` to check if raw transfer is supported on current system or not, so user can avoid these errors.
@graphite-app graphite-app bot force-pushed the 03-05-fix_napi_do_not_support_raw_transfer_on_wasm32 branch from 10ed2d0 to 91c9932 Compare March 6, 2025 01:34
graphite-app bot pushed a commit that referenced this pull request Mar 6, 2025
Duplicate of #9555, but just stacked on top of #9566.

`napi-rs` for some reason omits the `export * from '@oxc-project/types';` line from `index.d.ts` when building for WASM.

I don't know how to fix that, so added a hacky script to fix up `index.d.ts` manually. This is not at all ideal, but at least it now compiles and CI passes.
@graphite-app graphite-app bot merged commit 91c9932 into main Mar 6, 2025
15 checks passed
@graphite-app graphite-app bot deleted the 03-05-fix_napi_do_not_support_raw_transfer_on_wasm32 branch March 6, 2025 01:39
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 6, 2025
@oxc-bot oxc-bot mentioned this pull request Mar 6, 2025
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