mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
DataTable accepted any mix of its 40-odd props and rejected the incoherent combinations at runtime, from a validator that threw during the first render. A caller only found out it had wired server sorting without a `sorting` prop when the page blew up in front of them. Split the public prop type into mode-keyed unions instead, so the compiler rejects those combinations at the call site. `validateDataTableConfig` and `DataTableConfigError` go away; the component body reads an unchanged flat `DataTableResolvedProps`, which every union member is assignable to, so there is no narrowing inside it. All 44 existing call sites typecheck against the new union unchanged, which `next build` covers. That build only typechecks the app module graph, so the prop type itself needed a gate of its own: `npm run test:types` runs vitest's typecheck mode over `*.test-d.tsx`, and the unit workflow now runs it. The four guards deleted from `DataTable.test.tsx` come back there as compile-time assertions, and loosening the union back to the flat shape fails all five. |
||
|---|---|---|
| .. | ||
| actions | ||
| codeql | ||
| ISSUE_TEMPLATE | ||
| observatory | ||
| screenshots | ||
| scripts | ||
| workflows | ||
| ci-coverage-allowlist.yml | ||
| CODEOWNERS | ||
| dependabot.yaml | ||
| deploy-on-aws.png | ||
| deploy-on-gcp.png | ||
| deploy-to-aws.png | ||
| FUNDING.yml | ||
| pull_request_template.md | ||
| template.yaml | ||