@reckona/mreact-compiler 0.0.117 → 0.0.119

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.
@@ -193,14 +193,14 @@ function emitClientBoundaryHelper(name) {
193
193
  ` }`,
194
194
  ` return false;`,
195
195
  `}`,
196
- `function ${name}(name, props) {`,
196
+ `function ${name}(name, props, childrenHtml = "") {`,
197
197
  ` const _name = String(name);`,
198
198
  ` const _escapedName = _name.replaceAll("&", "&amp;").replaceAll('"', "&quot;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");`,
199
199
  ` const _props = props ?? {};`,
200
200
  ` const _nonSerializable = ${propsHelperName}(_props);`,
201
201
  ` const _nonSerializableAttr = _nonSerializable ? ' data-mreact-client-boundary-nonserializable="true"' : "";`,
202
202
  ` const _json = (JSON.stringify(_props) ?? "{}").replaceAll("<", "\\\\u003c");`,
203
- ` return \`<template data-mreact-client-boundary="\${_escapedName}"\${_nonSerializableAttr}></template><script type="application/json" data-mreact-client-boundary-props="\${_escapedName}">\${_json}</script>\`;`,
203
+ ` return \`<template data-mreact-client-boundary="\${_escapedName}"\${_nonSerializableAttr}></template>\${childrenHtml}<script type="application/json" data-mreact-client-boundary-props="\${_escapedName}">\${_json}</script>\`;`,
204
204
  `}`,
205
205
  ].join("\n");
206
206
  }
@@ -829,7 +829,7 @@ function collectHtmlParts(node, escapeHelperName, asyncBoundaryHelperName, outOf
829
829
  return [
830
830
  {
831
831
  kind: "raw-dynamic",
832
- code: `${helperName}(${stringLiteral(node.name)}, ${emitPropsObject(node.props, node.children, escapeHelperName)})`,
832
+ code: `${helperName}(${stringLiteral(node.name)}, ${emitPropsObject(node.props, [], escapeHelperName)}, ${emitHtmlExpressionFromChildren(node.children, escapeHelperName)})`,
833
833
  },
834
834
  ];
835
835
  }