@ecopages/ecopages-jsx 0.2.0-beta.30 → 0.2.0-beta.32

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.
@@ -1,163 +1,171 @@
1
- import {
2
- IntegrationPlugin
3
- } from "@ecopages/core/plugins/integration-plugin";
4
- import { AssetFactory } from "@ecopages/core/services/asset-processing-service";
5
- import { ECOPAGES_JSX_PLUGIN_NAME } from "./ecopages-jsx.constants.js";
6
- import { RADIANT_INSTALL_HYDRATOR_FILEPATH } from "./resolve-radiant-install-hydrator.js";
7
- import {
8
- appendMdxExtensions,
9
- createMdxLoaderPlugin,
10
- registerBunMdxPlugin,
11
- resolveMdxCompilerOptions
12
- } from "./ecopages-jsx-mdx.js";
13
- import { EcopagesJsxRenderer } from "./ecopages-jsx-renderer.js";
14
- import { EcopagesJsxHmrStrategy } from "./ecopages-jsx-hmr-strategy.js";
15
- import { assignPageOwnedContentScriptGroupedBundles } from "./page-owned-content-script-grouping.js";
16
- import { invalidateRadiantRegisteredScriptSsrRegistration } from "./radiant-registered-script-ssr-invalidation.js";
17
- const RADIANT_HYDRATOR_SCRIPT_ID = "ecopages-jsx-radiant-hydrator";
1
+ import { IntegrationPlugin, } from '@ecopages/core/plugins/integration-plugin';
2
+ import { AssetFactory } from '@ecopages/core/services/asset-processing-service';
3
+ import { ECOPAGES_JSX_PLUGIN_NAME } from './ecopages-jsx.constants.js';
4
+ import { RADIANT_INSTALL_HYDRATOR_FILEPATH } from './resolve-radiant-install-hydrator.js';
5
+ import { appendMdxExtensions, createMdxLoaderPlugin, registerBunMdxPlugin, resolveMdxCompilerOptions, } from './ecopages-jsx-mdx.js';
6
+ import { EcopagesJsxRenderer } from './ecopages-jsx-renderer.js';
7
+ import { EcopagesJsxHmrStrategy } from './ecopages-jsx-hmr-strategy.js';
8
+ import { EcopagesJsxDevTransformContributor } from './dev-transform/ecopages-jsx-dev-transform-contributor.js';
9
+ import { assignPageOwnedContentScriptGroupedBundles } from './page-owned-content-script-grouping.js';
10
+ import { invalidateRadiantRegisteredScriptSsrRegistration } from './radiant-registered-script-ssr-invalidation.js';
11
+ const RADIANT_HYDRATOR_SCRIPT_ID = 'ecopages-jsx-radiant-hydrator';
12
+ /**
13
+ * Resolves user-facing plugin options into a fully-defaulted internal config.
14
+ *
15
+ * Defaults:
16
+ * - `extensions`: `['.tsx']`
17
+ * - `radiant`: `true`
18
+ * - `mdx.enabled`: `false`
19
+ * - `mdx.extensions`: `['.mdx']`
20
+ */
18
21
  const resolvePluginOptions = (options) => {
19
- const { extensions: userExtensions, radiant, mdx, ...baseConfig } = options ?? {};
20
- const extensions = [...userExtensions ?? [".tsx"]];
21
- const mdxExtensions = mdx?.extensions ?? [".mdx"];
22
- const mdxEnabled = mdx?.enabled ?? false;
23
- if (mdxEnabled) {
24
- appendMdxExtensions(extensions, mdxExtensions);
25
- }
26
- return {
27
- ...baseConfig,
28
- extensions,
29
- includeRadiant: radiant ?? true,
30
- mdxEnabled,
31
- mdxExtensions,
32
- mdxCompilerOptions: mdxEnabled && mdx ? resolveMdxCompilerOptions(mdx) : void 0
33
- };
22
+ const { extensions: userExtensions, radiant, mdx, ...baseConfig } = options ?? {};
23
+ const extensions = [...(userExtensions ?? ['.tsx'])];
24
+ const mdxExtensions = mdx?.extensions ?? ['.mdx'];
25
+ const mdxEnabled = mdx?.enabled ?? false;
26
+ if (mdxEnabled) {
27
+ appendMdxExtensions(extensions, mdxExtensions);
28
+ }
29
+ return {
30
+ ...baseConfig,
31
+ extensions,
32
+ includeRadiant: radiant ?? true,
33
+ mdxEnabled,
34
+ mdxExtensions,
35
+ mdxCompilerOptions: mdxEnabled && mdx ? resolveMdxCompilerOptions(mdx) : undefined,
36
+ };
34
37
  };
35
- class EcopagesJsxPlugin extends IntegrationPlugin {
36
- renderer = EcopagesJsxRenderer;
37
- includeRadiant;
38
- mdxEnabled;
39
- mdxCompilerOptions;
40
- mdxExtensions;
41
- mdxLoaderPlugin;
42
- /** Returns the build plugins required by the JSX integration. */
43
- get plugins() {
44
- return [this.mdxLoaderPlugin].filter((plugin) => plugin !== void 0);
45
- }
46
- /** Creates the renderer instance with the resolved JSX integration runtime options. */
47
- initializeRenderer(options) {
48
- return this.attachRendererRuntimeServices(
49
- new this.renderer({
50
- ...this.createRendererOptions(options),
51
- jsxConfig: {
52
- mdxExtensions: this.mdxExtensions,
53
- radiantSsrEnabled: this.includeRadiant
38
+ /** JSX integration plugin for Ecopages, supporting `.tsx` templates and optional Radiant web components. */
39
+ export class EcopagesJsxPlugin extends IntegrationPlugin {
40
+ renderer = EcopagesJsxRenderer;
41
+ includeRadiant;
42
+ mdxEnabled;
43
+ mdxCompilerOptions;
44
+ mdxExtensions;
45
+ mdxLoaderPlugin;
46
+ /** Returns the build plugins required by the JSX integration. */
47
+ get plugins() {
48
+ return [this.mdxLoaderPlugin].filter((plugin) => plugin !== undefined);
49
+ }
50
+ /** Creates the renderer instance with the resolved JSX integration runtime options. */
51
+ initializeRenderer(options) {
52
+ return this.attachRendererRuntimeServices(new this.renderer({
53
+ ...this.createRendererOptions(options),
54
+ jsxConfig: {
55
+ mdxExtensions: this.mdxExtensions,
56
+ radiantSsrEnabled: this.includeRadiant,
57
+ },
58
+ }));
59
+ }
60
+ constructor(options) {
61
+ const config = resolvePluginOptions(options);
62
+ const { extensions, includeRadiant, mdxEnabled, mdxExtensions, mdxCompilerOptions, ...baseConfig } = config;
63
+ super({
64
+ name: ECOPAGES_JSX_PLUGIN_NAME,
65
+ extensions,
66
+ jsxImportSource: '@ecopages/jsx',
67
+ ...baseConfig,
68
+ });
69
+ this.includeRadiant = includeRadiant;
70
+ this.mdxEnabled = mdxEnabled;
71
+ this.mdxExtensions = mdxExtensions;
72
+ this.mdxCompilerOptions = mdxCompilerOptions;
73
+ if (this.includeRadiant) {
74
+ this.integrationDependencies.unshift(...this.getDependencies());
54
75
  }
55
- })
56
- );
57
- }
58
- constructor(options) {
59
- const config = resolvePluginOptions(options);
60
- const { extensions, includeRadiant, mdxEnabled, mdxExtensions, mdxCompilerOptions, ...baseConfig } = config;
61
- super({
62
- name: ECOPAGES_JSX_PLUGIN_NAME,
63
- extensions,
64
- jsxImportSource: "@ecopages/jsx",
65
- ...baseConfig
66
- });
67
- this.includeRadiant = includeRadiant;
68
- this.mdxEnabled = mdxEnabled;
69
- this.mdxExtensions = mdxExtensions;
70
- this.mdxCompilerOptions = mdxCompilerOptions;
71
- if (this.includeRadiant) {
72
- this.integrationDependencies.unshift(...this.getDependencies());
73
76
  }
74
- }
75
- getDependencies() {
76
- return [
77
- AssetFactory.createNodeModuleScript({
78
- position: "head",
79
- importPath: RADIANT_INSTALL_HYDRATOR_FILEPATH,
80
- bundle: false,
81
- attributes: {
82
- "data-eco-script-id": RADIANT_HYDRATOR_SCRIPT_ID
77
+ getDependencies() {
78
+ return [
79
+ AssetFactory.createNodeModuleScript({
80
+ position: 'head',
81
+ importPath: RADIANT_INSTALL_HYDRATOR_FILEPATH,
82
+ bundle: false,
83
+ attributes: {
84
+ 'data-eco-script-id': RADIANT_HYDRATOR_SCRIPT_ID,
85
+ },
86
+ }),
87
+ ];
88
+ }
89
+ /** Ensures MDX build hooks are ready before Ecopages collects contributions. */
90
+ async prepareBuildContributions() {
91
+ this.ensureMdxLoaderPlugin();
92
+ }
93
+ /** Assigns grouped-build metadata for page-owned JSX content scripts. */
94
+ prepareAssetDependencies(dependencies) {
95
+ return assignPageOwnedContentScriptGroupedBundles(dependencies);
96
+ }
97
+ /** Registers JSX HMR strategy, dev-transform plugins, and Radiant SSR invalidation hooks. */
98
+ setHmrManager(hmrManager) {
99
+ super.setHmrManager(hmrManager);
100
+ const strategy = this.getHmrStrategy();
101
+ if (strategy) {
102
+ hmrManager.registerDevTransformContributor(new EcopagesJsxDevTransformContributor({
103
+ strategy: strategy,
104
+ getMdxLoaderPlugin: () => this.mdxLoaderPlugin,
105
+ }));
83
106
  }
84
- })
85
- ];
86
- }
87
- /** Ensures MDX build hooks are ready before Ecopages collects contributions. */
88
- async prepareBuildContributions() {
89
- this.ensureMdxLoaderPlugin();
90
- }
91
- /** Assigns grouped-build metadata for page-owned JSX content scripts. */
92
- prepareAssetDependencies(dependencies) {
93
- return assignPageOwnedContentScriptGroupedBundles(dependencies);
94
- }
95
- /** Registers JSX HMR strategy and Radiant SSR invalidation hooks. */
96
- setHmrManager(hmrManager) {
97
- super.setHmrManager(hmrManager);
98
- if (!this.includeRadiant || !this.appConfig) {
99
- return;
107
+ if (!this.includeRadiant || !this.appConfig) {
108
+ return;
109
+ }
110
+ const runtime = this.appConfig.runtime ?? {};
111
+ this.appConfig.runtime = runtime;
112
+ runtime.registeredScriptEntrypointChangeHandlers ??= [];
113
+ runtime.registeredScriptEntrypointChangeHandlers.push(invalidateRadiantRegisteredScriptSsrRegistration);
100
114
  }
101
- const runtime = this.appConfig.runtime ?? {};
102
- this.appConfig.runtime = runtime;
103
- runtime.registeredScriptEntrypointChangeHandlers ??= [];
104
- runtime.registeredScriptEntrypointChangeHandlers.push(invalidateRadiantRegisteredScriptSsrRegistration);
105
- }
106
- /**
107
- * Returns the JSX-integration HMR strategy.
108
- *
109
- * @remarks
110
- * The strategy handles `layout-update` broadcasts for page sources, layout
111
- * sources, and any component file in the active render tree. It defers
112
- * registered script entrypoints to the generic JS strategy and includes /
113
- * explicit server views to `ServerRenderedTemplateHmrStrategy`.
114
- */
115
- getHmrStrategy() {
116
- if (!this.hmrManager || !this.appConfig) {
117
- return void 0;
115
+ /**
116
+ * Returns the JSX-integration HMR strategy.
117
+ *
118
+ * @remarks
119
+ * The strategy handles `layout-update` broadcasts for page sources, layout
120
+ * sources, and any component file in the active render tree. It defers
121
+ * registered script entrypoints to the generic JS strategy and includes /
122
+ * explicit server views to `ServerRenderedTemplateHmrStrategy`.
123
+ */
124
+ getHmrStrategy() {
125
+ if (!this.hmrManager || !this.appConfig) {
126
+ return undefined;
127
+ }
128
+ const context = this.hmrManager.getDefaultContext();
129
+ const absolutePaths = this.appConfig.absolutePaths;
130
+ return new EcopagesJsxHmrStrategy({
131
+ getRegisteredEntrypoints: context.getRegisteredEntrypoints,
132
+ getSrcDir: context.getSrcDir,
133
+ getPagesDir: context.getPagesDir,
134
+ getLayoutsDir: context.getLayoutsDir,
135
+ getIncludesDir: () => absolutePaths.includesDir,
136
+ getTemplateExtensions: () => this.extensions,
137
+ });
118
138
  }
119
- const context = this.hmrManager.getDefaultContext();
120
- const absolutePaths = this.appConfig.absolutePaths;
121
- return new EcopagesJsxHmrStrategy({
122
- getWatchedFiles: context.getWatchedFiles,
123
- getSrcDir: context.getSrcDir,
124
- getPagesDir: context.getPagesDir,
125
- getLayoutsDir: context.getLayoutsDir,
126
- getIncludesDir: () => absolutePaths.includesDir,
127
- getTemplateExtensions: () => this.extensions
128
- });
129
- }
130
- /**
131
- * Registers MDX tooling and completes the base integration setup.
132
- */
133
- async setup() {
134
- this.ensureMdxLoaderPlugin();
135
- if (typeof Bun !== "undefined" && this.mdxEnabled && this.mdxCompilerOptions) {
136
- await this.registerMdxBunPlugin();
139
+ /**
140
+ * Registers MDX tooling and completes the base integration setup.
141
+ */
142
+ async setup() {
143
+ this.ensureMdxLoaderPlugin();
144
+ if (typeof Bun !== 'undefined' && this.mdxEnabled && this.mdxCompilerOptions) {
145
+ await this.registerMdxBunPlugin();
146
+ }
147
+ await super.setup();
137
148
  }
138
- await super.setup();
139
- }
140
- ensureMdxLoaderPlugin() {
141
- if (!this.mdxEnabled || !this.mdxCompilerOptions || this.mdxLoaderPlugin) {
142
- return;
149
+ ensureMdxLoaderPlugin() {
150
+ if (!this.mdxEnabled || !this.mdxCompilerOptions || this.mdxLoaderPlugin) {
151
+ return;
152
+ }
153
+ this.mdxLoaderPlugin = createMdxLoaderPlugin(this.mdxCompilerOptions, this.mdxExtensions);
143
154
  }
144
- this.mdxLoaderPlugin = createMdxLoaderPlugin(this.mdxCompilerOptions, this.mdxExtensions);
145
- }
146
- /**
147
- * Registers Bun's MDX loader at runtime setup time.
148
- *
149
- * Build-time contribution collection may run where Bun is absent, so
150
- * this hook stays isolated from manifest preparation.
151
- */
152
- async registerMdxBunPlugin() {
153
- if (typeof Bun === "undefined" || !this.mdxCompilerOptions) {
154
- return;
155
+ /**
156
+ * Registers Bun's MDX loader at runtime setup time.
157
+ *
158
+ * Build-time contribution collection may run where Bun is absent, so
159
+ * this hook stays isolated from manifest preparation.
160
+ */
161
+ async registerMdxBunPlugin() {
162
+ if (typeof Bun === 'undefined' || !this.mdxCompilerOptions) {
163
+ return;
164
+ }
165
+ await registerBunMdxPlugin(this.mdxCompilerOptions, this.mdxExtensions);
155
166
  }
156
- await registerBunMdxPlugin(this.mdxCompilerOptions, this.mdxExtensions);
157
- }
158
167
  }
159
- const ecopagesJsxPlugin = (options) => new EcopagesJsxPlugin(options);
160
- export {
161
- EcopagesJsxPlugin,
162
- ecopagesJsxPlugin
163
- };
168
+ /**
169
+ * Creates the JSX integration plugin with resolved defaults.
170
+ */
171
+ export const ecopagesJsxPlugin = (options) => new EcopagesJsxPlugin(options);
@@ -0,0 +1 @@
1
+ export {};
@@ -1,57 +1,63 @@
1
- import { rapidhash } from "@ecopages/core/utils/hash";
2
- import { ECOPAGES_JSX_PLUGIN_NAME } from "./ecopages-jsx.constants.js";
3
- const PAGE_OWNED_CONTENT_SCRIPT_BUNDLE_PREFIX = "ecopages";
4
- function createPageOwnedContentScriptBundleId(integrationName) {
5
- return `${PAGE_OWNED_CONTENT_SCRIPT_BUNDLE_PREFIX}-${integrationName}-page-content-scripts`;
1
+ import { rapidhash } from '@ecopages/core/utils/hash';
2
+ import { ECOPAGES_JSX_PLUGIN_NAME } from './ecopages-jsx.constants.js';
3
+ /** Shared grouped-build id prefix for page-owned content scripts. */
4
+ const PAGE_OWNED_CONTENT_SCRIPT_BUNDLE_PREFIX = 'ecopages';
5
+ /** Returns the stable grouped-build id for one integration's page-owned content scripts. */
6
+ export function createPageOwnedContentScriptBundleId(integrationName) {
7
+ return `${PAGE_OWNED_CONTENT_SCRIPT_BUNDLE_PREFIX}-${integrationName}-page-content-scripts`;
6
8
  }
7
9
  function isPageOwnedGroupableContentScript(dep) {
8
- if (dep.kind !== "script" || dep.source !== "content" || dep.inline) {
9
- return false;
10
- }
11
- if (dep.excludeFromHtml) {
12
- return false;
13
- }
14
- if (dep.groupedBundle?.id) {
15
- return false;
16
- }
17
- if (dep.packageRole === "keep-separate" || dep.packageRole === "runtime" || dep.packageRole === "dynamic-chunk") {
18
- return false;
19
- }
20
- return true;
10
+ if (dep.kind !== 'script' || dep.source !== 'content' || dep.inline) {
11
+ return false;
12
+ }
13
+ if (dep.excludeFromHtml) {
14
+ return false;
15
+ }
16
+ if (dep.groupedBundle?.id) {
17
+ return false;
18
+ }
19
+ if (dep.packageRole === 'keep-separate' || dep.packageRole === 'runtime' || dep.packageRole === 'dynamic-chunk') {
20
+ return false;
21
+ }
22
+ return true;
21
23
  }
22
24
  function createPageOwnedGroupedEntryName(dep, usedEntryNames) {
23
- const baseName = dep.name ?? `script-${rapidhash(dep.content).toString(16)}`;
24
- if (!usedEntryNames.has(baseName)) {
25
- usedEntryNames.add(baseName);
26
- return baseName;
27
- }
28
- let suffix = 2;
29
- let candidate = `${baseName}-${suffix}`;
30
- while (usedEntryNames.has(candidate)) {
31
- suffix += 1;
32
- candidate = `${baseName}-${suffix}`;
33
- }
34
- usedEntryNames.add(candidate);
35
- return candidate;
36
- }
37
- function assignPageOwnedContentScriptGroupedBundles(dependencies) {
38
- const bundleId = createPageOwnedContentScriptBundleId(ECOPAGES_JSX_PLUGIN_NAME);
39
- const usedEntryNames = /* @__PURE__ */ new Set();
40
- for (const dependency of dependencies) {
41
- if (!isPageOwnedGroupableContentScript(dependency)) {
42
- continue;
25
+ const baseName = dep.name ?? `script-${rapidhash(dep.content).toString(16)}`;
26
+ if (!usedEntryNames.has(baseName)) {
27
+ usedEntryNames.add(baseName);
28
+ return baseName;
29
+ }
30
+ let suffix = 2;
31
+ let candidate = `${baseName}-${suffix}`;
32
+ while (usedEntryNames.has(candidate)) {
33
+ suffix += 1;
34
+ candidate = `${baseName}-${suffix}`;
43
35
  }
44
- dependency.groupedBundle = {
45
- id: bundleId,
46
- entryName: createPageOwnedGroupedEntryName(dependency, usedEntryNames)
47
- };
48
- if (dependency.bundle === false) {
49
- dependency.bundle = true;
36
+ usedEntryNames.add(candidate);
37
+ return candidate;
38
+ }
39
+ /**
40
+ * Tags page-owned content scripts in one dependency batch with a shared grouped-build id.
41
+ *
42
+ * @remarks
43
+ * Lazy hydration entries (`excludeFromHtml`), component file scripts, and integration runtime
44
+ * assets stay ungrouped. Integrations that already assign a grouped id (for example React
45
+ * Router pages) are left unchanged.
46
+ */
47
+ export function assignPageOwnedContentScriptGroupedBundles(dependencies) {
48
+ const bundleId = createPageOwnedContentScriptBundleId(ECOPAGES_JSX_PLUGIN_NAME);
49
+ const usedEntryNames = new Set();
50
+ for (const dependency of dependencies) {
51
+ if (!isPageOwnedGroupableContentScript(dependency)) {
52
+ continue;
53
+ }
54
+ dependency.groupedBundle = {
55
+ id: bundleId,
56
+ entryName: createPageOwnedGroupedEntryName(dependency, usedEntryNames),
57
+ };
58
+ if (dependency.bundle === false) {
59
+ dependency.bundle = true;
60
+ }
50
61
  }
51
- }
52
- return dependencies;
62
+ return dependencies;
53
63
  }
54
- export {
55
- assignPageOwnedContentScriptGroupedBundles,
56
- createPageOwnedContentScriptBundleId
57
- };
@@ -15,4 +15,4 @@ export declare function clearRadiantCustomElementDefinition(tagName: string): vo
15
15
  /**
16
16
  * Clears the SSR custom-element registry entry for one registered Radiant script module.
17
17
  */
18
- export declare function invalidateRadiantRegisteredScriptSsrRegistration(scriptPath: string): void;
18
+ export declare function invalidateRadiantRegisteredScriptSsrRegistration(scriptPath: string): boolean;
@@ -1,36 +1,47 @@
1
- import { existsSync, readFileSync } from "node:fs";
1
+ import { existsSync, readFileSync } from 'node:fs';
2
2
  const CUSTOM_ELEMENT_TAG_PATTERN = /@customElement\s*\(\s*['"`]([^'"`]+)['"`]/u;
3
- function resolveRadiantCustomElementTag(scriptPath) {
4
- if (!existsSync(scriptPath)) {
5
- return void 0;
6
- }
7
- const content = readFileSync(scriptPath, "utf8");
8
- const match = content.match(CUSTOM_ELEMENT_TAG_PATTERN);
9
- return match?.[1];
3
+ /**
4
+ * Reads the custom-element tag name from a registered script module source file.
5
+ */
6
+ export function resolveRadiantCustomElementTag(scriptPath) {
7
+ if (!existsSync(scriptPath)) {
8
+ return undefined;
9
+ }
10
+ const content = readFileSync(scriptPath, 'utf8');
11
+ const match = content.match(CUSTOM_ELEMENT_TAG_PATTERN);
12
+ return match?.[1];
10
13
  }
11
- function clearRadiantCustomElementDefinition(tagName) {
12
- const registry = globalThis.customElements;
13
- if (!registry) {
14
- return;
15
- }
16
- if (typeof registry.delete === "function") {
17
- registry.delete(tagName);
18
- return;
19
- }
20
- const definitions = registry.definitions;
21
- if (definitions instanceof Map && definitions.has(tagName)) {
22
- definitions.delete(tagName);
23
- }
14
+ /**
15
+ * Removes one custom-element definition from the active runtime registry.
16
+ *
17
+ * @remarks
18
+ * Radiant's `@customElement` decorator and the SSR light-DOM shim both skip
19
+ * re-registration when a tag is already defined. During dev, server requests
20
+ * reuse the same process-global registry, so script edits would otherwise keep
21
+ * serving stale SSR markup until a full dev-server restart.
22
+ */
23
+ export function clearRadiantCustomElementDefinition(tagName) {
24
+ const registry = globalThis.customElements;
25
+ if (!registry) {
26
+ return;
27
+ }
28
+ if (typeof registry.delete === 'function') {
29
+ registry.delete(tagName);
30
+ return;
31
+ }
32
+ const definitions = registry.definitions;
33
+ if (definitions instanceof Map && definitions.has(tagName)) {
34
+ definitions.delete(tagName);
35
+ }
24
36
  }
25
- function invalidateRadiantRegisteredScriptSsrRegistration(scriptPath) {
26
- const tagName = resolveRadiantCustomElementTag(scriptPath);
27
- if (!tagName) {
28
- return;
29
- }
30
- clearRadiantCustomElementDefinition(tagName);
37
+ /**
38
+ * Clears the SSR custom-element registry entry for one registered Radiant script module.
39
+ */
40
+ export function invalidateRadiantRegisteredScriptSsrRegistration(scriptPath) {
41
+ const tagName = resolveRadiantCustomElementTag(scriptPath);
42
+ if (!tagName) {
43
+ return false;
44
+ }
45
+ clearRadiantCustomElementDefinition(tagName);
46
+ return true;
31
47
  }
32
- export {
33
- clearRadiantCustomElementDefinition,
34
- invalidateRadiantRegisteredScriptSsrRegistration,
35
- resolveRadiantCustomElementTag
36
- };
@@ -1,7 +1,3 @@
1
- import { fileURLToPath } from "node:url";
2
- const RADIANT_INSTALL_HYDRATOR_FILEPATH = fileURLToPath(
3
- import.meta.resolve("@ecopages/radiant/client/install-hydrator")
4
- );
5
- export {
6
- RADIANT_INSTALL_HYDRATOR_FILEPATH
7
- };
1
+ import { fileURLToPath } from 'node:url';
2
+ /** Absolute path to `@ecopages/radiant/client/install-hydrator` from this integration package. */
3
+ export const RADIANT_INSTALL_HYDRATOR_FILEPATH = fileURLToPath(import.meta.resolve('@ecopages/radiant/client/install-hydrator'));