@molecule/app-routing-react-router 1.1.0 → 1.1.2
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 +8 -5
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-10-
|
|
6
|
+
Generated: 2026-10-25T14:57:33.051Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-routing-react-router
|
|
@@ -48,7 +48,9 @@ function App() {
|
|
|
48
48
|
|
|
49
49
|
A list with query-selected views. The public URL remains public after login;
|
|
50
50
|
a protected view waits for session restoration. Include the signed-in principal
|
|
51
|
-
in the data key so one user's cached response cannot appear for another user
|
|
51
|
+
in the data key so one user's cached response cannot appear for another user, and
|
|
52
|
+
pass `null` while the session is still restoring (`status === 'loading'`) — the
|
|
53
|
+
auth gate holds the request until then anyway, so waiting for it costs nothing.
|
|
52
54
|
|
|
53
55
|
```tsx
|
|
54
56
|
import { Link } from 'react-router'
|
|
@@ -76,7 +78,7 @@ function ActivityList() {
|
|
|
76
78
|
auth: { status, redirectTo: '/sign-in' },
|
|
77
79
|
})
|
|
78
80
|
const entries = useQuery(
|
|
79
|
-
list.canLoad
|
|
81
|
+
list.canLoad && status !== 'loading'
|
|
80
82
|
? {
|
|
81
83
|
key: ['activity', user?.id ?? 'anonymous', list.selection, list.filters, list.page],
|
|
82
84
|
fetch: async (signal) =>
|
|
@@ -903,8 +905,9 @@ Peer dependencies:
|
|
|
903
905
|
Do not mirror selection/page in local state or rewrite an explicit public view
|
|
904
906
|
when auth changes. Auth redirects replace the protected history entry only after
|
|
905
907
|
a confirmed `unauthenticated` status; `loading` and `unavailable` remain in place.
|
|
906
|
-
- Pass `null` to `useQuery` when `list.canLoad` is false
|
|
907
|
-
|
|
908
|
+
- Pass `null` to `useQuery` when `list.canLoad` is false **or** while the session
|
|
909
|
+
is still restoring (`status === 'loading'`). Public views stay ready; protected
|
|
910
|
+
views do not fall back to a public request while auth is unresolved.
|
|
908
911
|
- A selection's `query` owns only its configured keys. `undefined` means absent;
|
|
909
912
|
unrelated query values and the hash survive pagination and selection changes.
|
|
910
913
|
Filter/selection changes reset page one atomically, unless `page` is explicit.
|
package/dist/index.d.ts
CHANGED
|
@@ -35,7 +35,9 @@
|
|
|
35
35
|
* @example
|
|
36
36
|
* A list with query-selected views. The public URL remains public after login;
|
|
37
37
|
* a protected view waits for session restoration. Include the signed-in principal
|
|
38
|
-
* in the data key so one user's cached response cannot appear for another user
|
|
38
|
+
* in the data key so one user's cached response cannot appear for another user, and
|
|
39
|
+
* pass `null` while the session is still restoring (`status === 'loading'`) — the
|
|
40
|
+
* auth gate holds the request until then anyway, so waiting for it costs nothing.
|
|
39
41
|
*
|
|
40
42
|
* ```tsx
|
|
41
43
|
* import { Link } from 'react-router'
|
|
@@ -59,7 +61,7 @@
|
|
|
59
61
|
* },
|
|
60
62
|
* auth: { status, redirectTo: '/sign-in' },
|
|
61
63
|
* })
|
|
62
|
-
* const entries = useQuery(list.canLoad ? {
|
|
64
|
+
* const entries = useQuery(list.canLoad && status !== 'loading' ? {
|
|
63
65
|
* key: ['activity', user?.id ?? 'anonymous', list.selection, list.filters, list.page],
|
|
64
66
|
* fetch: async (signal) => unwrapList<Entry>(await http.get('/api/activity', {
|
|
65
67
|
* signal,
|
|
@@ -116,8 +118,9 @@
|
|
|
116
118
|
* Do not mirror selection/page in local state or rewrite an explicit public view
|
|
117
119
|
* when auth changes. Auth redirects replace the protected history entry only after
|
|
118
120
|
* a confirmed `unauthenticated` status; `loading` and `unavailable` remain in place.
|
|
119
|
-
* - Pass `null` to `useQuery` when `list.canLoad` is false
|
|
120
|
-
*
|
|
121
|
+
* - Pass `null` to `useQuery` when `list.canLoad` is false **or** while the session
|
|
122
|
+
* is still restoring (`status === 'loading'`). Public views stay ready; protected
|
|
123
|
+
* views do not fall back to a public request while auth is unresolved.
|
|
121
124
|
* - A selection's `query` owns only its configured keys. `undefined` means absent;
|
|
122
125
|
* unrelated query values and the hash survive pagination and selection changes.
|
|
123
126
|
* Filter/selection changes reset page one atomically, unless `page` is explicit.
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+IG;AAEH,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,9 @@
|
|
|
35
35
|
* @example
|
|
36
36
|
* A list with query-selected views. The public URL remains public after login;
|
|
37
37
|
* a protected view waits for session restoration. Include the signed-in principal
|
|
38
|
-
* in the data key so one user's cached response cannot appear for another user
|
|
38
|
+
* in the data key so one user's cached response cannot appear for another user, and
|
|
39
|
+
* pass `null` while the session is still restoring (`status === 'loading'`) — the
|
|
40
|
+
* auth gate holds the request until then anyway, so waiting for it costs nothing.
|
|
39
41
|
*
|
|
40
42
|
* ```tsx
|
|
41
43
|
* import { Link } from 'react-router'
|
|
@@ -59,7 +61,7 @@
|
|
|
59
61
|
* },
|
|
60
62
|
* auth: { status, redirectTo: '/sign-in' },
|
|
61
63
|
* })
|
|
62
|
-
* const entries = useQuery(list.canLoad ? {
|
|
64
|
+
* const entries = useQuery(list.canLoad && status !== 'loading' ? {
|
|
63
65
|
* key: ['activity', user?.id ?? 'anonymous', list.selection, list.filters, list.page],
|
|
64
66
|
* fetch: async (signal) => unwrapList<Entry>(await http.get('/api/activity', {
|
|
65
67
|
* signal,
|
|
@@ -116,8 +118,9 @@
|
|
|
116
118
|
* Do not mirror selection/page in local state or rewrite an explicit public view
|
|
117
119
|
* when auth changes. Auth redirects replace the protected history entry only after
|
|
118
120
|
* a confirmed `unauthenticated` status; `loading` and `unavailable` remain in place.
|
|
119
|
-
* - Pass `null` to `useQuery` when `list.canLoad` is false
|
|
120
|
-
*
|
|
121
|
+
* - Pass `null` to `useQuery` when `list.canLoad` is false **or** while the session
|
|
122
|
+
* is still restoring (`status === 'loading'`). Public views stay ready; protected
|
|
123
|
+
* views do not fall back to a public request while auth is unresolved.
|
|
121
124
|
* - A selection's `query` owns only its configured keys. `undefined` means absent;
|
|
122
125
|
* unrelated query values and the hash survive pagination and selection changes.
|
|
123
126
|
* Filter/selection changes reset page one atomically, unless `page` is explicit.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+IG;AAEH,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-routing-react-router",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "React Router v7 provider for @molecule/app-routing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"build": "tsc",
|
|
14
14
|
"dev": "tsc --watch",
|
|
15
15
|
"test": "vitest run",
|
|
16
|
-
"test:watch": "vitest"
|
|
16
|
+
"test:watch": "vitest",
|
|
17
|
+
"typecheck:tests": "tsc -p tsconfig.tests.json"
|
|
17
18
|
},
|
|
18
19
|
"author": "Molecule Dev, Inc. (https://molecule.dev)",
|
|
19
20
|
"license": "Apache-2.0",
|
|
@@ -27,11 +28,11 @@
|
|
|
27
28
|
"react-router": "^7.0.0 || ^8.0.0"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
|
-
"@molecule/app-i18n": "1.0
|
|
31
|
-
"@types/node": "26.
|
|
32
|
-
"@types/react": "19.
|
|
33
|
-
"react": "19.
|
|
34
|
-
"react-router": "8.
|
|
31
|
+
"@molecule/app-i18n": "1.1.0",
|
|
32
|
+
"@types/node": "26.6.5",
|
|
33
|
+
"@types/react": "19.3.0",
|
|
34
|
+
"react": "19.3.1",
|
|
35
|
+
"react-router": "8.5.0",
|
|
35
36
|
"typescript": "6.0.3",
|
|
36
37
|
"vitest": "4.1.12"
|
|
37
38
|
},
|