Skip to content

Commit 11caab2

Browse files
chore: TanStack workspace upgrades (#744)
* Set type module in examples * Update to pnpm v9 * Update Nx, knip, tanstack config * Move tests folders * Update packages * Add eslint * Fix eslint * Update packages * Final updates * pnpm dedupe
1 parent e02207d commit 11caab2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+6491
-5375
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto eol=lf

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ jobs:
2727
with:
2828
fetch-depth: '0'
2929
- name: Setup pnpm
30-
uses: pnpm/action-setup@v2
31-
with:
32-
version: 8
30+
uses: pnpm/action-setup@v4
3331
- name: Setup Node
3432
uses: actions/setup-node@v4
3533
with:

.github/workflows/pr.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ jobs:
2424
with:
2525
fetch-depth: 0
2626
- name: Setup pnpm
27-
uses: pnpm/action-setup@v2
28-
with:
29-
version: 8
27+
uses: pnpm/action-setup@v4
3028
- name: Setup Node
3129
uses: actions/setup-node@v4
3230
with:

.gitignore

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,13 @@
33

44
# dependencies
55
node_modules
6+
package-lock.json
7+
yarn.lock
68

79
# builds
8-
types
910
build
10-
*/build
11-
dist
12-
lib
13-
es
14-
artifacts
15-
.rpt2_cache
1611
coverage
17-
*.tgz
12+
dist
1813

1914
# misc
2015
.DS_Store
@@ -34,13 +29,14 @@ stats-hydration.json
3429
stats.json
3530
stats.html
3631
.vscode/settings.json
37-
.idea
3832

3933
*.log
40-
.DS_Store
4134
.cache
35+
.idea
4236
.nx/cache
37+
.nx/workspace-data
4338
.pnpm-store
39+
.tsup
4440
.svelte-kit
4541

4642
vite.config.js.timestamp-*

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
link-workspace-packages=true
12
prefer-workspace-packages=true

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18.19.0
1+
v18.20.3

eslint.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// @ts-check
2+
3+
// @ts-expect-error
4+
import { tanstackConfig } from '@tanstack/config/eslint'
5+
6+
export default [
7+
...tanstackConfig,
8+
{
9+
name: 'tanstack/temp',
10+
rules: {
11+
'ts/ban-types': 'off',
12+
'ts/naming-convention': 'off',
13+
'ts/no-unnecessary-condition': 'off',
14+
'no-self-assign': 'off',
15+
},
16+
},
17+
]

examples/lit/dynamic/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "tanstack-lit-virtual-example-dynamic",
33
"private": true,
4+
"type": "module",
45
"scripts": {
56
"dev": "vite",
67
"build": "tsc && vite build",
@@ -13,9 +14,8 @@
1314
"lit": "^3.1.3"
1415
},
1516
"devDependencies": {
16-
"@rollup/plugin-replace": "^5.0.2",
1717
"@types/node": "^18.19.3",
1818
"typescript": "5.2.2",
19-
"vite": "^5.1.3"
19+
"vite": "^5.3.2"
2020
}
2121
}

examples/lit/fixed/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "tanstack-lit-virtual-example-fixed",
33
"private": true,
4+
"type": "module",
45
"scripts": {
56
"dev": "vite",
67
"build": "tsc && vite build",
@@ -13,9 +14,8 @@
1314
"lit": "^3.1.3"
1415
},
1516
"devDependencies": {
16-
"@rollup/plugin-replace": "^5.0.2",
1717
"@types/node": "^18.19.3",
1818
"typescript": "5.2.2",
19-
"vite": "^5.1.3"
19+
"vite": "^5.3.2"
2020
}
2121
}

examples/react/dynamic/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "tanstack-react-virtual-example-dynamic",
33
"private": true,
4+
"type": "module",
45
"scripts": {
56
"dev": "vite",
67
"build": "tsc && vite build",
@@ -9,16 +10,15 @@
910
"dependencies": {
1011
"@faker-js/faker": "^7.6.0",
1112
"@tanstack/react-virtual": "^3.7.0",
12-
"react": "^18.2.0",
13-
"react-dom": "^18.2.0"
13+
"react": "^18.3.1",
14+
"react-dom": "^18.3.1"
1415
},
1516
"devDependencies": {
16-
"@rollup/plugin-replace": "^5.0.2",
1717
"@types/node": "^18.19.3",
18-
"@types/react": "^18.2.56",
19-
"@types/react-dom": "^18.2.19",
20-
"@vitejs/plugin-react": "^4.2.1",
18+
"@types/react": "^18.3.3",
19+
"@types/react-dom": "^18.3.0",
20+
"@vitejs/plugin-react": "^4.3.1",
2121
"typescript": "5.2.2",
22-
"vite": "^5.1.3"
22+
"vite": "^5.3.2"
2323
}
2424
}

examples/react/fixed/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
22
"name": "tanstack-react-virtual-example-fixed",
33
"private": true,
4+
"type": "module",
45
"scripts": {
56
"dev": "vite",
67
"build": "tsc && vite build",
78
"serve": "vite preview"
89
},
910
"dependencies": {
1011
"@tanstack/react-virtual": "^3.7.0",
11-
"react": "^18.2.0",
12-
"react-dom": "^18.2.0"
12+
"react": "^18.3.1",
13+
"react-dom": "^18.3.1"
1314
},
1415
"devDependencies": {
15-
"@rollup/plugin-replace": "^5.0.2",
1616
"@types/node": "^18.19.3",
17-
"@types/react": "^18.2.56",
18-
"@types/react-dom": "^18.2.19",
19-
"@vitejs/plugin-react": "^4.2.1",
17+
"@types/react": "^18.3.3",
18+
"@types/react-dom": "^18.3.0",
19+
"@vitejs/plugin-react": "^4.3.1",
2020
"typescript": "5.2.2",
21-
"vite": "^5.1.3"
21+
"vite": "^5.3.2"
2222
}
2323
}
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "tanstack-react-virtual-example-infinite-scroll",
3-
"version": "0.0.0",
43
"private": true,
4+
"type": "module",
55
"scripts": {
66
"dev": "vite",
77
"build": "vite build",
@@ -10,14 +10,12 @@
1010
},
1111
"dependencies": {
1212
"@tanstack/react-virtual": "^3.7.0",
13-
"axios": "^0.26.1",
14-
"react": "^18.2.0",
15-
"react-dom": "^18.2.0",
16-
"react-query": "^3.39.1"
13+
"react": "^18.3.1",
14+
"react-dom": "^18.3.1",
15+
"@tanstack/react-query": "^5.48.0"
1716
},
1817
"devDependencies": {
19-
"@rollup/plugin-replace": "^5.0.2",
20-
"@vitejs/plugin-react": "^4.2.1",
21-
"vite": "^5.1.3"
18+
"@vitejs/plugin-react": "^4.3.1",
19+
"vite": "^5.3.2"
2220
}
2321
}

examples/react/infinite-scroll/src/main.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import React from 'react'
22
import ReactDOM from 'react-dom'
3-
import axios from 'axios'
4-
import { QueryClient, QueryClientProvider, useInfiniteQuery } from 'react-query'
3+
import {
4+
QueryClient,
5+
QueryClientProvider,
6+
useInfiniteQuery,
7+
} from '@tanstack/react-query'
58

69
import './index.css'
710

@@ -31,13 +34,11 @@ function App() {
3134
isFetchingNextPage,
3235
fetchNextPage,
3336
hasNextPage,
34-
} = useInfiniteQuery(
35-
'projects',
36-
(ctx) => fetchServerPage(10, ctx.pageParam),
37-
{
38-
getNextPageParam: (_lastGroup, groups) => groups.length,
39-
},
40-
)
37+
} = useInfiniteQuery({
38+
queryKey: 'projects',
39+
queryFn: (ctx) => fetchServerPage(10, ctx.pageParam),
40+
getNextPageParam: (_lastGroup, groups) => groups.length,
41+
})
4142

4243
const allRows = data ? data.pages.flatMap((d) => d.rows) : []
4344

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import * as path from 'path'
21
import { defineConfig } from 'vite'
32
import react from '@vitejs/plugin-react'
4-
import rollupReplace from '@rollup/plugin-replace'
53

6-
// https://vitejs.dev/config/
74
export default defineConfig({
85
plugins: [react()],
96
})

examples/react/padding/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
{
22
"name": "tanstack-react-virtual-example-padding",
3-
"version": "0.0.0",
43
"private": true,
4+
"type": "module",
55
"scripts": {
66
"dev": "vite",
77
"build": "vite build",
88
"serve": "vite preview --port 3001",
99
"start": "vite"
1010
},
1111
"dependencies": {
12-
"react": "^18.2.0",
13-
"react-dom": "^18.2.0",
12+
"react": "^18.3.1",
13+
"react-dom": "^18.3.1",
1414
"@tanstack/react-virtual": "^3.7.0"
1515
},
1616
"devDependencies": {
17-
"@rollup/plugin-replace": "^5.0.2",
18-
"@vitejs/plugin-react": "^4.2.1",
19-
"vite": "^5.1.3"
17+
"@vitejs/plugin-react": "^4.3.1",
18+
"vite": "^5.3.2"
2019
}
2120
}

examples/react/padding/vite.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import * as path from 'path'
21
import { defineConfig } from 'vite'
32
import react from '@vitejs/plugin-react'
4-
import rollupReplace from '@rollup/plugin-replace'
53

6-
// https://vitejs.dev/config/
74
export default defineConfig({
85
plugins: [react()],
96
})
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
{
22
"name": "tanstack-react-virtual-example-scroll-padding",
3-
"version": "0.0.0",
43
"private": true,
4+
"type": "module",
55
"scripts": {
66
"dev": "vite",
77
"build": "vite build",
88
"serve": "vite preview --port 3001",
99
"start": "vite"
1010
},
1111
"dependencies": {
12-
"@react-hookz/web": "^14.2.2",
12+
"@react-hookz/web": "^24.0.4",
1313
"@tanstack/react-virtual": "^3.7.0",
14-
"react": "^18.2.0",
15-
"react-dom": "^18.2.0"
14+
"react": "^18.3.1",
15+
"react-dom": "^18.3.1"
1616
},
1717
"devDependencies": {
18-
"@rollup/plugin-replace": "^5.0.2",
19-
"@vitejs/plugin-react": "^4.2.1",
20-
"vite": "^5.1.3"
18+
"@vitejs/plugin-react": "^4.3.1",
19+
"vite": "^5.3.2"
2120
}
2221
}

examples/react/scroll-padding/src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import ReactDOM from 'react-dom'
33

44
import './index.css'
55

6-
import { useMeasure } from '@react-hookz/web/esm'
6+
import { useMeasure } from '@react-hookz/web'
77
import { useVirtualizer } from '@tanstack/react-virtual'
88

99
function App() {
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import * as path from 'path'
21
import { defineConfig } from 'vite'
32
import react from '@vitejs/plugin-react'
4-
import rollupReplace from '@rollup/plugin-replace'
53

6-
// https://vitejs.dev/config/
74
export default defineConfig({
85
plugins: [react()],
96
})
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
{
22
"name": "tanstack-react-virtual-example-smooth-scroll",
3-
"version": "0.0.0",
43
"private": true,
4+
"type": "module",
55
"scripts": {
66
"dev": "vite",
77
"build": "vite build",
88
"serve": "vite preview --port 3001",
99
"start": "vite"
1010
},
1111
"dependencies": {
12-
"react": "^18.2.0",
13-
"react-dom": "^18.2.0",
12+
"react": "^18.3.1",
13+
"react-dom": "^18.3.1",
1414
"@tanstack/react-virtual": "^3.7.0"
1515
},
1616
"devDependencies": {
17-
"@rollup/plugin-replace": "^5.0.2",
18-
"@vitejs/plugin-react": "^4.2.1",
19-
"vite": "^5.1.3"
17+
"@vitejs/plugin-react": "^4.3.1",
18+
"vite": "^5.3.2"
2019
}
2120
}
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import * as path from 'path'
21
import { defineConfig } from 'vite'
32
import react from '@vitejs/plugin-react'
4-
import rollupReplace from '@rollup/plugin-replace'
53

6-
// https://vitejs.dev/config/
74
export default defineConfig({
85
plugins: [react()],
96
})

0 commit comments

Comments
 (0)