@nifrajs/web-preact 2.0.0 → 2.2.0

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 +1 @@
1
- {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAyB,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAA;AAE1D;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,EAAE,KAAK,EAAE,WAAW,GAAG,KAAK,CAa5E"}
1
+ {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAyB,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAA;AAE1D;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,EAAE,KAAK,EAAE,WAAW,GAAG,KAAK,CAoB5E"}
package/dist/compose.js CHANGED
@@ -15,7 +15,10 @@ export function compose(chain, props) {
15
15
  let node = h(chain[last], props);
16
16
  for (let i = last - 1; i >= 0; i--) {
17
17
  // children passed as the 3rd arg — Preact's canonical form (mirrors the React adapter).
18
- node = h(chain[i], null, node);
18
+ // Each layout receives its own loader data at its own index. Layouts are the chain's leading
19
+ // prefix, so `layoutData[i]` belongs to `chain[i]`; anything past that end (a client-only `_error`
20
+ // boundary marker, the page) reads `undefined` and is unaffected.
21
+ node = h(chain[i], { data: props.layoutData?.[i] ?? null }, node);
19
22
  }
20
23
  return node;
21
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"compose.js","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,CAAC,EAAc,MAAM,QAAQ,CAAA;AAE1D;;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AI,EAAE,EACvC,IAAI,CACI,CAAA;IACZ,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nifrajs/web-preact",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "Preact render adapter for @nifrajs/web — streaming SSR + hydration (no build plugin).",
5
5
  "keywords": [
6
6
  "bun",
@@ -70,9 +70,9 @@
70
70
  "access": "public"
71
71
  },
72
72
  "dependencies": {
73
- "@nifrajs/i18n": "2.0.0",
74
- "@nifrajs/image": "2.0.0",
75
- "@nifrajs/web": "2.0.0",
73
+ "@nifrajs/i18n": "2.2.0",
74
+ "@nifrajs/image": "2.2.0",
75
+ "@nifrajs/web": "2.2.0",
76
76
  "preact-render-to-string": "^6.5.0"
77
77
  },
78
78
  "peerDependencies": {
package/src/compose.ts CHANGED
@@ -17,7 +17,14 @@ export function compose(chain: readonly unknown[], props: RenderProps): VNode {
17
17
  let node: VNode = h(chain[last] as ComponentType<RenderProps>, props) as VNode
18
18
  for (let i = last - 1; i >= 0; i--) {
19
19
  // children passed as the 3rd arg — Preact's canonical form (mirrors the React adapter).
20
- node = h(chain[i] as ComponentType, null, node)
20
+ // Each layout receives its own loader data at its own index. Layouts are the chain's leading
21
+ // prefix, so `layoutData[i]` belongs to `chain[i]`; anything past that end (a client-only `_error`
22
+ // boundary marker, the page) reads `undefined` and is unaffected.
23
+ node = h(
24
+ chain[i] as ComponentType<{ data: unknown }>,
25
+ { data: props.layoutData?.[i] ?? null },
26
+ node,
27
+ ) as VNode
21
28
  }
22
29
  return node
23
30
  }