Unused `export *` re-export is kept in the entry chunk
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 22/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript, vite
- 领域
- build-system, frontend
调研方向
Start with the repro shape in the issue: src/ui/index.ts re-exports Grid via export *, and src/console/LazyGrid.tsx loads it with import("./Grid"). Reproduce by building a minimal Start app and grepping the entry chunk for the marker string. Done means heavy is absent from the entry chunk, which needs understanding of how the TanStack Start plugin builds the module graph on top of Rolldown.
由索引模型根据 Issue 内容生成。
描述
Unused export * re-export is kept in the entry chunk under TanStack Start
Versions
@tanstack/react-start1.169.5@tanstack/react-router1.170.46vite8.3.8 (Rolldown 1.2.19)@vitejs/plugin-react6.3.0- React 19.3.1
Minimal structure
// src/console/Grid.tsx
import { heavy } from "./heavy" // ~12 kB of marker code
export function Grid() { return <div>{heavy("x")}</div> }
// src/ui/index.ts
export * from "../console/Grid"
export { other } from "./other"
// src/routes/__root.tsx
import { other } from "../ui" // only `other` is used
export const Route = createRootRoute({ component: () => <><div>{other}</div><Outlet /></> })
// src/console/LazyGrid.tsx
const Grid = lazy(() => import("./Grid").then((m) => ({ default: m.Grid })))
export function LazyGrid() { return <Suspense fallback={null}><Grid /></Suspense> }
// routes under /app import LazyGrid only
Expected
heavy is not reachable from the entry: Grid is only reached through the
lazy import("./Grid"), and the export * re-export in src/ui/index.ts is
unused. heavy should stay in the lazy Grid chunk (or be dropped entirely).
Actual
heavy is emitted into dist/client/assets/index-*.js (the entry chunk) and
is therefore preloaded by every route.
Verification
grep -l HEAVY_MARKER dist/client/assets/*.js
# actual: dist/client/assets/index-*.js
The same structure built with vanilla Vite (no Start) drops HEAVY_MARKER
entirely, so this appears to be the Start plugin's module/chunk graph, not
Rolldown's general tree-shaking.
Why it matters
In a large Start app this is ~139 kB of @tanstack/table-core source plus
~74 kB of @tanstack/virtual-core in the entry, even though the only importer
is a lazily loaded DataGrid; the storefront and login preload it and the
route-group bundle budgets pay for it.
- 主要语言
- TypeScript
- 星标
- 15.3k
- 派生
- 1.9k
- 平均合并
- 1 天 5 小时
- 30 天内合并 PR
- 46
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/router 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
Masked navigation drops the first character of the hash each time (__tempLocation hash missing '#')可能已有人在做 @hassanabrar202 于 8 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
router-generator: lazy-load Prettier (costs ~300–450ms per build even when formatting is off)可能已有人在做 @Sheraff 于 27 天前认领。 未关闭package: router-generator performance
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
router-generator: sibling `physical()` subtrees in a virtual route config generate duplicate identifiers可能已有人在做 @Sheraff 于 27 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
docs(router): clarify static title fallback in SPA mode可能已有人在做 @Rohan-Dedhia 于 18 天前认领。 未关闭
难度 1/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
相似的 Issue
-
[BUG]: Shared links drop the configured basePath on GitHub Pages可能已有人在做 @anshulchikhale30-p 今天认领。 未关闭bug
难度 1/5 1 小时以内 新手友好度 88/100
StabilityNexus/IdentityTokens-EVM-Frontend#182 · 1 条评论 ·
维护者通常 1 天内回复
-
Add: GTrekker未关闭check:passed streams:add
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
Koenkk/zigbee-herdsman-converters#13900 ·
维护者通常 1 天内回复
-
area: ui Bug Payload OSS
难度 1/5 1 小时以内 新手友好度 88/100
payloadcms/payload#19839 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
jeanibarz/knowledge-base-mcp-server#1291 ·
维护者通常 1 天内回复