@ecopages/react 0.2.0-rc.0 → 0.2.0-rc.1

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/react",
3
- "version": "0.2.0-rc.0",
3
+ "version": "0.2.0-rc.1",
4
4
  "description": "React integration for Ecopages",
5
5
  "keywords": [
6
6
  "ecopages",
@@ -93,16 +93,16 @@
93
93
  "directory": "packages/integrations/react"
94
94
  },
95
95
  "peerDependencies": {
96
- "@ecopages/core": "0.2.0-rc.0",
96
+ "@ecopages/core": "0.2.0-rc.1",
97
97
  "@types/react": "^19",
98
98
  "@types/react-dom": "^19",
99
99
  "react": "^19",
100
100
  "react-dom": "^19"
101
101
  },
102
102
  "dependencies": {
103
- "@ecopages/file-system": "0.2.0-rc.0",
103
+ "@ecopages/file-system": "0.2.0-rc.1",
104
104
  "@ecopages/logger": "^0.2.3",
105
- "@ecopages/mdx": "0.2.0-rc.0",
105
+ "@ecopages/mdx": "0.2.0-rc.1",
106
106
  "@mdx-js/mdx": "^3.1.1",
107
107
  "oxc-parser": "^0.141.0",
108
108
  "oxc-transform": "^0.141.0",
@@ -19,6 +19,7 @@ import { PageModuleService } from '../page/page-module.js';
19
19
  import { PagePayloadService } from '../hydration/page-payload.js';
20
20
  import { HydrationAssetService } from '../hydration/hydration-asset.js';
21
21
  import { type DocumentShellLayoutInput } from '@ecopages/core/route-renderer/orchestration/document-shell/document-shell-render.service';
22
+ import type { ForeignChildRuntime } from '@ecopages/core/route-renderer/orchestration/foreign-child/component-render-context';
22
23
  import { type ReactRuntimeModules } from './react-runtime.js';
23
24
  export type { ReactRendererConfig } from '../plugin/react.types.js';
24
25
  export { BundleError, ReactRenderError } from './errors.js';
@@ -83,7 +84,7 @@ export declare class ReactRenderer extends IntegrationRenderer<ReactNode> {
83
84
  protected createForeignChildRuntime(options: {
84
85
  renderInput: ComponentRenderInput;
85
86
  rendererCache: Map<string, IntegrationRenderer<any>>;
86
- }): import("@ecopages/core").ForeignChildRuntime;
87
+ }): ForeignChildRuntime;
87
88
  /**
88
89
  * Checks if the given file path corresponds to an MDX file based on configured extensions.
89
90
  * @param filePath - The file path to check
@@ -117,7 +118,7 @@ export declare class ReactRenderer extends IntegrationRenderer<ReactNode> {
117
118
  * serialize only the browser-safe page payload, compose the mixed React/non-
118
119
  * React shell tree, and hand the result back as a document body.
119
120
  */
120
- render({ params, query, props, locals, pageLocals, metadata, Page, Layout, HtmlTemplate, pageProps, pagePackage, }: IntegrationRendererRenderOptions<ReactNode>): Promise<RouteRendererBody>;
121
+ render({ params, query, props, locals, pageLocals, metadata, Page, Layout, layoutEntries, HtmlTemplate, pageProps, pagePackage, }: IntegrationRendererRenderOptions<ReactNode>): Promise<RouteRendererBody>;
121
122
  protected getHtmlDocumentContributions(options: HtmlDocumentContributionContext<ReactNode>): HtmlDocumentContribution[] | undefined;
122
123
  protected getDocumentAttributes(): Record<string, string> | undefined;
123
124
  protected renderViewWithDocumentShell<P>(input: {
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import { getComponentIdentity } from '@ecopages/core';
12
12
  import { IntegrationRenderer, } from '@ecopages/core/route-renderer/orchestration/integration-renderer';
13
+ import { resolveDocumentShellLayouts } from '@ecopages/core/route-renderer/orchestration/document-shell/layout-shell-props.service';
13
14
  import { RESOLVED_ASSETS_DIR } from '@ecopages/core/constants';
14
15
  import { ECO_DOCUMENT_OWNER_ATTRIBUTE } from '@ecopages/core/router/navigation-coordinator';
15
16
  import { ensurePageConfigLayouts } from '@ecopages/core/eco/page-layout-normalization';
@@ -297,7 +298,7 @@ export class ReactRenderer extends IntegrationRenderer {
297
298
  * serialize only the browser-safe page payload, compose the mixed React/non-
298
299
  * React shell tree, and hand the result back as a document body.
299
300
  */
300
- async render({ params, query, props, locals, pageLocals, metadata, Page, Layout, HtmlTemplate, pageProps, pagePackage, }) {
301
+ async render({ params, query, props, locals, pageLocals, metadata, Page, Layout, layoutEntries, HtmlTemplate, pageProps, pagePackage, }) {
301
302
  try {
302
303
  const pageModuleUrl = this.pagePayloadService.resolvePageModuleUrl(pagePackage, {
303
304
  routerEnabled: Boolean(this.routerAdapter),
@@ -314,12 +315,13 @@ export class ReactRenderer extends IntegrationRenderer {
314
315
  component: Page,
315
316
  props: { params, query, ...props, locals: pageLocals },
316
317
  },
317
- layout: Layout
318
- ? {
319
- component: Layout,
320
- props: locals ? { locals } : {},
321
- }
322
- : undefined,
318
+ layouts: resolveDocumentShellLayouts({
319
+ layout: Layout,
320
+ layoutEntries,
321
+ params,
322
+ query,
323
+ locals,
324
+ }),
323
325
  htmlTemplate: HtmlTemplate,
324
326
  metadata,
325
327
  pageProps: allPageProps,