Skip to content

feat(runtime): export useHead hook from @rspress/core/runtime#3272

Merged
SoonIter merged 2 commits intomainfrom
codex/expose-use-head-runtime
Apr 1, 2026
Merged

feat(runtime): export useHead hook from @rspress/core/runtime#3272
SoonIter merged 2 commits intomainfrom
codex/expose-use-head-runtime

Conversation

@SoonIter
Copy link
Copy Markdown
Member

@SoonIter SoonIter commented Apr 1, 2026

Summary

  • export useHead from @rspress/core/runtime
  • add English and Chinese documentation for the useHead runtime hook
  • update the custom head guide to document both Head and useHead

Testing

  • pnpm --filter @rspress/core build (currently fails on an existing unrelated type error in src/node/mdx/options.ts: MarkdownOptions.defaultCodeOverflow)
  • npx heading-case --write website/docs/en/ui/hooks/use-head.mdx website/docs/zh/ui/hooks/use-head.mdx website/docs/en/ui/runtime-components/head.mdx website/docs/zh/ui/runtime-components/head.mdx website/docs/en/guide/advanced/custom-head.mdx website/docs/zh/guide/advanced/custom-head.mdx

Copilot AI review requested due to automatic review settings April 1, 2026 08:43
Timeless0911
Timeless0911 previously approved these changes Apr 1, 2026
@SoonIter SoonIter changed the title fix(core): export useHead from runtime fix(runtime): export useHead from runtime Apr 1, 2026
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 1, 2026

Deploying rspress-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: a5af1bf
Status: ✅  Deploy successful!
Preview URL: https://ab4aed4d.rspress-v2.pages.dev
Branch Preview URL: https://codex-expose-use-head-runtim.rspress-v2.pages.dev

View logs

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Rsdoctor Bundle Diff Analysis

Found 3 projects in monorepo, 3 projects with changes.

📊 Quick Summary
Project Total Size Change
node 12.6 MB +115.9 KB (0.9%)
web 16.3 MB +29.1 KB (0.2%)
node_md 1.6 MB +7.5 KB (0.5%)
📋 Detailed Reports (Click to expand)

📁 node

Path: website/doc_build/diff-rsdoctor/node/rsdoctor-data.json

📌 Baseline Commit: 9129469c70 | PR: #3271

Metric Current Baseline Change
📊 Total Size 12.6 MB 12.5 MB +115.9 KB (0.9%)
📄 JavaScript 0 B 0 B 0
🎨 CSS 0 B 0 B 0
🌐 HTML 12.6 MB 12.5 MB +115.9 KB (0.9%)
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: node Bundle Diff

📁 web

Path: website/doc_build/diff-rsdoctor/web/rsdoctor-data.json

📌 Baseline Commit: 9129469c70 | PR: #3271

Metric Current Baseline Change
📊 Total Size 16.3 MB 16.2 MB +29.1 KB (0.2%)
📄 JavaScript 16.0 MB 16.0 MB +28.4 KB (0.2%)
🎨 CSS 122.1 KB 122.1 KB 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 167.9 KB 167.2 KB +749.0 B (0.4%)

📦 Download Diff Report: web Bundle Diff

📁 node_md

Path: website/doc_build/diff-rsdoctor/node_md/rsdoctor-data.json

📌 Baseline Commit: 9129469c70 | PR: #3271

Metric Current Baseline Change
📊 Total Size 1.6 MB 1.6 MB +7.5 KB (0.5%)
📄 JavaScript 0 B 0 B 0
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 1.6 MB 1.6 MB +7.5 KB (0.5%)

📦 Download Diff Report: node_md Bundle Diff

Generated by Rsdoctor GitHub Action

Copy link
Copy Markdown
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 aligns @rspress/core/runtime’s public API with the underlying @unhead/react runtime by re-exporting the useHead hook alongside the existing Head export, enabling consumers to import useHead directly from the Rspress runtime entrypoint.

Changes:

  • Re-export useHead from @unhead/react via @rspress/core/runtime.
  • Keep the runtime export surface consistent with existing head-management usage patterns.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SoonIter SoonIter changed the title fix(runtime): export useHead from runtime feat(runtime): export useHead from runtime Apr 1, 2026
@SoonIter SoonIter changed the title feat(runtime): export useHead from runtime feat(runtime): export useHead hook from @rspress/core/runtime Apr 1, 2026
@SoonIter SoonIter enabled auto-merge (squash) April 1, 2026 09:08
@SoonIter SoonIter requested a review from Timeless0911 April 1, 2026 09:09
@SoonIter SoonIter merged commit 66dfa8f into main Apr 1, 2026
8 checks passed
@SoonIter SoonIter deleted the codex/expose-use-head-runtime branch April 1, 2026 09:10
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.

3 participants