Repository navigation
test(rspack-plugin): cover unstored roots on the loader's unproven path - #1994
Merged
Merged
Conversation
#1966 rewrote the only rspack loader case that rendered a fire-and-forget `createRoot(container).render(Main)` root without a void-component proof, switching it to a stored root with `unmount`. The unstored shape is the one a void-root rewrite targets, so restore it as its own case: the loader must keep `__createRootDefaultOptions` and render a value returned by a replacement component. Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm
marked this pull request as ready for review
October 11, 2026 11:48
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website | 6036fb6 | Commit Preview URL Branch Preview URL |
Oct 11 2026, 12:07 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website-mcp | 6036fb6 | Commit Preview URL Branch Preview URL |
Oct 11 2026, 12:08 PM |
Contributor
Benchmark report🟢 No byte growth, no added work, and no timing changes beyond ±3%. Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)No changes across 60 measured values. Public-import reachability bundles (bytes)No changes across 111 measured values. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
createRoot(container).render(Main)) on the loader's unproven path. This is the follow-up promised in the review of perf: omit unused root error reporting for default roots #1966.Why
createRoot(document.body).render(Main)to a stored root withunmount. The unstoredfactory(...).render(...)form is exactly the shape a void-root rewrite targets, and no other rspack test covered it on the unproven path.__createRootDefaultOptions(container).render(Main)), because a later loader can replace the component with one that returns a value.Changes
packages/rspack-plugin-octane/tests/loader.integration.test.ts: new casekeeps unstored production roots off the void contract when the loader cannot prove resolved module output, placed right after the stored-root case and using the same helpers (write,transform,evaluateCompiledFixtureCode,join).CONTRIBUTING.md: skip changesets for test-only work).Validation
pnpm format:check: not run repo-wide.pnpm format:files:checkon the changed file passes.pnpm typecheck: not run repo-wide.pnpm typecheck:files packages/rspack-plugin-octane/tests/loader.integration.test.tspasses.pnpm test: not run, per this machine's local-test policy. CI covers it.pnpm vitest run --project rspack-plugin packages/rspack-plugin-octane/tests/loader.integration.test.tspasses 20/20.packages/rspack-plugin-octane/src/loader.jsto passisVoidComponentImport: () => true, which forces the unproven path onto the void root helper. Both root cases then failed withexpected '' to be 'replacement value', because the void root drops the returned value. I reverted the change before committing. (A mutation insidecollectRootEditsinslot-hooks.jsdoes not reach this path: withoutisVoidComponentImport,canSpecializeRootis false and no candidates are collected.)pnpm sync: no generated changes.perf-review: not applicable (test-only).concise-code: src +0 −0 (runtime +0 −0). No new files or exports; the test file gains +28 lines. Alternative considered: anit.eachtable shared with the stored-root case, at about the same size. Rejected because the stored case returns and assertsunmountcleanup, so a table would need a per-row branch. Bytes: not applicable.Risk / follow-ups
Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Low Risk
Test-only change with no production code or loader logic modifications.
Overview
Adds an rspack loader integration test for unstored production roots (
createRoot(container).render(Main)) when the loader cannot prove the imported component’s output, complementing the existing stored-root +unmountcase from octane#1966.The test asserts the transform does not add a hard dependency on
Main.tsrxand that compiled output still uses a generic root so a later loader can substitute a component that returns a value (replacement valuein the DOM). Test-only; no runtime or loader behavior changes.Reviewed by Cursor Bugbot for commit 6036fb6. Bugbot is set up for automated code reviews on this repo. Configure here.