From d969cfb3b77007c0f69400acc61dacda79a881c7 Mon Sep 17 00:00:00 2001 From: TkDodo Date: Tue, 18 Aug 2026 15:45:17 +0200 Subject: [PATCH 1/2] chore: react-nodenext integration test --- integrations/react-nodenext/package.json | 16 ++++++++++++++++ integrations/react-nodenext/src/hooks.cts | 10 ++++++++++ integrations/react-nodenext/src/hooks.ts | 10 ++++++++++ integrations/react-nodenext/tsconfig.json | 12 ++++++++++++ pnpm-lock.yaml | 10 ++++++++++ 5 files changed, 58 insertions(+) create mode 100644 integrations/react-nodenext/package.json create mode 100644 integrations/react-nodenext/src/hooks.cts create mode 100644 integrations/react-nodenext/src/hooks.ts create mode 100644 integrations/react-nodenext/tsconfig.json diff --git a/integrations/react-nodenext/package.json b/integrations/react-nodenext/package.json new file mode 100644 index 00000000000..7bef7c5fc0b --- /dev/null +++ b/integrations/react-nodenext/package.json @@ -0,0 +1,16 @@ +{ + "name": "react-nodenext", + "private": true, + "type": "module", + "scripts": { + "test:types": "pnpm run test:types:ts6 && pnpm run test:types:ts7", + "test:types:ts6": "node ../../node_modules/typescript/lib/tsc.js --pretty false --project tsconfig.json", + "test:types:ts7": "node ../../node_modules/typescript70/lib/tsc.js --pretty false --project tsconfig.json" + }, + "dependencies": { + "@tanstack/react-query": "workspace:*" + }, + "devDependencies": { + "@types/react": "^19.2.7" + } +} diff --git a/integrations/react-nodenext/src/hooks.cts b/integrations/react-nodenext/src/hooks.cts new file mode 100644 index 00000000000..959e37ec9b1 --- /dev/null +++ b/integrations/react-nodenext/src/hooks.cts @@ -0,0 +1,10 @@ +import { useQuery } from '@tanstack/react-query' + +export function useMyHook() { + const query = useQuery({ + queryKey: ['test'], + queryFn: () => 'hello', + }) + + return { data: query.data } +} diff --git a/integrations/react-nodenext/src/hooks.ts b/integrations/react-nodenext/src/hooks.ts new file mode 100644 index 00000000000..959e37ec9b1 --- /dev/null +++ b/integrations/react-nodenext/src/hooks.ts @@ -0,0 +1,10 @@ +import { useQuery } from '@tanstack/react-query' + +export function useMyHook() { + const query = useQuery({ + queryKey: ['test'], + queryFn: () => 'hello', + }) + + return { data: query.data } +} diff --git a/integrations/react-nodenext/tsconfig.json b/integrations/react-nodenext/tsconfig.json new file mode 100644 index 00000000000..896ca915f1e --- /dev/null +++ b/integrations/react-nodenext/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "module": "nodenext", + "moduleResolution": "nodenext", + "declaration": true, + "emitDeclarationOnly": true, + "strict": true, + "rootDir": "./src", + "outDir": "./dist" + }, + "include": ["./src"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c5d56be5240..f43ddf9e6fb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2237,6 +2237,16 @@ importers: specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.14) + integrations/react-nodenext: + dependencies: + '@tanstack/react-query': + specifier: workspace:* + version: link:../../packages/react-query + devDependencies: + '@types/react': + specifier: ^19.2.7 + version: 19.2.14 + integrations/react-vite: dependencies: '@tanstack/react-query': From 19200446af501e27accda79c6fafb0ec1ba2d111 Mon Sep 17 00:00:00 2001 From: TkDodo Date: Tue, 18 Aug 2026 16:08:43 +0200 Subject: [PATCH 2/2] fix: nx --- integrations/react-nodenext/package.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/integrations/react-nodenext/package.json b/integrations/react-nodenext/package.json index 7bef7c5fc0b..5fa50bf9677 100644 --- a/integrations/react-nodenext/package.json +++ b/integrations/react-nodenext/package.json @@ -12,5 +12,14 @@ }, "devDependencies": { "@types/react": "^19.2.7" + }, + "nx": { + "targets": { + "test:types": { + "dependsOn": [ + "^build" + ] + } + } } }