Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.15.1
24.8.0
2 changes: 1 addition & 1 deletion examples/angular/filters/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@if (!header.isPlaceholder) {
<div
[ngClass]="{
'cursor-pointer select-none': header.column.getCanSort()
'cursor-pointer select-none': header.column.getCanSort(),
}"
>
<ng-container
Expand Down
5 changes: 2 additions & 3 deletions examples/vue/filters/src/Filter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ const props = defineProps({
required: true,
},
})
const firstValue = computed(
() =>
props.table.getPreFilteredRowModel().flatRows[0]?.getValue(props.column.id)
const firstValue = computed(() =>
props.table.getPreFilteredRowModel().flatRows[0]?.getValue(props.column.id)
)
const columnFilterValue = computed(() => props.column.getFilterValue())
const sortedUniqueValues = computed(() =>
Expand Down
59 changes: 28 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"namespace": "@tanstack",
"private": true,
"repository": "https://github.com/tanstack/table.git",
"packageManager": "pnpm@8.12.1",
"packageManager": "pnpm@10.16.1",
"type": "module",
"scripts": {
"clean": "pnpm --filter \"./packages/**\" run clean",
Expand All @@ -23,8 +23,8 @@
"dev": "pnpm run watch",
"prettier": "prettier --ignore-unknown '**/*'",
"prettier:write": "pnpm run prettier --write",
"cipublish": "node scripts/publish.js",
"verify-links": "node scripts/verify-links.ts"
"verify-links": "node scripts/verify-links.ts",
"cipublish": "node scripts/publish.js"
Comment on lines +26 to +27
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

verify-links will fail: Node can't execute TypeScript directly.

The script runs a .ts file with plain node, but ts-node/tsx isn’t present (ts-node was removed in this PR). This will exit with a syntax error on the first type.

Apply one of the following. Option A (preferred) adds tsx:

   "prettier:write": "pnpm run prettier --write",
-  "verify-links": "node scripts/verify-links.ts",
+  "verify-links": "tsx scripts/verify-links.ts",
   "cipublish": "node scripts/publish.js"

and in devDependencies:

   "tinyglobby": "^0.2.15",
+  "tsx": "^4.16.0",
   "typescript": "5.4.5",

Option B: transpile the script to JS (e.g., scripts/verify-links.mjs) and keep using node. If you choose B, ensure the compiled file is committed or generated before use.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"verify-links": "node scripts/verify-links.ts",
"cipublish": "node scripts/publish.js"
"verify-links": "tsx scripts/verify-links.ts",
"cipublish": "node scripts/publish.js"
🤖 Prompt for AI Agents
In package.json around lines 26-27, the "verify-links" script invokes a
TypeScript (.ts) file directly with node which will fail; fix it by either
(preferred) adding a devDependency for "tsx" and updating the script to run the
TS file via tsx, or (alternate) transpiling the script to JavaScript (e.g., to
an .mjs file) and changing the script to run the compiled JS with node (ensure
the compiled file is committed or produced before running).

},
"nx": {
"includedScripts": [
Expand All @@ -44,40 +44,37 @@
}
],
"devDependencies": {
"@babel/core": "^7.24.3",
"@babel/preset-env": "^7.24.3",
"@babel/preset-react": "^7.24.1",
"@babel/preset-typescript": "^7.24.1",
"@babel/core": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@faker-js/faker": "^8.4.1",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.5",
"@rollup/plugin-replace": "^5.0.7",
"@rollup/plugin-terser": "^0.4.4",
"@size-limit/preset-small-lib": "^11.1.2",
"@tanstack/config": "^0.6.0",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.2",
"@size-limit/preset-small-lib": "^11.1.4",
"@tanstack/config": "^0.13.0",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
"@testing-library/react-hooks": "^8.0.1",
"@types/node": "^20.11.30",
"jsdom": "^24.0.0",
"knip": "^5.5.0",
"nx": "^18.1.3",
"prettier": "^4.0.0-alpha.8",
"prettier-plugin-svelte": "^3.2.2",
"rimraf": "^5.0.5",
"rollup": "^4.13.0",
"@types/node": "^20.14.9",
"jsdom": "^24.1.0",
"knip": "^5.23.2",
"markdown-link-extractor": "^4.0.2",
"nx": "^19.3.2",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.5",
"rimraf": "^5.0.7",
"rollup": "^4.18.0",
"rollup-plugin-size": "^0.3.1",
"rollup-plugin-svelte": "^7.2.0",
"rollup-plugin-svelte": "^7.2.2",
"rollup-plugin-visualizer": "^5.12.0",
"sherif": "^0.8.1",
"size-limit": "^11.1.2",
"typescript": "5.4.3",
"vitest": "^1.4.0",
"@types/glob": "^8.1.0",
"fast-glob": "^3.3.3",
"glob": "^8.1.0",
"markdown-link-extractor": "^4.0.2",
"ts-node": "^10.9.2"
"sherif": "^0.9.0",
"size-limit": "^11.1.4",
"tinyglobby": "^0.2.15",
"typescript": "5.4.5",
"vitest": "^1.6.0"
}
}
4 changes: 2 additions & 2 deletions packages/table-core/src/filterFns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ const arrIncludesSome: FilterFn<any> = (
columnId: string,
filterValue: unknown[]
) => {
return filterValue.some(
val => row.getValue<unknown[]>(columnId)?.includes(val)
return filterValue.some(val =>
row.getValue<unknown[]>(columnId)?.includes(val)
)
}

Expand Down
11 changes: 6 additions & 5 deletions packages/table-core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ type DeepKeysPrefix<
? `${TPrefix}.${DeepKeys<T[TPrefix], [...TDepth, any]> & string}`
: never

export type DeepValue<T, TProp> = T extends Record<string | number, any>
? TProp extends `${infer TBranch}.${infer TDeepProp}`
? DeepValue<T[TBranch], TDeepProp>
: T[TProp & string]
: never
export type DeepValue<T, TProp> =
T extends Record<string | number, any>
? TProp extends `${infer TBranch}.${infer TDeepProp}`
? DeepValue<T[TBranch], TDeepProp>
: T[TProp & string]
: never

export type NoInfer<T> = [T][T extends any ? 0 : never]

Expand Down
4 changes: 2 additions & 2 deletions packages/table-core/src/utils/getSortedRowModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export function getSortedRowModel<TData extends RowData>(): (
const sortedFlatRows: Row<TData>[] = []

// Filter out sortings that correspond to non existing columns
const availableSorting = sortingState.filter(
sort => table.getColumn(sort.id)?.getCanSort()
const availableSorting = sortingState.filter(sort =>
table.getColumn(sort.id)?.getCanSort()
)

const columnInfoById: Record<
Expand Down
Loading
Loading