@ecopages/core 0.2.0-beta.1 → 0.2.0-beta.10
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/package.json +107 -3
- package/src/adapters/abstract/application-adapter.d.ts +73 -1
- package/src/adapters/abstract/application-adapter.js +89 -0
- package/src/adapters/abstract/server-adapter.d.ts +3 -0
- package/src/adapters/abstract/ws-pattern-matcher.d.ts +60 -0
- package/src/adapters/abstract/ws-pattern-matcher.js +61 -0
- package/src/adapters/bun/client-bridge.d.ts +1 -0
- package/src/adapters/bun/client-bridge.js +3 -0
- package/src/adapters/bun/create-app.d.ts +5 -3
- package/src/adapters/bun/create-app.js +44 -39
- package/src/adapters/bun/hmr-manager.d.ts +2 -1
- package/src/adapters/bun/hmr-manager.js +2 -2
- package/src/adapters/bun/server-adapter.d.ts +81 -20
- package/src/adapters/bun/server-adapter.js +220 -78
- package/src/adapters/bun/static-preview-host.js +25 -20
- package/src/adapters/create-app.d.ts +13 -0
- package/src/adapters/create-app.js +10 -1
- package/src/adapters/node/create-app.d.ts +4 -0
- package/src/adapters/node/create-app.js +38 -9
- package/src/adapters/node/node-client-bridge.d.ts +1 -0
- package/src/adapters/node/node-client-bridge.js +3 -0
- package/src/adapters/node/node-hmr-manager.d.ts +2 -1
- package/src/adapters/node/node-hmr-manager.js +2 -2
- package/src/adapters/node/server-adapter-dependencies.js +2 -0
- package/src/adapters/node/server-adapter.d.ts +55 -19
- package/src/adapters/node/server-adapter.js +140 -132
- package/src/adapters/node/static-content-server.d.ts +1 -0
- package/src/adapters/node/static-content-server.js +10 -2
- package/src/adapters/node/static-preview-host.js +27 -12
- package/src/adapters/shared/bun-user-websocket-lifecycle.d.ts +22 -0
- package/src/adapters/shared/bun-user-websocket-lifecycle.js +96 -0
- package/src/adapters/shared/copy-runtime-public-dir.d.ts +6 -0
- package/src/adapters/shared/copy-runtime-public-dir.js +24 -0
- package/src/adapters/shared/hmr-html-response.d.ts +1 -1
- package/src/adapters/shared/hmr-html-response.js +4 -1
- package/src/adapters/shared/node-http-websocket-upgrades.d.ts +21 -0
- package/src/adapters/shared/node-http-websocket-upgrades.js +100 -0
- package/src/adapters/shared/port-manager.d.ts +116 -0
- package/src/adapters/shared/port-manager.js +196 -0
- package/src/adapters/shared/runtime-app-bootstrap.d.ts +2 -1
- package/src/adapters/shared/runtime-app-bootstrap.js +3 -6
- package/src/adapters/shared/runtime-server-lifecycle.d.ts +38 -0
- package/src/adapters/shared/runtime-server-lifecycle.js +39 -0
- package/src/adapters/shared/server-adapter.d.ts +2 -1
- package/src/adapters/shared/server-adapter.js +12 -4
- package/src/adapters/shared/server-route-handler.d.ts +4 -1
- package/src/adapters/shared/server-route-handler.js +5 -2
- package/src/adapters/shared/server-static-builder.d.ts +14 -29
- package/src/adapters/shared/server-static-builder.js +91 -70
- package/src/adapters/shared/shared-hmr-manager.d.ts +12 -0
- package/src/adapters/shared/shared-hmr-manager.js +64 -7
- package/src/adapters/shared/static-preview-host.d.ts +5 -0
- package/src/adapters/shared/websocket-lifecycle.d.ts +24 -0
- package/src/adapters/shared/websocket-lifecycle.js +55 -0
- package/src/build/README.md +77 -14
- package/src/build/app-build-manifest-runtime.d.ts +10 -0
- package/src/build/app-build-manifest-runtime.js +90 -0
- package/src/build/build-adapter.d.ts +17 -319
- package/src/build/build-adapter.js +28 -94
- package/src/build/build-contracts.d.ts +97 -0
- package/src/build/build-contracts.js +0 -0
- package/src/build/build-input-fingerprint.d.ts +28 -0
- package/src/build/build-input-fingerprint.js +31 -0
- package/src/build/build-profile-options.d.ts +7 -0
- package/src/build/build-profile-options.js +37 -0
- package/src/build/build-runtime.d.ts +24 -0
- package/src/build/build-runtime.js +65 -0
- package/src/build/deduping-build-executor.d.ts +28 -0
- package/src/build/deduping-build-executor.js +56 -0
- package/src/build/jsx-ownership-plugins.d.ts +24 -0
- package/src/build/jsx-ownership-plugins.js +41 -0
- package/src/build/pages-unified-graph-build.d.ts +31 -0
- package/src/build/pages-unified-graph-build.js +206 -0
- package/src/build/parallel-build-executor.d.ts +21 -0
- package/src/build/parallel-build-executor.js +52 -0
- package/src/build/production-build-cache.d.ts +20 -0
- package/src/build/production-build-cache.js +63 -0
- package/src/build/rolldown-adapter-helpers.d.ts +3 -6
- package/src/build/rolldown-adapter-helpers.js +71 -6
- package/src/build/rolldown-build-adapter.d.ts +2 -6
- package/src/build/rolldown-build-adapter.js +3 -3
- package/src/build/rolldown-build-invocation-metrics.d.ts +12 -0
- package/src/build/rolldown-build-invocation-metrics.js +43 -0
- package/src/build/rolldown-plugin-bridge.d.ts +15 -1
- package/src/build/rolldown-plugin-bridge.js +20 -5
- package/src/build/rolldown-source-transform-pass.d.ts +15 -0
- package/src/build/rolldown-source-transform-pass.js +58 -0
- package/src/build/runtime-build-executor.d.ts +8 -15
- package/src/build/runtime-build-executor.js +12 -15
- package/src/build/runtime-build-output-normalizer.d.ts +7 -0
- package/src/build/runtime-build-output-normalizer.js +94 -2
- package/src/build/server-entry-build-cache.d.ts +44 -0
- package/src/build/server-entry-build-cache.js +161 -0
- package/src/config/config-builder.d.ts +12 -7
- package/src/config/config-builder.js +12 -9
- package/src/dev/client-bridge-registry.d.ts +5 -0
- package/src/dev/client-bridge-registry.js +15 -0
- package/src/dev/dev-client-ownership.d.ts +7 -0
- package/src/dev/dev-client-ownership.js +6 -0
- package/src/dev/host-runtime.d.ts +3 -0
- package/src/dev/host-runtime.js +7 -0
- package/src/hmr/client/hmr-runtime.js +5 -2
- package/src/hmr/strategies/server-rendered-template-hmr-strategy.d.ts +17 -0
- package/src/hmr/strategies/server-rendered-template-hmr-strategy.js +29 -0
- package/src/integrations/ghtml/ghtml-renderer.d.ts +2 -6
- package/src/integrations/ghtml/ghtml-renderer.js +2 -51
- package/src/integrations/ghtml/ghtml.plugin.d.ts +3 -16
- package/src/integrations/ghtml/ghtml.plugin.js +7 -14
- package/src/plugins/define-integration.d.ts +26 -0
- package/src/plugins/define-integration.js +19 -0
- package/src/plugins/eco-component-meta-plugin.js +5 -8
- package/src/plugins/foreign-jsx-override-plugin.js +4 -6
- package/src/plugins/integration-plugin.d.ts +19 -9
- package/src/plugins/integration-plugin.js +7 -4
- package/src/plugins/jsx-import-source.utils.d.ts +8 -0
- package/src/plugins/jsx-import-source.utils.js +26 -0
- package/src/plugins/processor.d.ts +19 -4
- package/src/plugins/processor.js +22 -4
- package/src/plugins/source-transform.d.ts +31 -0
- package/src/plugins/source-transform.js +23 -1
- package/src/route-renderer/GRAPH.md +8 -8
- package/src/route-renderer/README.md +30 -28
- package/src/route-renderer/orchestration/component-graph-collectors.d.ts +10 -0
- package/src/route-renderer/orchestration/component-graph-collectors.js +143 -0
- package/src/route-renderer/orchestration/component-graph.d.ts +36 -0
- package/src/route-renderer/orchestration/component-graph.js +90 -0
- package/src/route-renderer/orchestration/component-render-context.d.ts +3 -10
- package/src/route-renderer/orchestration/component-render-context.js +3 -1
- package/src/route-renderer/orchestration/declared-ownership-graph.d.ts +1 -18
- package/src/route-renderer/orchestration/declared-ownership-graph.js +5 -31
- package/src/route-renderer/orchestration/document-shell-render.service.d.ts +54 -0
- package/src/route-renderer/orchestration/document-shell-render.service.js +54 -0
- package/src/route-renderer/orchestration/foreign-subtree-execution.service.d.ts +59 -29
- package/src/route-renderer/orchestration/foreign-subtree-execution.service.js +164 -35
- package/src/route-renderer/orchestration/global-injector-assets.service.d.ts +7 -0
- package/src/route-renderer/orchestration/global-injector-assets.service.js +32 -0
- package/src/route-renderer/orchestration/integration-renderer.d.ts +18 -54
- package/src/route-renderer/orchestration/integration-renderer.js +108 -194
- package/src/route-renderer/orchestration/integration-route-render-adapter.d.ts +38 -0
- package/src/route-renderer/orchestration/integration-route-render-adapter.js +27 -0
- package/src/route-renderer/orchestration/ownership-validation.service.d.ts +4 -0
- package/src/route-renderer/orchestration/ownership-validation.service.js +11 -1
- package/src/route-renderer/orchestration/page-browser-graph-contribution.loader.d.ts +9 -0
- package/src/route-renderer/orchestration/page-browser-graph-contribution.loader.js +7 -0
- package/src/route-renderer/orchestration/page-browser-graph.service.d.ts +25 -0
- package/src/route-renderer/orchestration/page-browser-graph.service.js +174 -0
- package/src/route-renderer/orchestration/render-output.utils.d.ts +2 -0
- package/src/route-renderer/orchestration/render-output.utils.js +4 -0
- package/src/route-renderer/orchestration/route-html-finalization.service.d.ts +17 -0
- package/src/route-renderer/orchestration/route-html-finalization.service.js +26 -0
- package/src/route-renderer/orchestration/route-prepared-options.builder.d.ts +24 -0
- package/src/route-renderer/orchestration/route-prepared-options.builder.js +52 -0
- package/src/route-renderer/orchestration/route-prepared-options.utils.d.ts +4 -0
- package/src/route-renderer/orchestration/route-prepared-options.utils.js +33 -0
- package/src/route-renderer/orchestration/route-render-orchestrator.d.ts +5 -38
- package/src/route-renderer/orchestration/route-render-orchestrator.js +51 -459
- package/src/route-renderer/orchestration/string-markup-renderer.d.ts +14 -0
- package/src/route-renderer/orchestration/string-markup-renderer.js +54 -0
- package/src/router/client/navigation-coordinator.d.ts +1 -1
- package/src/router/client/navigation-coordinator.js +12 -2
- package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.d.ts +1 -0
- package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.js +1 -0
- package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.d.ts +4 -2
- package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.js +27 -7
- package/src/services/assets/asset-processing-service/processors/script/file-script.processor.js +32 -14
- package/src/services/assets/asset-processing-service/processors/script/node-module-script.processor.js +17 -3
- package/src/services/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.d.ts +0 -3
- package/src/services/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.js +2 -31
- package/src/services/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.d.ts +0 -3
- package/src/services/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.js +2 -30
- package/src/services/assets/asset-processing-service/processors/stylesheet/stylesheet-processor-pipeline.d.ts +2 -0
- package/src/services/assets/asset-processing-service/processors/stylesheet/stylesheet-processor-pipeline.js +43 -0
- package/src/services/assets/browser-bundle.service.d.ts +3 -1
- package/src/services/assets/browser-bundle.service.js +17 -5
- package/src/services/html/html-transformer.service.d.ts +1 -1
- package/src/services/html/html-transformer.service.js +4 -4
- package/src/services/invalidation/development-invalidation.service.d.ts +10 -1
- package/src/services/invalidation/development-invalidation.service.js +31 -2
- package/src/services/module-loading/README.md +49 -0
- package/src/services/module-loading/app-server-module-transpiler.service.js +5 -17
- package/src/services/module-loading/page-module-import.service.d.ts +4 -1
- package/src/services/module-loading/page-module-import.service.js +61 -41
- package/src/services/module-loading/route-module-build-cache-registry.d.ts +24 -0
- package/src/services/module-loading/route-module-build-cache-registry.js +37 -0
- package/src/services/module-loading/route-module-build-cache.d.ts +4 -0
- package/src/services/module-loading/route-module-build-cache.js +38 -0
- package/src/services/module-loading/route-module-build-cache.store.d.ts +57 -0
- package/src/services/module-loading/route-module-build-cache.store.js +207 -0
- package/src/services/module-loading/route-module-build-manifest.d.ts +61 -0
- package/src/services/module-loading/route-module-build-manifest.js +116 -0
- package/src/services/module-loading/route-module-dependency-hasher.d.ts +81 -0
- package/src/services/module-loading/route-module-dependency-hasher.js +121 -0
- package/src/services/module-loading/server-module-transpiler.service.js +1 -1
- package/src/static-site-generator/README.md +33 -0
- package/src/static-site-generator/static-build-invalidation.d.ts +10 -0
- package/src/static-site-generator/static-build-invalidation.js +59 -0
- package/src/static-site-generator/static-export-context.d.ts +22 -0
- package/src/static-site-generator/static-export-context.js +0 -0
- package/src/static-site-generator/static-site-generator.d.ts +17 -20
- package/src/static-site-generator/static-site-generator.js +188 -85
- package/src/types/internal-types.d.ts +12 -9
- package/src/types/public-types.d.ts +87 -22
- package/src/utils/parse-cli-args.d.ts +1 -0
- package/src/utils/parse-cli-args.js +3 -0
- package/src/watchers/project-watcher.d.ts +14 -2
- package/src/watchers/project-watcher.js +50 -20
- package/src/build/rolldown-dev-build-adapter.d.ts +0 -82
- package/src/build/rolldown-dev-build-adapter.js +0 -166
- package/src/hmr/hmr.postcss.test.e2e.d.ts +0 -1
- package/src/hmr/hmr.postcss.test.e2e.js +0 -31
- package/src/hmr/hmr.test.e2e.d.ts +0 -1
- package/src/hmr/hmr.test.e2e.js +0 -43
- package/src/route-renderer/orchestration/ownership-planning.service.d.ts +0 -24
- package/src/route-renderer/orchestration/ownership-planning.service.js +0 -63
- package/src/route-renderer/orchestration/queued-foreign-subtree-resolution.service.d.ts +0 -91
- package/src/route-renderer/orchestration/queued-foreign-subtree-resolution.service.js +0 -170
|
@@ -7,18 +7,22 @@ import { HttpError } from "../../errors/http-error.js";
|
|
|
7
7
|
import { DependencyResolverService } from "../page-loading/dependency-resolver.js";
|
|
8
8
|
import { PageModuleLoaderService } from "../page-loading/page-module-loader.js";
|
|
9
9
|
import { OwnershipValidationService } from "./ownership-validation.service.js";
|
|
10
|
+
import { hasForeignChildDescendantsInGraph } from "./component-graph-collectors.js";
|
|
10
11
|
import {
|
|
11
12
|
RouteRenderOrchestrator
|
|
12
13
|
} from "./route-render-orchestrator.js";
|
|
13
|
-
import {
|
|
14
|
+
import { createIntegrationRouteRenderAdapter } from "./integration-route-render-adapter.js";
|
|
15
|
+
import { loadPageBrowserGraphContribution } from "./page-browser-graph-contribution.loader.js";
|
|
16
|
+
import { normalizeUnresolvedMarkerArtifactHtml, isMarkupNodeLike } from "./render-output.utils.js";
|
|
14
17
|
import {
|
|
15
18
|
ForeignSubtreeExecutionService
|
|
16
19
|
} from "./foreign-subtree-execution.service.js";
|
|
17
|
-
import {} from "./queued-foreign-subtree-resolution.service.js";
|
|
18
20
|
import { buildProcessedAssetDedupeKey } from "./processed-asset-dedupe.js";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
import {
|
|
22
|
+
applyDocumentShellAttributeStamping,
|
|
23
|
+
composeDocumentShell,
|
|
24
|
+
renderPageDocumentShell
|
|
25
|
+
} from "./document-shell-render.service.js";
|
|
22
26
|
class IntegrationRenderer {
|
|
23
27
|
appConfig;
|
|
24
28
|
assetProcessingService;
|
|
@@ -31,7 +35,22 @@ class IntegrationRenderer {
|
|
|
31
35
|
pageModuleLoaderService;
|
|
32
36
|
routeRenderOrchestrator;
|
|
33
37
|
foreignSubtreeExecutionService = new ForeignSubtreeExecutionService();
|
|
38
|
+
/**
|
|
39
|
+
* Serializes route and view renders that mutate `htmlTransformer` state.
|
|
40
|
+
*
|
|
41
|
+
* Integration renderers are cached per integration, so concurrent static builds
|
|
42
|
+
* and overlapping SSR requests must not share one transformer page package.
|
|
43
|
+
*/
|
|
44
|
+
renderExclusiveChain = Promise.resolve();
|
|
34
45
|
DOC_TYPE = "<!DOCTYPE html>";
|
|
46
|
+
runRenderExclusive(operation) {
|
|
47
|
+
const run = this.renderExclusiveChain.then(operation, operation);
|
|
48
|
+
this.renderExclusiveChain = run.then(
|
|
49
|
+
() => void 0,
|
|
50
|
+
() => void 0
|
|
51
|
+
);
|
|
52
|
+
return run;
|
|
53
|
+
}
|
|
35
54
|
/**
|
|
36
55
|
* Loads one route module through the owning renderer's import path.
|
|
37
56
|
*
|
|
@@ -43,52 +62,6 @@ class IntegrationRenderer {
|
|
|
43
62
|
async loadPageModule(file, options) {
|
|
44
63
|
return this.importPageFile(file, options);
|
|
45
64
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Reads the execution-scoped owning-renderer cache from one render input.
|
|
48
|
-
*
|
|
49
|
-
* Shared page/layout/document shell helpers pass one cache through
|
|
50
|
-
* `integrationContext` so repeated delegation to the same foreign integration
|
|
51
|
-
* can reuse a single initialized renderer instance during one render flow.
|
|
52
|
-
* The cache is deliberately scoped to the current render execution rather than
|
|
53
|
-
* stored on the renderer, which avoids leaking mutable integration state across
|
|
54
|
-
* requests while still preventing redundant renderer initialization.
|
|
55
|
-
*
|
|
56
|
-
* @param integrationContext - Optional render context carried with one render input.
|
|
57
|
-
* @returns The current execution cache when present.
|
|
58
|
-
*/
|
|
59
|
-
getOwningRendererCache(integrationContext) {
|
|
60
|
-
if (integrationContext?.rendererCache instanceof Map) {
|
|
61
|
-
return integrationContext.rendererCache;
|
|
62
|
-
}
|
|
63
|
-
return void 0;
|
|
64
|
-
}
|
|
65
|
-
getForeignOwnerIntegrationName(component) {
|
|
66
|
-
const integrationName = component.config?.integration ?? component.config?.__eco?.integration;
|
|
67
|
-
if (!integrationName || integrationName === this.name) {
|
|
68
|
-
return void 0;
|
|
69
|
-
}
|
|
70
|
-
return this.appConfig.integrations.some((integration) => integration.name === integrationName) ? integrationName : void 0;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Attaches an execution-scoped owning-renderer cache to one render input.
|
|
74
|
-
*
|
|
75
|
-
* Foreign-owned page, layout, or document shells may delegate several times in
|
|
76
|
-
* the same render flow. Threading the cache through `integrationContext`
|
|
77
|
-
* preserves renderer reuse without changing the public render input contract.
|
|
78
|
-
* Existing integration-specific context is preserved and augmented.
|
|
79
|
-
*
|
|
80
|
-
* @param input - Original render input.
|
|
81
|
-
* @param rendererCache - Execution-scoped renderer cache to propagate.
|
|
82
|
-
* @returns Render input augmented with the shared renderer cache.
|
|
83
|
-
*/
|
|
84
|
-
withOwningRendererCache(input, rendererCache) {
|
|
85
|
-
const integrationContext = input.integrationContext;
|
|
86
|
-
const sharedRendererCache = rendererCache;
|
|
87
|
-
return {
|
|
88
|
-
...input,
|
|
89
|
-
integrationContext: integrationContext ? { ...integrationContext, rendererCache: sharedRendererCache } : { rendererCache: sharedRendererCache }
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
65
|
getRendererModuleValue(key) {
|
|
93
66
|
if (!this.rendererModules || typeof this.rendererModules !== "object") {
|
|
94
67
|
return void 0;
|
|
@@ -184,10 +157,11 @@ class IntegrationRenderer {
|
|
|
184
157
|
return await this.routeRenderOrchestrator.resolveDeclaredPageBrowserGraph({
|
|
185
158
|
routeFile: filePath,
|
|
186
159
|
integrationName: this.name,
|
|
187
|
-
collectContribution:
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
160
|
+
collectContribution: (routeFile) => loadPageBrowserGraphContribution(
|
|
161
|
+
routeFile,
|
|
162
|
+
(targetFile) => this.importPageFile(targetFile),
|
|
163
|
+
(context) => this.collectPageBrowserGraphContribution(context)
|
|
164
|
+
)
|
|
191
165
|
});
|
|
192
166
|
}
|
|
193
167
|
mergePageBrowserGraphIntoPagePackage(pageBrowserGraph) {
|
|
@@ -313,19 +287,25 @@ class IntegrationRenderer {
|
|
|
313
287
|
await this.prepareViewDependencies(input.view, input.layout);
|
|
314
288
|
const HtmlTemplate = await this.getHtmlTemplate();
|
|
315
289
|
const metadata = await this.resolveViewMetadata(input.view, input.props);
|
|
316
|
-
const { documentHtml } = await
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
290
|
+
const { documentHtml } = await composeDocumentShell(
|
|
291
|
+
{
|
|
292
|
+
renderComponentWithForeignChildren: (renderInput) => this.renderComponentWithForeignChildren(renderInput),
|
|
293
|
+
appendProcessedDependencies: (...assetGroups) => this.appendProcessedDependencies(...assetGroups)
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
primaryComponent: input.view,
|
|
297
|
+
primaryProps: normalizedProps,
|
|
298
|
+
layout: input.layout ? {
|
|
299
|
+
component: input.layout,
|
|
300
|
+
props: {}
|
|
301
|
+
} : void 0,
|
|
302
|
+
htmlTemplate: HtmlTemplate,
|
|
303
|
+
documentProps: {
|
|
304
|
+
metadata,
|
|
305
|
+
pageProps: normalizedProps
|
|
306
|
+
}
|
|
327
307
|
}
|
|
328
|
-
|
|
308
|
+
);
|
|
329
309
|
const html = await this.finalizeResolvedHtml({
|
|
330
310
|
html: `${this.DOC_TYPE}${documentHtml}`,
|
|
331
311
|
partial: false
|
|
@@ -345,59 +325,17 @@ class IntegrationRenderer {
|
|
|
345
325
|
* @returns Final serialized document HTML including the doctype prefix.
|
|
346
326
|
*/
|
|
347
327
|
async renderPageWithDocumentShell(input) {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
...input.documentProps ?? {}
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
const documentHtml = input.transformDocumentHtml ? input.transformDocumentHtml(composedDocumentHtml) : composedDocumentHtml;
|
|
360
|
-
return `${this.DOC_TYPE}${documentHtml}`;
|
|
361
|
-
}
|
|
362
|
-
async composeDocumentShell(input) {
|
|
363
|
-
const rendererCache = /* @__PURE__ */ new Map();
|
|
364
|
-
const primaryRender = await this.renderComponentWithForeignChildren({
|
|
365
|
-
component: input.primaryComponent,
|
|
366
|
-
props: input.primaryProps,
|
|
367
|
-
integrationContext: { rendererCache }
|
|
368
|
-
});
|
|
369
|
-
const layoutRender = input.layout ? await this.renderComponentWithForeignChildren({
|
|
370
|
-
component: input.layout.component,
|
|
371
|
-
props: input.layout.props ?? {},
|
|
372
|
-
children: primaryRender.html,
|
|
373
|
-
integrationContext: { rendererCache }
|
|
374
|
-
}) : void 0;
|
|
375
|
-
const documentRender = await this.renderComponentWithForeignChildren({
|
|
376
|
-
component: input.htmlTemplate,
|
|
377
|
-
props: input.documentProps,
|
|
378
|
-
children: layoutRender?.html ?? primaryRender.html,
|
|
379
|
-
integrationContext: { rendererCache }
|
|
380
|
-
});
|
|
381
|
-
this.appendProcessedDependencies(primaryRender.assets, layoutRender?.assets, documentRender.assets);
|
|
382
|
-
return {
|
|
383
|
-
documentHtml: documentRender.html
|
|
384
|
-
};
|
|
328
|
+
return renderPageDocumentShell(
|
|
329
|
+
{
|
|
330
|
+
renderComponentWithForeignChildren: (renderInput) => this.renderComponentWithForeignChildren(renderInput),
|
|
331
|
+
appendProcessedDependencies: (...assetGroups) => this.appendProcessedDependencies(...assetGroups)
|
|
332
|
+
},
|
|
333
|
+
input,
|
|
334
|
+
this.DOC_TYPE
|
|
335
|
+
);
|
|
385
336
|
}
|
|
386
|
-
/**
|
|
387
|
-
* Renders one string-first component with serialized children and collects its assets.
|
|
388
|
-
*
|
|
389
|
-
* String-oriented integrations frequently share the same component contract:
|
|
390
|
-
* pass serialized children through props, coerce the render result to HTML, and
|
|
391
|
-
* attach any component-scoped dependencies. This helper centralizes that flow
|
|
392
|
-
* so integrations can opt into shared orchestration without repeating the same
|
|
393
|
-
* string-render boilerplate.
|
|
394
|
-
*
|
|
395
|
-
* @param input - Component render input.
|
|
396
|
-
* @param component - String-oriented component implementation to execute.
|
|
397
|
-
* @returns Structured component render result for orchestration paths.
|
|
398
|
-
*/
|
|
399
337
|
async renderStringComponentWithSerializedChildren(input, component) {
|
|
400
|
-
const serializedChildren = input.children === void 0 ? void 0 : typeof input.children === "string" ? input.children : isMarkupNodeLike(input.children) ? input.children.outerHTML : void 0;
|
|
338
|
+
const serializedChildren = input.children === void 0 ? void 0 : typeof input.children === "string" ? input.children : isMarkupNodeLike(input.children) && typeof input.children.outerHTML === "string" ? input.children.outerHTML : void 0;
|
|
401
339
|
if (input.children !== void 0 && serializedChildren === void 0) {
|
|
402
340
|
const componentFile = input.component.config?.__eco?.file ?? "unknown component";
|
|
403
341
|
const childTag = Object.prototype.toString.call(input.children);
|
|
@@ -438,6 +376,18 @@ class IntegrationRenderer {
|
|
|
438
376
|
this.getForeignSubtreeResolutionContextKey()
|
|
439
377
|
);
|
|
440
378
|
}
|
|
379
|
+
async resolveQueuedForeignSubtreeHtml(html, runtimeContext, renderQueuedChildren, queueLabel = this.name) {
|
|
380
|
+
return this.foreignSubtreeExecutionService.resolveQueuedHtml({
|
|
381
|
+
currentIntegrationName: this.name,
|
|
382
|
+
html,
|
|
383
|
+
runtimeContext,
|
|
384
|
+
queueLabel,
|
|
385
|
+
getOwningRenderer: (integrationName, rendererCache) => this.getIntegrationRendererForName(integrationName, rendererCache),
|
|
386
|
+
applyAttributesToFirstElement: (resolvedHtml, attributes) => this.htmlTransformer.applyAttributesToFirstElement(resolvedHtml, attributes),
|
|
387
|
+
dedupeProcessedAssets: (assets) => this.htmlTransformer.dedupeProcessedAssets(assets),
|
|
388
|
+
renderQueuedChildren
|
|
389
|
+
});
|
|
390
|
+
}
|
|
441
391
|
/**
|
|
442
392
|
* Renders a string-first component, then resolves any queued foreign
|
|
443
393
|
* boundaries before returning final component HTML.
|
|
@@ -533,7 +483,7 @@ class IntegrationRenderer {
|
|
|
533
483
|
* @returns The imported module.
|
|
534
484
|
*/
|
|
535
485
|
async importPageFile(file, options) {
|
|
536
|
-
const bypassCache = options?.bypassCache ??
|
|
486
|
+
const bypassCache = options?.bypassCache ?? false;
|
|
537
487
|
const pageModule = this.usesIntegrationPageImporter(file) ? await this.importIntegrationPageFile(file, {
|
|
538
488
|
bypassCache,
|
|
539
489
|
cacheScope: options?.cacheScope
|
|
@@ -622,19 +572,20 @@ class IntegrationRenderer {
|
|
|
622
572
|
* subclasses continue to override protected renderer behavior directly.
|
|
623
573
|
*/
|
|
624
574
|
createRouteRenderOrchestratorAdapter() {
|
|
625
|
-
return {
|
|
575
|
+
return createIntegrationRouteRenderAdapter({
|
|
626
576
|
name: this.name,
|
|
627
577
|
resolveRouteRenderInputs: (routeOptions) => this.resolveRouteRenderInputs(routeOptions),
|
|
628
578
|
resolveRouteDependencies: (input) => this.resolveRouteDependencies(input),
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
return await this.collectPageBrowserGraphContribution({ file: routeFile, pageModule });
|
|
632
|
-
},
|
|
579
|
+
importPageFile: (file) => this.importPageFile(file),
|
|
580
|
+
collectPageBrowserGraphContribution: (context) => this.collectPageBrowserGraphContribution(context),
|
|
633
581
|
resolveRoutePageComponentRender: (input) => this.resolveRoutePageComponentRender(input),
|
|
634
582
|
renderRouteBody: (renderOptions) => this.renderRouteBody(renderOptions),
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
583
|
+
getDocumentAttributes: (renderOptions) => this.getDocumentAttributes(renderOptions),
|
|
584
|
+
getHtmlDocumentContributions: (options) => this.getHtmlDocumentContributions(options),
|
|
585
|
+
applyAttributesToFirstBodyElement: (html, attributes) => this.applyAttributesToFirstBodyElement(html, attributes),
|
|
586
|
+
applyAttributesToHtmlElement: (html, attributes) => this.applyAttributesToHtmlElement(html, attributes),
|
|
587
|
+
transformRouteResponse: (response, htmlContributions, pagePackage) => this.transformRouteResponse(response, htmlContributions, pagePackage)
|
|
588
|
+
});
|
|
638
589
|
}
|
|
639
590
|
async resolveRouteRenderInputs(routeOptions) {
|
|
640
591
|
const pageModule = await this.pageModuleLoaderService.resolvePageModule({
|
|
@@ -681,33 +632,13 @@ class IntegrationRenderer {
|
|
|
681
632
|
async renderRouteBody(renderOptions) {
|
|
682
633
|
return this.render(renderOptions);
|
|
683
634
|
}
|
|
684
|
-
|
|
685
|
-
const
|
|
686
|
-
const
|
|
687
|
-
|
|
688
|
-
const hasStructuralFinalization = componentRootAttributes && Object.keys(componentRootAttributes).length > 0 || documentAttributes && Object.keys(documentAttributes).length > 0;
|
|
689
|
-
if (!hasStructuralFinalization && (!htmlContributions || htmlContributions.length === 0)) {
|
|
690
|
-
return {};
|
|
691
|
-
}
|
|
692
|
-
return {
|
|
635
|
+
async transformRouteResponse(response, htmlContributions, pagePackage) {
|
|
636
|
+
const resolvedPagePackage = this.htmlTransformer.getPagePackage() ?? pagePackage;
|
|
637
|
+
const transformedResponse = await this.htmlTransformer.transform(
|
|
638
|
+
response,
|
|
693
639
|
htmlContributions,
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
if (componentRootAttributes) {
|
|
697
|
-
renderedHtml = this.htmlTransformer.applyAttributesToFirstBodyElement(
|
|
698
|
-
renderedHtml,
|
|
699
|
-
componentRootAttributes
|
|
700
|
-
);
|
|
701
|
-
}
|
|
702
|
-
if (documentAttributes) {
|
|
703
|
-
renderedHtml = this.htmlTransformer.applyAttributesToHtmlElement(renderedHtml, documentAttributes);
|
|
704
|
-
}
|
|
705
|
-
return renderedHtml;
|
|
706
|
-
}
|
|
707
|
-
};
|
|
708
|
-
}
|
|
709
|
-
async transformRouteResponse(response, htmlContributions) {
|
|
710
|
-
const transformedResponse = await this.htmlTransformer.transform(response, htmlContributions);
|
|
640
|
+
resolvedPagePackage
|
|
641
|
+
);
|
|
711
642
|
return transformedResponse.body ?? await transformedResponse.text();
|
|
712
643
|
}
|
|
713
644
|
/**
|
|
@@ -752,9 +683,12 @@ class IntegrationRenderer {
|
|
|
752
683
|
* @returns Rendered route body plus effective cache strategy.
|
|
753
684
|
*/
|
|
754
685
|
async execute(options) {
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
686
|
+
return this.runRenderExclusive(async () => {
|
|
687
|
+
this.htmlTransformer.setProcessedDependencies([]);
|
|
688
|
+
const adapter = this.createRouteRenderOrchestratorAdapter();
|
|
689
|
+
const renderOptions = await this.prepareRenderOptions(options, adapter);
|
|
690
|
+
return this.routeRenderOrchestrator.executePrepared(renderOptions, adapter);
|
|
691
|
+
});
|
|
758
692
|
}
|
|
759
693
|
/**
|
|
760
694
|
* Finalizes already-resolved HTML for explicit renderer-owned paths.
|
|
@@ -766,13 +700,17 @@ class IntegrationRenderer {
|
|
|
766
700
|
async finalizeResolvedHtml(options) {
|
|
767
701
|
const rendererBootstrapDependencies = this.getRendererBootstrapDependencies(options.partial);
|
|
768
702
|
this.appendProcessedDependencies(rendererBootstrapDependencies);
|
|
769
|
-
let html =
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
703
|
+
let html = applyDocumentShellAttributeStamping(
|
|
704
|
+
options.html,
|
|
705
|
+
{
|
|
706
|
+
applyAttributesToFirstBodyElement: (nextHtml, attributes) => this.htmlTransformer.applyAttributesToFirstBodyElement(nextHtml, attributes),
|
|
707
|
+
applyAttributesToHtmlElement: (nextHtml, attributes) => this.htmlTransformer.applyAttributesToHtmlElement(nextHtml, attributes)
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
componentRootAttributes: options.componentRootAttributes,
|
|
711
|
+
documentAttributes: options.documentAttributes
|
|
712
|
+
}
|
|
713
|
+
);
|
|
776
714
|
const shouldTransform = options.transformHtml ?? !options.partial;
|
|
777
715
|
if (!shouldTransform) {
|
|
778
716
|
return html;
|
|
@@ -797,6 +735,12 @@ class IntegrationRenderer {
|
|
|
797
735
|
getDocumentAttributes(_renderOptions) {
|
|
798
736
|
return void 0;
|
|
799
737
|
}
|
|
738
|
+
applyAttributesToFirstBodyElement(html, attributes) {
|
|
739
|
+
return this.htmlTransformer.applyAttributesToFirstBodyElement(html, attributes);
|
|
740
|
+
}
|
|
741
|
+
applyAttributesToHtmlElement(html, attributes) {
|
|
742
|
+
return this.htmlTransformer.applyAttributesToHtmlElement(html, attributes);
|
|
743
|
+
}
|
|
800
744
|
/**
|
|
801
745
|
* Returns declarative HTML fragments that core should inject into the final document.
|
|
802
746
|
*
|
|
@@ -859,22 +803,6 @@ class IntegrationRenderer {
|
|
|
859
803
|
getOwningRenderer: (integrationName, rendererCache) => this.getIntegrationRendererForName(integrationName, rendererCache)
|
|
860
804
|
});
|
|
861
805
|
}
|
|
862
|
-
/**
|
|
863
|
-
* Compatibility foreign-subtree contract that exposes a narrower payload shape for
|
|
864
|
-
* future route-composition work while preserving the current
|
|
865
|
-
* `renderComponentWithForeignChildren()` runtime semantics.
|
|
866
|
-
*/
|
|
867
|
-
async renderForeignSubtree(input) {
|
|
868
|
-
const result = await this.renderComponentWithForeignChildren(input);
|
|
869
|
-
return {
|
|
870
|
-
html: result.html,
|
|
871
|
-
assets: result.assets ?? [],
|
|
872
|
-
rootTag: result.rootTag,
|
|
873
|
-
rootAttributes: result.rootAttributes,
|
|
874
|
-
attachmentPolicy: result.canAttachAttributes ? { kind: "first-element" } : { kind: "none" },
|
|
875
|
-
integrationName: result.integrationName
|
|
876
|
-
};
|
|
877
|
-
}
|
|
878
806
|
normalizeComponentRenderOutput(result) {
|
|
879
807
|
const normalizedHtml = this.normalizeUnresolvedMarkerArtifactHtml(result.html);
|
|
880
808
|
return normalizedHtml === result.html ? result : {
|
|
@@ -893,21 +821,7 @@ class IntegrationRenderer {
|
|
|
893
821
|
* directly without paying the queue orchestration cost.
|
|
894
822
|
*/
|
|
895
823
|
hasForeignChildDescendants(component) {
|
|
896
|
-
|
|
897
|
-
const seen = /* @__PURE__ */ new Set();
|
|
898
|
-
while (stack.length > 0) {
|
|
899
|
-
const current = stack.pop();
|
|
900
|
-
if (!current || seen.has(current)) {
|
|
901
|
-
continue;
|
|
902
|
-
}
|
|
903
|
-
seen.add(current);
|
|
904
|
-
const integrationName = current.config?.integration ?? current.config?.__eco?.integration;
|
|
905
|
-
if (integrationName && integrationName !== this.name) {
|
|
906
|
-
return true;
|
|
907
|
-
}
|
|
908
|
-
stack.push(...current.config?.dependencies?.components ?? []);
|
|
909
|
-
}
|
|
910
|
-
return false;
|
|
824
|
+
return hasForeignChildDescendantsInGraph(component, this.name);
|
|
911
825
|
}
|
|
912
826
|
/**
|
|
913
827
|
* Render a single component and return structured output for orchestration paths.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ProcessedAsset } from '../../services/assets/asset-processing-service/index.js';
|
|
2
|
+
import type { HtmlDocumentContribution } from '../../services/html/html-transformer.service.js';
|
|
3
|
+
import type { ComponentRenderResult, EcoComponent, EcoPageFile, IntegrationRendererRenderOptions, PageBrowserGraphContribution, PageBrowserGraphContributionContext, PagePackageResult, RouteRendererBody, RouteRendererOptions } from '../../types/public-types.js';
|
|
4
|
+
import type { RouteHtmlFinalization, RouteRenderOrchestratorAdapter, RouteRenderOrchestratorResolvedInputs } from './route-render-orchestrator.js';
|
|
5
|
+
/**
|
|
6
|
+
* Host surface required to build the orchestrator adapter for one integration renderer.
|
|
7
|
+
*/
|
|
8
|
+
export type IntegrationRouteRenderAdapterHost<C> = {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
resolveRouteRenderInputs(routeOptions: RouteRendererOptions): Promise<RouteRenderOrchestratorResolvedInputs>;
|
|
11
|
+
resolveRouteDependencies(input: {
|
|
12
|
+
components: (EcoComponent | Partial<EcoComponent>)[];
|
|
13
|
+
}): Promise<{
|
|
14
|
+
resolvedDependencies: ProcessedAsset[];
|
|
15
|
+
}>;
|
|
16
|
+
importPageFile(file: string): Promise<EcoPageFile>;
|
|
17
|
+
collectPageBrowserGraphContribution(context: PageBrowserGraphContributionContext): Promise<PageBrowserGraphContribution | undefined>;
|
|
18
|
+
resolveRoutePageComponentRender(input: {
|
|
19
|
+
Page: EcoComponent;
|
|
20
|
+
Layout?: EcoComponent;
|
|
21
|
+
props: Record<string, unknown>;
|
|
22
|
+
routeOptions: RouteRendererOptions;
|
|
23
|
+
}): Promise<ComponentRenderResult | undefined>;
|
|
24
|
+
renderRouteBody(renderOptions: IntegrationRendererRenderOptions<C>): Promise<RouteRendererBody>;
|
|
25
|
+
getDocumentAttributes(renderOptions: IntegrationRendererRenderOptions<C>): Record<string, string> | undefined;
|
|
26
|
+
getHtmlDocumentContributions(options: {
|
|
27
|
+
renderOptions: IntegrationRendererRenderOptions<C>;
|
|
28
|
+
partial: boolean;
|
|
29
|
+
}): HtmlDocumentContribution[] | undefined;
|
|
30
|
+
applyAttributesToFirstBodyElement(html: string, attributes: Record<string, string>): string;
|
|
31
|
+
applyAttributesToHtmlElement(html: string, attributes: Record<string, string>): string;
|
|
32
|
+
transformRouteResponse(response: Response, htmlContributions?: HtmlDocumentContribution[], pagePackage?: PagePackageResult): Promise<RouteRendererBody>;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Builds the internal route-render adapter consumed by `RouteRenderOrchestrator`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function createIntegrationRouteRenderAdapter<C>(host: IntegrationRouteRenderAdapterHost<C>): RouteRenderOrchestratorAdapter<C>;
|
|
38
|
+
export type { RouteHtmlFinalization };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { loadPageBrowserGraphContribution } from "./page-browser-graph-contribution.loader.js";
|
|
2
|
+
import { buildRouteHtmlFinalization } from "./route-html-finalization.service.js";
|
|
3
|
+
function createIntegrationRouteRenderAdapter(host) {
|
|
4
|
+
return {
|
|
5
|
+
name: host.name,
|
|
6
|
+
resolveRouteRenderInputs: (routeOptions) => host.resolveRouteRenderInputs(routeOptions),
|
|
7
|
+
resolveRouteDependencies: (input) => host.resolveRouteDependencies(input),
|
|
8
|
+
collectPageBrowserGraphContribution: (routeFile) => loadPageBrowserGraphContribution(
|
|
9
|
+
routeFile,
|
|
10
|
+
(file) => host.importPageFile(file),
|
|
11
|
+
(context) => host.collectPageBrowserGraphContribution(context)
|
|
12
|
+
),
|
|
13
|
+
resolveRoutePageComponentRender: (input) => host.resolveRoutePageComponentRender(input),
|
|
14
|
+
renderRouteBody: (renderOptions) => host.renderRouteBody(renderOptions),
|
|
15
|
+
getRouteHtmlFinalization: (renderOptions) => buildRouteHtmlFinalization({
|
|
16
|
+
renderOptions,
|
|
17
|
+
getDocumentAttributes: (options) => host.getDocumentAttributes(options),
|
|
18
|
+
getHtmlDocumentContributions: (options) => host.getHtmlDocumentContributions(options),
|
|
19
|
+
applyAttributesToFirstBodyElement: (html, attributes) => host.applyAttributesToFirstBodyElement(html, attributes),
|
|
20
|
+
applyAttributesToHtmlElement: (html, attributes) => host.applyAttributesToHtmlElement(html, attributes)
|
|
21
|
+
}),
|
|
22
|
+
transformRouteResponse: (response, htmlContributions, pagePackage) => host.transformRouteResponse(response, htmlContributions, pagePackage)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
createIntegrationRouteRenderAdapter
|
|
27
|
+
};
|
|
@@ -26,4 +26,8 @@ export declare class OwnershipValidationService {
|
|
|
26
26
|
validate(input: OwnershipValidationInput): OwnershipValidationError[];
|
|
27
27
|
private isRegisteredIntegration;
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Throws when declared ownership validation collected one or more errors.
|
|
31
|
+
*/
|
|
32
|
+
export declare function throwIfOwnershipInvalid(validationErrors: OwnershipValidationError[]): void;
|
|
29
33
|
export {};
|
|
@@ -20,6 +20,9 @@ class OwnershipValidationService {
|
|
|
20
20
|
if (!isForeignToParent) {
|
|
21
21
|
return errors;
|
|
22
22
|
}
|
|
23
|
+
if (integrationName === "html") {
|
|
24
|
+
return errors;
|
|
25
|
+
}
|
|
23
26
|
if (!componentMeta) {
|
|
24
27
|
errors.push({
|
|
25
28
|
code: "MISSING_COMPONENT_METADATA",
|
|
@@ -48,6 +51,13 @@ class OwnershipValidationService {
|
|
|
48
51
|
return this.appConfig.integrations.some((integration) => integration.name === integrationName);
|
|
49
52
|
}
|
|
50
53
|
}
|
|
54
|
+
function throwIfOwnershipInvalid(validationErrors) {
|
|
55
|
+
if (validationErrors.length === 0) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
throw new Error(validationErrors.map((error) => error.message).join("\n"));
|
|
59
|
+
}
|
|
51
60
|
export {
|
|
52
|
-
OwnershipValidationService
|
|
61
|
+
OwnershipValidationService,
|
|
62
|
+
throwIfOwnershipInvalid
|
|
53
63
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
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>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
async function loadPageBrowserGraphContribution(routeFile, importPageFile, collectContribution) {
|
|
2
|
+
const pageModule = await importPageFile(routeFile);
|
|
3
|
+
return collectContribution({ file: routeFile, pageModule });
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
loadPageBrowserGraphContribution
|
|
7
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { EcoPagesAppConfig } from '../../types/internal-types.js';
|
|
2
|
+
import type { PageBrowserGraphContribution, PageBrowserGraphResult } from '../../types/public-types.js';
|
|
3
|
+
import { type AssetProcessingService } from '../../services/assets/asset-processing-service/index.js';
|
|
4
|
+
export type PageBrowserGraphResolveInput = {
|
|
5
|
+
routeFile: string;
|
|
6
|
+
integrationName: string;
|
|
7
|
+
collectContribution: (routeFile: string) => Promise<PageBrowserGraphContribution | undefined>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Resolves declarative page browser graph assets for one route and integration.
|
|
11
|
+
*/
|
|
12
|
+
export declare class PageBrowserGraphService {
|
|
13
|
+
private readonly appConfig;
|
|
14
|
+
private readonly assetProcessingService;
|
|
15
|
+
private readonly pageBrowserGraphCache;
|
|
16
|
+
private readonly groupedPageBrowserGraphCache;
|
|
17
|
+
constructor(appConfig: EcoPagesAppConfig, assetProcessingService: AssetProcessingService);
|
|
18
|
+
resolvePageBrowserGraph(input: PageBrowserGraphResolveInput): Promise<PageBrowserGraphResult | undefined>;
|
|
19
|
+
private isHmrEnabled;
|
|
20
|
+
private buildPageBrowserGraph;
|
|
21
|
+
private resolveGroupedPageBrowserAssets;
|
|
22
|
+
private buildGroupedPageBrowserAssets;
|
|
23
|
+
private listIntegrationRouteFiles;
|
|
24
|
+
private partitionPageBrowserGraphAssets;
|
|
25
|
+
}
|