From 8775ab5d6224139d1350965830a57fb0074a4e78 Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Sat, 3 Feb 2024 13:25:03 +1100 Subject: [PATCH 1/6] Update Nx config --- .github/workflows/ci.yml | 1 - .github/workflows/pr.yml | 4 +--- nx.json | 5 ----- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de3baf5bf8..f53ae5f885 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,6 @@ concurrency: env: NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} - NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }} jobs: test-and-publish: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 8ee509c25c..d6b06f3d90 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -12,11 +12,9 @@ concurrency: cancel-in-progress: true env: + NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} NX_CLOUD_DISTRIBUTED_EXECUTION: true NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT: 3 - NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} - NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }} - NX_VERBOSE_LOGGING: true jobs: main: diff --git a/nx.json b/nx.json index 4fcd3a3f97..4c43445be5 100644 --- a/nx.json +++ b/nx.json @@ -4,11 +4,6 @@ "defaultBase": "main" }, "defaultBase": "main", - "pluginsConfig": { - "@nrwl/js": { - "analyzeSourceFiles": false - } - }, "nxCloudAccessToken": "ZDdkNDA4MGEtYjNmYi00MWI4LWE1N2QtYTdlNmYxMGJlZWM2fHJlYWQ=", "parallel": 5, "namedInputs": { From 4fe92c9010615c5b8dae9d7caa0b35cb7f947a88 Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Sat, 3 Feb 2024 13:42:22 +1100 Subject: [PATCH 2/6] Make nextjs examples work --- examples/react/auto-refetching/next.config.js | 5 +++++ examples/react/auto-refetching/package.json | 2 +- examples/react/infinite-query-with-max-pages/next.config.js | 5 +++++ examples/react/load-more-infinite-scroll/next.config.js | 5 +++++ examples/react/nextjs/next.config.js | 5 +++++ examples/react/optimistic-updates-cache/next.config.js | 5 +++++ examples/react/optimistic-updates-ui/next.config.js | 5 +++++ package.json | 4 ++-- 8 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 examples/react/auto-refetching/next.config.js create mode 100644 examples/react/infinite-query-with-max-pages/next.config.js create mode 100644 examples/react/load-more-infinite-scroll/next.config.js create mode 100644 examples/react/nextjs/next.config.js create mode 100644 examples/react/optimistic-updates-cache/next.config.js create mode 100644 examples/react/optimistic-updates-ui/next.config.js diff --git a/examples/react/auto-refetching/next.config.js b/examples/react/auto-refetching/next.config.js new file mode 100644 index 0000000000..954704d28c --- /dev/null +++ b/examples/react/auto-refetching/next.config.js @@ -0,0 +1,5 @@ +module.exports = { + eslint: { + ignoreDuringBuilds: true, + }, +} diff --git a/examples/react/auto-refetching/package.json b/examples/react/auto-refetching/package.json index 9462e6573e..4e3ef1ff80 100644 --- a/examples/react/auto-refetching/package.json +++ b/examples/react/auto-refetching/package.json @@ -1,5 +1,5 @@ { - "name": "@tanstack/query-example-react-refetch-interval", + "name": "@tanstack/query-example-react-auto-refetching", "private": true, "main": "index.js", "license": "MIT", diff --git a/examples/react/infinite-query-with-max-pages/next.config.js b/examples/react/infinite-query-with-max-pages/next.config.js new file mode 100644 index 0000000000..954704d28c --- /dev/null +++ b/examples/react/infinite-query-with-max-pages/next.config.js @@ -0,0 +1,5 @@ +module.exports = { + eslint: { + ignoreDuringBuilds: true, + }, +} diff --git a/examples/react/load-more-infinite-scroll/next.config.js b/examples/react/load-more-infinite-scroll/next.config.js new file mode 100644 index 0000000000..954704d28c --- /dev/null +++ b/examples/react/load-more-infinite-scroll/next.config.js @@ -0,0 +1,5 @@ +module.exports = { + eslint: { + ignoreDuringBuilds: true, + }, +} diff --git a/examples/react/nextjs/next.config.js b/examples/react/nextjs/next.config.js new file mode 100644 index 0000000000..954704d28c --- /dev/null +++ b/examples/react/nextjs/next.config.js @@ -0,0 +1,5 @@ +module.exports = { + eslint: { + ignoreDuringBuilds: true, + }, +} diff --git a/examples/react/optimistic-updates-cache/next.config.js b/examples/react/optimistic-updates-cache/next.config.js new file mode 100644 index 0000000000..954704d28c --- /dev/null +++ b/examples/react/optimistic-updates-cache/next.config.js @@ -0,0 +1,5 @@ +module.exports = { + eslint: { + ignoreDuringBuilds: true, + }, +} diff --git a/examples/react/optimistic-updates-ui/next.config.js b/examples/react/optimistic-updates-ui/next.config.js new file mode 100644 index 0000000000..954704d28c --- /dev/null +++ b/examples/react/optimistic-updates-ui/next.config.js @@ -0,0 +1,5 @@ +module.exports = { + eslint: { + ignoreDuringBuilds: true, + }, +} diff --git a/package.json b/package.json index 626d789a5d..549bb67ec6 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ "preinstall": "node -e \"if(process.env.CI == 'true') {console.log('Skipping preinstall...'); process.exit(1)}\" || npx -y only-allow pnpm", "install:csb": "corepack enable && pnpm install --frozen-lockfile", "test": "pnpm run test:ci", - "test:pr": "nx affected --targets=test:eslint,test:lib,test:types,test:build,build --exclude=examples/**", - "test:ci": "nx run-many --targets=test:format,test:sherif,test:eslint,test:lib,test:types,test:build,build --exclude=examples/**", + "test:pr": "nx affected --targets=test:eslint,test:lib,test:types,test:build,build", + "test:ci": "nx run-many --targets=test:format,test:sherif,test:eslint,test:lib,test:types,test:build,build", "test:eslint": "nx affected --target=test:eslint --exclude=examples/**", "test:format": "pnpm run prettier --check", "test:sherif": "sherif --ignore-package \"./integrations/*\"", From 2aff990801f64097a9c8f410e58c0e74f289d714 Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Sat, 3 Feb 2024 13:48:09 +1100 Subject: [PATCH 3/6] Fix 2 more next examples --- examples/react/pagination/next.config.js | 5 +++++ examples/react/prefetching/next.config.js | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 examples/react/pagination/next.config.js create mode 100644 examples/react/prefetching/next.config.js diff --git a/examples/react/pagination/next.config.js b/examples/react/pagination/next.config.js new file mode 100644 index 0000000000..954704d28c --- /dev/null +++ b/examples/react/pagination/next.config.js @@ -0,0 +1,5 @@ +module.exports = { + eslint: { + ignoreDuringBuilds: true, + }, +} diff --git a/examples/react/prefetching/next.config.js b/examples/react/prefetching/next.config.js new file mode 100644 index 0000000000..954704d28c --- /dev/null +++ b/examples/react/prefetching/next.config.js @@ -0,0 +1,5 @@ +module.exports = { + eslint: { + ignoreDuringBuilds: true, + }, +} From 8687b955a3b96da50f261048a30f27402469e878 Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Sat, 3 Feb 2024 13:58:10 +1100 Subject: [PATCH 4/6] Fix solid and svelte examples --- .../solid/basic-graphql-request/vite.config.ts | 13 ++----------- examples/solid/basic-typescript/vite.config.ts | 13 ++----------- .../solid/default-query-function/vite.config.ts | 13 ++----------- examples/solid/simple/vite.config.ts | 13 ++----------- .../svelte/auto-refetching/sandbox.config.json | 5 ----- examples/svelte/basic/sandbox.config.json | 5 ----- .../sandbox.config.json | 5 ----- .../sandbox.config.json | 5 ----- examples/svelte/playground/sandbox.config.json | 5 ----- examples/svelte/simple/index.html | 1 - examples/svelte/simple/public/favicon.png | Bin 1571 -> 0 bytes examples/svelte/simple/sandbox.config.json | 5 ----- examples/svelte/ssr/sandbox.config.json | 5 ----- examples/svelte/star-wars/sandbox.config.json | 5 ----- 14 files changed, 8 insertions(+), 85 deletions(-) delete mode 100644 examples/svelte/auto-refetching/sandbox.config.json delete mode 100644 examples/svelte/basic/sandbox.config.json delete mode 100644 examples/svelte/load-more-infinite-scroll/sandbox.config.json delete mode 100644 examples/svelte/optimistic-updates-typescript/sandbox.config.json delete mode 100644 examples/svelte/playground/sandbox.config.json delete mode 100644 examples/svelte/simple/public/favicon.png delete mode 100644 examples/svelte/simple/sandbox.config.json delete mode 100644 examples/svelte/ssr/sandbox.config.json delete mode 100644 examples/svelte/star-wars/sandbox.config.json diff --git a/examples/solid/basic-graphql-request/vite.config.ts b/examples/solid/basic-graphql-request/vite.config.ts index 598cdda908..4095d9be50 100644 --- a/examples/solid/basic-graphql-request/vite.config.ts +++ b/examples/solid/basic-graphql-request/vite.config.ts @@ -1,15 +1,6 @@ import { defineConfig } from 'vite' -import solidPlugin from 'vite-plugin-solid' +import solid from 'vite-plugin-solid' export default defineConfig({ - plugins: [solidPlugin()], - server: { - port: 3000, - }, - build: { - target: 'esnext', - }, - resolve: { - preserveSymlinks: true, - }, + plugins: [solid()], }) diff --git a/examples/solid/basic-typescript/vite.config.ts b/examples/solid/basic-typescript/vite.config.ts index 598cdda908..4095d9be50 100644 --- a/examples/solid/basic-typescript/vite.config.ts +++ b/examples/solid/basic-typescript/vite.config.ts @@ -1,15 +1,6 @@ import { defineConfig } from 'vite' -import solidPlugin from 'vite-plugin-solid' +import solid from 'vite-plugin-solid' export default defineConfig({ - plugins: [solidPlugin()], - server: { - port: 3000, - }, - build: { - target: 'esnext', - }, - resolve: { - preserveSymlinks: true, - }, + plugins: [solid()], }) diff --git a/examples/solid/default-query-function/vite.config.ts b/examples/solid/default-query-function/vite.config.ts index 598cdda908..4095d9be50 100644 --- a/examples/solid/default-query-function/vite.config.ts +++ b/examples/solid/default-query-function/vite.config.ts @@ -1,15 +1,6 @@ import { defineConfig } from 'vite' -import solidPlugin from 'vite-plugin-solid' +import solid from 'vite-plugin-solid' export default defineConfig({ - plugins: [solidPlugin()], - server: { - port: 3000, - }, - build: { - target: 'esnext', - }, - resolve: { - preserveSymlinks: true, - }, + plugins: [solid()], }) diff --git a/examples/solid/simple/vite.config.ts b/examples/solid/simple/vite.config.ts index 598cdda908..4095d9be50 100644 --- a/examples/solid/simple/vite.config.ts +++ b/examples/solid/simple/vite.config.ts @@ -1,15 +1,6 @@ import { defineConfig } from 'vite' -import solidPlugin from 'vite-plugin-solid' +import solid from 'vite-plugin-solid' export default defineConfig({ - plugins: [solidPlugin()], - server: { - port: 3000, - }, - build: { - target: 'esnext', - }, - resolve: { - preserveSymlinks: true, - }, + plugins: [solid()], }) diff --git a/examples/svelte/auto-refetching/sandbox.config.json b/examples/svelte/auto-refetching/sandbox.config.json deleted file mode 100644 index 0da04c0cad..0000000000 --- a/examples/svelte/auto-refetching/sandbox.config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "container": { - "node": "16" - } -} diff --git a/examples/svelte/basic/sandbox.config.json b/examples/svelte/basic/sandbox.config.json deleted file mode 100644 index 0da04c0cad..0000000000 --- a/examples/svelte/basic/sandbox.config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "container": { - "node": "16" - } -} diff --git a/examples/svelte/load-more-infinite-scroll/sandbox.config.json b/examples/svelte/load-more-infinite-scroll/sandbox.config.json deleted file mode 100644 index 0da04c0cad..0000000000 --- a/examples/svelte/load-more-infinite-scroll/sandbox.config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "container": { - "node": "16" - } -} diff --git a/examples/svelte/optimistic-updates-typescript/sandbox.config.json b/examples/svelte/optimistic-updates-typescript/sandbox.config.json deleted file mode 100644 index 0da04c0cad..0000000000 --- a/examples/svelte/optimistic-updates-typescript/sandbox.config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "container": { - "node": "16" - } -} diff --git a/examples/svelte/playground/sandbox.config.json b/examples/svelte/playground/sandbox.config.json deleted file mode 100644 index 0da04c0cad..0000000000 --- a/examples/svelte/playground/sandbox.config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "container": { - "node": "16" - } -} diff --git a/examples/svelte/simple/index.html b/examples/svelte/simple/index.html index eb2ff6747b..900a45c983 100644 --- a/examples/svelte/simple/index.html +++ b/examples/svelte/simple/index.html @@ -2,7 +2,6 @@ - Vite + Svelte + TS diff --git a/examples/svelte/simple/public/favicon.png b/examples/svelte/simple/public/favicon.png deleted file mode 100644 index 825b9e65af7c104cfb07089bb28659393b4f2097..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1571 zcmV+;2Hg3HP)Px)-AP12RCwC$UE6KzI1p6{F2N z1VK2vi|pOpn{~#djwYcWXTI_im_u^TJgMZ4JMOsSj!0ma>B?-(Hr@X&W@|R-$}W@Z zgj#$x=!~7LGqHW?IO8+*oE1MyDp!G=L0#^lUx?;!fXv@l^6SvTnf^ac{5OurzC#ZMYc20lI%HhX816AYVs1T3heS1*WaWH z%;x>)-J}YB5#CLzU@GBR6sXYrD>Vw(Fmt#|JP;+}<#6b63Ike{Fuo!?M{yEffez;| zp!PfsuaC)>h>-AdbnwN13g*1LowNjT5?+lFVd#9$!8Z9HA|$*6dQ8EHLu}U|obW6f z2%uGv?vr=KNq7YYa2Roj;|zooo<)lf=&2yxM@e`kM$CmCR#x>gI>I|*Ubr({5Y^rb zghxQU22N}F51}^yfDSt786oMTc!W&V;d?76)9KXX1 z+6Okem(d}YXmmOiZq$!IPk5t8nnS{%?+vDFz3BevmFNgpIod~R{>@#@5x9zJKEHLHv!gHeK~n)Ld!M8DB|Kfe%~123&Hz1Z(86nU7*G5chmyDe ziV7$pB7pJ=96hpxHv9rCR29%bLOXlKU<_13_M8x)6;P8E1Kz6G<&P?$P^%c!M5`2` zfY2zg;VK5~^>TJGQzc+33-n~gKt{{of8GzUkWmU110IgI0DLxRIM>0US|TsM=L|@F z0Bun8U!cRB7-2apz=y-7*UxOxz@Z0)@QM)9wSGki1AZ38ceG7Q72z5`i;i=J`ILzL z@iUO?SBBG-0cQuo+an4TsLy-g-x;8P4UVwk|D8{W@U1Zi z!M)+jqy@nQ$p?5tsHp-6J304Q={v-B>66$P0IDx&YT(`IcZ~bZfmn11#rXd7<5s}y zBi9eim&zQc0Dk|2>$bs0PnLmDfMP5lcXRY&cvJ=zKxI^f0%-d$tD!`LBf9^jMSYUA zI8U?CWdY@}cRq6{5~y+)#h1!*-HcGW@+gZ4B};0OnC~`xQOyH19z*TA!!BJ%9s0V3F?CAJ{hTd#*tf+ur-W9MOURF-@B77_-OshsY}6 zOXRY=5%C^*26z?l)1=$bz30!so5tfABdSYzO+H=CpV~aaUefmjvfZ3Ttu9W&W3Iu6 zROlh0MFA5h;my}8lB0tAV-Rvc2Zs_CCSJnx@d`**$idgy-iMob4dJWWw|21b4NB=LfsYp0Aeh{Ov)yztQi;eL4y5 zMi>8^SzKqk8~k?UiQK^^-5d8c%bV?$F8%X~czyiaKCI2=UH Date: Sat, 3 Feb 2024 14:04:47 +1100 Subject: [PATCH 5/6] Fix react prefetching example --- examples/react/prefetching/src/pages/_app.js | 12 ++++++++++++ examples/react/prefetching/src/pages/index.js | 19 ++----------------- examples/svelte/simple/package.json | 2 +- 3 files changed, 15 insertions(+), 18 deletions(-) create mode 100644 examples/react/prefetching/src/pages/_app.js diff --git a/examples/react/prefetching/src/pages/_app.js b/examples/react/prefetching/src/pages/_app.js new file mode 100644 index 0000000000..d31935d2e6 --- /dev/null +++ b/examples/react/prefetching/src/pages/_app.js @@ -0,0 +1,12 @@ +import React from 'react' +import { QueryClient, QueryClientProvider } from '@tanstack/react-query' + +export default function MyApp({ Component, pageProps }) { + const [queryClient] = React.useState(() => new QueryClient()) + + return ( + + + + ) +} diff --git a/examples/react/prefetching/src/pages/index.js b/examples/react/prefetching/src/pages/index.js index 384001c241..c8edc5465d 100644 --- a/examples/react/prefetching/src/pages/index.js +++ b/examples/react/prefetching/src/pages/index.js @@ -1,11 +1,6 @@ import React from 'react' import axios from 'axios' -import { - useQuery, - useQueryClient, - QueryClient, - QueryClientProvider, -} from '@tanstack/react-query' +import { useQuery, useQueryClient } from '@tanstack/react-query' import { ReactQueryDevtools } from '@tanstack/react-query-devtools' const getCharacters = async () => { @@ -22,17 +17,7 @@ const getCharacter = async (selectedChar) => { return data } -const queryClient = new QueryClient() - -export default function App() { - return ( - - - - ) -} - -function Example() { +export default function Example() { const queryClient = useQueryClient() const rerender = React.useState(0)[1] const [selectedChar, setSelectedChar] = React.useState(1) diff --git a/examples/svelte/simple/package.json b/examples/svelte/simple/package.json index a2b4c0e9b6..bc0b4d9521 100644 --- a/examples/svelte/simple/package.json +++ b/examples/svelte/simple/package.json @@ -6,7 +6,7 @@ "dev": "vite", "build": "vite build", "preview": "vite preview", - "check": "svelte-check --tsconfig ./tsconfig.json" + "test:types": "svelte-check --tsconfig ./tsconfig.json" }, "dependencies": { "@tanstack/svelte-query": "^5.18.1", From 383b9ffa19265dbc287dfa67d24c53dd39945f69 Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Sat, 3 Feb 2024 14:08:37 +1100 Subject: [PATCH 6/6] Fix svelte type --- examples/svelte/simple/src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/svelte/simple/src/main.ts b/examples/svelte/simple/src/main.ts index 8a909a15a0..4d67e2ac2a 100644 --- a/examples/svelte/simple/src/main.ts +++ b/examples/svelte/simple/src/main.ts @@ -2,7 +2,7 @@ import './app.css' import App from './App.svelte' const app = new App({ - target: document.getElementById('app'), + target: document.getElementById('app')!, }) export default app