@teyik0/furin 0.5.0-alpha.2 → 0.7.0-alpha.1
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/dist/adapter/runtime-build.d.ts +3 -1
- package/dist/build/client.d.ts +4 -1
- package/dist/build/entry-template.d.ts +5 -0
- package/dist/build/entry-template.ts +9 -0
- package/dist/build/hydrate.d.ts +1 -1
- package/dist/build/index.js +9589 -6685
- package/dist/build/preload-manifest.d.ts +17 -0
- package/dist/build/request-keys.d.ts +4 -0
- package/dist/build/types.d.ts +6 -0
- package/dist/cli/index.js +9539 -6644
- package/dist/client/browser-events-runtime.d.ts +2 -1
- package/dist/client/client-module.d.ts +26 -0
- package/dist/client/define-route.d.ts +9 -1
- package/dist/client/dev-error-overlay.ts +1 -0
- package/dist/client/document.d.ts +3 -0
- package/dist/client/hmr.d.ts +1 -1
- package/dist/client/internal/runtime-types.d.ts +2 -0
- package/dist/client/link.js +1011 -157
- package/dist/client/mutation.d.ts +38 -0
- package/dist/client/query-store.d.ts +85 -0
- package/dist/client/query.d.ts +14 -0
- package/dist/client/route-api.d.ts +11 -0
- package/dist/client/router/context.d.ts +3 -2
- package/dist/client/router/index.d.ts +1 -1
- package/dist/client/router/link-utils.d.ts +8 -1
- package/dist/client/router/navigation.d.ts +2 -9
- package/dist/client/router/optimistic.d.ts +41 -0
- package/dist/client/router/search/index.d.ts +3 -3
- package/dist/client/router/search-store.d.ts +1 -0
- package/dist/client/router/sync-catch-up.d.ts +3 -0
- package/dist/client/router/types.d.ts +49 -7
- package/dist/client/sync.d.ts +39 -22
- package/dist/client.d.ts +11 -33
- package/dist/client.js +1222 -57
- package/dist/config.d.ts +7 -0
- package/dist/config.js +1 -0
- package/dist/define-route.d.ts +231 -123
- package/dist/env.d.ts +2 -2
- package/dist/furin.d.ts +4 -2
- package/dist/furin.js +9717 -6796
- package/dist/plugin/hmr-dependencies.d.ts +2 -0
- package/dist/plugin/index.js +811 -145
- package/dist/plugin/transform-client-module.d.ts +16 -0
- package/dist/plugin/transform-client.d.ts +2 -0
- package/dist/plugin/transform-dev-page.d.ts +7 -0
- package/dist/plugin/transform-isomorphic.d.ts +1 -1
- package/dist/routes.d.ts +6 -0
- package/dist/rsc-client.js +87 -16
- package/dist/rsc.js +87 -16
- package/dist/server/auto-invalidate/registry.d.ts +5 -2
- package/dist/server/auto-invalidate/types.d.ts +2 -0
- package/dist/server/browser-events/plugin.d.ts +3 -0
- package/dist/server/cache/isr.d.ts +2 -4
- package/dist/server/cache/route-cache.d.ts +5 -0
- package/dist/server/dev/graph.d.ts +1 -0
- package/dist/server/dev/runtime.production.d.ts +1 -0
- package/dist/server/dev-page-plugin.d.ts +6 -19
- package/dist/server/internal.d.ts +5 -0
- package/dist/server/internal.js +105 -57
- package/dist/server/production-server.js +104 -56
- package/dist/server/render/assemble.d.ts +6 -6
- package/dist/server/render/document.d.ts +1 -1
- package/dist/server/render/element.d.ts +1 -1
- package/dist/server/render/loaders.d.ts +15 -5
- package/dist/server/render/mixed-cache.d.ts +6 -0
- package/dist/server/render/react-stream.d.ts +3 -0
- package/dist/server/render/ssr.d.ts +5 -4
- package/dist/server/render/template.d.ts +4 -0
- package/dist/server/router/defined-route.d.ts +2 -0
- package/dist/server/router/discovery.d.ts +1 -0
- package/dist/server/router/hmr.d.ts +1 -1
- package/dist/server/router/patterns.d.ts +3 -0
- package/dist/server/router/plugin.d.ts +3 -0
- package/dist/server/router/types.d.ts +4 -0
- package/dist/server/security/csp.d.ts +12 -0
- package/dist/server/sync/adapter.d.ts +25 -4
- package/dist/server/sync/atomic.d.ts +25 -0
- package/dist/server/sync/drizzle/index.d.ts +45 -0
- package/dist/server/sync/drizzle/index.js +540 -0
- package/dist/server/sync/execution-error.d.ts +2 -0
- package/dist/server/sync/index.d.ts +2 -1
- package/dist/server/sync/index.js +580 -124
- package/dist/server/sync/mutation-handler.d.ts +4 -0
- package/dist/server/sync/plugin.d.ts +34 -11
- package/dist/server/sync/postgres/execute.d.ts +3 -0
- package/dist/server/sync/postgres/index.d.ts +12 -1
- package/dist/server/sync/postgres/index.js +42 -13
- package/dist/server/sync/postgres/sql.d.ts +8 -0
- package/dist/server/sync/prisma/index.d.ts +24 -0
- package/dist/server/sync/prisma/index.js +340 -0
- package/dist/server/sync/queries.d.ts +21 -0
- package/dist/server/sync/query-context.d.ts +5 -0
- package/dist/server/sync/redis/index.js +3 -3
- package/dist/server/sync/redis/scripts.d.ts +1 -1
- package/dist/server/sync/response.d.ts +1 -0
- package/dist/server/sync/sqlite/index.d.ts +3 -0
- package/dist/server/sync/sqlite/index.js +10 -4
- package/dist/server/sync/stream.d.ts +2 -5
- package/dist/server/sync/validation.d.ts +4 -0
- package/dist/shared/defer.d.ts +31 -0
- package/dist/shared/error.d.ts +2 -2
- package/dist/shared/page-key.d.ts +7 -0
- package/dist/shared/query-bindings.d.ts +12 -0
- package/dist/shared/route-frame.d.ts +1 -0
- package/dist/shared/sync-query.d.ts +40 -0
- package/package.json +40 -16
- package/src/adapter/README.md +3 -0
- package/src/adapter/bun.ts +3 -0
- package/src/adapter/package.ts +16 -2
- package/src/adapter/runtime-build.ts +99 -14
- package/src/adapter/static.ts +17 -6
- package/src/adapter/vercel.ts +33 -23
- package/src/build/client.ts +23 -5
- package/src/build/entry-template.ts +9 -0
- package/src/build/hydrate.ts +18 -3
- package/src/build/preload-manifest.ts +100 -0
- package/src/build/production-instrumentation.ts +6 -3
- package/src/build/request-keys.ts +93 -0
- package/src/build/ssg-cache.ts +9 -4
- package/src/build/types.ts +4 -0
- package/src/cli/index.ts +1 -0
- package/src/client/boundaries.tsx +1 -1
- package/src/client/browser-events-runtime.ts +73 -16
- package/src/client/client-module.ts +57 -0
- package/src/client/define-route.ts +11 -2
- package/src/client/dev-error-overlay.ts +1 -0
- package/src/client/document.tsx +47 -20
- package/src/client/hmr.ts +4 -2
- package/src/client/internal/runtime-types.ts +2 -0
- package/src/client/link.tsx +8 -8
- package/src/client/mutation.ts +136 -0
- package/src/client/query-store.ts +418 -0
- package/src/client/query.tsx +67 -0
- package/src/client/route-api.tsx +75 -0
- package/src/client/router/boundary-tree.tsx +10 -6
- package/src/client/router/context.ts +57 -4
- package/src/client/router/index.ts +3 -0
- package/src/client/router/link-utils.ts +29 -1
- package/src/client/router/navigation.ts +3 -50
- package/src/client/router/optimistic.ts +233 -0
- package/src/client/router/provider.tsx +404 -96
- package/src/client/router/search/index.ts +37 -17
- package/src/client/router/search-store.ts +4 -0
- package/src/client/router/sync-catch-up.ts +7 -0
- package/src/client/router/types.ts +71 -9
- package/src/client/sync.ts +438 -65
- package/src/client.ts +20 -60
- package/src/config.ts +5 -0
- package/src/define-route.ts +442 -155
- package/src/env.d.ts +2 -2
- package/src/furin.ts +213 -38
- package/src/plugin/hmr-dependencies.ts +58 -0
- package/src/plugin/index.ts +38 -2
- package/src/plugin/route-config-autofix.ts +2 -2
- package/src/plugin/routes.ts +19 -8
- package/src/plugin/transform-client-module.ts +123 -0
- package/src/plugin/transform-client.ts +293 -13
- package/src/plugin/transform-dev-page.ts +231 -0
- package/src/plugin/transform-isomorphic.ts +11 -5
- package/src/routes.ts +8 -0
- package/src/rsc/shared.tsx +104 -18
- package/src/rsc/version.ts +5 -0
- package/src/server/auto-invalidate/registry.ts +56 -24
- package/src/server/auto-invalidate/runtime.ts +17 -0
- package/src/server/auto-invalidate/types.ts +6 -0
- package/src/server/browser-events/plugin.ts +112 -1
- package/src/server/cache/dev-loader.ts +1 -1
- package/src/server/cache/invalidation.ts +2 -0
- package/src/server/cache/isr-ssg.ts +1 -1
- package/src/server/cache/isr.ts +6 -34
- package/src/server/cache/route-cache.ts +40 -4
- package/src/server/cache/ssg.ts +1 -1
- package/src/server/dev/diagnostics.ts +4 -2
- package/src/server/dev/error.ts +2 -1
- package/src/server/dev/graph.ts +70 -7
- package/src/server/dev/runtime.production.ts +4 -0
- package/src/server/dev/symbolicate.ts +2 -0
- package/src/server/dev-page-plugin.ts +160 -63
- package/src/server/evlog.ts +1 -1
- package/src/server/internal.ts +5 -0
- package/src/server/render/assemble.ts +15 -11
- package/src/server/render/document.tsx +13 -2
- package/src/server/render/element.tsx +11 -6
- package/src/server/render/isr.ts +71 -33
- package/src/server/render/loaders.ts +328 -70
- package/src/server/render/mixed-cache.ts +327 -0
- package/src/server/render/not-found.ts +14 -11
- package/src/server/render/ppr-document.ts +47 -11
- package/src/server/render/ppr-route.ts +54 -20
- package/src/server/render/react-stream.ts +17 -0
- package/src/server/render/route-frame-transport.ts +3 -0
- package/src/server/render/ssg.ts +53 -19
- package/src/server/render/ssr.ts +105 -36
- package/src/server/render/static-params.ts +1 -1
- package/src/server/render/template.ts +23 -0
- package/src/server/router/defined-route.ts +3 -0
- package/src/server/router/discovery.ts +14 -0
- package/src/server/router/hmr.ts +109 -18
- package/src/server/router/patterns.ts +27 -0
- package/src/server/router/plugin.ts +94 -19
- package/src/server/router/source-version.ts +20 -2
- package/src/server/router/types.ts +4 -0
- package/src/server/security/csp.ts +44 -0
- package/src/server/sync/adapter.ts +41 -4
- package/src/server/sync/atomic.ts +303 -0
- package/src/server/sync/drizzle/index.ts +145 -0
- package/src/server/sync/execution-error.ts +1 -0
- package/src/server/sync/fingerprint.ts +2 -6
- package/src/server/sync/index.ts +6 -0
- package/src/server/sync/mutation-handler.ts +69 -0
- package/src/server/sync/plugin.ts +177 -60
- package/src/server/sync/postgres/execute.ts +20 -0
- package/src/server/sync/postgres/index.ts +60 -16
- package/src/server/sync/postgres/sql.ts +20 -0
- package/src/server/sync/prisma/index.ts +70 -0
- package/src/server/sync/queries.ts +75 -0
- package/src/server/sync/query-context.ts +85 -0
- package/src/server/sync/redis/index.ts +7 -3
- package/src/server/sync/redis/scripts.ts +1 -1
- package/src/server/sync/response.ts +21 -0
- package/src/server/sync/sqlite/index.ts +19 -8
- package/src/server/sync/stream.ts +14 -22
- package/src/server/sync/validation.ts +34 -0
- package/src/shared/defer.ts +48 -0
- package/src/shared/error.ts +2 -2
- package/src/shared/page-key.ts +36 -0
- package/src/shared/query-bindings.ts +138 -0
- package/src/shared/route-frame.ts +13 -1
- package/src/shared/route-map.ts +12 -2
- package/src/shared/sync-query.ts +138 -0
|
@@ -71,14 +71,29 @@ function instanceSlot(init) {
|
|
|
71
71
|
// src/server/auto-invalidate/registry.ts
|
|
72
72
|
class AutoInvalidateRegistry {
|
|
73
73
|
pathToTags = new Map;
|
|
74
|
+
pathOwners = new Map;
|
|
74
75
|
tagToPaths = new Map;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
reindexPath(urlPath) {
|
|
77
|
+
const previous = this.pathToTags.get(urlPath);
|
|
78
|
+
if (previous) {
|
|
79
|
+
for (const tag of previous) {
|
|
80
|
+
const paths = this.tagToPaths.get(tag);
|
|
81
|
+
paths?.delete(urlPath);
|
|
82
|
+
if (paths?.size === 0) {
|
|
83
|
+
this.tagToPaths.delete(tag);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const uniqueTags = new Set;
|
|
88
|
+
for (const tags of this.pathOwners.get(urlPath)?.values() ?? []) {
|
|
89
|
+
for (const tag of tags) {
|
|
90
|
+
uniqueTags.add(tag);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (uniqueTags.size === 0) {
|
|
94
|
+
this.pathToTags.delete(urlPath);
|
|
78
95
|
return;
|
|
79
96
|
}
|
|
80
|
-
this.unregisterPath(urlPath);
|
|
81
|
-
const uniqueTags = new Set(tags);
|
|
82
97
|
this.pathToTags.set(urlPath, uniqueTags);
|
|
83
98
|
for (const tag of uniqueTags) {
|
|
84
99
|
let paths = this.tagToPaths.get(tag);
|
|
@@ -89,6 +104,23 @@ class AutoInvalidateRegistry {
|
|
|
89
104
|
paths.add(urlPath);
|
|
90
105
|
}
|
|
91
106
|
}
|
|
107
|
+
registerLoaderTags(urlPath, tags, owner) {
|
|
108
|
+
const ownerKey = owner ?? "default";
|
|
109
|
+
let owners = this.pathOwners.get(urlPath);
|
|
110
|
+
if (tags === undefined || tags.length === 0) {
|
|
111
|
+
owners?.delete(ownerKey);
|
|
112
|
+
if (owners?.size === 0) {
|
|
113
|
+
this.pathOwners.delete(urlPath);
|
|
114
|
+
}
|
|
115
|
+
} else {
|
|
116
|
+
if (!owners) {
|
|
117
|
+
owners = new Map;
|
|
118
|
+
this.pathOwners.set(urlPath, owners);
|
|
119
|
+
}
|
|
120
|
+
owners.set(ownerKey, new Set(tags));
|
|
121
|
+
}
|
|
122
|
+
this.reindexPath(urlPath);
|
|
123
|
+
}
|
|
92
124
|
pathsForTags(tags) {
|
|
93
125
|
const paths = new Set;
|
|
94
126
|
for (const tag of tags) {
|
|
@@ -98,34 +130,33 @@ class AutoInvalidateRegistry {
|
|
|
98
130
|
}
|
|
99
131
|
return [...paths];
|
|
100
132
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (paths.size === 0) {
|
|
113
|
-
this.tagToPaths.delete(tag);
|
|
133
|
+
tagsForPath(path) {
|
|
134
|
+
return [...this.pathToTags.get(path) ?? []];
|
|
135
|
+
}
|
|
136
|
+
unregisterPath(urlPath, owner) {
|
|
137
|
+
if (owner === undefined) {
|
|
138
|
+
this.pathOwners.delete(urlPath);
|
|
139
|
+
} else {
|
|
140
|
+
const owners = this.pathOwners.get(urlPath);
|
|
141
|
+
owners?.delete(owner);
|
|
142
|
+
if (owners?.size === 0) {
|
|
143
|
+
this.pathOwners.delete(urlPath);
|
|
114
144
|
}
|
|
115
145
|
}
|
|
116
|
-
this.
|
|
146
|
+
this.reindexPath(urlPath);
|
|
117
147
|
}
|
|
118
148
|
reset() {
|
|
119
149
|
this.pathToTags.clear();
|
|
150
|
+
this.pathOwners.clear();
|
|
120
151
|
this.tagToPaths.clear();
|
|
121
152
|
}
|
|
122
153
|
}
|
|
123
154
|
var instanceAutoInvalidateRegistry = instanceSlot(() => new AutoInvalidateRegistry);
|
|
124
155
|
var autoInvalidateRegistry = {
|
|
125
156
|
pathsForTags: (tags) => instanceAutoInvalidateRegistry().pathsForTags(tags),
|
|
126
|
-
registerLoaderTags: (urlPath, tags) => instanceAutoInvalidateRegistry().registerLoaderTags(urlPath, tags),
|
|
157
|
+
registerLoaderTags: (urlPath, tags, owner) => instanceAutoInvalidateRegistry().registerLoaderTags(urlPath, tags, owner),
|
|
127
158
|
reset: () => instanceAutoInvalidateRegistry().reset(),
|
|
128
|
-
unregisterPath: (urlPath) => instanceAutoInvalidateRegistry().unregisterPath(urlPath)
|
|
159
|
+
unregisterPath: (urlPath, owner) => instanceAutoInvalidateRegistry().unregisterPath(urlPath, owner)
|
|
129
160
|
};
|
|
130
161
|
|
|
131
162
|
// src/server/cache/route-cache.ts
|
|
@@ -148,7 +179,14 @@ function matchesPath(urlPath, path, type) {
|
|
|
148
179
|
}
|
|
149
180
|
function createRouteCache(options) {
|
|
150
181
|
const store = new Map;
|
|
182
|
+
const generations = new Map;
|
|
151
183
|
const pathFromKey = options.pathFromKey ?? defaultPathFromKey;
|
|
184
|
+
const invalidateGenerations = (key) => {
|
|
185
|
+
for (const generation of generations.get(key) ?? []) {
|
|
186
|
+
generation.valid = false;
|
|
187
|
+
}
|
|
188
|
+
generations.delete(key);
|
|
189
|
+
};
|
|
152
190
|
const evictOldest = () => {
|
|
153
191
|
if (options.maxSize === undefined || store.size <= options.maxSize) {
|
|
154
192
|
return;
|
|
@@ -159,6 +197,7 @@ function createRouteCache(options) {
|
|
|
159
197
|
}
|
|
160
198
|
};
|
|
161
199
|
const deleteEntry = (key) => {
|
|
200
|
+
invalidateGenerations(key);
|
|
162
201
|
const entry = store.get(key);
|
|
163
202
|
if (entry === undefined) {
|
|
164
203
|
return false;
|
|
@@ -168,7 +207,20 @@ function createRouteCache(options) {
|
|
|
168
207
|
return true;
|
|
169
208
|
};
|
|
170
209
|
return {
|
|
210
|
+
captureGeneration(key) {
|
|
211
|
+
const generation = { valid: true };
|
|
212
|
+
let pending = generations.get(key);
|
|
213
|
+
if (pending === undefined) {
|
|
214
|
+
pending = new Set;
|
|
215
|
+
generations.set(key, pending);
|
|
216
|
+
}
|
|
217
|
+
pending.add(generation);
|
|
218
|
+
return generation;
|
|
219
|
+
},
|
|
171
220
|
clear() {
|
|
221
|
+
for (const key of generations.keys()) {
|
|
222
|
+
invalidateGenerations(key);
|
|
223
|
+
}
|
|
172
224
|
for (const key of [...store.keys()]) {
|
|
173
225
|
deleteEntry(key);
|
|
174
226
|
}
|
|
@@ -194,14 +246,15 @@ function createRouteCache(options) {
|
|
|
194
246
|
invalidatePath(path, type) {
|
|
195
247
|
let deleted = false;
|
|
196
248
|
const purgedPaths = [];
|
|
197
|
-
for (const key of [...store.keys()]) {
|
|
249
|
+
for (const key of new Set([...store.keys(), ...generations.keys()])) {
|
|
198
250
|
const urlPath = pathFromKey(key);
|
|
199
251
|
if (urlPath === null || !matchesPath(urlPath, path, type)) {
|
|
200
252
|
continue;
|
|
201
253
|
}
|
|
202
|
-
deleteEntry(key)
|
|
203
|
-
|
|
204
|
-
|
|
254
|
+
if (deleteEntry(key)) {
|
|
255
|
+
deleted = true;
|
|
256
|
+
purgedPaths.push(urlPath);
|
|
257
|
+
}
|
|
205
258
|
}
|
|
206
259
|
return { deleted, purgedPaths: [...new Set(purgedPaths)] };
|
|
207
260
|
},
|
|
@@ -209,6 +262,13 @@ function createRouteCache(options) {
|
|
|
209
262
|
return store.keys();
|
|
210
263
|
},
|
|
211
264
|
name: options.name,
|
|
265
|
+
releaseGeneration(key, generation) {
|
|
266
|
+
const pending = generations.get(key);
|
|
267
|
+
pending?.delete(generation);
|
|
268
|
+
if (pending?.size === 0) {
|
|
269
|
+
generations.delete(key);
|
|
270
|
+
}
|
|
271
|
+
},
|
|
212
272
|
set(key, entry) {
|
|
213
273
|
const previous = store.get(key);
|
|
214
274
|
if (previous !== undefined) {
|
|
@@ -232,7 +292,7 @@ function createHtmlRouteCache(mode, options) {
|
|
|
232
292
|
maxSize: MAX_HTML_CACHE_SIZE,
|
|
233
293
|
name: `render:${mode}-html`,
|
|
234
294
|
onDelete: (key, entry) => {
|
|
235
|
-
autoInvalidateRegistry.unregisterPath(key);
|
|
295
|
+
autoInvalidateRegistry.unregisterPath(key, `render:${mode}-html`);
|
|
236
296
|
options?.onDelete?.(key, entry);
|
|
237
297
|
},
|
|
238
298
|
pathFromKey: pathWithoutSearch
|
|
@@ -275,22 +335,10 @@ function createStoreView(resolve) {
|
|
|
275
335
|
|
|
276
336
|
// src/server/cache/isr.ts
|
|
277
337
|
var instanceIsrCache = instanceSlot((instance) => {
|
|
278
|
-
const generations = new Map;
|
|
279
338
|
const pendingRevalidations = new Map;
|
|
280
|
-
const cache = createHtmlRouteCache("isr"
|
|
281
|
-
onDelete: (key) => {
|
|
282
|
-
const pending = generations.get(key);
|
|
283
|
-
if (pending === undefined) {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
for (const generation of pending) {
|
|
287
|
-
generation.valid = false;
|
|
288
|
-
}
|
|
289
|
-
generations.delete(key);
|
|
290
|
-
}
|
|
291
|
-
});
|
|
339
|
+
const cache = createHtmlRouteCache("isr");
|
|
292
340
|
registerCacheInvalidator(cache, instance);
|
|
293
|
-
return { cache,
|
|
341
|
+
return { cache, pendingRevalidations };
|
|
294
342
|
});
|
|
295
343
|
var isrCache = createStoreView(() => instanceIsrCache().cache.store);
|
|
296
344
|
async function waitForPendingISRRevalidations() {
|
|
@@ -306,7 +354,7 @@ async function waitForPendingISRRevalidations() {
|
|
|
306
354
|
|
|
307
355
|
// src/server/evlog.ts
|
|
308
356
|
import { Elysia } from "elysia";
|
|
309
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
357
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/streamResponse-OlirMA5P.mjs
|
|
310
358
|
function shouldDeferEmitForResponse(response) {
|
|
311
359
|
if (!response.body)
|
|
312
360
|
return false;
|
|
@@ -384,7 +432,7 @@ function bindStreamingResponseLifecycle(response, onComplete) {
|
|
|
384
432
|
headers: response.headers
|
|
385
433
|
});
|
|
386
434
|
}
|
|
387
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
435
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/utils.mjs
|
|
388
436
|
function elapsedMs(startTime) {
|
|
389
437
|
return Math.max(0, Date.now() - startTime);
|
|
390
438
|
}
|
|
@@ -524,7 +572,7 @@ function isoNow() {
|
|
|
524
572
|
return `${_isoCachedPrefix}.${String(now % 1000).padStart(3, "0")}Z`;
|
|
525
573
|
}
|
|
526
574
|
|
|
527
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
575
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/redact-C7FmdhwI.mjs
|
|
528
576
|
var DEFAULT_REPLACEMENT = "[REDACTED]";
|
|
529
577
|
function normalizeRedactPathPattern(pattern) {
|
|
530
578
|
if (!pattern.includes("*") && !pattern.includes("."))
|
|
@@ -830,7 +878,7 @@ function applyMaskers(value, maskers) {
|
|
|
830
878
|
return result;
|
|
831
879
|
}
|
|
832
880
|
|
|
833
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
881
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/globalRegistry-Bh3bIGwA.mjs
|
|
834
882
|
function logPluginError(name, hook, err) {
|
|
835
883
|
console.error(`[evlog/${name}] ${hook} failed:`, err);
|
|
836
884
|
}
|
|
@@ -997,7 +1045,7 @@ function getSharedStorage(id, create) {
|
|
|
997
1045
|
return storage;
|
|
998
1046
|
}
|
|
999
1047
|
|
|
1000
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
1048
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/pretty-error-D8rlWNL1.mjs
|
|
1001
1049
|
var snippetReader = null;
|
|
1002
1050
|
var PRETTY_ERROR_TREE_SPACER = "__EVLOG_TREE_SPACER__";
|
|
1003
1051
|
function pushTreeSpacer(children) {
|
|
@@ -1298,7 +1346,7 @@ function buildErrorEntries(error, options = {}) {
|
|
|
1298
1346
|
}];
|
|
1299
1347
|
}
|
|
1300
1348
|
|
|
1301
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
1349
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/dev-terminal-Brarc6vc.mjs
|
|
1302
1350
|
var DEV_PRESETS = {
|
|
1303
1351
|
evlog: {
|
|
1304
1352
|
frameworkOverlay: false,
|
|
@@ -1347,7 +1395,7 @@ function resolveDevTerminal(input = {}) {
|
|
|
1347
1395
|
};
|
|
1348
1396
|
}
|
|
1349
1397
|
|
|
1350
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
1398
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/wideEventChannel-BUDW48oP.mjs
|
|
1351
1399
|
var publisher = null;
|
|
1352
1400
|
function hasWideEventPublisher() {
|
|
1353
1401
|
return publisher !== null;
|
|
@@ -1362,13 +1410,13 @@ function publishWideEvent(event) {
|
|
|
1362
1410
|
}
|
|
1363
1411
|
}
|
|
1364
1412
|
|
|
1365
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
1413
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/error-brand-D0-DCPvr.mjs
|
|
1366
1414
|
var evlogErrorBrand = Symbol.for("evlog.error.brand");
|
|
1367
1415
|
function isEvlogError(error) {
|
|
1368
1416
|
return typeof error === "object" && error !== null && error[evlogErrorBrand] === true;
|
|
1369
1417
|
}
|
|
1370
1418
|
|
|
1371
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
1419
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/error.mjs
|
|
1372
1420
|
var evlogErrorInternalKey = Symbol.for("evlog.error.internal");
|
|
1373
1421
|
var evlogErrorDataKey = Symbol.for("evlog.error.data");
|
|
1374
1422
|
var EvlogError = class EvlogError extends Error {
|
|
@@ -1472,7 +1520,7 @@ Object.defineProperty(EvlogError.prototype, evlogErrorBrand, {
|
|
|
1472
1520
|
enumerable: false
|
|
1473
1521
|
});
|
|
1474
1522
|
|
|
1475
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
1523
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/headers-Bx1ieR-m.mjs
|
|
1476
1524
|
function extractSafeHeaders(headers) {
|
|
1477
1525
|
const raw = {};
|
|
1478
1526
|
headers.forEach((value, key) => {
|
|
@@ -1490,7 +1538,7 @@ function extractSafeNodeHeaders(headers) {
|
|
|
1490
1538
|
return filterSafeHeaders(raw);
|
|
1491
1539
|
}
|
|
1492
1540
|
|
|
1493
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
1541
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/audit-C8euLMvu.mjs
|
|
1494
1542
|
var nativeStdoutWrite = typeof process !== "undefined" && typeof process.stdout?.write === "function" ? process.stdout.write.bind(process.stdout) : undefined;
|
|
1495
1543
|
function writePrettyStdout(text) {
|
|
1496
1544
|
(globalThis.__evlogNativeStdoutWrite ?? nativeStdoutWrite)?.(text);
|
|
@@ -2406,7 +2454,7 @@ function finalizeAudit(event) {
|
|
|
2406
2454
|
_testCollector?.(decorated, event);
|
|
2407
2455
|
}
|
|
2408
2456
|
|
|
2409
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
2457
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/errors-CL8dDgIi.mjs
|
|
2410
2458
|
function extractErrorStatus(error) {
|
|
2411
2459
|
if (error === null || typeof error !== "object")
|
|
2412
2460
|
return 500;
|
|
@@ -2415,7 +2463,7 @@ function extractErrorStatus(error) {
|
|
|
2415
2463
|
return Number.isFinite(status) ? status : 500;
|
|
2416
2464
|
}
|
|
2417
2465
|
|
|
2418
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
2466
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/deferred-drain-CfRYimo5.mjs
|
|
2419
2467
|
function shouldLog(path, include, exclude) {
|
|
2420
2468
|
if (exclude && exclude.length > 0) {
|
|
2421
2469
|
if (exclude.some((pattern) => matchesPattern(path, pattern)))
|
|
@@ -2440,7 +2488,7 @@ function extendDeferredDrain(drainPromise, waitUntil) {
|
|
|
2440
2488
|
waitUntil(drainPromise);
|
|
2441
2489
|
}
|
|
2442
2490
|
|
|
2443
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
2491
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/middleware-fam3VyaL.mjs
|
|
2444
2492
|
var noopResult = {
|
|
2445
2493
|
logger: noopLogger,
|
|
2446
2494
|
finish: () => Promise.resolve(null),
|
|
@@ -2624,7 +2672,7 @@ function createMiddlewareLogger(options) {
|
|
|
2624
2672
|
};
|
|
2625
2673
|
}
|
|
2626
2674
|
|
|
2627
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
2675
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/integration-CGD18W8r.mjs
|
|
2628
2676
|
function attachForkToLogger(storage, parent, middlewareOptions, lifecycle) {
|
|
2629
2677
|
const log = parent;
|
|
2630
2678
|
log.fork = (label, fn) => {
|
|
@@ -2720,7 +2768,7 @@ function defineFrameworkIntegration(spec) {
|
|
|
2720
2768
|
};
|
|
2721
2769
|
} };
|
|
2722
2770
|
}
|
|
2723
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
2771
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/toolkit/storage.mjs
|
|
2724
2772
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
|
|
2725
2773
|
function createLoggerStorage(contextHint, id = contextHint) {
|
|
2726
2774
|
const storage = getSharedStorage(id, () => new AsyncLocalStorage2);
|
|
@@ -18,9 +18,9 @@ export declare const FURIN_DEFERRED_GLOBAL = "__FURIN_DEFERRED__";
|
|
|
18
18
|
* Synchronous loader data is NOT carried here — it lives exclusively in the
|
|
19
19
|
* `__FURIN_DATA__` JSON script that the hydrate entry reads.
|
|
20
20
|
*
|
|
21
|
-
* CSP note: this is an inline `<script>` — nonce support is a v2 concern.
|
|
22
21
|
*/
|
|
23
|
-
export declare function
|
|
22
|
+
export declare function nonceAttribute(nonce?: string): string;
|
|
23
|
+
export declare function buildDeferredScript(deferredKeys: string[], nonce?: string): string;
|
|
24
24
|
/**
|
|
25
25
|
* Generates a late `<script>` that settles one deferred Promise on the client.
|
|
26
26
|
* The `chunk` must be a seroval CrossJSON value produced by `toCrossJSON(value)`.
|
|
@@ -29,7 +29,7 @@ export declare function buildDeferredScript(deferredKeys: string[]): string;
|
|
|
29
29
|
* @param chunk - The already-serialised CrossJSON value
|
|
30
30
|
* @param action - "resolve" or "reject"
|
|
31
31
|
*/
|
|
32
|
-
export declare function buildDeferredResolution(key: string, chunk: ReturnType<typeof toCrossJSON>, action: "resolve" | "reject"): string;
|
|
32
|
+
export declare function buildDeferredResolution(key: string, chunk: ReturnType<typeof toCrossJSON>, action: "resolve" | "reject", nonce?: string): string;
|
|
33
33
|
/** Minimal context passed to background / synthetic render helpers — only `request` is needed. */
|
|
34
34
|
export interface LoaderContext {
|
|
35
35
|
request: Request;
|
|
@@ -37,8 +37,8 @@ export interface LoaderContext {
|
|
|
37
37
|
export declare function resolvePath(pattern: string, params: Record<string, string>): string;
|
|
38
38
|
export declare function streamToString(stream: ReadableStream): Promise<string>;
|
|
39
39
|
export declare function buildRouteFrameTemplate(payload: string): string;
|
|
40
|
-
export declare function buildRouteFrameStreamScript(): string;
|
|
41
|
-
export declare function buildRouteFramePushScript(payload: string): string;
|
|
42
|
-
export declare function buildRouteFrameCloseScript(): string;
|
|
40
|
+
export declare function buildRouteFrameStreamScript(nonce?: string): string;
|
|
41
|
+
export declare function buildRouteFramePushScript(payload: string, nonce?: string): string;
|
|
42
|
+
export declare function buildRouteFrameCloseScript(nonce?: string): string;
|
|
43
43
|
export declare function buildSyncRuntimeScript(): string;
|
|
44
44
|
export declare function injectSyncRuntimeScript(html: string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type DocumentAssets } from "../../client/document.tsx";
|
|
3
3
|
import type { HeadOptions } from "../../client.ts";
|
|
4
|
-
export declare function withDocumentState(element: ReactNode, assets: DocumentAssets, head: HeadOptions | undefined, data: object | undefined): ReactNode;
|
|
4
|
+
export declare function withDocumentState(element: ReactNode, assets: DocumentAssets, head: HeadOptions | undefined, data: object | undefined, nonce?: string): ReactNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
import type { RuntimeRoute } from "../../client/internal/runtime-types.ts";
|
|
3
3
|
import type { ErrorComponent } from "../../shared/error.ts";
|
|
4
4
|
import type { FurinNotFoundError, NotFoundComponent } from "../../shared/not-found.ts";
|
|
@@ -30,12 +30,13 @@ export type LoaderResult = {
|
|
|
30
30
|
* has already been consumed by `runLoaders` (do NOT read it again).
|
|
31
31
|
*/
|
|
32
32
|
error: unknown;
|
|
33
|
-
/** HTTP status to return. Default 500; sourced from
|
|
33
|
+
/** HTTP status to return. Default 500; sourced from thrown Responses and Eden problems. */
|
|
34
34
|
status: number;
|
|
35
35
|
/**
|
|
36
36
|
* Safe public message extracted at the loader boundary. For thrown
|
|
37
37
|
* `Response` objects: response body or `statusText`. For thrown `Error`
|
|
38
|
-
*
|
|
38
|
+
* values carrying an Eden problem: its detail or title. For other
|
|
39
|
+
* `Error` / non-Error values: a generic "Something went wrong" string (the raw
|
|
39
40
|
* error/message is never leaked here — `errorMessageOf` decides what to
|
|
40
41
|
* surface from the original `error` value when an `error.tsx` fallback
|
|
41
42
|
* exists).
|
|
@@ -43,12 +44,16 @@ export type LoaderResult = {
|
|
|
43
44
|
message: string;
|
|
44
45
|
headers: Record<string, string>;
|
|
45
46
|
};
|
|
46
|
-
export declare function
|
|
47
|
+
export declare function runRequestLoaderFields(route: ResolvedRoute, ctx: Context): {
|
|
48
|
+
fields: Record<string, Promise<unknown>>;
|
|
49
|
+
fieldsByLoader: Record<string, Promise<unknown>>[];
|
|
50
|
+
noFieldCompletion: Promise<void>;
|
|
51
|
+
} | undefined;
|
|
47
52
|
export declare function withRequestLoaderData(route: ResolvedRoute, ctx: Context, publicResult: Extract<LoaderResult, {
|
|
48
53
|
type: "data";
|
|
49
|
-
}>): Extract<LoaderResult, {
|
|
54
|
+
}>): Promise<Extract<LoaderResult, {
|
|
50
55
|
type: "data";
|
|
51
|
-
}
|
|
56
|
+
}>>;
|
|
52
57
|
/**
|
|
53
58
|
* Normalises an error thrown inside a deferred Promise into a value that is
|
|
54
59
|
* safe to send through `toCrossJSON` and that preserves the original semantics
|
|
@@ -69,4 +74,9 @@ export declare function withRequestLoaderData(route: ResolvedRoute, ctx: Context
|
|
|
69
74
|
export declare function serializeDeferredRejection(err: unknown): Promise<unknown>;
|
|
70
75
|
export declare function runLoaders(route: ResolvedRoute, ctx: Context): Promise<LoaderResult>;
|
|
71
76
|
export declare function runPublicLoaders(route: ResolvedRoute, ctx: Context): Promise<LoaderResult>;
|
|
77
|
+
export declare function hasSsrLoaderAncestor(route: ResolvedRoute): boolean;
|
|
78
|
+
export declare function hasMixedLoaderModes(route: ResolvedRoute): boolean;
|
|
79
|
+
export declare function runMixedLoaders(route: ResolvedRoute, ctx: Context): Promise<LoaderResult>;
|
|
80
|
+
export declare function runRouteLoaders(route: ResolvedRoute, ctx: Context): Promise<LoaderResult>;
|
|
81
|
+
export declare function runSegmentPublicLoaders(route: ResolvedRoute, ctx: Context): Promise<LoaderResult>;
|
|
72
82
|
export declare function hasRequestLoader(route: ResolvedRoute): boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Context } from "elysia";
|
|
2
|
+
import type { RuntimePage, RuntimeRoute } from "../../client/internal/runtime-types.ts";
|
|
3
|
+
import { type FurinInstance } from "../instance.ts";
|
|
4
|
+
import type { ResolvedRoute } from "../router/types.ts";
|
|
5
|
+
export declare function clearMixedPublicCache(instance?: FurinInstance): void;
|
|
6
|
+
export declare function cacheMixedPublicLoader(route: ResolvedRoute, ctx: Context, segment: RuntimeRoute | RuntimePage, index: number, parentData: Promise<Record<string, unknown>>, parentFieldsRead: ReadonlySet<string>, run: () => Promise<Record<string, unknown>>): Promise<Record<string, unknown>>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { renderToReadableStream as renderReactStream } from "react-dom/server";
|
|
2
|
+
/** Keep module preloads in the same nonce scope as React's streamed scripts. */
|
|
3
|
+
export declare function renderToReadableStream(element: Parameters<typeof renderReactStream>[0], options: Parameters<typeof renderReactStream>[1]): ReturnType<typeof renderReactStream>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Context } from "elysia";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
|
-
import { renderToReadableStream } from "react-dom/server";
|
|
4
3
|
import { type DocumentAssets } from "../../client/document.tsx";
|
|
5
4
|
import type { RouterContextValue } from "../../client/router/types.ts";
|
|
6
5
|
import type { HeadOptions } from "../../client.ts";
|
|
@@ -8,6 +7,7 @@ import type { SearchRouteMetadata } from "../../shared/search-params.ts";
|
|
|
8
7
|
import type { ResolvedRoute, RootLayout } from "../router/types.ts";
|
|
9
8
|
import { buildErrorElement } from "./element.tsx";
|
|
10
9
|
import { type LoaderResult } from "./loaders.ts";
|
|
10
|
+
import { renderToReadableStream } from "./react-stream.ts";
|
|
11
11
|
export type { LoaderContext } from "./assemble.ts";
|
|
12
12
|
export type { LoaderResult } from "./loaders.ts";
|
|
13
13
|
export interface RenderResult {
|
|
@@ -20,6 +20,7 @@ export interface RenderResult {
|
|
|
20
20
|
* interchangeably.
|
|
21
21
|
*/
|
|
22
22
|
ndjson: string;
|
|
23
|
+
queryTags?: string[];
|
|
23
24
|
status: number;
|
|
24
25
|
}
|
|
25
26
|
export interface PreparedRender {
|
|
@@ -84,7 +85,7 @@ interface ShellFallbackResult {
|
|
|
84
85
|
* to a string) — both start from this same React stream and only diverge in how
|
|
85
86
|
* they consume it and which fields they log.
|
|
86
87
|
*/
|
|
87
|
-
export declare function renderElementWithShellFallback(element: ReactNode, errorComponent: Parameters<typeof buildErrorElement>[0], ssrContext: RouterContextValue, wrapFallbackDocument: (element: ReactNode, digest: string, message: string) => ReactNode): Promise<ShellFallbackResult>;
|
|
88
|
+
export declare function renderElementWithShellFallback(element: ReactNode, errorComponent: Parameters<typeof buildErrorElement>[0], ssrContext: RouterContextValue, wrapFallbackDocument: (element: ReactNode, digest: string, message: string) => ReactNode, nonce?: string): Promise<ShellFallbackResult>;
|
|
88
89
|
/**
|
|
89
90
|
* defer() streams data progressively — it only makes sense in SSR. In SSG/ISR
|
|
90
91
|
* the HTML is pre-rendered and cached, so the deferred fields would be absent
|
|
@@ -108,8 +109,8 @@ interface SsrTransportScripts {
|
|
|
108
109
|
usesRouteFrames: boolean;
|
|
109
110
|
}
|
|
110
111
|
export declare function injectAfterEntry(html: string, injection: string, fallbackIndex: number, hasEntryModule: boolean): string | undefined;
|
|
111
|
-
export declare function buildSsrTransportScripts(dataPayload: Record<string, unknown>, deferredKeys: string[], hasDeferred: boolean, shellErrored: boolean): SsrTransportScripts;
|
|
112
|
-
export declare function writeDeferredSsrChunks(writer: WritableStreamDefaultWriter<Uint8Array>, enc: TextEncoder, deferredPromises: Record<string, Promise<unknown>>, usesRouteFrames: boolean): Promise<void>;
|
|
112
|
+
export declare function buildSsrTransportScripts(dataPayload: Record<string, unknown>, deferredKeys: string[], hasDeferred: boolean, shellErrored: boolean, nonce?: string): SsrTransportScripts;
|
|
113
|
+
export declare function writeDeferredSsrChunks(writer: WritableStreamDefaultWriter<Uint8Array>, enc: TextEncoder, deferredPromises: Record<string, Promise<unknown>>, usesRouteFrames: boolean, nonce?: string): Promise<void>;
|
|
113
114
|
/**
|
|
114
115
|
* Serialises a loader's `syncData` + `deferredPromises` into the same one-line
|
|
115
116
|
* NDJSON shape the live `/_furin/data` endpoint emits.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClientPreloadManifest } from "../../build/preload-manifest.ts";
|
|
1
2
|
import type { DocumentAssets } from "../../client/document.tsx";
|
|
2
3
|
import { type FurinInstance } from "../instance.ts";
|
|
3
4
|
export declare function documentAssetsFromTemplate(template: string): DocumentAssets;
|
|
@@ -7,5 +8,8 @@ export declare function setProductionTemplatePath(path: string | null, instance?
|
|
|
7
8
|
export declare function setProductionTemplateContent(content: string, instance?: FurinInstance): void;
|
|
8
9
|
export declare function getProductionDocumentAssets(): DocumentAssets | null;
|
|
9
10
|
export declare function getProductionTemplate(): string | null;
|
|
11
|
+
export declare function setProductionPreloadManifest(manifest: ClientPreloadManifest, instance?: FurinInstance): void;
|
|
12
|
+
/** The client build's preload manifest, or `null` in dev and before a build. */
|
|
13
|
+
export declare function getProductionPreloadManifest(): ClientPreloadManifest | null;
|
|
10
14
|
/** @internal test-only — resets all template state */
|
|
11
15
|
export declare function __resetTemplateState(): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RuntimePage, RuntimeRoute } from "../../client/internal/runtime-types.ts";
|
|
2
2
|
import type { HeadOptions, RenderingMode } from "../../client.ts";
|
|
3
|
+
import type { RemountDependency } from "../../shared/page-key.ts";
|
|
3
4
|
interface DefinedRouteTerminal {
|
|
4
5
|
__type: "FURIN_ROUTE";
|
|
5
6
|
component: (...args: never[]) => React.ReactNode;
|
|
@@ -9,6 +10,7 @@ interface DefinedRouteTerminal {
|
|
|
9
10
|
loader?: (...args: never[]) => unknown;
|
|
10
11
|
mode?: RenderingMode;
|
|
11
12
|
page?: (...args: never[]) => React.ReactNode;
|
|
13
|
+
remountDeps?: (context: never) => readonly RemountDependency[];
|
|
12
14
|
requestLoader?: (...args: never[]) => unknown;
|
|
13
15
|
revalidate?: number;
|
|
14
16
|
schemas?: {
|
|
@@ -2,6 +2,7 @@ import type { RuntimePage, RuntimeRoute } from "../../client/internal/runtime-ty
|
|
|
2
2
|
import { type CompileContext } from "../internal.ts";
|
|
3
3
|
import type { ResolvedRoute, RootLayout } from "./types.ts";
|
|
4
4
|
export declare function isModuleNotFoundError(err: unknown): boolean;
|
|
5
|
+
export declare function annotateScannedRequestKeys(routes: ResolvedRoute[]): Promise<void>;
|
|
5
6
|
/** @internal Exported for unit testing. */
|
|
6
7
|
export declare function collectRouteTags(routeChain: RuntimeRoute[], page: Pick<RuntimePage, "tags"> | undefined): string[] | undefined;
|
|
7
8
|
export declare function loadProdRoutes(ctx: CompileContext): {
|
|
@@ -65,7 +65,7 @@ export declare function renderDevSSGWithLoaderCache(route: ResolvedRoute, ctx: C
|
|
|
65
65
|
/**
|
|
66
66
|
* @internal Lists every source file whose contents can affect the render
|
|
67
67
|
* output for a given page: the page itself, every intermediate `_route.*`
|
|
68
|
-
* between the page and the pages root,
|
|
68
|
+
* between the page and the pages root, `root.tsx`, and their local imports.
|
|
69
69
|
*
|
|
70
70
|
* Only paths that EXIST on disk are returned. `isDevLoaderCacheValid` treats
|
|
71
71
|
* a `statSync` throw as "invalid" (conservative on missing files), so listing
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { RuntimePage, RuntimeRoute } from "../../client/internal/runtime-types.ts";
|
|
2
|
+
import type { ResolvedRoute } from "./types.ts";
|
|
2
3
|
export declare function collectIntermediateLayoutDirs(pagePath: string, rootPath: string): string[];
|
|
3
4
|
export declare function resolveRouteRevalidate(page: RuntimePage): number | undefined;
|
|
5
|
+
export declare function resolveDocumentMode(route: ResolvedRoute): "ssr" | "ssg" | "isr";
|
|
6
|
+
export declare function resolveDocumentRevalidate(route: ResolvedRoute): number | undefined;
|
|
4
7
|
export declare function resolveMode(page: RuntimePage, routeChain: RuntimeRoute[]): "ssr" | "ssg" | "isr";
|
|
5
8
|
export interface DynamicRouteSegment {
|
|
6
9
|
catchAll: boolean;
|
|
@@ -6,6 +6,9 @@ type RefreshDevRoute = (route: ResolvedRoute) => Promise<{
|
|
|
6
6
|
route: ResolvedRoute;
|
|
7
7
|
root: RootLayout;
|
|
8
8
|
}>;
|
|
9
|
+
export declare function serializeGuardRedirect(response: Response, request: Request): Promise<Response>;
|
|
10
|
+
/** Serialise navigation data after Elysia has run the matched page's hooks. */
|
|
11
|
+
export declare function renderRouteData(route: ResolvedRoute, ctx: Context, root: RootLayout, searchRoutes: SearchRouteMetadata[], logicalHref: string): Promise<Response>;
|
|
9
12
|
export declare function createRoutePlugin(route: ResolvedRoute, root: RootLayout, buildId?: string, searchRoutes?: SearchRouteMetadata[]): AnyElysia;
|
|
10
13
|
export declare function renderResolvedRoute(route: ResolvedRoute, ctx: Context, root: RootLayout, buildId: string, searchRoutes: SearchRouteMetadata[] | undefined): unknown;
|
|
11
14
|
/**
|
|
@@ -39,6 +39,10 @@ export interface ResolvedRoute {
|
|
|
39
39
|
page: RuntimePage;
|
|
40
40
|
path: string;
|
|
41
41
|
pattern: string;
|
|
42
|
+
/** Finite private field names inferred from the request loaders in this chain. */
|
|
43
|
+
requestKeys?: string[];
|
|
44
|
+
/** Request field names for each entry in routeChain, in the same order. */
|
|
45
|
+
requestKeysByLoader?: string[][];
|
|
42
46
|
routeChain: RuntimeRoute[];
|
|
43
47
|
/**
|
|
44
48
|
* Per-directory boundary chain, ordered shallow → deep. Only directories
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Elysia } from "elysia";
|
|
2
|
+
export interface FurinCspOptions {
|
|
3
|
+
policy: (nonce: string | undefined) => string;
|
|
4
|
+
reportOnly?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/** @internal Called only by live SSR, never by public SSG/ISR prerenders. */
|
|
7
|
+
export declare function useRequestCspNonce(request: Request): string | undefined;
|
|
8
|
+
/** Install before Furin routes to attach an application-owned CSP to HTML responses. */
|
|
9
|
+
export declare function furinCsp({ policy, reportOnly }: FurinCspOptions): Elysia<"", "local", import("elysia").DefaultSingleton, {
|
|
10
|
+
typebox: {};
|
|
11
|
+
error: [];
|
|
12
|
+
}, import("elysia").DefaultMetadata, {}, import("elysia").DefaultEphemeral, import("elysia").DefaultEphemeral>;
|