From cbb2735de351da829e2d26c17fc24008952e68ed Mon Sep 17 00:00:00 2001 From: gatzjames Date: Mon, 25 Nov 2024 21:58:10 +0100 Subject: [PATCH 1/4] future flags --- package-lock.json | 26 +- packages/insomnia/package.json | 2 +- packages/insomnia/src/ui/index.tsx | 40 +- .../insomnia/src/ui/routes/mock-server.tsx | 414 +++++++++--------- 4 files changed, 249 insertions(+), 233 deletions(-) diff --git a/package-lock.json b/package-lock.json index 19218301708..bdce051713d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4782,9 +4782,9 @@ } }, "node_modules/@remix-run/router": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz", - "integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==", + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.21.0.tgz", + "integrity": "sha512-xfSkCAchbdG5PnbrKqFWwia4Bi61nH+wm8wLEqfHDyp7Y3dZzgqS2itV8i4gAq9pC2HsTpwyBC6Ds8VHZ96JlA==", "dev": true, "license": "MIT", "engines": { @@ -18731,13 +18731,13 @@ } }, "node_modules/react-router": { - "version": "6.26.2", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz", - "integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==", + "version": "6.28.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.28.0.tgz", + "integrity": "sha512-HrYdIFqdrnhDw0PqG/AKjAqEqM7AvxCz0DQ4h2W8k6nqmc5uRBYDag0SBxx9iYz5G8gnuNVLzUe13wl9eAsXXg==", "dev": true, "license": "MIT", "dependencies": { - "@remix-run/router": "1.19.2" + "@remix-run/router": "1.21.0" }, "engines": { "node": ">=14.0.0" @@ -18747,14 +18747,14 @@ } }, "node_modules/react-router-dom": { - "version": "6.26.2", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz", - "integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==", + "version": "6.28.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.28.0.tgz", + "integrity": "sha512-kQ7Unsl5YdyOltsPGl31zOjLrDv+m2VcIEcIHqYYD3Lp0UppLjrzcfJqDJwXxFw3TH/yvapbnUvPlAj7Kx5nbg==", "dev": true, "license": "MIT", "dependencies": { - "@remix-run/router": "1.19.2", - "react-router": "6.26.2" + "@remix-run/router": "1.21.0", + "react-router": "6.28.0" }, "engines": { "node": ">=14.0.0" @@ -23021,7 +23021,7 @@ "react-aria-components": "^1.1.1", "react-dom": "^18.2.0", "react-resizable-panels": "^2.0.17", - "react-router-dom": "^6.26.2", + "react-router-dom": "^6.28.0", "react-stately": "3.30.1", "react-use": "^17.5.0", "tailwindcss": "^3.4.3", diff --git a/packages/insomnia/package.json b/packages/insomnia/package.json index c7dd05a910b..83c24a400fd 100644 --- a/packages/insomnia/package.json +++ b/packages/insomnia/package.json @@ -167,7 +167,7 @@ "react-aria-components": "^1.1.1", "react-dom": "^18.2.0", "react-resizable-panels": "^2.0.17", - "react-router-dom": "^6.26.2", + "react-router-dom": "^6.28.0", "react-stately": "3.30.1", "react-use": "^17.5.0", "tailwindcss": "^3.4.3", diff --git a/packages/insomnia/src/ui/index.tsx b/packages/insomnia/src/ui/index.tsx index db4ec3a7dac..338a4a148ba 100644 --- a/packages/insomnia/src/ui/index.tsx +++ b/packages/insomnia/src/ui/index.tsx @@ -114,15 +114,17 @@ async function renderApp() { errorElement: , children: [ { - path: 'onboarding/*', - element: , - errorElement: , - }, - { - path: 'onboarding/migrate', - loader: async (...args) => (await import('./routes/onboarding.migrate')).loader(...args), - action: async (...args) => (await import('./routes/onboarding.migrate')).action(...args), - element: , + path: 'onboarding', + children: [{ + path: '*', + element: , + errorElement: , + }, { + path: 'migrate', + loader: async (...args) => (await import('./routes/onboarding.migrate')).loader(...args), + action: async (...args) => (await import('./routes/onboarding.migrate')).action(...args), + element: , + }], }, { path: 'commands', @@ -320,7 +322,7 @@ async function renderApp() { ), children: [ { - path: `${ACTIVITY_DEBUG}/*`, + path: `${ACTIVITY_DEBUG}`, loader: async (...args) => (await import('./routes/debug')).loader( ...args, @@ -511,7 +513,7 @@ async function renderApp() { ], }, { - path: 'mock-server/*', + path: 'mock-server', id: 'mock-server', loader: async (...args) => (await import('./routes/mock-server')).loader( @@ -688,7 +690,7 @@ async function renderApp() { ], }, { - path: 'test/*', + path: 'test', loader: async (...args) => (await import('./routes/unit-test')).loader( ...args, @@ -1136,6 +1138,13 @@ async function renderApp() { ], { initialEntries: [initialEntry], + future: { + v7_relativeSplatPath: true, + v7_fetcherPersist: true, + v7_normalizeFormMethod: true, + v7_partialHydration: true, + v7_skipActionErrorRevalidation: true, + }, } ); @@ -1163,7 +1172,12 @@ async function renderApp() { }); ReactDOM.createRoot(root).render( - + ); } diff --git a/packages/insomnia/src/ui/routes/mock-server.tsx b/packages/insomnia/src/ui/routes/mock-server.tsx index 9d80107648d..77af1aa41d5 100644 --- a/packages/insomnia/src/ui/routes/mock-server.tsx +++ b/packages/insomnia/src/ui/routes/mock-server.tsx @@ -175,182 +175,182 @@ const MockServerRoute = () => { return ( -
-
- - - - - - - - - - - -
-
- +
+ ({ + id: route._id, + key: route._id, + ...route, + }))} + className="overflow-y-auto flex-1 data-[empty]:py-0 py-[--padding-sm]" + disallowEmptySelection + selectedKeys={[mockRouteId]} + selectionMode="single" + onSelectionChange={keys => { + if (keys !== 'all') { + const value = keys.values().next().value; + navigate({ + pathname: `/organization/${organizationId}/project/${projectId}/workspace/${workspaceId}/mock-server/mock-route/${value}`, + }); + } }} > - - New Mock Route - -
- ({ - id: route._id, - key: route._id, - ...route, - }))} - className="overflow-y-auto flex-1 data-[empty]:py-0 py-[--padding-sm]" - disallowEmptySelection - selectedKeys={[mockRouteId]} - selectionMode="single" - onSelectionChange={keys => { - if (keys !== 'all') { - const value = keys.values().next().value; - navigate({ - pathname: `/organization/${organizationId}/project/${projectId}/workspace/${workspaceId}/mock-server/mock-route/${value}`, - }); - } - }} - > - {item => { - return ( - -
- - { + return ( + +
+ + - {formatMethodName(item.method)} - - { - const hasRouteInServer = mockRoutes.filter(m => m._id !== item._id).find(m => m.name === name && m.method.toUpperCase() === item.method.toUpperCase()); - if (hasRouteInServer) { - showModal(AlertModal, { - title: 'Error', - message: `Path "${name}" and method must be unique. Please enter a different name.`, - }); - return; - }; - if (name[0] !== '/') { - showModal(AlertModal, { - title: 'Error', - message: 'Path must begin with a /', - }); - return; - }; - name && fetcher.submit( - { name }, - { - encType: 'application/json', - action: `/organization/${organizationId}/project/${projectId}/workspace/${workspaceId}/mock-server/mock-route/${item._id}/update`, - method: 'POST', - } - ); - }} - /> - - - - - { - mockRouteActionList - .find(({ id }) => key === id) - ?.action(item._id, item.name); - }} - items={mockRouteActionList} - className="border select-none text-sm min-w-max border-solid border-[--hl-sm] shadow-lg bg-[--color-bg] py-2 rounded-md overflow-y-auto max-h-[85vh] focus:outline-none" + {formatMethodName(item.method)} + + { + const hasRouteInServer = mockRoutes.filter(m => m._id !== item._id).find(m => m.name === name && m.method.toUpperCase() === item.method.toUpperCase()); + if (hasRouteInServer) { + showModal(AlertModal, { + title: 'Error', + message: `Path "${name}" and method must be unique. Please enter a different name.`, + }); + return; + }; + if (name[0] !== '/') { + showModal(AlertModal, { + title: 'Error', + message: 'Path must begin with a /', + }); + return; + }; + name && fetcher.submit( + { name }, + { + encType: 'application/json', + action: `/organization/${organizationId}/project/${projectId}/workspace/${workspaceId}/mock-server/mock-route/${item._id}/update`, + method: 'POST', + } + ); + }} + /> + + + - - -
-
- ); - }} - + + + + { + mockRouteActionList + .find(({ id }) => key === id) + ?.action(item._id, item.name); + }} + items={mockRouteActionList} + className="border select-none text-sm min-w-max border-solid border-[--hl-sm] shadow-lg bg-[--color-bg] py-2 rounded-md overflow-y-auto max-h-[85vh] focus:outline-none" + > + {item => ( + + + {item.name} + + )} + + + +
+
+ ); + }} +
- +
@@ -358,47 +358,49 @@ const MockServerRoute = () => { - - - - } - /> - } - documentationLinks={[]} - title="Create a route to configure mock response here" - /> - } - /> + + + + } + /> + } + documentationLinks={[]} + title="Create a route to configure mock response here" + /> + } + /> - - - - } - /> - } - documentationLinks={[]} - title="Create a route to see mock server activity here" - /> - } - /> + + + + + } + /> + + } + documentationLinks={[]} + title="Create a route to see mock server activity here" + /> + } + /> From 39e97be62ba929576be8df5242a07a1182a7a6f4 Mon Sep 17 00:00:00 2001 From: gatzjames Date: Mon, 25 Nov 2024 22:00:01 +0100 Subject: [PATCH 2/4] upgrade version --- package-lock.json | 77 ++++++++++++++++++---------------- packages/insomnia/package.json | 2 +- 2 files changed, 42 insertions(+), 37 deletions(-) diff --git a/package-lock.json b/package-lock.json index bdce051713d..f8bcad7626c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4781,16 +4781,6 @@ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" } }, - "node_modules/@remix-run/router": { - "version": "1.21.0", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.21.0.tgz", - "integrity": "sha512-xfSkCAchbdG5PnbrKqFWwia4Bi61nH+wm8wLEqfHDyp7Y3dZzgqS2itV8i4gAq9pC2HsTpwyBC6Ds8VHZ96JlA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/@rollup/plugin-commonjs": { "version": "22.0.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.2.tgz", @@ -6168,6 +6158,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==", + "license": "MIT" + }, "node_modules/@types/cookie-parser": { "version": "1.4.7", "resolved": "https://registry.npmjs.org/@types/cookie-parser/-/cookie-parser-1.4.7.tgz", @@ -15738,7 +15734,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, "license": "MIT", "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" @@ -18503,7 +18498,6 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", - "dev": true, "license": "MIT", "dependencies": { "loose-envify": "^1.1.0" @@ -18692,7 +18686,7 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "loose-envify": "^1.1.0", @@ -18731,37 +18725,36 @@ } }, "node_modules/react-router": { - "version": "6.28.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.28.0.tgz", - "integrity": "sha512-HrYdIFqdrnhDw0PqG/AKjAqEqM7AvxCz0DQ4h2W8k6nqmc5uRBYDag0SBxx9iYz5G8gnuNVLzUe13wl9eAsXXg==", - "dev": true, + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.0.1.tgz", + "integrity": "sha512-WVAhv9oWCNsja5AkK6KLpXJDSJCQizOIyOd4vvB/+eHGbYx5vkhcmcmwWjQ9yqkRClogi+xjEg9fNEOd5EX/tw==", "license": "MIT", "dependencies": { - "@remix-run/router": "1.21.0" + "@types/cookie": "^0.6.0", + "cookie": "^1.0.1", + "set-cookie-parser": "^2.6.0", + "turbo-stream": "2.4.0" }, "engines": { - "node": ">=14.0.0" + "node": ">=20.0.0" }, "peerDependencies": { - "react": ">=16.8" + "react": ">=18", + "react-dom": ">=18" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } } }, - "node_modules/react-router-dom": { - "version": "6.28.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.28.0.tgz", - "integrity": "sha512-kQ7Unsl5YdyOltsPGl31zOjLrDv+m2VcIEcIHqYYD3Lp0UppLjrzcfJqDJwXxFw3TH/yvapbnUvPlAj7Kx5nbg==", - "dev": true, + "node_modules/react-router/node_modules/cookie": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz", + "integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==", "license": "MIT", - "dependencies": { - "@remix-run/router": "1.21.0", - "react-router": "6.28.0" - }, "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "react": ">=16.8", - "react-dom": ">=16.8" + "node": ">=18" } }, "node_modules/react-stately": { @@ -19323,7 +19316,7 @@ "version": "0.23.2", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "loose-envify": "^1.1.0" @@ -19512,6 +19505,12 @@ "node": ">= 0.8.0" } }, + "node_modules/set-cookie-parser": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz", + "integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==", + "license": "MIT" + }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -21054,6 +21053,12 @@ "node": ">=0.6.x" } }, + "node_modules/turbo-stream": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/turbo-stream/-/turbo-stream-2.4.0.tgz", + "integrity": "sha512-FHncC10WpBd2eOmGwpmQsWLDoK4cqsA/UT/GqNoaKOQnT8uzhtCbg3EoUDMvqpOSAI0S26mr0rkjzbOO6S3v1g==", + "license": "ISC" + }, "node_modules/tv4": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/tv4/-/tv4-1.3.0.tgz", @@ -22928,6 +22933,7 @@ "oauth-1.0a": "^2.2.6", "papaparse": "^5.4.1", "prettier": "2.4.1", + "react-router": "^7.0.1", "shell-quote": "^1.8.1", "swagger-ui-dist": "^5.17.14", "tough-cookie": "^4.1.3", @@ -23021,7 +23027,6 @@ "react-aria-components": "^1.1.1", "react-dom": "^18.2.0", "react-resizable-panels": "^2.0.17", - "react-router-dom": "^6.28.0", "react-stately": "3.30.1", "react-use": "^17.5.0", "tailwindcss": "^3.4.3", diff --git a/packages/insomnia/package.json b/packages/insomnia/package.json index 83c24a400fd..bb40cef561b 100644 --- a/packages/insomnia/package.json +++ b/packages/insomnia/package.json @@ -77,6 +77,7 @@ "oauth-1.0a": "^2.2.6", "papaparse": "^5.4.1", "prettier": "2.4.1", + "react-router": "^7.0.1", "shell-quote": "^1.8.1", "swagger-ui-dist": "^5.17.14", "tough-cookie": "^4.1.3", @@ -167,7 +168,6 @@ "react-aria-components": "^1.1.1", "react-dom": "^18.2.0", "react-resizable-panels": "^2.0.17", - "react-router-dom": "^6.28.0", "react-stately": "3.30.1", "react-use": "^17.5.0", "tailwindcss": "^3.4.3", From 5a34f37d39d2d56375a85c58c23f84a4afbd45a0 Mon Sep 17 00:00:00 2001 From: gatzjames Date: Mon, 25 Nov 2024 22:02:42 +0100 Subject: [PATCH 3/4] update imports --- packages/insomnia/src/ui/components/command-palette.tsx | 2 +- .../insomnia/src/ui/components/dropdowns/auth-dropdown.tsx | 2 +- .../src/ui/components/dropdowns/content-type-dropdown.tsx | 2 +- .../src/ui/components/dropdowns/git-sync-dropdown.tsx | 2 +- .../src/ui/components/dropdowns/preview-mode-dropdown.tsx | 2 +- .../insomnia/src/ui/components/dropdowns/project-dropdown.tsx | 2 +- .../src/ui/components/dropdowns/request-actions-dropdown.tsx | 2 +- .../components/dropdowns/request-group-actions-dropdown.tsx | 2 +- .../src/ui/components/dropdowns/response-history-dropdown.tsx | 4 ++-- .../insomnia/src/ui/components/dropdowns/sync-dropdown.tsx | 2 +- .../src/ui/components/dropdowns/workspace-card-dropdown.tsx | 2 +- .../src/ui/components/dropdowns/workspace-dropdown.tsx | 2 +- .../src/ui/components/dropdowns/workspace-sync-dropdown.tsx | 2 +- .../ui/components/editors/auth/components/auth-accordion.tsx | 2 +- .../ui/components/editors/auth/components/auth-input-row.tsx | 2 +- .../editors/auth/components/auth-private-key-row.tsx | 2 +- .../src/ui/components/editors/auth/components/auth-row.tsx | 2 +- .../ui/components/editors/auth/components/auth-select-row.tsx | 2 +- .../ui/components/editors/auth/components/auth-toggle-row.tsx | 2 +- .../insomnia/src/ui/components/editors/auth/o-auth-1-auth.tsx | 2 +- .../insomnia/src/ui/components/editors/auth/o-auth-2-auth.tsx | 2 +- .../insomnia/src/ui/components/editors/body/body-editor.tsx | 2 +- .../src/ui/components/editors/mock-response-extractor.tsx | 4 ++-- .../ui/components/editors/mock-response-headers-editor.tsx | 2 +- .../src/ui/components/editors/request-headers-editor.tsx | 2 +- .../src/ui/components/editors/request-parameters-editor.tsx | 2 +- packages/insomnia/src/ui/components/environment-picker.tsx | 2 +- packages/insomnia/src/ui/components/keydown-binder.ts | 2 +- .../insomnia/src/ui/components/mocks/mock-response-pane.tsx | 4 ++-- packages/insomnia/src/ui/components/mocks/mock-url-bar.tsx | 2 +- .../insomnia/src/ui/components/modals/cli-preview-modal.tsx | 2 +- .../insomnia/src/ui/components/modals/cookie-modify-modal.tsx | 4 ++-- packages/insomnia/src/ui/components/modals/cookies-modal.tsx | 2 +- .../src/ui/components/modals/export-requests-modal.tsx | 2 +- .../insomnia/src/ui/components/modals/git-branches-modal.tsx | 2 +- packages/insomnia/src/ui/components/modals/git-log-modal.tsx | 2 +- .../git-repository-settings-modal/git-repo-clone-modal.tsx | 2 +- .../git-repository-settings-modal.tsx | 2 +- .../insomnia/src/ui/components/modals/git-staging-modal.tsx | 2 +- packages/insomnia/src/ui/components/modals/import-modal.tsx | 2 +- .../src/ui/components/modals/invite-modal/invite-modal.tsx | 2 +- .../modals/invite-modal/organization-invite-form.tsx | 2 +- .../src/ui/components/modals/mock-server-settings-modal.tsx | 2 +- .../insomnia/src/ui/components/modals/proto-files-modal.tsx | 2 +- .../src/ui/components/modals/request-group-settings-modal.tsx | 2 +- .../src/ui/components/modals/request-settings-modal.tsx | 2 +- .../insomnia/src/ui/components/modals/sync-branches-modal.tsx | 2 +- .../insomnia/src/ui/components/modals/sync-delete-modal.tsx | 2 +- .../insomnia/src/ui/components/modals/sync-history-modal.tsx | 2 +- .../insomnia/src/ui/components/modals/sync-staging-modal.tsx | 2 +- .../src/ui/components/modals/workspace-certificates-modal.tsx | 2 +- .../src/ui/components/modals/workspace-duplicate-modal.tsx | 2 +- .../components/modals/workspace-environments-edit-modal.tsx | 2 +- .../src/ui/components/modals/workspace-settings-modal.tsx | 2 +- .../insomnia/src/ui/components/panes/grpc-request-pane.tsx | 2 +- .../src/ui/components/panes/placeholder-request-pane.tsx | 2 +- .../src/ui/components/panes/project-empty-state-pane.tsx | 2 +- .../insomnia/src/ui/components/panes/request-group-pane.tsx | 2 +- packages/insomnia/src/ui/components/panes/request-pane.tsx | 2 +- packages/insomnia/src/ui/components/panes/response-pane.tsx | 2 +- packages/insomnia/src/ui/components/present-users.tsx | 2 +- packages/insomnia/src/ui/components/request-url-bar.tsx | 2 +- .../insomnia/src/ui/components/settings/import-export.tsx | 4 ++-- packages/insomnia/src/ui/components/websockets/action-bar.tsx | 2 +- packages/insomnia/src/ui/components/websockets/event-view.tsx | 2 +- .../src/ui/components/websockets/realtime-response-pane.tsx | 2 +- .../src/ui/components/websockets/websocket-request-pane.tsx | 2 +- packages/insomnia/src/ui/context/app/ai-context.tsx | 2 +- .../src/ui/context/app/insomnia-event-stream-context.tsx | 2 +- packages/insomnia/src/ui/context/nunjucks/use-nunjucks.ts | 2 +- packages/insomnia/src/ui/hooks/use-document-title.ts | 2 +- packages/insomnia/src/ui/hooks/use-organization-features.tsx | 2 +- packages/insomnia/src/ui/hooks/use-request.ts | 2 +- packages/insomnia/src/ui/hooks/use-vcs-version.ts | 4 ++-- packages/insomnia/src/ui/index.tsx | 2 +- packages/insomnia/src/ui/routes/actions.tsx | 2 +- packages/insomnia/src/ui/routes/auth.authorize.tsx | 2 +- packages/insomnia/src/ui/routes/auth.login.tsx | 2 +- packages/insomnia/src/ui/routes/auth.logout.tsx | 2 +- packages/insomnia/src/ui/routes/auth.tsx | 2 +- packages/insomnia/src/ui/routes/commands.tsx | 2 +- packages/insomnia/src/ui/routes/debug.tsx | 2 +- packages/insomnia/src/ui/routes/design.tsx | 2 +- packages/insomnia/src/ui/routes/environments.tsx | 2 +- packages/insomnia/src/ui/routes/error.tsx | 2 +- packages/insomnia/src/ui/routes/git-actions.tsx | 2 +- packages/insomnia/src/ui/routes/import.tsx | 2 +- packages/insomnia/src/ui/routes/mock-route.tsx | 2 +- packages/insomnia/src/ui/routes/mock-server.tsx | 2 +- packages/insomnia/src/ui/routes/modals.tsx | 2 +- packages/insomnia/src/ui/routes/onboarding.migrate.tsx | 2 +- packages/insomnia/src/ui/routes/onboarding.tsx | 2 +- packages/insomnia/src/ui/routes/organization.tsx | 2 +- packages/insomnia/src/ui/routes/project.tsx | 2 +- packages/insomnia/src/ui/routes/remote-collections.tsx | 2 +- packages/insomnia/src/ui/routes/request-group.tsx | 2 +- packages/insomnia/src/ui/routes/request.tsx | 2 +- packages/insomnia/src/ui/routes/root.tsx | 2 +- packages/insomnia/src/ui/routes/runner.tsx | 2 +- packages/insomnia/src/ui/routes/test-results.tsx | 2 +- packages/insomnia/src/ui/routes/test-suite.tsx | 2 +- packages/insomnia/src/ui/routes/unit-test.tsx | 2 +- packages/insomnia/src/ui/routes/untracked-projects.tsx | 2 +- packages/insomnia/src/ui/routes/workspace.tsx | 2 +- packages/insomnia/src/utils/router.ts | 2 +- 105 files changed, 111 insertions(+), 111 deletions(-) diff --git a/packages/insomnia/src/ui/components/command-palette.tsx b/packages/insomnia/src/ui/components/command-palette.tsx index 8301ad562a4..f542b9370bd 100644 --- a/packages/insomnia/src/ui/components/command-palette.tsx +++ b/packages/insomnia/src/ui/components/command-palette.tsx @@ -1,7 +1,7 @@ import React, { memo, useEffect, useRef } from 'react'; import { useState } from 'react'; import { Button, Collection, ComboBox, Dialog, DialogTrigger, Header, Input, Keyboard, Label, ListBox, ListBoxItem, Modal, ModalOverlay, Popover, Section, Text } from 'react-aria-components'; -import { useFetcher, useNavigate, useParams, useRouteLoaderData } from 'react-router-dom'; +import { useFetcher, useNavigate, useParams, useRouteLoaderData } from 'react-router'; import { constructKeyCombinationDisplay, getPlatformKeyCombinations } from '../../common/hotkeys'; import { fuzzyMatch } from '../../common/misc'; diff --git a/packages/insomnia/src/ui/components/dropdowns/auth-dropdown.tsx b/packages/insomnia/src/ui/components/dropdowns/auth-dropdown.tsx index b011d608a40..938c732d8a8 100644 --- a/packages/insomnia/src/ui/components/dropdowns/auth-dropdown.tsx +++ b/packages/insomnia/src/ui/components/dropdowns/auth-dropdown.tsx @@ -1,7 +1,7 @@ import type { IconName } from '@fortawesome/fontawesome-svg-core'; import React, { type FC, useCallback } from 'react'; import { Button, Collection, Header, ListBox, ListBoxItem, Popover, Section, Select, SelectValue } from 'react-aria-components'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import { HAWK_ALGORITHM_SHA256, diff --git a/packages/insomnia/src/ui/components/dropdowns/content-type-dropdown.tsx b/packages/insomnia/src/ui/components/dropdowns/content-type-dropdown.tsx index 46a3f366ed4..c6e2731077e 100644 --- a/packages/insomnia/src/ui/components/dropdowns/content-type-dropdown.tsx +++ b/packages/insomnia/src/ui/components/dropdowns/content-type-dropdown.tsx @@ -1,7 +1,7 @@ import type { IconName } from '@fortawesome/fontawesome-svg-core'; import React, { type FC } from 'react'; import { Button, Collection, Header, ListBox, ListBoxItem, Popover, Section, Select, SelectValue } from 'react-aria-components'; -import { useParams, useRouteLoaderData } from 'react-router-dom'; +import { useParams, useRouteLoaderData } from 'react-router'; import { CONTENT_TYPE_EDN, diff --git a/packages/insomnia/src/ui/components/dropdowns/git-sync-dropdown.tsx b/packages/insomnia/src/ui/components/dropdowns/git-sync-dropdown.tsx index bdec0b0cc30..114c3673e1d 100644 --- a/packages/insomnia/src/ui/components/dropdowns/git-sync-dropdown.tsx +++ b/packages/insomnia/src/ui/components/dropdowns/git-sync-dropdown.tsx @@ -1,7 +1,7 @@ import type { IconName, IconProp } from '@fortawesome/fontawesome-svg-core'; import React, { type FC, useEffect, useState } from 'react'; import { Button, Collection, Menu, MenuItem, MenuTrigger, Popover, Section, Tooltip, TooltipTrigger } from 'react-aria-components'; -import { useFetcher, useParams, useRevalidator } from 'react-router-dom'; +import { useFetcher, useParams, useRevalidator } from 'react-router'; import { useInterval } from 'react-use'; import type { GitRepository } from '../../../models/git-repository'; diff --git a/packages/insomnia/src/ui/components/dropdowns/preview-mode-dropdown.tsx b/packages/insomnia/src/ui/components/dropdowns/preview-mode-dropdown.tsx index 3df3287898a..7977bd7d3fc 100644 --- a/packages/insomnia/src/ui/components/dropdowns/preview-mode-dropdown.tsx +++ b/packages/insomnia/src/ui/components/dropdowns/preview-mode-dropdown.tsx @@ -1,7 +1,7 @@ import fs from 'fs'; import React, { type FC, useCallback } from 'react'; import { Button } from 'react-aria-components'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import { getPreviewModeName, PREVIEW_MODE_SOURCE, PREVIEW_MODES } from '../../../common/constants'; import { exportHarCurrentRequest } from '../../../common/har'; diff --git a/packages/insomnia/src/ui/components/dropdowns/project-dropdown.tsx b/packages/insomnia/src/ui/components/dropdowns/project-dropdown.tsx index f469c31fe35..3ee3601e188 100644 --- a/packages/insomnia/src/ui/components/dropdowns/project-dropdown.tsx +++ b/packages/insomnia/src/ui/components/dropdowns/project-dropdown.tsx @@ -18,7 +18,7 @@ import { Tooltip, TooltipTrigger, } from 'react-aria-components'; -import { useFetcher } from 'react-router-dom'; +import { useFetcher } from 'react-router'; import { isRemoteProject, diff --git a/packages/insomnia/src/ui/components/dropdowns/request-actions-dropdown.tsx b/packages/insomnia/src/ui/components/dropdowns/request-actions-dropdown.tsx index 2eb6587bdc6..605c0106cc9 100644 --- a/packages/insomnia/src/ui/components/dropdowns/request-actions-dropdown.tsx +++ b/packages/insomnia/src/ui/components/dropdowns/request-actions-dropdown.tsx @@ -1,7 +1,7 @@ import type { IconName } from '@fortawesome/fontawesome-svg-core'; import React, { Fragment, useCallback, useState } from 'react'; import { Button, Collection, Header, Menu, MenuItem, MenuTrigger, Popover, Section } from 'react-aria-components'; -import { useFetcher, useParams } from 'react-router-dom'; +import { useFetcher, useParams } from 'react-router'; import { exportHarRequest } from '../../../common/har'; import { toKebabCase } from '../../../common/misc'; diff --git a/packages/insomnia/src/ui/components/dropdowns/request-group-actions-dropdown.tsx b/packages/insomnia/src/ui/components/dropdowns/request-group-actions-dropdown.tsx index 4b2d1e2aa29..5bee2530d93 100644 --- a/packages/insomnia/src/ui/components/dropdowns/request-group-actions-dropdown.tsx +++ b/packages/insomnia/src/ui/components/dropdowns/request-group-actions-dropdown.tsx @@ -1,7 +1,7 @@ import type { IconName } from '@fortawesome/fontawesome-svg-core'; import React, { Fragment, useRef, useState } from 'react'; import { Button, Collection, Header, Menu, MenuItem, MenuTrigger, Popover, Section } from 'react-aria-components'; -import { useFetcher, useNavigate, useParams, useRouteLoaderData } from 'react-router-dom'; +import { useFetcher, useNavigate, useParams, useRouteLoaderData } from 'react-router'; import { toKebabCase } from '../../../common/misc'; import { RENDER_PURPOSE_NO_RENDER } from '../../../common/render'; diff --git a/packages/insomnia/src/ui/components/dropdowns/response-history-dropdown.tsx b/packages/insomnia/src/ui/components/dropdowns/response-history-dropdown.tsx index 3a1da85f251..602ff5e35a1 100644 --- a/packages/insomnia/src/ui/components/dropdowns/response-history-dropdown.tsx +++ b/packages/insomnia/src/ui/components/dropdowns/response-history-dropdown.tsx @@ -1,8 +1,8 @@ import { differenceInHours, differenceInMinutes, isThisWeek, isToday } from 'date-fns'; import React, { useCallback, useRef } from 'react'; import { Button } from 'react-aria-components'; -import { useFetcher, useRouteLoaderData } from 'react-router-dom'; -import { useParams } from 'react-router-dom'; +import { useFetcher, useRouteLoaderData } from 'react-router'; +import { useParams } from 'react-router'; import { decompressObject } from '../../../common/misc'; import * as models from '../../../models/index'; diff --git a/packages/insomnia/src/ui/components/dropdowns/sync-dropdown.tsx b/packages/insomnia/src/ui/components/dropdowns/sync-dropdown.tsx index 6bbfb0ab123..dd0a66282eb 100644 --- a/packages/insomnia/src/ui/components/dropdowns/sync-dropdown.tsx +++ b/packages/insomnia/src/ui/components/dropdowns/sync-dropdown.tsx @@ -1,7 +1,7 @@ import type { IconProp } from '@fortawesome/fontawesome-svg-core'; import React, { type FC, Fragment, useCallback, useEffect, useState } from 'react'; import { Button, Collection, Menu, MenuItem, MenuTrigger, Popover, Section, Tooltip, TooltipTrigger } from 'react-aria-components'; -import { useFetcher, useParams } from 'react-router-dom'; +import { useFetcher, useParams } from 'react-router'; import { useInterval } from 'react-use'; import * as session from '../../../account/session'; diff --git a/packages/insomnia/src/ui/components/dropdowns/workspace-card-dropdown.tsx b/packages/insomnia/src/ui/components/dropdowns/workspace-card-dropdown.tsx index a60c7cc74ff..63b269c482c 100644 --- a/packages/insomnia/src/ui/components/dropdowns/workspace-card-dropdown.tsx +++ b/packages/insomnia/src/ui/components/dropdowns/workspace-card-dropdown.tsx @@ -1,6 +1,6 @@ import React, { type FC, Fragment, useCallback, useState } from 'react'; import { Button, Dialog, Heading, Modal, ModalOverlay } from 'react-aria-components'; -import { useFetcher, useParams } from 'react-router-dom'; +import { useFetcher, useParams } from 'react-router'; import { parseApiSpec } from '../../../common/api-specs'; import { getProductName } from '../../../common/constants'; diff --git a/packages/insomnia/src/ui/components/dropdowns/workspace-dropdown.tsx b/packages/insomnia/src/ui/components/dropdowns/workspace-dropdown.tsx index 7d53a667f77..00d9826b9f9 100644 --- a/packages/insomnia/src/ui/components/dropdowns/workspace-dropdown.tsx +++ b/packages/insomnia/src/ui/components/dropdowns/workspace-dropdown.tsx @@ -1,7 +1,7 @@ import type { IconName } from '@fortawesome/fontawesome-svg-core'; import React, { type FC, type ReactNode, useCallback, useEffect, useState } from 'react'; import { Button, Collection, Dialog, Header, Heading, Menu, MenuItem, MenuTrigger, Modal, ModalOverlay, Popover, Section } from 'react-aria-components'; -import { useFetcher, useNavigate, useParams, useRouteLoaderData } from 'react-router-dom'; +import { useFetcher, useNavigate, useParams, useRouteLoaderData } from 'react-router'; import { getProductName } from '../../../common/constants'; import { database as db } from '../../../common/database'; diff --git a/packages/insomnia/src/ui/components/dropdowns/workspace-sync-dropdown.tsx b/packages/insomnia/src/ui/components/dropdowns/workspace-sync-dropdown.tsx index e2829f83a89..324d93257b9 100644 --- a/packages/insomnia/src/ui/components/dropdowns/workspace-sync-dropdown.tsx +++ b/packages/insomnia/src/ui/components/dropdowns/workspace-sync-dropdown.tsx @@ -1,6 +1,6 @@ import { type FC } from 'react'; import React from 'react'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import { isRemoteProject } from '../../../models/project'; import { useOrganizationPermissions } from '../../hooks/use-organization-features'; diff --git a/packages/insomnia/src/ui/components/editors/auth/components/auth-accordion.tsx b/packages/insomnia/src/ui/components/editors/auth/components/auth-accordion.tsx index 8e27124b408..d1ee159c3af 100644 --- a/packages/insomnia/src/ui/components/editors/auth/components/auth-accordion.tsx +++ b/packages/insomnia/src/ui/components/editors/auth/components/auth-accordion.tsx @@ -1,6 +1,6 @@ import classnames from 'classnames'; import React, { type FC, type PropsWithChildren } from 'react'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import type { RequestAccordionKeys } from '../../../../../models/request-meta'; import { useRequestMetaPatcher } from '../../../../hooks/use-request'; diff --git a/packages/insomnia/src/ui/components/editors/auth/components/auth-input-row.tsx b/packages/insomnia/src/ui/components/editors/auth/components/auth-input-row.tsx index c09056414af..07792709938 100644 --- a/packages/insomnia/src/ui/components/editors/auth/components/auth-input-row.tsx +++ b/packages/insomnia/src/ui/components/editors/auth/components/auth-input-row.tsx @@ -1,5 +1,5 @@ import React, { type ComponentProps, type FC, type ReactNode, useCallback } from 'react'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import { useToggle } from 'react-use'; import { toKebabCase } from '../../../../../common/misc'; diff --git a/packages/insomnia/src/ui/components/editors/auth/components/auth-private-key-row.tsx b/packages/insomnia/src/ui/components/editors/auth/components/auth-private-key-row.tsx index 13b777dd4dc..ed31dafd7a0 100644 --- a/packages/insomnia/src/ui/components/editors/auth/components/auth-private-key-row.tsx +++ b/packages/insomnia/src/ui/components/editors/auth/components/auth-private-key-row.tsx @@ -1,5 +1,5 @@ import React, { type FC, type ReactNode, useCallback } from 'react'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import { toKebabCase } from '../../../../../common/misc'; import { invariant } from '../../../../../utils/invariant'; diff --git a/packages/insomnia/src/ui/components/editors/auth/components/auth-row.tsx b/packages/insomnia/src/ui/components/editors/auth/components/auth-row.tsx index d19417b63a2..e290d7872d3 100644 --- a/packages/insomnia/src/ui/components/editors/auth/components/auth-row.tsx +++ b/packages/insomnia/src/ui/components/editors/auth/components/auth-row.tsx @@ -1,6 +1,6 @@ import classnames from 'classnames'; import React, { type FC, type PropsWithChildren, type ReactNode } from 'react'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import type { RequestLoaderData } from '../../../../routes/request'; import type { RequestGroupLoaderData } from '../../../../routes/request-group'; diff --git a/packages/insomnia/src/ui/components/editors/auth/components/auth-select-row.tsx b/packages/insomnia/src/ui/components/editors/auth/components/auth-select-row.tsx index ac82617cf3d..d4053e606bf 100644 --- a/packages/insomnia/src/ui/components/editors/auth/components/auth-select-row.tsx +++ b/packages/insomnia/src/ui/components/editors/auth/components/auth-select-row.tsx @@ -1,5 +1,5 @@ import React, { type ChangeEvent, type FC, type ReactNode, useCallback } from 'react'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import { toKebabCase } from '../../../../../common/misc'; import { useRequestGroupPatcher, useRequestPatcher } from '../../../../hooks/use-request'; diff --git a/packages/insomnia/src/ui/components/editors/auth/components/auth-toggle-row.tsx b/packages/insomnia/src/ui/components/editors/auth/components/auth-toggle-row.tsx index b791b2aeffd..5c11a2a5331 100644 --- a/packages/insomnia/src/ui/components/editors/auth/components/auth-toggle-row.tsx +++ b/packages/insomnia/src/ui/components/editors/auth/components/auth-toggle-row.tsx @@ -1,5 +1,5 @@ import React, { type FC, type ReactNode, useCallback } from 'react'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import { toKebabCase } from '../../../../../common/misc'; import { useRequestGroupPatcher, useRequestPatcher } from '../../../../hooks/use-request'; diff --git a/packages/insomnia/src/ui/components/editors/auth/o-auth-1-auth.tsx b/packages/insomnia/src/ui/components/editors/auth/o-auth-1-auth.tsx index 6919970480c..d88eaf88ee4 100644 --- a/packages/insomnia/src/ui/components/editors/auth/o-auth-1-auth.tsx +++ b/packages/insomnia/src/ui/components/editors/auth/o-auth-1-auth.tsx @@ -1,5 +1,5 @@ import React, { type FC } from 'react'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import type { AuthTypeOAuth1 } from '../../../../models/request'; import { diff --git a/packages/insomnia/src/ui/components/editors/auth/o-auth-2-auth.tsx b/packages/insomnia/src/ui/components/editors/auth/o-auth-2-auth.tsx index bc26de0063d..f098f9f5c58 100644 --- a/packages/insomnia/src/ui/components/editors/auth/o-auth-2-auth.tsx +++ b/packages/insomnia/src/ui/components/editors/auth/o-auth-2-auth.tsx @@ -1,5 +1,5 @@ import React, { type ChangeEvent, type FC, type ReactNode, useEffect, useMemo, useState } from 'react'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import { AUTH_OAUTH_2 } from '../../../../common/constants'; import { toKebabCase } from '../../../../common/misc'; diff --git a/packages/insomnia/src/ui/components/editors/body/body-editor.tsx b/packages/insomnia/src/ui/components/editors/body/body-editor.tsx index 6b2828c7a3a..f1cda235ec8 100644 --- a/packages/insomnia/src/ui/components/editors/body/body-editor.tsx +++ b/packages/insomnia/src/ui/components/editors/body/body-editor.tsx @@ -2,7 +2,7 @@ import clone from 'clone'; import { lookup } from 'mime-types'; import React, { type FC, useCallback } from 'react'; import { Toolbar } from 'react-aria-components'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import { CONTENT_TYPE_FILE, diff --git a/packages/insomnia/src/ui/components/editors/mock-response-extractor.tsx b/packages/insomnia/src/ui/components/editors/mock-response-extractor.tsx index 5230bd3993e..ad3420f00e4 100644 --- a/packages/insomnia/src/ui/components/editors/mock-response-extractor.tsx +++ b/packages/insomnia/src/ui/components/editors/mock-response-extractor.tsx @@ -1,11 +1,11 @@ import fs from 'fs/promises'; import React, { useState } from 'react'; import { Button } from 'react-aria-components'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router'; import { useFetcher, useRouteLoaderData, -} from 'react-router-dom'; +} from 'react-router'; import { getContentTypeName, getMimeTypeFromContentType } from '../../../common/constants'; import type { ResponseHeader } from '../../../models/response'; diff --git a/packages/insomnia/src/ui/components/editors/mock-response-headers-editor.tsx b/packages/insomnia/src/ui/components/editors/mock-response-headers-editor.tsx index 90113431a00..eeb33ec148f 100644 --- a/packages/insomnia/src/ui/components/editors/mock-response-headers-editor.tsx +++ b/packages/insomnia/src/ui/components/editors/mock-response-headers-editor.tsx @@ -1,5 +1,5 @@ import React, { type FC, useCallback } from 'react'; -import { useParams, useRouteLoaderData } from 'react-router-dom'; +import { useParams, useRouteLoaderData } from 'react-router'; import { getCommonHeaderNames, getCommonHeaderValues } from '../../../common/common-headers'; import type { RequestHeader } from '../../../models/request'; diff --git a/packages/insomnia/src/ui/components/editors/request-headers-editor.tsx b/packages/insomnia/src/ui/components/editors/request-headers-editor.tsx index b8db0f29e0e..98fadeff777 100644 --- a/packages/insomnia/src/ui/components/editors/request-headers-editor.tsx +++ b/packages/insomnia/src/ui/components/editors/request-headers-editor.tsx @@ -1,5 +1,5 @@ import React, { type FC, useCallback } from 'react'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import { getCommonHeaderNames, getCommonHeaderValues } from '../../../common/common-headers'; import { generateId } from '../../../common/misc'; diff --git a/packages/insomnia/src/ui/components/editors/request-parameters-editor.tsx b/packages/insomnia/src/ui/components/editors/request-parameters-editor.tsx index a027693326c..632d794ce0a 100644 --- a/packages/insomnia/src/ui/components/editors/request-parameters-editor.tsx +++ b/packages/insomnia/src/ui/components/editors/request-parameters-editor.tsx @@ -1,5 +1,5 @@ import React, { type FC, useCallback } from 'react'; -import { useParams, useRouteLoaderData } from 'react-router-dom'; +import { useParams, useRouteLoaderData } from 'react-router'; import type { RequestParameter } from '../../../models/request'; import { useRequestPatcher } from '../../hooks/use-request'; diff --git a/packages/insomnia/src/ui/components/environment-picker.tsx b/packages/insomnia/src/ui/components/environment-picker.tsx index 222aad93d89..c568794b311 100644 --- a/packages/insomnia/src/ui/components/environment-picker.tsx +++ b/packages/insomnia/src/ui/components/environment-picker.tsx @@ -1,7 +1,7 @@ import type { IconName } from '@fortawesome/fontawesome-svg-core'; import React, { Fragment } from 'react'; import { Button, ComboBox, Dialog, DialogTrigger, Heading, Input, ListBox, ListBoxItem, Popover, Text } from 'react-aria-components'; -import { useFetcher, useNavigate, useParams, useRouteLoaderData } from 'react-router-dom'; +import { useFetcher, useNavigate, useParams, useRouteLoaderData } from 'react-router'; import { fuzzyMatch } from '../../common/misc'; import { isRemoteProject } from '../../models/project'; diff --git a/packages/insomnia/src/ui/components/keydown-binder.ts b/packages/insomnia/src/ui/components/keydown-binder.ts index 15c89992228..1e7929e7971 100644 --- a/packages/insomnia/src/ui/components/keydown-binder.ts +++ b/packages/insomnia/src/ui/components/keydown-binder.ts @@ -1,5 +1,5 @@ import { useEffect } from 'react'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import { createKeybindingsHandler as _createKeybindingsHandler, type KeyBindingHandlerOptions, type KeyBindingMap, tinykeys } from 'tinykeys'; import { getPlatformKeyCombinations } from '../../common/hotkeys'; diff --git a/packages/insomnia/src/ui/components/mocks/mock-response-pane.tsx b/packages/insomnia/src/ui/components/mocks/mock-response-pane.tsx index 7912c910d02..6db89f5ce49 100644 --- a/packages/insomnia/src/ui/components/mocks/mock-response-pane.tsx +++ b/packages/insomnia/src/ui/components/mocks/mock-response-pane.tsx @@ -2,8 +2,8 @@ import fs from 'fs'; import type * as Har from 'har-format'; import React, { Fragment, useCallback, useEffect, useState } from 'react'; import { Button, Tab, TabList, TabPanel, Tabs, Toolbar } from 'react-aria-components'; -import { useRouteLoaderData } from 'react-router-dom'; -import { useFetcher } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; +import { useFetcher } from 'react-router'; import { useInterval } from 'react-use'; import { getMockServiceURL, getPreviewModeName, PREVIEW_MODE_FRIENDLY, PREVIEW_MODES, type PreviewMode } from '../../../common/constants'; diff --git a/packages/insomnia/src/ui/components/mocks/mock-url-bar.tsx b/packages/insomnia/src/ui/components/mocks/mock-url-bar.tsx index a1d839d5d53..0812db753a0 100644 --- a/packages/insomnia/src/ui/components/mocks/mock-url-bar.tsx +++ b/packages/insomnia/src/ui/components/mocks/mock-url-bar.tsx @@ -1,6 +1,6 @@ import React, { useRef, useState } from 'react'; import { Button } from 'react-aria-components'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import { useInterval } from 'react-use'; import { getMockServiceBinURL, HTTP_METHODS } from '../../../common/constants'; diff --git a/packages/insomnia/src/ui/components/modals/cli-preview-modal.tsx b/packages/insomnia/src/ui/components/modals/cli-preview-modal.tsx index 692cbe2f763..5a8d82f2b47 100644 --- a/packages/insomnia/src/ui/components/modals/cli-preview-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/cli-preview-modal.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Button, Dialog, Heading, Modal, ModalOverlay } from 'react-aria-components'; -import { useParams, useRouteLoaderData } from 'react-router-dom'; +import { useParams, useRouteLoaderData } from 'react-router'; import type { WorkspaceLoaderData } from '../../routes/workspace'; import { CopyButton } from '../base/copy-button'; diff --git a/packages/insomnia/src/ui/components/modals/cookie-modify-modal.tsx b/packages/insomnia/src/ui/components/modals/cookie-modify-modal.tsx index 1fe83f8bda8..f34a2f66f3d 100644 --- a/packages/insomnia/src/ui/components/modals/cookie-modify-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/cookie-modify-modal.tsx @@ -3,8 +3,8 @@ import { isValid } from 'date-fns'; import React, { useEffect, useRef, useState } from 'react'; import { OverlayContainer } from 'react-aria'; import { Tab, TabList, TabPanel, Tabs } from 'react-aria-components'; -import { useRouteLoaderData } from 'react-router-dom'; -import { useFetcher, useParams } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; +import { useFetcher, useParams } from 'react-router'; import { Cookie as ToughCookie } from 'tough-cookie'; import { cookieToString } from '../../../common/cookies'; diff --git a/packages/insomnia/src/ui/components/modals/cookies-modal.tsx b/packages/insomnia/src/ui/components/modals/cookies-modal.tsx index e3442052f4c..754a0aa4ec9 100644 --- a/packages/insomnia/src/ui/components/modals/cookies-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/cookies-modal.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useRef, useState } from 'react'; import { OverlayContainer } from 'react-aria'; -import { useFetcher, useParams, useRouteLoaderData } from 'react-router-dom'; +import { useFetcher, useParams, useRouteLoaderData } from 'react-router'; import { fuzzyMatch } from '../../../common/misc'; import type { Cookie, CookieJar } from '../../../models/cookie-jar'; diff --git a/packages/insomnia/src/ui/components/modals/export-requests-modal.tsx b/packages/insomnia/src/ui/components/modals/export-requests-modal.tsx index 90e1155a65e..a36ccf61c26 100644 --- a/packages/insomnia/src/ui/components/modals/export-requests-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/export-requests-modal.tsx @@ -1,6 +1,6 @@ import React, { type FC, type ReactNode, useEffect, useState } from 'react'; import { Button, Checkbox, Dialog, Heading, Modal, ModalOverlay } from 'react-aria-components'; -import { useFetcher, useParams } from 'react-router-dom'; +import { useFetcher, useParams } from 'react-router'; import { exportRequestsToFile } from '../../../common/export'; import { requestGroup } from '../../../models'; diff --git a/packages/insomnia/src/ui/components/modals/git-branches-modal.tsx b/packages/insomnia/src/ui/components/modals/git-branches-modal.tsx index 19d12b7064d..46beba54db1 100644 --- a/packages/insomnia/src/ui/components/modals/git-branches-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/git-branches-modal.tsx @@ -1,6 +1,6 @@ import React, { type FC, useEffect, useState } from 'react'; import { Button, Dialog, GridList, GridListItem, Heading, Input, Label, Modal, ModalOverlay, TextField } from 'react-aria-components'; -import { useFetcher, useParams, useRevalidator } from 'react-router-dom'; +import { useFetcher, useParams, useRevalidator } from 'react-router'; import { MergeConflictError } from '../../../sync/git/git-vcs'; import type { MergeConflict } from '../../../sync/types'; diff --git a/packages/insomnia/src/ui/components/modals/git-log-modal.tsx b/packages/insomnia/src/ui/components/modals/git-log-modal.tsx index ea36f1f5b65..189dff700d2 100644 --- a/packages/insomnia/src/ui/components/modals/git-log-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/git-log-modal.tsx @@ -1,6 +1,6 @@ import React, { type FC, useEffect } from 'react'; import { Button, Cell, Column, Dialog, Heading, Modal, ModalOverlay, Row, Table, TableBody, TableHeader, Tooltip, TooltipTrigger } from 'react-aria-components'; -import { useFetcher, useParams } from 'react-router-dom'; +import { useFetcher, useParams } from 'react-router'; import type { GitLogLoaderData } from '../../routes/git-actions'; import { Icon } from '../icon'; diff --git a/packages/insomnia/src/ui/components/modals/git-repository-settings-modal/git-repo-clone-modal.tsx b/packages/insomnia/src/ui/components/modals/git-repository-settings-modal/git-repo-clone-modal.tsx index 50ce9b2e6e8..b79a26b82b4 100644 --- a/packages/insomnia/src/ui/components/modals/git-repository-settings-modal/git-repo-clone-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/git-repository-settings-modal/git-repo-clone-modal.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useRef, useState } from 'react'; import { Tab, TabList, TabPanel, Tabs } from 'react-aria-components'; -import { useFetcher, useParams } from 'react-router-dom'; +import { useFetcher, useParams } from 'react-router'; import { docsGitSync } from '../../../../common/documentation'; import type { GitRepository, OauthProviderName } from '../../../../models/git-repository'; diff --git a/packages/insomnia/src/ui/components/modals/git-repository-settings-modal/git-repository-settings-modal.tsx b/packages/insomnia/src/ui/components/modals/git-repository-settings-modal/git-repository-settings-modal.tsx index 9a527c922f2..c00970e198d 100644 --- a/packages/insomnia/src/ui/components/modals/git-repository-settings-modal/git-repository-settings-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/git-repository-settings-modal/git-repository-settings-modal.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useRef, useState } from 'react'; import { OverlayContainer } from 'react-aria'; import { Tab, TabList, TabPanel, Tabs } from 'react-aria-components'; -import { useFetcher, useParams } from 'react-router-dom'; +import { useFetcher, useParams } from 'react-router'; import { docsGitSync } from '../../../../common/documentation'; import type { GitRepository, OauthProviderName } from '../../../../models/git-repository'; diff --git a/packages/insomnia/src/ui/components/modals/git-staging-modal.tsx b/packages/insomnia/src/ui/components/modals/git-staging-modal.tsx index e1e3d67be1e..0f4a67e3fa0 100644 --- a/packages/insomnia/src/ui/components/modals/git-staging-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/git-staging-modal.tsx @@ -1,7 +1,7 @@ import { Differ, Viewer } from 'json-diff-kit'; import React, { type FC, useEffect } from 'react'; import { Button, Dialog, GridList, GridListItem, Heading, Label, Modal, ModalOverlay, TextArea, TextField, Tooltip, TooltipTrigger } from 'react-aria-components'; -import { useFetcher, useParams } from 'react-router-dom'; +import { useFetcher, useParams } from 'react-router'; import type { GitChangesLoaderData, GitDiffResult } from '../../routes/git-actions'; import { Icon } from '../icon'; diff --git a/packages/insomnia/src/ui/components/modals/import-modal.tsx b/packages/insomnia/src/ui/components/modals/import-modal.tsx index a8ab364d582..bb4769d31d2 100644 --- a/packages/insomnia/src/ui/components/modals/import-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/import-modal.tsx @@ -10,7 +10,7 @@ import React, { } from 'react'; import { OverlayContainer, useDrop } from 'react-aria'; import { Heading } from 'react-aria-components'; -import { useFetcher } from 'react-router-dom'; +import { useFetcher } from 'react-router'; import { isScratchpadProject } from '../../../models/project'; import { SegmentEvent } from '../../analytics'; diff --git a/packages/insomnia/src/ui/components/modals/invite-modal/invite-modal.tsx b/packages/insomnia/src/ui/components/modals/invite-modal/invite-modal.tsx index 11a9a921ca7..47407093325 100644 --- a/packages/insomnia/src/ui/components/modals/invite-modal/invite-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/invite-modal/invite-modal.tsx @@ -1,6 +1,6 @@ import React, { type FC, type MutableRefObject, useCallback, useEffect, useRef, useState } from 'react'; import { Button, Dialog, Group, Heading, Input, ListBox, ListBoxItem, Modal, ModalOverlay, TextField } from 'react-aria-components'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import { getAccountId, getCurrentSessionId } from '../../../../account/session'; import defaultAvatarImg from '../../../../ui/images/default-avatar.svg'; diff --git a/packages/insomnia/src/ui/components/modals/invite-modal/organization-invite-form.tsx b/packages/insomnia/src/ui/components/modals/invite-modal/organization-invite-form.tsx index f74efe1bbe8..c8a102a0ab3 100644 --- a/packages/insomnia/src/ui/components/modals/invite-modal/organization-invite-form.tsx +++ b/packages/insomnia/src/ui/components/modals/invite-modal/organization-invite-form.tsx @@ -1,6 +1,6 @@ import React, { useCallback, useState } from 'react'; import { Button, Group, Input, TextField } from 'react-aria-components'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import { decryptRSAWithJWK, encryptRSAWithJWK } from '../../../../account/crypt'; import { getCurrentSessionId, getPrivateKey } from '../../../../account/session'; diff --git a/packages/insomnia/src/ui/components/modals/mock-server-settings-modal.tsx b/packages/insomnia/src/ui/components/modals/mock-server-settings-modal.tsx index c01b99ea331..e2bc33f853f 100644 --- a/packages/insomnia/src/ui/components/modals/mock-server-settings-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/mock-server-settings-modal.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; import { Button, Dialog, Heading, Input, Label, Link, Modal, ModalOverlay, Radio, RadioGroup, TextField } from 'react-aria-components'; -import { useFetcher, useParams, useRouteLoaderData } from 'react-router-dom'; +import { useFetcher, useParams, useRouteLoaderData } from 'react-router'; import { invariant } from '../../../utils/invariant'; import { fetchAndCacheOrganizationStorageRule, ORG_STORAGE_RULE, type OrganizationLoaderData } from '../../routes/organization'; diff --git a/packages/insomnia/src/ui/components/modals/proto-files-modal.tsx b/packages/insomnia/src/ui/components/modals/proto-files-modal.tsx index 904eb1dc2d2..a72cb3a97dc 100644 --- a/packages/insomnia/src/ui/components/modals/proto-files-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/proto-files-modal.tsx @@ -2,7 +2,7 @@ import * as protoLoader from '@grpc/proto-loader'; import fs from 'fs'; import path from 'path'; import React, { type FC, useEffect, useRef, useState } from 'react'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import { type ChangeBufferEvent, database as db } from '../../../common/database'; import { selectFileOrFolder } from '../../../common/select-file-or-folder'; diff --git a/packages/insomnia/src/ui/components/modals/request-group-settings-modal.tsx b/packages/insomnia/src/ui/components/modals/request-group-settings-modal.tsx index 5f4d71eb29d..58fffb3dcba 100644 --- a/packages/insomnia/src/ui/components/modals/request-group-settings-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/request-group-settings-modal.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useRef, useState } from 'react'; import { OverlayContainer } from 'react-aria'; -import { useFetcher, useNavigate, useParams } from 'react-router-dom'; +import { useFetcher, useNavigate, useParams } from 'react-router'; import { isNotNullOrUndefined } from '../../../common/misc'; import type { RequestGroup } from '../../../models/request-group'; diff --git a/packages/insomnia/src/ui/components/modals/request-settings-modal.tsx b/packages/insomnia/src/ui/components/modals/request-settings-modal.tsx index 8a376337936..bf7b1d4cb77 100644 --- a/packages/insomnia/src/ui/components/modals/request-settings-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/request-settings-modal.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useRef, useState } from 'react'; import { OverlayContainer } from 'react-aria'; -import { useFetcher, useNavigate, useParams } from 'react-router-dom'; +import { useFetcher, useNavigate, useParams } from 'react-router'; import { isNotNullOrUndefined } from '../../../common/misc'; import * as models from '../../../models'; diff --git a/packages/insomnia/src/ui/components/modals/sync-branches-modal.tsx b/packages/insomnia/src/ui/components/modals/sync-branches-modal.tsx index ad931f5672f..efd17c0c9f1 100644 --- a/packages/insomnia/src/ui/components/modals/sync-branches-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/sync-branches-modal.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react'; import { Button, Dialog, GridList, GridListItem, Heading, Input, Label, Modal, ModalOverlay, TextField } from 'react-aria-components'; -import { useFetcher, useParams } from 'react-router-dom'; +import { useFetcher, useParams } from 'react-router'; import { PromptButton } from '../base/prompt-button'; import { Icon } from '../icon'; diff --git a/packages/insomnia/src/ui/components/modals/sync-delete-modal.tsx b/packages/insomnia/src/ui/components/modals/sync-delete-modal.tsx index 02f7467ea27..d1734183059 100644 --- a/packages/insomnia/src/ui/components/modals/sync-delete-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/sync-delete-modal.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useRef, useState } from 'react'; import { OverlayContainer } from 'react-aria'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import { strings } from '../../../common/strings'; import { interceptAccessError } from '../../../sync/vcs/util'; diff --git a/packages/insomnia/src/ui/components/modals/sync-history-modal.tsx b/packages/insomnia/src/ui/components/modals/sync-history-modal.tsx index 0f267ab6800..086d37d3384 100644 --- a/packages/insomnia/src/ui/components/modals/sync-history-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/sync-history-modal.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Button, Cell, Column, Dialog, Heading, Modal, ModalOverlay, Row, Table, TableBody, TableHeader } from 'react-aria-components'; -import { useFetcher, useParams } from 'react-router-dom'; +import { useFetcher, useParams } from 'react-router'; import type { Snapshot } from '../../../sync/types'; import { useRootLoaderData } from '../../routes/root'; diff --git a/packages/insomnia/src/ui/components/modals/sync-staging-modal.tsx b/packages/insomnia/src/ui/components/modals/sync-staging-modal.tsx index 47262ee06a3..2ab7590f648 100644 --- a/packages/insomnia/src/ui/components/modals/sync-staging-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/sync-staging-modal.tsx @@ -3,7 +3,7 @@ import 'json-diff-kit/dist/viewer.css'; import { Differ, Viewer } from 'json-diff-kit'; import React, { useEffect, useState } from 'react'; import { Button, Dialog, GridList, GridListItem, Heading, Label, Modal, ModalOverlay, TextArea, TextField, Tooltip, TooltipTrigger } from 'react-aria-components'; -import { useFetcher, useParams } from 'react-router-dom'; +import { useFetcher, useParams } from 'react-router'; import { all } from '../../../models'; import type { StageEntry, Status, StatusCandidate } from '../../../sync/types'; diff --git a/packages/insomnia/src/ui/components/modals/workspace-certificates-modal.tsx b/packages/insomnia/src/ui/components/modals/workspace-certificates-modal.tsx index 842edaa2edd..61f7bf0f125 100644 --- a/packages/insomnia/src/ui/components/modals/workspace-certificates-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/workspace-certificates-modal.tsx @@ -1,6 +1,6 @@ import React, { Fragment, useEffect, useId, useState } from 'react'; import { Button, Dialog, FileTrigger, GridList, GridListItem, Heading, Input, Label, Modal, ModalOverlay, Tab, TabList, TabPanel, Tabs, ToggleButton } from 'react-aria-components'; -import { useFetcher, useParams, useRouteLoaderData } from 'react-router-dom'; +import { useFetcher, useParams, useRouteLoaderData } from 'react-router'; import type { ClientCertificate } from '../../../models/client-certificate'; import type { WorkspaceLoaderData } from '../../routes/workspace'; diff --git a/packages/insomnia/src/ui/components/modals/workspace-duplicate-modal.tsx b/packages/insomnia/src/ui/components/modals/workspace-duplicate-modal.tsx index f6f5e25bbf8..208732a5071 100644 --- a/packages/insomnia/src/ui/components/modals/workspace-duplicate-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/workspace-duplicate-modal.tsx @@ -1,6 +1,6 @@ import React, { type FC, type MouseEventHandler, useEffect, useRef, useState } from 'react'; import { OverlayContainer } from 'react-aria'; -import { useFetcher, useParams } from 'react-router-dom'; +import { useFetcher, useParams } from 'react-router'; import { database } from '../../../common/database'; import { getWorkspaceLabel } from '../../../common/get-workspace-label'; diff --git a/packages/insomnia/src/ui/components/modals/workspace-environments-edit-modal.tsx b/packages/insomnia/src/ui/components/modals/workspace-environments-edit-modal.tsx index 9415c9ce384..f74c2539247 100644 --- a/packages/insomnia/src/ui/components/modals/workspace-environments-edit-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/workspace-environments-edit-modal.tsx @@ -1,7 +1,7 @@ import type { IconName, IconProp } from '@fortawesome/fontawesome-svg-core'; import React, { Fragment, useMemo, useRef, useState } from 'react'; import { Button, Dialog, DropIndicator, GridList, GridListItem, Heading, Label, Menu, MenuItem, MenuTrigger, Modal, ModalOverlay, Popover, Text, ToggleButton, useDragAndDrop } from 'react-aria-components'; -import { useFetcher, useParams, useRouteLoaderData } from 'react-router-dom'; +import { useFetcher, useParams, useRouteLoaderData } from 'react-router'; import { docsAfterResponseScript, docsTemplateTags } from '../../../common/documentation'; import { debounce } from '../../../common/misc'; diff --git a/packages/insomnia/src/ui/components/modals/workspace-settings-modal.tsx b/packages/insomnia/src/ui/components/modals/workspace-settings-modal.tsx index 9252d52a1b9..9638144a1d9 100644 --- a/packages/insomnia/src/ui/components/modals/workspace-settings-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/workspace-settings-modal.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Button, Dialog, Heading, Input, Label, Modal, ModalOverlay, Radio, RadioGroup, TextField } from 'react-aria-components'; -import { useFetcher, useRouteLoaderData } from 'react-router-dom'; +import { useFetcher, useRouteLoaderData } from 'react-router'; import { database as db } from '../../../common/database'; import { getWorkspaceLabel } from '../../../common/get-workspace-label'; diff --git a/packages/insomnia/src/ui/components/panes/grpc-request-pane.tsx b/packages/insomnia/src/ui/components/panes/grpc-request-pane.tsx index f10f6f984d8..7935b023249 100644 --- a/packages/insomnia/src/ui/components/panes/grpc-request-pane.tsx +++ b/packages/insomnia/src/ui/components/panes/grpc-request-pane.tsx @@ -1,6 +1,6 @@ import React, { type FunctionComponent, useRef, useState } from 'react'; import { Tab, TabList, TabPanel, Tabs } from 'react-aria-components'; -import { useParams, useRouteLoaderData } from 'react-router-dom'; +import { useParams, useRouteLoaderData } from 'react-router'; import { useMount } from 'react-use'; import { getCommonHeaderNames, getCommonHeaderValues } from '../../../common/common-headers'; diff --git a/packages/insomnia/src/ui/components/panes/placeholder-request-pane.tsx b/packages/insomnia/src/ui/components/panes/placeholder-request-pane.tsx index f215cc979e8..779389b2966 100644 --- a/packages/insomnia/src/ui/components/panes/placeholder-request-pane.tsx +++ b/packages/insomnia/src/ui/components/panes/placeholder-request-pane.tsx @@ -1,5 +1,5 @@ import React, { type FC, useCallback } from 'react'; -import { useFetcher, useParams } from 'react-router-dom'; +import { useFetcher, useParams } from 'react-router'; import { useRootLoaderData } from '../../routes/root'; import { Hotkey } from '../hotkey'; diff --git a/packages/insomnia/src/ui/components/panes/project-empty-state-pane.tsx b/packages/insomnia/src/ui/components/panes/project-empty-state-pane.tsx index a7a3935f95b..48f8b97ac7a 100644 --- a/packages/insomnia/src/ui/components/panes/project-empty-state-pane.tsx +++ b/packages/insomnia/src/ui/components/panes/project-empty-state-pane.tsx @@ -1,6 +1,6 @@ import React, { type FC, type PropsWithChildren } from 'react'; import { Button } from 'react-aria-components'; -import { useParams } from 'react-router-dom'; +import { useParams } from 'react-router'; import { getAccountId } from '../../../account/session'; import { getAppWebsiteBaseURL } from '../../../common/constants'; diff --git a/packages/insomnia/src/ui/components/panes/request-group-pane.tsx b/packages/insomnia/src/ui/components/panes/request-group-pane.tsx index e90bd6a7121..5b4986602b7 100644 --- a/packages/insomnia/src/ui/components/panes/request-group-pane.tsx +++ b/packages/insomnia/src/ui/components/panes/request-group-pane.tsx @@ -1,6 +1,6 @@ import React, { type FC, useRef, useState } from 'react'; import { Heading, Tab, TabList, TabPanel, Tabs, ToggleButton } from 'react-aria-components'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import { type EnvironmentKvPairData, EnvironmentType, getDataFromKVPair } from '../../../models/environment'; import type { Settings } from '../../../models/settings'; diff --git a/packages/insomnia/src/ui/components/panes/request-pane.tsx b/packages/insomnia/src/ui/components/panes/request-pane.tsx index 3b3e94c49d0..12879a08c49 100644 --- a/packages/insomnia/src/ui/components/panes/request-pane.tsx +++ b/packages/insomnia/src/ui/components/panes/request-pane.tsx @@ -1,6 +1,6 @@ import React, { type FC, Fragment, useState } from 'react'; import { Button, Heading, Tab, TabList, TabPanel, Tabs, ToggleButton } from 'react-aria-components'; -import { useParams, useRouteLoaderData } from 'react-router-dom'; +import { useParams, useRouteLoaderData } from 'react-router'; import { useLocalStorage } from 'react-use'; import { getContentTypeFromHeaders } from '../../../common/constants'; diff --git a/packages/insomnia/src/ui/components/panes/response-pane.tsx b/packages/insomnia/src/ui/components/panes/response-pane.tsx index 7666639a817..aa7b8e3f220 100644 --- a/packages/insomnia/src/ui/components/panes/response-pane.tsx +++ b/packages/insomnia/src/ui/components/panes/response-pane.tsx @@ -2,7 +2,7 @@ import fs from 'fs'; import { extension as mimeExtension } from 'mime-types'; import React, { type FC, useCallback, useMemo } from 'react'; import { Tab, TabList, TabPanel, Tabs, Toolbar } from 'react-aria-components'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import { PREVIEW_MODE_SOURCE } from '../../../common/constants'; import { getSetCookieHeaders } from '../../../common/misc'; diff --git a/packages/insomnia/src/ui/components/present-users.tsx b/packages/insomnia/src/ui/components/present-users.tsx index 6e807e31c90..241843126e3 100644 --- a/packages/insomnia/src/ui/components/present-users.tsx +++ b/packages/insomnia/src/ui/components/present-users.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { useParams, useRouteLoaderData } from 'react-router-dom'; +import { useParams, useRouteLoaderData } from 'react-router'; import { useInsomniaEventStreamContext } from '../context/app/insomnia-event-stream-context'; import type { ProjectIdLoaderData } from '../routes/project'; diff --git a/packages/insomnia/src/ui/components/request-url-bar.tsx b/packages/insomnia/src/ui/components/request-url-bar.tsx index cd9ac6fd9ea..309b1682a5c 100644 --- a/packages/insomnia/src/ui/components/request-url-bar.tsx +++ b/packages/insomnia/src/ui/components/request-url-bar.tsx @@ -1,6 +1,6 @@ import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react'; import { Button } from 'react-aria-components'; -import { useFetcher, useParams, useRouteLoaderData, useSearchParams } from 'react-router-dom'; +import { useFetcher, useParams, useRouteLoaderData, useSearchParams } from 'react-router'; import { useInterval } from 'react-use'; import { database as db } from '../../common/database'; diff --git a/packages/insomnia/src/ui/components/settings/import-export.tsx b/packages/insomnia/src/ui/components/settings/import-export.tsx index c54a9e26c88..af4debeebb0 100644 --- a/packages/insomnia/src/ui/components/settings/import-export.tsx +++ b/packages/insomnia/src/ui/components/settings/import-export.tsx @@ -1,7 +1,7 @@ import React, { type FC, Fragment, useEffect, useState } from 'react'; import { Button, Heading, ListBox, ListBoxItem, Popover, Select, SelectValue } from 'react-aria-components'; -import { useFetcher, useParams } from 'react-router-dom'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useFetcher, useParams } from 'react-router'; +import { useRouteLoaderData } from 'react-router'; import { getProductName } from '../../../common/constants'; import { exportProjectToFile } from '../../../common/export'; diff --git a/packages/insomnia/src/ui/components/websockets/action-bar.tsx b/packages/insomnia/src/ui/components/websockets/action-bar.tsx index 5ea2934852f..c0aa5c90dc5 100644 --- a/packages/insomnia/src/ui/components/websockets/action-bar.tsx +++ b/packages/insomnia/src/ui/components/websockets/action-bar.tsx @@ -1,5 +1,5 @@ import React, { type FC, useCallback, useEffect, useLayoutEffect, useRef } from 'react'; -import { useFetcher, useParams } from 'react-router-dom'; +import { useFetcher, useParams } from 'react-router'; import * as models from '../../../models'; import type { WebSocketRequest } from '../../../models/websocket-request'; diff --git a/packages/insomnia/src/ui/components/websockets/event-view.tsx b/packages/insomnia/src/ui/components/websockets/event-view.tsx index b1af0b4e54f..e4f57f46e25 100644 --- a/packages/insomnia/src/ui/components/websockets/event-view.tsx +++ b/packages/insomnia/src/ui/components/websockets/event-view.tsx @@ -1,6 +1,6 @@ import fs from 'fs'; import React, { type FC, useCallback } from 'react'; -import { useParams, useRouteLoaderData } from 'react-router-dom'; +import { useParams, useRouteLoaderData } from 'react-router'; import { PREVIEW_MODE_FRIENDLY, PREVIEW_MODE_RAW, PREVIEW_MODE_SOURCE } from '../../../common/constants'; import type { CurlEvent, CurlMessageEvent } from '../../../main/network/curl'; diff --git a/packages/insomnia/src/ui/components/websockets/realtime-response-pane.tsx b/packages/insomnia/src/ui/components/websockets/realtime-response-pane.tsx index 73777144fa8..cbce24b56d8 100644 --- a/packages/insomnia/src/ui/components/websockets/realtime-response-pane.tsx +++ b/packages/insomnia/src/ui/components/websockets/realtime-response-pane.tsx @@ -2,7 +2,7 @@ import fs from 'fs'; import React, { type FC, useEffect, useState } from 'react'; import { Button, Input, SearchField, Tab, TabList, TabPanel, Tabs } from 'react-aria-components'; import { Panel, PanelGroup, PanelResizeHandle } from 'react-resizable-panels'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import { getSetCookieHeaders } from '../../../common/misc'; import type { CurlEvent } from '../../../main/network/curl'; diff --git a/packages/insomnia/src/ui/components/websockets/websocket-request-pane.tsx b/packages/insomnia/src/ui/components/websockets/websocket-request-pane.tsx index 08a89c62fc1..7a7e199a4c2 100644 --- a/packages/insomnia/src/ui/components/websockets/websocket-request-pane.tsx +++ b/packages/insomnia/src/ui/components/websockets/websocket-request-pane.tsx @@ -1,6 +1,6 @@ import React, { type FC, Fragment, useEffect, useRef, useState } from 'react'; import { Button, Heading, Tab, TabList, TabPanel, Tabs, ToggleButton, Toolbar } from 'react-aria-components'; -import { useParams, useRouteLoaderData } from 'react-router-dom'; +import { useParams, useRouteLoaderData } from 'react-router'; import { useLocalStorage } from 'react-use'; import { CONTENT_TYPE_JSON } from '../../../common/constants'; diff --git a/packages/insomnia/src/ui/context/app/ai-context.tsx b/packages/insomnia/src/ui/context/app/ai-context.tsx index 67b63293f71..9774c531234 100644 --- a/packages/insomnia/src/ui/context/app/ai-context.tsx +++ b/packages/insomnia/src/ui/context/app/ai-context.tsx @@ -1,5 +1,5 @@ import React, { createContext, type FC, type PropsWithChildren, useContext, useEffect, useRef } from 'react'; -import { useFetcher, useFetchers, useParams } from 'react-router-dom'; +import { useFetcher, useFetchers, useParams } from 'react-router'; import { useRootLoaderData } from '../../routes/root'; diff --git a/packages/insomnia/src/ui/context/app/insomnia-event-stream-context.tsx b/packages/insomnia/src/ui/context/app/insomnia-event-stream-context.tsx index 6c471440f78..a598600fbfd 100644 --- a/packages/insomnia/src/ui/context/app/insomnia-event-stream-context.tsx +++ b/packages/insomnia/src/ui/context/app/insomnia-event-stream-context.tsx @@ -1,5 +1,5 @@ import React, { createContext, type FC, type PropsWithChildren, useContext, useEffect, useState } from 'react'; -import { useFetcher, useParams, useRouteLoaderData } from 'react-router-dom'; +import { useFetcher, useParams, useRouteLoaderData } from 'react-router'; import { CDN_INVALIDATION_TTL } from '../../../common/constants'; import { insomniaFetch } from '../../../ui/insomniaFetch'; diff --git a/packages/insomnia/src/ui/context/nunjucks/use-nunjucks.ts b/packages/insomnia/src/ui/context/nunjucks/use-nunjucks.ts index 1ce3ebe4963..0561d1e8611 100644 --- a/packages/insomnia/src/ui/context/nunjucks/use-nunjucks.ts +++ b/packages/insomnia/src/ui/context/nunjucks/use-nunjucks.ts @@ -1,5 +1,5 @@ import { useCallback } from 'react'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import { getRenderContext, getRenderContextAncestors, type HandleGetRenderContext, type HandleRender, render } from '../../../common/render'; import { NUNJUCKS_TEMPLATE_GLOBAL_PROPERTY_NAME } from '../../../templating'; diff --git a/packages/insomnia/src/ui/hooks/use-document-title.ts b/packages/insomnia/src/ui/hooks/use-document-title.ts index ed68d8af6c2..7b32d535a0e 100644 --- a/packages/insomnia/src/ui/hooks/use-document-title.ts +++ b/packages/insomnia/src/ui/hooks/use-document-title.ts @@ -1,5 +1,5 @@ import { useEffect } from 'react'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import { getProductName } from '../../common/constants'; import type { RequestLoaderData } from '../routes/request'; diff --git a/packages/insomnia/src/ui/hooks/use-organization-features.tsx b/packages/insomnia/src/ui/hooks/use-organization-features.tsx index 60bfd9e1dfc..865af29476a 100644 --- a/packages/insomnia/src/ui/hooks/use-organization-features.tsx +++ b/packages/insomnia/src/ui/hooks/use-organization-features.tsx @@ -1,5 +1,5 @@ import { useEffect } from 'react'; -import { useFetcher, useParams } from 'react-router-dom'; +import { useFetcher, useParams } from 'react-router'; import { isScratchpadOrganizationId } from '../../models/organization'; import type { OrganizationFeatureLoaderData } from '../routes/organization'; diff --git a/packages/insomnia/src/ui/hooks/use-request.ts b/packages/insomnia/src/ui/hooks/use-request.ts index 09014cd1a10..fd57f35d3a4 100644 --- a/packages/insomnia/src/ui/hooks/use-request.ts +++ b/packages/insomnia/src/ui/hooks/use-request.ts @@ -1,5 +1,5 @@ -import { useFetcher, useParams } from 'react-router-dom'; +import { useFetcher, useParams } from 'react-router'; import type { GrpcRequest } from '../../models/grpc-request'; import type { GrpcRequestMeta } from '../../models/grpc-request-meta'; diff --git a/packages/insomnia/src/ui/hooks/use-vcs-version.ts b/packages/insomnia/src/ui/hooks/use-vcs-version.ts index d5682b6c84f..15afc5878b8 100644 --- a/packages/insomnia/src/ui/hooks/use-vcs-version.ts +++ b/packages/insomnia/src/ui/hooks/use-vcs-version.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react'; -import { useRouteLoaderData } from 'react-router-dom'; -import { useParams } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; +import { useParams } from 'react-router'; import { type ChangeBufferEvent, database } from '../../common/database'; import type { BaseModel } from '../../models'; diff --git a/packages/insomnia/src/ui/index.tsx b/packages/insomnia/src/ui/index.tsx index 338a4a148ba..ff738940384 100644 --- a/packages/insomnia/src/ui/index.tsx +++ b/packages/insomnia/src/ui/index.tsx @@ -7,7 +7,7 @@ import { matchPath, Outlet, RouterProvider, -} from 'react-router-dom'; +} from 'react-router'; import { migrateFromLocalStorage, type SessionData, setSessionData } from '../account/session'; import { diff --git a/packages/insomnia/src/ui/routes/actions.tsx b/packages/insomnia/src/ui/routes/actions.tsx index 43412376740..9d951bbcc8e 100644 --- a/packages/insomnia/src/ui/routes/actions.tsx +++ b/packages/insomnia/src/ui/routes/actions.tsx @@ -2,7 +2,7 @@ import type { IRuleResult } from '@stoplight/spectral-core'; import { generate, runTests, type Test } from 'insomnia-testing'; import type { TestResults } from 'insomnia-testing/src/run/entities'; import path from 'path'; -import { type ActionFunction, redirect } from 'react-router-dom'; +import { type ActionFunction, redirect } from 'react-router'; import { parseApiSpec, resolveComponentSchemaRefs } from '../../common/api-specs'; import { ACTIVITY_DEBUG, getAIServiceURL } from '../../common/constants'; diff --git a/packages/insomnia/src/ui/routes/auth.authorize.tsx b/packages/insomnia/src/ui/routes/auth.authorize.tsx index 9898de6cbe7..5db18b4d3f8 100644 --- a/packages/insomnia/src/ui/routes/auth.authorize.tsx +++ b/packages/insomnia/src/ui/routes/auth.authorize.tsx @@ -1,6 +1,6 @@ import React, { Fragment } from 'react'; import { Button, Heading } from 'react-aria-components'; -import { type ActionFunction, redirect, useFetcher, useFetchers, useNavigate } from 'react-router-dom'; +import { type ActionFunction, redirect, useFetcher, useFetchers, useNavigate } from 'react-router'; import { invariant } from '../../utils/invariant'; import { SegmentEvent } from '../analytics'; diff --git a/packages/insomnia/src/ui/routes/auth.login.tsx b/packages/insomnia/src/ui/routes/auth.login.tsx index 3f3dd180dec..b9c53d1ec44 100644 --- a/packages/insomnia/src/ui/routes/auth.login.tsx +++ b/packages/insomnia/src/ui/routes/auth.login.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; import { Button } from 'react-aria-components'; -import { type ActionFunction, redirect, useFetcher, useNavigate } from 'react-router-dom'; +import { type ActionFunction, redirect, useFetcher, useNavigate } from 'react-router'; import { LandingPage } from '../../common/sentry'; import { SegmentEvent } from '../analytics'; diff --git a/packages/insomnia/src/ui/routes/auth.logout.tsx b/packages/insomnia/src/ui/routes/auth.logout.tsx index 72bb53d5058..244ee102327 100644 --- a/packages/insomnia/src/ui/routes/auth.logout.tsx +++ b/packages/insomnia/src/ui/routes/auth.logout.tsx @@ -1,4 +1,4 @@ -import { type ActionFunction, redirect } from 'react-router-dom'; +import { type ActionFunction, redirect } from 'react-router'; import { logout } from '../../account/session'; diff --git a/packages/insomnia/src/ui/routes/auth.tsx b/packages/insomnia/src/ui/routes/auth.tsx index d2e95fad89d..27b28aa4510 100644 --- a/packages/insomnia/src/ui/routes/auth.tsx +++ b/packages/insomnia/src/ui/routes/auth.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; import { Button, Link, Tooltip, TooltipTrigger } from 'react-aria-components'; -import { Outlet } from 'react-router-dom'; +import { Outlet } from 'react-router'; import { Hotkey } from '../components/hotkey'; import { Icon } from '../components/icon'; diff --git a/packages/insomnia/src/ui/routes/commands.tsx b/packages/insomnia/src/ui/routes/commands.tsx index 982ef970315..90f1dcfa1a5 100644 --- a/packages/insomnia/src/ui/routes/commands.tsx +++ b/packages/insomnia/src/ui/routes/commands.tsx @@ -1,4 +1,4 @@ -import type { LoaderFunction } from 'react-router-dom'; +import type { LoaderFunction } from 'react-router'; import { database } from '../../common/database'; import { fuzzyMatch } from '../../common/misc'; diff --git a/packages/insomnia/src/ui/routes/debug.tsx b/packages/insomnia/src/ui/routes/debug.tsx index 441fce9c964..8b84d2be1ab 100644 --- a/packages/insomnia/src/ui/routes/debug.tsx +++ b/packages/insomnia/src/ui/routes/debug.tsx @@ -40,7 +40,7 @@ import { useParams, useRouteLoaderData, useSearchParams, -} from 'react-router-dom'; +} from 'react-router'; import { DEFAULT_SIDEBAR_SIZE, getProductName, SORT_ORDERS, type SortOrder, sortOrderName } from '../../common/constants'; import { type ChangeBufferEvent, database as db } from '../../common/database'; diff --git a/packages/insomnia/src/ui/routes/design.tsx b/packages/insomnia/src/ui/routes/design.tsx index 7bfac39a31c..c80843d6c40 100644 --- a/packages/insomnia/src/ui/routes/design.tsx +++ b/packages/insomnia/src/ui/routes/design.tsx @@ -39,7 +39,7 @@ import { useLoaderData, useParams, useRouteLoaderData, -} from 'react-router-dom'; +} from 'react-router'; import { useUnmount } from 'react-use'; import { SwaggerUIBundle } from 'swagger-ui-dist'; import YAML from 'yaml'; diff --git a/packages/insomnia/src/ui/routes/environments.tsx b/packages/insomnia/src/ui/routes/environments.tsx index 5fd3ff51f31..ee10fa0c5fc 100644 --- a/packages/insomnia/src/ui/routes/environments.tsx +++ b/packages/insomnia/src/ui/routes/environments.tsx @@ -2,7 +2,7 @@ import type { IconName, IconProp } from '@fortawesome/fontawesome-svg-core'; import React, { Fragment, useEffect, useRef, useState } from 'react'; import { Breadcrumb, Breadcrumbs, Button, DropIndicator, GridList, GridListItem, Heading, Label, Menu, MenuItem, MenuTrigger, Popover, Text, ToggleButton, useDragAndDrop } from 'react-aria-components'; import { type ImperativePanelGroupHandle, Panel, PanelGroup, PanelResizeHandle } from 'react-resizable-panels'; -import { NavLink, useFetcher, useParams, useRouteLoaderData } from 'react-router-dom'; +import { NavLink, useFetcher, useParams, useRouteLoaderData } from 'react-router'; import { DEFAULT_SIDEBAR_SIZE } from '../../common/constants'; import { debounce } from '../../common/misc'; diff --git a/packages/insomnia/src/ui/routes/error.tsx b/packages/insomnia/src/ui/routes/error.tsx index 0ea28489bf1..fbd5d02f549 100644 --- a/packages/insomnia/src/ui/routes/error.tsx +++ b/packages/insomnia/src/ui/routes/error.tsx @@ -7,7 +7,7 @@ import { useNavigate, useNavigation, useRouteError, -} from 'react-router-dom'; +} from 'react-router'; import { Icon } from '../components/icon'; diff --git a/packages/insomnia/src/ui/routes/git-actions.tsx b/packages/insomnia/src/ui/routes/git-actions.tsx index d9a3ad075d4..1db3efe354c 100644 --- a/packages/insomnia/src/ui/routes/git-actions.tsx +++ b/packages/insomnia/src/ui/routes/git-actions.tsx @@ -1,7 +1,7 @@ import { fromUrl } from 'hosted-git-info'; import { Errors } from 'isomorphic-git'; import path from 'path'; -import { type ActionFunction, type LoaderFunction, redirect } from 'react-router-dom'; +import { type ActionFunction, type LoaderFunction, redirect } from 'react-router'; import YAML from 'yaml'; import { ACTIVITY_SPEC } from '../../common/constants'; diff --git a/packages/insomnia/src/ui/routes/import.tsx b/packages/insomnia/src/ui/routes/import.tsx index 74f971c074d..a946434c608 100644 --- a/packages/insomnia/src/ui/routes/import.tsx +++ b/packages/insomnia/src/ui/routes/import.tsx @@ -1,6 +1,6 @@ import path from 'node:path'; -import type { ActionFunction } from 'react-router-dom'; +import type { ActionFunction } from 'react-router'; import type { PostmanDataDumpRawData } from '../../common/import'; import { fetchImportContentFromURI, getFilesFromPostmanExportedDataDump, importResourcesToProject, importResourcesToWorkspace, scanResources, type ScanResult } from '../../common/import'; diff --git a/packages/insomnia/src/ui/routes/mock-route.tsx b/packages/insomnia/src/ui/routes/mock-route.tsx index 89edde3b702..57b14c8b7ff 100644 --- a/packages/insomnia/src/ui/routes/mock-route.tsx +++ b/packages/insomnia/src/ui/routes/mock-route.tsx @@ -1,7 +1,7 @@ import type * as Har from 'har-format'; import React from 'react'; import { Button, Tab, TabList, TabPanel, Tabs, Toolbar } from 'react-aria-components'; -import { type LoaderFunction, useFetcher, useParams, useRouteLoaderData } from 'react-router-dom'; +import { type LoaderFunction, useFetcher, useParams, useRouteLoaderData } from 'react-router'; import { CONTENT_TYPE_JSON, CONTENT_TYPE_OTHER, CONTENT_TYPE_PLAINTEXT, CONTENT_TYPE_XML, CONTENT_TYPE_YAML, contentTypesMap, getMockServiceBinURL, getMockServiceURL, RESPONSE_CODE_REASONS } from '../../common/constants'; import { database as db } from '../../common/database'; diff --git a/packages/insomnia/src/ui/routes/mock-server.tsx b/packages/insomnia/src/ui/routes/mock-server.tsx index 77af1aa41d5..8a4ef7858f1 100644 --- a/packages/insomnia/src/ui/routes/mock-server.tsx +++ b/packages/insomnia/src/ui/routes/mock-server.tsx @@ -2,7 +2,7 @@ import type { IconName } from '@fortawesome/fontawesome-svg-core'; import React, { Suspense, useEffect, useLayoutEffect, useRef, useState } from 'react'; import { Breadcrumb, Breadcrumbs, Button, GridList, GridListItem, Menu, MenuItem, MenuTrigger, Popover } from 'react-aria-components'; import { type ImperativePanelGroupHandle, Panel, PanelGroup, PanelResizeHandle } from 'react-resizable-panels'; -import { type LoaderFunction, NavLink, Route, Routes, useFetcher, useLoaderData, useNavigate, useParams } from 'react-router-dom'; +import { type LoaderFunction, NavLink, Route, Routes, useFetcher, useLoaderData, useNavigate, useParams } from 'react-router'; import { DEFAULT_SIDEBAR_SIZE } from '../../common/constants'; import * as models from '../../models'; diff --git a/packages/insomnia/src/ui/routes/modals.tsx b/packages/insomnia/src/ui/routes/modals.tsx index 71ba0f9d31b..b39cf236ecd 100644 --- a/packages/insomnia/src/ui/routes/modals.tsx +++ b/packages/insomnia/src/ui/routes/modals.tsx @@ -1,5 +1,5 @@ import React, { type FC } from 'react'; -import { useRouteLoaderData } from 'react-router-dom'; +import { useRouteLoaderData } from 'react-router'; import { ErrorBoundary } from '../components/error-boundary'; import { registerModal } from '../components/modals'; diff --git a/packages/insomnia/src/ui/routes/onboarding.migrate.tsx b/packages/insomnia/src/ui/routes/onboarding.migrate.tsx index 2158a0679be..6802dfdd938 100644 --- a/packages/insomnia/src/ui/routes/onboarding.migrate.tsx +++ b/packages/insomnia/src/ui/routes/onboarding.migrate.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Button, Heading, Radio, RadioGroup } from 'react-aria-components'; -import { type ActionFunction, type LoaderFunction, redirect, useFetcher } from 'react-router-dom'; +import { type ActionFunction, type LoaderFunction, redirect, useFetcher } from 'react-router'; import { shouldMigrateProjectUnderOrganization } from '../../sync/vcs/migrate-projects-into-organization'; import { invariant } from '../../utils/invariant'; diff --git a/packages/insomnia/src/ui/routes/onboarding.tsx b/packages/insomnia/src/ui/routes/onboarding.tsx index c28d06f7463..173116ce639 100644 --- a/packages/insomnia/src/ui/routes/onboarding.tsx +++ b/packages/insomnia/src/ui/routes/onboarding.tsx @@ -1,6 +1,6 @@ import type { IconName } from '@fortawesome/fontawesome-svg-core'; import React, { useEffect } from 'react'; -import { Link, Route, Routes, useLocation } from 'react-router-dom'; +import { Link, Route, Routes, useLocation } from 'react-router'; import { LandingPage } from '../../common/sentry'; import { InsomniaLogo } from '../components/insomnia-icon'; diff --git a/packages/insomnia/src/ui/routes/organization.tsx b/packages/insomnia/src/ui/routes/organization.tsx index 88134d0b42f..21a5da88269 100644 --- a/packages/insomnia/src/ui/routes/organization.tsx +++ b/packages/insomnia/src/ui/routes/organization.tsx @@ -24,7 +24,7 @@ import { useNavigate, useParams, useRouteLoaderData, -} from 'react-router-dom'; +} from 'react-router'; import { useLocalStorage } from 'react-use'; import * as session from '../../account/session'; diff --git a/packages/insomnia/src/ui/routes/project.tsx b/packages/insomnia/src/ui/routes/project.tsx index bf0c6dfb373..4ce3ec0bd5b 100644 --- a/packages/insomnia/src/ui/routes/project.tsx +++ b/packages/insomnia/src/ui/routes/project.tsx @@ -39,7 +39,7 @@ import { useNavigate, useParams, useRouteLoaderData, -} from 'react-router-dom'; +} from 'react-router'; import { useLocalStorage } from 'react-use'; import { logout } from '../../account/session'; diff --git a/packages/insomnia/src/ui/routes/remote-collections.tsx b/packages/insomnia/src/ui/routes/remote-collections.tsx index ebecbc983f6..34dd91c4846 100644 --- a/packages/insomnia/src/ui/routes/remote-collections.tsx +++ b/packages/insomnia/src/ui/routes/remote-collections.tsx @@ -1,5 +1,5 @@ import * as Sentry from '@sentry/electron/renderer'; -import { type ActionFunction, type LoaderFunction, redirect } from 'react-router-dom'; +import { type ActionFunction, type LoaderFunction, redirect } from 'react-router'; import { database, type Operation } from '../../common/database'; import { isNotNullOrUndefined } from '../../common/misc'; diff --git a/packages/insomnia/src/ui/routes/request-group.tsx b/packages/insomnia/src/ui/routes/request-group.tsx index 8d9e30bf75d..d56dd90397c 100644 --- a/packages/insomnia/src/ui/routes/request-group.tsx +++ b/packages/insomnia/src/ui/routes/request-group.tsx @@ -1,4 +1,4 @@ -import { type ActionFunction, type LoaderFunction, redirect } from 'react-router-dom'; +import { type ActionFunction, type LoaderFunction, redirect } from 'react-router'; import * as models from '../../models'; import { EnvironmentType } from '../../models/environment'; diff --git a/packages/insomnia/src/ui/routes/request.tsx b/packages/insomnia/src/ui/routes/request.tsx index cfa0e94e3b1..0d75c2ca19d 100644 --- a/packages/insomnia/src/ui/routes/request.tsx +++ b/packages/insomnia/src/ui/routes/request.tsx @@ -5,7 +5,7 @@ import * as contentDisposition from 'content-disposition'; import { GRAPHQL_TRANSPORT_WS_PROTOCOL, MessageType } from 'graphql-ws'; import type { RequestTestResult } from 'insomnia-sdk'; import { extension as mimeExtension } from 'mime-types'; -import { type ActionFunction, type LoaderFunction, redirect } from 'react-router-dom'; +import { type ActionFunction, type LoaderFunction, redirect } from 'react-router'; import { v4 as uuidv4 } from 'uuid'; import { version } from '../../../package.json'; diff --git a/packages/insomnia/src/ui/routes/root.tsx b/packages/insomnia/src/ui/routes/root.tsx index 81b08d2f038..7acce030bef 100644 --- a/packages/insomnia/src/ui/routes/root.tsx +++ b/packages/insomnia/src/ui/routes/root.tsx @@ -2,7 +2,7 @@ import '../css/styles.css'; import type { IpcRendererEvent } from 'electron'; import React, { useEffect, useState } from 'react'; -import { type LoaderFunction, Outlet, useFetcher, useNavigate, useParams, useRouteLoaderData } from 'react-router-dom'; +import { type LoaderFunction, Outlet, useFetcher, useNavigate, useParams, useRouteLoaderData } from 'react-router'; import { isDevelopment } from '../../common/constants'; import * as models from '../../models'; diff --git a/packages/insomnia/src/ui/routes/runner.tsx b/packages/insomnia/src/ui/routes/runner.tsx index 629f05f40d9..256d3313996 100644 --- a/packages/insomnia/src/ui/routes/runner.tsx +++ b/packages/insomnia/src/ui/routes/runner.tsx @@ -3,7 +3,7 @@ import porderedJSON from 'json-order'; import React, { type FC, useCallback, useEffect, useMemo, useState } from 'react'; import { Button, Checkbox, DropIndicator, GridList, GridListItem, type GridListItemProps, Heading, type Key, Tab, TabList, TabPanel, Tabs, Toolbar, TooltipTrigger, useDragAndDrop } from 'react-aria-components'; import { Panel, PanelResizeHandle } from 'react-resizable-panels'; -import { type ActionFunction, type LoaderFunction, redirect, useNavigate, useParams, useRouteLoaderData, useSearchParams, useSubmit } from 'react-router-dom'; +import { type ActionFunction, type LoaderFunction, redirect, useNavigate, useParams, useRouteLoaderData, useSearchParams, useSubmit } from 'react-router'; import { useListData } from 'react-stately'; import { useInterval } from 'react-use'; import { v4 as uuidv4 } from 'uuid'; diff --git a/packages/insomnia/src/ui/routes/test-results.tsx b/packages/insomnia/src/ui/routes/test-results.tsx index 84304507d51..74b92d06db5 100644 --- a/packages/insomnia/src/ui/routes/test-results.tsx +++ b/packages/insomnia/src/ui/routes/test-results.tsx @@ -1,6 +1,6 @@ import React, { type FC } from 'react'; import { Heading } from 'react-aria-components'; -import { type LoaderFunction, redirect, useRouteLoaderData } from 'react-router-dom'; +import { type LoaderFunction, redirect, useRouteLoaderData } from 'react-router'; import { database } from '../../common/database'; import * as models from '../../models'; diff --git a/packages/insomnia/src/ui/routes/test-suite.tsx b/packages/insomnia/src/ui/routes/test-suite.tsx index a9e754168a6..37c0c2ae833 100644 --- a/packages/insomnia/src/ui/routes/test-suite.tsx +++ b/packages/insomnia/src/ui/routes/test-suite.tsx @@ -18,7 +18,7 @@ import { useFetcher, useParams, useRouteLoaderData, -} from 'react-router-dom'; +} from 'react-router'; import { database } from '../../common/database'; import { documentationLinks } from '../../common/documentation'; diff --git a/packages/insomnia/src/ui/routes/unit-test.tsx b/packages/insomnia/src/ui/routes/unit-test.tsx index e2ab789ac51..8027e4fd719 100644 --- a/packages/insomnia/src/ui/routes/unit-test.tsx +++ b/packages/insomnia/src/ui/routes/unit-test.tsx @@ -26,7 +26,7 @@ import { useNavigate, useParams, useRouteLoaderData, -} from 'react-router-dom'; +} from 'react-router'; import { DEFAULT_SIDEBAR_SIZE } from '../../common/constants'; import { database } from '../../common/database'; diff --git a/packages/insomnia/src/ui/routes/untracked-projects.tsx b/packages/insomnia/src/ui/routes/untracked-projects.tsx index 208d1ee70fe..ffea0c794bb 100644 --- a/packages/insomnia/src/ui/routes/untracked-projects.tsx +++ b/packages/insomnia/src/ui/routes/untracked-projects.tsx @@ -1,4 +1,4 @@ -import type { LoaderFunction } from 'react-router-dom'; +import type { LoaderFunction } from 'react-router'; import { database } from '../../common/database'; import { userSession } from '../../models'; diff --git a/packages/insomnia/src/ui/routes/workspace.tsx b/packages/insomnia/src/ui/routes/workspace.tsx index 2e13c5e03f0..6cb69b57829 100644 --- a/packages/insomnia/src/ui/routes/workspace.tsx +++ b/packages/insomnia/src/ui/routes/workspace.tsx @@ -1,5 +1,5 @@ import React, { useEffect } from 'react'; -import { type LoaderFunction, Outlet, useLoaderData } from 'react-router-dom'; +import { type LoaderFunction, Outlet, useLoaderData } from 'react-router'; import type { SortOrder } from '../../common/constants'; import { database } from '../../common/database'; diff --git a/packages/insomnia/src/utils/router.ts b/packages/insomnia/src/utils/router.ts index cd4f7ec2aee..86d6264f716 100644 --- a/packages/insomnia/src/utils/router.ts +++ b/packages/insomnia/src/utils/router.ts @@ -1,4 +1,4 @@ -import { matchPath, type PathMatch } from 'react-router-dom'; +import { matchPath, type PathMatch } from 'react-router'; import { database } from '../common/database'; import * as models from '../models'; From aef2bd12905f300855224312299b5e5ad0953c31 Mon Sep 17 00:00:00 2001 From: gatzjames Date: Mon, 25 Nov 2024 22:08:03 +0100 Subject: [PATCH 4/4] =?UTF-8?q?tada=20=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/insomnia/package.json | 2 +- packages/insomnia/src/ui/index.tsx | 10 ---------- packages/insomnia/src/ui/routes/project.tsx | 5 ++--- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/packages/insomnia/package.json b/packages/insomnia/package.json index bb40cef561b..cba6184b064 100644 --- a/packages/insomnia/package.json +++ b/packages/insomnia/package.json @@ -77,7 +77,6 @@ "oauth-1.0a": "^2.2.6", "papaparse": "^5.4.1", "prettier": "2.4.1", - "react-router": "^7.0.1", "shell-quote": "^1.8.1", "swagger-ui-dist": "^5.17.14", "tough-cookie": "^4.1.3", @@ -168,6 +167,7 @@ "react-aria-components": "^1.1.1", "react-dom": "^18.2.0", "react-resizable-panels": "^2.0.17", + "react-router": "^7.0.1", "react-stately": "3.30.1", "react-use": "^17.5.0", "tailwindcss": "^3.4.3", diff --git a/packages/insomnia/src/ui/index.tsx b/packages/insomnia/src/ui/index.tsx index ff738940384..99700cf4ff3 100644 --- a/packages/insomnia/src/ui/index.tsx +++ b/packages/insomnia/src/ui/index.tsx @@ -1138,13 +1138,6 @@ async function renderApp() { ], { initialEntries: [initialEntry], - future: { - v7_relativeSplatPath: true, - v7_fetcherPersist: true, - v7_normalizeFormMethod: true, - v7_partialHydration: true, - v7_skipActionErrorRevalidation: true, - }, } ); @@ -1173,9 +1166,6 @@ async function renderApp() { ReactDOM.createRoot(root).render( ); diff --git a/packages/insomnia/src/ui/routes/project.tsx b/packages/insomnia/src/ui/routes/project.tsx index 4ce3ec0bd5b..0eebeb5f58e 100644 --- a/packages/insomnia/src/ui/routes/project.tsx +++ b/packages/insomnia/src/ui/routes/project.tsx @@ -30,7 +30,6 @@ import { import { Panel, PanelGroup, PanelResizeHandle } from 'react-resizable-panels'; import { type ActionFunction, - defer, type LoaderFunction, redirect, useFetcher, @@ -576,7 +575,7 @@ export const loader: LoaderFunction = async ({ const projectsSyncStatusPromise = CheckAllProjectSyncStatus(projects); - return defer({ + return { localFiles, learningFeaturePromise, remoteFilesPromise, @@ -597,7 +596,7 @@ export const loader: LoaderFunction = async ({ file => file.scope === 'mock-server' ).length, projectsSyncStatusPromise, - }); + }; }; const ProjectRoute: FC = () => {