@ecopages/ecopages-jsx 0.2.0-alpha.38 → 0.2.0-alpha.40
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/ecopages-jsx",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.40",
|
|
4
4
|
"description": "JSX integration plugin for Ecopages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ecopages",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"vfile": "^6.0.3"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@ecopages/core": "0.2.0-alpha.
|
|
39
|
-
"@ecopages/jsx": "0.3.0-alpha.
|
|
40
|
-
"@ecopages/radiant": "0.3.0-alpha.
|
|
38
|
+
"@ecopages/core": "0.2.0-alpha.40",
|
|
39
|
+
"@ecopages/jsx": "0.3.0-alpha.25",
|
|
40
|
+
"@ecopages/radiant": "0.3.0-alpha.25"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { createMarkupNodeLike } from "@ecopages/jsx";
|
|
2
|
-
import {
|
|
3
|
-
createServerHydrationBindingState,
|
|
4
|
-
isServerRenderHydrationActive,
|
|
5
|
-
withServerHydrationBindingState
|
|
6
|
-
} from "@ecopages/jsx/server";
|
|
2
|
+
import { createServerHydrationBindingState, withServerHydrationBindingState } from "@ecopages/jsx/server";
|
|
7
3
|
class EcopagesJsxRadiantSsrPolicy {
|
|
8
4
|
static runtimeModules;
|
|
9
5
|
static runtimeModulesPromise;
|
|
@@ -49,7 +45,7 @@ class EcopagesJsxRadiantSsrPolicy {
|
|
|
49
45
|
withServerHydrationBindingState(
|
|
50
46
|
createServerHydrationBindingState(),
|
|
51
47
|
() => renderBridge.renderHostToString({
|
|
52
|
-
mode:
|
|
48
|
+
mode: "hydrate"
|
|
53
49
|
})
|
|
54
50
|
)
|
|
55
51
|
);
|
|
@@ -213,9 +213,7 @@ class EcopagesJsxRenderer extends IntegrationRenderer {
|
|
|
213
213
|
}
|
|
214
214
|
async renderJsx(value) {
|
|
215
215
|
const collectedAssets = [];
|
|
216
|
-
const html = await this.
|
|
217
|
-
() => this.withCustomElementRenderHook(() => renderToString(value, { mode: "hydrate" }))
|
|
218
|
-
);
|
|
216
|
+
const html = await this.withCustomElementRenderHook(() => renderToString(value));
|
|
219
217
|
const dedupedAssets = this.renderSession.recordCollectedAssets(collectedAssets);
|
|
220
218
|
return {
|
|
221
219
|
assets: dedupedAssets,
|
|
@@ -18,6 +18,7 @@ export declare class EcopagesJsxPlugin extends IntegrationPlugin<JsxRenderable>
|
|
|
18
18
|
rendererModules?: unknown;
|
|
19
19
|
}): EcopagesJsxRenderer;
|
|
20
20
|
constructor(options?: EcopagesJsxPluginOptions);
|
|
21
|
+
private getDependencies;
|
|
21
22
|
/** Ensures MDX build hooks are ready before Ecopages collects contributions. */
|
|
22
23
|
prepareBuildContributions(): Promise<void>;
|
|
23
24
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
IntegrationPlugin
|
|
3
3
|
} from "@ecopages/core/plugins/integration-plugin";
|
|
4
|
+
import { AssetFactory } from "@ecopages/core/services/asset-processing-service";
|
|
4
5
|
import { ECOPAGES_JSX_PLUGIN_NAME } from "./ecopages-jsx.constants.js";
|
|
5
6
|
import {
|
|
6
7
|
appendMdxExtensions,
|
|
@@ -9,6 +10,7 @@ import {
|
|
|
9
10
|
resolveMdxCompilerOptions
|
|
10
11
|
} from "./ecopages-jsx-mdx.js";
|
|
11
12
|
import { EcopagesJsxRenderer } from "./ecopages-jsx-renderer.js";
|
|
13
|
+
const RADIANT_HYDRATOR_SCRIPT_ID = "ecopages-jsx-radiant-hydrator";
|
|
12
14
|
const resolvePluginOptions = (options) => {
|
|
13
15
|
const { extensions: userExtensions, radiant, mdx, ...baseConfig } = options ?? {};
|
|
14
16
|
const extensions = [...userExtensions ?? [".tsx"]];
|
|
@@ -62,6 +64,21 @@ class EcopagesJsxPlugin extends IntegrationPlugin {
|
|
|
62
64
|
this.mdxEnabled = mdxEnabled;
|
|
63
65
|
this.mdxExtensions = mdxExtensions;
|
|
64
66
|
this.mdxCompilerOptions = mdxCompilerOptions;
|
|
67
|
+
if (this.includeRadiant) {
|
|
68
|
+
this.integrationDependencies.unshift(...this.getDependencies());
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
getDependencies() {
|
|
72
|
+
return [
|
|
73
|
+
AssetFactory.createNodeModuleScript({
|
|
74
|
+
position: "head",
|
|
75
|
+
importPath: "@ecopages/radiant/client/install-hydrator",
|
|
76
|
+
bundle: false,
|
|
77
|
+
attributes: {
|
|
78
|
+
"data-eco-script-id": RADIANT_HYDRATOR_SCRIPT_ID
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
];
|
|
65
82
|
}
|
|
66
83
|
/** Ensures MDX build hooks are ready before Ecopages collects contributions. */
|
|
67
84
|
async prepareBuildContributions() {
|