@markless/bundler 0.5.0 → 0.7.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.
@@ -447,17 +447,52 @@ function scalarPlanSourceReference(source) {
447
447
  }
448
448
  //#endregion
449
449
  //#region src/rebound-symbol-route.ts
450
- function emitReboundSymbolRoute(route, reboundName, localLoader, unboundLoad, indent) {
451
- if (!hasBoundSymbols(route)) return [];
452
- const rest = `symbolId.slice(${route.prefix.length})`;
453
- return [`${indent}const bound = ${JSON.stringify(route.boundSymbols)};`, `${indent}if (Object.hasOwn(bound, ${rest})) return ${reboundName}(${localLoader}(bound[${rest}]), ${JSON.stringify(route.prefix)}, () => ${unboundLoad});`];
454
- }
455
450
  function emitReboundSymbolImport(routes, reboundName) {
456
451
  return routes.some(hasBoundSymbols) ? `import { marklessReboundSymbol as ${reboundName} } from '@markless/web/fns/rebound-symbol';` : "";
457
452
  }
458
453
  function hasBoundSymbols(route) {
459
454
  return route.boundSymbols !== void 0 && Object.keys(route.boundSymbols).length > 0;
460
455
  }
456
+ /**
457
+ * One loader for every composed child route, driven by a table: a page with many
458
+ * instances of a child adds a row per instance, not a copy of the loader.
459
+ */
460
+ function emitSymbolRouteTable(input) {
461
+ const { routes, functionName, fallbackName, reboundName } = input;
462
+ const sources = [...new Set(routes.flatMap((route) => route.importSource ? [route.importSource] : []))];
463
+ const keyLists = [];
464
+ const table = routes.map((route) => `[${JSON.stringify(route.prefix)}, ${route.importSource ? sources.indexOf(route.importSource) : -1}, ${hasBoundSymbols(route) ? boundEntry(route.boundSymbols, keyLists) : 0}]`);
465
+ return [
466
+ emitReboundSymbolImport(routes, reboundName),
467
+ `const ${functionName}Imports = [${sources.map((source) => `() => import(${JSON.stringify(source)})`).join(", ")}];`,
468
+ keyLists.length > 0 ? `const ${functionName}BoundKeys = [${keyLists.join(", ")}];` : "",
469
+ `const ${functionName}Routes = [${table.join(", ")}];`,
470
+ `${input.exported ? "export " : ""}function ${functionName}(symbolId) {`,
471
+ `\tfor (const [prefix, at, bound] of ${functionName}Routes) {`,
472
+ " if (!symbolId.startsWith(prefix)) continue;",
473
+ " const rest = symbolId.slice(prefix.length);",
474
+ `\t\tconst unbound = () => at < 0 ? (prefix ? ${functionName}(rest) : ${fallbackName}(rest)) : ${functionName}Imports[at]().then((mod) => mod.loadSymbol ? mod.loadSymbol(rest) : Promise.reject(new Error(\`Unknown child async symbol \${symbolId}\`)));`,
475
+ hasAnyBound(routes) ? [keyLists.length > 0 ? `\t\tconst boundId = !bound ? undefined : Array.isArray(bound) ? (${functionName}BoundKeys[bound[1]].includes(rest) ? \`bound:\${encodeURIComponent(rest)}:\${bound[0]}\` : undefined) : Object.hasOwn(bound, rest) ? bound[rest] : undefined;` : " const boundId = bound && Object.hasOwn(bound, rest) ? bound[rest] : undefined;", `\t\tif (boundId) return ${reboundName}(${fallbackName}(boundId), prefix, unbound);`].join("\n") : "",
476
+ " return unbound();",
477
+ " }",
478
+ `\treturn ${fallbackName}(symbolId);`,
479
+ "}"
480
+ ].filter((line) => line !== "").join("\n");
481
+ }
482
+ function boundEntry(boundSymbols, keyLists) {
483
+ const entries = Object.entries(boundSymbols);
484
+ const [firstKey, firstId] = entries[0];
485
+ const head = `bound:${encodeURIComponent(firstKey)}:`;
486
+ const suffix = firstId.startsWith(head) ? firstId.slice(head.length) : void 0;
487
+ if (suffix === void 0 || entries.some(([key, id]) => id !== `bound:${encodeURIComponent(key)}:${suffix}`)) return JSON.stringify(boundSymbols);
488
+ const keys = JSON.stringify(entries.map(([key]) => key));
489
+ let index = keyLists.indexOf(keys);
490
+ if (index < 0) index = keyLists.push(keys) - 1;
491
+ return `[${JSON.stringify(suffix)}, ${index}]`;
492
+ }
493
+ function hasAnyBound(routes) {
494
+ return routes.some(hasBoundSymbols);
495
+ }
461
496
  //#endregion
462
497
  //#region src/source-module.ts
463
498
  const MARKLESS_VIRTUAL_PREFIX = "virtual:markless:";
@@ -725,8 +760,8 @@ function emitRowMintLoaderInstall() {
725
760
  * The same one line for per-enclosing-row wiring: only a page holding a `@for`
726
761
  * inside another `@for`'s rows names the module, so no other app emits its chunk.
727
762
  */
728
- function nestedRepeatsLoader(runtimeDemandMap) {
729
- return demandsKeyedRepeatModule(runtimeDemandMap, NESTED_REPEATS_RUNTIME_MODULE_ID) ? ["globalThis.__marklessNestedRepeats ??= (...input) =>", " import('@markless/web/fns/nested-repeats').then((nested) => nested.wireNestedRepeats(...input));"].join("\n") : null;
763
+ function nestedRepeatsLoader(runtimeDemandMap, linked = false) {
764
+ return linked || demandsKeyedRepeatModule(runtimeDemandMap, NESTED_REPEATS_RUNTIME_MODULE_ID) ? ["globalThis.__marklessNestedRepeats ??= (...input) =>", " import('@markless/web/fns/nested-repeats').then((nested) => nested.wireNestedRepeats(...input));"].join("\n") : null;
730
765
  }
731
766
  /**
732
767
  * True when the compiler folded the mint into a keyed-repeat record - which it
@@ -762,8 +797,8 @@ function componentRowLoader(input) {
762
797
  return input.linkedRowSlotReaders || demandsKeyedRepeatModule(input.runtimeDemandMap, ROW_SLOT_MINT_RUNTIME_MODULE_ID) ? emitRowSlotMintLoaderInstall() : void 0;
763
798
  }
764
799
  function clientRowMintLoader(input) {
765
- const mint = demandsRowComponentMint(input.runtimeDemandMap) ? emitRowComponentMintLoaderInstall() : componentRowLoader(input) ?? (demandsRowMint(input.runtimeDemandMap) ? emitRowMintLoaderInstall() : null);
766
- const nested = nestedRepeatsLoader(input.runtimeDemandMap);
800
+ const mint = demandsRowComponentMint(input.runtimeDemandMap) ? emitRowComponentMintLoaderInstall() : componentRowLoader(input) ?? (input.linkedRowTemplates || demandsRowMint(input.runtimeDemandMap) ? emitRowMintLoaderInstall() : null);
801
+ const nested = nestedRepeatsLoader(input.runtimeDemandMap, input.linkedNestedRepeats);
767
802
  return mint && nested ? `${mint}\n${nested}` : mint ?? nested;
768
803
  }
769
804
  function emitRowSlotMintLoaderInstall() {
@@ -798,7 +833,7 @@ function emitResumeModule(input) {
798
833
  runtimeDemandMap: input.servedScalarPlans
799
834
  } : input);
800
835
  const stagedPrerender = (input.prerenderTriggerGroups?.length ?? 0) > 0;
801
- const resumeContainerEvent = emitQueuedResumeContainerEvent(emitResumeContainerEvent(resumeSymbolLoader, input.needsFullResume ?? false, input.payloadState?.version === ASYNC_PROTOCOL_VERSION, servedPlansOnly ? "scalar" : composedLeanMode(input.symbolRoutes.length > 0, leanResumeMode(input.runtimeDemandMap)), scalarSpecializations, input.runtimeDemandMap, input.executionLog !== "never", input.prerenderDataId, stagedPrerender, componentRowLoader(input) ? input.lazyRenderDataId ?? input.renderDataId : void 0, input.symbolRoutes.length > 0 || servedPlansOnly, (input.closurePlanRoutes ?? []).some((route) => "importSource" in route) && scalarSpecializations.length > 0 && !input.prerenderDataId, input.streamsArms === true));
836
+ const resumeContainerEvent = emitQueuedResumeContainerEvent(emitResumeContainerEvent(resumeSymbolLoader, input.needsFullResume ?? false, input.storageCells !== true && input.payloadState?.version === ASYNC_PROTOCOL_VERSION, servedPlansOnly ? "scalar" : composedLeanMode(input.symbolRoutes.length > 0, leanResumeMode(input.runtimeDemandMap)), scalarSpecializations, input.runtimeDemandMap, input.executionLog !== "never", input.prerenderDataId, stagedPrerender, componentRowLoader(input) ? input.lazyRenderDataId ?? input.renderDataId : void 0, input.symbolRoutes.length > 0 || servedPlansOnly, (input.closurePlanRoutes ?? []).some((route) => "importSource" in route) && scalarSpecializations.length > 0 && !input.prerenderDataId, input.streamsArms === true));
802
837
  const closureImports = [
803
838
  "marklessClosureRouted",
804
839
  "marklessPrimeClosure",
@@ -818,8 +853,8 @@ function emitResumeModule(input) {
818
853
  ].join("\n") : input.rosterDerivation === true ? emitRosterResumeLoaderInstall() : null,
819
854
  demandsOverlay(input.runtimeDemandMap) ? emitOverlayLoaderInstall() : null,
820
855
  input.hasIdleEvents ? emitIdleTriggerInstall() : null,
821
- componentRowLoader(input) ?? (demandsRowMint(input.runtimeDemandMap) ? emitRowMintLoaderInstall() : null),
822
- nestedRepeatsLoader(input.runtimeDemandMap),
856
+ componentRowLoader(input) ?? (input.linkedRowTemplates || demandsRowMint(input.runtimeDemandMap) ? emitRowMintLoaderInstall() : null),
857
+ nestedRepeatsLoader(input.runtimeDemandMap, input.linkedNestedRepeats),
823
858
  scalarSpecializations.length > 0 ? [
824
859
  "import { marklessDecodeScalarCell, marklessReadScalarCell, marklessScalarSpecializedError } from '@markless/web/fns/scalar-specialized';",
825
860
  resumeContainerEvent.includes("marklessScalarServedOwner") ? `import { marklessScalarLocate, marklessScalarServedOwner, marklessScalarServedPrime${resumeContainerEvent.includes("marklessScalarServedRecord") ? ", marklessScalarServedRecord" : ""} } from '@markless/web/fns/scalar-served';` : "",
@@ -855,7 +890,7 @@ function emitQueuedResumeContainerEvent(source, { censusRepair = true } = {}) {
855
890
  " const root = input.root;",
856
891
  censusRepair ? " if (root.__marklessShifted) return import('@markless/web/fns/served-census-repair').then((census) => (census.marklessRepairCensus(root), resumeContainerEvent(input)));" : "",
857
892
  " if (!root.__marklessDispatch) {",
858
- " let handler = marklessResumeContainerEvent, tail = Promise.resolve(), done = tail, lastEvent = null, lastEventTime = undefined;",
893
+ " let handler = marklessResumeContainerEvent, tail = Promise.resolve(), done = tail, lastEvent = null, lastEventTime = undefined, seen = new WeakMap();",
859
894
  " root.__marklessRegisterDispatch = next => {",
860
895
  " const fallback = handler;",
861
896
  " handler = input => next(input, fallback);",
@@ -863,7 +898,8 @@ function emitQueuedResumeContainerEvent(source, { censusRepair = true } = {}) {
863
898
  " root.__marklessDispatch = next => {",
864
899
  " const event = next.event, eventTime = event?.timeStamp;",
865
900
  " if (event && next.eventRecord && next.element) event.__marklessPressHost ??= next.element;",
866
- " if (event === lastEvent && eventTime === lastEventTime) return done;",
901
+ " if ((event === lastEvent && eventTime === lastEventTime) || (seen.has(event) && seen.get(event) === eventTime)) return done;",
902
+ " if (Object(event) === event) seen.set(event, eventTime);",
867
903
  " lastEvent = event;",
868
904
  " lastEventTime = eventTime;",
869
905
  " let release;",
@@ -884,23 +920,15 @@ function emitComposedArmRecordsInstall() {
884
920
  }
885
921
  function emitLazySymbolRouteFunction(routes, functionName, fallbackName = "loadSymbol", includeScalarActionPlans = false) {
886
922
  if (routes.length === 0) return "";
887
- const ordered = [...routes].sort((left, right) => right.prefix.length - left.prefix.length);
888
- const reboundName = `${functionName}Rebound`;
889
- return [
890
- emitReboundSymbolImport(ordered, reboundName),
891
- `function ${functionName}(symbolId) {`,
892
- ...ordered.flatMap((route) => {
893
- const unbound = "importSource" in route ? `import(${JSON.stringify(symbolRouteImportSource$1(route.importSource, includeScalarActionPlans))}).then((mod) => mod.loadSymbol ? mod.loadSymbol(symbolId.slice(${route.prefix.length})) : Promise.reject(new Error(\`Unknown child async symbol \${symbolId}\`)))` : `${route.prefix.length > 0 ? functionName : fallbackName}(symbolId.slice(${route.prefix.length}))`;
894
- return [
895
- ` if (symbolId.startsWith(${JSON.stringify(route.prefix)})) {`,
896
- ...emitReboundSymbolRoute(route, reboundName, fallbackName, unbound, " "),
897
- ` return ${unbound};`,
898
- " }"
899
- ];
900
- }),
901
- ` return ${fallbackName}(symbolId);`,
902
- "}"
903
- ].filter((line) => line !== "").join("\n");
923
+ return emitSymbolRouteTable({
924
+ routes: [...routes].sort((left, right) => right.prefix.length - left.prefix.length).map((route) => "importSource" in route ? {
925
+ ...route,
926
+ importSource: symbolRouteImportSource$1(route.importSource, includeScalarActionPlans)
927
+ } : route),
928
+ functionName,
929
+ fallbackName,
930
+ reboundName: `${functionName}Rebound`
931
+ });
904
932
  }
905
933
  function emitsClosurePlanLoader(actions, routes) {
906
934
  return routes.some((route) => "importSource" in route) || actions.some((action) => action.plan?.kind === "closure");
@@ -1296,7 +1324,7 @@ function emitSpecializedScalarDispatcher(actions, loadSymbolName, fallback, reso
1296
1324
  " throw error;",
1297
1325
  " }",
1298
1326
  " }",
1299
- fallback === "fail" ? " return;" : ` return ${fallbackName}(input, "event-match");`,
1327
+ ...fallback === "fail" ? [" return;"] : [" if (input.logOnly) return;", ` return ${fallbackName}(input, "event-match");`],
1300
1328
  "}",
1301
1329
  fallback === "fail" ? "function marklessScalarSpecializedHostMiss(_input, site) { return marklessScalarSpecializedError(\"MARKLESS_SCALAR_SPECIALIZED_HOST_MISS\", site); }" : "function marklessScalarSpecializedHostMiss(input, site) { return marklessScalarSpecializedFallback(input, site); }",
1302
1330
  ...resolution === "static" ? [
@@ -1507,6 +1535,7 @@ const MARKLESS_BUILD_METADATA_FILES = [
1507
1535
  MARKLESS_INTERACTION_CLOSURES,
1508
1536
  MARKLESS_BYTE_ATTRIBUTION
1509
1537
  ];
1538
+ const MARKLESS_PUBLIC_BUILD_METADATA_FILES = [MARKLESS_EXECUTION_SIZES];
1510
1539
  const WEB_RUNTIME_CAPABILITY_GROUPS = [
1511
1540
  {
1512
1541
  name: "markless-direct-renderer",
@@ -1750,21 +1779,16 @@ function emitPrerenderTriggerGroupModule(input) {
1750
1779
  } : route);
1751
1780
  if (routes.length > 0) {
1752
1781
  source = source.replaceAll("loadSymbol(", "marklessLoadLocalSymbol(");
1753
- source += [
1754
- emitReboundSymbolImport(routes, "marklessLoadSymbolRebound"),
1755
- "export function loadSymbol(symbolId) {",
1756
- ...routes.flatMap((route) => {
1757
- const unbound = "importSource" in route ? `import(${JSON.stringify(symbolRouteImportSource(route.importSource))}).then((mod) => mod.loadSymbol ? mod.loadSymbol(symbolId.slice(${route.prefix.length})) : Promise.reject(new Error(\`Unknown child async symbol \${symbolId}\`)))` : `${route.prefix.length > 0 ? "loadSymbol" : "marklessLoadLocalSymbol"}(symbolId.slice(${route.prefix.length}))`;
1758
- return [
1759
- `\tif (symbolId.startsWith(${JSON.stringify(route.prefix)})) {`,
1760
- ...emitReboundSymbolRoute(route, "marklessLoadSymbolRebound", "marklessLoadLocalSymbol", unbound, " "),
1761
- `\t\treturn ${unbound};`,
1762
- " }"
1763
- ];
1764
- }),
1765
- " return marklessLoadLocalSymbol(symbolId);",
1766
- "}"
1767
- ].filter((line) => line !== "").join("\n");
1782
+ source += "\n" + emitSymbolRouteTable({
1783
+ routes: routes.map((route) => "importSource" in route ? {
1784
+ ...route,
1785
+ importSource: symbolRouteImportSource(route.importSource)
1786
+ } : route),
1787
+ functionName: "loadSymbol",
1788
+ fallbackName: "marklessLoadLocalSymbol",
1789
+ reboundName: "marklessLoadSymbolRebound",
1790
+ exported: true
1791
+ });
1768
1792
  }
1769
1793
  return [
1770
1794
  armRendererModuleId ? [
@@ -2363,6 +2387,19 @@ function plannedLandingFiles(bundle) {
2363
2387
  return planned;
2364
2388
  }
2365
2389
  //#endregion
2390
+ //#region src/build/warm-packs.ts
2391
+ function warmPacksSuffix(specifiers) {
2392
+ return `setTimeout(()=>{for(const pack of[${specifiers.map((specifier) => `import(${JSON.stringify(specifier)})`).join(",")}])pack.catch(()=>{})});`;
2393
+ }
2394
+ const WARM_PACKS = /setTimeout\(\(\)=>\{for\((?:const|let|var) ([\w$]+) of\[((?:import\([^)]*\),?)+)\]\)\1\.catch\(\(\)=>\{\}\)\}\)/g;
2395
+ const IMPORT_SPECIFIER = /import\(\s*["'`]([^"'`]+)["'`]\s*\)/g;
2396
+ /** The packs a chunk evaluates a task after it runs, read from `warmPacksSuffix` before or after minifying. */
2397
+ function warmEvaluatedImports(code) {
2398
+ const specifiers = [];
2399
+ for (const warm of code.matchAll(WARM_PACKS)) for (const target of warm[2].matchAll(IMPORT_SPECIFIER)) specifiers.push(target[1]);
2400
+ return specifiers;
2401
+ }
2402
+ //#endregion
2366
2403
  //#region src/build/pack-cost-model.ts
2367
2404
  const PACK_COST_MODEL = {
2368
2405
  roundMs: 162,
@@ -2704,4 +2741,4 @@ function push(map, key, value) {
2704
2741
  else map.set(key, [value]);
2705
2742
  }
2706
2743
  //#endregion
2707
- export { MARKLESS_EXECUTION_DEMAND as $, normalizeVirtualId as A, isExecutionLogChunk as At, sourceForSymbolVirtualImporter as B, isRelativeImport as C, EXECUTION_LOG_DISPATCH_MODULE_IDS as Ct, isScalarPlanSourceRequest as D, executionLogVirtualModuleSource as Dt, isRouteNavigationSourceRequest as E, executionLogActivationInjection as Et, serverSharedSourceRequest as F, emitPrerenderTriggerGroupModule as G, stripBuildPrefix as H, sharedReachedRenderDataRequest as I, adaptImportedCaptureResolver as J, planPrerenderTriggerGroups as K, sourceForPrerenderWakeVirtualImporter as L, renderDataReachedFromQuery as M, requalifyExecutionLogModuleHook as Mt, resolveVirtualId as N, planModulePreloadUrls as Nt, isSymbolOnlySourceRequest as O, hasExecutionLogModuleHook as Ot, resolverVirtualModuleSourceFile as P, planModulePreloads as Pt, MARKLESS_BYTE_ATTRIBUTION as Q, sourceForResumeVirtualImporter as R, isPrerenderWakeSourceRequest as S, withoutFirstUse as St, isResumeSourceRequest as T, MARKLESS_EXECUTION_LOG_MODULE_ID as Tt, virtualModuleSourceForLoad as U, sourceForTriggerGroupVirtualImporter as V, emitPrerenderBoundaryRendererModule as W, MARKLESS_BUILD_PREFIX as X, MARKLESS_BUILD_METADATA_FILES as Y, MARKLESS_BUNDLE_GRAPH as Z, devBrowserVirtualModuleUrl as _, scopedSymbolExportName as _t, isStartupPack as a, STORAGE_FREE_RESUME_ENTRY_SPECIFIER as at, isClientPrimarySourceRequest as b, symbolVirtualModuleId as bt, planRoutePackGroups as c, emitResumeModule as ct, plannedLandingFiles as d, encodedSymbolSource as dt, MARKLESS_EXECUTION_SIZES as et, MARKLESS_ROUTE_SOURCE_QUERY_RE as f, payloadModule as ft, devBrowserSourceModuleUrl as g, rewriteSymbolModuleExport as gt, clientSymbolEntries as h, resumeVirtualModuleId as ht, isMarklessNavigationPack as i, RESUME_ENTRY_SPECIFIER as it, pathname as j, normalizeExecutionLogMode as jt, materializedReachedRenderDataSource as k, injectExecutionLogModuleHook as kt, startupPackOfLazy as l, emitSettleModule as lt, clientRouteArtifactReference as m, prerenderWakeVirtualModuleSourceFile as mt, MARKLESS_NAVIGATION_PACK_PREFIX as n, outputDefaults as nt, lazyStartupPackName as o, demandsOverlay as ot, TSRX_SOURCE_FILE as p, prerenderWakeVirtualModuleId as pt, triggerGroupVirtualModuleId as q, isMarklessDeferredPack as r, MARKLESS_VIRTUAL_PREFIX as rt, marklessDeferredChunkFileNames as s, emitOverlayLoaderInstall as st, MARKLESS_DEFERRED_PACK as t, MARKLESS_INTERACTION_CLOSURES as tt, MARKLESS_INTERACTION_CLOSURES_ASSET as u, emitSourceModule as ut, emittedBundleModuleIds as v, settleVirtualModuleId as vt, isRenderDataSourceRequest as w, MARKLESS_EXECUTION_LOG_GLOBAL as wt, isMarklessRuntimeModule as x, symbolVirtualModuleSourceFile as xt, executionLogRuntimeModuleId as y, symbolEntryVirtualModuleId as yt, sourceForSettleVirtualImporter as z };
2744
+ export { MARKLESS_BUNDLE_GRAPH as $, isSymbolOnlySourceRequest as A, executionLogVirtualModuleSource as At, sourceForResumeVirtualImporter as B, isMarklessRuntimeModule as C, symbolVirtualModuleId as Ct, isResumeSourceRequest as D, MARKLESS_EXECUTION_LOG_GLOBAL as Dt, isRenderDataSourceRequest as E, EXECUTION_LOG_DISPATCH_MODULE_IDS as Et, resolveVirtualId as F, requalifyExecutionLogModuleHook as Ft, virtualModuleSourceForLoad as G, sourceForSymbolVirtualImporter as H, resolverVirtualModuleSourceFile as I, planModulePreloadUrls as It, planPrerenderTriggerGroups as J, emitPrerenderBoundaryRendererModule as K, serverSharedSourceRequest as L, planModulePreloads as Lt, normalizeVirtualId as M, injectExecutionLogModuleHook as Mt, pathname as N, isExecutionLogChunk as Nt, isRouteNavigationSourceRequest as O, MARKLESS_EXECUTION_LOG_MODULE_ID as Ot, renderDataReachedFromQuery as P, normalizeExecutionLogMode as Pt, MARKLESS_BUILD_PREFIX as Q, sharedReachedRenderDataRequest as R, isClientPrimarySourceRequest as S, symbolEntryVirtualModuleId as St, isRelativeImport as T, withoutFirstUse as Tt, sourceForTriggerGroupVirtualImporter as U, sourceForSettleVirtualImporter as V, stripBuildPrefix as W, adaptImportedCaptureResolver as X, triggerGroupVirtualModuleId as Y, MARKLESS_BUILD_METADATA_FILES as Z, clientSymbolEntries as _, prerenderWakeVirtualModuleSourceFile as _t, isStartupPack as a, outputDefaults as at, emittedBundleModuleIds as b, scopedSymbolExportName as bt, planRoutePackGroups as c, STORAGE_FREE_RESUME_ENTRY_SPECIFIER as ct, warmPacksSuffix as d, emitResumeModule as dt, MARKLESS_BYTE_ATTRIBUTION as et, MARKLESS_INTERACTION_CLOSURES_ASSET as f, emitSettleModule as ft, clientRouteArtifactReference as g, prerenderWakeVirtualModuleId as gt, TSRX_SOURCE_FILE as h, payloadModule as ht, isMarklessNavigationPack as i, MARKLESS_PUBLIC_BUILD_METADATA_FILES as it, materializedReachedRenderDataSource as j, hasExecutionLogModuleHook as jt, isScalarPlanSourceRequest as k, executionLogActivationInjection as kt, startupPackOfLazy as l, demandsOverlay as lt, MARKLESS_ROUTE_SOURCE_QUERY_RE as m, encodedSymbolSource as mt, MARKLESS_NAVIGATION_PACK_PREFIX as n, MARKLESS_EXECUTION_SIZES as nt, lazyStartupPackName as o, MARKLESS_VIRTUAL_PREFIX as ot, plannedLandingFiles as p, emitSourceModule as pt, emitPrerenderTriggerGroupModule as q, isMarklessDeferredPack as r, MARKLESS_INTERACTION_CLOSURES as rt, marklessDeferredChunkFileNames as s, RESUME_ENTRY_SPECIFIER as st, MARKLESS_DEFERRED_PACK as t, MARKLESS_EXECUTION_DEMAND as tt, warmEvaluatedImports as u, emitOverlayLoaderInstall as ut, devBrowserSourceModuleUrl as v, resumeVirtualModuleId as vt, isPrerenderWakeSourceRequest as w, symbolVirtualModuleSourceFile as wt, executionLogRuntimeModuleId as x, settleVirtualModuleId as xt, devBrowserVirtualModuleUrl as y, rewriteSymbolModuleExport as yt, sourceForPrerenderWakeVirtualImporter as z };
@@ -55,6 +55,7 @@ interface TransformTsrxModuleInput {
55
55
  importedModuleInterfaces?: SemanticGraphInput['importedModuleInterfaces'];
56
56
  importedModuleConstants?: SemanticGraphInput['importedModuleConstants'];
57
57
  serverOnlyProps?: SemanticGraphInput['serverOnlyProps'];
58
+ routeRoot?: SemanticGraphInput['routeRoot'];
58
59
  renderDataImportSources?: Readonly<Record<string, string>>;
59
60
  artifactChildMaterializations?: Readonly<Record<string, ArtifactChildMaterialization>>;
60
61
  symbols?: import('@markless/compiler').SymbolResolverModuleInput['symbols'];
@@ -186,6 +187,8 @@ type MarklessRolldownPluginApi = {
186
187
  enableChunkImportMap: () => void;
187
188
  /** A host plugin names, per root-relative module id, the props browser code must never read. */
188
189
  declareServerOnlyProps: (resolve: (moduleId: string) => SemanticGraphInput['serverOnlyProps']) => void;
190
+ /** A host plugin names, per root-relative module id, the modules it renders as pages. */
191
+ declareRouteModules: (isRoute: (moduleId: string) => boolean) => void;
189
192
  invalidateGeneratedModules: (parent: string, environment?: MarklessEnvironment, nextSource?: string) => string[] | Promise<string[]>;
190
193
  runtimeDemandMaps: () => Iterable<RuntimeDemandMapManifest | undefined>;
191
194
  runtimeDemandSources: () => Iterable<{
package/dist/vite.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { c as MarklessEnvironment, g as PreloadGraphEntriesAdder, h as PreloadGraphEntries, i as MarklessBuildMetadata, l as MarklessManifest, m as PreloadGraphContext, n as GlobalInjections, t as BundleGraphAdder, u as MarklessRolldownOptions } from "./types-BqSoEVp6.js";
1
+ import { c as MarklessEnvironment, g as PreloadGraphEntriesAdder, h as PreloadGraphEntries, i as MarklessBuildMetadata, l as MarklessManifest, m as PreloadGraphContext, n as GlobalInjections, t as BundleGraphAdder, u as MarklessRolldownOptions } from "./types-iOUoceJ-.js";
2
2
  import { Plugin } from "vite";
3
3
  //#region src/vite/index.d.ts
4
4
  export interface MarklessViteOptions extends MarklessRolldownOptions {