table-core 9.2.5+: private types leak from .d.ts files, declaration emit fails with TS2883
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 74/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- build-system, testing
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 28.5k
- Fork
- 3.6k
- Merge medio
- 17h 39m
- PR unite (30g)
- 10
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TanStack/table
-
Issue template renders `react-table`, not `TanStack/table`Forse già presa @vishruthasgowda l’ha presa 15 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
TanStack/table#6595 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[svelte] createTableHook: App* wrappers call setContext in the parent's component context (set_context_after_init when showing a column)Forse già presa @india3Eth l’ha presa 1 giorno fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
TanStack/table#6601 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Cast required to access custom options when defining a custom plugin/featureForse già presa @sorena-paydar l’ha presa 16 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
`aggregatedCell` not typed against bound `cellComponents` in `createAppColumnHelper`Forse già presa @cpruijsen l’ha presa 27 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di TanStack/table
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
siyuan-note/siyuan#20313 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
alunduil/projects-v2-sync#14 ·
-
Service process inherits the caller's cwd at first use, holding that folder open on Windows (EBUSY)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
DevTools page styles leak into the host app in developmentForse già presa @onmax l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
nuxt-modules/better-auth#567 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno