@ecopages/core 0.2.0-alpha.11 → 0.2.0-alpha.13
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/CHANGELOG.md +7 -10
- package/README.md +5 -4
- package/package.json +30 -6
- package/src/adapters/bun/hmr-manager.js +2 -2
- package/src/adapters/node/node-hmr-manager.js +2 -2
- package/src/adapters/node/server-adapter.d.ts +2 -2
- package/src/adapters/node/server-adapter.js +5 -5
- package/src/build/build-adapter.d.ts +8 -6
- package/src/build/build-adapter.js +44 -7
- package/src/eco/eco.js +18 -118
- package/src/eco/eco.utils.d.ts +1 -40
- package/src/eco/eco.utils.js +5 -35
- package/src/hmr/hmr-strategy.d.ts +8 -6
- package/src/integrations/ghtml/ghtml-renderer.d.ts +6 -1
- package/src/integrations/ghtml/ghtml-renderer.js +29 -28
- package/src/plugins/foreign-jsx-override-plugin.d.ts +31 -0
- package/src/plugins/foreign-jsx-override-plugin.js +35 -0
- package/src/plugins/integration-plugin.d.ts +90 -29
- package/src/plugins/integration-plugin.js +62 -19
- package/src/route-renderer/GRAPH.md +54 -84
- package/src/route-renderer/README.md +11 -19
- package/src/route-renderer/orchestration/component-render-context.d.ts +83 -0
- package/src/route-renderer/orchestration/component-render-context.js +147 -0
- package/src/route-renderer/orchestration/integration-renderer.d.ts +219 -81
- package/src/route-renderer/orchestration/integration-renderer.js +415 -171
- package/src/route-renderer/orchestration/queued-boundary-runtime.service.d.ts +93 -0
- package/src/route-renderer/orchestration/queued-boundary-runtime.service.js +155 -0
- package/src/route-renderer/orchestration/render-execution.service.d.ts +8 -70
- package/src/route-renderer/orchestration/render-execution.service.js +28 -113
- package/src/route-renderer/orchestration/render-output.utils.d.ts +46 -0
- package/src/route-renderer/orchestration/render-output.utils.js +65 -0
- package/src/route-renderer/orchestration/render-preparation.service.d.ts +0 -6
- package/src/route-renderer/orchestration/render-preparation.service.js +5 -13
- package/src/route-renderer/orchestration/template-serialization.d.ts +38 -0
- package/src/route-renderer/orchestration/template-serialization.js +45 -0
- package/src/route-renderer/page-loading/dependency-resolver.js +10 -8
- package/src/router/client/navigation-coordinator.js +2 -2
- package/src/router/server/fs-router-scanner.js +6 -1
- package/src/services/module-loading/node-bootstrap-plugin.js +14 -1
- package/src/services/module-loading/page-module-import.service.js +1 -1
- package/src/services/runtime-state/dev-graph.service.d.ts +5 -5
- package/src/services/runtime-state/dev-graph.service.js +10 -10
- package/src/types/public-types.d.ts +18 -3
- package/src/utils/html-escaping.d.ts +7 -0
- package/src/utils/html-escaping.js +6 -0
- package/src/eco/component-render-context.d.ts +0 -105
- package/src/eco/component-render-context.js +0 -94
- package/src/route-renderer/component-graph/component-graph-executor.d.ts +0 -33
- package/src/route-renderer/component-graph/component-graph-executor.js +0 -30
- package/src/route-renderer/component-graph/component-graph.d.ts +0 -53
- package/src/route-renderer/component-graph/component-graph.js +0 -94
- package/src/route-renderer/component-graph/component-marker.d.ts +0 -52
- package/src/route-renderer/component-graph/component-marker.js +0 -46
- package/src/route-renderer/component-graph/component-reference.d.ts +0 -11
- package/src/route-renderer/component-graph/component-reference.js +0 -39
- package/src/route-renderer/component-graph/marker-graph-resolver.d.ts +0 -79
- package/src/route-renderer/component-graph/marker-graph-resolver.js +0 -117
|
@@ -10,20 +10,14 @@ import { HtmlTransformerService } from '../../services/html/html-transformer.ser
|
|
|
10
10
|
import { HttpError } from '../../errors/http-error.js';
|
|
11
11
|
import { DependencyResolverService } from '../page-loading/dependency-resolver.js';
|
|
12
12
|
import { PageModuleLoaderService } from '../page-loading/page-module-loader.js';
|
|
13
|
-
import {
|
|
14
|
-
import { RenderExecutionService, type RenderExecutionGraphContext } from './render-execution.service.js';
|
|
13
|
+
import { RenderExecutionService } from './render-execution.service.js';
|
|
15
14
|
import { RenderPreparationService } from './render-preparation.service.js';
|
|
16
|
-
import type {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
componentRootAttributes?: Record<string, string>;
|
|
23
|
-
documentAttributes?: Record<string, string>;
|
|
24
|
-
mergeAssets?: boolean;
|
|
25
|
-
transformHtml?: boolean;
|
|
26
|
-
}
|
|
15
|
+
import type { ComponentBoundaryRuntime } from './component-render-context.js';
|
|
16
|
+
import { QueuedBoundaryRuntimeService, type QueuedBoundaryResolution, type QueuedBoundaryRuntimeContext } from './queued-boundary-runtime.service.js';
|
|
17
|
+
type BoundaryRenderDecisionInput = {
|
|
18
|
+
currentIntegration: string;
|
|
19
|
+
targetIntegration?: string;
|
|
20
|
+
};
|
|
27
21
|
/**
|
|
28
22
|
* Context for renderToResponse method.
|
|
29
23
|
*/
|
|
@@ -49,10 +43,38 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
49
43
|
protected runtimeOrigin: string;
|
|
50
44
|
protected dependencyResolverService: DependencyResolverService;
|
|
51
45
|
protected pageModuleLoaderService: PageModuleLoaderService;
|
|
52
|
-
protected markerGraphResolver: MarkerGraphResolver;
|
|
53
46
|
protected renderPreparationService: RenderPreparationService;
|
|
54
47
|
protected renderExecutionService: RenderExecutionService;
|
|
48
|
+
protected readonly queuedBoundaryRuntimeService: QueuedBoundaryRuntimeService;
|
|
55
49
|
protected DOC_TYPE: string;
|
|
50
|
+
/**
|
|
51
|
+
* Reads the execution-scoped foreign renderer cache from one boundary input.
|
|
52
|
+
*
|
|
53
|
+
* Shared page/layout/document shell helpers pass one cache through
|
|
54
|
+
* `integrationContext` so repeated delegation to the same foreign integration
|
|
55
|
+
* can reuse a single initialized renderer instance during one render flow.
|
|
56
|
+
* The cache is deliberately scoped to the current render execution rather than
|
|
57
|
+
* stored on the renderer, which avoids leaking mutable integration state across
|
|
58
|
+
* requests while still preventing redundant renderer initialization.
|
|
59
|
+
*
|
|
60
|
+
* @param integrationContext - Optional boundary context carried with one render input.
|
|
61
|
+
* @returns The current execution cache when present.
|
|
62
|
+
*/
|
|
63
|
+
private getBoundaryRendererCache;
|
|
64
|
+
private getRegisteredBoundaryOwner;
|
|
65
|
+
/**
|
|
66
|
+
* Attaches an execution-scoped foreign renderer cache to one boundary input.
|
|
67
|
+
*
|
|
68
|
+
* Foreign-owned page, layout, or document shells may delegate several times in
|
|
69
|
+
* the same render flow. Threading the cache through `integrationContext`
|
|
70
|
+
* preserves renderer reuse without changing the public boundary input contract.
|
|
71
|
+
* Existing integration-specific context is preserved and augmented.
|
|
72
|
+
*
|
|
73
|
+
* @param input - Original boundary render input.
|
|
74
|
+
* @param rendererCache - Execution-scoped renderer cache to propagate.
|
|
75
|
+
* @returns Boundary input augmented with the shared renderer cache.
|
|
76
|
+
*/
|
|
77
|
+
private withBoundaryRendererCache;
|
|
56
78
|
protected getRendererModuleValue(key: string): unknown;
|
|
57
79
|
protected getRendererModuleString(key: string): string | undefined;
|
|
58
80
|
protected getRendererBootstrapDependencies(partial?: boolean): ProcessedAsset[];
|
|
@@ -86,6 +108,139 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
86
108
|
* @returns Resolved processed assets
|
|
87
109
|
*/
|
|
88
110
|
protected prepareViewDependencies(view: EcoComponent, layout?: EcoComponent): Promise<ProcessedAsset[]>;
|
|
111
|
+
/**
|
|
112
|
+
* Merges component-scoped assets into the active HTML transformer state.
|
|
113
|
+
*
|
|
114
|
+
* Explicit page, layout, and document shell composition can produce assets at
|
|
115
|
+
* each boundary. This helper deduplicates those groups and folds them back into
|
|
116
|
+
* the transformer so downstream HTML finalization sees one canonical asset set.
|
|
117
|
+
*
|
|
118
|
+
* @param assetGroups - Optional groups of processed assets to merge.
|
|
119
|
+
* @returns The deduplicated asset subset contributed by this merge operation.
|
|
120
|
+
*/
|
|
121
|
+
protected appendProcessedDependencies(...assetGroups: Array<readonly ProcessedAsset[] | undefined>): ProcessedAsset[];
|
|
122
|
+
/**
|
|
123
|
+
* Resolves metadata for explicit view rendering.
|
|
124
|
+
*
|
|
125
|
+
* When a view declares a `metadata()` function, that contract owns the final
|
|
126
|
+
* metadata for the explicit render. Otherwise the app-level default metadata is
|
|
127
|
+
* reused so explicit routes and page-module routes share the same fallback.
|
|
128
|
+
*
|
|
129
|
+
* @param view - View component being rendered.
|
|
130
|
+
* @param props - Props passed to the view.
|
|
131
|
+
* @returns Resolved metadata for the final document shell.
|
|
132
|
+
*/
|
|
133
|
+
protected resolveViewMetadata<P>(view: EcoComponent<P>, props: P): Promise<PageMetadataProps>;
|
|
134
|
+
/**
|
|
135
|
+
* Renders one explicit view response in partial mode.
|
|
136
|
+
*
|
|
137
|
+
* Same-integration views can optionally stream or render inline via the caller's
|
|
138
|
+
* `renderInline()` hook. Once a view may cross integration boundaries, this
|
|
139
|
+
* helper routes the render through `renderComponentBoundary()` instead so mixed
|
|
140
|
+
* shells can reuse the execution-scoped renderer cache and resolve nested
|
|
141
|
+
* foreign ownership before the partial response is returned.
|
|
142
|
+
*
|
|
143
|
+
* @param input - View render options for the partial response.
|
|
144
|
+
* @returns HTML response for the partial render.
|
|
145
|
+
*/
|
|
146
|
+
protected renderPartialViewResponse<P>(input: {
|
|
147
|
+
view: EcoComponent<P>;
|
|
148
|
+
props: P;
|
|
149
|
+
ctx: RenderToResponseContext;
|
|
150
|
+
renderInline?: () => Promise<BodyInit>;
|
|
151
|
+
transformHtml?: (html: string) => string;
|
|
152
|
+
}): Promise<Response>;
|
|
153
|
+
/**
|
|
154
|
+
* Renders an explicit view through optional layout and document shells.
|
|
155
|
+
*
|
|
156
|
+
* This helper is the shared explicit-route path for string-oriented and mixed
|
|
157
|
+
* integrations. It prepares view dependencies, resolves metadata, and composes
|
|
158
|
+
* view, layout, and html template boundaries with one execution-scoped renderer
|
|
159
|
+
* cache so repeated foreign shell delegation can reuse initialized renderers
|
|
160
|
+
* during the same render flow.
|
|
161
|
+
*
|
|
162
|
+
* @param input - View, props, and optional layout metadata for the render.
|
|
163
|
+
* @returns HTML response for the explicit view render.
|
|
164
|
+
*/
|
|
165
|
+
protected renderViewWithDocumentShell<P>(input: {
|
|
166
|
+
view: EcoComponent<P>;
|
|
167
|
+
props: P;
|
|
168
|
+
ctx: RenderToResponseContext;
|
|
169
|
+
layout?: EcoComponent;
|
|
170
|
+
}): Promise<Response>;
|
|
171
|
+
/**
|
|
172
|
+
* Renders a route page through optional layout and document shells.
|
|
173
|
+
*
|
|
174
|
+
* Route rendering and explicit view rendering now share the same boundary-owned
|
|
175
|
+
* shell composition model. This helper composes page, layout, and html template
|
|
176
|
+
* boundaries while threading one execution-scoped renderer cache through every
|
|
177
|
+
* delegated boundary so foreign shell ownership remains stable and renderer
|
|
178
|
+
* initialization is reused inside the current request.
|
|
179
|
+
*
|
|
180
|
+
* @param input - Page, layout, document, and metadata inputs for the route render.
|
|
181
|
+
* @returns Final serialized document HTML including the doctype prefix.
|
|
182
|
+
*/
|
|
183
|
+
protected renderPageWithDocumentShell(input: {
|
|
184
|
+
page: {
|
|
185
|
+
component: EcoComponent;
|
|
186
|
+
props: Record<string, unknown>;
|
|
187
|
+
};
|
|
188
|
+
layout?: {
|
|
189
|
+
component: EcoComponent;
|
|
190
|
+
props?: Record<string, unknown>;
|
|
191
|
+
};
|
|
192
|
+
htmlTemplate: EcoComponent;
|
|
193
|
+
metadata: PageMetadataProps;
|
|
194
|
+
pageProps: Record<string, unknown>;
|
|
195
|
+
documentProps?: Record<string, unknown>;
|
|
196
|
+
transformDocumentHtml?: (html: string) => string;
|
|
197
|
+
}): Promise<string>;
|
|
198
|
+
/**
|
|
199
|
+
* Renders one string-first component boundary and collects its assets.
|
|
200
|
+
*
|
|
201
|
+
* String-oriented integrations frequently share the same boundary contract:
|
|
202
|
+
* pass serialized children through props, coerce the render result to HTML, and
|
|
203
|
+
* attach any component-scoped dependencies. This helper centralizes that flow
|
|
204
|
+
* so integrations can opt into shared orchestration without repeating the same
|
|
205
|
+
* boundary boilerplate.
|
|
206
|
+
*
|
|
207
|
+
* @param input - Boundary render input.
|
|
208
|
+
* @param component - String-oriented component implementation to execute.
|
|
209
|
+
* @returns Structured component render result for orchestration paths.
|
|
210
|
+
*/
|
|
211
|
+
protected renderStringComponentBoundary(input: ComponentRenderInput, component: (props: Record<string, unknown>) => Promise<EcoPagesElement> | EcoPagesElement): Promise<ComponentRenderResult>;
|
|
212
|
+
protected getBoundaryTokenPrefix(): string;
|
|
213
|
+
protected getBoundaryRuntimeContextKey(): string;
|
|
214
|
+
protected getQueuedBoundaryRuntime<TContext extends QueuedBoundaryRuntimeContext>(input: ComponentRenderInput, runtimeContextKey?: string): TContext | undefined;
|
|
215
|
+
protected resolveQueuedBoundaryTokens(html: string, queuedResolutionsByToken: Map<string, QueuedBoundaryResolution>, resolveToken: (token: string) => Promise<string>): Promise<string>;
|
|
216
|
+
protected createQueuedBoundaryRuntime<TContext extends QueuedBoundaryRuntimeContext>(options: {
|
|
217
|
+
boundaryInput: ComponentRenderInput;
|
|
218
|
+
rendererCache: Map<string, IntegrationRenderer<any>>;
|
|
219
|
+
runtimeContextKey?: string;
|
|
220
|
+
tokenPrefix?: string;
|
|
221
|
+
createRuntimeContext?: (integrationContext: {
|
|
222
|
+
rendererCache?: Map<string, unknown>;
|
|
223
|
+
componentInstanceId?: string;
|
|
224
|
+
[key: string]: unknown;
|
|
225
|
+
}, rendererCache: Map<string, unknown>) => TContext;
|
|
226
|
+
}): ComponentBoundaryRuntime;
|
|
227
|
+
protected resolveRendererOwnedQueuedBoundaryHtml<TContext extends QueuedBoundaryRuntimeContext>(options: {
|
|
228
|
+
html: string;
|
|
229
|
+
runtimeContext?: TContext;
|
|
230
|
+
queueLabel: string;
|
|
231
|
+
renderQueuedChildren: (children: unknown, runtimeContext: TContext, queuedResolutionsByToken: Map<string, QueuedBoundaryResolution>, resolveToken: (token: string) => Promise<string>) => Promise<{
|
|
232
|
+
assets: ProcessedAsset[];
|
|
233
|
+
html?: string;
|
|
234
|
+
}>;
|
|
235
|
+
}): Promise<{
|
|
236
|
+
assets: ProcessedAsset[];
|
|
237
|
+
html: string;
|
|
238
|
+
}>;
|
|
239
|
+
/**
|
|
240
|
+
* Renders a string-first component, then resolves any queued foreign
|
|
241
|
+
* boundaries before returning final component HTML.
|
|
242
|
+
*/
|
|
243
|
+
protected renderStringComponentBoundaryWithQueuedForeignBoundaries(input: ComponentRenderInput, component: (props: Record<string, unknown>) => Promise<EcoPagesElement> | EcoPagesElement): Promise<ComponentRenderResult>;
|
|
89
244
|
constructor({ appConfig, assetProcessingService, resolvedIntegrationDependencies, rendererModules, runtimeOrigin, }: {
|
|
90
245
|
appConfig: EcoPagesAppConfig;
|
|
91
246
|
assetProcessingService: AssetProcessingService;
|
|
@@ -231,11 +386,10 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
231
386
|
*
|
|
232
387
|
* Execution flow:
|
|
233
388
|
* 1. Build normalized render options (`prepareRenderOptions`).
|
|
234
|
-
* 2. Render
|
|
235
|
-
* 3.
|
|
236
|
-
* 4.
|
|
237
|
-
* 5.
|
|
238
|
-
* 6. Run HTML transformer with final dependency set.
|
|
389
|
+
* 2. Render the route body once.
|
|
390
|
+
* 3. Reject unresolved route-level boundary artifacts.
|
|
391
|
+
* 4. Optionally apply root attributes for page/component root boundaries.
|
|
392
|
+
* 5. Run HTML transformer with final dependency set.
|
|
239
393
|
*
|
|
240
394
|
* Stream-safety note: the first render result is normalized to a string once,
|
|
241
395
|
* then the pipeline continues with that immutable HTML value to avoid disturbed
|
|
@@ -246,23 +400,19 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
246
400
|
*/
|
|
247
401
|
execute(options: RouteRendererOptions): Promise<RouteRenderResult>;
|
|
248
402
|
/**
|
|
249
|
-
*
|
|
250
|
-
* for deferred marker resolution.
|
|
403
|
+
* Finalizes already-resolved HTML for explicit renderer-owned paths.
|
|
251
404
|
*
|
|
252
|
-
* This
|
|
253
|
-
*
|
|
254
|
-
*
|
|
405
|
+
* This keeps document and root-attribute stamping plus HTML transformation
|
|
406
|
+
* available after a renderer has completed nested boundary resolution without
|
|
407
|
+
* routing back through shared route execution.
|
|
255
408
|
*/
|
|
256
|
-
protected
|
|
409
|
+
protected finalizeResolvedHtml(options: {
|
|
257
410
|
html: string;
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
* HTML transformer for full-document flows.
|
|
264
|
-
*/
|
|
265
|
-
protected finalizeCapturedHtmlRender(options: FinalizeCapturedHtmlRenderOptions): Promise<string>;
|
|
411
|
+
partial?: boolean;
|
|
412
|
+
componentRootAttributes?: Record<string, string>;
|
|
413
|
+
documentAttributes?: Record<string, string>;
|
|
414
|
+
transformHtml?: boolean;
|
|
415
|
+
}): Promise<string>;
|
|
266
416
|
/**
|
|
267
417
|
* Returns document-level attributes to stamp onto the rendered `<html>` tag.
|
|
268
418
|
*
|
|
@@ -270,30 +420,6 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
270
420
|
* other runtime coordination markers without relying on script sniffing.
|
|
271
421
|
*/
|
|
272
422
|
protected getDocumentAttributes(_renderOptions: IntegrationRendererRenderOptions<C>): Record<string, string> | undefined;
|
|
273
|
-
/**
|
|
274
|
-
* Resolves all `eco-marker` placeholders in rendered HTML using integration
|
|
275
|
-
* dispatch and bottom-up graph execution.
|
|
276
|
-
*
|
|
277
|
-
* Responsibility split:
|
|
278
|
-
* - core decodes markers into component refs, props, slot children, and target
|
|
279
|
-
* integration dispatch
|
|
280
|
-
* - the selected integration renderer performs the actual component render via
|
|
281
|
-
* `renderComponent()`
|
|
282
|
-
*
|
|
283
|
-
* Resolver callback behavior per marker:
|
|
284
|
-
* - resolve component definition by `componentRef`
|
|
285
|
-
* - resolve serialized props by `propsRef`
|
|
286
|
-
* - stitch resolved child HTML when `slotRef` is present
|
|
287
|
-
* - dispatch to target integration `renderComponent`
|
|
288
|
-
* - collect produced assets and apply root attributes when attachable
|
|
289
|
-
*
|
|
290
|
-
* @param options.html HTML that may still contain marker tokens.
|
|
291
|
-
* @param options.componentsToResolve Component set used to build component ref registry.
|
|
292
|
-
* @param options.graphContext Props/slot linkage captured during render.
|
|
293
|
-
* @returns Resolved HTML plus any component-scoped assets produced while resolving nodes.
|
|
294
|
-
* @throws Error when marker component refs or props refs cannot be resolved.
|
|
295
|
-
*/
|
|
296
|
-
private resolveMarkerGraphHtml;
|
|
297
423
|
/**
|
|
298
424
|
* Returns a renderer instance for a given integration name.
|
|
299
425
|
*
|
|
@@ -313,17 +439,26 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
313
439
|
* @returns The rendered body.
|
|
314
440
|
*/
|
|
315
441
|
abstract render(options: IntegrationRendererRenderOptions<C>): Promise<RouteRendererBody>;
|
|
442
|
+
protected resolveBoundaryInOwningRenderer(input: ComponentRenderInput, rendererCache: Map<string, IntegrationRenderer<any>>): Promise<ComponentRenderResult | undefined>;
|
|
443
|
+
/**
|
|
444
|
+
* Renders one component under this integration's boundary runtime and resolves
|
|
445
|
+
* any nested foreign boundaries captured during that render.
|
|
446
|
+
*
|
|
447
|
+
* Without this wrapper, a component tree with foreign-owned descendants would
|
|
448
|
+
* render them with no active boundary runtime, which bypasses the owning
|
|
449
|
+
* renderer's nested-boundary handoff.
|
|
450
|
+
*/
|
|
451
|
+
renderComponentBoundary(input: ComponentRenderInput): Promise<ComponentRenderResult>;
|
|
452
|
+
private normalizeComponentBoundaryRender;
|
|
453
|
+
protected normalizeBoundaryArtifactHtml(html: string): string;
|
|
316
454
|
/**
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
* graph is being resolved bottom-up.
|
|
455
|
+
* Returns whether the component dependency tree crosses into another
|
|
456
|
+
* integration.
|
|
320
457
|
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
323
|
-
* fall back to inline escaped HTML instead of emitting the next marker layer.
|
|
458
|
+
* This keeps boundary-runtime setup narrow: same-integration trees can render
|
|
459
|
+
* directly without paying the queue orchestration cost.
|
|
324
460
|
*/
|
|
325
|
-
|
|
326
|
-
protected shouldWrapMarkerGraphComponent(component: EcoComponent): boolean;
|
|
461
|
+
protected hasForeignBoundaryDescendants(component: EcoComponent): boolean;
|
|
327
462
|
/**
|
|
328
463
|
* Render a view directly to a Response object.
|
|
329
464
|
* Used for explicit routing where views are rendered from route handlers.
|
|
@@ -340,7 +475,7 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
340
475
|
* Default behavior delegates to `renderToResponse` in partial mode and wraps
|
|
341
476
|
* the resulting HTML into the `ComponentRenderResult` contract.
|
|
342
477
|
*
|
|
343
|
-
* In
|
|
478
|
+
* In boundary resolution, this method is the integration-owned step that turns an
|
|
344
479
|
* already-resolved deferred boundary into concrete HTML, assets, and optional
|
|
345
480
|
* root attributes.
|
|
346
481
|
*
|
|
@@ -348,7 +483,7 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
348
483
|
* root attributes, integration-specific hydration metadata).
|
|
349
484
|
*
|
|
350
485
|
* @param input Component render request.
|
|
351
|
-
* @returns Structured render result used by
|
|
486
|
+
* @returns Structured render result used by component/page orchestration.
|
|
352
487
|
*/
|
|
353
488
|
renderComponent(input: ComponentRenderInput): Promise<ComponentRenderResult>;
|
|
354
489
|
/**
|
|
@@ -367,25 +502,28 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
367
502
|
*/
|
|
368
503
|
protected buildRouteRenderAssets(_file: string): Promise<ProcessedAsset[]> | undefined;
|
|
369
504
|
/**
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
* `eco.component()` consumes this facade without knowing about integration
|
|
374
|
-
* registries or plugin instances.
|
|
505
|
+
* Creates the per-render boundary runtime adopted by the shared component
|
|
506
|
+
* render context.
|
|
375
507
|
*
|
|
376
|
-
*
|
|
508
|
+
* Real mixed-integration renderers should override this and keep foreign
|
|
509
|
+
* boundary resolution inside their own renderer-owned queue. The base runtime
|
|
510
|
+
* fails fast when a renderer crosses into a foreign owner without providing its
|
|
511
|
+
* own handoff mechanism.
|
|
377
512
|
*/
|
|
378
|
-
protected
|
|
513
|
+
protected createComponentBoundaryRuntime(_options: {
|
|
514
|
+
boundaryInput: ComponentRenderInput;
|
|
515
|
+
rendererCache: Map<string, IntegrationRenderer<any>>;
|
|
516
|
+
}): ComponentBoundaryRuntime;
|
|
379
517
|
/**
|
|
380
|
-
* Resolves whether a
|
|
381
|
-
*
|
|
518
|
+
* Resolves whether a boundary should leave the current render pass and be
|
|
519
|
+
* resolved by its owning renderer.
|
|
382
520
|
*
|
|
383
|
-
* Boundaries
|
|
384
|
-
*
|
|
385
|
-
* `shouldDeferComponentBoundary()` policy.
|
|
521
|
+
* Boundaries owned by the current integration always render inline. Foreign-
|
|
522
|
+
* owned boundaries must be handed off by a renderer-owned runtime.
|
|
386
523
|
*
|
|
387
524
|
* @param input Boundary metadata for the active render pass.
|
|
388
|
-
* @returns `true` when the boundary should
|
|
525
|
+
* @returns `true` when the boundary should leave the current pass; otherwise `false`.
|
|
389
526
|
*/
|
|
390
|
-
protected
|
|
527
|
+
protected shouldResolveBoundaryInOwningRenderer(input: BoundaryRenderDecisionInput): boolean;
|
|
391
528
|
}
|
|
529
|
+
export {};
|