@farm.js/core 0.1.81 → 0.1.82
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-mcp.d-Cxi3214_.d.ts → agent-mcp.d-C2Su3x4D.d.ts} +1 -1
- package/dist/{agent-mcp.d-DMqOqnOA.d.mts → agent-mcp.d-Yak-LqRd.d.mts} +1 -1
- package/dist/agent-runtime.cjs +4 -3
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +3 -2
- package/dist/analyzer-LV23T6QN.cjs +17 -0
- package/dist/{analyzer-IC66UJCU.mjs → analyzer-RPU2KG4J.mjs} +2 -2
- package/dist/api/node.cjs +5 -4
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- package/dist/api/node.mjs +4 -3
- package/dist/api/route-manager.cjs +5 -4
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +4 -3
- package/dist/api/runtime.cjs +4 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api/runtime.mjs +3 -2
- package/dist/api.cjs +7 -6
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/api.mjs +6 -5
- package/dist/{app-manifest.d-Bbxp5kes.d.mts → app-manifest.d-BcyOFMrg.d.mts} +1 -1
- package/dist/{app-manifest.d-C8Cswd31.d.ts → app-manifest.d-DZyXaICz.d.ts} +1 -1
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{app.d-BJuSurgy.d.mts → app.d-C0ePpuaG.d.mts} +21 -4
- package/dist/{app.d-DGIoFt5D.d.ts → app.d-CIoXsAbN.d.ts} +21 -4
- package/dist/chunk-3DE6RK7K.cjs +36 -0
- package/dist/{chunk-NOYKBGUK.mjs → chunk-47I2MYIR.mjs} +130 -46
- package/dist/{chunk-GY63XD6K.mjs → chunk-4X7LSGM6.mjs} +1 -1
- package/dist/{chunk-BPWTSPK6.mjs → chunk-5AL2GXAU.mjs} +1 -1
- package/dist/{chunk-GAWSWJJ2.cjs → chunk-5GFTMTX3.cjs} +2 -2
- package/dist/{chunk-CPZZBCPO.cjs → chunk-5MUFW5UU.cjs} +2 -2
- package/dist/{chunk-LKIG5SM6.cjs → chunk-5P65LXGU.cjs} +9 -9
- package/dist/{chunk-XOXCQGAF.mjs → chunk-63ZE6B6M.mjs} +1 -1
- package/dist/{chunk-XOGCNKB7.cjs → chunk-6BPFIYGY.cjs} +3 -3
- package/dist/{chunk-UF4BNKKJ.mjs → chunk-6QYPP5KC.mjs} +2 -2
- package/dist/{chunk-ATISIC6G.mjs → chunk-7VJXYB6S.mjs} +7 -1
- package/dist/{chunk-2Y2HRZQY.cjs → chunk-AIPZDBP6.cjs} +312 -228
- package/dist/{chunk-CL7BUGVB.cjs → chunk-ARORZ3MH.cjs} +286 -240
- package/dist/{chunk-ONSZP5JK.mjs → chunk-AUFEM3FB.mjs} +1 -1
- package/dist/{chunk-FYZD7DUS.cjs → chunk-B2PGVHBG.cjs} +4 -4
- package/dist/{chunk-WGWWRV2M.cjs → chunk-B3HQTGXS.cjs} +6 -4
- package/dist/{chunk-M6DAIE4T.cjs → chunk-BCTHOQPP.cjs} +10 -8
- package/dist/{chunk-S3IWDDQ3.mjs → chunk-C3VCYOU4.mjs} +1 -1
- package/dist/{chunk-OO4GVGM3.mjs → chunk-CA2HBLXP.mjs} +11 -1
- package/dist/{chunk-W6C3LEXX.cjs → chunk-CD5Z7RR5.cjs} +155 -20
- package/dist/{chunk-YH7ENV3K.mjs → chunk-CJDBTTLB.mjs} +4 -4
- package/dist/{chunk-5N526T7Q.mjs → chunk-DAXU2NBE.mjs} +74 -18
- package/dist/{chunk-Z5BANEQD.cjs → chunk-DMSXZNQR.cjs} +2 -2
- package/dist/{chunk-46UV2E7I.cjs → chunk-DRO3NXA3.cjs} +9 -9
- package/dist/{chunk-4OFWG4IK.cjs → chunk-EACD6ND7.cjs} +8 -2
- package/dist/{chunk-HTNJ7A4D.mjs → chunk-EL2Z6YFZ.mjs} +2 -2
- package/dist/{chunk-IM3UINTZ.mjs → chunk-GXLNARPO.mjs} +151 -16
- package/dist/{chunk-E3HBD2K3.cjs → chunk-HHQEKLZL.cjs} +2 -2
- package/dist/{chunk-5ZHC6QGD.cjs → chunk-HQKCSJEH.cjs} +8 -2
- package/dist/{chunk-RHI67C2V.cjs → chunk-HUGPJFOC.cjs} +1 -35
- package/dist/{chunk-BJWJP5A4.mjs → chunk-I4DR3HCH.mjs} +3 -3
- package/dist/{chunk-C2OLXVUC.mjs → chunk-IVP5Q4BX.mjs} +10 -3
- package/dist/{chunk-NSLRK5DK.cjs → chunk-JK26IMT7.cjs} +1 -1
- package/dist/{chunk-WIZRYFB2.cjs → chunk-JYQ6DGPW.cjs} +8 -6
- package/dist/{chunk-TYHWZOA2.mjs → chunk-KWI3SQFX.mjs} +4 -2
- package/dist/{chunk-POVHO46S.mjs → chunk-L3RDECA5.mjs} +1 -1
- package/dist/{chunk-MOGRRZMW.cjs → chunk-LM2ZDNDD.cjs} +16 -16
- package/dist/{chunk-RPA45OQS.mjs → chunk-MO4UTDQ6.mjs} +1 -1
- package/dist/{chunk-ZIYJWJV2.cjs → chunk-N2EFMN2K.cjs} +8 -8
- package/dist/{chunk-6WVRVGKC.mjs → chunk-NAHDG6UX.mjs} +1 -1
- package/dist/{chunk-OFVCWV2D.cjs → chunk-NEKO3HM2.cjs} +11 -1
- package/dist/{chunk-SLEHAGGV.mjs → chunk-NQ3Y6E2T.mjs} +7 -1
- package/dist/{chunk-IPG6B25T.mjs → chunk-NRCKBDYP.mjs} +78 -32
- package/dist/{chunk-POL5RCVU.mjs → chunk-OMB7UGVW.mjs} +1 -1
- package/dist/{chunk-D77OGI6X.mjs → chunk-OP5VI4TP.mjs} +1 -1
- package/dist/{chunk-7VCLTNED.mjs → chunk-PNMAD3OS.mjs} +1 -35
- package/dist/{chunk-OIWDEDUO.cjs → chunk-Q2VOT3K2.cjs} +392 -336
- package/dist/{chunk-RZ6XUEQS.mjs → chunk-QSMUMK7Y.mjs} +2 -2
- package/dist/{chunk-2HMSSPCZ.mjs → chunk-RMLR5RMH.mjs} +4 -2
- package/dist/{chunk-ADQ2LATR.cjs → chunk-RMPUEH5T.cjs} +2 -2
- package/dist/{chunk-AHVF5GI2.cjs → chunk-S7WZUK3B.cjs} +2 -2
- package/dist/{chunk-ZKNXCRUQ.cjs → chunk-U54REWMJ.cjs} +23 -23
- package/dist/chunk-U6XYBTUT.mjs +36 -0
- package/dist/{chunk-TCMRLW3K.cjs → chunk-VACYUMXW.cjs} +10 -3
- package/dist/{chunk-OUDNUFVR.cjs → chunk-VMBIKDKW.cjs} +4 -4
- package/dist/{chunk-UGLTOLTJ.cjs → chunk-W76C7TCW.cjs} +2 -2
- package/dist/{chunk-6JWXHPVR.mjs → chunk-XRSNW4IU.mjs} +4 -2
- package/dist/{chunk-TLSGRK7E.mjs → chunk-ZIZRIZLP.mjs} +1 -1
- package/dist/{cli-runtime.d-D8O1v2_X.d.mts → cli-runtime.d-Hnvvadz7.d.mts} +5 -5
- package/dist/{cli-runtime.d-hf4L1MNP.d.ts → cli-runtime.d-I0MphTbc.d.ts} +5 -5
- package/dist/{client-component.d-CX8UCQh-.d.ts → client-component.d-5QEvtJsg.d.ts} +1 -1
- package/dist/{client-component.d-DFwUHlOz.d.mts → client-component.d-DapRqtSC.d.mts} +1 -1
- package/dist/{client-plugins.d-BflSNO-b.d.mts → client-plugins.d-C1WM3ieD.d.mts} +6 -1
- package/dist/{client-plugins.d-qWp8hNwd.d.ts → client-plugins.d-DcmDzcSC.d.ts} +6 -1
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.d.mts +7 -7
- package/dist/client.d.ts +7 -7
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/cron.cjs +2 -2
- package/dist/cron.mjs +1 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-EI5N366Z.cjs → devtools-5B7NZE6F.cjs} +10 -9
- package/dist/{devtools-XJHODO5H.mjs → devtools-C5GXZZ7E.mjs} +7 -6
- package/dist/docs.cjs +9 -8
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +8 -7
- package/dist/environment/vite.cjs +4 -4
- package/dist/environment/vite.mjs +3 -3
- package/dist/{handler.d-DoH5Krkq.d.mts → handler.d-B8bPCBzl.d.mts} +1 -1
- package/dist/{handler.d-C2oRihfa.d.ts → handler.d-Cliwo6Nu.d.ts} +1 -1
- package/dist/{headers.d-BrX53wFQ.d.mts → headers.d-CVwSpSGX.d.mts} +1 -1
- package/dist/{headers.d-Dj0mfYpb.d.ts → headers.d-C_btqjV6.d.ts} +1 -1
- package/dist/index.cjs +28 -27
- package/dist/{index.d-DzDHOttz.d.mts → index.d-DFuMZk9-.d.mts} +1 -1
- package/dist/{index.d-Dhc2scRl.d.ts → index.d-hOEbMcLk.d.ts} +1 -1
- package/dist/index.d.mts +22 -22
- package/dist/index.d.ts +22 -22
- package/dist/index.mjs +27 -26
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations.cjs +4 -3
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +3 -2
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/build-runtime.cjs +26 -25
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +25 -24
- package/dist/internal/cli-runtime.cjs +11 -10
- package/dist/internal/cli-runtime.d.mts +7 -7
- package/dist/internal/cli-runtime.d.ts +7 -7
- package/dist/internal/cli-runtime.mjs +10 -9
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +9 -8
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +8 -7
- package/dist/internal/infra-analytics-runtime.cjs +8 -6
- package/dist/internal/infra-analytics-runtime.d.mts +8 -2
- package/dist/internal/infra-analytics-runtime.d.ts +8 -2
- package/dist/internal/infra-analytics-runtime.mjs +8 -6
- package/dist/internal/islands-boot.cjs +54 -20
- package/dist/internal/islands-boot.d.mts +5 -3
- package/dist/internal/islands-boot.d.ts +5 -3
- package/dist/internal/islands-boot.mjs +49 -15
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +11 -6
- package/dist/internal/production-runtime.d.mts +13 -11
- package/dist/internal/production-runtime.d.ts +13 -11
- package/dist/internal/production-runtime.mjs +10 -5
- package/dist/internal/spa-router.d.mts +3 -3
- package/dist/internal/spa-router.d.ts +3 -3
- package/dist/internal/start-manifest.d.mts +1 -1
- package/dist/internal/start-manifest.d.ts +1 -1
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/{mount.d-DwXjaOHY.d.ts → mount.d-CAovYKfs.d.ts} +1 -1
- package/dist/{mount.d-DOaeUoWq.d.mts → mount.d-DLeYxeRR.d.mts} +1 -1
- package/dist/{navigation-delegate.d-o3pPd9VI.d.ts → navigation-delegate.d-BLM-8Q3Z.d.ts} +1 -1
- package/dist/{navigation-delegate.d-BElGUMgt.d.mts → navigation-delegate.d-Chv93QS6.d.mts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/{nitro-YLTGVGK4.mjs → nitro-FK3SZM4H.mjs} +1 -1
- package/dist/{nitro-XGIO6EQN.cjs → nitro-YDFMH5PY.cjs} +4 -4
- package/dist/{plugin-LN3JBZRR.cjs → plugin-3PT7I26P.cjs} +2 -2
- package/dist/{plugin-33I3V42N.mjs → plugin-QOTAPTVV.mjs} +1 -1
- package/dist/plugin.cjs +21 -19
- package/dist/plugin.d.mts +5 -5
- package/dist/plugin.d.ts +5 -5
- package/dist/plugin.mjs +20 -18
- package/dist/{render-plan.d-BD06tqFA.d.ts → render-plan.d-BSTjTH8h.d.ts} +1 -1
- package/dist/{render-plan.d-xWCRAJeR.d.mts → render-plan.d-CK5Lggyb.d.mts} +1 -1
- package/dist/renderer-client.cjs +48 -5
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/renderer-client.mjs +48 -5
- package/dist/renderer.cjs +2 -2
- package/dist/renderer.d.mts +10 -0
- package/dist/renderer.d.ts +10 -0
- package/dist/renderer.mjs +1 -1
- package/dist/{request.d-Dx82V8bz.d.mts → request.d-BhggxQf3.d.mts} +1 -1
- package/dist/{request.d-DUMuWxSN.d.ts → request.d-CyJS9bjm.d.ts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-BwBVpLtD.d.ts → route-rendering.d-BLPPmI5I.d.ts} +1 -1
- package/dist/{route-rendering.d-DJh6GauM.d.mts → route-rendering.d-CUpG2mZJ.d.mts} +1 -1
- package/dist/{router.d-CJBSG5jr.d.ts → router.d-0X2Ki6rf.d.ts} +1 -1
- package/dist/{router.d-BtkKDxUB.d.mts → router.d-2NQM1Kgw.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-H5AXQA7A.cjs → rsc-pipeline-5AOF64FL.cjs} +10 -9
- package/dist/{rsc-pipeline-GD6KLOIG.mjs → rsc-pipeline-DNRLYOJ7.mjs} +9 -8
- package/dist/{runtime-OJ7FXFUI.mjs → runtime-EHG2FRXZ.mjs} +9 -8
- package/dist/{runtime-YWQVBC3V.cjs → runtime-ZVHG5SRB.cjs} +13 -12
- package/dist/{runtime.d-BQnD0cfC.d.ts → runtime.d-CXuwkUgr.d.ts} +1 -1
- package/dist/{runtime.d-C4SuZXf6.d.mts → runtime.d-CaFXcu_Q.d.mts} +1 -1
- package/dist/{server-components-status.d-rfKOcE0N.d.ts → server-components-status.d-BdeFD8ZH.d.ts} +1 -1
- package/dist/{server-components-status.d-9rH7ZoEq.d.mts → server-components-status.d-Cp7zvBm5.d.mts} +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +54 -48
- package/dist/server.d.mts +11 -11
- package/dist/server.d.ts +11 -11
- package/dist/server.mjs +30 -24
- package/dist/{spa-router.d-DMKiBsHH.d.ts → spa-router.d-Bjgl-Osi.d.ts} +2 -2
- package/dist/{spa-router.d-V6XLSTCy.d.mts → spa-router.d-l3G38xHa.d.mts} +2 -2
- package/dist/{ssg.d-MNedvvMB.d.ts → ssg.d-DDca17Lc.d.ts} +2 -2
- package/dist/{ssg.d-BnCKPQL0.d.mts → ssg.d-RnlHOqUL.d.mts} +2 -2
- package/dist/{store-core.d-BqJI1-ix.d.mts → store-core.d-BZjuC6Zc.d.mts} +11 -3
- package/dist/{store-core.d-Ad5biajo.d.ts → store-core.d-BaOUOPf7.d.ts} +11 -3
- package/dist/testing.cjs +5 -4
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +4 -3
- package/dist/{utils.d-BdjHKDuT.d.ts → utils.d-D8TWmpWo.d.ts} +1 -1
- package/dist/{utils.d-BEKLWa0Z.d.mts → utils.d-tdzw0_zQ.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +21 -19
- package/dist/vite.d.mts +6 -6
- package/dist/vite.d.ts +6 -6
- package/dist/vite.mjs +20 -18
- package/package.json +2 -2
- package/dist/analyzer-435DCIQ6.cjs +0 -17
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { aK as FarmConfig, P as ParsedRoute, bn as ResolvedFarmRouteRuntimeConfig, bo as ApplicationMetadataRouteKind, e as RouteModule, aZ as LayoutModule, S as SSGCollectionResult, E as FarmRequest, G as FarmResponse, bp as ResolvedFarmAPIConfig, aH as FarmDocsResolvedConfig, bm as FarmMarkdownResolvedConfig, d as FarmMdxResolvedConfig, ax as ResolvedFarmDevtoolsConfig, bq as ResolvedFarmDevIndicatorsConfig, br as ResolvedFarmAuthConfig, bs as ResolvedFarmPerformanceConfig, bt as ResolvedFarmSecurityConfig } from './client-plugins.d-
|
|
1
|
+
import { aK as FarmConfig, P as ParsedRoute, bn as ResolvedFarmRouteRuntimeConfig, bo as ApplicationMetadataRouteKind, e as RouteModule, aZ as LayoutModule, S as SSGCollectionResult, E as FarmRequest, G as FarmResponse, bp as ResolvedFarmAPIConfig, aH as FarmDocsResolvedConfig, bm as FarmMarkdownResolvedConfig, d as FarmMdxResolvedConfig, ax as ResolvedFarmDevtoolsConfig, bq as ResolvedFarmDevIndicatorsConfig, br as ResolvedFarmAuthConfig, bs as ResolvedFarmPerformanceConfig, bt as ResolvedFarmSecurityConfig } from './client-plugins.d-DcmDzcSC.js';
|
|
2
2
|
import { FarmWorkflowsResolvedConfig } from './workflows.js';
|
|
3
3
|
import { FarmCronResolvedConfig } from './cron.js';
|
|
4
4
|
import { R as ResolvedFarmImageConfig } from './image-config.d-ByhQ0TT7.js';
|
|
5
|
-
import { F as FarmSearchPreserveRoute, M as MetadataImageKind, c as createFarmDefaultMCPServer } from './agent-mcp.d-
|
|
5
|
+
import { F as FarmSearchPreserveRoute, M as MetadataImageKind, c as createFarmDefaultMCPServer } from './agent-mcp.d-C2Su3x4D.js';
|
|
6
6
|
import { ProgrammaticRedirectRoute, ProgrammaticRouteSearchClientOptions } from './routes.js';
|
|
7
|
-
import { I as IsolatedClientBoundaryReference, F as FarmSourceSnapshotStore, C as ClientModuleHydrationPlan, P as ProgrammaticClientRoutes } from './client-component.d-
|
|
7
|
+
import { I as IsolatedClientBoundaryReference, F as FarmSourceSnapshotStore, C as ClientModuleHydrationPlan, P as ProgrammaticClientRoutes } from './client-component.d-5QEvtJsg.js';
|
|
8
8
|
import { ViteDevServer } from 'vite';
|
|
9
9
|
import { F as FarmIslandStrategy } from './island.d-CfGru1MO.js';
|
|
10
10
|
import { FarmRenderer, FarmServerRendererRuntime } from './renderer.js';
|
|
11
|
-
import { F as FarmRouteRenderPlan } from './render-plan.d-
|
|
11
|
+
import { F as FarmRouteRenderPlan } from './render-plan.d-BSTjTH8h.js';
|
|
12
12
|
import { R as ResolvedFarmI18nConfig } from './types.d-euATAbE4.js';
|
|
13
13
|
import { a as FarmRedirectStatus } from './navigation-errors.d-DwHtoMyR.js';
|
|
14
14
|
import { F as FarmI18nRuntime } from './runtime.d-PUA5qBnd.js';
|
|
@@ -468,6 +468,13 @@ declare class ServerRenderer {
|
|
|
468
468
|
*/
|
|
469
469
|
private applyRendererAppSetup;
|
|
470
470
|
private createPageBoundary;
|
|
471
|
+
/**
|
|
472
|
+
* The browser hydrates a page island or a route slot as its own root, inside the integration
|
|
473
|
+
* providers, so the server renders the providers inside it too, or a provider that renders
|
|
474
|
+
* markup (a Vue `<slot />` renders fragment markers) puts the root's HTML out of step. React
|
|
475
|
+
* lines an island up with its tree position instead, and its providers render no markup.
|
|
476
|
+
*/
|
|
477
|
+
private wrapIslandIntegrationProviders;
|
|
471
478
|
private devGlobalStylesheetHref;
|
|
472
479
|
private devGlobalStylesheetLink;
|
|
473
480
|
private devGlobalStylesheetAssets;
|
|
@@ -629,6 +636,16 @@ declare class ServerRenderer {
|
|
|
629
636
|
private getMetadataImageRenderer;
|
|
630
637
|
private writeStaticMetadataImageResponse;
|
|
631
638
|
private renderRouteErrorBoundary;
|
|
639
|
+
/**
|
|
640
|
+
* Islands mode: a page whose route hydrates nothing as a root hydrates only islands, which hold
|
|
641
|
+
* their own clicks, so nothing else on it is held, as in production.
|
|
642
|
+
*/
|
|
643
|
+
private isIslandsOnlyPage;
|
|
644
|
+
/**
|
|
645
|
+
* The head script that holds a page's clicks and submits until it hydrates, which the client
|
|
646
|
+
* replays once it has. Production writes it into the same pages, streamed or buffered.
|
|
647
|
+
*/
|
|
648
|
+
private renderPreHydrationHold;
|
|
632
649
|
private renderBufferedSSR;
|
|
633
650
|
/**
|
|
634
651
|
* Whether the root layout returns its own `<html>` document, checked as the client's layout
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/api/route-schema.ts
|
|
2
|
+
async function parseRouteSchema(schema, value) {
|
|
3
|
+
if (schema.parseAsync) return schema.parseAsync(value);
|
|
4
|
+
if (schema["~standard"]) {
|
|
5
|
+
const result = await schema["~standard"].validate(value);
|
|
6
|
+
if (result.issues)
|
|
7
|
+
throw Object.assign(new Error("Validation failed"), { issues: result.issues });
|
|
8
|
+
return result.value;
|
|
9
|
+
}
|
|
10
|
+
if (schema.parse) return schema.parse(value);
|
|
11
|
+
throw new TypeError("Route validators must implement Standard Schema or parse().");
|
|
12
|
+
}
|
|
13
|
+
var PUBLIC_MESSAGE_CODES = /* @__PURE__ */ new Set(["custom", "invalid_type"]);
|
|
14
|
+
function toPublicValidationIssues(error) {
|
|
15
|
+
const issues = _optionalChain([error, 'optionalAccess', _ => _.issues]);
|
|
16
|
+
const list = Array.isArray(issues) ? issues : Array.isArray(_optionalChain([error, 'optionalAccess', _2 => _2.errors])) ? error.errors : [];
|
|
17
|
+
return list.map((issue) => {
|
|
18
|
+
const { path, code, message } = _nullishCoalesce(issue, () => ( {}));
|
|
19
|
+
return {
|
|
20
|
+
path: Array.isArray(path) ? path.map(toPublicPathSegment) : [],
|
|
21
|
+
...typeof code === "string" ? { code } : {},
|
|
22
|
+
message: PUBLIC_MESSAGE_CODES.has(code) && typeof message === "string" && message ? message : "Invalid value"
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function toPublicPathSegment(segment) {
|
|
27
|
+
const key = segment && typeof segment === "object" && "key" in segment ? segment.key : segment;
|
|
28
|
+
if (typeof key === "number") return key;
|
|
29
|
+
if (typeof key === "symbol") return key.description || key.toString();
|
|
30
|
+
return String(key);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
exports.parseRouteSchema = parseRouteSchema; exports.toPublicValidationIssues = toPublicValidationIssues;
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
import {
|
|
33
33
|
collectFarmNativeServerFns,
|
|
34
34
|
findFarmNativeScreenFiles
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-C3VCYOU4.mjs";
|
|
36
36
|
import {
|
|
37
37
|
assertFarmDocsAdapterServesNoGuardedPages,
|
|
38
38
|
compileFarmDocsAdapterEdgeManifest,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
hasFarmDocsRuntimeAdapter,
|
|
42
42
|
listFarmDocsAdapterPages,
|
|
43
43
|
listFarmDocsPagePaths
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-OMB7UGVW.mjs";
|
|
45
45
|
import {
|
|
46
46
|
FARM_DOCS_LAST_MODIFIED_MANIFEST,
|
|
47
47
|
createFarmDocsHandler,
|
|
@@ -63,9 +63,6 @@ import {
|
|
|
63
63
|
import {
|
|
64
64
|
CDN_CACHE_CONTROL_HEADERS
|
|
65
65
|
} from "./chunk-UBLKPREL.mjs";
|
|
66
|
-
import {
|
|
67
|
-
FARM_PRERENDER_ENV
|
|
68
|
-
} from "./chunk-IM3UINTZ.mjs";
|
|
69
66
|
import {
|
|
70
67
|
loadFarmDocsEngine
|
|
71
68
|
} from "./chunk-LRPPXKCX.mjs";
|
|
@@ -74,7 +71,7 @@ import {
|
|
|
74
71
|
getDeployTargetForPreset,
|
|
75
72
|
hasCustomFarmRouteContext,
|
|
76
73
|
resolveDeployOutputPath
|
|
77
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-CJDBTTLB.mjs";
|
|
78
75
|
import {
|
|
79
76
|
resolveFarmInstrumentationFile
|
|
80
77
|
} from "./chunk-QRNYSISP.mjs";
|
|
@@ -119,23 +116,23 @@ import {
|
|
|
119
116
|
resolveFarmNotFoundComponentPath,
|
|
120
117
|
resolveFarmRouteRootStrategy,
|
|
121
118
|
toBakedMarkdownSourcePath
|
|
122
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-NRCKBDYP.mjs";
|
|
123
120
|
import {
|
|
124
121
|
TAILWIND_CSS_BROWSER_TARGET,
|
|
125
122
|
generateFarmClientPluginEntryCode,
|
|
126
123
|
hasFarmServerRuntimePlugins,
|
|
127
124
|
includesTailwindVitePlugin,
|
|
128
125
|
loadTailwindVitePlugin
|
|
129
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-MO4UTDQ6.mjs";
|
|
130
127
|
import {
|
|
131
128
|
PluginManager
|
|
132
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-IVP5Q4BX.mjs";
|
|
133
130
|
import {
|
|
134
131
|
generateFarmTypeArtifacts,
|
|
135
132
|
readRouteRenderingDirectiveFromFile,
|
|
136
133
|
resolveRouteRenderingConfig,
|
|
137
134
|
resolveRouteRenderingConfigFromFile
|
|
138
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-ZIZRIZLP.mjs";
|
|
139
136
|
import {
|
|
140
137
|
HOISTED_HEAD_ELEMENT,
|
|
141
138
|
appMiddlewareMayHandlePath,
|
|
@@ -148,13 +145,17 @@ import {
|
|
|
148
145
|
layoutsCanCoverSamePage,
|
|
149
146
|
routeBoundaryCoversDirectory,
|
|
150
147
|
stripRouteGroups
|
|
151
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-CA2HBLXP.mjs";
|
|
152
149
|
import {
|
|
153
150
|
FARM_NATIVE_TREE_CONTENT_TYPE
|
|
154
151
|
} from "./chunk-LLZSYFOM.mjs";
|
|
155
152
|
import {
|
|
156
153
|
farmPluginMayAffectRuntimePath
|
|
157
154
|
} from "./chunk-UUMKLGUU.mjs";
|
|
155
|
+
import {
|
|
156
|
+
FARM_PRERENDER_ENV,
|
|
157
|
+
_farmWebMCPReportsEnabled
|
|
158
|
+
} from "./chunk-GXLNARPO.mjs";
|
|
158
159
|
import {
|
|
159
160
|
FARM_API_CATALOG_PATH,
|
|
160
161
|
FARM_APP_MANIFEST_LEGACY_PATH,
|
|
@@ -162,7 +163,7 @@ import {
|
|
|
162
163
|
listFarmBuiltInRoutePaths,
|
|
163
164
|
resolveFarmApiCatalogInput,
|
|
164
165
|
resolveFarmAppManifestInput
|
|
165
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-QSMUMK7Y.mjs";
|
|
166
167
|
import {
|
|
167
168
|
FARM_DEFAULT_MCP_PATH,
|
|
168
169
|
createFarmDefaultMCPServer,
|
|
@@ -170,7 +171,7 @@ import {
|
|
|
170
171
|
} from "./chunk-HR4N2K4V.mjs";
|
|
171
172
|
import {
|
|
172
173
|
isFarmPreviewDeploymentEnvironment
|
|
173
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-4X7LSGM6.mjs";
|
|
174
175
|
import {
|
|
175
176
|
FARM_NATIVE_SERVER_FN_PLUGIN
|
|
176
177
|
} from "./chunk-L4RTTTVE.mjs";
|
|
@@ -191,7 +192,7 @@ import {
|
|
|
191
192
|
withFarmSourceSnapshot,
|
|
192
193
|
withFarmSourceSnapshotOf,
|
|
193
194
|
withPackageClientBoundaryCache
|
|
194
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-EL2Z6YFZ.mjs";
|
|
195
196
|
import {
|
|
196
197
|
generateFarmDocsAdapterClientRuntime,
|
|
197
198
|
getFarmDocsAdapterConfigModule
|
|
@@ -223,14 +224,14 @@ import {
|
|
|
223
224
|
isReactRenderer,
|
|
224
225
|
loadFarmRendererVitePlugins,
|
|
225
226
|
resolveFarmRendererAppSetup
|
|
226
|
-
} from "./chunk-
|
|
227
|
+
} from "./chunk-RMLR5RMH.mjs";
|
|
227
228
|
import {
|
|
228
229
|
applyFarmCronVercelCrons,
|
|
229
230
|
createFarmCronCloudflareConfig,
|
|
230
231
|
mergeScheduledTasks,
|
|
231
232
|
prepareFarmCronForNitro,
|
|
232
233
|
toFarmCronCloudflareScheduledTasks
|
|
233
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-7VJXYB6S.mjs";
|
|
234
235
|
import {
|
|
235
236
|
resolveServerActionsConfig
|
|
236
237
|
} from "./chunk-NLATR3T3.mjs";
|
|
@@ -260,7 +261,7 @@ import {
|
|
|
260
261
|
import {
|
|
261
262
|
getFarmIntegrationPluginServerRuntime,
|
|
262
263
|
getIntegrationProviders
|
|
263
|
-
} from "./chunk-
|
|
264
|
+
} from "./chunk-XRSNW4IU.mjs";
|
|
264
265
|
import {
|
|
265
266
|
FARM_INTEGRATION_API_BASE_PATH_KEY
|
|
266
267
|
} from "./chunk-CZOXZ6WQ.mjs";
|
|
@@ -274,7 +275,7 @@ import {
|
|
|
274
275
|
} from "./chunk-QD34VE4N.mjs";
|
|
275
276
|
import {
|
|
276
277
|
APIRouteManager
|
|
277
|
-
} from "./chunk-
|
|
278
|
+
} from "./chunk-NAHDG6UX.mjs";
|
|
278
279
|
import {
|
|
279
280
|
readFarmI18nCatalogs
|
|
280
281
|
} from "./chunk-VO55MMBX.mjs";
|
|
@@ -302,7 +303,7 @@ import {
|
|
|
302
303
|
} from "./chunk-2I6PUKWJ.mjs";
|
|
303
304
|
import {
|
|
304
305
|
FARM_VERSION
|
|
305
|
-
} from "./chunk-
|
|
306
|
+
} from "./chunk-OP5VI4TP.mjs";
|
|
306
307
|
import {
|
|
307
308
|
FARM_VIDEO_PLAYER_PATH
|
|
308
309
|
} from "./chunk-AG27TI6Q.mjs";
|
|
@@ -3127,7 +3128,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3127
3128
|
farmPlugin,
|
|
3128
3129
|
farmServerOnlyEntriesPlugin
|
|
3129
3130
|
} = await import("./vite.mjs");
|
|
3130
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
3131
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-QOTAPTVV.mjs");
|
|
3131
3132
|
const fs5 = await import("fs/promises");
|
|
3132
3133
|
const pluginManager = new PluginManager2({
|
|
3133
3134
|
config,
|
|
@@ -4938,6 +4939,7 @@ __farmConfigureApp(__farmAppSetup);` : `import * as __farmRendererClient from ${
|
|
|
4938
4939
|
import { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};
|
|
4939
4940
|
const React = { ...__farmRendererClient };`
|
|
4940
4941
|
);
|
|
4942
|
+
const hydrateFarmRouteCall = isReactRenderer(renderer) ? "return hydrateRoot(container, route.element);" : "return route.layouts.length > 0 ? hydrateRoot(container, route.element, route) : hydrateRoot(container, route.element);";
|
|
4941
4943
|
const providerClientCode = generateFarmIntegrationProviderClientCode(
|
|
4942
4944
|
integrationProviders,
|
|
4943
4945
|
root,
|
|
@@ -5212,11 +5214,12 @@ ${generateUniversalRouterStateProperties()}
|
|
|
5212
5214
|
|
|
5213
5215
|
reconcileFarmDocumentHead(doc);
|
|
5214
5216
|
|
|
5215
|
-
// Swap root content
|
|
5217
|
+
// Swap root content: the parsed nodes themselves, not markup the page parses again.
|
|
5216
5218
|
const newRoot = doc.getElementById("root");
|
|
5217
5219
|
const currentRoot = document.getElementById("root");
|
|
5218
5220
|
if (!newRoot || !currentRoot) return this.swapDocument(doc);
|
|
5219
|
-
|
|
5221
|
+
adoptFarmParsedNodes(newRoot);
|
|
5222
|
+
currentRoot.replaceChildren(...newRoot.childNodes);
|
|
5220
5223
|
return true;
|
|
5221
5224
|
},
|
|
5222
5225
|
|
|
@@ -5233,7 +5236,8 @@ ${generateUniversalRouterStateProperties()}
|
|
|
5233
5236
|
});
|
|
5234
5237
|
|
|
5235
5238
|
document.head.innerHTML = doc.head ? doc.head.innerHTML : "";
|
|
5236
|
-
|
|
5239
|
+
adoptFarmParsedNodes(doc.body);
|
|
5240
|
+
document.body.replaceChildren(...doc.body.childNodes);
|
|
5237
5241
|
delete window.__farmDocsRuntime;
|
|
5238
5242
|
delete window.__farmDocsPageActionsRuntime;
|
|
5239
5243
|
|
|
@@ -5531,7 +5535,7 @@ ${layoutImports}
|
|
|
5531
5535
|
${rendererClientImports}
|
|
5532
5536
|
${isolatedHydrationImport}
|
|
5533
5537
|
${providerClientCode.imports}
|
|
5534
|
-
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, keepFarmIslandValues, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, reconcileFarmDocumentHead, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
5538
|
+
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, keepFarmIslandValues, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, reconcileFarmDocumentHead, replayFarmQueuedInteraction, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
5535
5539
|
import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
|
|
5536
5540
|
import { createFarmRouter, isFarmRouteActive, matchFarmRoute } from "@farm.js/core/router";
|
|
5537
5541
|
${clientPluginEntry.imports}
|
|
@@ -5795,7 +5799,16 @@ function createFarmRouteState(page, pathname, params, includeLayouts) {
|
|
|
5795
5799
|
|
|
5796
5800
|
function hydrateFarmRoute(container, route) {
|
|
5797
5801
|
farmLastRouteState = route;
|
|
5798
|
-
${
|
|
5802
|
+
${getFarmRendererCapabilities(renderer).hydrationFallback ? `try {
|
|
5803
|
+
${hydrateFarmRouteCall}
|
|
5804
|
+
} catch (error) {
|
|
5805
|
+
// The renderer opted in with capabilities.hydrationFallback, as development always does. The
|
|
5806
|
+
// page still works, but the server's DOM, focus, and typed input are gone, so say so.
|
|
5807
|
+
console.error("[Farm.js] Hydration error; rendering the page on the client instead:", error);
|
|
5808
|
+
const root = createRoot(container);
|
|
5809
|
+
renderFarmRoute(root, route);
|
|
5810
|
+
return root;
|
|
5811
|
+
}` : hydrateFarmRouteCall}
|
|
5799
5812
|
}
|
|
5800
5813
|
|
|
5801
5814
|
function renderFarmRoute(root, route) {
|
|
@@ -5953,6 +5966,26 @@ function renderClientRouteSlot(slot, registration, mode) {
|
|
|
5953
5966
|
return true;
|
|
5954
5967
|
}
|
|
5955
5968
|
|
|
5969
|
+
// The document's pre-hydration hold keeps clicks and submits until what they target hydrates, as in
|
|
5970
|
+
// development. A hydrated route slot stops holding its own and replays what it held, as the page's
|
|
5971
|
+
// scheduler does for the page.
|
|
5972
|
+
function replayPreHydrationClicks(container) {
|
|
5973
|
+
container.dataset.farmIslandHydrated = "true";
|
|
5974
|
+
const queue = Array.isArray(window.__FARM_PREHYDRATION_CLICK_QUEUE__)
|
|
5975
|
+
? window.__FARM_PREHYDRATION_CLICK_QUEUE__
|
|
5976
|
+
: [];
|
|
5977
|
+
const held = queue.filter(function(item) {
|
|
5978
|
+
return item && item.target instanceof Element && container.contains(item.target);
|
|
5979
|
+
});
|
|
5980
|
+
if (held.length === 0) return;
|
|
5981
|
+
queue.splice(0, queue.length, ...queue.filter(function(item) { return held.indexOf(item) === -1; }));
|
|
5982
|
+
for (const item of held) {
|
|
5983
|
+
setTimeout(function() {
|
|
5984
|
+
if (item.target.isConnected) replayFarmQueuedInteraction(item.target, item.kind);
|
|
5985
|
+
}, 0);
|
|
5986
|
+
}
|
|
5987
|
+
}
|
|
5988
|
+
|
|
5956
5989
|
function hydrateInitialRouteSlots() {
|
|
5957
5990
|
const slots = Array.isArray(window.__FARM_ROUTE_SLOTS__)
|
|
5958
5991
|
? window.__FARM_ROUTE_SLOTS__
|
|
@@ -5961,7 +5994,9 @@ function hydrateInitialRouteSlots() {
|
|
|
5961
5994
|
const registration = findClientRouteSlot(slot);
|
|
5962
5995
|
if (!registration) continue;
|
|
5963
5996
|
try {
|
|
5964
|
-
renderClientRouteSlot(slot, registration, "hydrate")
|
|
5997
|
+
if (renderClientRouteSlot(slot, registration, "hydrate")) {
|
|
5998
|
+
replayPreHydrationClicks(document.getElementById(slot.containerId));
|
|
5999
|
+
}
|
|
5965
6000
|
} catch (error) {
|
|
5966
6001
|
console.warn("[Farm.js] Could not hydrate route slot:", slot.name, error);
|
|
5967
6002
|
}
|
|
@@ -6030,6 +6065,15 @@ function setFarmHydrated() {
|
|
|
6030
6065
|
isHydrated = true;
|
|
6031
6066
|
}
|
|
6032
6067
|
|
|
6068
|
+
// The document's head script holds clicks and submits until the page hydrates. Once the first
|
|
6069
|
+
// hydration settles it holds nothing more, as in development: each root that hydrated replayed
|
|
6070
|
+
// what it held, and a navigation's page renders in a React root that takes its own clicks.
|
|
6071
|
+
function markFarmHydrated() {
|
|
6072
|
+
if (window.__FARM_HYDRATED__ !== false) return;
|
|
6073
|
+
window.__FARM_HYDRATED__ = true;
|
|
6074
|
+
document.documentElement.dataset.farmHydrated = "true";
|
|
6075
|
+
}
|
|
6076
|
+
|
|
6033
6077
|
${generateUniversalRouterStateRuntime(islandValues)}
|
|
6034
6078
|
|
|
6035
6079
|
function cancelPendingPageHydration() {
|
|
@@ -6271,9 +6315,12 @@ async function streamFarmNavigation(stream, root, isCurrent) {
|
|
|
6271
6315
|
for (let flush = await stream.next(); flush !== null; flush = await stream.next()) {
|
|
6272
6316
|
if (!isCurrent()) return stream.cancel();
|
|
6273
6317
|
html += flush;
|
|
6274
|
-
const parsed = new DOMParser()
|
|
6318
|
+
const parsed = new DOMParser()
|
|
6319
|
+
.parseFromString('<div id="root">' + flush, "text/html")
|
|
6320
|
+
.getElementById("root");
|
|
6321
|
+
adoptFarmParsedNodes(parsed);
|
|
6275
6322
|
const fragment = document.createDocumentFragment();
|
|
6276
|
-
for (const node of Array.from(parsed.
|
|
6323
|
+
for (const node of Array.from(parsed.childNodes)) fragment.appendChild(node);
|
|
6277
6324
|
activateNavigationScripts(fragment);
|
|
6278
6325
|
root.appendChild(fragment);
|
|
6279
6326
|
}
|
|
@@ -6369,6 +6416,8 @@ ${islandValues ? FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBou
|
|
|
6369
6416
|
${isolatedHydrationEnabled ? `${islandValues ? `// A refresh keeps the islands still on the page, with their state and new props.
|
|
6370
6417
|
if (refresh) farmIsolatedHydrationRuntime.carryOver(currentTarget, nextTarget);
|
|
6371
6418
|
` : ""}disposeFarmIsolatedClientBoundaries(currentTarget);` : ""}
|
|
6419
|
+
// After the comparison: a noscript turned to text serializes escaped in the parsed document.
|
|
6420
|
+
adoptFarmParsedNodes(nextRoot);
|
|
6372
6421
|
currentTarget.replaceWith(nextTarget);${islandValues ? "\n if (fields) restoreFarmServerFields(fields, nextTarget);" : ""}
|
|
6373
6422
|
activateNavigationScripts(nextTarget);
|
|
6374
6423
|
if (nextTreeRoot && nextTreeRoot !== nextTarget) nextTreeRoot.remove();
|
|
@@ -6781,7 +6830,9 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
6781
6830
|
${islandValues ? 'if (!replacedSharedBoundary && isSegment) return "segment-mismatch";' : ""}
|
|
6782
6831
|
if (!replacedSharedBoundary) {
|
|
6783
6832
|
${isolatedHydrationEnabled ? "disposeFarmIsolatedClientBoundaries(currentRoot);" : ""}
|
|
6784
|
-
|
|
6833
|
+
// The parsed nodes themselves, not markup the page parses again.
|
|
6834
|
+
adoptFarmParsedNodes(newRoot);
|
|
6835
|
+
currentRoot.replaceChildren(...newRoot.childNodes);
|
|
6785
6836
|
activateNavigationScripts(currentRoot);
|
|
6786
6837
|
isolatedHydrationScope = currentRoot;
|
|
6787
6838
|
}
|
|
@@ -6863,7 +6914,8 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
6863
6914
|
});
|
|
6864
6915
|
|
|
6865
6916
|
document.head.innerHTML = doc.head ? doc.head.innerHTML : "";
|
|
6866
|
-
|
|
6917
|
+
adoptFarmParsedNodes(doc.body);
|
|
6918
|
+
document.body.replaceChildren(...doc.body.childNodes);
|
|
6867
6919
|
delete window.__farmDocsRuntime;
|
|
6868
6920
|
delete window.__farmDocsPageActionsRuntime;
|
|
6869
6921
|
|
|
@@ -6982,7 +7034,7 @@ document.addEventListener("click", function(e) {
|
|
|
6982
7034
|
if (isFarmDocsSearchPage()) {
|
|
6983
7035
|
mountFarmDocsSearch();
|
|
6984
7036
|
}
|
|
6985
|
-
void hydrate();
|
|
7037
|
+
void hydrate().finally(markFarmHydrated);
|
|
6986
7038
|
`.trim();
|
|
6987
7039
|
}
|
|
6988
7040
|
async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime, sourceSnapshot) {
|
|
@@ -6993,7 +7045,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6993
7045
|
farmPlugin,
|
|
6994
7046
|
farmServerOnlyEntriesPlugin
|
|
6995
7047
|
} = await import("./vite.mjs");
|
|
6996
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
7048
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-QOTAPTVV.mjs");
|
|
6997
7049
|
const fs5 = await import("fs/promises");
|
|
6998
7050
|
const pluginManager = new PluginManager2({
|
|
6999
7051
|
config,
|
|
@@ -7788,7 +7840,7 @@ function getFarmBufferedPreloadMarker(html) {
|
|
|
7788
7840
|
// Prove eligibility while Farm still owns the complete document string.
|
|
7789
7841
|
// Candidate-bearing or unknown bodies must retain the full parser path.
|
|
7790
7842
|
// Response.text() strips a leading UTF-8 BOM; retain that legacy behavior.
|
|
7791
|
-
return typeof html === "string" && html.charCodeAt(0) !== 0xfeff &&
|
|
7843
|
+
return typeof html === "string" && html.charCodeAt(0) !== 0xfeff && !hasFarmHtmlPreloadToken(html) ? "none" : "1";
|
|
7792
7844
|
}
|
|
7793
7845
|
|
|
7794
7846
|
async function applyFarmPreloadBudget(response, pathname, request) {
|
|
@@ -7880,7 +7932,7 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
|
|
|
7880
7932
|
const farmClientBoot = canBootFarmIslandsClient(config);
|
|
7881
7933
|
const farmMobileClient = shouldBuildFarmMobileClient(config);
|
|
7882
7934
|
const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
|
|
7883
|
-
const hasCompressionRuntime = config.compress && resolveFarmInstrumentationRuntime(preset)
|
|
7935
|
+
const hasCompressionRuntime = config.compress && resolveFarmInstrumentationRuntime(preset) !== "edge";
|
|
7884
7936
|
const servesAgentRobotsTxt = Boolean(config.agent?.crawlers?.enabled) && !applicationMetadataRoutes.some(
|
|
7885
7937
|
(metadata) => metadata.kind === "robots" && metadata.pattern === "/"
|
|
7886
7938
|
);
|
|
@@ -7891,6 +7943,7 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
|
|
|
7891
7943
|
const servesAiCatalog = config.agent?.aiCatalog !== false;
|
|
7892
7944
|
const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
|
|
7893
7945
|
const hasInfraAnalyticsRuntime = config.analytics !== false && resolveFarmInstrumentationRuntime(preset) === "nodejs";
|
|
7946
|
+
const reportsWebMCPCalls = hasInfraAnalyticsRuntime && _farmWebMCPReportsEnabled(config.plugins);
|
|
7894
7947
|
const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
|
|
7895
7948
|
const adapterOwnsDocsRuntime = Boolean(
|
|
7896
7949
|
isReactRenderer(config.renderer) && config.docs?.enabled && config.docs.adapter?.server && config.docs.adapter.react
|
|
@@ -8282,6 +8335,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8282
8335
|
applyFarmBasePath,
|
|
8283
8336
|
applyFarmCspNonceToResponse,
|
|
8284
8337
|
createFarmCspNonce,
|
|
8338
|
+
createPreHydrationClickQueueScript,
|
|
8285
8339
|
stampFarmCspNonce,
|
|
8286
8340
|
isDeferred,
|
|
8287
8341
|
prepareDeferredData,
|
|
@@ -8341,6 +8395,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8341
8395
|
isFarmNotFoundError,
|
|
8342
8396
|
isFarmRedirectError,
|
|
8343
8397
|
localizeFarmHref,
|
|
8398
|
+
hasFarmHtmlPreloadToken,
|
|
8344
8399
|
manageFarmDocumentPreloads,
|
|
8345
8400
|
mergeRouteRenderingDirectiveConfig,
|
|
8346
8401
|
resolveRouteSharedCacheControl,
|
|
@@ -8785,6 +8840,12 @@ function wrapWithFarmIntegrationProviders(element) {
|
|
|
8785
8840
|
}
|
|
8786
8841
|
return wrapped;
|
|
8787
8842
|
}
|
|
8843
|
+
// The browser hydrates a page island or a route slot as its own root, inside the integration
|
|
8844
|
+
// providers, so the server renders them inside it too. React lines an island up with its tree
|
|
8845
|
+
// position instead, and its providers render no markup.
|
|
8846
|
+
function wrapFarmIslandIntegrationProviders(element) {
|
|
8847
|
+
return ${isReactRenderer(config.renderer) ? "element" : "wrapWithFarmIntegrationProviders(element)"};
|
|
8848
|
+
}
|
|
8788
8849
|
const serverRuntimeIntegrations = Object.fromEntries(
|
|
8789
8850
|
Object.entries(configuredIntegrations).filter(([, integration]) =>
|
|
8790
8851
|
integration && typeof integration === "object" && integration.serverRuntime !== false
|
|
@@ -8794,7 +8855,14 @@ const integrationRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs, {
|
|
|
8794
8855
|
integrations: configuredIntegrations,
|
|
8795
8856
|
${JSON.stringify(FARM_INTEGRATION_API_BASE_PATH_KEY)}: ${JSON.stringify(resolveFarmAPIServerBasePath(config.api))},
|
|
8796
8857
|
});
|
|
8797
|
-
const farmInfraAnalytics = ${hasInfraAnalyticsRuntime ? hasPluginRuntime ? "createFarmInfraAnalyticsPlugin
|
|
8858
|
+
const farmInfraAnalytics = ${hasInfraAnalyticsRuntime ? `${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"}(${reportsWebMCPCalls ? "{ webmcp: { route: farmWebMCPCallRoute } }" : ""})` : "null"};${reportsWebMCPCalls ? `
|
|
8859
|
+
// A WebMCP tool call a page reports goes under that page's route, matched and labeled as a
|
|
8860
|
+
// request for the page is.
|
|
8861
|
+
function farmWebMCPCallRoute(pathname) {
|
|
8862
|
+
return labelFarmRequestOptions(
|
|
8863
|
+
getFarmPluginRequestOptions(new Request(new URL(pathname, "http://farm.invalid"))),
|
|
8864
|
+
).route;
|
|
8865
|
+
}` : ""}
|
|
8798
8866
|
const configuredPlugins = [
|
|
8799
8867
|
${hasCompressionRuntime && hasPluginRuntime ? "createCompressionPlugin()," : ""}
|
|
8800
8868
|
${hasRuntimeIntegrationConfig ? "...resolveIntegrationPlugins(serverRuntimeIntegrations)," : ""}
|
|
@@ -12264,7 +12332,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12264
12332
|
}
|
|
12265
12333
|
|
|
12266
12334
|
if (route.shouldHydrate && !shouldHydrateLayout) {
|
|
12267
|
-
pageElement = wrapFarmRouteClientGraph(pageElement);
|
|
12335
|
+
pageElement = wrapFarmRouteClientGraph(wrapFarmIslandIntegrationProviders(pageElement));
|
|
12268
12336
|
} else if (shouldHydrateLayout && !route.shouldHydrate) {
|
|
12269
12337
|
pageElement = route.serverTree
|
|
12270
12338
|
? await renderFarmRouteServerTree(
|
|
@@ -12325,7 +12393,9 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12325
12393
|
},
|
|
12326
12394
|
slot.hydrates
|
|
12327
12395
|
? wrapFarmRouteClientGraph(
|
|
12328
|
-
|
|
12396
|
+
wrapFarmIslandIntegrationProviders(
|
|
12397
|
+
React.createElement(slot.module.default, slot.props),
|
|
12398
|
+
),
|
|
12329
12399
|
)
|
|
12330
12400
|
: React.createElement(slot.module.default, slot.props),
|
|
12331
12401
|
);
|
|
@@ -12539,6 +12609,18 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12539
12609
|
// Set once the whole document is rendered: whether it starts with the boot entry, which
|
|
12540
12610
|
// preloads nothing.
|
|
12541
12611
|
let farmBootsClient = false;
|
|
12612
|
+
// A document something hydrates over holds the clicks and submits made before it hydrates,
|
|
12613
|
+
// for the client entry to replay, as development does. One that starts with the boot entry
|
|
12614
|
+
// holds its own.
|
|
12615
|
+
const farmHoldsInteractions =
|
|
12616
|
+
route.shouldHydrate ||
|
|
12617
|
+
shouldHydrateLayout ||
|
|
12618
|
+
renderedRouteSlots.some(function(slot) { return slot.hydrates; });
|
|
12619
|
+
const renderFarmPreHydrationHoldScript = function() {
|
|
12620
|
+
return farmHoldsInteractions && !farmBootsClient
|
|
12621
|
+
? stampFarmCspNonce(createPreHydrationClickQueueScript()) + '\\n'
|
|
12622
|
+
: '';
|
|
12623
|
+
};
|
|
12542
12624
|
// A client navigation swaps this document in without running its scripts. A route a
|
|
12543
12625
|
// shared cache stores renders the same for every request.
|
|
12544
12626
|
const farmNavigationRequest = ${farmIslandsMode ? `!farmSharedCacheableRoute &&
|
|
@@ -12553,7 +12635,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12553
12635
|
composed = composed
|
|
12554
12636
|
// Inject CSS link after opening head tag or first meta tag
|
|
12555
12637
|
.replace(/<head([^>]*)>/i, function(match, attrs) { return '<head' + attrs + '>\\n <link rel="stylesheet" href="/__farm_client_css_href__">' + (farmBootsClient ? "" : renderFarmClientModulePreloads(composed, route.clientModule, farmNavigationRequest)); })
|
|
12556
|
-
.replace(/<\\/head>/i, () => renderFarmRendererHydrationScript() + '\\n</head>')
|
|
12638
|
+
.replace(/<\\/head>/i, () => renderFarmRendererHydrationScript() + '\\n' + renderFarmPreHydrationHoldScript() + '</head>')
|
|
12557
12639
|
// Explicit metadata wins over renderer and layout titles. Without
|
|
12558
12640
|
// explicit metadata, a renderer title wins over the layout title.
|
|
12559
12641
|
.replace(/<head([^>]*)>([\\s\\S]*?)<\\/head>/i, (match, attrs, headContent) => {
|
|
@@ -12628,6 +12710,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12628
12710
|
' <link rel="stylesheet" href="/__farm_client_css_href__">\\n' +
|
|
12629
12711
|
' <link rel="modulepreload" href="/__farm_client_js_src__">' + renderFarmClientModulePreloads(null, route.clientModule) + '\\n' +
|
|
12630
12712
|
renderFarmRendererHydrationScript() + '\\n' +
|
|
12713
|
+
renderFarmPreHydrationHoldScript() +
|
|
12631
12714
|
'</head>\\n<body>\\n' + farmEarlyClientScripts + ' <div id="root">';
|
|
12632
12715
|
const streamClientScripts = farmEarlyClientScripts ? '' : farmClientScripts();
|
|
12633
12716
|
const streamSuffix = function() {
|
|
@@ -12784,7 +12867,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12784
12867
|
\${suppressDefaultTitle ? "" : "<title>" + title + "</title>"}\${metaTags}\${rendererHead ? "\\n " + rendererHead : ""}
|
|
12785
12868
|
<link rel="stylesheet" href="/__farm_client_css_href__">\${farmBootsClient ? "" : renderFarmClientModulePreloads(html, route.clientModule, farmNavigationRequest)}
|
|
12786
12869
|
\${renderFarmRendererHydrationScript()}
|
|
12787
|
-
</head>
|
|
12870
|
+
\${renderFarmPreHydrationHoldScript()}</head>
|
|
12788
12871
|
<body>
|
|
12789
12872
|
<div id="root">\${html}</div>
|
|
12790
12873
|
\${renderFarmClientBootstrapScript(pageProps.__farmCanonicalPath, farmDeferredData.data.slots, farmDeferredData.data.page, routePathname)}\${renderFarmDeferredDataScript(farmDeferredData.records)}
|
|
@@ -14134,7 +14217,9 @@ function toFarmNodeResponse(request, response) {
|
|
|
14134
14217
|
];
|
|
14135
14218
|
})
|
|
14136
14219
|
);
|
|
14137
|
-
if (preset === "node-server"
|
|
14220
|
+
if (preset === "node-server" || preset === "bun") {
|
|
14221
|
+
await writeFarmClientBrotliAssets(clientOutputDir);
|
|
14222
|
+
}
|
|
14138
14223
|
const immutableAssets = isVercel ? { publicAssets: [], routeRules: {} } : planFarmImmutableAssets({
|
|
14139
14224
|
clientOutputDir,
|
|
14140
14225
|
files: await listFarmClientOutputFiles(clientOutputDir),
|
|
@@ -14171,9 +14256,8 @@ function toFarmNodeResponse(request, response) {
|
|
|
14171
14256
|
// A self-hosted Node or Bun server sends static files itself, so precompress
|
|
14172
14257
|
// them with gzip and let Nitro serve that by Accept-Encoding. Brotli at Nitro's
|
|
14173
14258
|
// fixed top quality on every file cost a docs app ~20 s of build CPU, so only
|
|
14174
|
-
// client scripts and stylesheets get a brotli copy
|
|
14175
|
-
//
|
|
14176
|
-
// that compresses.
|
|
14259
|
+
// client scripts and stylesheets get a brotli copy (writeFarmClientBrotliAssets).
|
|
14260
|
+
// Serverless and edge targets sit behind a CDN that compresses.
|
|
14177
14261
|
...preset === "node-server" || preset === "bun" ? { compressPublicAssets: { gzip: true } } : {},
|
|
14178
14262
|
// Nitro gzips every server output file at level 9, node_modules included, to
|
|
14179
14263
|
// print sizes after the build. A self-hosted server is never shipped compressed,
|
|
@@ -15340,7 +15424,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
15340
15424
|
farmPlugin,
|
|
15341
15425
|
farmServerOnlyEntriesPlugin
|
|
15342
15426
|
} = await import("./vite.mjs");
|
|
15343
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
15427
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-QOTAPTVV.mjs");
|
|
15344
15428
|
const pluginManager = new PluginManager2({
|
|
15345
15429
|
config,
|
|
15346
15430
|
isDev: false,
|
|
@@ -15369,7 +15453,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
15369
15453
|
}
|
|
15370
15454
|
async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
15371
15455
|
const { farmI18nClientBridgePlugin, farmIslandContainersPlugin, farmPlugin } = await import("./vite.mjs");
|
|
15372
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
15456
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-QOTAPTVV.mjs");
|
|
15373
15457
|
const pluginManager = new PluginManager2({
|
|
15374
15458
|
config,
|
|
15375
15459
|
isDev: false,
|
|
@@ -15411,7 +15495,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
|
|
|
15411
15495
|
}
|
|
15412
15496
|
async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
|
|
15413
15497
|
const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
|
|
15414
|
-
import("./nitro-
|
|
15498
|
+
import("./nitro-FK3SZM4H.mjs"),
|
|
15415
15499
|
import("nitro/builder")
|
|
15416
15500
|
]);
|
|
15417
15501
|
let nitroConfig = await createNitroConfig(
|
|
@@ -25,7 +25,7 @@ var _chunk2OFP3IVAcjs = require('./chunk-2OFP3IVA.cjs');
|
|
|
25
25
|
var _chunk2LHZD3OPcjs = require('./chunk-2LHZD3OP.cjs');
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _chunkB3HQTGXScjs = require('./chunk-B3HQTGXS.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
var _chunkGBMWLDCCcjs = require('./chunk-GBMWLDCC.cjs');
|
|
@@ -117,7 +117,7 @@ async function withTimeout(work, timeoutMs) {
|
|
|
117
117
|
var formatSeconds = (ms) => ms < 1e3 ? `${ms}ms` : `${Number((ms / 1e3).toFixed(1))}s`;
|
|
118
118
|
function collectSchemaOwners(config) {
|
|
119
119
|
const owners = [];
|
|
120
|
-
const integrationSchemas =
|
|
120
|
+
const integrationSchemas = _chunkB3HQTGXScjs.getIntegrationSchemas.call(void 0, config.integrations);
|
|
121
121
|
let integrationClient;
|
|
122
122
|
for (const [name, schema] of Object.entries(integrationSchemas)) {
|
|
123
123
|
owners.push({
|
|
@@ -18,14 +18,14 @@ var _chunkCCAUIBIScjs = require('./chunk-CCAUIBIS.cjs');
|
|
|
18
18
|
var _chunkWMRGIQTAcjs = require('./chunk-WMRGIQTA.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkJK26IMT7cjs = require('./chunk-JK26IMT7.cjs');
|
|
22
22
|
|
|
23
23
|
// src/mobile/analyzer.ts
|
|
24
24
|
var _crypto = require('crypto');
|
|
25
25
|
var _fs = require('fs');
|
|
26
26
|
var _promises = require('fs/promises');
|
|
27
27
|
var _path = require('path'); var path = _interopRequireWildcard(_path);
|
|
28
|
-
var ANALYZER_VERSION = `8:${
|
|
28
|
+
var ANALYZER_VERSION = `8:${_chunkJK26IMT7cjs.FARM_VERSION}`;
|
|
29
29
|
var INTRINSIC_KINDS = {};
|
|
30
30
|
for (const tag of "div section main article header footer nav aside figure hr li".split(" ")) {
|
|
31
31
|
INTRINSIC_KINDS[tag] = "View";
|