@farm.js/core 0.1.84 → 0.1.86

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 (102) hide show
  1. package/dist/{analyzer-7RNO3XKC.mjs → analyzer-I5S5YKHM.mjs} +2 -2
  2. package/dist/analyzer-OEMQSLYT.cjs +17 -0
  3. package/dist/{app.d-eSm7jgoc.d.mts → app.d-Bvpc2eJq.d.mts} +1 -1
  4. package/dist/{app.d-CVPu_hoD.d.ts → app.d-DEKpJEp4.d.ts} +1 -1
  5. package/dist/{chunk-CVZY4TLW.cjs → chunk-2NKNP4AH.cjs} +1 -1
  6. package/dist/{chunk-BRDGINBB.mjs → chunk-3TKGMIPX.mjs} +9 -9
  7. package/dist/{chunk-KXVMWLTC.mjs → chunk-45ANSCTO.mjs} +85 -15
  8. package/dist/{chunk-MYSH5Y4E.mjs → chunk-4IE3YK7U.mjs} +1 -1
  9. package/dist/{chunk-CWUQBECF.mjs → chunk-4SJ22WTT.mjs} +1 -1
  10. package/dist/{chunk-IRJSZAJB.mjs → chunk-7UTRNV6R.mjs} +1 -1
  11. package/dist/{chunk-Z37PDUJR.cjs → chunk-BAD6T5NU.cjs} +4 -4
  12. package/dist/{chunk-USMRAC72.cjs → chunk-BLZCAFGJ.cjs} +2 -2
  13. package/dist/{chunk-M5XU22PQ.mjs → chunk-CFKAYV7B.mjs} +1 -1
  14. package/dist/{chunk-MAPHNGTF.cjs → chunk-CPSFDQKJ.cjs} +3 -3
  15. package/dist/{chunk-3WM7VBGW.mjs → chunk-CVKTYG4L.mjs} +2 -2
  16. package/dist/{chunk-BOEDYXAX.cjs → chunk-FDU4Q4QP.cjs} +7 -7
  17. package/dist/{chunk-DSWSDDP2.cjs → chunk-FWLXYNWA.cjs} +379 -309
  18. package/dist/{chunk-I5CVJ24H.mjs → chunk-GWPANDW3.mjs} +1 -1
  19. package/dist/{chunk-BCCCPFHQ.mjs → chunk-HV6CYSMF.mjs} +3 -0
  20. package/dist/{chunk-5I4ZGKP2.cjs → chunk-IAERD73G.cjs} +161 -156
  21. package/dist/{chunk-EDBIBO67.mjs → chunk-KHIEGVG7.mjs} +1 -1
  22. package/dist/{chunk-HOQ2MYBJ.cjs → chunk-L2IULWKV.cjs} +9 -9
  23. package/dist/{chunk-57EEWWUS.cjs → chunk-NXOZRI3B.cjs} +2 -2
  24. package/dist/{chunk-OFVBMS6I.cjs → chunk-P253SZJF.cjs} +93 -93
  25. package/dist/{chunk-NLHSKKTT.mjs → chunk-PAENAKTC.mjs} +1 -1
  26. package/dist/{chunk-OP7BIEUW.cjs → chunk-Q3YWQEUS.cjs} +2 -2
  27. package/dist/{chunk-EBSL5TW7.cjs → chunk-QYDGIXQ5.cjs} +146 -88
  28. package/dist/{chunk-DFDQGHPU.mjs → chunk-QYWP5KDY.mjs} +17 -12
  29. package/dist/{chunk-INU4K4U4.mjs → chunk-RA5OUXOJ.mjs} +2 -2
  30. package/dist/{chunk-XLULEFRW.mjs → chunk-SB74WCKC.mjs} +67 -9
  31. package/dist/{chunk-3OKSEJ33.cjs → chunk-T7UC2ORA.cjs} +3 -0
  32. package/dist/{chunk-22BTYPIX.cjs → chunk-TQJ35BBW.cjs} +4 -4
  33. package/dist/{chunk-BZY3SRRD.mjs → chunk-UAQQUQWE.mjs} +1 -1
  34. package/dist/{chunk-YU6VL7H5.cjs → chunk-UDWBTABT.cjs} +3 -3
  35. package/dist/{chunk-F7JVO3OZ.cjs → chunk-VGZIIOU6.cjs} +4 -4
  36. package/dist/{chunk-RQ6XX5IN.mjs → chunk-VTEAUQMT.mjs} +1 -1
  37. package/dist/{chunk-L3BSHASB.cjs → chunk-XMVZXZ32.cjs} +4 -4
  38. package/dist/{chunk-MUUDHWQZ.mjs → chunk-YMAE32O7.mjs} +1 -1
  39. package/dist/{chunk-L5HDCDFT.mjs → chunk-YNPVG2GG.mjs} +1 -1
  40. package/dist/{chunk-GLNVLCUH.cjs → chunk-ZSVFI7JM.cjs} +6 -6
  41. package/dist/{client-component.d-DLknFP8l.d.ts → client-component.d-CZG02pIh.d.ts} +2 -1
  42. package/dist/{client-component.d-DLMCzmUx.d.mts → client-component.d-miqIXyQv.d.mts} +2 -1
  43. package/dist/{devtools-4SVIRV4P.cjs → devtools-A3L7WNTB.cjs} +4 -4
  44. package/dist/{devtools-MWQA5LVN.mjs → devtools-DGC2247E.mjs} +2 -2
  45. package/dist/docs.cjs +4 -4
  46. package/dist/docs.mjs +3 -3
  47. package/dist/environment/vite.cjs +4 -4
  48. package/dist/environment/vite.mjs +3 -3
  49. package/dist/index.cjs +18 -18
  50. package/dist/index.d.mts +2 -2
  51. package/dist/index.d.ts +2 -2
  52. package/dist/index.mjs +18 -18
  53. package/dist/internal/build-runtime.cjs +18 -18
  54. package/dist/internal/build-runtime.mjs +17 -17
  55. package/dist/internal/cli-runtime.cjs +6 -6
  56. package/dist/internal/cli-runtime.mjs +5 -5
  57. package/dist/internal/client-error-overlay.cjs +4 -4
  58. package/dist/internal/client-error-overlay.mjs +1 -1
  59. package/dist/internal/config-runtime.cjs +4 -4
  60. package/dist/internal/config-runtime.mjs +3 -3
  61. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  62. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  63. package/dist/internal/islands-runtime.cjs +15 -8
  64. package/dist/internal/islands-runtime.d.mts +2 -3
  65. package/dist/internal/islands-runtime.d.ts +2 -3
  66. package/dist/internal/islands-runtime.mjs +15 -8
  67. package/dist/internal/islands-server-tree.cjs +8 -0
  68. package/dist/internal/islands-server-tree.d.mts +5 -0
  69. package/dist/internal/islands-server-tree.d.ts +5 -0
  70. package/dist/internal/islands-server-tree.mjs +8 -0
  71. package/dist/internal/islx-actions-server.d.mts +0 -3
  72. package/dist/internal/islx-actions-server.d.ts +0 -3
  73. package/dist/internal/native-server-fns.cjs +4 -4
  74. package/dist/internal/native-server-fns.mjs +3 -3
  75. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  76. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  77. package/dist/internal/production-runtime.cjs +7 -7
  78. package/dist/internal/production-runtime.mjs +8 -8
  79. package/dist/plugin.cjs +13 -13
  80. package/dist/plugin.d.mts +1 -1
  81. package/dist/plugin.d.ts +1 -1
  82. package/dist/plugin.mjs +12 -12
  83. package/dist/renderer.cjs +3 -3
  84. package/dist/renderer.d.mts +10 -2
  85. package/dist/renderer.d.ts +10 -2
  86. package/dist/renderer.mjs +2 -2
  87. package/dist/{rsc-pipeline-UT3Z2GDO.mjs → rsc-pipeline-BROS3NEB.mjs} +4 -4
  88. package/dist/{rsc-pipeline-OWBEZ7HB.cjs → rsc-pipeline-SNGPAXGW.cjs} +5 -5
  89. package/dist/{runtime-SRMQ46SK.cjs → runtime-7T5TRAWL.cjs} +9 -9
  90. package/dist/{runtime-F5I3WY3B.mjs → runtime-SLJLW37A.mjs} +4 -4
  91. package/dist/server.cjs +38 -38
  92. package/dist/server.d.mts +2 -2
  93. package/dist/server.d.ts +2 -2
  94. package/dist/server.mjs +14 -14
  95. package/dist/version.cjs +2 -2
  96. package/dist/version.mjs +1 -1
  97. package/dist/vite.cjs +13 -13
  98. package/dist/vite.d.mts +2 -2
  99. package/dist/vite.d.ts +2 -2
  100. package/dist/vite.mjs +12 -12
  101. package/package.json +6 -1
  102. package/dist/analyzer-PFKA5NI6.cjs +0 -17
@@ -3,11 +3,11 @@ import {
3
3
  analyzeFarmMobileRoutes,
4
4
  readAliases,
5
5
  resolveFile
6
- } from "./chunk-BZY3SRRD.mjs";
6
+ } from "./chunk-UAQQUQWE.mjs";
7
7
  import "./chunk-IOEXXZK3.mjs";
8
8
  import "./chunk-423SSBYQ.mjs";
9
9
  import "./chunk-D2VAANBS.mjs";
10
- import "./chunk-I5CVJ24H.mjs";
10
+ import "./chunk-GWPANDW3.mjs";
11
11
  import "./chunk-TIZJYHB7.mjs";
12
12
  export {
13
13
  CORE_PORTABLE,
@@ -0,0 +1,17 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+ var _chunkQ3YWQEUScjs = require('./chunk-Q3YWQEUS.cjs');
7
+ require('./chunk-WBTHHTBO.cjs');
8
+ require('./chunk-CCAUIBIS.cjs');
9
+ require('./chunk-WMRGIQTA.cjs');
10
+ require('./chunk-2NKNP4AH.cjs');
11
+ require('./chunk-UZM3PDKK.cjs');
12
+
13
+
14
+
15
+
16
+
17
+ exports.CORE_PORTABLE = _chunkQ3YWQEUScjs.CORE_PORTABLE; exports.analyzeFarmMobileRoutes = _chunkQ3YWQEUScjs.analyzeFarmMobileRoutes; exports.readAliases = _chunkQ3YWQEUScjs.readAliases; exports.resolveFile = _chunkQ3YWQEUScjs.resolveFile;
@@ -4,7 +4,7 @@ import { FarmCronResolvedConfig } from './cron.mjs';
4
4
  import { R as ResolvedFarmImageConfig } from './image-config.d-ByhQ0TT7.mjs';
5
5
  import { F as FarmSearchPreserveRoute, M as MetadataImageKind, c as createFarmDefaultMCPServer } from './agent-mcp.d-LChlR2au.mjs';
6
6
  import { ProgrammaticRedirectRoute, ProgrammaticRouteSearchClientOptions } from './routes.mjs';
7
- import { I as IsolatedClientBoundaryReference, F as FarmSourceSnapshotStore, C as ClientModuleHydrationPlan, P as ProgrammaticClientRoutes } from './client-component.d-DLMCzmUx.mjs';
7
+ import { I as IsolatedClientBoundaryReference, F as FarmSourceSnapshotStore, C as ClientModuleHydrationPlan, P as ProgrammaticClientRoutes } from './client-component.d-miqIXyQv.mjs';
8
8
  import { ViteDevServer } from 'vite';
9
9
  import { F as FarmIslandStrategy } from './island.d-CfGru1MO.mjs';
10
10
  import { FarmRenderer, FarmServerRendererRuntime } from './renderer.mjs';
@@ -4,7 +4,7 @@ import { FarmCronResolvedConfig } from './cron.js';
4
4
  import { R as ResolvedFarmImageConfig } from './image-config.d-ByhQ0TT7.js';
5
5
  import { F as FarmSearchPreserveRoute, M as MetadataImageKind, c as createFarmDefaultMCPServer } from './agent-mcp.d-7uKdOttc.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-DLknFP8l.js';
7
+ import { I as IsolatedClientBoundaryReference, F as FarmSourceSnapshotStore, C as ClientModuleHydrationPlan, P as ProgrammaticClientRoutes } from './client-component.d-CZG02pIh.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';
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});// package.json
2
- var version = "0.1.84";
2
+ var version = "0.1.86";
3
3
 
4
4
  // src/version.ts
5
5
  var FARM_VERSION = version;
@@ -9,13 +9,13 @@ import {
9
9
  collectSSGPages,
10
10
  matchSSGPage,
11
11
  resolveRouteRenderingConfigFromFile
12
- } from "./chunk-CWUQBECF.mjs";
13
- import {
14
- findFarmAppPackageDir
15
- } from "./chunk-MYSH5Y4E.mjs";
12
+ } from "./chunk-4SJ22WTT.mjs";
16
13
  import {
17
14
  resolveFarmRendererRoutes
18
- } from "./chunk-L5HDCDFT.mjs";
15
+ } from "./chunk-YNPVG2GG.mjs";
16
+ import {
17
+ findFarmAppPackageDir
18
+ } from "./chunk-4IE3YK7U.mjs";
19
19
  import {
20
20
  createFarmMetadataImageResponse,
21
21
  resolveFarmMetadataImageValue
@@ -59,7 +59,7 @@ import {
59
59
  } from "./chunk-4EEAPBNV.mjs";
60
60
  import {
61
61
  listFarmMCPLlmsTxtLinks
62
- } from "./chunk-3WM7VBGW.mjs";
62
+ } from "./chunk-CVKTYG4L.mjs";
63
63
  import {
64
64
  FARM_DEFAULT_MCP_PATH,
65
65
  collectFarmDefaultMCPPages,
@@ -104,7 +104,7 @@ import {
104
104
  traceFarmSourceReads,
105
105
  usesFarmServerTree,
106
106
  withFarmSourceSnapshot
107
- } from "./chunk-XLULEFRW.mjs";
107
+ } from "./chunk-SB74WCKC.mjs";
108
108
  import {
109
109
  _setDefaultFarmThemeConfig,
110
110
  getTheme
@@ -165,7 +165,7 @@ import {
165
165
  resolveFarmRendererAppSetup,
166
166
  resolveFarmRendererModule,
167
167
  resolveFarmServerComponentsMode
168
- } from "./chunk-BCCCPFHQ.mjs";
168
+ } from "./chunk-HV6CYSMF.mjs";
169
169
  import {
170
170
  resolveFarmImageConfig
171
171
  } from "./chunk-AOIUYHPH.mjs";
@@ -306,7 +306,7 @@ import {
306
306
  } from "./chunk-EILUVBKS.mjs";
307
307
  import {
308
308
  FARM_VERSION
309
- } from "./chunk-I5CVJ24H.mjs";
309
+ } from "./chunk-GWPANDW3.mjs";
310
310
  import {
311
311
  normalizeFarmAPIConfig
312
312
  } from "./chunk-W6QLRQ3V.mjs";
@@ -32,7 +32,7 @@ import {
32
32
  import {
33
33
  collectFarmNativeServerFns,
34
34
  findFarmNativeScreenFiles
35
- } from "./chunk-MUUDHWQZ.mjs";
35
+ } from "./chunk-YMAE32O7.mjs";
36
36
  import {
37
37
  assertFarmDocsAdapterServesNoGuardedPages,
38
38
  compileFarmDocsAdapterEdgeManifest,
@@ -40,7 +40,7 @@ import {
40
40
  farmDocsAdapterServesGuardedPages,
41
41
  listFarmDocsAdapterPages,
42
42
  listFarmDocsPagePaths
43
- } from "./chunk-NLHSKKTT.mjs";
43
+ } from "./chunk-PAENAKTC.mjs";
44
44
  import {
45
45
  FARM_DOCS_LAST_MODIFIED_MANIFEST,
46
46
  createFarmDocsHandler,
@@ -70,7 +70,7 @@ import {
70
70
  getDeployTargetForPreset,
71
71
  hasCustomFarmRouteContext,
72
72
  resolveDeployOutputPath
73
- } from "./chunk-EDBIBO67.mjs";
73
+ } from "./chunk-KHIEGVG7.mjs";
74
74
  import {
75
75
  resolveFarmInstrumentationFile
76
76
  } from "./chunk-QRNYSISP.mjs";
@@ -115,7 +115,7 @@ import {
115
115
  resolveFarmNotFoundComponentPath,
116
116
  resolveFarmRouteRootStrategy,
117
117
  toBakedMarkdownSourcePath
118
- } from "./chunk-BRDGINBB.mjs";
118
+ } from "./chunk-3TKGMIPX.mjs";
119
119
  import {
120
120
  TAILWIND_CSS_BROWSER_TARGET,
121
121
  generateFarmClientPluginEntryCode,
@@ -131,14 +131,14 @@ import {
131
131
  readRouteRenderingDirectiveFromFile,
132
132
  resolveRouteRenderingConfig,
133
133
  resolveRouteRenderingConfigFromFile
134
- } from "./chunk-CWUQBECF.mjs";
134
+ } from "./chunk-4SJ22WTT.mjs";
135
135
  import {
136
136
  usesFarmRendererIslands
137
- } from "./chunk-RQ6XX5IN.mjs";
137
+ } from "./chunk-VTEAUQMT.mjs";
138
138
  import {
139
139
  FARM_PRERENDER_ENV,
140
140
  _farmWebMCPReportsEnabled
141
- } from "./chunk-M5XU22PQ.mjs";
141
+ } from "./chunk-CFKAYV7B.mjs";
142
142
  import {
143
143
  HOISTED_HEAD_ELEMENT,
144
144
  appMiddlewareMayHandlePath,
@@ -165,7 +165,7 @@ import {
165
165
  listFarmBuiltInRoutePaths,
166
166
  resolveFarmApiCatalogInput,
167
167
  resolveFarmAppManifestInput
168
- } from "./chunk-3WM7VBGW.mjs";
168
+ } from "./chunk-CVKTYG4L.mjs";
169
169
  import {
170
170
  FARM_DEFAULT_MCP_PATH,
171
171
  createFarmDefaultMCPServer,
@@ -173,7 +173,7 @@ import {
173
173
  } from "./chunk-HR4N2K4V.mjs";
174
174
  import {
175
175
  isFarmPreviewDeploymentEnvironment
176
- } from "./chunk-IRJSZAJB.mjs";
176
+ } from "./chunk-7UTRNV6R.mjs";
177
177
  import {
178
178
  FARM_NATIVE_SERVER_FN_PLUGIN
179
179
  } from "./chunk-L4RTTTVE.mjs";
@@ -194,7 +194,7 @@ import {
194
194
  withFarmSourceSnapshot,
195
195
  withFarmSourceSnapshotOf,
196
196
  withPackageClientBoundaryCache
197
- } from "./chunk-XLULEFRW.mjs";
197
+ } from "./chunk-SB74WCKC.mjs";
198
198
  import {
199
199
  generateFarmDocsAdapterClientRuntime,
200
200
  getFarmDocsAdapterConfigModule
@@ -229,7 +229,7 @@ import {
229
229
  loadFarmRendererVitePlugins,
230
230
  resolveFarmRendererAppSetup,
231
231
  resolveFarmServerComponentsMode
232
- } from "./chunk-BCCCPFHQ.mjs";
232
+ } from "./chunk-HV6CYSMF.mjs";
233
233
  import {
234
234
  applyFarmCronVercelCrons,
235
235
  createFarmCronCloudflareConfig,
@@ -308,7 +308,7 @@ import {
308
308
  } from "./chunk-2I6PUKWJ.mjs";
309
309
  import {
310
310
  FARM_VERSION
311
- } from "./chunk-I5CVJ24H.mjs";
311
+ } from "./chunk-GWPANDW3.mjs";
312
312
  import {
313
313
  FARM_VIDEO_PLAYER_PATH
314
314
  } from "./chunk-AG27TI6Q.mjs";
@@ -832,6 +832,7 @@ function collectFarmClientModulePreloads(bundle, options) {
832
832
  const rendererFiles = dynamicFiles(options.rendererModules);
833
833
  const rootFiles = dynamicFiles(options.rootModules);
834
834
  const actionFiles = dynamicFiles(options.actionModules, rendererFiles);
835
+ const serverTreeFiles = dynamicFiles(options.serverTreeModules, rendererFiles);
835
836
  return {
836
837
  files,
837
838
  entry: entryFiles.map(index),
@@ -839,6 +840,7 @@ function collectFarmClientModulePreloads(bundle, options) {
839
840
  ...rendererFiles.length > 0 ? { renderer: rendererFiles.map(index) } : {},
840
841
  ...rootFiles.length > 0 ? { root: rootFiles.map(index) } : {},
841
842
  ...actionFiles.length > 0 ? { actions: actionFiles.map(index) } : {},
843
+ ...serverTreeFiles.length > 0 ? { serverTrees: serverTreeFiles.map(index) } : {},
842
844
  modules
843
845
  };
844
846
  }
@@ -857,11 +859,17 @@ function createFarmClientModulePreloadPlugin(options) {
857
859
  };
858
860
  const rendererModules = await resolve(options.rendererImports);
859
861
  const actionModules = await resolve(options.actionImports);
862
+ const serverTreeModules = await resolve(options.serverTreeImports);
860
863
  await fs.mkdir(options.buildDir, { recursive: true });
861
864
  await fs.writeFile(
862
865
  path4.join(options.buildDir, FARM_CLIENT_MODULE_PRELOADS_FILE),
863
866
  JSON.stringify(
864
- collectFarmClientModulePreloads(bundle, { ...options, rendererModules, actionModules })
867
+ collectFarmClientModulePreloads(bundle, {
868
+ ...options,
869
+ rendererModules,
870
+ actionModules,
871
+ serverTreeModules
872
+ })
865
873
  )
866
874
  );
867
875
  }
@@ -883,6 +891,50 @@ function encodeFarmBuildJSONPlaceholder(value) {
883
891
  return JSON.stringify(JSON.stringify(value)).slice(1, -1).replace(/'/g, "\\u0027").replace(/`/g, "\\u0060").replace(/\$/g, "\\u0024").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
884
892
  }
885
893
 
894
+ // src/nitro/islands-react-chunk.ts
895
+ var REACT_MODULE = /[\\/]node_modules[\\/](?:react|react-dom|scheduler)[\\/]/;
896
+ function createFarmIslandsReactChunkGroup() {
897
+ let entryImportsReact;
898
+ return {
899
+ debugName: "react",
900
+ name(moduleId, context) {
901
+ if (!REACT_MODULE.test(moduleId)) return null;
902
+ entryImportsReact ?? (entryImportsReact = reactLoadsWithAnEntry(moduleId, context));
903
+ return entryImportsReact ? null : "react";
904
+ }
905
+ };
906
+ }
907
+ function reactLoadsWithAnEntry(moduleId, context) {
908
+ const react = /* @__PURE__ */ new Set();
909
+ const pending = [moduleId];
910
+ for (let id = pending.pop(); id !== void 0; id = pending.pop()) {
911
+ if (react.has(id) || !REACT_MODULE.test(id)) continue;
912
+ react.add(id);
913
+ const info = context.getModuleInfo(id);
914
+ if (info) pending.push(...info.importedIds, ...info.importers);
915
+ }
916
+ const seen = /* @__PURE__ */ new Set();
917
+ pending.push(...react);
918
+ for (let id = pending.pop(); id !== void 0; id = pending.pop()) {
919
+ if (seen.has(id)) continue;
920
+ seen.add(id);
921
+ const info = context.getModuleInfo(id);
922
+ if (!info) continue;
923
+ if (info.isEntry) return true;
924
+ pending.push(...info.importers);
925
+ }
926
+ return false;
927
+ }
928
+ function configuresFarmClientChunks(vite) {
929
+ const build2 = vite?.build;
930
+ const outputs = [build2?.rollupOptions?.output, build2?.rolldownOptions?.output].flat();
931
+ return outputs.some(
932
+ (output) => !!output && typeof output === "object" && ["manualChunks", "advancedChunks", "codeSplitting", "inlineDynamicImports"].some(
933
+ (key) => output[key] !== void 0
934
+ )
935
+ );
936
+ }
937
+
886
938
  // src/nitro/client-route-table.ts
887
939
  import fs2 from "fs/promises";
888
940
  import path5 from "path";
@@ -3543,6 +3595,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3543
3595
  entryFileNames: "[name]-h[hash].js",
3544
3596
  chunkFileNames: "chunks/[name]-h[hash].js",
3545
3597
  hashCharacters: "hex",
3598
+ ...islandsMode && isReactRenderer(config.renderer) && !configuresFarmClientChunks(config.vite) ? { codeSplitting: { groups: [createFarmIslandsReactChunkGroup()] } } : {},
3546
3599
  // Use predictable name for CSS so we can reference it in SSR HTML
3547
3600
  assetFileNames: (assetInfo) => {
3548
3601
  if (assetInfo.name?.endsWith(".css")) {
@@ -3591,6 +3644,9 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3591
3644
  ],
3592
3645
  // What a call's result is handled with, imported on the first (RFC 0013).
3593
3646
  actionImports: ["@farm.js/core/internal/islands-action-client"],
3647
+ // What a root rebuilds a server tree with, imported with the first (RFC
3648
+ // 0013). A build without server trees has no chunk for it.
3649
+ serverTreeImports: ["@farm.js/core/internal/islands-server-tree"],
3594
3650
  rendererImporter: clientEntryPath
3595
3651
  } : {}
3596
3652
  }),
@@ -10368,6 +10424,8 @@ const FARM_CLIENT_MODULE_REFERENCE_PATTERN = /<f-island src="([^"]+)"([^>]*)>|"r
10368
10424
  // A server action reference in a document's markup: an action in an island's or a client
10369
10425
  // component's props (islx's \`{"$":"a",...}\`), or a server form posting one (its \`$F_REF_\` field).
10370
10426
  const FARM_ACTION_REFERENCE_PATTERN = /"\\$":"a"|name="\\$F_REF_/;
10427
+ // A server tree in a document's markup: the payload a page or layout root rebuilds from.
10428
+ const FARM_SERVER_TREE_PATTERN = /<script type="f\\/tree"/;
10371
10429
 
10372
10430
  function renderFarmClientModulePreload(index) {
10373
10431
  return '\\n <link rel="modulepreload" href="/' +
@@ -10407,6 +10465,14 @@ function collectFarmClientActionModules(markup, listed) {
10407
10465
  return actions.filter((index) => !listed.has(index) && listed.add(index));
10408
10466
  }
10409
10467
 
10468
+ // The manifest indexes of islands mode's server trees (RFC 0013), for a document whose markup holds
10469
+ // one, leaving out those already listed. The islands runtime imports them with the first otherwise.
10470
+ function collectFarmClientServerTreeModules(markup, listed) {
10471
+ const trees = farmClientModulePreloads.serverTrees;
10472
+ if (!trees || typeof markup !== "string" || !FARM_SERVER_TREE_PATTERN.test(markup)) return [];
10473
+ return trees.filter((index) => !listed.has(index) && listed.add(index));
10474
+ }
10475
+
10410
10476
  // The modulepreload links for a document: the entry's static imports and, unless it answers a
10411
10477
  // client navigation, the renderer and, when a page or layout root hydrates in it (\`hydratesRoot\`),
10412
10478
  // the code that renders it; then the modules its hydrating page and its markup load.
@@ -10420,6 +10486,7 @@ function renderFarmClientModulePreloads(markup, pageModule, navigation, hydrates
10420
10486
  (hydratesRoot && !navigation ? farmClientRootPreloadTags : "") +
10421
10487
  collectFarmClientDocumentModules(markup, pageModule, listed)
10422
10488
  .concat(collectFarmClientActionModules(markup, listed))
10489
+ .concat(collectFarmClientServerTreeModules(markup, listed))
10423
10490
  .map(renderFarmClientModulePreload)
10424
10491
  .join("");
10425
10492
  }
@@ -10452,11 +10519,14 @@ function renderFarmClientBootPreloads(markup, pageModule, root, rootStrategy, na
10452
10519
  )
10453
10520
  : [];
10454
10521
  const waitsForClick = rootStrategy === "interaction";
10455
- // A call needs a hydrated island, so the action client comes with the renderer.
10522
+ // A call needs a hydrated island, so the action client comes with the renderer, as do the server
10523
+ // trees a root rebuilds.
10524
+ const listed = new Set(entry.concat(rootModules));
10456
10525
  const renderer = navigation
10457
10526
  ? []
10458
10527
  : (farmClientModulePreloads.renderer || []).concat(
10459
- collectFarmClientActionModules(markup, new Set(entry.concat(rootModules))),
10528
+ collectFarmClientActionModules(markup, listed),
10529
+ collectFarmClientServerTreeModules(markup, listed),
10460
10530
  );
10461
10531
  return attribute("data-farm-preload", waitsForClick ? entry : entry.concat(rootModules)) +
10462
10532
  attribute("data-farm-preload-router", farmClientModulePreloads.router || []) +
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  isExplicitFarmServerComponentsMode,
3
3
  resolveFarmServerComponentsMode
4
- } from "./chunk-BCCCPFHQ.mjs";
4
+ } from "./chunk-HV6CYSMF.mjs";
5
5
  import {
6
6
  logger
7
7
  } from "./chunk-U6GMCDRS.mjs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createRouteTypeDeclarations,
3
3
  generateRouteTypes
4
- } from "./chunk-L5HDCDFT.mjs";
4
+ } from "./chunk-YNPVG2GG.mjs";
5
5
  import {
6
6
  APITypeGenerator
7
7
  } from "./chunk-HQ2VAJLW.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FARM_VERSION
3
- } from "./chunk-I5CVJ24H.mjs";
3
+ } from "./chunk-GWPANDW3.mjs";
4
4
 
5
5
  // src/deployment-environment.ts
6
6
  function isFarmProductionDeploymentEnvironment(env = process.env) {
@@ -1,6 +1,6 @@
1
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; }
2
2
 
3
- var _chunk22BTYPIXcjs = require('./chunk-22BTYPIX.cjs');
3
+ var _chunkTQJ35BBWcjs = require('./chunk-TQJ35BBW.cjs');
4
4
 
5
5
 
6
6
 
@@ -354,7 +354,7 @@ function requestEvent(metadata, method, status, durationMs) {
354
354
  id: uuid(),
355
355
  requestId: metadata.id,
356
356
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
357
- route: routeTemplate(_chunk22BTYPIXcjs.getFarmRouteLabel.call(void 0, metadata.route)),
357
+ route: routeTemplate(_chunkTQJ35BBWcjs.getFarmRouteLabel.call(void 0, metadata.route)),
358
358
  ...metadata.path ? { path: metadata.path } : {},
359
359
  agent: metadata.agent,
360
360
  kind: "request",
@@ -410,7 +410,7 @@ function toolEvent(metadata, event, payloads) {
410
410
  id: uuid(),
411
411
  requestId: metadata.id,
412
412
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
413
- route: routeTemplate(_chunk22BTYPIXcjs.getFarmRouteLabel.call(void 0, metadata.route)),
413
+ route: routeTemplate(_chunkTQJ35BBWcjs.getFarmRouteLabel.call(void 0, metadata.route)),
414
414
  ...metadata.path ? { path: metadata.path } : {},
415
415
  agent: metadata.agent,
416
416
  kind: "mcp.tool",
@@ -496,7 +496,7 @@ async function receiveWebMCPReport(request, exporter, options, webmcp, waitUntil
496
496
  exporter.enqueue({
497
497
  id: uuid(),
498
498
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
499
- route: routeTemplate(_chunk22BTYPIXcjs.getFarmRouteLabel.call(void 0, route)),
499
+ route: routeTemplate(_chunkTQJ35BBWcjs.getFarmRouteLabel.call(void 0, route)),
500
500
  ...path ? { path } : {},
501
501
  agent: _chunk2NOHVIJ3cjs.classifyFarmClient.call(void 0, request),
502
502
  kind: "mcp.tool",
@@ -18,7 +18,7 @@ var _chunkHR5GU4UUcjs = require('./chunk-HR5GU4UU.cjs');
18
18
  var _chunkNDOE76QCcjs = require('./chunk-NDOE76QC.cjs');
19
19
 
20
20
 
21
- var _chunkBOEDYXAXcjs = require('./chunk-BOEDYXAX.cjs');
21
+ var _chunkFDU4Q4QPcjs = require('./chunk-FDU4Q4QP.cjs');
22
22
 
23
23
 
24
24
 
@@ -599,7 +599,7 @@ async function resolveAPIContext(options) {
599
599
  config: options.config,
600
600
  configPath: options.configPath
601
601
  }));
602
- const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkBOEDYXAXcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
602
+ const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkFDU4Q4QPcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
603
603
  const guardedPaths = new Set(_nullishCoalesce(_optionalChain([runtimeConfig, 'optionalAccess', _25 => _25.guardedPaths]), () => ( [])));
604
604
  return {
605
605
  root,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getFarmRouteLabel
3
- } from "./chunk-3WM7VBGW.mjs";
3
+ } from "./chunk-CVKTYG4L.mjs";
4
4
  import {
5
5
  _classifyFarmMCPSession,
6
6
  _farmMCPClientSession,
@@ -6,7 +6,7 @@ var _chunk7KJJ4SBScjs = require('./chunk-7KJJ4SBS.cjs');
6
6
 
7
7
 
8
8
 
9
- var _chunk3OKSEJ33cjs = require('./chunk-3OKSEJ33.cjs');
9
+ var _chunkT7UC2ORAcjs = require('./chunk-T7UC2ORA.cjs');
10
10
 
11
11
 
12
12
  var _chunk3BIASUGRcjs = require('./chunk-3BIASUGR.cjs');
@@ -88,8 +88,8 @@ function resolveFarmIsland(props, reference) {
88
88
  }
89
89
  }
90
90
  function usesFarmRendererIslands(config) {
91
- const renderer = _chunk3OKSEJ33cjs.resolveFarmRenderer.call(void 0, config.renderer);
92
- return !_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, renderer) && _chunk3OKSEJ33cjs.getFarmRendererCapabilities.call(void 0, renderer).islands && _optionalChain([config, 'access', _2 => _2.experimental, 'optionalAccess', _3 => _3.isolatedClientHydration]) === "enabled" && _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _4 => _4.experimental, 'optionalAccess', _5 => _5.serverComponents])) === void 0;
91
+ const renderer = _chunkT7UC2ORAcjs.resolveFarmRenderer.call(void 0, config.renderer);
92
+ return !_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, renderer) && _chunkT7UC2ORAcjs.getFarmRendererCapabilities.call(void 0, renderer).islands && _optionalChain([config, 'access', _2 => _2.experimental, 'optionalAccess', _3 => _3.isolatedClientHydration]) === "enabled" && _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _4 => _4.experimental, 'optionalAccess', _5 => _5.serverComponents])) === void 0;
93
93
  }
94
94
 
95
95
 
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-HR4N2K4V.mjs";
5
5
  import {
6
6
  normalizeFarmProductionSiteOrigin
7
- } from "./chunk-IRJSZAJB.mjs";
7
+ } from "./chunk-7UTRNV6R.mjs";
8
8
  import {
9
9
  resolveFarmAppManifestConfig
10
10
  } from "./chunk-SQ5O7I3L.mjs";
@@ -29,7 +29,7 @@ import {
29
29
  } from "./chunk-YT2ZMLXK.mjs";
30
30
  import {
31
31
  FARM_VERSION
32
- } from "./chunk-I5CVJ24H.mjs";
32
+ } from "./chunk-GWPANDW3.mjs";
33
33
  import {
34
34
  applyFarmBasePath
35
35
  } from "./chunk-SF3JB56B.mjs";
@@ -45,7 +45,7 @@ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
45
45
 
46
46
 
47
47
 
48
- var _chunk3OKSEJ33cjs = require('./chunk-3OKSEJ33.cjs');
48
+ var _chunkT7UC2ORAcjs = require('./chunk-T7UC2ORA.cjs');
49
49
 
50
50
 
51
51
  var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
@@ -1050,7 +1050,7 @@ function validateConfigRouteSources(routes, field) {
1050
1050
  return routes;
1051
1051
  }
1052
1052
  async function resolveConfig(userConfig, mode) {
1053
- _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([userConfig, 'access', _44 => _44.experimental, 'optionalAccess', _45 => _45.serverComponents]));
1053
+ _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([userConfig, 'access', _44 => _44.experimental, 'optionalAccess', _45 => _45.serverComponents]));
1054
1054
  const projectRoot = userConfig.root || process.cwd();
1055
1055
  const layerResolution = await _chunk52Q4OB4Acjs.resolveFarmLayers.call(void 0, userConfig, {
1056
1056
  root: projectRoot,
@@ -1067,7 +1067,7 @@ async function resolveConfig(userConfig, mode) {
1067
1067
  'The top-level "output" option is not supported and has no effect. Configure `deploy.target`, `deploy.preset`, or `deploy.outputDir` for deployment output, and use route rendering configuration for static pages.'
1068
1068
  );
1069
1069
  }
1070
- if (_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, _chunk3OKSEJ33cjs.resolveFarmRenderer.call(void 0, userConfig.renderer))) {
1070
+ if (_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, _chunkT7UC2ORAcjs.resolveFarmRenderer.call(void 0, userConfig.renderer))) {
1071
1071
  userConfig = await applyFarmDocsFrameworkAutoDetection(userConfig, {
1072
1072
  root: userConfig.root || projectRoot
1073
1073
  });
@@ -1097,7 +1097,7 @@ async function resolveConfig(userConfig, mode) {
1097
1097
  const srcDir = userConfig.srcDir || "src";
1098
1098
  _chunkMNUYXZV7cjs.setFarmProjectSourceDir.call(void 0, root, srcDir);
1099
1099
  const docs = await resolveDocsConfig(userConfig.docs, { root, srcDir });
1100
- const renderer = _chunk3OKSEJ33cjs.resolveFarmRenderer.call(void 0, userConfig.renderer);
1100
+ const renderer = _chunkT7UC2ORAcjs.resolveFarmRenderer.call(void 0, userConfig.renderer);
1101
1101
  _chunkL2GUEYHRcjs.assertFarmDocsAdapterRenderer.call(void 0, docs, renderer.name);
1102
1102
  const md = _chunk2NOHVIJ3cjs.resolveMarkdownConfig.call(void 0, userConfig.md);
1103
1103
  const mdx = _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, userConfig.mdx);
@@ -1182,13 +1182,13 @@ async function resolveConfig(userConfig, mode) {
1182
1182
  serverActions: false,
1183
1183
  // Islands mode hydrates client components as islands (RFC 0003); an app can still pick
1184
1184
  // isolatedClientHydration itself.
1185
- isolatedClientHydration: _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([userConfig, 'access', _55 => _55.experimental, 'optionalAccess', _56 => _56.serverComponents])) === "islands" ? "enabled" : "off",
1185
+ isolatedClientHydration: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([userConfig, 'access', _55 => _55.experimental, 'optionalAccess', _56 => _56.serverComponents])) === "islands" ? "enabled" : "off",
1186
1186
  ppr: false,
1187
1187
  ...userConfig.experimental
1188
1188
  },
1189
1189
  agent: resolveFarmAgentConfig(userConfig.agent, {
1190
1190
  docs: docs.enabled,
1191
- pages: !_chunk3OKSEJ33cjs.isFarmRendererDisabled.call(void 0, userConfig.renderer)
1191
+ pages: !_chunkT7UC2ORAcjs.isFarmRendererDisabled.call(void 0, userConfig.renderer)
1192
1192
  }),
1193
1193
  desktop: _nullishCoalesce(_optionalChain([desktopSetup, 'optionalAccess', _57 => _57.desktop]), () => ( null)),
1194
1194
  ...userConfig.mobile !== void 0 ? { mobileClient: true } : {},
@@ -1211,7 +1211,7 @@ async function resolveConfig(userConfig, mode) {
1211
1211
  routeRules,
1212
1212
  images: _chunkMCSRMEQVcjs.resolveFarmImageConfig.call(void 0,
1213
1213
  userConfig.images,
1214
- _chunk3OKSEJ33cjs.isFarmRendererDisabled.call(void 0, userConfig.renderer) ? "none" : void 0
1214
+ _chunkT7UC2ORAcjs.isFarmRendererDisabled.call(void 0, userConfig.renderer) ? "none" : void 0
1215
1215
  ),
1216
1216
  performance: _chunkEACD6ND7cjs.resolveFarmPerformanceConfig.call(void 0, userConfig.performance),
1217
1217
  theme: _chunkWT6RAN2Icjs.resolveFarmThemeConfig.call(void 0, userConfig.theme, basePath),