@farm.js/core 0.1.0-beta.3 → 0.1.0-beta.4
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/agent-runtime.d.mts +2 -1
- package/dist/agent-runtime.d.ts +2 -1
- package/dist/api/route-manager.cjs +313 -10
- package/dist/api/route-manager.cjs.map +1 -1
- package/dist/api/route-manager.d.mts +3 -2
- package/dist/api/route-manager.d.ts +3 -2
- package/dist/api/route-manager.mjs +6 -5
- package/dist/api/runtime.cjs +313 -10
- package/dist/api/runtime.cjs.map +1 -1
- package/dist/api/runtime.d.mts +2 -1
- package/dist/api/runtime.d.ts +2 -1
- package/dist/api/runtime.mjs +4 -3
- package/dist/api.cjs +642 -57
- package/dist/api.cjs.map +1 -1
- package/dist/api.d.mts +3 -2
- package/dist/api.d.ts +3 -2
- package/dist/api.mjs +29 -9
- package/dist/{app-DOKxo-LH.d.ts → app-BjN-da13.d.ts} +38 -3
- package/dist/{app-BB3Iu3xh.d.mts → app-CakAr8Be.d.mts} +38 -3
- package/dist/app-markdown.d.mts +2 -1
- package/dist/app-markdown.d.ts +2 -1
- package/dist/cache.cjs +395 -12
- package/dist/cache.cjs.map +1 -1
- package/dist/cache.d.mts +100 -6
- package/dist/cache.d.ts +100 -6
- package/dist/cache.mjs +8 -2
- package/dist/{chunk-XUBZ7JI4.mjs → chunk-2CUKEMVR.mjs} +187 -16
- package/dist/chunk-2CUKEMVR.mjs.map +1 -0
- package/dist/{chunk-5QH4IKY3.mjs → chunk-3U3ZUQAQ.mjs} +2 -2
- package/dist/{chunk-6WXJ54TC.mjs → chunk-65A7QIKI.mjs} +5 -5
- package/dist/{chunk-6WXJ54TC.mjs.map → chunk-65A7QIKI.mjs.map} +1 -1
- package/dist/{chunk-OHC6VCDI.mjs → chunk-AJWRO5WE.mjs} +521 -42
- package/dist/chunk-AJWRO5WE.mjs.map +1 -0
- package/dist/chunk-ALCLXXTY.mjs +187 -0
- package/dist/chunk-ALCLXXTY.mjs.map +1 -0
- package/dist/{chunk-XJSHJN4M.mjs → chunk-AOBXKNS5.mjs} +593 -49
- package/dist/chunk-AOBXKNS5.mjs.map +1 -0
- package/dist/{chunk-CSU4KJJF.mjs → chunk-C2ROET2V.mjs} +2 -2
- package/dist/{chunk-BIOIOWXZ.mjs → chunk-HNIQFZKB.mjs} +2 -2
- package/dist/{chunk-G5I34UA6.mjs → chunk-JDEOUK5V.mjs} +4 -4
- package/dist/{chunk-T543TMFY.mjs → chunk-NM3CRAAL.mjs} +3 -2
- package/dist/chunk-NM3CRAAL.mjs.map +1 -0
- package/dist/{chunk-LWMGIEJA.mjs → chunk-PFE6GMNE.mjs} +47 -37
- package/dist/chunk-PFE6GMNE.mjs.map +1 -0
- package/dist/{chunk-6VS6CKAV.mjs → chunk-QM746KUO.mjs} +8 -1
- package/dist/chunk-QM746KUO.mjs.map +1 -0
- package/dist/{chunk-SHRJG6OG.mjs → chunk-RBRLLZL5.mjs} +18 -3
- package/dist/chunk-RBRLLZL5.mjs.map +1 -0
- package/dist/{chunk-MH6FKW2I.mjs → chunk-SADGIRS2.mjs} +3 -3
- package/dist/{chunk-NRRFGX45.mjs → chunk-TQAEEJB4.mjs} +3 -3
- package/dist/{chunk-45LKHSHJ.mjs → chunk-UB5UOSHB.mjs} +24 -12
- package/dist/chunk-UB5UOSHB.mjs.map +1 -0
- package/dist/chunk-V3XURYJO.mjs +756 -0
- package/dist/chunk-V3XURYJO.mjs.map +1 -0
- package/dist/{chunk-5FW6PQ3J.mjs → chunk-VVKWFZAH.mjs} +41 -16
- package/dist/chunk-VVKWFZAH.mjs.map +1 -0
- package/dist/{chunk-HZYXGV4K.mjs → chunk-VY2UYN5R.mjs} +24 -4
- package/dist/chunk-VY2UYN5R.mjs.map +1 -0
- package/dist/{chunk-C33RALN7.mjs → chunk-W2CRQFF6.mjs} +79 -15
- package/dist/chunk-W2CRQFF6.mjs.map +1 -0
- package/dist/{chunk-JNYVN7YP.mjs → chunk-W4UIVMVI.mjs} +2 -2
- package/dist/{chunk-JNYVN7YP.mjs.map → chunk-W4UIVMVI.mjs.map} +1 -1
- package/dist/{chunk-LG3YINQN.mjs → chunk-Z5CQMP54.mjs} +3 -3
- package/dist/{client-DiViK9yK.d.mts → client-BT1mFQas.d.mts} +23 -4
- package/dist/{client-DpEBJbts.d.ts → client-Nn0q4eO4.d.ts} +23 -4
- package/dist/{client-plugins-CTnsZz_A.d.ts → client-plugins-Cw4qUGsw.d.ts} +6 -0
- package/dist/{client-plugins-Cnr0D3kk.d.mts → client-plugins-DQQ1adXM.d.mts} +6 -0
- package/dist/client-plugins.d.mts +2 -1
- package/dist/client-plugins.d.ts +2 -1
- package/dist/client.cjs +665 -82
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.mts +70 -4
- package/dist/client.d.ts +70 -4
- package/dist/client.mjs +10 -7
- package/dist/config.d.mts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/{devtools-HE4FTUDN.mjs → devtools-LVC3VB5P.mjs} +4 -4
- package/dist/docs.cjs +11 -1
- package/dist/docs.cjs.map +1 -1
- package/dist/docs.mjs +4 -4
- package/dist/index.cjs +2112 -197
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +12 -11
- package/dist/index.d.ts +12 -11
- package/dist/index.mjs +49 -21
- package/dist/index.mjs.map +1 -1
- package/dist/integrations.d.mts +2 -1
- package/dist/integrations.d.ts +2 -1
- package/dist/internal/build-runtime.cjs +1455 -90
- package/dist/internal/build-runtime.cjs.map +1 -1
- package/dist/internal/build-runtime.d.mts +4 -3
- package/dist/internal/build-runtime.d.ts +4 -3
- package/dist/internal/build-runtime.mjs +15 -14
- package/dist/internal/config-runtime.cjs +12 -1
- package/dist/internal/config-runtime.cjs.map +1 -1
- package/dist/internal/config-runtime.d.mts +3 -2
- package/dist/internal/config-runtime.d.ts +3 -2
- package/dist/internal/config-runtime.mjs +3 -3
- package/dist/internal/production-runtime.cjs +282 -6
- package/dist/internal/production-runtime.cjs.map +1 -1
- package/dist/internal/production-runtime.d.mts +4 -4
- package/dist/internal/production-runtime.d.ts +4 -4
- package/dist/internal/production-runtime.mjs +4 -2
- package/dist/{metadata-eoVmHoyv.d.ts → metadata-BAPg_Nmo.d.ts} +1 -1
- package/dist/{metadata-Dp8AdvsB.d.mts → metadata-_6i9oFG3.d.mts} +1 -1
- package/dist/middleware.d.mts +4 -3
- package/dist/middleware.d.ts +4 -3
- package/dist/navigation.cjs +40 -15
- package/dist/navigation.cjs.map +1 -1
- package/dist/navigation.mjs +2 -2
- package/dist/plugin.cjs +913 -53
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.mts +2 -1
- package/dist/plugin.d.ts +2 -1
- package/dist/plugin.mjs +11 -10
- package/dist/{production-runtime-BqTnUTai.d.ts → production-runtime-BoJDc5mc.d.ts} +1 -1
- package/dist/{production-runtime-DtDdG9fc.d.mts → production-runtime-DPfgMV9Y.d.mts} +1 -1
- package/dist/routes.cjs +276 -6
- package/dist/routes.cjs.map +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.mjs +3 -3
- package/dist/{runtime-C1B7pSGT.d.mts → runtime-9nQjVM7X.d.mts} +8 -9
- package/dist/{runtime-CdPHt0bv.d.ts → runtime-DgeS2skB.d.ts} +8 -9
- package/dist/server-action-security.cjs +28 -10
- package/dist/server-action-security.cjs.map +1 -1
- package/dist/server-action-security.d.mts +2 -1
- package/dist/server-action-security.d.ts +2 -1
- package/dist/server-action-security.mjs +2 -2
- package/dist/server-fn-client.d.mts +1 -0
- package/dist/server-fn-client.d.ts +1 -0
- package/dist/server-fn.cjs +785 -3
- package/dist/server-fn.cjs.map +1 -1
- package/dist/server-fn.d.mts +10 -1
- package/dist/server-fn.d.ts +10 -1
- package/dist/server-fn.mjs +6 -3
- package/dist/server-plugins.d.mts +3 -2
- package/dist/server-plugins.d.ts +3 -2
- package/dist/server-query-client.cjs +278 -7
- package/dist/server-query-client.cjs.map +1 -1
- package/dist/server-query-client.mjs +4 -4
- package/dist/server-query.cjs +381 -10
- package/dist/server-query.cjs.map +1 -1
- package/dist/server-query.mjs +5 -5
- package/dist/server.cjs +1086 -76
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.mts +8 -7
- package/dist/server.d.ts +8 -7
- package/dist/server.mjs +31 -16
- package/dist/server.mjs.map +1 -1
- package/dist/testing.cjs +341 -20
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.mts +3 -2
- package/dist/testing.d.ts +3 -2
- package/dist/testing.mjs +7 -6
- package/dist/testing.mjs.map +1 -1
- package/dist/transport-BmbGTXA5.d.mts +49 -0
- package/dist/transport-BmbGTXA5.d.ts +49 -0
- package/dist/{utils-8USa5BiY.d.mts → utils-CHXlMDkg.d.mts} +1 -1
- package/dist/{utils-DKJb6K6G.d.ts → utils-Drsyz1Vj.d.ts} +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +914 -54
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.mts +2 -1
- package/dist/vite.d.ts +2 -1
- package/dist/vite.mjs +11 -10
- package/package.json +1 -1
- package/types/api.d.ts +44 -0
- package/types/client.d.ts +85 -4
- package/dist/chunk-45LKHSHJ.mjs.map +0 -1
- package/dist/chunk-5FW6PQ3J.mjs.map +0 -1
- package/dist/chunk-6VS6CKAV.mjs.map +0 -1
- package/dist/chunk-C33RALN7.mjs.map +0 -1
- package/dist/chunk-GZWT6VI5.mjs +0 -382
- package/dist/chunk-GZWT6VI5.mjs.map +0 -1
- package/dist/chunk-HZYXGV4K.mjs.map +0 -1
- package/dist/chunk-LWMGIEJA.mjs.map +0 -1
- package/dist/chunk-OHC6VCDI.mjs.map +0 -1
- package/dist/chunk-SHRJG6OG.mjs.map +0 -1
- package/dist/chunk-T543TMFY.mjs.map +0 -1
- package/dist/chunk-XJSHJN4M.mjs.map +0 -1
- package/dist/chunk-XUBZ7JI4.mjs.map +0 -1
- /package/dist/{chunk-5QH4IKY3.mjs.map → chunk-3U3ZUQAQ.mjs.map} +0 -0
- /package/dist/{chunk-CSU4KJJF.mjs.map → chunk-C2ROET2V.mjs.map} +0 -0
- /package/dist/{chunk-BIOIOWXZ.mjs.map → chunk-HNIQFZKB.mjs.map} +0 -0
- /package/dist/{chunk-G5I34UA6.mjs.map → chunk-JDEOUK5V.mjs.map} +0 -0
- /package/dist/{chunk-MH6FKW2I.mjs.map → chunk-SADGIRS2.mjs.map} +0 -0
- /package/dist/{chunk-NRRFGX45.mjs.map → chunk-TQAEEJB4.mjs.map} +0 -0
- /package/dist/{chunk-LG3YINQN.mjs.map → chunk-Z5CQMP54.mjs.map} +0 -0
- /package/dist/{devtools-HE4FTUDN.mjs.map → devtools-LVC3VB5P.mjs.map} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export { _runWithAfterRequest } from '../after.mjs';
|
|
2
2
|
export { _ as _runWithCurrentRequest, g as getCurrentRequest } from '../request-BrFBuc8G.mjs';
|
|
3
|
-
export { createFarmCacheKey, getFarmDataCache, normalizeRevalidatePath } from '../cache.mjs';
|
|
3
|
+
export { configureFarmCache, createFarmCacheKey, getFarmDataCache, normalizeRevalidatePath } from '../cache.mjs';
|
|
4
4
|
export { c as createFarmLocaleCookie, g as getFarmLocaleVaryHeaders } from '../resolver-DlOPpjkB.mjs';
|
|
5
5
|
export { localizeFarmHref, localizeFarmPathname, stripFarmLocaleFromPathname } from '../i18n/index.mjs';
|
|
6
|
-
export { a as addMetadataImageReference, m as mergeMetadata, r as renderMetadataHead } from '../metadata-
|
|
7
|
-
export { _ as _runWithMiddlewareContext, b as _runWithMiddlewareData, a as applyProductionMiddlewareHeaders, c as createProductionMiddlewareRunner } from '../production-runtime-
|
|
6
|
+
export { a as addMetadataImageReference, m as mergeMetadata, r as renderMetadataHead } from '../metadata-_6i9oFG3.mjs';
|
|
7
|
+
export { _ as _runWithMiddlewareContext, b as _runWithMiddlewareData, a as applyProductionMiddlewareHeaders, c as createProductionMiddlewareRunner } from '../production-runtime-DPfgMV9Y.mjs';
|
|
8
8
|
export { g as getFarmRedirectError, i as isFarmNotFoundError, a as isFarmRedirectError } from '../navigation-errors-Dvwpzaer.mjs';
|
|
9
9
|
export { configureFarmObservability, emitFarmEvent } from '../observability.mjs';
|
|
10
|
-
import { F as FarmConfig, e as FarmContextFactoryInput } from '../client-plugins-
|
|
10
|
+
import { F as FarmConfig, e as FarmContextFactoryInput } from '../client-plugins-DQQ1adXM.mjs';
|
|
11
11
|
import 'node:http';
|
|
12
12
|
import '../types-BH1lhg5G.mjs';
|
|
13
13
|
import '../plugin-BJDf43dc.mjs';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export { _runWithAfterRequest } from '../after.js';
|
|
2
2
|
export { _ as _runWithCurrentRequest, g as getCurrentRequest } from '../request-BslSZIRz.js';
|
|
3
|
-
export { createFarmCacheKey, getFarmDataCache, normalizeRevalidatePath } from '../cache.js';
|
|
3
|
+
export { configureFarmCache, createFarmCacheKey, getFarmDataCache, normalizeRevalidatePath } from '../cache.js';
|
|
4
4
|
export { c as createFarmLocaleCookie, g as getFarmLocaleVaryHeaders } from '../resolver-C6iecsDV.js';
|
|
5
5
|
export { localizeFarmHref, localizeFarmPathname, stripFarmLocaleFromPathname } from '../i18n/index.js';
|
|
6
|
-
export { a as addMetadataImageReference, m as mergeMetadata, r as renderMetadataHead } from '../metadata-
|
|
7
|
-
export { _ as _runWithMiddlewareContext, b as _runWithMiddlewareData, a as applyProductionMiddlewareHeaders, c as createProductionMiddlewareRunner } from '../production-runtime-
|
|
6
|
+
export { a as addMetadataImageReference, m as mergeMetadata, r as renderMetadataHead } from '../metadata-BAPg_Nmo.js';
|
|
7
|
+
export { _ as _runWithMiddlewareContext, b as _runWithMiddlewareData, a as applyProductionMiddlewareHeaders, c as createProductionMiddlewareRunner } from '../production-runtime-BoJDc5mc.js';
|
|
8
8
|
export { g as getFarmRedirectError, i as isFarmNotFoundError, a as isFarmRedirectError } from '../navigation-errors-Dvwpzaer.js';
|
|
9
9
|
export { configureFarmObservability, emitFarmEvent } from '../observability.js';
|
|
10
|
-
import { F as FarmConfig, e as FarmContextFactoryInput } from '../client-plugins-
|
|
10
|
+
import { F as FarmConfig, e as FarmContextFactoryInput } from '../client-plugins-Cw4qUGsw.js';
|
|
11
11
|
import 'node:http';
|
|
12
12
|
import '../types-BH1lhg5G.js';
|
|
13
13
|
import '../plugin-BJDf43dc.js';
|
|
@@ -38,12 +38,13 @@ import {
|
|
|
38
38
|
stripFarmLocaleFromPathname
|
|
39
39
|
} from "../chunk-44ZCFSKE.mjs";
|
|
40
40
|
import {
|
|
41
|
+
configureFarmCache,
|
|
41
42
|
createFarmCacheKey,
|
|
42
43
|
getFarmDataCache,
|
|
43
44
|
normalizeRevalidatePath
|
|
44
|
-
} from "../chunk-
|
|
45
|
+
} from "../chunk-V3XURYJO.mjs";
|
|
45
46
|
import "../chunk-WZ5QFROO.mjs";
|
|
46
|
-
import "../chunk-
|
|
47
|
+
import "../chunk-RBRLLZL5.mjs";
|
|
47
48
|
import {
|
|
48
49
|
configureFarmObservability,
|
|
49
50
|
emitFarmEvent
|
|
@@ -56,6 +57,7 @@ export {
|
|
|
56
57
|
_runWithMiddlewareData,
|
|
57
58
|
addMetadataImageReference,
|
|
58
59
|
applyProductionMiddlewareHeaders,
|
|
60
|
+
configureFarmCache,
|
|
59
61
|
configureFarmObservability,
|
|
60
62
|
createFarmCacheKey,
|
|
61
63
|
createFarmLocaleCookie,
|
package/dist/middleware.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { cm as MiddlewareChain, cq as RateLimitStorage, cr as RateLimitStatus, ch as MiddlewareContext, Y as FarmMiddlewareConfig, ci as MiddlewareFunction, cY as MiddlewareConfig, M as MiddlewareProps } from './client-plugins-
|
|
2
|
-
export { cn as CookieJar, co as CookieOptions, ct as MiddlewareResult, cl as MiddlewareStore, cs as NextFunction, cp as RateLimitConfig, X as ReadonlyMiddlewareStore, cj as RequestMiddleware, ck as RequestMiddlewareContext } from './client-plugins-
|
|
1
|
+
import { cm as MiddlewareChain, cq as RateLimitStorage, cr as RateLimitStatus, ch as MiddlewareContext, Y as FarmMiddlewareConfig, ci as MiddlewareFunction, cY as MiddlewareConfig, M as MiddlewareProps } from './client-plugins-DQQ1adXM.mjs';
|
|
2
|
+
export { cn as CookieJar, co as CookieOptions, ct as MiddlewareResult, cl as MiddlewareStore, cs as NextFunction, cp as RateLimitConfig, X as ReadonlyMiddlewareStore, cj as RequestMiddleware, ck as RequestMiddlewareContext } from './client-plugins-DQQ1adXM.mjs';
|
|
3
3
|
import { IncomingMessage, ServerResponse } from 'http';
|
|
4
4
|
import { ViteDevServer, Plugin } from 'vite';
|
|
5
5
|
import { R as ResolvedFarmI18nConfig } from './types-BH1lhg5G.mjs';
|
|
6
|
-
export { _ as _runWithMiddlewareContext, b as _runWithMiddlewareData, a as applyProductionMiddlewareHeaders, c as createProductionMiddlewareRunner, g as getMiddlewareContext, d as getMiddlewareData, e as getMiddlewareValue } from './production-runtime-
|
|
6
|
+
export { _ as _runWithMiddlewareContext, b as _runWithMiddlewareData, a as applyProductionMiddlewareHeaders, c as createProductionMiddlewareRunner, g as getMiddlewareContext, d as getMiddlewareData, e as getMiddlewareValue } from './production-runtime-DPfgMV9Y.mjs';
|
|
7
7
|
import './plugin-BJDf43dc.mjs';
|
|
8
8
|
import 'react';
|
|
9
9
|
import './types-D1A6-XvH.mjs';
|
|
@@ -20,6 +20,7 @@ import './cron.mjs';
|
|
|
20
20
|
import './env.mjs';
|
|
21
21
|
import './server-action-security.mjs';
|
|
22
22
|
import './image-config-Duob7wER.mjs';
|
|
23
|
+
import './cache.mjs';
|
|
23
24
|
import './route-runtime-DoOHzCAD.mjs';
|
|
24
25
|
|
|
25
26
|
/**
|
package/dist/middleware.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { cm as MiddlewareChain, cq as RateLimitStorage, cr as RateLimitStatus, ch as MiddlewareContext, Y as FarmMiddlewareConfig, ci as MiddlewareFunction, cY as MiddlewareConfig, M as MiddlewareProps } from './client-plugins-
|
|
2
|
-
export { cn as CookieJar, co as CookieOptions, ct as MiddlewareResult, cl as MiddlewareStore, cs as NextFunction, cp as RateLimitConfig, X as ReadonlyMiddlewareStore, cj as RequestMiddleware, ck as RequestMiddlewareContext } from './client-plugins-
|
|
1
|
+
import { cm as MiddlewareChain, cq as RateLimitStorage, cr as RateLimitStatus, ch as MiddlewareContext, Y as FarmMiddlewareConfig, ci as MiddlewareFunction, cY as MiddlewareConfig, M as MiddlewareProps } from './client-plugins-Cw4qUGsw.js';
|
|
2
|
+
export { cn as CookieJar, co as CookieOptions, ct as MiddlewareResult, cl as MiddlewareStore, cs as NextFunction, cp as RateLimitConfig, X as ReadonlyMiddlewareStore, cj as RequestMiddleware, ck as RequestMiddlewareContext } from './client-plugins-Cw4qUGsw.js';
|
|
3
3
|
import { IncomingMessage, ServerResponse } from 'http';
|
|
4
4
|
import { ViteDevServer, Plugin } from 'vite';
|
|
5
5
|
import { R as ResolvedFarmI18nConfig } from './types-BH1lhg5G.js';
|
|
6
|
-
export { _ as _runWithMiddlewareContext, b as _runWithMiddlewareData, a as applyProductionMiddlewareHeaders, c as createProductionMiddlewareRunner, g as getMiddlewareContext, d as getMiddlewareData, e as getMiddlewareValue } from './production-runtime-
|
|
6
|
+
export { _ as _runWithMiddlewareContext, b as _runWithMiddlewareData, a as applyProductionMiddlewareHeaders, c as createProductionMiddlewareRunner, g as getMiddlewareContext, d as getMiddlewareData, e as getMiddlewareValue } from './production-runtime-BoJDc5mc.js';
|
|
7
7
|
import './plugin-BJDf43dc.js';
|
|
8
8
|
import 'react';
|
|
9
9
|
import './types-D1A6-XvH.js';
|
|
@@ -20,6 +20,7 @@ import './cron.js';
|
|
|
20
20
|
import './env.js';
|
|
21
21
|
import './server-action-security.js';
|
|
22
22
|
import './image-config-Duob7wER.js';
|
|
23
|
+
import './cache.js';
|
|
23
24
|
import './route-runtime-DoOHzCAD.js';
|
|
24
25
|
|
|
25
26
|
/**
|
package/dist/navigation.cjs
CHANGED
|
@@ -589,6 +589,7 @@ __name(requireSnapshot, "requireSnapshot");
|
|
|
589
589
|
|
|
590
590
|
// src/client/spa-router.ts
|
|
591
591
|
var FARM_PAGE_STATE_KEY = "__farmPageState";
|
|
592
|
+
var FARM_INTERCEPT_FROM_KEY = "__farmInterceptFrom";
|
|
592
593
|
var IDLE_NAVIGATION_STATE = {
|
|
593
594
|
state: "idle",
|
|
594
595
|
pending: false,
|
|
@@ -659,7 +660,11 @@ var _SPARouter = class _SPARouter {
|
|
|
659
660
|
return;
|
|
660
661
|
}
|
|
661
662
|
const from = window.location.pathname + window.location.search;
|
|
662
|
-
if (await this.shouldBlockNavigation({
|
|
663
|
+
if (await this.shouldBlockNavigation({
|
|
664
|
+
from,
|
|
665
|
+
to: fullPath,
|
|
666
|
+
action: replace ? "replace" : "push"
|
|
667
|
+
})) {
|
|
663
668
|
return;
|
|
664
669
|
}
|
|
665
670
|
if (this.options.scrollRestoration) {
|
|
@@ -677,11 +682,11 @@ var _SPARouter = class _SPARouter {
|
|
|
677
682
|
to: url,
|
|
678
683
|
action: replace ? "replace" : "push"
|
|
679
684
|
});
|
|
680
|
-
const pageData = await this.fetchPageData(fullPath);
|
|
685
|
+
const pageData = await this.fetchPageData(fullPath, true, from);
|
|
681
686
|
if (clientNavigation) {
|
|
682
687
|
await this.clientPlugins?.markNavigationLoaded(clientNavigation, pageData);
|
|
683
688
|
}
|
|
684
|
-
if (pageData.isClientComponent === false) {
|
|
689
|
+
if (pageData.isClientComponent === false && !pageData.interception) {
|
|
685
690
|
this.finishNavigation();
|
|
686
691
|
window.location.assign(pageData.canonicalPath || fullPath);
|
|
687
692
|
return;
|
|
@@ -719,11 +724,12 @@ var _SPARouter = class _SPARouter {
|
|
|
719
724
|
if (isFarmLocaleChangeHref(href)) return;
|
|
720
725
|
const url = new URL(href, window.location.origin);
|
|
721
726
|
const fullPath = url.pathname + url.search;
|
|
727
|
+
const interceptFrom = window.location.pathname + window.location.search;
|
|
722
728
|
if (this.prefetchingUrls.has(fullPath)) return;
|
|
723
|
-
if (this.isCached(fullPath)) return;
|
|
729
|
+
if (this.isCached(fullPath, interceptFrom)) return;
|
|
724
730
|
this.prefetchingUrls.add(fullPath);
|
|
725
731
|
try {
|
|
726
|
-
await this.fetchPageData(fullPath, false);
|
|
732
|
+
await this.fetchPageData(fullPath, false, interceptFrom);
|
|
727
733
|
} catch (error) {
|
|
728
734
|
console.warn("[Farm.js] Prefetch failed:", href, error);
|
|
729
735
|
} finally {
|
|
@@ -798,7 +804,12 @@ var _SPARouter = class _SPARouter {
|
|
|
798
804
|
}
|
|
799
805
|
async commitNavigation(options) {
|
|
800
806
|
const historyPath = options.pageData.canonicalPath || options.fullPath;
|
|
801
|
-
const historyState = createHistoryState(
|
|
807
|
+
const historyState = createHistoryState(
|
|
808
|
+
historyPath,
|
|
809
|
+
options.state,
|
|
810
|
+
void 0,
|
|
811
|
+
options.pageData.interception?.from ?? null
|
|
812
|
+
);
|
|
802
813
|
if (options.replace) {
|
|
803
814
|
window.history.replaceState(historyState, "", historyPath);
|
|
804
815
|
} else {
|
|
@@ -853,15 +864,17 @@ var _SPARouter = class _SPARouter {
|
|
|
853
864
|
/**
|
|
854
865
|
* Fetch page data from cache or server
|
|
855
866
|
*/
|
|
856
|
-
async fetchPageData(path, recover = true) {
|
|
857
|
-
const
|
|
867
|
+
async fetchPageData(path, recover = true, interceptFrom) {
|
|
868
|
+
const cacheKey = getPageDataCacheKey(path, interceptFrom);
|
|
869
|
+
const cached = this.cache.get(cacheKey);
|
|
858
870
|
if (cached && Date.now() - cached.timestamp < this.options.cacheMaxAge) {
|
|
859
871
|
return cached.data;
|
|
860
872
|
}
|
|
861
873
|
const response = await fetch(`/__farm/page-data?path=${encodeURIComponent(path)}`, {
|
|
862
874
|
headers: createFarmDeploymentRequestHeaders(this.options.deploymentId, {
|
|
863
875
|
Accept: "application/x-farm-deferred+json, application/json",
|
|
864
|
-
"X-Farm-SPA": "1"
|
|
876
|
+
"X-Farm-SPA": "1",
|
|
877
|
+
...interceptFrom ? { "X-Farm-Intercept-From": interceptFrom } : {}
|
|
865
878
|
})
|
|
866
879
|
});
|
|
867
880
|
if (isFarmDeploymentMismatchResponse(response, this.options.deploymentId)) {
|
|
@@ -879,7 +892,7 @@ var _SPARouter = class _SPARouter {
|
|
|
879
892
|
throw new Error(`Failed to fetch page data: ${response.status}`);
|
|
880
893
|
}
|
|
881
894
|
const data = await readDeferredDataResponse(response);
|
|
882
|
-
this.cache.set(
|
|
895
|
+
this.cache.set(cacheKey, {
|
|
883
896
|
data,
|
|
884
897
|
timestamp: Date.now()
|
|
885
898
|
});
|
|
@@ -910,7 +923,8 @@ var _SPARouter = class _SPARouter {
|
|
|
910
923
|
to: window.location.href,
|
|
911
924
|
action: "pop"
|
|
912
925
|
});
|
|
913
|
-
const
|
|
926
|
+
const interceptFrom = typeof event.state?.[FARM_INTERCEPT_FROM_KEY] === "string" ? event.state[FARM_INTERCEPT_FROM_KEY] : void 0;
|
|
927
|
+
const pageData = await this.fetchPageData(path, true, interceptFrom);
|
|
914
928
|
if (clientNavigation) {
|
|
915
929
|
await this.clientPlugins?.markNavigationLoaded(clientNavigation, pageData);
|
|
916
930
|
}
|
|
@@ -941,8 +955,8 @@ var _SPARouter = class _SPARouter {
|
|
|
941
955
|
/**
|
|
942
956
|
* Check if URL is cached
|
|
943
957
|
*/
|
|
944
|
-
isCached(path) {
|
|
945
|
-
const cached = this.cache.get(path);
|
|
958
|
+
isCached(path, interceptFrom) {
|
|
959
|
+
const cached = this.cache.get(getPageDataCacheKey(path, interceptFrom));
|
|
946
960
|
return cached !== void 0 && Date.now() - cached.timestamp < this.options.cacheMaxAge;
|
|
947
961
|
}
|
|
948
962
|
/**
|
|
@@ -1082,15 +1096,26 @@ function readPageState() {
|
|
|
1082
1096
|
return state[FARM_PAGE_STATE_KEY] ?? null;
|
|
1083
1097
|
}
|
|
1084
1098
|
__name(readPageState, "readPageState");
|
|
1085
|
-
function createHistoryState(path, pageState, currentState) {
|
|
1099
|
+
function createHistoryState(path, pageState, currentState, interceptFrom) {
|
|
1086
1100
|
const base = currentState && typeof currentState === "object" ? { ...currentState } : {};
|
|
1087
|
-
|
|
1101
|
+
const nextState = {
|
|
1088
1102
|
...base,
|
|
1089
1103
|
path,
|
|
1090
1104
|
[FARM_PAGE_STATE_KEY]: pageState
|
|
1091
1105
|
};
|
|
1106
|
+
if (interceptFrom === null) {
|
|
1107
|
+
delete nextState[FARM_INTERCEPT_FROM_KEY];
|
|
1108
|
+
} else if (interceptFrom) {
|
|
1109
|
+
nextState[FARM_INTERCEPT_FROM_KEY] = interceptFrom;
|
|
1110
|
+
}
|
|
1111
|
+
return nextState;
|
|
1092
1112
|
}
|
|
1093
1113
|
__name(createHistoryState, "createHistoryState");
|
|
1114
|
+
function getPageDataCacheKey(path, interceptFrom) {
|
|
1115
|
+
return interceptFrom ? `${path}
|
|
1116
|
+
intercept:${interceptFrom}` : path;
|
|
1117
|
+
}
|
|
1118
|
+
__name(getPageDataCacheKey, "getPageDataCacheKey");
|
|
1094
1119
|
function createNavigationLocation(url) {
|
|
1095
1120
|
return {
|
|
1096
1121
|
href: url.href,
|