babel-plugin-jsx-dom-expressions 0.34.10 → 0.34.13

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.
Files changed (2) hide show
  1. package/index.js +10 -1
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -1567,7 +1567,7 @@ function createTemplate$1(path, result) {
1567
1567
 
1568
1568
  return t__namespace.callExpression(
1569
1569
  registerImportMethod(path, "ssr"),
1570
- result.template.length > 1 ? [id, ...result.templateValues] : [id]
1570
+ Array.isArray(result.template) && result.template.length > 1 ? [id, ...result.templateValues] : [id]
1571
1571
  );
1572
1572
  }
1573
1573
 
@@ -2004,6 +2004,7 @@ function createElement(path, { topLevel, hydratable }) {
2004
2004
  } else {
2005
2005
  const child = transformNode(path);
2006
2006
  if (markers && child.exprs.length) memo.push(t__namespace.stringLiteral("<!--#-->"));
2007
+ if (child.exprs.length && !child.spreadElement) child.exprs[0] = escapeExpression(path, child.exprs[0]);
2007
2008
  memo.push(getCreateTemplate(config, path, child)(path, child, true));
2008
2009
  if (markers && child.exprs.length) memo.push(t__namespace.stringLiteral("<!--/-->"));
2009
2010
  }
@@ -2681,6 +2682,14 @@ function transformComponentChildren(children, config) {
2681
2682
  componentChild: true
2682
2683
  });
2683
2684
  dynamic = dynamic || child.dynamic;
2685
+ if (
2686
+ config.generate === "ssr" &&
2687
+ filteredChildren.length > 1 &&
2688
+ child.dynamic &&
2689
+ t__namespace.isFunction(child.exprs[0])
2690
+ ) {
2691
+ child.exprs[0] = child.exprs[0].body;
2692
+ }
2684
2693
  memo.push(getCreateTemplate(config, path, child)(path, child, filteredChildren.length > 1));
2685
2694
  }
2686
2695
  return memo;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "babel-plugin-jsx-dom-expressions",
3
3
  "description": "A JSX to DOM plugin that wraps expressions for fine grained change detection",
4
- "version": "0.34.10",
4
+ "version": "0.34.13",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -27,5 +27,5 @@
27
27
  "peerDependencies": {
28
28
  "@babel/core": "^7.0.0"
29
29
  },
30
- "gitHead": "0964d1754dea73a9e5d28d3780f9d14cee11bee3"
30
+ "gitHead": "4c0cade4a828b281fd2eb47dfe09b70d012e6858"
31
31
  }