Repository navigation
fix(streaming): use emitted Vite IIFE asset URL - #789
Conversation
|
Warning Review limit reached
Next review available in: 6 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughSolidJS stream wrapping now buffers inner chunks until shell readiness, then flushes the shell and buffered output while coordinating cancellation and error settling. Unhead’s streaming plugin now treats the async IIFE as Vite-only, resolves emitted asset paths during HTML transformation, and updates related tests and build guards. ChangesSolidJS stream wrapping
Unhead streaming plugin
Sequence Diagram(s)SolidJS
|
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. | |
| Description check | The description is informative, but it omits the template’s Linked issue and Type of change sections. | Add the linked issue, check all applicable type-of-change boxes, and format the body with the repository template sections. |
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Title check | ✅ Passed | The title is concise, conventional, and matches the main change: using the emitted Vite IIFE asset URL. |
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
fix/streaming-contracts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
📦 Bundle Size✅ No notable changes All bundles (12)
⚡ Performance (directional)
All benchmarks (6)
Baseline: main @ e9808d8 · 2026-06-29 · gzipped is the headline size metric · perf is directional (shared-runner, gated) |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/unhead/build.config.ts`:
- Around line 18-20: The stub-mode early return in build:done is skipping the
post-build rewrite that populates the stream IIFE exports, so the stub artifact
no longer provides streamingIifeCode and streamingIifeSize for unplugin.ts.
Update the build flow in the build config so the rewrite still runs in stub
mode, or otherwise ensure dist/stream/iife and its matching type files export
those symbols before packages/unhead/src/stream/unplugin.ts imports them.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0bf0bab7-5301-4ec3-8ef3-aac322181310
📒 Files selected for processing (6)
packages/solid-js/src/stream/server.tspackages/solid-js/test/streaming.test.tspackages/unhead/build.config.tspackages/unhead/src/stream/unplugin.tspackages/unhead/test/streaming/unplugin.test.tspackages/vue/test/vite-plugin.test.ts
# Conflicts: # packages/solid-js/src/stream/server.ts # packages/solid-js/test/streaming.test.ts
What this fixes
In Vite production builds,
emitFile()returns a Rollup asset reference id, not the final file name. The async streaming plugin was putting that ref into the injected IIFE script tag, so the built HTML could point at/<ref>instead of/assets/unhead-streaming.[hash].js.Changes
unhead-streaming.jsfile from Vite's bundle context, withgetFileName()as a fallback, before injecting the async script.virtual:@unhead/streaming-iife.jsscoped to the Vite adapter; webpack, rspack, and rollup do not resolve or load that Vite-only module.unhead/stream/iifenamed export contract in stub builds by bundling the source IIFE before writingstreamingIifeCodeandstreamingIifeSize.Tests
unbuild --stuband the normalunheadpackage build produce importablestreamingIifeCodeexports.