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

perf: remove oxc-parser manual wasm fallback logic #3413

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

BobbieGoede
Copy link
Collaborator

@BobbieGoede BobbieGoede commented Mar 16, 2025

Experimenting

Copy link

pkg-pr-new bot commented Mar 16, 2025

npm i https://pkg.pr.new/@nuxtjs/i18n@3413

commit: da583c0

@BobbieGoede BobbieGoede marked this pull request as draft March 16, 2025 01:45
@BobbieGoede BobbieGoede force-pushed the fix/remove-parser-fallback branch from ff094c8 to 033e949 Compare March 19, 2025 22:55
@BobbieGoede BobbieGoede changed the title [DRAFT] fix: remove parser fallback fix: remove parser fallback Mar 19, 2025
@BobbieGoede BobbieGoede changed the title fix: remove parser fallback perf: remove parser fallback Mar 19, 2025
@BobbieGoede BobbieGoede changed the title perf: remove parser fallback perf: remove parser fallback logic Mar 19, 2025
@BobbieGoede BobbieGoede force-pushed the fix/remove-parser-fallback branch from 24308fb to 0e97bd8 Compare March 21, 2025 11:04
@BobbieGoede BobbieGoede changed the title perf: remove parser fallback logic perf: remove oxc-parser manual wasm fallback logic Mar 21, 2025
@BobbieGoede
Copy link
Collaborator Author

@danielroe @Boshen

Based on https://stackblitz.com/edit/oxc-parser I was hoping to remove our manual wasm fallback for oxc-parser (same for nuxt), it looks like this only works when explicitly adding @oxc-parser/binding-wasm32-wasi as a (prod) dependency (matching the usage example).

However, having this as prod dep will cause issues when installing in unsupported environments (as was the case in this PR).

Here some stackblitz reproductions using the preview release of this PR (nuxt-i18n + @oxc-parser/binding-wasm32-wasi as optional dep)

I suppose in the case for nuxt-i18n we could add the binding to the stackblitz playground/issue starters, but it would be great to have this working without adding the dependency or at least conditionally if the environment supports it.

@Boshen
Copy link

Boshen commented Mar 21, 2025

We are currently working with stackblitz to get oxc-parser work automatically without @oxc-parser/binding-wasm32-wasi. @hi-ogawa will let you know when it works.

@BobbieGoede BobbieGoede force-pushed the fix/remove-parser-fallback branch from 0e97bd8 to 8970ead Compare March 24, 2025 10:56
@hi-ogawa
Copy link

hi-ogawa commented Apr 2, 2025

Hi folks! With the latest oxc-parser 0.62.0, it fallbacks to wasm package automatically on stackblitz. Here is a quick example https://stackblitz.com/edit/stackblitz-starters-mv7ri8rj?file=index.js

As you can see in the example, currently this adds a few seconds of download time during import (not during npm i) with a bit too noisy log, which is not ideal, but I started with this to see how it affects downstream project in general. If this is too bothersome, we can explore more direct way of package replacement by coordinating with Stackblitz team. Please let me know if you have any feedback. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants