@ecopages/ecopages-jsx 0.2.0-rc.8 → 0.2.0-rc.9

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-rc.8",
3
+ "version": "0.2.0-rc.9",
4
4
  "description": "JSX integration plugin for Ecopages",
5
5
  "keywords": [
6
6
  "ecopages",
@@ -34,12 +34,12 @@
34
34
  "directory": "packages/integrations/ecopages-jsx"
35
35
  },
36
36
  "dependencies": {
37
- "@ecopages/mdx": "0.2.0-rc.8",
37
+ "@ecopages/mdx": "0.2.0-rc.9",
38
38
  "@mdx-js/mdx": "^3.1.1",
39
39
  "vfile": "^6.0.3"
40
40
  },
41
41
  "peerDependencies": {
42
- "@ecopages/core": "0.2.0-rc.8",
42
+ "@ecopages/core": "0.2.0-rc.9",
43
43
  "@ecopages/jsx": "^0.3.0-rc.9",
44
44
  "@ecopages/radiant": "^0.3.0-rc.9"
45
45
  }
@@ -8,7 +8,7 @@ import { isMdxFile, normalizeMdxPageModule, } from './ecopages-jsx-mdx.js';
8
8
  import { EcopagesJsxRenderSession } from './ecopages-jsx-render-session.js';
9
9
  import { EcopagesJsxRadiantSsrPolicy } from './ecopages-jsx-radiant-ssr-policy.js';
10
10
  import { CUSTOM_ELEMENT_SSR_PRELOAD_CACHE_SCOPES, CustomElementScriptPreloader, } from '@ecopages/core/route-renderer/orchestration/custom-element-scripts/custom-element-script-preloader';
11
- import { createCustomElementSsrPreloadEntrypointResolver } from '@ecopages/core/route-renderer/orchestration/custom-element-scripts/custom-element-ssr-preload-entrypoint';
11
+ import { createSharedServerModuleImporter } from '@ecopages/core/route-renderer/orchestration/custom-element-scripts/custom-element-server-module-importer';
12
12
  /**
13
13
  * Local Ecopages renderer for JSX templates in the docs app.
14
14
  *
@@ -130,20 +130,20 @@ export class EcopagesJsxRenderer extends IntegrationRenderer {
130
130
  const preferSourceImports = typeof Bun !== 'undefined';
131
131
  this.ssrScriptPreloader = new CustomElementScriptPreloader({
132
132
  cacheScope: CUSTOM_ELEMENT_SSR_PRELOAD_CACHE_SCOPES.ecopagesJsx,
133
- /**
134
- * @remarks
135
- * Node production builds evaluate registration scripts through the
136
- * asset pipeline during render. Preloading through the app module loader
137
- * registers Radiant hosts in an isolated graph and breaks SSR.
138
- */
139
- enabled: radiantSsrEnabled && preferSourceImports,
133
+ collectForIntegration: ECOPAGES_JSX_PLUGIN_NAME,
134
+ enabled: radiantSsrEnabled,
140
135
  logLabel: 'ecopages-jsx',
141
136
  preferSourceImports,
142
137
  resolveDependencyPath: (componentDir, sourcePath) => this.resolveDependencyPath(componentDir, sourcePath),
143
- resolvePreloadEntrypoint: createCustomElementSsrPreloadEntrypointResolver({
144
- preferSourceImports,
145
- processDependencies: this.assetProcessingService?.processDependencies?.bind(this.assetProcessingService),
146
- }),
138
+ /**
139
+ * @remarks
140
+ * Bun imports the source file through `preferSourceImports`. Node must
141
+ * not: dev asset output is still the `.tsx` source, and a browser bundle
142
+ * is a second Radiant graph. The page server-module loader transpiles
143
+ * the script and externalizes packages, so `customElements.define` hits
144
+ * the same module instances the page already loaded.
145
+ */
146
+ importServerModule: preferSourceImports ? undefined : createSharedServerModuleImporter(this.appConfig),
147
147
  });
148
148
  }
149
149
  /** Returns whether the requested page file should be treated as MDX. */