@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.
- 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-OHC6VCDI.mjs → chunk-2NHCNRF6.mjs} +521 -42
- package/dist/chunk-2NHCNRF6.mjs.map +1 -0
- 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-5QH4IKY3.mjs → chunk-7N62DNSO.mjs} +2 -2
- package/dist/{chunk-XJSHJN4M.mjs → chunk-A2LUXHD2.mjs} +593 -49
- package/dist/chunk-A2LUXHD2.mjs.map +1 -0
- package/dist/chunk-ALCLXXTY.mjs +187 -0
- package/dist/chunk-ALCLXXTY.mjs.map +1 -0
- package/dist/{chunk-CSU4KJJF.mjs → chunk-C2ROET2V.mjs} +2 -2
- package/dist/{chunk-JNYVN7YP.mjs → chunk-EEABSBKK.mjs} +2 -2
- package/dist/{chunk-JNYVN7YP.mjs.map → chunk-EEABSBKK.mjs.map} +1 -1
- package/dist/{chunk-BIOIOWXZ.mjs → chunk-HNIQFZKB.mjs} +2 -2
- package/dist/{chunk-MH6FKW2I.mjs → chunk-J5YWQVI5.mjs} +4 -4
- package/dist/chunk-J5YWQVI5.mjs.map +1 -0
- 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-5FW6PQ3J.mjs → chunk-QTZZ2ISQ.mjs} +41 -16
- package/dist/chunk-QTZZ2ISQ.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-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-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-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 +71 -5
- package/dist/client.d.ts +71 -5
- 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 +2113 -198
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +16 -16
- package/dist/index.d.ts +16 -16
- 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 +279 -8
- 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-MH6FKW2I.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-7N62DNSO.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-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
package/dist/client.d.mts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
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;
|
|
@@ -376,6 +442,6 @@ declare function useRouter(options?: UseRouterOptions): {
|
|
|
376
442
|
declare function usePageState<TState = unknown>(): TState | null;
|
|
377
443
|
declare function useNavigation(): FarmNavigationState;
|
|
378
444
|
declare function useBlocker(options: UseBlockerOptions): UseBlockerReturn;
|
|
379
|
-
declare function useScrollRestoration<TElement extends HTMLElement = HTMLElement>(key: string): RefObject<TElement>;
|
|
445
|
+
declare function useScrollRestoration<TElement extends HTMLElement = HTMLElement>(key: string): RefObject<TElement | null>;
|
|
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 {
|
|
2
|
-
export {
|
|
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;
|
|
@@ -376,6 +442,6 @@ declare function useRouter(options?: UseRouterOptions): {
|
|
|
376
442
|
declare function usePageState<TState = unknown>(): TState | null;
|
|
377
443
|
declare function useNavigation(): FarmNavigationState;
|
|
378
444
|
declare function useBlocker(options: UseBlockerOptions): UseBlockerReturn;
|
|
379
|
-
declare function useScrollRestoration<TElement extends HTMLElement = HTMLElement>(key: string): RefObject<TElement>;
|
|
445
|
+
declare function useScrollRestoration<TElement extends HTMLElement = HTMLElement>(key: string): RefObject<TElement | null>;
|
|
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-
|
|
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-
|
|
15
|
+
} from "./chunk-J5YWQVI5.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-
|
|
30
|
-
import "./chunk-
|
|
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-
|
|
46
|
+
} from "./chunk-QTZZ2ISQ.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-
|
|
57
|
+
import "./chunk-ALCLXXTY.mjs";
|
|
58
|
+
import "./chunk-V3XURYJO.mjs";
|
|
57
59
|
import "./chunk-WZ5QFROO.mjs";
|
|
58
|
-
import "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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]) {
|