Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: type render() return across all framework integrations#672

Merged
harlan-zw merged 2 commits intov3from
fix/vue-head-client-render-type
Mar 2, 2026
Merged

fix: type render() return across all framework integrations#672
harlan-zw merged 2 commits intov3from
fix/vue-head-client-render-type

Conversation

@harlan-zw
Copy link
Collaborator

@harlan-zw harlan-zw commented Mar 2, 2026

πŸ”— Linked issue

N/A β€” reported by @danielroe as a downstream regression (head.render() returns unknown)

❓ Type of change

  • πŸ“– Documentation
  • 🐞 Bug fix
  • πŸ‘Œ Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

πŸ“š Description

Unhead<Input, RenderResult> has two generics but framework integrations only forwarded Input, leaving RenderResult at its default of unknown. This caused head.render() to return unknown instead of SSRHeadPayload (server) or boolean (client).

Vue: Added second generic to VueHeadClient<I, R> and threaded it through server/client createHead return types. Added type test with satisfies assertions.

React, Svelte, Solid: Changed client createHead return type from Unhead to ClientUnhead (which extends Unhead<T, boolean>).

Streaming: Typed BaseStreamableHeadContext.head as ServerUnhead<T> instead of Unhead<T>, removing unnecessary as SSRHeadPayload casts in Svelte and Solid streaming code.

VueHeadClient only forwarded the Input generic to Unhead, leaving
RenderResult at its default of unknown. This caused head.render()
to return unknown instead of SSRHeadPayload (server) or boolean (client).
@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • πŸ” Trigger review
✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/vue-head-client-render-type

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 and usage tips.

@harlan-zw harlan-zw changed the title fix(vue): thread RenderResult generic through VueHeadClient fix(vue): broken head instance types Mar 2, 2026
…orks

Apply the same RenderResult fix to React, Svelte, and Solid client
createHead functions using ClientUnhead. Also type BaseStreamableHeadContext
with ServerUnhead so streaming render() calls no longer need SSRHeadPayload
casts.
@harlan-zw harlan-zw changed the title fix(vue): broken head instance types fix: type render() return across all framework integrations Mar 2, 2026
@harlan-zw harlan-zw merged commit a7e761a into v3 Mar 2, 2026
1 of 2 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