@ecopages/kitajs 0.2.0-alpha.23 → 0.2.0-alpha.25
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecopages/kitajs",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.25",
|
|
4
4
|
"description": "Kitajs plugin for Ecopages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ecopages",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"directory": "packages/integrations/kitajs"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@ecopages/core": "0.2.0-alpha.
|
|
20
|
+
"@ecopages/core": "0.2.0-alpha.25",
|
|
21
21
|
"@kitajs/html": "^4.1.0",
|
|
22
22
|
"@kitajs/ts-html-plugin": "^4.0.1"
|
|
23
23
|
}
|
package/src/kitajs-renderer.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { IntegrationRenderer, type RenderToResponseContext } from '@ecopages/cor
|
|
|
10
10
|
*/
|
|
11
11
|
export declare class KitaRenderer extends IntegrationRenderer<EcoPagesElement> {
|
|
12
12
|
name: string;
|
|
13
|
+
private isFunctionComponent;
|
|
13
14
|
/**
|
|
14
15
|
* Renders a Kita component boundary for component-level orchestration.
|
|
15
16
|
*
|
package/src/kitajs-renderer.js
CHANGED
|
@@ -2,16 +2,19 @@ import { IntegrationRenderer } from "@ecopages/core/route-renderer/integration-r
|
|
|
2
2
|
import { KITAJS_PLUGIN_NAME } from "./kitajs.constants.js";
|
|
3
3
|
class KitaRenderer extends IntegrationRenderer {
|
|
4
4
|
name = KITAJS_PLUGIN_NAME;
|
|
5
|
+
isFunctionComponent(component) {
|
|
6
|
+
return typeof component === "function";
|
|
7
|
+
}
|
|
5
8
|
/**
|
|
6
9
|
* Renders a Kita component boundary for component-level orchestration.
|
|
7
10
|
*
|
|
8
11
|
* Includes component-scoped dependency assets when declared.
|
|
9
12
|
*/
|
|
10
13
|
async renderComponent(input) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
);
|
|
14
|
+
if (!this.isFunctionComponent(input.component)) {
|
|
15
|
+
throw new TypeError("Kita renderer expected a callable component.");
|
|
16
|
+
}
|
|
17
|
+
return this.renderStringComponentBoundaryWithQueuedForeignBoundaries(input, input.component);
|
|
15
18
|
}
|
|
16
19
|
createComponentBoundaryRuntime(options) {
|
|
17
20
|
return this.createQueuedBoundaryRuntime({
|