table-core 9.2.5+: private types leak from .d.ts files, declaration emit fails with TS2883
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 74/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
- Bereich
- build-system, testing
Rechercherichtung
Start with scripts/rewrite-table-core-dts.mjs and inspect how it rewrites declaration files; reproduce the failure with the provided TypeScript consumer and package versions. Check the built dist declarations through the package exports map, since tests/declaration-emit imports from src. Done when the consumer declaration emit succeeds and the declaration test covers the built package.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
TanStack Table version
@tanstack/table-core 9.2.6 (since 9.2.5; 9.2.4 is fine)
Framework/Library version
TypeScript 6.0.3 (framework-agnostic)
Describe the bug and the steps to reproduce it
Declaration emit in a consumer fails since 9.2.5:
index.ts(3,14): error TS2883: The inferred type of 'min' cannot be named without a reference to 'RangeValue' from './node_modules/@tanstack/table-core/dist/features/row-aggregation/aggregationFns.js'. This is likely not portable. A type annotation is necessary.
npm i @tanstack/[email protected] [email protected], then tsc -p .:
{ "compilerOptions": { "module": "NodeNext", "moduleResolution": "NodeNext", "declaration": true, "emitDeclarationOnly": true, "outDir": "out" } }
import { aggregationFn_min } from '@tanstack/table-core'
export const min = aggregationFn_min
Cause: since 9.2.5 the .d.ts files no longer end with export { … } (rolldown-plugin-dts 0.28.2+ inlines the exports). A declaration file without any export statement makes TypeScript treat every top-level declaration as exported, so private aliases such as RangeValue become referable, but only through a deep path the package exports map blocks. In 9.2.6 that is 24 private declarations across 9 files.
Appending export {}; to aggregationFns.d.ts fixes the repro, and the emitted type inlines (number | Date) | undefined as with 9.2.4.
Suggested fix until the bundler fix lands (sxzz/rolldown-plugin-dts#312, PR sxzz/rolldown-plugin-dts#310): let scripts/rewrite-table-core-dts.mjs append export {}; to declaration files that have no export {…}, export * or export =. tests/declaration-emit imports from src, so a check against the built dist through the package exports would catch this.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
Inline above. The TS Playground does not reproduce it: its fetched types ignore the exports map.
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 28.5k
- Forks
- 3.6k
- Ø Merge
- 17 Std. 39 Min.
- Gemergte PRs (30 T.)
- 10
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TanStack/table
-
Issue template renders `react-table`, not `TanStack/table`Evtl. vergeben @vishruthasgowda hat das vor 16 Tagen übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
TanStack/table#6595 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
[svelte] createTableHook: App* wrappers call setContext in the parent's component context (set_context_after_init when showing a column)Evtl. vergeben @india3Eth hat das vor 2 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 38/100
TanStack/table#6601 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Cast required to access custom options when defining a custom plugin/featureEvtl. vergeben @sorena-paydar hat das vor 17 Tagen übernommen. Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
Maintainer antworten meist innerhalb von 1 Tag
-
`aggregatedCell` not typed against bound `cellComponents` in `createAppColumnHelper`Evtl. vergeben @cpruijsen hat das vor 28 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
[Feature]: [P3] engine-rs: the package source hash should ignore line endings and untracked filesOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
maniator/verticopolis#880 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
siyuan-note/siyuan#20353 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
black-forest-labs/skills#17 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Albert-Weasker/niubigeo#168 ·
Maintainer antworten meist innerhalb von 1 Tag