Skip to content

docs: update framework bundler import examples and streaming guides - #792

Merged
harlan-zw merged 7 commits into
mainfrom
docs/plugin-imports-cleanup
Jun 29, 2026
Merged

harlan-zw merged 7 commits into
mainfrom
docs/plugin-imports-cleanup

Conversation

@harlan-zw

@harlan-zw harlan-zw commented Jun 25, 2026 •

Copy link
Copy Markdown
Collaborator

🔗 Related

Depends on #785 (the vite-ssr-vue example imports @unhead/schema-org/imports).

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

Updates the examples and build-plugin / streaming guides to the named Unhead plugin import and the @unhead/*/bundler framework entry (for example Unhead().webpack()), replacing the old default import and the removed per-bundler subpaths. The vite-ssr-vue example also adopts @unhead/schema-org/imports.

Summary by CodeRabbit

  • Documentation

    • Updated streaming and build-plugin guides with clearer setup instructions for webpack and other bundlers.
    • Refreshed the migration guide to match the latest bundler import and configuration patterns.
  • Examples

    • Updated Vite SSR examples across frameworks to use the current plugin import style.
    • Aligned the Vue schema-org example with the latest import path.

@github-actions

github-actions Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

📦 Bundle Size

✅ No notable changes

All bundles (12)
Bundle Gzipped Raw
Core
Client (Minimal) 4.7 kB 11.7 kB ✅
Client (Full) 7.9 kB 20.6 kB ✅
Server (Minimal) 4.5 kB 11.4 kB ✅
Vue
Vue Client (Minimal) 5.2 kB 12.8 kB ✅
Vue Client (Full) 8.7 kB 22.5 kB ✅
Vue Server (Minimal) 5 kB 12.3 kB ✅
React
React Client (Minimal) 5.1 kB 12.7 kB ✅
React Client (Full) 8.5 kB 22.1 kB ✅
React Server (Minimal) 4.8 kB 12 kB ✅
Schema.org
Schema.org (Minimal) 9.5 kB 26.3 kB ✅
Schema.org Imports 0.1 kB 0.1 kB ✅
Schema.org Vue Meta 0.4 kB 0.8 kB ✅

⚡ Performance (directional)

✅ No significant change (within CI noise)

All benchmarks (6)
Benchmark PR Δ RME
SSR render (CPU) 0.461 ms ~ noise ±8.6%
SSR render (wall) 0.296 ms ~ noise ±4.3%
SSR allocated / render 321.9 KiB ~ noise —
CSR DOM mutations / nav 38 ~ noise —
CSR re-render (CPU) 0.779 ms ~ noise ±5.6%
CSR re-render (wall) 0.440 ms ~ noise ±2.8%

Baseline: main @ 9b38328 · 2026-06-29 · gzipped is the headline size metric · perf is directional (shared-runner, gated)

@coderabbitai

coderabbitai Bot commented Jun 25, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Updates documentation and example Vite configs to align with a new bundler plugin API: replaces default unhead imports with named Unhead imports from @unhead/{framework}/vite or @unhead/{framework}/bundler, and changes webpack guidance from referencing a dedicated @unhead/*/webpack entry to calling Unhead({ streaming: true }).webpack().

Bundler API docs and examples

Layer / File(s) Summary
Docs: bundler/webpack guidance
docs/head/1.guides/build-plugins/0.overview.md, docs/6.migration-guide/1.v3.md, docs/0.react/.../5.streaming.md, docs/0.solid-js/.../5.streaming.md, docs/0.svelte/.../5.streaming.md, docs/0.vue/.../5.streaming.md
Replaces webpack-specific import paths (@unhead/*/webpack, @unhead/bundler/webpack) and default imports with named Unhead from @unhead/{framework}/bundler and .webpack() method calls across all framework streaming guides, the migration guide, and the build plugins overview.
Examples: vite.config.ts updates
examples/vite-ssr-react-streaming/vite.config.ts, examples/vite-ssr-react-ts/vite.config.ts, examples/vite-ssr-solidjs-streaming/vite.config.ts, examples/vite-ssr-svelte-streaming/vite.config.ts, examples/vite-ssr-vue/vite.config.ts
Switches all SSR example configs from default unhead imports to named Unhead imports from @unhead/{framework}/vite, updates plugin invocations accordingly, and fixes the Vue example's schema-org import to @unhead/schema-org/imports.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • unjs/unhead#733: Aligns docs/examples for webpack/Vite integration to named Unhead export and updated framework/bundler entrypoints.
  • unjs/unhead#751: Introduces the new webpack/rspack/rollup streaming entry points and createStreamingVitePlugin factory that this PR's docs now describe.
  • unjs/unhead#754: The bundler-factory breaking change that switched imports from @unhead/*/webpack to @unhead/*/bundler with .webpack(), which these doc/example updates reflect.

Poem

🐇 A rabbit once typed import unhead,
But the factory changed — named exports instead!
Now Unhead from bundler, .webpack() in tow,
Docs and examples all put on a show.
With one little rename, the configs align —
Hop hop, every import is finally fine! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the documentation updates to bundler imports and streaming guides.
Description check ✅ Passed It includes a linked dependency, a checked documentation type, and a clear description of the changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/plugin-imports-cleanup

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
docs/0.vue/head/guides/1.core-concepts/5.streaming.md (1)

41-41: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Optional: align the import path with the Vite snippet for consistency.

The Vite example (Line 29) imports from @unhead/vue/vite, while this webpack guidance imports from @unhead/vue/bundler. Both export the named Unhead factory and work, but using the unified @unhead/vue/bundler entry in both spots (it dispatches to all bundlers) would read more consistently for users.

🤖 Prompt for 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.

In `@docs/0.vue/head/guides/1.core-concepts/5.streaming.md` at line 41, The
webpack streaming example in the guide uses a different import entry than the
Vite snippet, which makes the documentation inconsistent. Update the webpack
guidance to use the same unified `Unhead` import path as the other bundler
example, and keep the `Unhead({ streaming: true }).webpack()` usage unchanged so
the `Unhead` factory is referenced consistently across the streaming docs.
🤖 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.

Nitpick comments:
In `@docs/0.vue/head/guides/1.core-concepts/5.streaming.md`:
- Line 41: The webpack streaming example in the guide uses a different import
entry than the Vite snippet, which makes the documentation inconsistent. Update
the webpack guidance to use the same unified `Unhead` import path as the other
bundler example, and keep the `Unhead({ streaming: true }).webpack()` usage
unchanged so the `Unhead` factory is referenced consistently across the
streaming docs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b6d1d2f5-083e-4910-b302-0debc60a1b48

📥 Commits

Reviewing files that changed from the base of the PR and between ba1d574 and 8890f4d.

📒 Files selected for processing (11)
  • docs/0.react/head/guides/1.core-concepts/5.streaming.md
  • docs/0.solid-js/head/guides/1.core-concepts/5.streaming.md
  • docs/0.svelte/head/guides/1.core-concepts/5.streaming.md
  • docs/0.vue/head/guides/1.core-concepts/5.streaming.md
  • docs/6.migration-guide/1.v3.md
  • docs/head/1.guides/build-plugins/0.overview.md
  • examples/vite-ssr-react-streaming/vite.config.ts
  • examples/vite-ssr-react-ts/vite.config.ts
  • examples/vite-ssr-solidjs-streaming/vite.config.ts
  • examples/vite-ssr-svelte-streaming/vite.config.ts
  • examples/vite-ssr-vue/vite.config.ts

@harlan-zw
harlan-zw merged commit 00c5340 into main Jun 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant