Skip to content

test(webcontainer): cover the WebContainer download fallback in plain Node - #10966

Merged
shulaoda merged 1 commit into
mainfrom
test/webcontainer-fallback-coverage
Sep 30, 2026
Merged

shulaoda merged 1 commit into
mainfrom
test/webcontainer-fallback-coverage

Conversation

@shulaoda

@shulaoda shulaoda commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #10952, which fixed #10938.

Why

The ci: webcontainer suite installs @rolldown/binding-wasm32-wasi next to rolldown, so the generated loader picks it up before the WebContainer fallback is reached, and expectNoRegistryFallback deliberately asserts the fallback is not taken. vite.new has no such package: there rolldown loads the binding that webcontainer-fallback.cjs installs, and that path had no coverage at all. That is how #10938 shipped in 1.2.9.

What

A third browser-tests suite, webcontainer-fallback, that runs in plain Node with no WebContainer:

  • installs the packed rolldown with optional dependencies disabled, so no binding of any kind is reachable
  • seeds /tmp/rolldown-<version> with the packed @rolldown/binding-wasm32-wasi. The fallback skips its registry download once the entry exists, so the packed binding is what gets tested, not whatever npm has for this version
  • fakes process.versions.webcontainer, bundles a small app in a child process, and asserts that the binding in require.cache is the seeded one

It runs on every PR that touches node code, as a new step in the same Browser job after just test-browser. It needs the same wasm build, which that job already has. Locally: just test-webcontainer-fallback.

@netlify

netlify Bot commented Sep 23, 2026

Copy link
Copy Markdown

✅ Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit a846d30
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6ab392e8459edf00088c4dae
😎 Deploy Preview https://deploy-preview-10966--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 9b71c60
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6abc9abd7b807500086c983f

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://test-webcontainer-fallback-coverage-rolldown-rs.voidzero-docs.workers.dev (commit 9b71c60)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://ccdad4b7-rolldown-rs.voidzero-docs.workers.dev 9b71c60 2026-09-30T05:16:47.876Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://63cfa33b-rolldown-rs.voidzero-docs.workers.dev 9981b90 2026-09-30T03:39:31.265Z Visit the dashboard ↗
  • Build: Failed ❌

View logs ↗
37604c1 2026-09-23T08:53:37.176Z View logs ↗

Comment thread packages/browser-tests/package.json
@shulaoda
shulaoda force-pushed the test/webcontainer-fallback-coverage branch from 37604c1 to 9981b90 Compare September 30, 2026 03:36
… Node

The ci: webcontainer suite installs the WASI binding next to rolldown, so
the generated loader never reaches webcontainer-fallback.cjs, the path
vite.new takes and the one #10938 broke. Add a plain-Node suite that
installs the packed rolldown with no binding, seeds the fallback
directory with the packed WASI binding, fakes the WebContainer marker
and checks the seeded binding is what loads. It runs in the Browser job
on every PR that touches node code.
@shulaoda
shulaoda force-pushed the test/webcontainer-fallback-coverage branch from 9981b90 to 9b71c60 Compare September 30, 2026 05:14
@shulaoda
shulaoda merged commit 35ab6e4 into main Sep 30, 2026
35 checks passed
@shulaoda
shulaoda deleted the test/webcontainer-fallback-coverage branch September 30, 2026 05:31
shulaoda added a commit that referenced this pull request Sep 30, 2026
…anges (#10967)

Stacked on #10966. Follow-up to #10938.

### Why

The `ci: webcontainer` suite only runs when someone adds the label.
#10888, the renovate PR that pulled in napi-rs cli 3.10, had no label,
so the suite never ran there. The AGENTS.md rule to always label napi-rs
changes is not something renovate reads.

### What

- `renovate.json`: bumps of `napi`, `napi-build`, `napi-derive`,
`@napi-rs/cli`, `@napi-rs/wasm-runtime`, `emnapi` and `@emnapi/*` get
the `ci: webcontainer` label added automatically. Those are the packages
whose bumps can break inside a real WebContainer, which is what the
suite is for.
- `ci.yml`: a `webcontainer-changes` path filter opts a PR in without
the label when it touches the generated binding loader, its WebContainer
fallback, `packages/rolldown/package.json` (the `napi` config), or the
suite itself. `pnpm-workspace.yaml` and `Cargo.toml` are deliberately
not in the filter: every dependency bump touches them, and the renovate
rule covers the bumps that matter.
- The `Show outputs` step now prints the WebContainer decision, so a
run's log says why the suite did or did not run.
- AGENTS.md: the manual-label rule now covers only what the two
automatic paths cannot see.
@rolldown-guard rolldown-guard Bot mentioned this pull request Sep 30, 2026
shulaoda added a commit that referenced this pull request Sep 30, 2026
## [1.2.12] - 2026-09-30

### 🚀 Features

- inline common chunks containing import() and deduplicate shared code in lazy chunks (#11034) by @hyfdev
- experimental `inlineCommonChunks` support (#10899) by @hyfdev
- dev: ship imported bindings for HMR partial accept (#10856) by @h-a-n-a

### 🐛 Bug Fixes

- chunking: re-derive chunk exec orders after the runtime leaves its host chunk (#11005) by @hyfdev
- code-splitting: gate member-read init paths on the reading statement (#11039) by @hyfdev
- code-splitting: retain initialization paths through re-exported namespaces (#11037) by @hyfdev
- dev: reject non-ESM output formats in dev mode (#11038) by @h-a-n-a
- dev: align `import.meta.hot.accept` deps with Vite (#10997) by @h-a-n-a
- dev: clear the resolver cache when a file is created or deleted (#10986) by @waltuov
- error: name the resolved specifier in unresolved import diagnostics (#11014) by @linyiru
- make entries-aware chunk merging deterministic (#11002) by @hyfdev
- watch: avoid restarting macOS watcher for unchanged paths (#10992) by @sep2

### 🚜 Refactor

- dev: ship the dev runtime entry as one file (#10998) by @h-a-n-a
- binding: remove `__internalForcePanic` (#10989) by @IWANABETHATGUY

### 📚 Documentation

- fix cloudflare preview builds (#10996) by @sapphi-red
- fix build config loader warning (#10994) by @sapphi-red
- deps: use Vite 8 (#10993) by @sapphi-red

### ⚡ Performance

- dev: only ship rows with dynamic edges in registerGraph (#11019) by @h-a-n-a

### 🧪 Testing

- code-splitting: cover more re-exported namespace shapes (#11042) by @hyfdev
- webcontainer: cover the WebContainer download fallback in plain Node (#10966) by @shulaoda
- dev: pin the runtime entry file layout that Vite serves (#10983) by @h-a-n-a

### ⚙️ Miscellaneous Tasks

- pin VOID_API_URL for the docs deploy (#11041) by @shulaoda
- opt into the WebContainer smoke test for napi bumps and loader changes (#10967) by @shulaoda
- deps: upgrade oxc to 0.152.0 (#11018) by @camc314
- deps: update rust crates (#11012) by @renovate[bot]
- deps: update npm packages (#11011) by @renovate[bot]
- deps: update crate-ci/typos action to v1.50.3 (#11023) by @renovate[bot]
- deps: update test262 submodule for tests (#11022) by @rolldown-guard[bot]
- deps: update rollup submodule for tests to v4.63.5 (#11021) by @rolldown-guard[bot]
- deps: update dependency vite-plus to v1 (#11017) by @renovate[bot]
- deps: update github actions (#11010) by @renovate[bot]
- remove `CLAUDE.md` (#10925) by @iiio2
- verify release debug info by matching file IDs (#10988) by @IWANABETHATGUY
- deps: update rollup submodule for tests to v4.63.4 (#10940) by @rolldown-guard[bot]

### ❤️ New Contributors

* @waltuov made their first contribution in [#10986](#10986)
* @linyiru made their first contribution in [#11014](#11014)
* @sep2 made their first contribution in [#10992](#10992)

Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
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.

[Bug]: binding-wasm32-wasi errors __napiBindingTarget is reserved by the generated binding loader, but the loaded binding already exports it

3 participants