@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.
Files changed (192) 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-5QH4IKY3.mjs → chunk-3U3ZUQAQ.mjs} +2 -2
  30. package/dist/{chunk-6WXJ54TC.mjs → chunk-65A7QIKI.mjs} +5 -5
  31. package/dist/{chunk-6WXJ54TC.mjs.map → chunk-65A7QIKI.mjs.map} +1 -1
  32. package/dist/{chunk-OHC6VCDI.mjs → chunk-AJWRO5WE.mjs} +521 -42
  33. package/dist/chunk-AJWRO5WE.mjs.map +1 -0
  34. package/dist/chunk-ALCLXXTY.mjs +187 -0
  35. package/dist/chunk-ALCLXXTY.mjs.map +1 -0
  36. package/dist/{chunk-XJSHJN4M.mjs → chunk-AOBXKNS5.mjs} +593 -49
  37. package/dist/chunk-AOBXKNS5.mjs.map +1 -0
  38. package/dist/{chunk-CSU4KJJF.mjs → chunk-C2ROET2V.mjs} +2 -2
  39. package/dist/{chunk-BIOIOWXZ.mjs → chunk-HNIQFZKB.mjs} +2 -2
  40. package/dist/{chunk-G5I34UA6.mjs → chunk-JDEOUK5V.mjs} +4 -4
  41. package/dist/{chunk-T543TMFY.mjs → chunk-NM3CRAAL.mjs} +3 -2
  42. package/dist/chunk-NM3CRAAL.mjs.map +1 -0
  43. package/dist/{chunk-LWMGIEJA.mjs → chunk-PFE6GMNE.mjs} +47 -37
  44. package/dist/chunk-PFE6GMNE.mjs.map +1 -0
  45. package/dist/{chunk-6VS6CKAV.mjs → chunk-QM746KUO.mjs} +8 -1
  46. package/dist/chunk-QM746KUO.mjs.map +1 -0
  47. package/dist/{chunk-SHRJG6OG.mjs → chunk-RBRLLZL5.mjs} +18 -3
  48. package/dist/chunk-RBRLLZL5.mjs.map +1 -0
  49. package/dist/{chunk-MH6FKW2I.mjs → chunk-SADGIRS2.mjs} +3 -3
  50. package/dist/{chunk-NRRFGX45.mjs → chunk-TQAEEJB4.mjs} +3 -3
  51. package/dist/{chunk-45LKHSHJ.mjs → chunk-UB5UOSHB.mjs} +24 -12
  52. package/dist/chunk-UB5UOSHB.mjs.map +1 -0
  53. package/dist/chunk-V3XURYJO.mjs +756 -0
  54. package/dist/chunk-V3XURYJO.mjs.map +1 -0
  55. package/dist/{chunk-5FW6PQ3J.mjs → chunk-VVKWFZAH.mjs} +41 -16
  56. package/dist/chunk-VVKWFZAH.mjs.map +1 -0
  57. package/dist/{chunk-HZYXGV4K.mjs → chunk-VY2UYN5R.mjs} +24 -4
  58. package/dist/chunk-VY2UYN5R.mjs.map +1 -0
  59. package/dist/{chunk-C33RALN7.mjs → chunk-W2CRQFF6.mjs} +79 -15
  60. package/dist/chunk-W2CRQFF6.mjs.map +1 -0
  61. package/dist/{chunk-JNYVN7YP.mjs → chunk-W4UIVMVI.mjs} +2 -2
  62. package/dist/{chunk-JNYVN7YP.mjs.map → chunk-W4UIVMVI.mjs.map} +1 -1
  63. package/dist/{chunk-LG3YINQN.mjs → chunk-Z5CQMP54.mjs} +3 -3
  64. package/dist/{client-DiViK9yK.d.mts → client-BT1mFQas.d.mts} +23 -4
  65. package/dist/{client-DpEBJbts.d.ts → client-Nn0q4eO4.d.ts} +23 -4
  66. package/dist/{client-plugins-CTnsZz_A.d.ts → client-plugins-Cw4qUGsw.d.ts} +6 -0
  67. package/dist/{client-plugins-Cnr0D3kk.d.mts → client-plugins-DQQ1adXM.d.mts} +6 -0
  68. package/dist/client-plugins.d.mts +2 -1
  69. package/dist/client-plugins.d.ts +2 -1
  70. package/dist/client.cjs +665 -82
  71. package/dist/client.cjs.map +1 -1
  72. package/dist/client.d.mts +70 -4
  73. package/dist/client.d.ts +70 -4
  74. package/dist/client.mjs +10 -7
  75. package/dist/config.d.mts +2 -1
  76. package/dist/config.d.ts +2 -1
  77. package/dist/{devtools-HE4FTUDN.mjs → devtools-LVC3VB5P.mjs} +4 -4
  78. package/dist/docs.cjs +11 -1
  79. package/dist/docs.cjs.map +1 -1
  80. package/dist/docs.mjs +4 -4
  81. package/dist/index.cjs +2112 -197
  82. package/dist/index.cjs.map +1 -1
  83. package/dist/index.d.mts +12 -11
  84. package/dist/index.d.ts +12 -11
  85. package/dist/index.mjs +49 -21
  86. package/dist/index.mjs.map +1 -1
  87. package/dist/integrations.d.mts +2 -1
  88. package/dist/integrations.d.ts +2 -1
  89. package/dist/internal/build-runtime.cjs +1455 -90
  90. package/dist/internal/build-runtime.cjs.map +1 -1
  91. package/dist/internal/build-runtime.d.mts +4 -3
  92. package/dist/internal/build-runtime.d.ts +4 -3
  93. package/dist/internal/build-runtime.mjs +15 -14
  94. package/dist/internal/config-runtime.cjs +12 -1
  95. package/dist/internal/config-runtime.cjs.map +1 -1
  96. package/dist/internal/config-runtime.d.mts +3 -2
  97. package/dist/internal/config-runtime.d.ts +3 -2
  98. package/dist/internal/config-runtime.mjs +3 -3
  99. package/dist/internal/production-runtime.cjs +282 -6
  100. package/dist/internal/production-runtime.cjs.map +1 -1
  101. package/dist/internal/production-runtime.d.mts +4 -4
  102. package/dist/internal/production-runtime.d.ts +4 -4
  103. package/dist/internal/production-runtime.mjs +4 -2
  104. package/dist/{metadata-eoVmHoyv.d.ts → metadata-BAPg_Nmo.d.ts} +1 -1
  105. package/dist/{metadata-Dp8AdvsB.d.mts → metadata-_6i9oFG3.d.mts} +1 -1
  106. package/dist/middleware.d.mts +4 -3
  107. package/dist/middleware.d.ts +4 -3
  108. package/dist/navigation.cjs +40 -15
  109. package/dist/navigation.cjs.map +1 -1
  110. package/dist/navigation.mjs +2 -2
  111. package/dist/plugin.cjs +913 -53
  112. package/dist/plugin.cjs.map +1 -1
  113. package/dist/plugin.d.mts +2 -1
  114. package/dist/plugin.d.ts +2 -1
  115. package/dist/plugin.mjs +11 -10
  116. package/dist/{production-runtime-BqTnUTai.d.ts → production-runtime-BoJDc5mc.d.ts} +1 -1
  117. package/dist/{production-runtime-DtDdG9fc.d.mts → production-runtime-DPfgMV9Y.d.mts} +1 -1
  118. package/dist/routes.cjs +276 -6
  119. package/dist/routes.cjs.map +1 -1
  120. package/dist/routes.d.mts +1 -1
  121. package/dist/routes.d.ts +1 -1
  122. package/dist/routes.mjs +3 -3
  123. package/dist/{runtime-C1B7pSGT.d.mts → runtime-9nQjVM7X.d.mts} +8 -9
  124. package/dist/{runtime-CdPHt0bv.d.ts → runtime-DgeS2skB.d.ts} +8 -9
  125. package/dist/server-action-security.cjs +28 -10
  126. package/dist/server-action-security.cjs.map +1 -1
  127. package/dist/server-action-security.d.mts +2 -1
  128. package/dist/server-action-security.d.ts +2 -1
  129. package/dist/server-action-security.mjs +2 -2
  130. package/dist/server-fn-client.d.mts +1 -0
  131. package/dist/server-fn-client.d.ts +1 -0
  132. package/dist/server-fn.cjs +785 -3
  133. package/dist/server-fn.cjs.map +1 -1
  134. package/dist/server-fn.d.mts +10 -1
  135. package/dist/server-fn.d.ts +10 -1
  136. package/dist/server-fn.mjs +6 -3
  137. package/dist/server-plugins.d.mts +3 -2
  138. package/dist/server-plugins.d.ts +3 -2
  139. package/dist/server-query-client.cjs +278 -7
  140. package/dist/server-query-client.cjs.map +1 -1
  141. package/dist/server-query-client.mjs +4 -4
  142. package/dist/server-query.cjs +381 -10
  143. package/dist/server-query.cjs.map +1 -1
  144. package/dist/server-query.mjs +5 -5
  145. package/dist/server.cjs +1086 -76
  146. package/dist/server.cjs.map +1 -1
  147. package/dist/server.d.mts +8 -7
  148. package/dist/server.d.ts +8 -7
  149. package/dist/server.mjs +31 -16
  150. package/dist/server.mjs.map +1 -1
  151. package/dist/testing.cjs +341 -20
  152. package/dist/testing.cjs.map +1 -1
  153. package/dist/testing.d.mts +3 -2
  154. package/dist/testing.d.ts +3 -2
  155. package/dist/testing.mjs +7 -6
  156. package/dist/testing.mjs.map +1 -1
  157. package/dist/transport-BmbGTXA5.d.mts +49 -0
  158. package/dist/transport-BmbGTXA5.d.ts +49 -0
  159. package/dist/{utils-8USa5BiY.d.mts → utils-CHXlMDkg.d.mts} +1 -1
  160. package/dist/{utils-DKJb6K6G.d.ts → utils-Drsyz1Vj.d.ts} +1 -1
  161. package/dist/version.cjs +1 -1
  162. package/dist/version.cjs.map +1 -1
  163. package/dist/version.mjs +1 -1
  164. package/dist/vite.cjs +914 -54
  165. package/dist/vite.cjs.map +1 -1
  166. package/dist/vite.d.mts +2 -1
  167. package/dist/vite.d.ts +2 -1
  168. package/dist/vite.mjs +11 -10
  169. package/package.json +1 -1
  170. package/types/api.d.ts +44 -0
  171. package/types/client.d.ts +85 -4
  172. package/dist/chunk-45LKHSHJ.mjs.map +0 -1
  173. package/dist/chunk-5FW6PQ3J.mjs.map +0 -1
  174. package/dist/chunk-6VS6CKAV.mjs.map +0 -1
  175. package/dist/chunk-C33RALN7.mjs.map +0 -1
  176. package/dist/chunk-GZWT6VI5.mjs +0 -382
  177. package/dist/chunk-GZWT6VI5.mjs.map +0 -1
  178. package/dist/chunk-HZYXGV4K.mjs.map +0 -1
  179. package/dist/chunk-LWMGIEJA.mjs.map +0 -1
  180. package/dist/chunk-OHC6VCDI.mjs.map +0 -1
  181. package/dist/chunk-SHRJG6OG.mjs.map +0 -1
  182. package/dist/chunk-T543TMFY.mjs.map +0 -1
  183. package/dist/chunk-XJSHJN4M.mjs.map +0 -1
  184. package/dist/chunk-XUBZ7JI4.mjs.map +0 -1
  185. /package/dist/{chunk-5QH4IKY3.mjs.map → chunk-3U3ZUQAQ.mjs.map} +0 -0
  186. /package/dist/{chunk-CSU4KJJF.mjs.map → chunk-C2ROET2V.mjs.map} +0 -0
  187. /package/dist/{chunk-BIOIOWXZ.mjs.map → chunk-HNIQFZKB.mjs.map} +0 -0
  188. /package/dist/{chunk-G5I34UA6.mjs.map → chunk-JDEOUK5V.mjs.map} +0 -0
  189. /package/dist/{chunk-MH6FKW2I.mjs.map → chunk-SADGIRS2.mjs.map} +0 -0
  190. /package/dist/{chunk-NRRFGX45.mjs.map → chunk-TQAEEJB4.mjs.map} +0 -0
  191. /package/dist/{chunk-LG3YINQN.mjs.map → chunk-Z5CQMP54.mjs.map} +0 -0
  192. /package/dist/{devtools-HE4FTUDN.mjs.map → devtools-LVC3VB5P.mjs.map} +0 -0
package/dist/client.d.mts CHANGED
@@ -1,8 +1,9 @@
1
- import { n as ClientOptions, e as APIResult } from './client-DiViK9yK.mjs';
2
- export { p as APIClient, f as APIClientError, A as APIClientOptions, g as APIClientSystemError, a as APIClientWithoutIntegrationsOptions, U as InferIntegrationOperationBody, V as InferIntegrationOperationQuery, W as InferIntegrationOperationResponse, N as IntegrationAPI, H as IntegrationClient, J as IntegrationClientAliases, Q as IntegrationClientData, v as IntegrationClientError, L as IntegrationClientOptions, M as IntegrationClientRequestOptions, K as IntegrationClientRoot, P as IntegrationClients, T as IntegrationOperationResult, X as IntegrationServerClient, Y as IntegrationServerClientAliases, Z as IntegrationServerClientOptions, _ as IntegrationServerClientRequestOptions, $ as IntegrationServerClientRoot, a0 as IntegrationServerRequestLike, o as RouteAPIClient, q as ServerAPIClient, S as ServerAPIClientOptions, b as ServerAPIClientWithoutIntegrationsOptions, r as createAPIClient, w as createIntegrationApi, u as createIntegrationClient, x as createIntegrationClients, z as createIntegrationServerClient, y as createIntegrations, t as createServerAPIClient, B as getIntegrationAPIManifest, D as integrationClients, E as integrationsClient, G as integrationsServer } from './client-DiViK9yK.mjs';
1
+ import { p as ClientOptions, g as APIResult } from './client-BT1mFQas.mjs';
2
+ export { r as APIClient, h as APIClientError, b as APIClientOptions, i as APIClientSystemError, c as APIClientWithoutIntegrationsOptions, X as InferIntegrationOperationBody, Y as InferIntegrationOperationQuery, Z as InferIntegrationOperationResponse, T as IntegrationAPI, L as IntegrationClient, M as IntegrationClientAliases, V as IntegrationClientData, y as IntegrationClientError, P as IntegrationClientOptions, Q as IntegrationClientRequestOptions, N as IntegrationClientRoot, U as IntegrationClients, W as IntegrationOperationResult, _ as IntegrationServerClient, $ as IntegrationServerClientAliases, a0 as IntegrationServerClientOptions, a1 as IntegrationServerClientRequestOptions, a2 as IntegrationServerClientRoot, a3 as IntegrationServerRequestLike, q as RouteAPIClient, s as ServerAPIClient, S as ServerAPIClientOptions, d as ServerAPIClientWithoutIntegrationsOptions, t as createAPIClient, z as createIntegrationApi, x as createIntegrationClient, B as createIntegrationClients, E as createIntegrationServerClient, D as createIntegrations, w as createServerAPIClient, G as getIntegrationAPIManifest, H as integrationClients, J as integrationsClient, K as integrationsServer } from './client-BT1mFQas.mjs';
3
+ export { F as FarmAPIStream } from './transport-BmbGTXA5.mjs';
4
+ import React__default, { ComponentType, FormHTMLAttributes, FormEvent, AnchorHTMLAttributes, RefObject } from 'react';
3
5
  export { ServerQueryFetchOptions, UseServerQueryOptions, UseServerQueryResult, fetchServerQuery, prefetchServerQuery, useServerQuery } from './server-query-client.mjs';
4
6
  export { F as FarmIntegrationAPI, e as FarmIntegrationAPIBodyFormat, f as FarmIntegrationAPIMethod, a as FarmIntegrationAPIOperation, g as FarmIntegrationAPIResponseFormat, b as api, d as defineIntegrationAPI, c as defineIntegrationAPIOperation, i as endpoint } from './integration-api-CHT2OKAf.mjs';
5
- import React__default, { AnchorHTMLAttributes, RefObject } from 'react';
6
7
  import { FarmRouterPathParams, FarmRouterPathParam, FarmRouterBuildOptions, FarmRouterRouteInput } from './router.mjs';
7
8
  import { F as FarmClientPluginManager } from './plugin-BJDf43dc.mjs';
8
9
  export { a as FarmClientHydrationCompleteEvent, b as FarmClientHydrationEvent, d as FarmClientHydrationMode, e as FarmClientHydrationSession, f as FarmClientLocation, g as FarmClientNavigationAction, h as FarmClientNavigationErrorEvent, i as FarmClientNavigationEvent, j as FarmClientNavigationLoadedEvent, k as FarmClientNavigationResolvedEvent, l as FarmClientNavigationSession, m as FarmClientPerformanceEvent, n as FarmClientPlugin, o as FarmClientPluginCloseEvent, p as FarmClientPluginEnforce, q as FarmClientPluginErrorEvent, r as FarmClientPluginErrorPhase, s as FarmClientPluginManagerOptions, t as FarmClientPluginMetadata, u as FarmClientPluginRegistration, v as FarmClientPluginRouter, w as FarmClientPluginSetupEvent, x as FarmClientPluginStateEvent, c as createClientPluginManager } from './plugin-BJDf43dc.mjs';
@@ -64,6 +65,55 @@ type UseMutationReturn<TTarget extends AnyMutationTarget, TData = MutationData<T
64
65
  */
65
66
  declare function useMutation<TTarget extends AnyMutationTarget>(target: TTarget, options?: UseMutationOptions<MutationInput<TTarget>, MutationData<TTarget>, MutationError<TTarget>>): UseMutationReturn<TTarget>;
66
67
 
68
+ type FetcherState = "idle" | "submitting";
69
+ type FetcherFormDataContext = {
70
+ form: HTMLFormElement | null;
71
+ submitter: HTMLElement | null;
72
+ };
73
+ type UseFetcherOptions<TTarget extends AnyMutationTarget> = UseMutationOptions<InferMutationVariables<TTarget>, InferMutationData<TTarget>, InferMutationError<TTarget>> & {
74
+ /**
75
+ * Convert browser FormData into the target's typed variables.
76
+ *
77
+ * Generated API routes default to `{ body: Object.fromEntries(formData) }`
78
+ * (or `{ query: ... }` for GET/HEAD). Server functions receive FormData
79
+ * directly so their input schema remains authoritative.
80
+ */
81
+ mapFormData?: (formData: FormData, context: FetcherFormDataContext) => InferMutationVariables<TTarget>;
82
+ };
83
+ type FetcherFormProps = Omit<FormHTMLAttributes<HTMLFormElement>, "action" | "onSubmit"> & {
84
+ /**
85
+ * Override the native form fallback. By default server functions remain the
86
+ * action and generated GET/POST API routes use their real URL.
87
+ */
88
+ action?: string | ((formData: FormData) => void | Promise<void>);
89
+ onSubmit?: (event: FormEvent<HTMLFormElement>) => void;
90
+ };
91
+ type FetcherInput<TTarget extends AnyMutationTarget> = InferMutationVariables<TTarget> | FormData;
92
+ type FetcherSubmitAsync<TTarget extends AnyMutationTarget> = [
93
+ ] extends Parameters<TTarget> ? (input?: FetcherInput<TTarget>) => Promise<InferMutationData<TTarget>> : (input: FetcherInput<TTarget>) => Promise<InferMutationData<TTarget>>;
94
+ type FetcherSubmit<TTarget extends AnyMutationTarget> = [
95
+ ] extends Parameters<TTarget> ? (input?: FetcherInput<TTarget>) => void : (input: FetcherInput<TTarget>) => void;
96
+ type UseFetcherReturn<TTarget extends AnyMutationTarget> = {
97
+ state: FetcherState;
98
+ status: MutationStatus;
99
+ pending: boolean;
100
+ data: InferMutationData<TTarget> | null;
101
+ error: InferMutationError<TTarget> | null;
102
+ variables: InferMutationVariables<TTarget> | undefined;
103
+ formData: FormData | null;
104
+ submit: FetcherSubmit<TTarget>;
105
+ submitAsync: FetcherSubmitAsync<TTarget>;
106
+ Form: ComponentType<FetcherFormProps>;
107
+ reset: () => void;
108
+ };
109
+ /**
110
+ * Run a typed server function or generated API operation without navigating.
111
+ *
112
+ * `fetcher.Form` progressively keeps a server function as the native form
113
+ * action, while hydration intercepts submissions into this fetcher lifecycle.
114
+ */
115
+ declare function useFetcher<TTarget extends AnyMutationTarget>(target: TTarget, options?: UseFetcherOptions<TTarget>): UseFetcherReturn<TTarget>;
116
+
67
117
  type StoreState = Record<string, any>;
68
118
  type StoreValueUpdater<T> = T | ((previous: T) => T);
69
119
  type StorePatch<T extends StoreState> = Partial<T> | ((state: T) => Partial<T>);
@@ -118,8 +168,24 @@ interface PageData {
118
168
  description?: string;
119
169
  };
120
170
  layoutModules?: string[];
171
+ routeSlots?: RouteSlotPageData[];
172
+ interception?: {
173
+ from?: string;
174
+ slots: string[];
175
+ };
121
176
  i18n?: FarmI18nClientSnapshot;
122
177
  }
178
+ interface RouteSlotPageData {
179
+ name: string;
180
+ ownerPattern: string;
181
+ containerId: string;
182
+ interception: boolean;
183
+ fallback: boolean;
184
+ modulePath: string;
185
+ isClientComponent: boolean;
186
+ shouldHydrate: boolean;
187
+ props: Record<string, any>;
188
+ }
123
189
  interface RouterOptions {
124
190
  prefetchTimeout?: number;
125
191
  cacheMaxAge?: number;
@@ -378,4 +444,4 @@ declare function useNavigation(): FarmNavigationState;
378
444
  declare function useBlocker(options: UseBlockerOptions): UseBlockerReturn;
379
445
  declare function useScrollRestoration<TElement extends HTMLElement = HTMLElement>(key: string): RefObject<TElement>;
380
446
 
381
- export { type DefaultRouteHref, type DefaultRoutePath, type DefaultRoutePattern, type ExternalHref, FarmClientPluginManager, type FarmNavigateOptions, type FarmNavigationBlocker, type FarmNavigationBlockerContext, type FarmNavigationListener, type FarmNavigationLocation, type FarmNavigationState, type FarmViewTransitionMode, type InferMutationData, type InferMutationError, type InferMutationVariables, Link, type LinkDefaultRoute, type LinkProps, type MutationAsync, type MutationOptimisticContext, type MutationStatus, type MutationTrigger, type PrefetchBehavior, type RouteHref, type RouteOptionalParamValue, type RouteParamValue, type RouteParams, SPARouter, type Store, type StoreApi, type StoreFields, type StoreKeyListener, type StoreKeysListener, type StoreListener, type StorePatch, type StoreState, type StoreValueUpdater, type UseBlockerOptions, type UseBlockerReturn, type UseMutationOptions, type UseMutationReturn, type UseRouterOptions, createStore, getRouter, navigateTo, prefetch, pushState, readPageState, replaceState, useBlocker, useMutation, useNavigation, usePageState, useRouter, useScrollRestoration };
447
+ export { type AnyMutationTarget, type DefaultRouteHref, type DefaultRoutePath, type DefaultRoutePattern, type ExternalHref, FarmClientPluginManager, type FarmNavigateOptions, type FarmNavigationBlocker, type FarmNavigationBlockerContext, type FarmNavigationListener, type FarmNavigationLocation, type FarmNavigationState, type FarmViewTransitionMode, type FetcherFormDataContext, type FetcherFormProps, type FetcherState, type FetcherSubmit, type FetcherSubmitAsync, type InferMutationData, type InferMutationError, type InferMutationVariables, Link, type LinkDefaultRoute, type LinkProps, type MutationAsync, type MutationOptimisticContext, type MutationStatus, type MutationTrigger, type PrefetchBehavior, type RouteHref, type RouteOptionalParamValue, type RouteParamValue, type RouteParams, SPARouter, type Store, type StoreApi, type StoreFields, type StoreKeyListener, type StoreKeysListener, type StoreListener, type StorePatch, type StoreState, type StoreValueUpdater, type UseBlockerOptions, type UseBlockerReturn, type UseFetcherOptions, type UseFetcherReturn, type UseMutationOptions, type UseMutationReturn, type UseRouterOptions, createStore, getRouter, navigateTo, prefetch, pushState, readPageState, replaceState, useBlocker, useFetcher, useMutation, useNavigation, usePageState, useRouter, useScrollRestoration };
package/dist/client.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { n as ClientOptions, e as APIResult } from './client-DpEBJbts.js';
2
- export { p as APIClient, f as APIClientError, A as APIClientOptions, g as APIClientSystemError, a as APIClientWithoutIntegrationsOptions, U as InferIntegrationOperationBody, V as InferIntegrationOperationQuery, W as InferIntegrationOperationResponse, N as IntegrationAPI, H as IntegrationClient, J as IntegrationClientAliases, Q as IntegrationClientData, v as IntegrationClientError, L as IntegrationClientOptions, M as IntegrationClientRequestOptions, K as IntegrationClientRoot, P as IntegrationClients, T as IntegrationOperationResult, X as IntegrationServerClient, Y as IntegrationServerClientAliases, Z as IntegrationServerClientOptions, _ as IntegrationServerClientRequestOptions, $ as IntegrationServerClientRoot, a0 as IntegrationServerRequestLike, o as RouteAPIClient, q as ServerAPIClient, S as ServerAPIClientOptions, b as ServerAPIClientWithoutIntegrationsOptions, r as createAPIClient, w as createIntegrationApi, u as createIntegrationClient, x as createIntegrationClients, z as createIntegrationServerClient, y as createIntegrations, t as createServerAPIClient, B as getIntegrationAPIManifest, D as integrationClients, E as integrationsClient, G as integrationsServer } from './client-DpEBJbts.js';
1
+ import { p as ClientOptions, g as APIResult } from './client-Nn0q4eO4.js';
2
+ export { r as APIClient, h as APIClientError, b as APIClientOptions, i as APIClientSystemError, c as APIClientWithoutIntegrationsOptions, X as InferIntegrationOperationBody, Y as InferIntegrationOperationQuery, Z as InferIntegrationOperationResponse, T as IntegrationAPI, L as IntegrationClient, M as IntegrationClientAliases, V as IntegrationClientData, y as IntegrationClientError, P as IntegrationClientOptions, Q as IntegrationClientRequestOptions, N as IntegrationClientRoot, U as IntegrationClients, W as IntegrationOperationResult, _ as IntegrationServerClient, $ as IntegrationServerClientAliases, a0 as IntegrationServerClientOptions, a1 as IntegrationServerClientRequestOptions, a2 as IntegrationServerClientRoot, a3 as IntegrationServerRequestLike, q as RouteAPIClient, s as ServerAPIClient, S as ServerAPIClientOptions, d as ServerAPIClientWithoutIntegrationsOptions, t as createAPIClient, z as createIntegrationApi, x as createIntegrationClient, B as createIntegrationClients, E as createIntegrationServerClient, D as createIntegrations, w as createServerAPIClient, G as getIntegrationAPIManifest, H as integrationClients, J as integrationsClient, K as integrationsServer } from './client-Nn0q4eO4.js';
3
+ export { F as FarmAPIStream } from './transport-BmbGTXA5.js';
4
+ import React__default, { ComponentType, FormHTMLAttributes, FormEvent, AnchorHTMLAttributes, RefObject } from 'react';
3
5
  export { ServerQueryFetchOptions, UseServerQueryOptions, UseServerQueryResult, fetchServerQuery, prefetchServerQuery, useServerQuery } from './server-query-client.js';
4
6
  export { F as FarmIntegrationAPI, e as FarmIntegrationAPIBodyFormat, f as FarmIntegrationAPIMethod, a as FarmIntegrationAPIOperation, g as FarmIntegrationAPIResponseFormat, b as api, d as defineIntegrationAPI, c as defineIntegrationAPIOperation, i as endpoint } from './integration-api-CHT2OKAf.js';
5
- import React__default, { AnchorHTMLAttributes, RefObject } from 'react';
6
7
  import { FarmRouterPathParams, FarmRouterPathParam, FarmRouterBuildOptions, FarmRouterRouteInput } from './router.js';
7
8
  import { F as FarmClientPluginManager } from './plugin-BJDf43dc.js';
8
9
  export { a as FarmClientHydrationCompleteEvent, b as FarmClientHydrationEvent, d as FarmClientHydrationMode, e as FarmClientHydrationSession, f as FarmClientLocation, g as FarmClientNavigationAction, h as FarmClientNavigationErrorEvent, i as FarmClientNavigationEvent, j as FarmClientNavigationLoadedEvent, k as FarmClientNavigationResolvedEvent, l as FarmClientNavigationSession, m as FarmClientPerformanceEvent, n as FarmClientPlugin, o as FarmClientPluginCloseEvent, p as FarmClientPluginEnforce, q as FarmClientPluginErrorEvent, r as FarmClientPluginErrorPhase, s as FarmClientPluginManagerOptions, t as FarmClientPluginMetadata, u as FarmClientPluginRegistration, v as FarmClientPluginRouter, w as FarmClientPluginSetupEvent, x as FarmClientPluginStateEvent, c as createClientPluginManager } from './plugin-BJDf43dc.js';
@@ -64,6 +65,55 @@ type UseMutationReturn<TTarget extends AnyMutationTarget, TData = MutationData<T
64
65
  */
65
66
  declare function useMutation<TTarget extends AnyMutationTarget>(target: TTarget, options?: UseMutationOptions<MutationInput<TTarget>, MutationData<TTarget>, MutationError<TTarget>>): UseMutationReturn<TTarget>;
66
67
 
68
+ type FetcherState = "idle" | "submitting";
69
+ type FetcherFormDataContext = {
70
+ form: HTMLFormElement | null;
71
+ submitter: HTMLElement | null;
72
+ };
73
+ type UseFetcherOptions<TTarget extends AnyMutationTarget> = UseMutationOptions<InferMutationVariables<TTarget>, InferMutationData<TTarget>, InferMutationError<TTarget>> & {
74
+ /**
75
+ * Convert browser FormData into the target's typed variables.
76
+ *
77
+ * Generated API routes default to `{ body: Object.fromEntries(formData) }`
78
+ * (or `{ query: ... }` for GET/HEAD). Server functions receive FormData
79
+ * directly so their input schema remains authoritative.
80
+ */
81
+ mapFormData?: (formData: FormData, context: FetcherFormDataContext) => InferMutationVariables<TTarget>;
82
+ };
83
+ type FetcherFormProps = Omit<FormHTMLAttributes<HTMLFormElement>, "action" | "onSubmit"> & {
84
+ /**
85
+ * Override the native form fallback. By default server functions remain the
86
+ * action and generated GET/POST API routes use their real URL.
87
+ */
88
+ action?: string | ((formData: FormData) => void | Promise<void>);
89
+ onSubmit?: (event: FormEvent<HTMLFormElement>) => void;
90
+ };
91
+ type FetcherInput<TTarget extends AnyMutationTarget> = InferMutationVariables<TTarget> | FormData;
92
+ type FetcherSubmitAsync<TTarget extends AnyMutationTarget> = [
93
+ ] extends Parameters<TTarget> ? (input?: FetcherInput<TTarget>) => Promise<InferMutationData<TTarget>> : (input: FetcherInput<TTarget>) => Promise<InferMutationData<TTarget>>;
94
+ type FetcherSubmit<TTarget extends AnyMutationTarget> = [
95
+ ] extends Parameters<TTarget> ? (input?: FetcherInput<TTarget>) => void : (input: FetcherInput<TTarget>) => void;
96
+ type UseFetcherReturn<TTarget extends AnyMutationTarget> = {
97
+ state: FetcherState;
98
+ status: MutationStatus;
99
+ pending: boolean;
100
+ data: InferMutationData<TTarget> | null;
101
+ error: InferMutationError<TTarget> | null;
102
+ variables: InferMutationVariables<TTarget> | undefined;
103
+ formData: FormData | null;
104
+ submit: FetcherSubmit<TTarget>;
105
+ submitAsync: FetcherSubmitAsync<TTarget>;
106
+ Form: ComponentType<FetcherFormProps>;
107
+ reset: () => void;
108
+ };
109
+ /**
110
+ * Run a typed server function or generated API operation without navigating.
111
+ *
112
+ * `fetcher.Form` progressively keeps a server function as the native form
113
+ * action, while hydration intercepts submissions into this fetcher lifecycle.
114
+ */
115
+ declare function useFetcher<TTarget extends AnyMutationTarget>(target: TTarget, options?: UseFetcherOptions<TTarget>): UseFetcherReturn<TTarget>;
116
+
67
117
  type StoreState = Record<string, any>;
68
118
  type StoreValueUpdater<T> = T | ((previous: T) => T);
69
119
  type StorePatch<T extends StoreState> = Partial<T> | ((state: T) => Partial<T>);
@@ -118,8 +168,24 @@ interface PageData {
118
168
  description?: string;
119
169
  };
120
170
  layoutModules?: string[];
171
+ routeSlots?: RouteSlotPageData[];
172
+ interception?: {
173
+ from?: string;
174
+ slots: string[];
175
+ };
121
176
  i18n?: FarmI18nClientSnapshot;
122
177
  }
178
+ interface RouteSlotPageData {
179
+ name: string;
180
+ ownerPattern: string;
181
+ containerId: string;
182
+ interception: boolean;
183
+ fallback: boolean;
184
+ modulePath: string;
185
+ isClientComponent: boolean;
186
+ shouldHydrate: boolean;
187
+ props: Record<string, any>;
188
+ }
123
189
  interface RouterOptions {
124
190
  prefetchTimeout?: number;
125
191
  cacheMaxAge?: number;
@@ -378,4 +444,4 @@ declare function useNavigation(): FarmNavigationState;
378
444
  declare function useBlocker(options: UseBlockerOptions): UseBlockerReturn;
379
445
  declare function useScrollRestoration<TElement extends HTMLElement = HTMLElement>(key: string): RefObject<TElement>;
380
446
 
381
- export { type DefaultRouteHref, type DefaultRoutePath, type DefaultRoutePattern, type ExternalHref, FarmClientPluginManager, type FarmNavigateOptions, type FarmNavigationBlocker, type FarmNavigationBlockerContext, type FarmNavigationListener, type FarmNavigationLocation, type FarmNavigationState, type FarmViewTransitionMode, type InferMutationData, type InferMutationError, type InferMutationVariables, Link, type LinkDefaultRoute, type LinkProps, type MutationAsync, type MutationOptimisticContext, type MutationStatus, type MutationTrigger, type PrefetchBehavior, type RouteHref, type RouteOptionalParamValue, type RouteParamValue, type RouteParams, SPARouter, type Store, type StoreApi, type StoreFields, type StoreKeyListener, type StoreKeysListener, type StoreListener, type StorePatch, type StoreState, type StoreValueUpdater, type UseBlockerOptions, type UseBlockerReturn, type UseMutationOptions, type UseMutationReturn, type UseRouterOptions, createStore, getRouter, navigateTo, prefetch, pushState, readPageState, replaceState, useBlocker, useMutation, useNavigation, usePageState, useRouter, useScrollRestoration };
447
+ export { type AnyMutationTarget, type DefaultRouteHref, type DefaultRoutePath, type DefaultRoutePattern, type ExternalHref, FarmClientPluginManager, type FarmNavigateOptions, type FarmNavigationBlocker, type FarmNavigationBlockerContext, type FarmNavigationListener, type FarmNavigationLocation, type FarmNavigationState, type FarmViewTransitionMode, type FetcherFormDataContext, type FetcherFormProps, type FetcherState, type FetcherSubmit, type FetcherSubmitAsync, type InferMutationData, type InferMutationError, type InferMutationVariables, Link, type LinkDefaultRoute, type LinkProps, type MutationAsync, type MutationOptimisticContext, type MutationStatus, type MutationTrigger, type PrefetchBehavior, type RouteHref, type RouteOptionalParamValue, type RouteParamValue, type RouteParams, SPARouter, type Store, type StoreApi, type StoreFields, type StoreKeyListener, type StoreKeysListener, type StoreListener, type StorePatch, type StoreState, type StoreValueUpdater, type UseBlockerOptions, type UseBlockerReturn, type UseFetcherOptions, type UseFetcherReturn, type UseMutationOptions, type UseMutationReturn, type UseRouterOptions, createStore, getRouter, navigateTo, prefetch, pushState, readPageState, replaceState, useBlocker, useFetcher, useMutation, useNavigation, usePageState, useRouter, useScrollRestoration };
package/dist/client.mjs CHANGED
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  Link,
3
3
  createStore,
4
+ useFetcher,
4
5
  useMutation
5
- } from "./chunk-XUBZ7JI4.mjs";
6
+ } from "./chunk-2CUKEMVR.mjs";
6
7
  import {
7
8
  installChunkErrorRecovery,
8
9
  isChunkLoadError
@@ -11,7 +12,7 @@ import {
11
12
  fetchServerQuery,
12
13
  prefetchServerQuery,
13
14
  useServerQuery
14
- } from "./chunk-MH6FKW2I.mjs";
15
+ } from "./chunk-SADGIRS2.mjs";
15
16
  import {
16
17
  APIClientError,
17
18
  IntegrationClientError,
@@ -26,8 +27,8 @@ import {
26
27
  integrationClients,
27
28
  integrationsClient,
28
29
  integrationsServer
29
- } from "./chunk-C33RALN7.mjs";
30
- import "./chunk-NRRFGX45.mjs";
30
+ } from "./chunk-W2CRQFF6.mjs";
31
+ import "./chunk-TQAEEJB4.mjs";
31
32
  import "./chunk-SCFX4UTD.mjs";
32
33
  import {
33
34
  SPARouter,
@@ -42,7 +43,7 @@ import {
42
43
  usePageState,
43
44
  useRouter,
44
45
  useScrollRestoration
45
- } from "./chunk-5FW6PQ3J.mjs";
46
+ } from "./chunk-VVKWFZAH.mjs";
46
47
  import "./chunk-ITN462YM.mjs";
47
48
  import "./chunk-B232I2GP.mjs";
48
49
  import {
@@ -53,9 +54,10 @@ import {
53
54
  } from "./chunk-JK25YEN6.mjs";
54
55
  import "./chunk-GS6K5OCM.mjs";
55
56
  import "./chunk-44ZCFSKE.mjs";
56
- import "./chunk-GZWT6VI5.mjs";
57
+ import "./chunk-ALCLXXTY.mjs";
58
+ import "./chunk-V3XURYJO.mjs";
57
59
  import "./chunk-WZ5QFROO.mjs";
58
- import "./chunk-SHRJG6OG.mjs";
60
+ import "./chunk-RBRLLZL5.mjs";
59
61
  import "./chunk-7ZY5AIJO.mjs";
60
62
  import "./chunk-ZBE6MLHL.mjs";
61
63
  import {
@@ -97,6 +99,7 @@ export {
97
99
  readPageState,
98
100
  replaceState,
99
101
  useBlocker,
102
+ useFetcher,
100
103
  useMutation,
101
104
  useNavigation,
102
105
  usePageState,
package/dist/config.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { T as FarmUserConfig } from './client-plugins-Cnr0D3kk.mjs';
1
+ import { T as FarmUserConfig } from './client-plugins-DQQ1adXM.mjs';
2
2
  import './plugin-BJDf43dc.mjs';
3
3
  import 'react';
4
4
  import 'http';
@@ -18,6 +18,7 @@ import './env.mjs';
18
18
  import './server-action-security.mjs';
19
19
  import './image-config-Duob7wER.mjs';
20
20
  import './types-BH1lhg5G.mjs';
21
+ import './cache.mjs';
21
22
  import './route-runtime-DoOHzCAD.mjs';
22
23
 
23
24
  /** Define a Farm application config while preserving literal types. */
package/dist/config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { T as FarmUserConfig } from './client-plugins-CTnsZz_A.js';
1
+ import { T as FarmUserConfig } from './client-plugins-Cw4qUGsw.js';
2
2
  import './plugin-BJDf43dc.js';
3
3
  import 'react';
4
4
  import 'http';
@@ -18,6 +18,7 @@ import './env.js';
18
18
  import './server-action-security.js';
19
19
  import './image-config-Duob7wER.js';
20
20
  import './types-BH1lhg5G.js';
21
+ import './cache.js';
21
22
  import './route-runtime-DoOHzCAD.js';
22
23
 
23
24
  /** Define a Farm application config while preserving literal types. */
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  getDeployTargetForPreset
3
- } from "./chunk-T543TMFY.mjs";
3
+ } from "./chunk-NM3CRAAL.mjs";
4
4
  import "./chunk-UVCIEUJC.mjs";
5
5
  import "./chunk-RSKVYESE.mjs";
6
6
  import "./chunk-74YTBPTY.mjs";
7
7
  import "./chunk-7MABZJIM.mjs";
8
8
  import "./chunk-YW7OBE6Q.mjs";
9
9
  import "./chunk-GY2STC2S.mjs";
10
- import "./chunk-45LKHSHJ.mjs";
10
+ import "./chunk-UB5UOSHB.mjs";
11
11
  import "./chunk-LLC7BNXW.mjs";
12
12
  import "./chunk-QGQX7SFC.mjs";
13
13
  import "./chunk-XIVV5IWN.mjs";
@@ -24,7 +24,7 @@ import {
24
24
  } from "./chunk-GQVGIUSN.mjs";
25
25
  import "./chunk-B232I2GP.mjs";
26
26
  import "./chunk-JK25YEN6.mjs";
27
- import "./chunk-SHRJG6OG.mjs";
27
+ import "./chunk-RBRLLZL5.mjs";
28
28
  import {
29
29
  __name
30
30
  } from "./chunk-CGILA3WO.mjs";
@@ -367,4 +367,4 @@ __name(createFarmDevtoolsSnapshot, "createFarmDevtoolsSnapshot");
367
367
  export {
368
368
  createFarmDevtoolsSnapshot
369
369
  };
370
- //# sourceMappingURL=devtools-HE4FTUDN.mjs.map
370
+ //# sourceMappingURL=devtools-LVC3VB5P.mjs.map
package/dist/docs.cjs CHANGED
@@ -4785,7 +4785,8 @@ var FARM_CACHE_INVALIDATION_STATE = /* @__PURE__ */ Symbol.for("farm.cacheInvali
4785
4785
  var globalState = globalThis;
4786
4786
  function getFarmCacheInvalidationState() {
4787
4787
  return globalState[FARM_CACHE_INVALIDATION_STATE] ?? (globalState[FARM_CACHE_INVALIDATION_STATE] = {
4788
- listeners: /* @__PURE__ */ new Set()
4788
+ listeners: /* @__PURE__ */ new Set(),
4789
+ taskListeners: /* @__PURE__ */ new Set()
4789
4790
  });
4790
4791
  }
4791
4792
  __name(getFarmCacheInvalidationState, "getFarmCacheInvalidationState");
@@ -4795,6 +4796,12 @@ function subscribeFarmCacheInvalidation(listener) {
4795
4796
  return () => state.listeners.delete(listener);
4796
4797
  }
4797
4798
  __name(subscribeFarmCacheInvalidation, "subscribeFarmCacheInvalidation");
4799
+ function subscribeFarmCacheTask(listener) {
4800
+ const state = getFarmCacheInvalidationState();
4801
+ state.taskListeners.add(listener);
4802
+ return () => state.taskListeners.delete(listener);
4803
+ }
4804
+ __name(subscribeFarmCacheTask, "subscribeFarmCacheTask");
4798
4805
 
4799
4806
  // src/server-action-security.ts
4800
4807
  var SERVER_ACTION_STORAGE_KEY = /* @__PURE__ */ Symbol.for("farm.serverActionStorage");
@@ -4805,6 +4812,9 @@ __name(getServerActionExecutionContext, "getServerActionExecutionContext");
4805
4812
  subscribeFarmCacheInvalidation((key) => {
4806
4813
  getServerActionExecutionContext()?.invalidations.add(key);
4807
4814
  });
4815
+ subscribeFarmCacheTask((task) => {
4816
+ getServerActionExecutionContext()?.cacheTasks.add(task);
4817
+ });
4808
4818
  function getServerActionStorage() {
4809
4819
  const globalState2 = globalThis;
4810
4820
  if (!globalState2[SERVER_ACTION_STORAGE_KEY]) {