@canonical/router-react 0.49.0 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -105,13 +105,16 @@ declare module "@canonical/router-react" {
105
105
  interface RouterRegister {
106
106
  routes: typeof routes;
107
107
  meta: AppRouteMeta; // optional: types every route's `meta`
108
+ context: AppContext; // optional: types the value every `warm` receives
108
109
  }
109
110
  }
110
111
  ```
111
112
 
112
113
  A declared `meta` is checked at each `route()` call and typed wherever a route is read (`router.routes[name].meta`, `match.route.meta`). Without it, `meta` is `Readonly<Record<string, unknown>>`.
113
114
 
114
- Explicit generics (`<typeof routes>`) still work as an escape hatch for multi-router apps or library code.
115
+ A declared `context` types the `context` option of `createRouter` and the `context` every `warm` receives (see [Data ownership](#data-ownership)). Once declared, `createRouter` requires the option. Without it, `context` is optional and typed `unknown`. The declaration covers the whole program: every `createRouter` call must then pass `context`, including test routers, a server-side matcher router and Storybook routers. To keep the option optional, declare `context: AppContext | undefined`.
116
+
117
+ Explicit generics (`<typeof routes>`) still work as an escape hatch for multi-router apps or library code. They cover the route map only: `meta` and `context` come from the declaration alone.
115
118
 
116
119
  Important distinction:
117
120
 
@@ -143,6 +146,49 @@ function UserProfile({ id }: { id: string }) {
143
146
  }
144
147
  ```
145
148
 
149
+ When `warm()` needs an application value, such as a Relay environment or the query client, pass it as `createRouter`'s `context` option rather than importing a module-level singleton. On the server, each request builds its router with its own value:
150
+
151
+ ```tsx
152
+ const entityRoute = route({
153
+ url: "/entities/:uri",
154
+ // Resolve when the data is in the store, so the server's warmRoute can
155
+ // wait for it; end the subscription when `signal` aborts, which cancels
156
+ // the request.
157
+ warm: ({ uri }, _search, { signal, context }) =>
158
+ new Promise<void>((resolve, reject) => {
159
+ if (signal.aborted) return resolve();
160
+ let subscription: { unsubscribe(): void } | undefined;
161
+ const stop = () => {
162
+ subscription?.unsubscribe();
163
+ resolve();
164
+ };
165
+ // Listen first: a query the store already holds completes during
166
+ // subscribe, and its completion must remove the listener.
167
+ signal.addEventListener("abort", stop, { once: true });
168
+ subscription = fetchQuery(
169
+ context.environment,
170
+ EntityPageQuery,
171
+ { uri },
172
+ { fetchPolicy: "store-or-network" },
173
+ ).subscribe({
174
+ complete: () => {
175
+ signal.removeEventListener("abort", stop);
176
+ resolve();
177
+ },
178
+ error: (error: Error) => {
179
+ signal.removeEventListener("abort", stop);
180
+ reject(error);
181
+ },
182
+ });
183
+ }),
184
+ content: ({ params }) => <EntityPage uri={params.uri} />,
185
+ });
186
+
187
+ const router = createRouter({ entity: entityRoute }, { adapter, context: { environment } });
188
+ ```
189
+
190
+ The value reaches `warm()` only: there is no hook for it, and components get their environment from their data library's own provider.
191
+
146
192
  ## Error handling
147
193
 
148
194
  Errors travel through two separate channels. Knowing which one you are in tells you which tool to reach for.
@@ -185,19 +231,30 @@ import { Component, type ReactNode } from "react";
185
231
  interface ErrorBoundaryProps {
186
232
  readonly children: ReactNode;
187
233
  readonly fallback: (error: unknown) => ReactNode;
234
+ readonly resetKey: string;
188
235
  }
189
236
 
190
237
  interface ErrorBoundaryState {
191
238
  readonly error: unknown | null;
239
+ readonly resetKey: string;
192
240
  }
193
241
 
194
242
  class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
195
- state: ErrorBoundaryState = { error: null };
243
+ state: ErrorBoundaryState = { error: null, resetKey: this.props.resetKey };
196
244
 
197
- static getDerivedStateFromError(error: unknown): ErrorBoundaryState {
245
+ static getDerivedStateFromError(error: unknown): Partial<ErrorBoundaryState> {
198
246
  return { error };
199
247
  }
200
248
 
249
+ static getDerivedStateFromProps(
250
+ props: ErrorBoundaryProps,
251
+ state: ErrorBoundaryState,
252
+ ): ErrorBoundaryState | null {
253
+ return props.resetKey === state.resetKey
254
+ ? null
255
+ : { error: null, resetKey: props.resetKey };
256
+ }
257
+
201
258
  render(): ReactNode {
202
259
  return this.state.error !== null
203
260
  ? this.props.fallback(this.state.error)
@@ -206,18 +263,34 @@ class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
206
263
  }
207
264
 
208
265
  // A plain boundary sticks in its error state after the user navigates away.
209
- // Key it by the location so navigation remounts it fresh:
266
+ // Reset it when the location changes. Do not key it by the location: a key
267
+ // remounts its whole subtree, kept wrappers included, on every navigation.
210
268
  function RouteErrorGate({ children }: { children: ReactNode }) {
211
269
  const { href } = useRoute();
212
270
 
213
271
  return (
214
- <ErrorBoundary key={href} fallback={(error) => <CrashPage error={error} />}>
272
+ <ErrorBoundary resetKey={href} fallback={(error) => <CrashPage error={error} />}>
215
273
  {children}
216
274
  </ErrorBoundary>
217
275
  );
218
276
  }
219
277
  ```
220
278
 
279
+ The same applies inside a wrapper. `Outlet` keeps a wrapper mounted while you move between routes that share it, so an error boundary or a mount effect placed in a wrapper no longer resets per route. Reset it on `href`, as `RouteErrorGate` does:
280
+
281
+ ```tsx
282
+ import type { WrapperComponentProps } from "@canonical/router-core";
283
+
284
+ function SectionLayout({ children }: WrapperComponentProps<ReactNode>) {
285
+ return (
286
+ <section>
287
+ <SectionNav />
288
+ <RouteErrorGate>{children}</RouteErrorGate>
289
+ </section>
290
+ );
291
+ }
292
+ ```
293
+
221
294
  Compose the two channels in one place — status gate outside, render boundary inside — and every route gets both behaviors for free.
222
295
 
223
296
  ## Search param mutation
@@ -430,7 +503,9 @@ hydrateRoot(
430
503
 
431
504
  ### `Outlet`
432
505
 
433
- `Outlet` subscribes to router state, builds the matched subtree with `createElement`, and wraps it in `Suspense`.
506
+ `Outlet` subscribes to router state, builds the matched subtree with `createElement`, and wraps each layer in its own `Suspense`: every wrapper keyed by its `id`, the route content keyed by the route name.
507
+
508
+ A wrapper stays mounted across a navigation, with its state, effects and DOM, when it sits at the same position in both routes' `wrappers` chains, with the same `id` (a router rejects two wrapper definitions that share an id, so the same id always means the same component), and every wrapper outside it does too. Any other wrapper remounts. The content remounts when the route name changes; a navigation within one route (new params or search) updates it in place. Something inside a kept wrapper that must reset per route, such as an error boundary, resets on `href` (see [Error handling](#error-handling)). A layer that suspends shows `fallback` in its place; the wrappers outside it stay rendered.
434
509
 
435
510
  It does **not** call `router.render()`. Core `render()` invokes the route's content and each wrapper as plain functions, which gives them no fiber of their own — every hook they declare would attach to `Outlet`'s hook list, and navigating between routes whose components declare different numbers of hooks would throw *"Rendered fewer hooks than expected"*. Constructing elements instead gives each component its own fiber, so its hooks belong to it. `render()` remains the correct shape for a non-React consumer.
436
511
 
@@ -466,7 +541,7 @@ The reference integration lives in [apps/react/boilerplate-vite](../../../apps/r
466
541
 
467
542
  - domain-colocated route modules assembled into one flat map
468
543
  - a shell-as-layout wrapper applied with `group()`
469
- - SSR with real HTTP statuses and redirects (`resolveRouteDisposition` in its server entry) and hydration via `readDehydratedState()`
544
+ - SSR with real HTTP statuses and redirects (`resolveRoute` and `warmRoute` in `src/server/renderPage.tsx`) and hydration from the embedded router state
470
545
  - a route-level `warm` hook priming the Relay store, read by the component's own query hook
471
546
  - an auth middleware redirect flow
472
547
  - a static redirect route answering 301
@@ -6,8 +6,18 @@ import useRouter from "../hooks/useRouter.js";
6
6
  *
7
7
  * `Outlet` subscribes to router state and only rerenders when the location
8
8
  * href changes — navigation-state transitions (`idle` → `loading`) do not
9
- * cause a rerender. The rendered content is keyed by route name so React
10
- * cleanly unmounts/remounts when the matched route changes.
9
+ * cause a rerender.
10
+ *
11
+ * Each layer sits in its own `Suspense` boundary showing `fallback`: every
12
+ * wrapper in a boundary keyed by its `id`, the route content in a boundary
13
+ * keyed by the route name. A wrapper therefore stays mounted, with its state
14
+ * and DOM, across a navigation when it sits at the same position in both
15
+ * routes' chains with the same `id` (the router allows one definition per
16
+ * id, so that is also the same component), and every wrapper outside it
17
+ * does too. Other wrappers remount; the content remounts
18
+ * when the route name changes.
19
+ * A layer that suspends shows `fallback` in its place while the layers
20
+ * around it stay rendered.
11
21
  *
12
22
  * Component-level render errors (e.g. a route's error component itself throws)
13
23
  * propagate past `Outlet`. Wrap it in a React `ErrorBoundary` to catch those.
@@ -46,11 +56,14 @@ export default function Outlet({ fallback = null }) {
46
56
  // `createElement` gives each component its own fiber, so its hooks belong
47
57
  // to it. Core's `render()` is left alone: it is the correct shape for a
48
58
  // non-React consumer, and this is a React-layer concern.
49
- let rendered = null;
59
+ let contentElement = null;
60
+ let wrappers = [];
50
61
  if (match && "route" in match && match.route.content) {
51
- const contentElement = createElement(match.route.content, { params: match.params, search: match.search });
52
- rendered = match.route.wrappers.reduceRight((children, currentWrapper) => createElement(currentWrapper.component, null, children), contentElement);
62
+ contentElement = createElement(match.route.content, { params: match.params, search: match.search });
63
+ wrappers = match.route.wrappers;
53
64
  }
54
- return (_jsx(Suspense, { fallback: fallback, children: rendered }, routeKey));
65
+ // Wrapper and content keys live in separate namespaces, so a wrapper whose
66
+ // id equals a route name never matches that route's content boundary.
67
+ return wrappers.reduceRight((children, currentWrapper) => (_jsx(Suspense, { fallback: fallback, children: createElement(currentWrapper.component, null, children) }, `wrapper:${currentWrapper.id}`)), _jsx(Suspense, { fallback: fallback, children: contentElement }, routeKey === undefined ? undefined : `route:${routeKey}`));
55
68
  }
56
69
  //# sourceMappingURL=Outlet.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Outlet.js","sourceRoot":"","sources":["../../../../src/lib/Outlet/Outlet.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,aAAa,EACb,QAAQ,EACR,WAAW,EACX,MAAM,EACN,oBAAoB,GACrB,MAAM,OAAO,CAAC;AACf,OAAO,SAAS,MAAM,uBAAuB,CAAC;AAG9C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI,EAAe;IAC7D,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,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M,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAC/C,CAAC;QACF,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,QAA2B,CAAC;IACrD,CAAC;IAED,2EAA2E;IAC3E,sEAAsE;IACtE,OAAO,QAAQ,CAAC,WAAW,CACzB,CAAC,QAAQ,EAAE,cAAc,EAAE,EAAE,CAAC,CAC5B,KAAC,QAAQ,IAAsC,QAAQ,EAAE,QAAQ,YAC9D,aAAa,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,CAAC,IAD3C,WAAW,cAAc,CAAC,EAAE,EAAE,CAElC,CACZ,EACD,KAAC,QAAQ,IAEP,QAAQ,EAAE,QAAQ,YAEjB,cAAc,IAHV,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,QAAQ,EAAE,CAIpD,CACZ,CAAC;AACJ,CAAC"}
@@ -5,8 +5,18 @@ import type { OutletProps } from "./types.js";
5
5
  *
6
6
  * `Outlet` subscribes to router state and only rerenders when the location
7
7
  * href changes — navigation-state transitions (`idle` → `loading`) do not
8
- * cause a rerender. The rendered content is keyed by route name so React
9
- * cleanly unmounts/remounts when the matched route changes.
8
+ * cause a rerender.
9
+ *
10
+ * Each layer sits in its own `Suspense` boundary showing `fallback`: every
11
+ * wrapper in a boundary keyed by its `id`, the route content in a boundary
12
+ * keyed by the route name. A wrapper therefore stays mounted, with its state
13
+ * and DOM, across a navigation when it sits at the same position in both
14
+ * routes' chains with the same `id` (the router allows one definition per
15
+ * id, so that is also the same component), and every wrapper outside it
16
+ * does too. Other wrappers remount; the content remounts
17
+ * when the route name changes.
18
+ * A layer that suspends shows `fallback` in its place while the layers
19
+ * around it stay rendered.
10
20
  *
11
21
  * Component-level render errors (e.g. a route's error component itself throws)
12
22
  * propagate past `Outlet`. Wrap it in a React `ErrorBoundary` to catch those.
@@ -1 +1 @@
1
- {"version":3,"file":"Outlet.d.ts","sourceRoot":"","sources":["../../../../src/lib/Outlet/Outlet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAa,MAAM,OAAO,CAAC;AASpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,QAAe,EAAE,EAAE,WAAW,GAAG,YAAY,CAwE7E"}
1
+ {"version":3,"file":"Outlet.d.ts","sourceRoot":"","sources":["../../../../src/lib/Outlet/Outlet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAa,MAAM,OAAO,CAAC;AASpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,QAAe,EAAE,EAAE,WAAW,GAAG,YAAY,CA6E7E"}
@@ -17,7 +17,8 @@ import type { AnyRoute, RouteMap } from "@canonical/router-core";
17
17
  * When no registration exists the fallback is `RouteMap` (any string key),
18
18
  * which compiles but provides no autocomplete or typo detection. A declared
19
19
  * `meta` types every route's `meta` (see `RouteMeta` in
20
- * `@canonical/router-core`).
20
+ * `@canonical/router-core`), and a declared `context` types the value every
21
+ * `warm` receives (see `RouterContext`).
21
22
  */
22
23
  export interface RouterRegister {
23
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/lib/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,WAAW,cAAc;CAAG;AAElC,8EAA8E;AAC9E,KAAK,mBAAmB,GAAG,cAAc,CAAC;AAE1C,OAAO,QAAQ,wBAAwB,CAAC;IACtC,qEAAqE;IACrE,UAAU,cAAe,SAAQ,mBAAmB;KAAG;CACxD;AAED,yEAAyE;AACzE,MAAM,MAAM,kBAAkB,GAAG,cAAc,SAAS;IACtD,MAAM,EAAE,MAAM,CAAC,SAAS,QAAQ,CAAC;CAClC,GACG,CAAC,GACD,QAAQ,CAAC;AAEb,gFAAgF;AAChF,MAAM,MAAM,kBAAkB,GAAG,cAAc,SAAS;IACtD,QAAQ,EAAE,MAAM,CAAC,SAAS,QAAQ,GAAG,SAAS,CAAC;CAChD,GACG,CAAC,GACD,SAAS,CAAC"}
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/lib/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,WAAW,cAAc;CAAG;AAElC,8EAA8E;AAC9E,KAAK,mBAAmB,GAAG,cAAc,CAAC;AAE1C,OAAO,QAAQ,wBAAwB,CAAC;IACtC,qEAAqE;IACrE,UAAU,cAAe,SAAQ,mBAAmB;KAAG;CACxD;AAED,yEAAyE;AACzE,MAAM,MAAM,kBAAkB,GAAG,cAAc,SAAS;IACtD,MAAM,EAAE,MAAM,CAAC,SAAS,QAAQ,CAAC;CAClC,GACG,CAAC,GACD,QAAQ,CAAC;AAEb,gFAAgF;AAChF,MAAM,MAAM,kBAAkB,GAAG,cAAc,SAAS;IACtD,QAAQ,EAAE,MAAM,CAAC,SAAS,QAAQ,GAAG,SAAS,CAAC;CAChD,GACG,CAAC,GACD,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@canonical/router-react",
3
3
  "description": "React bindings for @canonical/router-core",
4
- "version": "0.49.0",
4
+ "version": "0.50.0",
5
5
  "type": "module",
6
6
  "module": "dist/esm/index.js",
7
7
  "types": "dist/types/index.d.ts",
@@ -44,16 +44,16 @@
44
44
  "test:coverage": "vitest run --coverage"
45
45
  },
46
46
  "dependencies": {
47
- "@canonical/react-ssr": "^0.49.0",
48
- "@canonical/router-core": "^0.49.0",
47
+ "@canonical/react-ssr": "^0.50.0",
48
+ "@canonical/router-core": "^0.50.0",
49
49
  "react": "^19.2.4",
50
50
  "react-dom": "^19.2.4"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@biomejs/biome": "2.6.9",
54
54
  "@canonical/biome-config": "0.47.0",
55
- "@canonical/typescript-config-react": "^0.49.0",
56
- "@canonical/vitest-config-react": "^0.49.0",
55
+ "@canonical/typescript-config-react": "^0.50.0",
56
+ "@canonical/vitest-config-react": "^0.50.0",
57
57
  "@canonical/webarchitect": "0.46.0",
58
58
  "@testing-library/jest-dom": "^7.0.0",
59
59
  "@testing-library/react": "^16.3.2",
@@ -67,5 +67,5 @@
67
67
  "vite": "^8.0.1",
68
68
  "vitest": "^5.0.0"
69
69
  },
70
- "gitHead": "9b71099ded16351ee14432246e3d8190f48767ed"
70
+ "gitHead": "4a2ca02b4767a0ee8e58a679281194fdc316fd71"
71
71
  }