Skip to content

feat(wasm): add webcontainer fallback#11526

Merged
CPunisher merged 3 commits intomainfrom
08-28-feat/add-webcontainer-fallback
Aug 29, 2025
Merged

feat(wasm): add webcontainer fallback#11526
CPunisher merged 3 commits intomainfrom
08-28-feat/add-webcontainer-fallback

Conversation

@CPunisher
Copy link
Contributor

Summary

Copy from rolldown/oxc. This is a temporary solution before stackblitz configures the auto substitution for rspack. There's no need to specify architecture in webcontainer, see https://rspack.rs/guide/start/quick-start#preview-with-stackblitz

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link

netlify bot commented Aug 28, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 3f0e24b
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68b116ba9bcf520008478fca

@github-actions github-actions bot added release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack. labels Aug 28, 2025
@CPunisher CPunisher requested a review from h-a-n-a August 28, 2025 12:27
@CPunisher CPunisher marked this pull request as ready for review August 28, 2025 12:27
Copilot AI review requested due to automatic review settings August 29, 2025 02:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds WebContainer support to rspack by implementing a fallback mechanism that automatically downloads and uses the WASM binding when running in StackBlitz WebContainer environments. This is a temporary solution copied from rolldown/oxc until StackBlitz configures automatic substitution for rspack.

  • Adds webcontainer-fallback.cjs that detects WebContainer environment and downloads the WASM binding
  • Updates package.json to include the fallback file in the distribution
  • Modifies binding.js to use the WebContainer fallback when no native binding is available

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
crates/node_binding/webcontainer-fallback.cjs New fallback script that downloads and loads WASM binding in WebContainer
crates/node_binding/package.json Adds webcontainer-fallback.cjs to files array
crates/node_binding/binding.js Adds WebContainer detection and fallback loading logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 29, 2025

CodSpeed Performance Report

Merging #11526 will not alter performance

Comparing 08-28-feat/add-webcontainer-fallback (3f0e24b) with main (db225f9)1

🎉 Hooray! codspeed-rust just leveled up to 2.7.2!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 17 untouched benchmarks

Footnotes

  1. No successful run was found on main (c1ef1b5) during the generation of this report, so db225f9 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing 3f0e24b to fix: import.meta.prop with define plugin (#11525) by Gengkun

❌ Size increased by 512bytes from 47.62MB to 47.62MB (⬆️0.00%)

@CPunisher CPunisher enabled auto-merge (squash) August 29, 2025 10:11
@CPunisher CPunisher merged commit c507e66 into main Aug 29, 2025
122 of 150 checks passed
@CPunisher CPunisher deleted the 08-28-feat/add-webcontainer-fallback branch August 29, 2025 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants