@djangocfg/layouts 2.1.662 → 2.1.663
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
|
@@ -26,8 +26,10 @@ Peers: `@djangocfg/ui-core`, React 19, Next.js 16+, Tailwind CSS 4.
|
|
|
26
26
|
|
|
27
27
|
Two responsibilities, kept separate:
|
|
28
28
|
|
|
29
|
-
1. **Providers** — mount `BaseApp` ONCE at the app root (theme, auth, i18n,
|
|
30
|
-
monitor, toasts).
|
|
29
|
+
1. **Providers** — mount `BaseApp` ONCE at the app root (theme, auth, i18n,
|
|
30
|
+
the bounded realtime cache bridge, monitor, toasts). New REST data is owned
|
|
31
|
+
by Orval/TanStack Query v5 in the API package. It's framework-agnostic (works
|
|
32
|
+
in Wails/Vite too).
|
|
31
33
|
2. **Per-section shell** — each Next.js **route-group `layout.tsx`** imports the
|
|
32
34
|
matching shell (`PrivateLayout` / `PublicLayout`) and passes its own config.
|
|
33
35
|
No runtime layout-router, no `enabledPath` matching.
|
|
@@ -193,12 +195,14 @@ For local UI widgets that should not report to backend, use `Boundary` from `@dj
|
|
|
193
195
|
|
|
194
196
|
`BaseApp` mounts `RealtimeProvider` from `@djangocfg/realtime` inside `AuthProvider`. It opens no socket until a
|
|
195
197
|
component calls `useTopic`, so a page that never subscribes costs nothing. The socket URL is the API origin plus
|
|
196
|
-
`/ws` (`ws:`/`wss:` by scheme).
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
198
|
+
`/ws` (`ws:`/`wss:` by scheme). The existing layout bridge can refresh legacy
|
|
199
|
+
realtime consumers whose cache key is tagged with a topic, while new Orval /
|
|
200
|
+
React Query consumers should use `useTopicRefresh` with their generated query
|
|
201
|
+
key. Realtime issues (a 4401/4403/4500 close, five failed handshakes in a row,
|
|
202
|
+
a refused topic, a protocol error, a dev schema failure) go to
|
|
203
|
+
`@djangocfg/devtools` like any other frontend error; normal drops are not
|
|
204
|
+
reported. `realtime={{ url, path, onGap, onIssue }}` tunes it,
|
|
205
|
+
`realtime={false}` removes it. `@djangocfg/realtime` is a required peer. Usage:
|
|
202
206
|
[`@djangocfg/realtime`](../realtime/README.md).
|
|
203
207
|
|
|
204
208
|
## Analytics and auth funnels
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/layouts",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.663",
|
|
4
4
|
"description": "Simple, straightforward layout components for Next.js - import and use with props",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"layouts",
|
|
@@ -91,12 +91,12 @@
|
|
|
91
91
|
"test": "vitest run"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
|
-
"@djangocfg/analytics": "^2.1.
|
|
95
|
-
"@djangocfg/api": "^2.1.
|
|
96
|
-
"@djangocfg/devtools": "^2.1.
|
|
97
|
-
"@djangocfg/i18n": "^2.1.
|
|
98
|
-
"@djangocfg/realtime": "^2.1.
|
|
99
|
-
"@djangocfg/ui-core": "^2.1.
|
|
94
|
+
"@djangocfg/analytics": "^2.1.663",
|
|
95
|
+
"@djangocfg/api": "^2.1.663",
|
|
96
|
+
"@djangocfg/devtools": "^2.1.663",
|
|
97
|
+
"@djangocfg/i18n": "^2.1.663",
|
|
98
|
+
"@djangocfg/realtime": "^2.1.663",
|
|
99
|
+
"@djangocfg/ui-core": "^2.1.663",
|
|
100
100
|
"@hookform/resolvers": "^5.2.2 || ^7.0.2",
|
|
101
101
|
"consola": "^3.4.2",
|
|
102
102
|
"lucide-react": "^1.68.0",
|
|
@@ -124,13 +124,13 @@
|
|
|
124
124
|
"qrcode.react": "^4.2.0"
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
|
-
"@djangocfg/analytics": "^2.1.
|
|
128
|
-
"@djangocfg/api": "^2.1.
|
|
129
|
-
"@djangocfg/devtools": "^2.1.
|
|
130
|
-
"@djangocfg/i18n": "^2.1.
|
|
131
|
-
"@djangocfg/realtime": "^2.1.
|
|
132
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
133
|
-
"@djangocfg/ui-core": "^2.1.
|
|
127
|
+
"@djangocfg/analytics": "^2.1.663",
|
|
128
|
+
"@djangocfg/api": "^2.1.663",
|
|
129
|
+
"@djangocfg/devtools": "^2.1.663",
|
|
130
|
+
"@djangocfg/i18n": "^2.1.663",
|
|
131
|
+
"@djangocfg/realtime": "^2.1.663",
|
|
132
|
+
"@djangocfg/typescript-config": "^2.1.663",
|
|
133
|
+
"@djangocfg/ui-core": "^2.1.663",
|
|
134
134
|
"@storybook/react-vite": "^10.6.5",
|
|
135
135
|
"@types/node": "^25.9.5",
|
|
136
136
|
"@types/react": "19.3.0",
|
|
@@ -44,8 +44,10 @@ function captureIssue(issue: ReportedIssue): void {
|
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* `RealtimeProvider` with the app's defaults: unless the app passes `onGap`, a
|
|
47
|
-
* gap
|
|
48
|
-
* the source of truth;
|
|
47
|
+
* gap refreshes legacy SWR cache entries tagged with the topic, so the REST API
|
|
48
|
+
* stays the source of truth; new Orval/React Query consumers use
|
|
49
|
+
* `useTopicRefresh` with their generated query key. Issues are captured by
|
|
50
|
+
* `@djangocfg/devtools` (an app's
|
|
49
51
|
* own `onIssue` runs as well). Sits inside `SWRConfig` and `AuthProvider`.
|
|
50
52
|
*/
|
|
51
53
|
export function RealtimeMount({ config, apiUrl, children }: RealtimeMountProps) {
|