@farm.js/core 0.1.87 → 0.2.0-beta.0
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/analyzer-B2TRJT3B.cjs +17 -0
- package/dist/{analyzer-W4EB7DHL.mjs → analyzer-PWHYGER6.mjs} +2 -2
- package/dist/api/route-manager.cjs +3 -3
- package/dist/api/route-manager.mjs +2 -2
- package/dist/api.cjs +4 -4
- package/dist/api.mjs +3 -3
- package/dist/{chunk-B7L24VPX.cjs → chunk-22KXTL3I.cjs} +6 -4
- package/dist/{chunk-FULX5RYX.cjs → chunk-2OR5WAD5.cjs} +19 -13
- package/dist/{chunk-WSQ3S3NV.cjs → chunk-3MY6TNNE.cjs} +13 -12
- package/dist/{chunk-A4WWKG2B.cjs → chunk-5ZWXTIGE.cjs} +2 -2
- package/dist/{chunk-HYL372GW.cjs → chunk-6266WH6X.cjs} +1 -1
- package/dist/chunk-65LZRVCZ.mjs +18 -0
- package/dist/{chunk-ZCX2XJPY.cjs → chunk-7LBNWL3L.cjs} +2 -2
- package/dist/{chunk-4FGTNYHE.mjs → chunk-BJHXFEAF.mjs} +2 -2
- package/dist/chunk-BQHIJOZM.cjs +13 -0
- package/dist/{chunk-VCZ4EM5K.cjs → chunk-CFLRUCN7.cjs} +143 -136
- package/dist/{chunk-IM422XKU.cjs → chunk-CNGGEHXY.cjs} +2 -2
- package/dist/{chunk-B5QRNCIE.mjs → chunk-DATICPTO.mjs} +1 -1
- package/dist/{chunk-XMVZXZ32.cjs → chunk-ERV422FO.cjs} +2 -2
- package/dist/{chunk-33WR5XV5.cjs → chunk-FEWCWBOF.cjs} +4 -4
- package/dist/{chunk-FLMALEY2.mjs → chunk-GGD57DJA.mjs} +3 -25
- package/dist/{chunk-HQ2VAJLW.mjs → chunk-GV5D5EM6.mjs} +1 -1
- package/dist/{chunk-6MZSTPD2.mjs → chunk-H47EH24T.mjs} +1 -1
- package/dist/{chunk-OBVBII5K.cjs → chunk-HU4R2PPW.cjs} +2 -2
- package/dist/{chunk-N3VMHPIY.mjs → chunk-HZY63K5C.mjs} +2 -2
- package/dist/{chunk-HFRG2IQS.mjs → chunk-JDO3X7RB.mjs} +5 -4
- package/dist/{chunk-XFUPWRKT.cjs → chunk-JGUMFTZT.cjs} +4 -4
- package/dist/chunk-JIGWHFA5.mjs +32 -0
- package/dist/{chunk-YBXIVQCE.cjs → chunk-JP5TWUK2.cjs} +4 -4
- package/dist/{chunk-UGD53SNO.cjs → chunk-KQ6TYQU7.cjs} +16 -12
- package/dist/{chunk-K5FLQJW5.mjs → chunk-L6ZL35ZJ.mjs} +6 -4
- package/dist/{chunk-Q73LRKLP.mjs → chunk-LUGQUU4S.mjs} +1 -1
- package/dist/{chunk-LIWVPE72.mjs → chunk-M4CNAZMS.mjs} +23 -16
- package/dist/{chunk-QLRI2BX5.mjs → chunk-MM4U2NNI.mjs} +4 -4
- package/dist/{chunk-5D73SKF3.mjs → chunk-MRULVIH3.mjs} +1 -1
- package/dist/{chunk-LBJOHMTB.mjs → chunk-MZPPT5NA.mjs} +1 -1
- package/dist/{chunk-2UYYXSUS.mjs → chunk-N5NRXLCX.mjs} +4 -2
- package/dist/{chunk-U3A46QFD.cjs → chunk-PA3VZNWU.cjs} +6 -6
- package/dist/{chunk-2PJVEL56.cjs → chunk-PCAEJNQF.cjs} +5 -27
- package/dist/{chunk-TI4BZV6M.cjs → chunk-PQ6DBVJ2.cjs} +53 -53
- package/dist/chunk-PTAGDZ7I.mjs +13 -0
- package/dist/{chunk-3AV4DCXY.mjs → chunk-PWTBXYJY.mjs} +12 -6
- package/dist/{chunk-PO5MZIWK.mjs → chunk-QBXS4TNG.mjs} +6 -2
- package/dist/chunk-QZUCVJZJ.cjs +18 -0
- package/dist/{chunk-EZYNIADW.mjs → chunk-SCOKBXHS.mjs} +45 -29
- package/dist/{chunk-CXHVRHM2.cjs → chunk-SG5RFGV6.cjs} +2 -2
- package/dist/{chunk-VCI776NG.cjs → chunk-SUACCCZG.cjs} +12 -10
- package/dist/{chunk-CN2JOTRO.cjs → chunk-THGSPDFD.cjs} +7 -7
- package/dist/{chunk-SDNYULFS.cjs → chunk-TQFIZRON.cjs} +157 -141
- package/dist/{chunk-7BNVUIGL.cjs → chunk-VMGQOP7X.cjs} +2 -2
- package/dist/{chunk-4SJ22WTT.mjs → chunk-W3ZBLFLU.mjs} +1 -1
- package/dist/{chunk-26HESRBL.mjs → chunk-WOTAU3BN.mjs} +1 -1
- package/dist/{chunk-JB4BHRFK.cjs → chunk-WP77JDKI.cjs} +16 -16
- package/dist/{chunk-3F55K4MC.mjs → chunk-WPB6HJC7.mjs} +1 -1
- package/dist/{chunk-VPGEYX5Y.mjs → chunk-WX752VMN.mjs} +2 -2
- package/dist/{chunk-O7K4HMAQ.mjs → chunk-XJJQAFZX.mjs} +1 -1
- package/dist/{chunk-RGYS5OPL.cjs → chunk-XRYLMTYF.cjs} +3 -3
- package/dist/{chunk-QSDIJ45N.mjs → chunk-YCHIR3X6.mjs} +1 -1
- package/dist/chunk-YIGUFJMR.cjs +32 -0
- package/dist/{chunk-A2PPQ5LB.mjs → chunk-ZOD6EYWE.mjs} +1 -1
- package/dist/client.cjs +8 -6
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +7 -5
- package/dist/{devtools-GWJZPWIW.mjs → devtools-2CRVXV7E.mjs} +1 -1
- package/dist/{devtools-GPIKZ5AV.cjs → devtools-RL4AU5KD.cjs} +2 -2
- package/dist/docs.cjs +3 -3
- package/dist/docs.mjs +2 -2
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/i18n/client.cjs +11 -10
- package/dist/i18n/client.mjs +3 -2
- package/dist/index.cjs +30 -28
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +25 -23
- package/dist/internal/build-runtime.cjs +17 -17
- package/dist/internal/build-runtime.mjs +16 -16
- package/dist/internal/cli-runtime.cjs +5 -5
- package/dist/internal/cli-runtime.mjs +4 -4
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +11 -12
- package/dist/internal/client-runtime.d.mts +6 -4
- package/dist/internal/client-runtime.d.ts +6 -4
- package/dist/internal/client-runtime.mjs +11 -12
- package/dist/internal/config-runtime.cjs +3 -3
- package/dist/internal/config-runtime.mjs +2 -2
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/islands-boot.cjs +20 -15
- package/dist/internal/islands-boot.mjs +6 -1
- 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 +4 -4
- package/dist/internal/production-runtime.mjs +3 -3
- package/dist/internal/spa-router.cjs +4 -3
- package/dist/internal/spa-router.d.mts +1 -1
- package/dist/internal/spa-router.d.ts +1 -1
- package/dist/internal/spa-router.mjs +3 -2
- package/dist/{manager-PX4QN4HK.cjs → manager-D4DZRBRS.cjs} +4 -4
- package/dist/{manager-OMTC5FOJ.mjs → manager-PKPQGBAE.mjs} +3 -3
- package/dist/{navigation-delegate.d-ChfinbWB.d.mts → navigation-delegate.d-B9GjWbov.d.mts} +1 -1
- package/dist/{navigation-delegate.d-fMgELdAe.d.ts → navigation-delegate.d-BbW1_pf_.d.ts} +1 -1
- package/dist/navigation.cjs +6 -5
- package/dist/navigation.d.mts +2 -2
- package/dist/navigation.d.ts +2 -2
- package/dist/navigation.mjs +5 -4
- package/dist/plugin.cjs +12 -12
- package/dist/plugin.mjs +11 -11
- package/dist/query/client.cjs +8 -7
- package/dist/query/client.mjs +3 -2
- package/dist/renderer-client.cjs +14 -13
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +5 -4
- package/dist/{router.d-D5Mp7bpO.d.ts → router.d-Bm9FNSu3.d.ts} +1 -1
- package/dist/{router.d-DrQ1QDFk.d.mts → router.d-YKVirmj4.d.mts} +1 -1
- package/dist/{rsc-pipeline-TQOSDWOU.cjs → rsc-pipeline-3DYC5ZXW.cjs} +3 -3
- package/dist/{rsc-pipeline-KLMQU3YP.mjs → rsc-pipeline-LRB4ZG6I.mjs} +2 -2
- package/dist/{runtime-BDPBO65S.mjs → runtime-3WJNNAAR.mjs} +2 -2
- package/dist/{runtime-CQSCRVZ7.cjs → runtime-CRFF32H6.cjs} +4 -4
- package/dist/server.cjs +47 -33
- package/dist/server.mjs +27 -13
- package/dist/{spa-router.d-CXgvy-7L.d.mts → spa-router.d-DGmropfK.d.mts} +3 -1
- package/dist/{spa-router.d-BXxoU3Cv.d.ts → spa-router.d-nE1jHNGt.d.ts} +3 -1
- package/dist/{store-core.d-D00BsbnO.d.ts → store-core.d-B5cwOd8g.d.ts} +2 -2
- package/dist/{store-core.d-CDbVAbTn.d.mts → store-core.d-C-gATBwd.d.mts} +2 -2
- package/dist/testing.cjs +2 -2
- package/dist/testing.mjs +2 -2
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +12 -12
- package/dist/vite.mjs +11 -11
- package/package.json +3 -3
- package/dist/analyzer-LLU2Z6I4.cjs +0 -17
- package/dist/chunk-SBDWCDS6.cjs +0 -8
- package/dist/chunk-YX6AFPXC.mjs +0 -8
- /package/dist/{chunk-ALOFMAFA.mjs → chunk-BGEA4K7C.mjs} +0 -0
- /package/dist/{chunk-MZR22RAC.cjs → chunk-IRPXOTEN.cjs} +0 -0
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
import {
|
|
33
33
|
collectFarmNativeServerFns,
|
|
34
34
|
findFarmNativeScreenFiles
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-WPB6HJC7.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-
|
|
43
|
+
} from "./chunk-YCHIR3X6.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-
|
|
73
|
+
} from "./chunk-BGEA4K7C.mjs";
|
|
74
74
|
import {
|
|
75
75
|
resolveFarmInstrumentationFile
|
|
76
76
|
} from "./chunk-QRNYSISP.mjs";
|
|
@@ -116,7 +116,7 @@ import {
|
|
|
116
116
|
resolveFarmNotFoundComponentPath,
|
|
117
117
|
resolveFarmRouteRootStrategy,
|
|
118
118
|
toBakedMarkdownSourcePath
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-MM4U2NNI.mjs";
|
|
120
120
|
import {
|
|
121
121
|
TAILWIND_CSS_BROWSER_TARGET,
|
|
122
122
|
generateFarmClientPluginEntryCode,
|
|
@@ -132,11 +132,11 @@ import {
|
|
|
132
132
|
readRouteRenderingDirectiveFromFile,
|
|
133
133
|
resolveRouteRenderingConfig,
|
|
134
134
|
resolveRouteRenderingConfigFromFile
|
|
135
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-W3ZBLFLU.mjs";
|
|
136
136
|
import {
|
|
137
137
|
FARM_PRERENDER_ENV,
|
|
138
138
|
_farmWebMCPReportsEnabled
|
|
139
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-MRULVIH3.mjs";
|
|
140
140
|
import {
|
|
141
141
|
HOISTED_HEAD_ELEMENT,
|
|
142
142
|
appMiddlewareMayHandlePath,
|
|
@@ -163,7 +163,7 @@ import {
|
|
|
163
163
|
listFarmBuiltInRoutePaths,
|
|
164
164
|
resolveFarmApiCatalogInput,
|
|
165
165
|
resolveFarmAppManifestInput
|
|
166
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-BJHXFEAF.mjs";
|
|
167
167
|
import {
|
|
168
168
|
FARM_DEFAULT_MCP_PATH,
|
|
169
169
|
createFarmDefaultMCPServer,
|
|
@@ -171,7 +171,7 @@ import {
|
|
|
171
171
|
} from "./chunk-HR4N2K4V.mjs";
|
|
172
172
|
import {
|
|
173
173
|
isFarmPreviewDeploymentEnvironment
|
|
174
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-LUGQUU4S.mjs";
|
|
175
175
|
import {
|
|
176
176
|
FARM_NATIVE_SERVER_FN_PLUGIN
|
|
177
177
|
} from "./chunk-L4RTTTVE.mjs";
|
|
@@ -192,7 +192,7 @@ import {
|
|
|
192
192
|
withFarmSourceSnapshot,
|
|
193
193
|
withFarmSourceSnapshotOf,
|
|
194
194
|
withPackageClientBoundaryCache
|
|
195
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-WOTAU3BN.mjs";
|
|
196
196
|
import {
|
|
197
197
|
generateFarmDocsAdapterClientRuntime,
|
|
198
198
|
getFarmDocsAdapterConfigModule
|
|
@@ -281,7 +281,10 @@ import {
|
|
|
281
281
|
} from "./chunk-QD34VE4N.mjs";
|
|
282
282
|
import {
|
|
283
283
|
APIRouteManager
|
|
284
|
-
} from "./chunk-
|
|
284
|
+
} from "./chunk-JDO3X7RB.mjs";
|
|
285
|
+
import {
|
|
286
|
+
hasPolyroutePlugin
|
|
287
|
+
} from "./chunk-PTAGDZ7I.mjs";
|
|
285
288
|
import {
|
|
286
289
|
readFarmI18nCatalogs
|
|
287
290
|
} from "./chunk-VO55MMBX.mjs";
|
|
@@ -309,7 +312,7 @@ import {
|
|
|
309
312
|
} from "./chunk-2I6PUKWJ.mjs";
|
|
310
313
|
import {
|
|
311
314
|
FARM_VERSION
|
|
312
|
-
} from "./chunk-
|
|
315
|
+
} from "./chunk-XJJQAFZX.mjs";
|
|
313
316
|
import {
|
|
314
317
|
FARM_VIDEO_PLAYER_PATH
|
|
315
318
|
} from "./chunk-AG27TI6Q.mjs";
|
|
@@ -1503,7 +1506,7 @@ function collectServerReadSSRAssets(bundle) {
|
|
|
1503
1506
|
}
|
|
1504
1507
|
return assets;
|
|
1505
1508
|
}
|
|
1506
|
-
function collectServerOnlySSRAssets(bundle) {
|
|
1509
|
+
function collectServerOnlySSRAssets(bundle, polyroute = false) {
|
|
1507
1510
|
const serverOnly = /* @__PURE__ */ new Set();
|
|
1508
1511
|
const publicReferenceSources = [];
|
|
1509
1512
|
for (const [fileName, output] of Object.entries(bundle)) {
|
|
@@ -1526,6 +1529,7 @@ function collectServerOnlySSRAssets(bundle) {
|
|
|
1526
1529
|
}
|
|
1527
1530
|
}
|
|
1528
1531
|
for (const fileName of serverOnly) {
|
|
1532
|
+
if (polyroute && /(?:^|\/)polyroute\/[a-f0-9]+\/[^/]+\.wasm$/.test(fileName)) continue;
|
|
1529
1533
|
const name = path10.posix.basename(fileName);
|
|
1530
1534
|
if (publicReferenceSources.some((source) => source.includes(name))) {
|
|
1531
1535
|
serverOnly.delete(fileName);
|
|
@@ -3035,7 +3039,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
3035
3039
|
}
|
|
3036
3040
|
const { bundle: ssrBundle, entryFile: ssrEntryFile, configuredHeaderRoutes } = ssrResult;
|
|
3037
3041
|
assertServerReadSSRAssetsSupported(ssrBundle, preset, root);
|
|
3038
|
-
await writeSSRAssetsToClient(ssrBundle, clientOutputDir);
|
|
3042
|
+
await writeSSRAssetsToClient(ssrBundle, clientOutputDir, ssrResult.polyroute);
|
|
3039
3043
|
if (!rendererDisabled) {
|
|
3040
3044
|
await writeFarmVideoPlayerToClient(clientOutputDir);
|
|
3041
3045
|
}
|
|
@@ -3113,9 +3117,9 @@ function varyFarmNitroCacheRules(rules, headerNames) {
|
|
|
3113
3117
|
})
|
|
3114
3118
|
);
|
|
3115
3119
|
}
|
|
3116
|
-
async function writeSSRAssetsToClient(bundle, outputDir) {
|
|
3120
|
+
async function writeSSRAssetsToClient(bundle, outputDir, polyroute) {
|
|
3117
3121
|
const fs5 = await import("fs/promises");
|
|
3118
|
-
const serverOnlyAssets = collectServerOnlySSRAssets(bundle);
|
|
3122
|
+
const serverOnlyAssets = collectServerOnlySSRAssets(bundle, polyroute);
|
|
3119
3123
|
for (const [fileName, output] of Object.entries(bundle)) {
|
|
3120
3124
|
if (output.type !== "asset" || serverOnlyAssets.has(fileName)) continue;
|
|
3121
3125
|
if (fileName === "farm-fonts.css") {
|
|
@@ -5332,7 +5336,7 @@ function isFarmDocsPath() {
|
|
|
5332
5336
|
// Farm.js Client Runtime (no client components)
|
|
5333
5337
|
${cssImport}
|
|
5334
5338
|
${layoutImports}
|
|
5335
|
-
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, reconcileFarmDocumentHead, runFarmNavigationDelegates, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
5339
|
+
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, isFarmSameDocumentFragment, readFarmLinkNavigateOptions, targetsCurrentContext, rememberFarmLinkLocale, reconcileFarmDocumentHead, runFarmNavigationDelegates, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
5336
5340
|
import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
|
|
5337
5341
|
${clientPluginEntry.imports}
|
|
5338
5342
|
${clientCachePersistence.imports}
|
|
@@ -5548,6 +5552,7 @@ ${generateUniversalRouterStateProperties()}
|
|
|
5548
5552
|
}
|
|
5549
5553
|
});
|
|
5550
5554
|
}
|
|
5555
|
+
if (isFarmSameDocumentFragment(url.href, window.location.href)) return;
|
|
5551
5556
|
|
|
5552
5557
|
const pathname = url.pathname + url.search;
|
|
5553
5558
|
if (this.readFreshPrefetch(pathname) !== undefined) return;
|
|
@@ -5619,7 +5624,7 @@ document.addEventListener("click", function(e) {
|
|
|
5619
5624
|
if (anchor.hasAttribute("download")) return;
|
|
5620
5625
|
if (hasAbsoluteNavigationHref(href)) return;
|
|
5621
5626
|
if (href.startsWith("#")) return;
|
|
5622
|
-
if (anchor
|
|
5627
|
+
if (!targetsCurrentContext(anchor)) return;
|
|
5623
5628
|
if (document.documentElement.dataset.farmDocsRuntime === "true") return;
|
|
5624
5629
|
if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
|
|
5625
5630
|
if (e.button !== 0) return;
|
|
@@ -5844,7 +5849,7 @@ ${lazyRoot ? "" : layoutImports}
|
|
|
5844
5849
|
${rendererClientImports}
|
|
5845
5850
|
${isolatedHydrationImport}
|
|
5846
5851
|
${providerClientCode.imports}
|
|
5847
|
-
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";
|
|
5852
|
+
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, keepFarmIslandValues, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, isFarmSameDocumentFragment, readFarmLinkNavigateOptions, targetsCurrentContext, rememberFarmLinkLocale, reconcileFarmDocumentHead, replayFarmQueuedInteraction, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
5848
5853
|
import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
|
|
5849
5854
|
${lazyMatcher ? "" : 'import { createFarmRouter, isFarmRouteActive, matchFarmRoute } from "@farm.js/core/router";'}
|
|
5850
5855
|
${clientPluginEntry.imports}
|
|
@@ -7237,6 +7242,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
7237
7242
|
}
|
|
7238
7243
|
});
|
|
7239
7244
|
}
|
|
7245
|
+
if (isFarmSameDocumentFragment(url.href, window.location.href)) return;
|
|
7240
7246
|
prefetchFarmClientRouteTable();
|
|
7241
7247
|
|
|
7242
7248
|
// A prefetch warms an ordinary future navigation, which reads the bare
|
|
@@ -7318,7 +7324,7 @@ document.addEventListener("click", function(e) {
|
|
|
7318
7324
|
if (anchor.hasAttribute("download")) return;
|
|
7319
7325
|
if (hasAbsoluteNavigationHref(href)) return;
|
|
7320
7326
|
if (href.startsWith("#")) return;
|
|
7321
|
-
if (anchor
|
|
7327
|
+
if (!targetsCurrentContext(anchor)) return;
|
|
7322
7328
|
if (document.documentElement.dataset.farmDocsRuntime === "true") return;
|
|
7323
7329
|
if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
|
|
7324
7330
|
if (e.button !== 0) return;
|
|
@@ -7370,6 +7376,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7370
7376
|
label: "for SSR"
|
|
7371
7377
|
});
|
|
7372
7378
|
}
|
|
7379
|
+
let polyroute = false;
|
|
7373
7380
|
let ssrBundle;
|
|
7374
7381
|
let ssrEntryFile;
|
|
7375
7382
|
const pageRoutes = collectedPageRoutes.map((route) => ({ ...route }));
|
|
@@ -7447,7 +7454,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7447
7454
|
const appDirs = getFarmAppDirectories(config);
|
|
7448
7455
|
let openAPIReference = null;
|
|
7449
7456
|
if (config.openapi.enabled && config.openapi.route) {
|
|
7450
|
-
const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-
|
|
7457
|
+
const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-PKPQGBAE.mjs");
|
|
7451
7458
|
const openAPIManager = new OpenAPIManager(appDirs, config.openapi, {
|
|
7452
7459
|
mode: "production",
|
|
7453
7460
|
apiBaseURL: config.api.baseURL,
|
|
@@ -7752,16 +7759,24 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7752
7759
|
},
|
|
7753
7760
|
{
|
|
7754
7761
|
name: "capture-ssr-bundle",
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7762
|
+
configResolved(config2) {
|
|
7763
|
+
polyroute = hasPolyroutePlugin(config2.plugins);
|
|
7764
|
+
},
|
|
7765
|
+
enforce: "post",
|
|
7766
|
+
generateBundle: {
|
|
7767
|
+
// Retain assets emitted by user plugins, including post-generateBundle hooks.
|
|
7768
|
+
order: "post",
|
|
7769
|
+
handler(_options, bundle) {
|
|
7770
|
+
ssrBundle = bundle;
|
|
7771
|
+
for (const [fileName, file] of Object.entries(bundle)) {
|
|
7772
|
+
if (file.type === "chunk" && file.isEntry) {
|
|
7773
|
+
ssrEntryFile = fileName;
|
|
7774
|
+
break;
|
|
7775
|
+
}
|
|
7776
|
+
}
|
|
7777
|
+
if (!ssrEntryFile) {
|
|
7778
|
+
throw new Error("No entry point found in SSR bundle");
|
|
7761
7779
|
}
|
|
7762
|
-
}
|
|
7763
|
-
if (!ssrEntryFile) {
|
|
7764
|
-
throw new Error("No entry point found in SSR bundle");
|
|
7765
7780
|
}
|
|
7766
7781
|
}
|
|
7767
7782
|
}
|
|
@@ -7791,6 +7806,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7791
7806
|
}
|
|
7792
7807
|
}
|
|
7793
7808
|
return {
|
|
7809
|
+
polyroute,
|
|
7794
7810
|
bundle: ssrBundle,
|
|
7795
7811
|
entryFile: ssrEntryFile,
|
|
7796
7812
|
configuredHeaderRoutes
|
|
@@ -18,7 +18,7 @@ var _chunkHR5GU4UUcjs = require('./chunk-HR5GU4UU.cjs');
|
|
|
18
18
|
var _chunkNDOE76QCcjs = require('./chunk-NDOE76QC.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkIRPXOTENcjs = require('./chunk-IRPXOTEN.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
|
|
602
|
+
const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkIRPXOTENcjs.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,
|
|
@@ -9,13 +9,14 @@ var _chunkKBGZ5FD6cjs = require('./chunk-KBGZ5FD6.cjs');
|
|
|
9
9
|
var _chunkP2355C6Ecjs = require('./chunk-P2355C6E.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunk3MY6TNNEcjs = require('./chunk-3MY6TNNE.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkHS4JPIGRcjs = require('./chunk-HS4JPIGR.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
var _chunkBQHIJOZMcjs = require('./chunk-BQHIJOZM.cjs');
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
|
|
@@ -148,7 +149,7 @@ function farmApiPlugin(options = {}) {
|
|
|
148
149
|
const existing = apiRoutesCache.get(routePath);
|
|
149
150
|
const existingFile = _optionalChain([endpointSources, 'access', _4 => _4.get, 'call', _5 => _5(routePath), 'optionalAccess', _6 => _6.get, 'call', _7 => _7(normalizedMethod)]);
|
|
150
151
|
if (existingFile) {
|
|
151
|
-
throw new (0,
|
|
152
|
+
throw new (0, _chunk3MY6TNNEcjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
|
|
152
153
|
}
|
|
153
154
|
if (existing) {
|
|
154
155
|
if (!existing.methods.includes(normalizedMethod)) {
|
|
@@ -276,6 +277,7 @@ function farmApiPlugin(options = {}) {
|
|
|
276
277
|
name: "@farm.js/core:api",
|
|
277
278
|
enforce: "pre",
|
|
278
279
|
configureServer(server) {
|
|
280
|
+
const polyroute = _chunkBQHIJOZMcjs.hasPolyroutePlugin.call(void 0, server.config.plugins);
|
|
279
281
|
projectRoot = server.config.root;
|
|
280
282
|
devServer = server;
|
|
281
283
|
const discoverFileRoutes = async (apiDir) => {
|
|
@@ -293,7 +295,7 @@ function farmApiPlugin(options = {}) {
|
|
|
293
295
|
const fullPath = path.join(dir, entry.name);
|
|
294
296
|
if (entry.isDirectory()) {
|
|
295
297
|
files.push(...findRouteFiles(fullPath));
|
|
296
|
-
} else if (
|
|
298
|
+
} else if (_chunkBQHIJOZMcjs.isFarmAPIRouteFileName.call(void 0, entry.name, polyroute)) {
|
|
297
299
|
files.push(fullPath);
|
|
298
300
|
}
|
|
299
301
|
}
|
|
@@ -323,7 +325,7 @@ function farmApiPlugin(options = {}) {
|
|
|
323
325
|
log(`API route discovered: ${availableMethods.join(", ")} ${routePath}`);
|
|
324
326
|
}
|
|
325
327
|
} catch (e) {
|
|
326
|
-
if (e instanceof
|
|
328
|
+
if (e instanceof _chunk3MY6TNNEcjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
|
|
327
329
|
log(`API route load failed at ${filePath}: ${e.message}`);
|
|
328
330
|
}
|
|
329
331
|
}
|
|
@@ -350,7 +352,7 @@ function farmApiPlugin(options = {}) {
|
|
|
350
352
|
}
|
|
351
353
|
}
|
|
352
354
|
} catch (e) {
|
|
353
|
-
if (e instanceof
|
|
355
|
+
if (e instanceof _chunk3MY6TNNEcjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
|
|
354
356
|
log(`Root routes.ts load failed: ${e.message}`);
|
|
355
357
|
}
|
|
356
358
|
break;
|
|
@@ -381,7 +383,7 @@ function farmApiPlugin(options = {}) {
|
|
|
381
383
|
}
|
|
382
384
|
}
|
|
383
385
|
} catch (e) {
|
|
384
|
-
if (e instanceof
|
|
386
|
+
if (e instanceof _chunk3MY6TNNEcjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
|
|
385
387
|
log(`Programmatic routes file load failed at ${routeFile}: ${e.message}`);
|
|
386
388
|
}
|
|
387
389
|
}
|
|
@@ -606,12 +608,12 @@ function farmApiPlugin(options = {}) {
|
|
|
606
608
|
log(`API router recreated`);
|
|
607
609
|
} catch (e) {
|
|
608
610
|
restoreRouteState(previousState);
|
|
609
|
-
if (e instanceof
|
|
611
|
+
if (e instanceof _chunk3MY6TNNEcjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
|
|
610
612
|
log(`Root routes.ts HMR failed: ${e.message}`);
|
|
611
613
|
}
|
|
612
614
|
return [];
|
|
613
615
|
}
|
|
614
|
-
if (normalizedFile.includes("/api/") && fileName.
|
|
616
|
+
if (normalizedFile.includes("/api/") && _chunkBQHIJOZMcjs.isFarmAPIRouteFileName.call(void 0, fileName, _chunkBQHIJOZMcjs.hasPolyroutePlugin.call(void 0, server.config.plugins))) {
|
|
615
617
|
const shortPath = normalizedFile.split("/api/")[1] || normalizedFile;
|
|
616
618
|
log(`API route updated: ${shortPath}`);
|
|
617
619
|
for (const mod of modules) {
|
|
@@ -644,7 +646,7 @@ function farmApiPlugin(options = {}) {
|
|
|
644
646
|
log(`API router recreated`);
|
|
645
647
|
} catch (e) {
|
|
646
648
|
restoreRouteState(previousState);
|
|
647
|
-
if (e instanceof
|
|
649
|
+
if (e instanceof _chunk3MY6TNNEcjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
|
|
648
650
|
log(`API route HMR failed: ${e.message}`);
|
|
649
651
|
}
|
|
650
652
|
return [];
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkWP77JDKIcjs = require('./chunk-WP77JDKI.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkKQ6TYQU7cjs = require('./chunk-KQ6TYQU7.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
10
10
|
|
|
11
11
|
// src/navigation.ts
|
|
12
12
|
function useRouter2() {
|
|
13
|
-
const router =
|
|
13
|
+
const router = _chunkWP77JDKIcjs.useRouter.call(void 0, );
|
|
14
14
|
return {
|
|
15
15
|
push: router.push,
|
|
16
16
|
replace: router.replace,
|
|
@@ -18,19 +18,19 @@ function useRouter2() {
|
|
|
18
18
|
forward: router.forward,
|
|
19
19
|
refresh() {
|
|
20
20
|
if (typeof window === "undefined") return Promise.resolve();
|
|
21
|
-
return
|
|
21
|
+
return _chunkKQ6TYQU7cjs.getRouter.call(void 0, ).refresh();
|
|
22
22
|
},
|
|
23
23
|
prefetch(href) {
|
|
24
24
|
if (typeof window === "undefined") return Promise.resolve();
|
|
25
|
-
return
|
|
25
|
+
return _chunkKQ6TYQU7cjs.getRouter.call(void 0, ).prefetch(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, href));
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
function usePathname() {
|
|
30
|
-
return
|
|
30
|
+
return _chunkWP77JDKIcjs.useRouter.call(void 0, ).pathname;
|
|
31
31
|
}
|
|
32
32
|
function useSearchParams() {
|
|
33
|
-
return
|
|
33
|
+
return _chunkWP77JDKIcjs.useRouter.call(void 0, ).searchParams;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
|