Skip to content

Commit 5931aab

Browse files
authored
chore(juno): update tanstack router to fix basepath and schema validation issues (#1246)
* fix(greenhouse): convert null to undefined * chore(juno): change how we redirect to default page * chore(supernova): remove manual normalization of legacy state * chore(juno): update changesets * test(supernova): remove test
1 parent 208aaf7 commit 5931aab

13 files changed

Lines changed: 116 additions & 225 deletions

File tree

.changeset/cute-seas-drive.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@cloudoperators/juno-app-supernova": patch
3+
---
4+
5+
- Update tanstack router to fix issue where the basepath would be overwritten while redirection.
6+
- Remove manual normalization part of legacy state to `undefined` that is no longer needed with latest version of the router.

.changeset/orange-eagles-drum.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@cloudoperators/juno-app-greenhouse": patch
3+
"@cloudoperators/juno-app-heureka": patch
4+
"@cloudoperators/juno-app-doop": patch
5+
---
6+
7+
Update tanstack router to fix issue where the basepath would be overwritten while redirection.

apps/doop/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@cloudoperators/juno-config": "workspace:*",
1818
"@tanstack/react-query": "5.62.2",
1919
"@tailwindcss/vite": "4.1.13",
20-
"@tanstack/router-plugin": "1.131.25",
20+
"@tanstack/router-plugin": "1.133.22",
2121
"@testing-library/jest-dom": "6.8.0",
2222
"@testing-library/react": "16.3.0",
2323
"@types/react": "19.1.8",
@@ -47,7 +47,7 @@
4747
"@cloudoperators/juno-messages-provider": "workspace:*",
4848
"@cloudoperators/juno-ui-components": "workspace:*",
4949
"@cloudoperators/juno-url-state-provider": "workspace:*",
50-
"@tanstack/react-router": "1.131.25",
50+
"@tanstack/react-router": "1.133.22",
5151
"react": "19.1.0",
5252
"react-dom": "19.1.0"
5353
}

apps/doop/src/routes/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,11 @@
66
import { createFileRoute, redirect } from "@tanstack/react-router"
77

88
export const Route = createFileRoute("/")({
9-
loader: () => redirect({ to: "/violations", search: (prev) => ({ ...prev }) }), // redirect to the default /violations page
9+
beforeLoad: () => {
10+
// eslint-disable-next-line @typescript-eslint/only-throw-error
11+
throw redirect({
12+
to: "/violations",
13+
search: (prev) => ({ ...prev }),
14+
})
15+
},
1016
})

apps/greenhouse/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"devDependencies": {
1818
"@cloudoperators/juno-config": "workspace:*",
1919
"@tailwindcss/vite": "4.1.13",
20-
"@tanstack/router-plugin": "1.131.25",
20+
"@tanstack/router-plugin": "1.133.22",
2121
"@testing-library/jest-dom": "6.8.0",
2222
"@testing-library/react": "16.3.0",
2323
"@types/lodash": "4.17.16",
@@ -58,7 +58,7 @@
5858
"@cloudoperators/juno-oauth": "workspace:*",
5959
"@cloudoperators/juno-ui-components": "workspace:*",
6060
"@cloudoperators/juno-url-state-provider": "workspace:*",
61-
"@tanstack/react-router": "1.131.25",
61+
"@tanstack/react-router": "1.133.22",
6262
"lodash": "4.17.21"
6363
}
6464
}

apps/greenhouse/src/components/Extension.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function Extension({ id, config, auth, appProps }: ExtensionProps) {
5050
? {
5151
embedded: true,
5252
token: auth?.JWT,
53-
basePath: `${router.basepath}/${config.id}`,
53+
basePath: `${router.basepath === "/" ? "" : router.basepath}/${config.id}`,
5454
enableHashedRouting: appProps?.enableHashedRouting || false,
5555
}
5656
: { auth: auth }),

apps/heureka/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@cloudoperators/juno-ui-components": "workspace:*",
3333
"@cloudoperators/juno-url-state-provider": "workspace:*",
3434
"@tanstack/react-query": "5.89.0",
35-
"@tanstack/react-router": "1.131.25",
35+
"@tanstack/react-router": "1.133.22",
3636
"lodash": "4.17.21",
3737
"react": "19.1.0",
3838
"react-dom": "19.1.0"
@@ -44,7 +44,7 @@
4444
"@graphql-codegen/typescript": "4.1.6",
4545
"@graphql-codegen/typescript-operations": "4.6.1",
4646
"@graphql-codegen/typescript-react-apollo": "4.3.3",
47-
"@tanstack/router-plugin": "1.131.25",
47+
"@tanstack/router-plugin": "1.133.22",
4848
"@tailwindcss/vite": "4.1.13",
4949
"@testing-library/jest-dom": "6.8.0",
5050
"@testing-library/react": "16.3.0",

apps/heureka/src/routes/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,11 @@
66
import { createFileRoute, redirect } from "@tanstack/react-router"
77

88
export const Route = createFileRoute("/")({
9-
loader: () => redirect({ to: "/services", search: (prev) => ({ ...prev }) }), // redirect to the default /services page
9+
beforeLoad: () => {
10+
// eslint-disable-next-line @typescript-eslint/only-throw-error
11+
throw redirect({
12+
to: "/services",
13+
search: (prev) => ({ ...prev }),
14+
})
15+
},
1016
})

apps/supernova/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@cloudoperators/juno-config": "workspace:*",
2020
"@tailwindcss/vite": "4.1.13",
2121
"@tanstack/react-query": "5.62.2",
22-
"@tanstack/router-plugin": "1.131.25",
22+
"@tanstack/router-plugin": "1.133.22",
2323
"@testing-library/jest-dom": "6.6.3",
2424
"@testing-library/react": "16.3.0",
2525
"@types/react": "19.1.8",
@@ -50,7 +50,7 @@
5050
"@cloudoperators/juno-messages-provider": "workspace:*",
5151
"@cloudoperators/juno-ui-components": "workspace:*",
5252
"@cloudoperators/juno-url-state-provider": "workspace:*",
53-
"@tanstack/react-router": "1.131.25",
53+
"@tanstack/react-router": "1.133.22",
5454
"react": "19.1.0",
5555
"react-dom": "19.1.0",
5656
"react-error-boundary": "4.1.2"

apps/supernova/src/lib/urlStateUtils.test.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,6 @@ describe("readLegacyUrlState", () => {
4040
silencesRegEx: "regexPattern",
4141
})
4242
})
43-
44-
it("should handle NaN values for predefinedFilter and showDetailsFor", () => {
45-
const state = {
46-
p: NaN,
47-
d: NaN,
48-
}
49-
50-
const result = readLegacyUrlState(state)
51-
52-
expect(result.predefinedFilter).toBeUndefined()
53-
expect(result.showDetailsFor).toBeUndefined()
54-
})
5543
})
5644

5745
describe("getFiltersForUrl", () => {

0 commit comments

Comments
 (0)