@ecopages/lit 0.2.0-beta.27 → 0.2.0-beta.28
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 +2 -2
- package/src/lit-renderer.d.ts +1 -1
- package/src/lit-renderer.js +26 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecopages/lit",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.28",
|
|
4
4
|
"description": "Ecopages lit integration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ecopages",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"directory": "packages/integrations/lit"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@ecopages/core": "0.2.0-beta.
|
|
42
|
+
"@ecopages/core": "0.2.0-beta.28",
|
|
43
43
|
"@lit-labs/ssr": "^3.3.0",
|
|
44
44
|
"@lit-labs/ssr-client": "^1.1.7",
|
|
45
45
|
"lit": "^3.2.1"
|
package/src/lit-renderer.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { ComponentRenderInput, ComponentRenderResult, EcoComponent, EcoPagesElement, IntegrationRendererRenderOptions, RouteRenderResult, RouteRendererBody, RouteRendererOptions } from '@ecopages/core';
|
|
6
6
|
import './dom-shim.js';
|
|
7
|
-
import { IntegrationRenderer, type RenderToResponseContext } from '@ecopages/core/route-renderer/integration-renderer';
|
|
7
|
+
import { IntegrationRenderer, type RenderToResponseContext } from '@ecopages/core/route-renderer/orchestration/integration-renderer';
|
|
8
8
|
import type { LitStaticRenderSession } from './lit-static-render-session.js';
|
|
9
9
|
export type LitRendererOptions = ConstructorParameters<typeof IntegrationRenderer>[0] & {
|
|
10
10
|
/**
|
package/src/lit-renderer.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import "./dom-shim.js";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
IntegrationRenderer
|
|
4
|
+
} from "@ecopages/core/route-renderer/orchestration/integration-renderer";
|
|
5
|
+
import {
|
|
6
|
+
getForeignSubtreeResolutionContextKey,
|
|
7
|
+
resolveOwningIntegrationRenderer
|
|
8
|
+
} from "@ecopages/core/route-renderer/orchestration/foreign-child/owning-renderer-resolution";
|
|
3
9
|
import { LitSsrLazyPreloader } from "./lit-ssr-lazy-preloader.js";
|
|
4
10
|
import { LIT_PLUGIN_NAME } from "./lit.constants.js";
|
|
5
11
|
import {
|
|
@@ -106,12 +112,26 @@ class LitRenderer extends IntegrationRenderer {
|
|
|
106
112
|
const content = await component(props);
|
|
107
113
|
const renderedHtml = await renderLitValueToString(content);
|
|
108
114
|
const html = renderedChildren === void 0 ? renderedHtml : injectLitRenderedChildren(renderedHtml, renderedChildren);
|
|
109
|
-
const queuedForeignSubtreeResolution = await this.
|
|
115
|
+
const queuedForeignSubtreeResolution = await this.foreignSubtreeExecutionService.resolveQueuedHtml({
|
|
116
|
+
currentIntegrationName: this.name,
|
|
110
117
|
html,
|
|
111
|
-
this.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
118
|
+
runtimeContext: this.foreignSubtreeExecutionService.getQueuedRuntimeContext(
|
|
119
|
+
input,
|
|
120
|
+
getForeignSubtreeResolutionContextKey(this.name)
|
|
121
|
+
),
|
|
122
|
+
queueLabel: "Lit",
|
|
123
|
+
getOwningRenderer: (integrationName, rendererCache) => resolveOwningIntegrationRenderer({
|
|
124
|
+
appConfig: this.appConfig,
|
|
125
|
+
runtimeOrigin: this.runtimeOrigin,
|
|
126
|
+
currentIntegrationName: this.name,
|
|
127
|
+
currentRenderer: this,
|
|
128
|
+
integrationName,
|
|
129
|
+
cache: rendererCache
|
|
130
|
+
}),
|
|
131
|
+
applyAttributesToFirstElement: (resolvedHtml, attributes) => this.htmlTransformer.applyAttributesToFirstElement(resolvedHtml, attributes),
|
|
132
|
+
dedupeProcessedAssets: (assets2) => this.htmlTransformer.dedupeProcessedAssets(assets2),
|
|
133
|
+
renderQueuedChildren: (children, _runtimeContext, queuedResolutionsByToken, resolveToken) => this.renderLitQueuedForeignSubtreeChildren(children, queuedResolutionsByToken, resolveToken)
|
|
134
|
+
});
|
|
115
135
|
const hasDependencies = Boolean(input.component.config?.dependencies);
|
|
116
136
|
const canResolveAssets = typeof this.assetProcessingService?.processDependencies === "function";
|
|
117
137
|
const assets = hasDependencies && canResolveAssets ? await this.processComponentDependencies([input.component]) : void 0;
|