table-core 9.2.5+: private types leak from .d.ts files, declaration emit fails with TS2883
Mantenedores costumam responder em até 1 dia
Um pull request relacionado já foi integrado.
- #6620 de @MFA-G — integrado
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 74/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript
- Domínio
- build-system, testing
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 28.5k
- Forks
- 3.6k
- Merge médio
- 1d 4h
- PRs com merge (30d)
- 21
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de TanStack/table
-
svelte-table: controlled expanded and pagination state resets straight after every changeTalvez já em andamento @NickSpag assumiu há 6 dias. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 38/100
TanStack/table#6601 · 5 comentários · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
Cast required to access custom options when defining a custom plugin/featureTalvez já em andamento @sorena-paydar assumiu há 37 dias. Aberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
Mantenedores costumam responder em até 1 dia
-
`aggregatedCell` not typed against bound `cellComponents` in `createAppColumnHelper`Talvez já em andamento @cpruijsen assumiu há 48 dias. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
TanStack/table#6577 · 6 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de TanStack/table
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
marmelab/react-admin#11431 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
db-ux-design-system/core-web#8655 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
stripe/react-stripe-js#728 ·
-
[Upload Grade C dataset] the pop-up changes it's size while uploading the document => Jumping effectAbertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
epam/statgpt-admin-frontend#305 ·
Mantenedores costumam responder em até 1 dia