Lit quick-start examples pass one type argument to a controller that requires twelve
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 88/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
从 docs/framework/lit/quick-start.md 中第 16 行附近的两个示例开始,并将它们与 packages/lit-form/src/tanstack-form-controller.ts 第 226 行 controller 上的十二个泛型参数进行比较。通过用 TypeScript strict mode 编译 starter 片段来复现;完成意味着两个 Lit quick-start 示例都通过类型检查,可能是通过去掉单个 <Employee> 参数并改为给 defaultValues 标注类型。检查完整示例的 FieldApi<Employee, 'firstName'> 注解是否一致。
由索引模型根据 Issue 内容生成。
描述
Hullo folks,
I’m doing some research for Tessl Code Review and ran it against your repo. It flagged a potential issue, and I figured it made sense to share it with you:
Describe the bug
The Lit quick-start still constructs new TanStackFormController<Employee>(this, ...), but the current controller has twelve required generic parameters. Copying that starter into a TypeScript Lit component produces TS2558.
This surfaced in a retrospective review of merged PR #2252. The same mismatch remains at 7a213d2: both quick-start examples supply one argument, while the class declaration supplies no defaults for the remaining parameters.
Minimal reproduction
import { LitElement } from 'lit';
import { TanStackFormController } from '@tanstack/lit-form';
interface Employee {
firstName: string;
lastName: string;
employed: boolean;
jobTitle: string;
}
export class TestForm extends LitElement {
form = new TanStackFormController<Employee>(this, {
defaultValues: {
firstName: '', lastName: '', employed: false, jobTitle: '',
},
});
}
Codex ran TypeScript 5.8.3 with --strict --noEmit against the actual controller source from this checkout, resolving form-core 1.33.5, lit-store 0.13.2 and Lit 3.3.1. The only diagnostic was:
error TS2558: Expected 12 type arguments, but got 1.
The public documentation above is the source example for reproducing this.
Expected behavior / workaround
The introductory example should type-check with the current controller. Omitting <Employee> and typing defaultValues as Employee lets the controller infer its generics; that control compiled without diagnostics in the same environment.
The complete example also explicitly annotates FieldApi<Employee, 'firstName'>, so reviewing its generic annotations together would help keep the page consistent.
Environment
Current checkout 7a213d2 (lit-form package version 1.25.5), TypeScript 5.8.3, macOS 27.2. This verifies the compile-time starter issue; it does not claim a rendered Lit application test.
Full transparency: I work at Tessl, and we've spotted that using Tessl Code Review - using repository-level context and specific review lenses that improve over time through feedback. That’s how this finding surfaced.
We’re just getting started and want to offer the tool free to open-source projects. If this is useful, happy to give you access.
Bap
- 主要语言
- TypeScript
- 星标
- 6.8k
- 派生
- 717
- 平均合并
- 5 天 22 小时
- 30 天内合并 PR
- 14
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/form 的其他 Issue
-
Submit listener exceptions leave isSubmitting stuck true可能已有人在做 @henricop 于 14 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
handleSubmit calls onSubmit again while a submit is still pending (since 1.33.1)可能已有人在做 @twotnguyen 于 14 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
`isDefaultValue` is wrong when a field-level `defaultValue` is `null`可能已有人在做 @fenet-as 于 40 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
Async validator doesn't re-trigger `isValidating` after first failed validation可能已有人在做 @drewsephski 于 44 天前认领。 未关闭
难度 2/5 1-2 天 新手友好度 72/100
维护者通常 1 天内回复
-
[v2 alpha] devtools are always light mode可能已有人在做 @dikshit-n 于 78 天前认领。 未关闭area: runtime scope: devtools type: bug v2
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
thecodacus/understory#61 ·
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
Termix-SSH/Plugin-Hosts-Config#14 · 1 条评论 ·
维护者通常 4 天内回复
-
ai-generated priority: p2 size: s type: bug
难度 2/5 1-3 小时 新手友好度 82/100
JonathanTSilva/jts-website#92 ·
维护者通常 1 天内回复
-
Toast announcer reads a doubled period when a toast's title ends in punctuation可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
vercel-labs/ui#999 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
ehmpathy/rhachet-roles-ehmpathy#1443 ·
维护者通常 1 天内回复