Skip to content

Commit b3d7d55

Browse files
lachlancollinsTkDodoardeora
authored
feat: Replace rollup with tsup/esbuild (#5597)
Co-authored-by: Dominik Dorfmeister <[email protected]> Co-authored-by: Aryan Deora <[email protected]>
1 parent b879836 commit b3d7d55

Some content is hidden

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

59 files changed

+786
-1111
lines changed

.browserslistrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

babel.config.cjs

Lines changed: 0 additions & 50 deletions
This file was deleted.

docs/react/installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ If you're not using a module bundler or package manager, you can also use this l
4242
React Query is optimized for modern browsers. It is compatible with the following browsers config
4343

4444
```
45-
Chrome >= 84
45+
Chrome >= 91
4646
Firefox >= 90
47-
Edge >= 84
47+
Edge >= 91
4848
Safari >= 15
4949
iOS >= 15
50-
opera >= 70
50+
opera >= 77
5151
```
5252

5353
> Depending on your environment, you might need to add polyfills. If you want to support older browsers, you need to transpile the library from `node_modules` yourselves.

nx.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@
2727
},
2828
"namedInputs": {
2929
"sharedGlobals": [
30-
"{workspaceRoot}/.browserslistrc",
3130
"{workspaceRoot}/.eslintrc.cjs",
32-
"{workspaceRoot}/babel.config.cjs",
3331
"{workspaceRoot}/package.json",
34-
"{workspaceRoot}/scripts/getRollupConfig.js",
32+
"{workspaceRoot}/scripts/getTsupConfig.js",
3533
"{workspaceRoot}/tsconfig.json"
3634
],
3735
"default": [

package.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,7 @@
3131
"namespace": "@tanstack",
3232
"devDependencies": {
3333
"@arethetypeswrong/cli": "^0.6.0",
34-
"@babel/core": "^7.21.8",
35-
"@babel/preset-env": "^7.21.5",
36-
"@babel/preset-react": "^7.18.6",
37-
"@babel/preset-typescript": "^7.21.5",
3834
"@commitlint/parse": "^17.6.5",
39-
"@rollup/plugin-babel": "^6.0.3",
40-
"@rollup/plugin-commonjs": "^25.0.2",
41-
"@rollup/plugin-node-resolve": "^15.1.0",
42-
"@rollup/plugin-replace": "^5.0.2",
4335
"@solidjs/testing-library": "^0.5.1",
4436
"@testing-library/jest-dom": "^5.16.5",
4537
"@testing-library/react": "^14.0.0",
@@ -59,7 +51,6 @@
5951
"@typescript-eslint/parser": "^5.54.0",
6052
"@vitest/coverage-istanbul": "^0.33.0",
6153
"axios": "^1.4.0",
62-
"babel-preset-solid": "^1.6.10",
6354
"chalk": "^5.2.0",
6455
"concurrently": "^8.0.1",
6556
"cpy-cli": "^4.2.0",
@@ -84,9 +75,6 @@
8475
"react-dom": "^18.2.0",
8576
"rimraf": "^5.0.1",
8677
"rollup": "^3.26.0",
87-
"rollup-plugin-node-externals": "^6.1.1",
88-
"rollup-plugin-preserve-directives": "^0.2.0",
89-
"rollup-plugin-visualizer": "^5.9.2",
9078
"rollup-preset-solid": "^2.0.1",
9179
"semver": "^7.5.1",
9280
"solid-js": "^1.6.13",

packages/eslint-plugin-query/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
1313
"type": "module",
14-
"types": "build/lib/index.d.ts",
15-
"main": "build/lib/index.cjs",
16-
"module": "build/lib/index.js",
14+
"types": "build/legacy/index.d.ts",
15+
"main": "build/legacy/index.cjs",
16+
"module": "build/legacy/index.js",
1717
"exports": {
1818
".": {
1919
"import": {
20-
"types": "./build/lib/index.d.ts",
21-
"default": "./build/lib/index.js"
20+
"types": "./build/legacy/index.d.ts",
21+
"default": "./build/legacy/index.js"
2222
},
2323
"require": {
24-
"types": "./build/lib/index.d.cts",
25-
"default": "./build/lib/index.cjs"
24+
"types": "./build/legacy/index.d.cts",
25+
"default": "./build/legacy/index.cjs"
2626
}
2727
},
2828
"./package.json": "./package.json"
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
// @ts-check
22

33
import { defineConfig } from 'tsup'
4+
import { legacyConfig } from '../../scripts/getTsupConfig.js'
45

5-
export default defineConfig({
6-
entry: ['src/index.ts'],
7-
format: ['cjs', 'esm'],
8-
target: ['es2020', 'node16'],
9-
outDir: 'build/lib',
10-
dts: true,
11-
sourcemap: true,
12-
clean: true,
13-
})
6+
export default defineConfig([
7+
legacyConfig({ entry: ['src/*.ts', 'src/*.tsx'], bundle: true }),
8+
])

packages/query-async-storage-persister/package.json

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,25 @@
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
1313
"type": "module",
14-
"types": "build/lib/index.d.ts",
15-
"main": "build/lib/index.legacy.cjs",
16-
"module": "build/lib/index.legacy.js",
14+
"types": "build/legacy/index.d.ts",
15+
"main": "build/legacy/index.cjs",
16+
"module": "build/legacy/index.js",
1717
"exports": {
1818
".": {
19-
"types": "./build/lib/index.d.ts",
20-
"import": "./build/lib/index.js",
21-
"require": "./build/lib/index.cjs",
22-
"default": "./build/lib/index.cjs"
19+
"import": {
20+
"types": "./build/modern/index.d.ts",
21+
"default": "./build/modern/index.js"
22+
},
23+
"require": {
24+
"types": "./build/modern/index.d.cts",
25+
"default": "./build/modern/index.cjs"
26+
}
2327
},
2428
"./package.json": "./package.json"
2529
},
2630
"sideEffects": false,
2731
"files": [
28-
"build/lib/*",
32+
"build",
2933
"src"
3034
],
3135
"scripts": {
@@ -34,10 +38,8 @@
3438
"test:types": "tsc --noEmit",
3539
"test:lib": "vitest run --coverage",
3640
"test:lib:dev": "pnpm run test:lib --watch",
37-
"test:build": "publint --strict",
38-
"build": "pnpm build:rollup && pnpm build:types",
39-
"build:rollup": "rollup --config rollup.config.js",
40-
"build:types": "tsc --emitDeclarationOnly"
41+
"test:build": "publint --strict && attw --pack",
42+
"build": "tsup"
4143
},
4244
"dependencies": {
4345
"@tanstack/query-persist-client-core": "workspace:*"

packages/query-async-storage-persister/rollup.config.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/query-async-storage-persister/tsconfig.eslint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"compilerOptions": {
44
"noEmit": true
55
},
6-
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "rollup.config.js"]
6+
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "tsup.config.js"]
77
}

0 commit comments

Comments
 (0)