@ecopages/core 0.2.0-beta.37 → 0.2.0-beta.39
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/README.md +1 -0
- package/package.json +35 -3
- package/src/adapters/bun/server-adapter.js +1 -0
- package/src/adapters/node/server-adapter.js +1 -0
- package/src/adapters/shared/http/explicit-static-render-preparation.js +1 -1
- package/src/adapters/shared/http/explicit-static-route-matcher.js +1 -1
- package/src/adapters/shared/http/fs-server-response-matcher.js +15 -7
- package/src/adapters/shared/runtime/collect-dev-prewarm-plan.d.ts +11 -0
- package/src/adapters/shared/runtime/collect-dev-prewarm-plan.js +29 -0
- package/src/adapters/shared/runtime/dev-static-route-prewarm.d.ts +16 -0
- package/src/adapters/shared/runtime/dev-static-route-prewarm.js +66 -0
- package/src/adapters/shared/runtime/render-context.js +1 -1
- package/src/adapters/shared/runtime/server-adapter.d.ts +7 -1
- package/src/adapters/shared/runtime/server-adapter.js +64 -5
- package/src/build/README.md +1 -1
- package/src/build/browser/browser-runtime-plugin.js +2 -5
- package/src/build/cache/production-build-cache.d.ts +3 -2
- package/src/build/cache/production-build-cache.js +2 -2
- package/src/build/contracts/content-virtual-modules.d.ts +12 -0
- package/src/build/contracts/content-virtual-modules.js +29 -0
- package/src/build/rolldown/rolldown-adapter-helpers.js +1 -1
- package/src/build/runtime/build-request-policy.d.ts +3 -4
- package/src/build/runtime/build-request-policy.js +4 -4
- package/src/cache/index.d.ts +2 -1
- package/src/cache/index.js +2 -1
- package/src/cache/module-parse-cache.d.ts +5 -0
- package/src/cache/module-parse-cache.js +27 -3
- package/src/cache/module-transform-profiler.d.ts +8 -0
- package/src/cache/module-transform-profiler.js +8 -0
- package/src/client/view-transitions.d.ts +17 -1
- package/src/client/view-transitions.js +45 -1
- package/src/client/view-transitions.test.browser.d.ts +1 -0
- package/src/client/view-transitions.test.browser.js +56 -0
- package/src/config/config-builder.d.ts +16 -9
- package/src/config/config-builder.js +24 -14
- package/src/dev/transform-server/dev-transform-vendor-registry.d.ts +1 -0
- package/src/dev/transform-server/dev-transform-vendor-registry.js +15 -2
- package/src/diagnostics/request-pipeline-metrics.d.ts +38 -0
- package/src/diagnostics/request-pipeline-metrics.js +121 -0
- package/src/eco/component-identity.d.ts +13 -0
- package/src/eco/component-identity.js +18 -0
- package/src/eco/eco-declared-component.d.ts +3 -2
- package/src/eco/eco-declared-component.js +6 -4
- package/src/eco/eco.browser.js +11 -4
- package/src/eco/eco.js +15 -8
- package/src/eco/eco.types.d.ts +34 -6
- package/src/errors/http-error.d.ts +8 -0
- package/src/errors/http-error.js +16 -0
- package/src/errors/undeclared-component-dependency-error.d.ts +1 -1
- package/src/errors/undeclared-component-dependency-error.js +2 -2
- package/src/index.browser.d.ts +1 -0
- package/src/index.browser.js +1 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/plugins/README.md +2 -1
- package/src/plugins/eco-component-meta-plugin.d.ts +6 -102
- package/src/plugins/eco-component-meta-plugin.js +110 -391
- package/src/plugins/processor.d.ts +10 -0
- package/src/plugins/processor.js +9 -0
- package/src/route-renderer/README.md +12 -9
- package/src/route-renderer/orchestration/document-shell/document-shell-render.service.js +1 -1
- package/src/route-renderer/orchestration/foreign-child/foreign-subtree-execution.service.js +1 -1
- package/src/route-renderer/orchestration/integration-renderer.d.ts +19 -11
- package/src/route-renderer/orchestration/integration-renderer.js +95 -27
- package/src/route-renderer/orchestration/ownership-graph/component-graph-collectors.js +5 -4
- package/src/route-renderer/orchestration/ownership-graph/component-graph.js +6 -4
- package/src/route-renderer/orchestration/ownership-graph/ownership-validation.service.d.ts +0 -1
- package/src/route-renderer/orchestration/ownership-graph/ownership-validation.service.js +10 -19
- package/src/route-renderer/orchestration/page-browser-graph/grouped-graph-build-plan.d.ts +15 -0
- package/src/route-renderer/orchestration/page-browser-graph/grouped-graph-build-plan.js +9 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-contribution.merge.d.ts +5 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-contribution.merge.js +30 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-session.d.ts +23 -6
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-session.js +156 -67
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph.service.d.ts +18 -2
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph.service.js +63 -39
- package/src/route-renderer/orchestration/page-browser-graph/route-instance-key.d.ts +29 -0
- package/src/route-renderer/orchestration/page-browser-graph/route-instance-key.js +54 -0
- package/src/route-renderer/orchestration/route-pipeline/integration-route-render-adapter.d.ts +3 -0
- package/src/route-renderer/orchestration/route-pipeline/integration-route-render-adapter.js +3 -2
- package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.builder.d.ts +1 -0
- package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.builder.js +3 -5
- package/src/route-renderer/orchestration/route-pipeline/route-render-orchestrator.d.ts +14 -4
- package/src/route-renderer/orchestration/route-pipeline/route-render-orchestrator.js +91 -32
- package/src/route-renderer/page-loading/component-dependency-collection.js +3 -2
- package/src/route-renderer/page-loading/ecopages-virtual-imports.d.ts +0 -5
- package/src/route-renderer/page-loading/ecopages-virtual-imports.js +4 -10
- package/src/route-renderer/page-loading/file-scoped-dependency-components.d.ts +42 -0
- package/src/route-renderer/page-loading/file-scoped-dependency-components.js +94 -0
- package/src/route-renderer/page-loading/lazy-trigger-planning.js +2 -1
- package/src/route-renderer/page-loading/page-module-loader.d.ts +2 -1
- package/src/route-renderer/page-loading/page-module-loader.js +9 -3
- package/src/route-renderer/page-loading/resolved-page-dependencies.d.ts +12 -0
- package/src/route-renderer/page-loading/resolved-page-dependencies.js +38 -0
- package/src/router/README.md +8 -0
- package/src/services/README.md +5 -0
- package/src/services/assets/asset-processing-service/asset-processing.service.d.ts +1 -0
- package/src/services/assets/asset-processing-service/asset-processing.service.js +22 -5
- package/src/services/cache/cache.types.d.ts +4 -2
- package/src/services/cache/html-page-cache-dependency-index.d.ts +34 -0
- package/src/services/cache/html-page-cache-dependency-index.js +88 -0
- package/src/services/cache/index.d.ts +2 -0
- package/src/services/cache/index.js +2 -0
- package/src/services/cache/page-cache-service.d.ts +31 -1
- package/src/services/cache/page-cache-service.js +79 -3
- package/src/services/cache/page-request-cache-coordinator.service.js +4 -0
- package/src/services/module-loading/README.md +9 -6
- package/src/services/module-loading/app-server-module-transpiler.service.js +0 -3
- package/src/services/module-loading/collection-server-module-build.service.d.ts +19 -0
- package/src/services/module-loading/collection-server-module-build.service.js +83 -0
- package/src/services/module-loading/page-module-import.service.d.ts +5 -11
- package/src/services/module-loading/page-module-import.service.js +56 -73
- package/src/services/module-loading/route-module-build-cache.store.js +6 -6
- package/src/services/module-loading/route-module-build-manifest.d.ts +8 -5
- package/src/services/module-loading/route-module-build-manifest.js +20 -32
- package/src/services/module-loading/server-module-transpiler.service.d.ts +0 -2
- package/src/services/module-loading/server-module-transpiler.service.js +0 -3
- package/src/static-site-generator/production-page-browser-graph-prebuild.d.ts +10 -6
- package/src/static-site-generator/production-page-browser-graph-prebuild.js +29 -10
- package/src/static-site-generator/static-site-generator.js +6 -3
- package/src/types/internal-types.d.ts +4 -0
- package/src/types/public-types.d.ts +27 -19
- package/src/watchers/project-watcher.js +14 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-contribution.loader.d.ts +0 -9
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-contribution.loader.js +0 -11
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { getAppPageBrowserGraphSession } from '../route-renderer/orchestration/page-browser-graph/page-browser-graph-session.js';
|
|
3
|
+
import { createPageDependencyInstanceKey } from '../route-renderer/orchestration/page-browser-graph/route-instance-key.js';
|
|
3
4
|
/**
|
|
4
5
|
* Returns whether production static export should warm Page Browser Graphs before rendering.
|
|
5
6
|
*
|
|
@@ -20,19 +21,37 @@ export function shouldPrebuildProductionPageBrowserGraphs() {
|
|
|
20
21
|
export function clearProductionPageBrowserGraphSession(appConfig) {
|
|
21
22
|
getAppPageBrowserGraphSession(appConfig).clearPolicyRecords('production');
|
|
22
23
|
}
|
|
24
|
+
function serializeProductionRouteInstance(instance) {
|
|
25
|
+
const routeFile = path.resolve(instance.routeFile);
|
|
26
|
+
const dependencyInstanceKey = createPageDependencyInstanceKey({ params: instance.params });
|
|
27
|
+
return JSON.stringify([routeFile, dependencyInstanceKey]);
|
|
28
|
+
}
|
|
23
29
|
/**
|
|
24
|
-
* Warms production Page Browser Graphs for the supplied static route
|
|
30
|
+
* Warms production Page Browser Graphs for the supplied static route instances.
|
|
25
31
|
*
|
|
26
32
|
* @remarks
|
|
27
|
-
* Deduplicates
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* `page-browser-graph-session`). Does not persist a disk manifest.
|
|
33
|
+
* Deduplicates route file + params pairs, then calls each integration renderer's
|
|
34
|
+
* `prebuildProductionPageBrowserGraph` sequentially (activates integration runtime,
|
|
35
|
+
* then resolves into `page-browser-graph-session`). Does not persist a disk manifest.
|
|
31
36
|
*/
|
|
32
|
-
export async function prebuildProductionPageBrowserGraphs(
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
export async function prebuildProductionPageBrowserGraphs(routeInstances, routeRendererFactory) {
|
|
38
|
+
const uniqueRouteInstances = [
|
|
39
|
+
...new Map(routeInstances.map((instance) => [serializeProductionRouteInstance(instance), instance])).values(),
|
|
40
|
+
].sort((left, right) => serializeProductionRouteInstance(left).localeCompare(serializeProductionRouteInstance(right)));
|
|
41
|
+
const instancesByRenderer = new Map();
|
|
42
|
+
for (const routeInstance of uniqueRouteInstances) {
|
|
43
|
+
const renderer = routeRendererFactory.getPageRenderer(routeInstance.routeFile);
|
|
44
|
+
const instances = instancesByRenderer.get(renderer) ?? [];
|
|
45
|
+
instances.push(routeInstance);
|
|
46
|
+
instancesByRenderer.set(renderer, instances);
|
|
47
|
+
}
|
|
48
|
+
for (const [renderer, routeInstancesForRenderer] of instancesByRenderer) {
|
|
49
|
+
const groupedBuildPlan = await renderer.buildGroupedGraphBuildPlan(routeInstancesForRenderer);
|
|
50
|
+
for (const routeInstance of routeInstancesForRenderer) {
|
|
51
|
+
await renderer.prebuildProductionPageBrowserGraph(routeInstance.routeFile, {
|
|
52
|
+
params: routeInstance.params,
|
|
53
|
+
groupedBuildPlan,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
37
56
|
}
|
|
38
57
|
}
|
|
@@ -15,7 +15,7 @@ import { normalizePathname } from '../utils/path-pattern.js';
|
|
|
15
15
|
export const STATIC_SITE_GENERATOR_ERRORS = {
|
|
16
16
|
ROUTE_RENDERER_FACTORY_REQUIRED: 'RouteRendererFactory is required for render strategy',
|
|
17
17
|
unsupportedBodyType: (bodyType) => `Unsupported body type for static generation: ${bodyType}`,
|
|
18
|
-
missingIntegration: (routePath) => `View at ${routePath} is missing
|
|
18
|
+
missingIntegration: (routePath) => `View at ${routePath} is missing component identity integration. Ensure it's defined with eco.page().`,
|
|
19
19
|
noRendererForIntegration: (integrationName) => `No renderer found for integration: ${integrationName}`,
|
|
20
20
|
dynamicRouteRequiresStaticPaths: (routePath) => `Dynamic route ${routePath} requires staticPaths to be defined on the view.`,
|
|
21
21
|
};
|
|
@@ -357,7 +357,10 @@ export class StaticSiteGenerator {
|
|
|
357
357
|
await this.invokeStaticExportHook('beforeStaticExport', staticExportContext);
|
|
358
358
|
try {
|
|
359
359
|
if (shouldPrebuildProductionPageBrowserGraphs() && routeRendererFactory) {
|
|
360
|
-
await prebuildProductionPageBrowserGraphs(routes.map((route) =>
|
|
360
|
+
await prebuildProductionPageBrowserGraphs(routes.map((route) => ({
|
|
361
|
+
routeFile: route.templateRoute.filePath,
|
|
362
|
+
params: route.params,
|
|
363
|
+
})), routeRendererFactory);
|
|
361
364
|
}
|
|
362
365
|
this.generateRobotsTxt();
|
|
363
366
|
await this.generateStaticPages({
|
|
@@ -427,7 +430,7 @@ export class StaticSiteGenerator {
|
|
|
427
430
|
}
|
|
428
431
|
}
|
|
429
432
|
resolveExplicitViewSourceFile(view) {
|
|
430
|
-
const sourceFile = view.config?.
|
|
433
|
+
const sourceFile = view.config?.identity?.file;
|
|
431
434
|
if (!sourceFile) {
|
|
432
435
|
return undefined;
|
|
433
436
|
}
|
|
@@ -107,6 +107,10 @@ export type EcoPagesAppConfig = {
|
|
|
107
107
|
sitemap: SitemapConfig;
|
|
108
108
|
/** Additional paths to watch. Use this to monitor extra files. It is relative to the rootDir */
|
|
109
109
|
additionalWatchPaths: string[];
|
|
110
|
+
/** Static paths to SSR-prewarm in development before user navigation. */
|
|
111
|
+
devPrewarmPaths?: string[];
|
|
112
|
+
/** Static paths to SSR-prewarm before the development server reports ready. */
|
|
113
|
+
devPrewarmBeforeReadyPaths?: string[];
|
|
110
114
|
/**
|
|
111
115
|
* @default { title: 'Ecopages', description: 'Ecopages' }
|
|
112
116
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Readable } from 'node:stream';
|
|
2
|
+
import type { ComponentIdentity } from '../eco/component-identity.js';
|
|
2
3
|
import type { ApiResponseBuilder } from '../adapters/shared/http/api-response.js';
|
|
3
4
|
import type { ForeignChildRuntime } from '../route-renderer/orchestration/foreign-child/component-render-context.js';
|
|
4
5
|
import type { EcoPageComponent } from '../eco/eco.types.js';
|
|
@@ -10,7 +11,7 @@ import type { InteractionEventsString as ScriptsInjectorInteractionEventsString
|
|
|
10
11
|
import type { EntrypointDependencyGraph } from '../services/runtime-state/entrypoint-dependency-graph.service.js';
|
|
11
12
|
import type { DevTransformBundleContributor } from '../dev/transform-server/types.js';
|
|
12
13
|
export type { EcoPagesAppConfig } from './internal-types.js';
|
|
13
|
-
export type { EcoPageComponent } from '../eco/eco.types.js';
|
|
14
|
+
export type { EcoPageComponent, GetPageDependencies, GetPageDependenciesContext, PageDependenciesResult, } from '../eco/eco.types.js';
|
|
14
15
|
export type { ProcessedAsset } from '../services/assets/asset-processing-service/assets.types.js';
|
|
15
16
|
/**
|
|
16
17
|
* Runtime-agnostic incoming WebSocket frame.
|
|
@@ -339,7 +340,7 @@ export type EcoComponentDependencies = {
|
|
|
339
340
|
/**
|
|
340
341
|
* Child components whose assets and foreign-child graph are collected transitively.
|
|
341
342
|
* Each entry must be an `eco.component()`, `eco.layout()`, or `eco.html()` result
|
|
342
|
-
* with
|
|
343
|
+
* with bound component identity.
|
|
343
344
|
*/
|
|
344
345
|
components?: EcoDeclaredComponent[];
|
|
345
346
|
};
|
|
@@ -347,8 +348,8 @@ export type EcoComponentDependencies = {
|
|
|
347
348
|
* Component returned from `eco.component()`, `eco.layout()`, or `eco.html()`.
|
|
348
349
|
*
|
|
349
350
|
* @remarks
|
|
350
|
-
* Used for `dependencies.components` and eco factory return types.
|
|
351
|
-
*
|
|
351
|
+
* Used for `dependencies.components` and eco factory return types. Bound
|
|
352
|
+
* component identity is enforced at runtime via `isEcoDeclaredComponent()`, not by this alias.
|
|
352
353
|
*/
|
|
353
354
|
export type EcoDeclaredComponent<P = any, R = any> = EcoComponent<P, R>;
|
|
354
355
|
export type EcoPagesElement = string | Promise<string>;
|
|
@@ -370,22 +371,9 @@ export type EcoChildren = string | Promise<string> | number | bigint | boolean |
|
|
|
370
371
|
* Represents the input configuration for EcoPages.
|
|
371
372
|
*/
|
|
372
373
|
export type EcoPagesConfig = Omit<Partial<EcoPagesAppConfig>, 'baseUrl' | 'derivedPaths' | 'templatesExt' | 'integrationsDependencies'> & Pick<EcoPagesAppConfig, 'baseUrl' | 'rootDir'>;
|
|
373
|
-
/**
|
|
374
|
-
* Internal metadata injected by eco-component-meta-plugin.
|
|
375
|
-
* Contains component file path and integration info for dependency resolution.
|
|
376
|
-
* @internal
|
|
377
|
-
*/
|
|
378
|
-
export interface EcoInjectedMeta {
|
|
379
|
-
/** Hashed identifier for client-side use (doesn't expose file paths) */
|
|
380
|
-
id: string;
|
|
381
|
-
/** Full file path of the component (use path.dirname() to get directory) */
|
|
382
|
-
file: string;
|
|
383
|
-
/** The integration identifier (e.g., 'react', 'kitajs', 'lit', 'ghtml', 'mdx') */
|
|
384
|
-
integration: string;
|
|
385
|
-
}
|
|
386
374
|
export type EcoComponentConfig = {
|
|
387
|
-
/**
|
|
388
|
-
|
|
375
|
+
/** Canonical integration, module, and stable component attribution. */
|
|
376
|
+
identity?: ComponentIdentity;
|
|
389
377
|
/**
|
|
390
378
|
* Explicit integration override for this component.
|
|
391
379
|
* When provided, this takes precedence over auto-detected integration metadata.
|
|
@@ -799,6 +787,14 @@ export type RouteRendererOptions = {
|
|
|
799
787
|
params?: PageParams;
|
|
800
788
|
query?: PageQuery;
|
|
801
789
|
locals?: RequestLocals;
|
|
790
|
+
/**
|
|
791
|
+
* Preloaded page module from request-time inspection.
|
|
792
|
+
*
|
|
793
|
+
* @remarks
|
|
794
|
+
* When present, render preparation reuses this module instead of importing the
|
|
795
|
+
* page file again for the same request.
|
|
796
|
+
*/
|
|
797
|
+
pageModule?: EcoPageFile;
|
|
802
798
|
/**
|
|
803
799
|
* Extra props merged into the page props for this render.
|
|
804
800
|
* @remarks Used by semantic error pages (for example development `message` /
|
|
@@ -817,6 +813,8 @@ export type RouteRenderResult = {
|
|
|
817
813
|
body: RouteRendererBody;
|
|
818
814
|
/** Cache strategy from page component's eco.page({ cache }) option */
|
|
819
815
|
cacheStrategy?: CacheStrategy;
|
|
816
|
+
/** Source paths observed during render preparation for HTML cache invalidation. */
|
|
817
|
+
sourceDependencyPaths?: readonly string[];
|
|
820
818
|
};
|
|
821
819
|
/**
|
|
822
820
|
* Represents the dependencies required for an integration plugin.
|
|
@@ -881,11 +879,15 @@ export type IntegrationRendererRenderOptions<C = EcoPagesElement> = RouteRendere
|
|
|
881
879
|
Layout?: EcoPageLayoutComponent<any>;
|
|
882
880
|
layoutEntries?: EcoPageLayoutEntry[];
|
|
883
881
|
dependencies?: EcoComponentDependencies;
|
|
882
|
+
/** @internal Resolved page dependencies carried through the render pipeline. */
|
|
883
|
+
resolvedPageDependencyComponents?: ReadonlyArray<EcoComponent | Partial<EcoComponent>>;
|
|
884
884
|
resolvedDependencies: ProcessedAsset[];
|
|
885
885
|
pagePackage?: PagePackageResult;
|
|
886
886
|
pageProps?: Record<string, unknown>;
|
|
887
887
|
cacheStrategy?: CacheStrategy;
|
|
888
888
|
pageLocals?: RequestLocals;
|
|
889
|
+
/** @internal Source paths from render preparation for HTML cache dependency registration. */
|
|
890
|
+
sourceDependencyPaths?: readonly string[];
|
|
889
891
|
};
|
|
890
892
|
/**
|
|
891
893
|
* Structured page asset package produced after dependency resolution.
|
|
@@ -950,10 +952,16 @@ export interface PageBrowserGraphResult {
|
|
|
950
952
|
export type PageBrowserGraphContributionContext = {
|
|
951
953
|
file: string;
|
|
952
954
|
pageModule: EcoPageFile;
|
|
955
|
+
props?: Record<string, unknown>;
|
|
956
|
+
params?: PageParams;
|
|
957
|
+
query?: PageQuery;
|
|
958
|
+
dependencyInstanceKey?: string;
|
|
953
959
|
};
|
|
954
960
|
export interface PageBrowserGraphContribution {
|
|
955
961
|
dependencies?: AssetDefinition[];
|
|
956
962
|
assets?: ProcessedAsset[];
|
|
963
|
+
/** Source files that should invalidate this graph entry when they change. */
|
|
964
|
+
watchPaths?: string[];
|
|
957
965
|
}
|
|
958
966
|
export type OwnershipValidationErrorCode = 'UNKNOWN_INTEGRATION_OWNER' | 'MISSING_COMPONENT_METADATA';
|
|
959
967
|
export interface OwnershipValidationError {
|
|
@@ -4,6 +4,7 @@ import { fileSystem } from '@ecopages/file-system';
|
|
|
4
4
|
import { appLogger } from '../global/app-logger.js';
|
|
5
5
|
import { DevelopmentInvalidationService, } from '../services/invalidation/development-invalidation.service.js';
|
|
6
6
|
import { prepareHmrFileChange } from '../hmr/hmr-file-change-prep.js';
|
|
7
|
+
import { invalidateAppPageCacheBySourcePaths, clearAppPageCache } from '../services/cache/page-cache-service.js';
|
|
7
8
|
import { getAppPageBrowserGraphSession } from '../route-renderer/orchestration/page-browser-graph/page-browser-graph-session.js';
|
|
8
9
|
import { isRegisteredDevTransformEntrypoint } from '../hmr/hmr-entrypoint-output.js';
|
|
9
10
|
import { resolveInternalExecutionDir } from '../utils/resolve-work-dir.js';
|
|
@@ -163,6 +164,12 @@ export class ProjectWatcher {
|
|
|
163
164
|
}
|
|
164
165
|
this.uncacheModules();
|
|
165
166
|
const resolvedFilePath = path.resolve(filePath);
|
|
167
|
+
if (shouldClearAllPageHtmlCache(plan.category)) {
|
|
168
|
+
await clearAppPageCache(this.appConfig);
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
await invalidateAppPageCacheBySourcePaths(this.appConfig, [resolvedFilePath]);
|
|
172
|
+
}
|
|
166
173
|
const graphPreparation = this.hmrManager.isEnabled()
|
|
167
174
|
? prepareHmrFileChange(this.appConfig, resolvedFilePath)
|
|
168
175
|
: undefined;
|
|
@@ -404,3 +411,10 @@ export class ProjectWatcher {
|
|
|
404
411
|
await this.changeQueue.catch(() => undefined);
|
|
405
412
|
}
|
|
406
413
|
}
|
|
414
|
+
function shouldClearAllPageHtmlCache(category) {
|
|
415
|
+
return (category === 'other' ||
|
|
416
|
+
category === 'server-source' ||
|
|
417
|
+
category === 'additional-watch' ||
|
|
418
|
+
category === 'include-source' ||
|
|
419
|
+
category === 'explicit-server-view');
|
|
420
|
+
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { EcoPageFile, PageBrowserGraphContribution, PageBrowserGraphContributionContext } from '../../../types/public-types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Loads a page module once and collects declarative browser-graph requirements.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* Shared by route orchestration prep and the integration route-render adapter so
|
|
7
|
-
* page imports are not duplicated when both paths need the same contribution.
|
|
8
|
-
*/
|
|
9
|
-
export declare function loadPageBrowserGraphContribution(routeFile: string, importPageFile: (file: string) => Promise<EcoPageFile>, collectContribution: (context: PageBrowserGraphContributionContext) => Promise<PageBrowserGraphContribution | undefined>): Promise<PageBrowserGraphContribution | undefined>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Loads a page module once and collects declarative browser-graph requirements.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Shared by route orchestration prep and the integration route-render adapter so
|
|
6
|
-
* page imports are not duplicated when both paths need the same contribution.
|
|
7
|
-
*/
|
|
8
|
-
export async function loadPageBrowserGraphContribution(routeFile, importPageFile, collectContribution) {
|
|
9
|
-
const pageModule = await importPageFile(routeFile);
|
|
10
|
-
return collectContribution({ file: routeFile, pageModule });
|
|
11
|
-
}
|