@farm.js/core 0.1.0-beta.3 → 0.1.0-beta.5

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.
Files changed (193) hide show
  1. package/dist/agent-runtime.d.mts +2 -1
  2. package/dist/agent-runtime.d.ts +2 -1
  3. package/dist/api/route-manager.cjs +313 -10
  4. package/dist/api/route-manager.cjs.map +1 -1
  5. package/dist/api/route-manager.d.mts +3 -2
  6. package/dist/api/route-manager.d.ts +3 -2
  7. package/dist/api/route-manager.mjs +6 -5
  8. package/dist/api/runtime.cjs +313 -10
  9. package/dist/api/runtime.cjs.map +1 -1
  10. package/dist/api/runtime.d.mts +2 -1
  11. package/dist/api/runtime.d.ts +2 -1
  12. package/dist/api/runtime.mjs +4 -3
  13. package/dist/api.cjs +642 -57
  14. package/dist/api.cjs.map +1 -1
  15. package/dist/api.d.mts +3 -2
  16. package/dist/api.d.ts +3 -2
  17. package/dist/api.mjs +29 -9
  18. package/dist/{app-DOKxo-LH.d.ts → app-BjN-da13.d.ts} +38 -3
  19. package/dist/{app-BB3Iu3xh.d.mts → app-CakAr8Be.d.mts} +38 -3
  20. package/dist/app-markdown.d.mts +2 -1
  21. package/dist/app-markdown.d.ts +2 -1
  22. package/dist/cache.cjs +395 -12
  23. package/dist/cache.cjs.map +1 -1
  24. package/dist/cache.d.mts +100 -6
  25. package/dist/cache.d.ts +100 -6
  26. package/dist/cache.mjs +8 -2
  27. package/dist/{chunk-XUBZ7JI4.mjs → chunk-2CUKEMVR.mjs} +187 -16
  28. package/dist/chunk-2CUKEMVR.mjs.map +1 -0
  29. package/dist/{chunk-OHC6VCDI.mjs → chunk-2NHCNRF6.mjs} +521 -42
  30. package/dist/chunk-2NHCNRF6.mjs.map +1 -0
  31. package/dist/{chunk-6WXJ54TC.mjs → chunk-65A7QIKI.mjs} +5 -5
  32. package/dist/{chunk-6WXJ54TC.mjs.map → chunk-65A7QIKI.mjs.map} +1 -1
  33. package/dist/{chunk-5QH4IKY3.mjs → chunk-7N62DNSO.mjs} +2 -2
  34. package/dist/{chunk-XJSHJN4M.mjs → chunk-A2LUXHD2.mjs} +593 -49
  35. package/dist/chunk-A2LUXHD2.mjs.map +1 -0
  36. package/dist/chunk-ALCLXXTY.mjs +187 -0
  37. package/dist/chunk-ALCLXXTY.mjs.map +1 -0
  38. package/dist/{chunk-CSU4KJJF.mjs → chunk-C2ROET2V.mjs} +2 -2
  39. package/dist/{chunk-JNYVN7YP.mjs → chunk-EEABSBKK.mjs} +2 -2
  40. package/dist/{chunk-JNYVN7YP.mjs.map → chunk-EEABSBKK.mjs.map} +1 -1
  41. package/dist/{chunk-BIOIOWXZ.mjs → chunk-HNIQFZKB.mjs} +2 -2
  42. package/dist/{chunk-MH6FKW2I.mjs → chunk-J5YWQVI5.mjs} +4 -4
  43. package/dist/chunk-J5YWQVI5.mjs.map +1 -0
  44. package/dist/{chunk-G5I34UA6.mjs → chunk-JDEOUK5V.mjs} +4 -4
  45. package/dist/{chunk-T543TMFY.mjs → chunk-NM3CRAAL.mjs} +3 -2
  46. package/dist/chunk-NM3CRAAL.mjs.map +1 -0
  47. package/dist/{chunk-LWMGIEJA.mjs → chunk-PFE6GMNE.mjs} +47 -37
  48. package/dist/chunk-PFE6GMNE.mjs.map +1 -0
  49. package/dist/{chunk-6VS6CKAV.mjs → chunk-QM746KUO.mjs} +8 -1
  50. package/dist/chunk-QM746KUO.mjs.map +1 -0
  51. package/dist/{chunk-5FW6PQ3J.mjs → chunk-QTZZ2ISQ.mjs} +41 -16
  52. package/dist/chunk-QTZZ2ISQ.mjs.map +1 -0
  53. package/dist/{chunk-SHRJG6OG.mjs → chunk-RBRLLZL5.mjs} +18 -3
  54. package/dist/chunk-RBRLLZL5.mjs.map +1 -0
  55. package/dist/{chunk-NRRFGX45.mjs → chunk-TQAEEJB4.mjs} +3 -3
  56. package/dist/{chunk-45LKHSHJ.mjs → chunk-UB5UOSHB.mjs} +24 -12
  57. package/dist/chunk-UB5UOSHB.mjs.map +1 -0
  58. package/dist/chunk-V3XURYJO.mjs +756 -0
  59. package/dist/chunk-V3XURYJO.mjs.map +1 -0
  60. package/dist/{chunk-HZYXGV4K.mjs → chunk-VY2UYN5R.mjs} +24 -4
  61. package/dist/chunk-VY2UYN5R.mjs.map +1 -0
  62. package/dist/{chunk-C33RALN7.mjs → chunk-W2CRQFF6.mjs} +79 -15
  63. package/dist/chunk-W2CRQFF6.mjs.map +1 -0
  64. package/dist/{chunk-LG3YINQN.mjs → chunk-Z5CQMP54.mjs} +3 -3
  65. package/dist/{client-DiViK9yK.d.mts → client-BT1mFQas.d.mts} +23 -4
  66. package/dist/{client-DpEBJbts.d.ts → client-Nn0q4eO4.d.ts} +23 -4
  67. package/dist/{client-plugins-CTnsZz_A.d.ts → client-plugins-Cw4qUGsw.d.ts} +6 -0
  68. package/dist/{client-plugins-Cnr0D3kk.d.mts → client-plugins-DQQ1adXM.d.mts} +6 -0
  69. package/dist/client-plugins.d.mts +2 -1
  70. package/dist/client-plugins.d.ts +2 -1
  71. package/dist/client.cjs +665 -82
  72. package/dist/client.cjs.map +1 -1
  73. package/dist/client.d.mts +71 -5
  74. package/dist/client.d.ts +71 -5
  75. package/dist/client.mjs +10 -7
  76. package/dist/config.d.mts +2 -1
  77. package/dist/config.d.ts +2 -1
  78. package/dist/{devtools-HE4FTUDN.mjs → devtools-LVC3VB5P.mjs} +4 -4
  79. package/dist/docs.cjs +11 -1
  80. package/dist/docs.cjs.map +1 -1
  81. package/dist/docs.mjs +4 -4
  82. package/dist/index.cjs +2113 -198
  83. package/dist/index.cjs.map +1 -1
  84. package/dist/index.d.mts +16 -16
  85. package/dist/index.d.ts +16 -16
  86. package/dist/index.mjs +49 -21
  87. package/dist/index.mjs.map +1 -1
  88. package/dist/integrations.d.mts +2 -1
  89. package/dist/integrations.d.ts +2 -1
  90. package/dist/internal/build-runtime.cjs +1455 -90
  91. package/dist/internal/build-runtime.cjs.map +1 -1
  92. package/dist/internal/build-runtime.d.mts +4 -3
  93. package/dist/internal/build-runtime.d.ts +4 -3
  94. package/dist/internal/build-runtime.mjs +15 -14
  95. package/dist/internal/config-runtime.cjs +12 -1
  96. package/dist/internal/config-runtime.cjs.map +1 -1
  97. package/dist/internal/config-runtime.d.mts +3 -2
  98. package/dist/internal/config-runtime.d.ts +3 -2
  99. package/dist/internal/config-runtime.mjs +3 -3
  100. package/dist/internal/production-runtime.cjs +282 -6
  101. package/dist/internal/production-runtime.cjs.map +1 -1
  102. package/dist/internal/production-runtime.d.mts +4 -4
  103. package/dist/internal/production-runtime.d.ts +4 -4
  104. package/dist/internal/production-runtime.mjs +4 -2
  105. package/dist/{metadata-eoVmHoyv.d.ts → metadata-BAPg_Nmo.d.ts} +1 -1
  106. package/dist/{metadata-Dp8AdvsB.d.mts → metadata-_6i9oFG3.d.mts} +1 -1
  107. package/dist/middleware.d.mts +4 -3
  108. package/dist/middleware.d.ts +4 -3
  109. package/dist/navigation.cjs +40 -15
  110. package/dist/navigation.cjs.map +1 -1
  111. package/dist/navigation.mjs +2 -2
  112. package/dist/plugin.cjs +913 -53
  113. package/dist/plugin.cjs.map +1 -1
  114. package/dist/plugin.d.mts +2 -1
  115. package/dist/plugin.d.ts +2 -1
  116. package/dist/plugin.mjs +11 -10
  117. package/dist/{production-runtime-BqTnUTai.d.ts → production-runtime-BoJDc5mc.d.ts} +1 -1
  118. package/dist/{production-runtime-DtDdG9fc.d.mts → production-runtime-DPfgMV9Y.d.mts} +1 -1
  119. package/dist/routes.cjs +276 -6
  120. package/dist/routes.cjs.map +1 -1
  121. package/dist/routes.d.mts +1 -1
  122. package/dist/routes.d.ts +1 -1
  123. package/dist/routes.mjs +3 -3
  124. package/dist/{runtime-C1B7pSGT.d.mts → runtime-9nQjVM7X.d.mts} +8 -9
  125. package/dist/{runtime-CdPHt0bv.d.ts → runtime-DgeS2skB.d.ts} +8 -9
  126. package/dist/server-action-security.cjs +28 -10
  127. package/dist/server-action-security.cjs.map +1 -1
  128. package/dist/server-action-security.d.mts +2 -1
  129. package/dist/server-action-security.d.ts +2 -1
  130. package/dist/server-action-security.mjs +2 -2
  131. package/dist/server-fn-client.d.mts +1 -0
  132. package/dist/server-fn-client.d.ts +1 -0
  133. package/dist/server-fn.cjs +785 -3
  134. package/dist/server-fn.cjs.map +1 -1
  135. package/dist/server-fn.d.mts +10 -1
  136. package/dist/server-fn.d.ts +10 -1
  137. package/dist/server-fn.mjs +6 -3
  138. package/dist/server-plugins.d.mts +3 -2
  139. package/dist/server-plugins.d.ts +3 -2
  140. package/dist/server-query-client.cjs +279 -8
  141. package/dist/server-query-client.cjs.map +1 -1
  142. package/dist/server-query-client.mjs +4 -4
  143. package/dist/server-query.cjs +381 -10
  144. package/dist/server-query.cjs.map +1 -1
  145. package/dist/server-query.mjs +5 -5
  146. package/dist/server.cjs +1086 -76
  147. package/dist/server.cjs.map +1 -1
  148. package/dist/server.d.mts +8 -7
  149. package/dist/server.d.ts +8 -7
  150. package/dist/server.mjs +31 -16
  151. package/dist/server.mjs.map +1 -1
  152. package/dist/testing.cjs +341 -20
  153. package/dist/testing.cjs.map +1 -1
  154. package/dist/testing.d.mts +3 -2
  155. package/dist/testing.d.ts +3 -2
  156. package/dist/testing.mjs +7 -6
  157. package/dist/testing.mjs.map +1 -1
  158. package/dist/transport-BmbGTXA5.d.mts +49 -0
  159. package/dist/transport-BmbGTXA5.d.ts +49 -0
  160. package/dist/{utils-8USa5BiY.d.mts → utils-CHXlMDkg.d.mts} +1 -1
  161. package/dist/{utils-DKJb6K6G.d.ts → utils-Drsyz1Vj.d.ts} +1 -1
  162. package/dist/version.cjs +1 -1
  163. package/dist/version.cjs.map +1 -1
  164. package/dist/version.mjs +1 -1
  165. package/dist/vite.cjs +914 -54
  166. package/dist/vite.cjs.map +1 -1
  167. package/dist/vite.d.mts +2 -1
  168. package/dist/vite.d.ts +2 -1
  169. package/dist/vite.mjs +11 -10
  170. package/package.json +1 -1
  171. package/types/api.d.ts +44 -0
  172. package/types/client.d.ts +85 -4
  173. package/dist/chunk-45LKHSHJ.mjs.map +0 -1
  174. package/dist/chunk-5FW6PQ3J.mjs.map +0 -1
  175. package/dist/chunk-6VS6CKAV.mjs.map +0 -1
  176. package/dist/chunk-C33RALN7.mjs.map +0 -1
  177. package/dist/chunk-GZWT6VI5.mjs +0 -382
  178. package/dist/chunk-GZWT6VI5.mjs.map +0 -1
  179. package/dist/chunk-HZYXGV4K.mjs.map +0 -1
  180. package/dist/chunk-LWMGIEJA.mjs.map +0 -1
  181. package/dist/chunk-MH6FKW2I.mjs.map +0 -1
  182. package/dist/chunk-OHC6VCDI.mjs.map +0 -1
  183. package/dist/chunk-SHRJG6OG.mjs.map +0 -1
  184. package/dist/chunk-T543TMFY.mjs.map +0 -1
  185. package/dist/chunk-XJSHJN4M.mjs.map +0 -1
  186. package/dist/chunk-XUBZ7JI4.mjs.map +0 -1
  187. /package/dist/{chunk-5QH4IKY3.mjs.map → chunk-7N62DNSO.mjs.map} +0 -0
  188. /package/dist/{chunk-CSU4KJJF.mjs.map → chunk-C2ROET2V.mjs.map} +0 -0
  189. /package/dist/{chunk-BIOIOWXZ.mjs.map → chunk-HNIQFZKB.mjs.map} +0 -0
  190. /package/dist/{chunk-G5I34UA6.mjs.map → chunk-JDEOUK5V.mjs.map} +0 -0
  191. /package/dist/{chunk-NRRFGX45.mjs.map → chunk-TQAEEJB4.mjs.map} +0 -0
  192. /package/dist/{chunk-LG3YINQN.mjs.map → chunk-Z5CQMP54.mjs.map} +0 -0
  193. /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-Dp8AdvsB.mjs';
7
- export { _ as _runWithMiddlewareContext, b as _runWithMiddlewareData, a as applyProductionMiddlewareHeaders, c as createProductionMiddlewareRunner } from '../production-runtime-DtDdG9fc.mjs';
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-Cnr0D3kk.mjs';
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-eoVmHoyv.js';
7
- export { _ as _runWithMiddlewareContext, b as _runWithMiddlewareData, a as applyProductionMiddlewareHeaders, c as createProductionMiddlewareRunner } from '../production-runtime-BqTnUTai.js';
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-CTnsZz_A.js';
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-GZWT6VI5.mjs";
45
+ } from "../chunk-V3XURYJO.mjs";
45
46
  import "../chunk-WZ5QFROO.mjs";
46
- import "../chunk-SHRJG6OG.mjs";
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,
@@ -1,4 +1,4 @@
1
- import { s as Metadata } from './client-plugins-CTnsZz_A.js';
1
+ import { s as Metadata } from './client-plugins-Cw4qUGsw.js';
2
2
 
3
3
  type MetadataImageKind = "opengraph" | "twitter";
4
4
  interface FarmMetadataImageReference {
@@ -1,4 +1,4 @@
1
- import { s as Metadata } from './client-plugins-Cnr0D3kk.mjs';
1
+ import { s as Metadata } from './client-plugins-DQQ1adXM.mjs';
2
2
 
3
3
  type MetadataImageKind = "opengraph" | "twitter";
4
4
  interface FarmMetadataImageReference {
@@ -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-Cnr0D3kk.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-Cnr0D3kk.mjs';
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-DtDdG9fc.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-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
  /**
@@ -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-CTnsZz_A.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-CTnsZz_A.js';
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-BqTnUTai.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-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
  /**
@@ -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({ from, to: fullPath, action: replace ? "replace" : "push" })) {
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(historyPath, options.state);
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 cached = this.cache.get(path);
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(path, {
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 pageData = await this.fetchPageData(path);
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
- return {
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,