Skip to content

Commit a33f87b

Browse files
feat: Remove UMD build output (#5517)
1 parent 359a082 commit a33f87b

File tree

20 files changed

+58
-280
lines changed

20 files changed

+58
-280
lines changed

docs/react/installation.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ id: installation
33
title: Installation
44
---
55

6-
You can install React Query via [NPM](https://npmjs.com),
6+
You can install React Query via [NPM](https://npmjs.com/),
77
or a good ol' `<script>` via
8-
[unpkg.com](https://unpkg.com).
8+
[ESM.sh](https://esm.sh/).
99

1010
> v5 is currently in alpha.
1111
@@ -25,15 +25,17 @@ React Query is compatible with React v18+ and works with ReactDOM and React Nati
2525
2626
### CDN
2727

28-
If you're not using a module bundler or package manager we also have a global ("UMD") build hosted on the [unpkg.com](https://unpkg.com) CDN. Simply add the following `<script>` tag to the bottom of your HTML file:
28+
If you're not using a module bundler or package manager, you can also use this library via an ESM-compatible CDN such as [ESM.sh](https://esm.sh/). Simply add a `<script type="module">` tag to the bottom of your HTML file:
2929

3030
```html
31-
<script src="https://unpkg.com/@tanstack/react-query@alpha/build/umd/index.production.js"></script>
31+
<script type="module">
32+
import React from 'https://esm.sh/[email protected]'
33+
import ReactDOM from 'https://esm.sh/[email protected]'
34+
import { QueryClient } from 'https://esm.sh/@tanstack/react-query@alpha'
35+
</script>
3236
```
3337

34-
Once you've added this you will have access to the `window.ReactQuery` object and its exports.
35-
36-
> This installation/usage requires the [React CDN script bundles](https://reactjs.org/docs/cdn-links.html) to be on the page as well.
38+
> You can find instructions on how to use React without JSX [here](https://react.dev/reference/react/createElement#creating-an-element-without-jsx).
3739
3840
### Requirements
3941

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"@rollup/plugin-commonjs": "^25.0.0",
4141
"@rollup/plugin-node-resolve": "^15.0.2",
4242
"@rollup/plugin-replace": "^5.0.2",
43-
"@rollup/plugin-terser": "^0.4.3",
4443
"@solidjs/testing-library": "^0.5.1",
4544
"@testing-library/jest-dom": "^5.16.5",
4645
"@testing-library/react": "^14.0.0",
@@ -83,7 +82,6 @@
8382
"rimraf": "^5.0.1",
8483
"rollup": "^3.23.0",
8584
"rollup-plugin-preserve-directives": "^0.2.0",
86-
"rollup-plugin-size": "^0.3.1",
8785
"rollup-plugin-visualizer": "^5.9.0",
8886
"rollup-preset-solid": "^2.0.1",
8987
"semver": "^7.5.1",
@@ -97,7 +95,7 @@
9795
"bundlewatch": {
9896
"files": [
9997
{
100-
"path": "packages/*/build/umd/*.production.js"
98+
"path": "packages/*/build/lib/*.js"
10199
}
102100
]
103101
},

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"sideEffects": false,
2626
"files": [
2727
"build/lib/*",
28-
"build/umd/*",
2928
"src"
3029
],
3130
"scripts": {

packages/query-broadcast-client-experimental/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"sideEffects": false,
2626
"files": [
2727
"build/lib/*",
28-
"build/umd/*",
2928
"src"
3029
],
3130
"scripts": {

packages/query-core/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"sideEffects": false,
2626
"files": [
2727
"build/lib/*",
28-
"build/umd/*",
2928
"src"
3029
],
3130
"scripts": {

packages/query-devtools/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
},
1313
"type": "commonjs",
1414
"types": "build/types/index.d.ts",
15-
"main": "build/umd/index.js",
15+
"main": "build/cjs/index.js",
1616
"module": "build/esm/index.mjs",
1717
"exports": {
1818
".": {
1919
"types": "./build/types/index.d.ts",
2020
"import": "./build/esm/index.mjs",
21-
"require": "./build/umd/index.js",
22-
"default": "./build/umd/index.js"
21+
"require": "./build/cjs/index.js",
22+
"default": "./build/cjs/index.js"
2323
},
2424
"./package.json": "./package.json"
2525
},

packages/query-persist-client-core/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"sideEffects": false,
2626
"files": [
2727
"build/lib/*",
28-
"build/umd/*",
2928
"src"
3029
],
3130
"scripts": {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"sideEffects": false,
2626
"files": [
2727
"build/lib/*",
28-
"build/umd/*",
2928
"src"
3029
],
3130
"scripts": {

packages/react-query-devtools/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"sideEffects": false,
3636
"files": [
3737
"build/lib/*",
38-
"build/umd/*",
3938
"src"
4039
],
4140
"scripts": {

packages/react-query-devtools/rollup.config.mjs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { defineConfig } from 'rollup'
44
import { buildConfigs } from '../../scripts/getRollupConfig.mjs'
55

66
export default defineConfig([
7-
...buildConfigs({
7+
buildConfigs({
88
name: 'react-query-devtools',
99
jsName: 'ReactQueryDevtools',
1010
outputFile: 'index',
@@ -15,9 +15,8 @@ export default defineConfig([
1515
'@tanstack/react-query': 'ReactQuery',
1616
'@tanstack/query-devtools': 'TanstackQueryDevtools',
1717
},
18-
bundleUMDGlobals: ['@tanstack/query-devtools'],
1918
}),
20-
...buildConfigs({
19+
buildConfigs({
2120
name: 'react-query-devtools-prod',
2221
jsName: 'ReactQueryDevtools',
2322
outputFile: 'index.prod',
@@ -31,6 +30,5 @@ export default defineConfig([
3130
},
3231
forceDevEnv: true,
3332
forceBundle: true,
34-
skipUmdBuild: true,
3533
}),
3634
])

packages/react-query-persist-client/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"sideEffects": false,
2626
"files": [
2727
"build/lib/*",
28-
"build/umd/*",
2928
"src"
3029
],
3130
"scripts": {

packages/react-query-persist-client/rollup.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ export default defineConfig(
1414
'@tanstack/query-persist-client-core': 'QueryPersistClientCore',
1515
'@tanstack/react-query': 'ReactQuery',
1616
},
17-
bundleUMDGlobals: ['@tanstack/query-persist-client-core'],
1817
}),
1918
)

packages/react-query/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
},
3737
"files": [
3838
"build/lib/*",
39-
"build/umd/*",
4039
"src",
4140
"build/codemods",
4241
"!build/codemods/jest.config.js",

packages/react-query/rollup.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ export default defineConfig(
1515
'@tanstack/query-core': 'QueryCore',
1616
'react-native': 'ReactNative',
1717
},
18-
bundleUMDGlobals: ['@tanstack/query-core'],
1918
}),
2019
)

packages/solid-query/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"files": [
4646
"build/esm/*",
4747
"build/cjs/*",
48-
"build/umd/*",
4948
"build/source/*",
5049
"build/types/*",
5150
"src"

packages/vue-query/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
"files": [
4444
"build/lib/*",
45-
"build/umd/*"
45+
"src"
4646
],
4747
"dependencies": {
4848
"@tanstack/query-core": "^5.0.0-alpha.43",

packages/vue-query/rollup.config.mjs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,5 @@ export default defineConfig(
1616
'@tanstack/match-sorter-utils': 'MatchSorter',
1717
'@vue/devtools-api': 'DevtoolsApi',
1818
},
19-
bundleUMDGlobals: [
20-
'@tanstack/query-core',
21-
'@tanstack/match-sorter-utils',
22-
'@vue/devtools-api',
23-
],
2419
}),
2520
)

pnpm-lock.yaml

Lines changed: 0 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)