table-core 9.2.5+: private types leak from .d.ts files, declaration emit fails with TS2883
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 74/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- build-system, testing
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 28.5k
- フォーク
- 3.6k
- 平均マージ
- 17時間 39分
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/table のほかの issue
-
Issue template renders `react-table`, not `TanStack/table`対応中かも @vishruthasgowda が 15 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
TanStack/table#6595 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[svelte] createTableHook: App* wrappers call setContext in the parent's component context (set_context_after_init when showing a column)対応中かも @india3Eth が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
TanStack/table#6601 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Cast required to access custom options when defining a custom plugin/feature対応中かも @sorena-paydar が 16 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
`aggregatedCell` not typed against bound `cellComponents` in `createAppColumnHelper`対応中かも @cpruijsen が 26 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
Tenant
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
MTES-MCT/Dossier-Facile-Frontend#2061 ·
メンテナーはふだん 1 日以内に返信
-
area:frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
interledger/publisher-tools#905 ·
メンテナーはふだん 1 日以内に返信
-
Add: Cbeebies PL SDオープンapproved check:passed streams:add
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
iptv-org/iptv#54525 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
DB-plane provider_chat_options.* is accepted by config set but never merged into the loaded config対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
area:web
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
praetorianer777/GoTome#178 ·
メンテナーはふだん 1 日以内に返信