@teyik0/furin 0.6.0-alpha.1 → 0.7.0-alpha.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/dist/adapter/runtime-build.d.ts +1 -1
- package/dist/build/client.d.ts +4 -1
- package/dist/build/elysia-aot-worker.d.ts +22 -0
- package/dist/build/elysia-aot.d.ts +1 -1
- package/dist/build/entry-template.d.ts +3 -0
- package/dist/build/entry-template.ts +7 -0
- package/dist/build/hydrate.d.ts +1 -1
- package/dist/build/index.js +1880 -401
- package/dist/build/preload-manifest.d.ts +17 -0
- package/dist/build/types.d.ts +6 -0
- package/dist/cli/index.js +1878 -408
- package/dist/client/client-module.d.ts +26 -0
- package/dist/client/define-route.d.ts +9 -0
- package/dist/client/document.d.ts +2 -0
- package/dist/client/internal/runtime-types.d.ts +2 -0
- package/dist/client/link.js +942 -122
- 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 +51 -7
- package/dist/client/sync.d.ts +39 -22
- package/dist/client.d.ts +11 -33
- package/dist/client.js +1219 -59
- package/dist/config.d.ts +7 -0
- package/dist/config.js +1 -0
- package/dist/define-route.d.ts +78 -32
- package/dist/env.d.ts +2 -2
- package/dist/furin.d.ts +1 -2
- package/dist/furin.js +2484 -708
- package/dist/plugin/hmr-dependencies.d.ts +2 -0
- package/dist/plugin/index.js +349 -18
- package/dist/plugin/transform-client-module.d.ts +16 -0
- package/dist/plugin/transform-client.d.ts +2 -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 +1 -0
- package/dist/server/auto-invalidate/types.d.ts +2 -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-page-plugin.d.ts +5 -19
- package/dist/server/internal.d.ts +3 -0
- package/dist/server/internal.js +55 -35
- package/dist/server/production-server.js +54 -34
- package/dist/server/render/loaders.d.ts +4 -2
- package/dist/server/render/react-stream.d.ts +3 -0
- package/dist/server/render/ssr.d.ts +2 -1
- package/dist/server/render/template.d.ts +4 -0
- package/dist/server/router/defined-route.d.ts +2 -0
- package/dist/server/router/hmr.d.ts +1 -1
- package/dist/server/router/patterns.d.ts +2 -0
- package/dist/server/router/types.d.ts +1 -1
- 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 +533 -105
- 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 +34 -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 +29 -6
- package/src/adapter/package.ts +12 -2
- package/src/adapter/runtime-build.ts +63 -12
- package/src/adapter/static.ts +7 -2
- package/src/adapter/vercel.ts +15 -13
- package/src/build/client.ts +23 -5
- package/src/build/elysia-aot-worker.ts +51 -0
- package/src/build/elysia-aot.ts +83 -19
- package/src/build/entry-template.ts +7 -0
- package/src/build/hydrate.ts +21 -3
- package/src/build/preload-manifest.ts +100 -0
- package/src/build/production-instrumentation.ts +6 -3
- package/src/build/types.ts +4 -0
- package/src/cli/index.ts +1 -0
- package/src/client/browser-events-runtime.ts +4 -0
- package/src/client/client-module.ts +57 -0
- package/src/client/define-route.ts +11 -1
- package/src/client/document.tsx +28 -18
- package/src/client/hmr.ts +2 -1
- 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 +19 -12
- 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 +306 -46
- 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 +73 -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 +113 -55
- package/src/env.d.ts +2 -2
- package/src/furin.ts +75 -13
- package/src/plugin/hmr-dependencies.ts +58 -0
- package/src/plugin/index.ts +38 -2
- package/src/plugin/routes.ts +28 -16
- package/src/plugin/transform-client-module.ts +123 -0
- package/src/plugin/transform-client.ts +293 -13
- package/src/plugin/transform-isomorphic.ts +11 -5
- package/src/routes.ts +8 -0
- package/src/rsc/shared.tsx +104 -18
- package/src/server/auto-invalidate/registry.ts +4 -0
- package/src/server/auto-invalidate/runtime.ts +17 -0
- package/src/server/auto-invalidate/types.ts +6 -0
- package/src/server/cache/isr.ts +6 -34
- package/src/server/cache/route-cache.ts +40 -4
- package/src/server/dev/graph.ts +16 -2
- package/src/server/dev-page-plugin.ts +93 -59
- package/src/server/internal.ts +3 -0
- package/src/server/render/document.tsx +10 -1
- package/src/server/render/element.tsx +21 -11
- package/src/server/render/isr.ts +61 -29
- package/src/server/render/loaders.ts +118 -47
- package/src/server/render/mixed-cache.ts +33 -4
- package/src/server/render/not-found.ts +4 -7
- package/src/server/render/ppr-document.ts +2 -1
- package/src/server/render/ppr-route.ts +30 -10
- 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 +51 -18
- package/src/server/render/ssr.ts +53 -8
- package/src/server/render/template.ts +23 -0
- package/src/server/router/defined-route.ts +3 -0
- package/src/server/router/discovery.ts +25 -9
- package/src/server/router/hmr.ts +3 -2
- package/src/server/router/patterns.ts +16 -0
- package/src/server/router/plugin.ts +27 -12
- package/src/server/router/types.ts +1 -1
- 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 +52 -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
|
@@ -130,6 +130,9 @@ class AutoInvalidateRegistry {
|
|
|
130
130
|
}
|
|
131
131
|
return [...paths];
|
|
132
132
|
}
|
|
133
|
+
tagsForPath(path) {
|
|
134
|
+
return [...this.pathToTags.get(path) ?? []];
|
|
135
|
+
}
|
|
133
136
|
unregisterPath(urlPath, owner) {
|
|
134
137
|
if (owner === undefined) {
|
|
135
138
|
this.pathOwners.delete(urlPath);
|
|
@@ -176,7 +179,14 @@ function matchesPath(urlPath, path, type) {
|
|
|
176
179
|
}
|
|
177
180
|
function createRouteCache(options) {
|
|
178
181
|
const store = new Map;
|
|
182
|
+
const generations = new Map;
|
|
179
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
|
+
};
|
|
180
190
|
const evictOldest = () => {
|
|
181
191
|
if (options.maxSize === undefined || store.size <= options.maxSize) {
|
|
182
192
|
return;
|
|
@@ -187,6 +197,7 @@ function createRouteCache(options) {
|
|
|
187
197
|
}
|
|
188
198
|
};
|
|
189
199
|
const deleteEntry = (key) => {
|
|
200
|
+
invalidateGenerations(key);
|
|
190
201
|
const entry = store.get(key);
|
|
191
202
|
if (entry === undefined) {
|
|
192
203
|
return false;
|
|
@@ -196,7 +207,20 @@ function createRouteCache(options) {
|
|
|
196
207
|
return true;
|
|
197
208
|
};
|
|
198
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
|
+
},
|
|
199
220
|
clear() {
|
|
221
|
+
for (const key of generations.keys()) {
|
|
222
|
+
invalidateGenerations(key);
|
|
223
|
+
}
|
|
200
224
|
for (const key of [...store.keys()]) {
|
|
201
225
|
deleteEntry(key);
|
|
202
226
|
}
|
|
@@ -222,14 +246,15 @@ function createRouteCache(options) {
|
|
|
222
246
|
invalidatePath(path, type) {
|
|
223
247
|
let deleted = false;
|
|
224
248
|
const purgedPaths = [];
|
|
225
|
-
for (const key of [...store.keys()]) {
|
|
249
|
+
for (const key of new Set([...store.keys(), ...generations.keys()])) {
|
|
226
250
|
const urlPath = pathFromKey(key);
|
|
227
251
|
if (urlPath === null || !matchesPath(urlPath, path, type)) {
|
|
228
252
|
continue;
|
|
229
253
|
}
|
|
230
|
-
deleteEntry(key)
|
|
231
|
-
|
|
232
|
-
|
|
254
|
+
if (deleteEntry(key)) {
|
|
255
|
+
deleted = true;
|
|
256
|
+
purgedPaths.push(urlPath);
|
|
257
|
+
}
|
|
233
258
|
}
|
|
234
259
|
return { deleted, purgedPaths: [...new Set(purgedPaths)] };
|
|
235
260
|
},
|
|
@@ -237,6 +262,13 @@ function createRouteCache(options) {
|
|
|
237
262
|
return store.keys();
|
|
238
263
|
},
|
|
239
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
|
+
},
|
|
240
272
|
set(key, entry) {
|
|
241
273
|
const previous = store.get(key);
|
|
242
274
|
if (previous !== undefined) {
|
|
@@ -303,22 +335,10 @@ function createStoreView(resolve) {
|
|
|
303
335
|
|
|
304
336
|
// src/server/cache/isr.ts
|
|
305
337
|
var instanceIsrCache = instanceSlot((instance) => {
|
|
306
|
-
const generations = new Map;
|
|
307
338
|
const pendingRevalidations = new Map;
|
|
308
|
-
const cache = createHtmlRouteCache("isr"
|
|
309
|
-
onDelete: (key) => {
|
|
310
|
-
const pending = generations.get(key);
|
|
311
|
-
if (pending === undefined) {
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
for (const generation of pending) {
|
|
315
|
-
generation.valid = false;
|
|
316
|
-
}
|
|
317
|
-
generations.delete(key);
|
|
318
|
-
}
|
|
319
|
-
});
|
|
339
|
+
const cache = createHtmlRouteCache("isr");
|
|
320
340
|
registerCacheInvalidator(cache, instance);
|
|
321
|
-
return { cache,
|
|
341
|
+
return { cache, pendingRevalidations };
|
|
322
342
|
});
|
|
323
343
|
var isrCache = createStoreView(() => instanceIsrCache().cache.store);
|
|
324
344
|
async function waitForPendingISRRevalidations() {
|
|
@@ -334,7 +354,7 @@ async function waitForPendingISRRevalidations() {
|
|
|
334
354
|
|
|
335
355
|
// src/server/evlog.ts
|
|
336
356
|
import { Elysia } from "elysia";
|
|
337
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
357
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/streamResponse-OlirMA5P.mjs
|
|
338
358
|
function shouldDeferEmitForResponse(response) {
|
|
339
359
|
if (!response.body)
|
|
340
360
|
return false;
|
|
@@ -412,7 +432,7 @@ function bindStreamingResponseLifecycle(response, onComplete) {
|
|
|
412
432
|
headers: response.headers
|
|
413
433
|
});
|
|
414
434
|
}
|
|
415
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
435
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/utils.mjs
|
|
416
436
|
function elapsedMs(startTime) {
|
|
417
437
|
return Math.max(0, Date.now() - startTime);
|
|
418
438
|
}
|
|
@@ -552,7 +572,7 @@ function isoNow() {
|
|
|
552
572
|
return `${_isoCachedPrefix}.${String(now % 1000).padStart(3, "0")}Z`;
|
|
553
573
|
}
|
|
554
574
|
|
|
555
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
575
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/redact-C7FmdhwI.mjs
|
|
556
576
|
var DEFAULT_REPLACEMENT = "[REDACTED]";
|
|
557
577
|
function normalizeRedactPathPattern(pattern) {
|
|
558
578
|
if (!pattern.includes("*") && !pattern.includes("."))
|
|
@@ -858,7 +878,7 @@ function applyMaskers(value, maskers) {
|
|
|
858
878
|
return result;
|
|
859
879
|
}
|
|
860
880
|
|
|
861
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
881
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/globalRegistry-Bh3bIGwA.mjs
|
|
862
882
|
function logPluginError(name, hook, err) {
|
|
863
883
|
console.error(`[evlog/${name}] ${hook} failed:`, err);
|
|
864
884
|
}
|
|
@@ -1025,7 +1045,7 @@ function getSharedStorage(id, create) {
|
|
|
1025
1045
|
return storage;
|
|
1026
1046
|
}
|
|
1027
1047
|
|
|
1028
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
1048
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/pretty-error-D8rlWNL1.mjs
|
|
1029
1049
|
var snippetReader = null;
|
|
1030
1050
|
var PRETTY_ERROR_TREE_SPACER = "__EVLOG_TREE_SPACER__";
|
|
1031
1051
|
function pushTreeSpacer(children) {
|
|
@@ -1326,7 +1346,7 @@ function buildErrorEntries(error, options = {}) {
|
|
|
1326
1346
|
}];
|
|
1327
1347
|
}
|
|
1328
1348
|
|
|
1329
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
1349
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/dev-terminal-Brarc6vc.mjs
|
|
1330
1350
|
var DEV_PRESETS = {
|
|
1331
1351
|
evlog: {
|
|
1332
1352
|
frameworkOverlay: false,
|
|
@@ -1375,7 +1395,7 @@ function resolveDevTerminal(input = {}) {
|
|
|
1375
1395
|
};
|
|
1376
1396
|
}
|
|
1377
1397
|
|
|
1378
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
1398
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/wideEventChannel-BUDW48oP.mjs
|
|
1379
1399
|
var publisher = null;
|
|
1380
1400
|
function hasWideEventPublisher() {
|
|
1381
1401
|
return publisher !== null;
|
|
@@ -1390,13 +1410,13 @@ function publishWideEvent(event) {
|
|
|
1390
1410
|
}
|
|
1391
1411
|
}
|
|
1392
1412
|
|
|
1393
|
-
// ../../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
|
|
1394
1414
|
var evlogErrorBrand = Symbol.for("evlog.error.brand");
|
|
1395
1415
|
function isEvlogError(error) {
|
|
1396
1416
|
return typeof error === "object" && error !== null && error[evlogErrorBrand] === true;
|
|
1397
1417
|
}
|
|
1398
1418
|
|
|
1399
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
1419
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/error.mjs
|
|
1400
1420
|
var evlogErrorInternalKey = Symbol.for("evlog.error.internal");
|
|
1401
1421
|
var evlogErrorDataKey = Symbol.for("evlog.error.data");
|
|
1402
1422
|
var EvlogError = class EvlogError extends Error {
|
|
@@ -1500,7 +1520,7 @@ Object.defineProperty(EvlogError.prototype, evlogErrorBrand, {
|
|
|
1500
1520
|
enumerable: false
|
|
1501
1521
|
});
|
|
1502
1522
|
|
|
1503
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
1523
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/headers-Bx1ieR-m.mjs
|
|
1504
1524
|
function extractSafeHeaders(headers) {
|
|
1505
1525
|
const raw = {};
|
|
1506
1526
|
headers.forEach((value, key) => {
|
|
@@ -1518,7 +1538,7 @@ function extractSafeNodeHeaders(headers) {
|
|
|
1518
1538
|
return filterSafeHeaders(raw);
|
|
1519
1539
|
}
|
|
1520
1540
|
|
|
1521
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
1541
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/audit-C8euLMvu.mjs
|
|
1522
1542
|
var nativeStdoutWrite = typeof process !== "undefined" && typeof process.stdout?.write === "function" ? process.stdout.write.bind(process.stdout) : undefined;
|
|
1523
1543
|
function writePrettyStdout(text) {
|
|
1524
1544
|
(globalThis.__evlogNativeStdoutWrite ?? nativeStdoutWrite)?.(text);
|
|
@@ -2434,7 +2454,7 @@ function finalizeAudit(event) {
|
|
|
2434
2454
|
_testCollector?.(decorated, event);
|
|
2435
2455
|
}
|
|
2436
2456
|
|
|
2437
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
2457
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/errors-CL8dDgIi.mjs
|
|
2438
2458
|
function extractErrorStatus(error) {
|
|
2439
2459
|
if (error === null || typeof error !== "object")
|
|
2440
2460
|
return 500;
|
|
@@ -2443,7 +2463,7 @@ function extractErrorStatus(error) {
|
|
|
2443
2463
|
return Number.isFinite(status) ? status : 500;
|
|
2444
2464
|
}
|
|
2445
2465
|
|
|
2446
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
2466
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/deferred-drain-CfRYimo5.mjs
|
|
2447
2467
|
function shouldLog(path, include, exclude) {
|
|
2448
2468
|
if (exclude && exclude.length > 0) {
|
|
2449
2469
|
if (exclude.some((pattern) => matchesPattern(path, pattern)))
|
|
@@ -2468,7 +2488,7 @@ function extendDeferredDrain(drainPromise, waitUntil) {
|
|
|
2468
2488
|
waitUntil(drainPromise);
|
|
2469
2489
|
}
|
|
2470
2490
|
|
|
2471
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
2491
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/middleware-fam3VyaL.mjs
|
|
2472
2492
|
var noopResult = {
|
|
2473
2493
|
logger: noopLogger,
|
|
2474
2494
|
finish: () => Promise.resolve(null),
|
|
@@ -2652,7 +2672,7 @@ function createMiddlewareLogger(options) {
|
|
|
2652
2672
|
};
|
|
2653
2673
|
}
|
|
2654
2674
|
|
|
2655
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
2675
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/integration-CGD18W8r.mjs
|
|
2656
2676
|
function attachForkToLogger(storage, parent, middlewareOptions, lifecycle) {
|
|
2657
2677
|
const log = parent;
|
|
2658
2678
|
log.fork = (label, fn) => {
|
|
@@ -2748,7 +2768,7 @@ function defineFrameworkIntegration(spec) {
|
|
|
2748
2768
|
};
|
|
2749
2769
|
} };
|
|
2750
2770
|
}
|
|
2751
|
-
// ../../node_modules/.bun/evlog@2.29.0+
|
|
2771
|
+
// ../../node_modules/.bun/evlog@2.29.0+e419d84a67dec76a/node_modules/evlog/dist/toolkit/storage.mjs
|
|
2752
2772
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
|
|
2753
2773
|
function createLoggerStorage(contextHint, id = contextHint) {
|
|
2754
2774
|
const storage = getSharedStorage(id, () => new AsyncLocalStorage2);
|
|
@@ -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).
|
|
@@ -45,6 +46,7 @@ export type LoaderResult = {
|
|
|
45
46
|
};
|
|
46
47
|
export declare function runRequestLoaderFields(route: ResolvedRoute, ctx: Context): {
|
|
47
48
|
fields: Record<string, Promise<unknown>>;
|
|
49
|
+
fieldsByLoader: Record<string, Promise<unknown>>[];
|
|
48
50
|
noFieldCompletion: Promise<void>;
|
|
49
51
|
} | undefined;
|
|
50
52
|
export declare function withRequestLoaderData(route: ResolvedRoute, ctx: Context, publicResult: Extract<LoaderResult, {
|
|
@@ -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 {
|
|
@@ -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?: {
|
|
@@ -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
|
|
@@ -11,6 +11,8 @@ export interface DynamicRouteSegment {
|
|
|
11
11
|
}
|
|
12
12
|
export declare function parseDynamicRouteSegment(segment: string, sourcePath: string | undefined): DynamicRouteSegment | undefined;
|
|
13
13
|
export declare function routeSegmentToPattern(segment: string): string;
|
|
14
|
+
export declare function isRouteGroup(segment: string): boolean;
|
|
15
|
+
export declare function routePatternKey(pattern: string): string;
|
|
14
16
|
export declare function filePathToPattern(path: string): string;
|
|
15
17
|
export declare function escapeRegExpChar(ch: string): string;
|
|
16
18
|
/**
|
|
@@ -11,7 +11,7 @@ import type { NotFoundComponent } from "../../shared/not-found.ts";
|
|
|
11
11
|
* exact nesting level where the user authored them (Next.js app-router model).
|
|
12
12
|
*/
|
|
13
13
|
export interface SegmentBoundary {
|
|
14
|
-
/**
|
|
14
|
+
/** Index of the enclosing layout in routeChain; 0 = the root layout. */
|
|
15
15
|
depth: number;
|
|
16
16
|
error?: ErrorComponent;
|
|
17
17
|
/**
|
|
@@ -63,9 +63,11 @@ export interface SyncAdapter {
|
|
|
63
63
|
completeMutation: (input: CompleteMutationInput) => Promise<CompleteMutationResult>;
|
|
64
64
|
currentCursor: () => Promise<string>;
|
|
65
65
|
/**
|
|
66
|
-
* Identifies
|
|
66
|
+
* Identifies the journal namespace's notification channel.
|
|
67
67
|
*/
|
|
68
68
|
readonly notificationChannel?: string;
|
|
69
|
+
/** False when completion requires an explicit wake-up after cache invalidation. */
|
|
70
|
+
readonly publishesNotifications?: boolean;
|
|
69
71
|
readChanges: (input: ReadChangesInput) => Promise<ChangePage>;
|
|
70
72
|
renewMutation: (lease: MutationLease) => Promise<"lost" | "renewed">;
|
|
71
73
|
readonly scope: "distributed" | "host-local" | "process-local";
|
|
@@ -75,7 +77,7 @@ export interface SyncSubscription {
|
|
|
75
77
|
}
|
|
76
78
|
export interface SyncNotifier {
|
|
77
79
|
/**
|
|
78
|
-
* Matches
|
|
80
|
+
* Matches the adapter's journal namespace for notifications and recovery.
|
|
79
81
|
*/
|
|
80
82
|
readonly notificationChannel?: string;
|
|
81
83
|
publish: (cursor: string) => Promise<void>;
|
|
@@ -86,8 +88,27 @@ export interface SyncNotifier {
|
|
|
86
88
|
readonly recovery?: "self";
|
|
87
89
|
subscribe: (listener: (cursor: string) => void) => Promise<SyncSubscription>;
|
|
88
90
|
}
|
|
89
|
-
export interface
|
|
90
|
-
|
|
91
|
+
export interface AtomicMutationValue<T> {
|
|
92
|
+
invalidations: readonly SyncInvalidation[];
|
|
93
|
+
response: StoredResponse;
|
|
94
|
+
value: T;
|
|
95
|
+
}
|
|
96
|
+
export interface AtomicMutationResult<T> {
|
|
97
|
+
cursor: string | undefined;
|
|
98
|
+
kind: "committed";
|
|
99
|
+
response: StoredResponse;
|
|
100
|
+
value: T;
|
|
101
|
+
}
|
|
102
|
+
export interface TransactionalSyncAdapter<Tx, Mode extends "async" | "sync"> extends SyncAdapter {
|
|
103
|
+
executeMutation: <T>(lease: MutationLease, callback: (tx: Tx) => AtomicMutationValue<T> | Promise<AtomicMutationValue<T>>) => Promise<AtomicMutationResult<T>>;
|
|
104
|
+
readonly transactionMode: Mode;
|
|
105
|
+
}
|
|
106
|
+
export type SyncTransaction<Adapter> = Adapter extends TransactionalSyncAdapter<infer Tx, "async" | "sync"> ? Tx : never;
|
|
107
|
+
export type SyncMutation<Adapter> = <T>(callback: (tx: SyncTransaction<Adapter>) => T & (Adapter extends {
|
|
108
|
+
transactionMode: "sync";
|
|
109
|
+
} ? T extends PromiseLike<unknown> ? never : unknown : unknown)) => Promise<Awaited<T>>;
|
|
110
|
+
export interface SyncRuntimeOptions<Adapter extends SyncAdapter = SyncAdapter> {
|
|
111
|
+
adapter: Adapter;
|
|
91
112
|
notifier?: SyncNotifier;
|
|
92
113
|
principal: (context: Context) => Promise<string> | string;
|
|
93
114
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Context, type Elysia } from "elysia";
|
|
2
|
+
import type { InvalidationInput } from "../auto-invalidate/types.ts";
|
|
3
|
+
import type { AtomicMutationResult, MutationLease, SyncInvalidation, TransactionalSyncAdapter } from "./adapter.ts";
|
|
4
|
+
import { type SyncInvalidationSelector } from "./queries.ts";
|
|
5
|
+
import type { ResolvedSyncRuntime } from "./runtime.ts";
|
|
6
|
+
type CommittedMutation = Extract<AtomicMutationResult<unknown>, {
|
|
7
|
+
kind: "committed";
|
|
8
|
+
}>;
|
|
9
|
+
interface Execution<Tx> {
|
|
10
|
+
adapter: TransactionalSyncAdapter<Tx, "async" | "sync">;
|
|
11
|
+
app: Elysia;
|
|
12
|
+
context: Context;
|
|
13
|
+
invalidate: SyncInvalidationSelector | undefined;
|
|
14
|
+
lease: MutationLease;
|
|
15
|
+
onCommit: (result: CommittedMutation) => void;
|
|
16
|
+
resolvedInvalidate?: InvalidationInput;
|
|
17
|
+
runtime: ResolvedSyncRuntime;
|
|
18
|
+
}
|
|
19
|
+
export declare function executeAtomicMutation<Tx>(execution: Execution<Tx>, callback: (tx: Tx) => unknown): Promise<unknown>;
|
|
20
|
+
export declare function conflictResponse(reason: "in-progress" | "payload-mismatch"): Response;
|
|
21
|
+
export declare function normalizedInvalidations(input: InvalidationInput | undefined): SyncInvalidation[];
|
|
22
|
+
export declare function pendingPathInvalidations(entries: readonly string[]): Extract<SyncInvalidation, {
|
|
23
|
+
kind: "path";
|
|
24
|
+
}>[];
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { BunSQLDatabase } from "drizzle-orm/bun-sql";
|
|
2
|
+
import type { BunSQLiteDatabase } from "drizzle-orm/bun-sqlite";
|
|
3
|
+
import type { AtomicMutationResult, AtomicMutationValue, MutationLease, TransactionalSyncAdapter } from "../adapter.ts";
|
|
4
|
+
import { PostgresSyncAdapter } from "../postgres/index.ts";
|
|
5
|
+
import { SqliteSyncAdapter } from "../sqlite/index.ts";
|
|
6
|
+
interface Schema {
|
|
7
|
+
[table: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
type Transaction<Db extends BunSQLiteDatabase<Schema> | BunSQLDatabase<Schema>> = Parameters<Parameters<Db["transaction"]>[0]>[0];
|
|
10
|
+
export declare class DrizzleSqliteSyncAdapter<Db extends BunSQLiteDatabase<Schema>> extends SqliteSyncAdapter implements TransactionalSyncAdapter<Transaction<Db>, "sync"> {
|
|
11
|
+
readonly transactionMode: "sync";
|
|
12
|
+
private readonly db;
|
|
13
|
+
constructor(options: {
|
|
14
|
+
db: Db & {
|
|
15
|
+
$client: import("bun:sqlite").Database;
|
|
16
|
+
};
|
|
17
|
+
namespace: string;
|
|
18
|
+
});
|
|
19
|
+
executeMutation<T>(lease: MutationLease, callback: (tx: Transaction<Db>) => AtomicMutationValue<T> | Promise<AtomicMutationValue<T>>): Promise<AtomicMutationResult<T>>;
|
|
20
|
+
}
|
|
21
|
+
export declare class DrizzlePostgresSyncAdapter<Db extends BunSQLDatabase<Schema>> extends PostgresSyncAdapter implements TransactionalSyncAdapter<Transaction<Db>, "async"> {
|
|
22
|
+
readonly transactionMode: "async";
|
|
23
|
+
private readonly db;
|
|
24
|
+
private readonly syncNamespace;
|
|
25
|
+
constructor(options: {
|
|
26
|
+
db: Db & {
|
|
27
|
+
$client: import("bun").SQL;
|
|
28
|
+
};
|
|
29
|
+
namespace: string;
|
|
30
|
+
});
|
|
31
|
+
executeMutation<T>(lease: MutationLease, callback: (tx: Transaction<Db>) => AtomicMutationValue<T> | Promise<AtomicMutationValue<T>>): Promise<AtomicMutationResult<T>>;
|
|
32
|
+
}
|
|
33
|
+
export declare function drizzleSyncAdapter<Db extends BunSQLiteDatabase<Schema>>(options: {
|
|
34
|
+
db: Db & {
|
|
35
|
+
$client: import("bun:sqlite").Database;
|
|
36
|
+
};
|
|
37
|
+
namespace: string;
|
|
38
|
+
}): DrizzleSqliteSyncAdapter<Db>;
|
|
39
|
+
export declare function drizzleSyncAdapter<Db extends BunSQLDatabase<Schema>>(options: {
|
|
40
|
+
db: Db & {
|
|
41
|
+
$client: import("bun").SQL;
|
|
42
|
+
};
|
|
43
|
+
namespace: string;
|
|
44
|
+
}): DrizzlePostgresSyncAdapter<Db>;
|
|
45
|
+
export {};
|