docs(router): clarify static title fallback in SPA mode
维护者通常 1 天内回复
评估
- 难度
- 1/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 62/100
- Issue 类型
- 文档
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- html, react, typescript
调研方向
该指南是 TanStack Router 文档中关于 SPA 文档 head 的页面,其中说明了要从 index.html 中移除静态的 <title>,并与 <HeadContent /> 一同出现。请先阅读该部分,然后查看链接的讨论 #1056,了解此前关于路由标题的背景。完成的标准是:文档解释了为什么必须移除静态标题、移除后初始 HTML 的样子,并推荐对路由特定的元数据使用预渲染或 SSR,同时提供受支持的回退方案。
由索引模型根据 Issue 内容生成。
描述
What would you like to see?
The SPA document head guide says to remove the static <title> from index.html when using <HeadContent />. It would help to explain why this is necessary and what to do if the app still needs a fallback title before JavaScript runs.
In SPA mode, the initial HTML response is the same for every route, so route-specific metadata is only available after the router runs. A static title can provide a useful fallback, but HeadContent currently doesn't adopt or replace that unmanaged title, so leaving it in place can result in duplicate titles.
Could the docs clarify this trade-off and recommend prerendering or SSR when route-specific metadata needs to be present in the initial HTML? It would also be useful to mention a supported pattern for retaining a generic fallback title without leaving duplicate title elements after the app starts.
Why is this needed?
Some apps don't need search indexing, but still want a sensible browser-tab title if JavaScript is disabled, blocked, or fails to load. The current instruction to remove the title is easy to follow without realizing that the initial document then has no title until client-side rendering.
I found the existing discussion about route titles: https://github.com/TanStack/router/discussions/1056
- 主要语言
- TypeScript
- 星标
- 15.3k
- 派生
- 1.9k
- 平均合并
- 1 天 7 小时
- 30 天内合并 PR
- 63
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/router 的其他 Issue
-
router-generator: sibling `physical()` subtrees in a virtual route config generate duplicate identifiers可能已有人在做 @karlshea 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
router.startViewTransition leaves the ready/finished promises unhandled, so a skipped transition throws an unhandled AbortError可能已有人在做 @unjica 于 13 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
TanStack/router#8776 · 3 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
Router devtools crash when search params contain a BigInt (JSON.stringify in history tracking)可能已有人在做 @A-Raphie 于 16 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
docs: `createLink` has no API reference page; 3 how-to guides link to a missing `#createlink` anchor可能已有人在做 @A-Raphie 于 16 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
Inline scripts are duplicated after hydration when the CSP nonce is sent in a header可能已有人在做 @gabriel-le 于 37 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 2 天内回复
-
reproduced
难度 2/5 1-3 小时 新手友好度 74/100
anomalyco/opencode#62052 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
strapi/design-system#2084 ·
维护者通常 3 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复