babel-plugin-jsx-dom-expressions 0.34.9 → 0.34.11

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 +11 -6
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -1973,10 +1973,10 @@ function transformChildren$1(path, results, { hydratable }) {
1973
1973
  appendToTemplate(results.template, child.template);
1974
1974
  results.templateValues.push.apply(results.templateValues, child.templateValues || []);
1975
1975
  if (child.exprs.length) {
1976
- if (!doNotEscape) child.exprs[0] = escapeExpression(path, child.exprs[0]);
1976
+ if (!doNotEscape && !child.spreadElement) child.exprs[0] = escapeExpression(path, child.exprs[0]);
1977
1977
 
1978
1978
  // boxed by textNodes
1979
- if (markers) {
1979
+ if (markers && !child.spreadElement) {
1980
1980
  appendToTemplate(results.template, `<!--#-->`);
1981
1981
  results.template.push("");
1982
1982
  results.templateValues.push(child.exprs[0]);
@@ -1993,9 +1993,6 @@ function createElement(path, { topLevel, hydratable }) {
1993
1993
  const tagName = getTagName(path.node),
1994
1994
  config = getConfig(path),
1995
1995
  attributes = normalizeAttributes(path);
1996
- isDynamic(path, {
1997
- checkMember: true
1998
- });
1999
1996
 
2000
1997
  const filteredChildren = filterChildren(path.get("children")),
2001
1998
  multi = checkLength(filteredChildren),
@@ -2081,7 +2078,7 @@ function createElement(path, { topLevel, hydratable }) {
2081
2078
  t__namespace.booleanLiteral(Boolean(topLevel && config.hydratable))
2082
2079
  ])
2083
2080
  ];
2084
- return { exprs, template: "" };
2081
+ return { exprs, template: "", spreadElement: true };
2085
2082
  }
2086
2083
 
2087
2084
  function transformElement$1(path, info) {
@@ -2684,6 +2681,14 @@ function transformComponentChildren(children, config) {
2684
2681
  componentChild: true
2685
2682
  });
2686
2683
  dynamic = dynamic || child.dynamic;
2684
+ if (
2685
+ config.generate === "ssr" &&
2686
+ filteredChildren.length > 1 &&
2687
+ child.dynamic &&
2688
+ t__namespace.isFunction(child.exprs[0])
2689
+ ) {
2690
+ child.exprs[0] = child.exprs[0].body;
2691
+ }
2687
2692
  memo.push(getCreateTemplate(config, path, child)(path, child, filteredChildren.length > 1));
2688
2693
  }
2689
2694
  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.9",
4
+ "version": "0.34.11",
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": "8221452594c2eb2d3d593b07759c05047dba17fa"
30
+ "gitHead": "ed99d8856de6b9f993d3ec94afa24f288b09a37b"
31
31
  }