babel-plugin-jsx-dom-expressions 0.34.5 → 0.34.7

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 +9 -2
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -1990,6 +1990,9 @@ function createElement(path, { topLevel, hydratable }) {
1990
1990
  const tagName = getTagName(path.node),
1991
1991
  config = getConfig(path),
1992
1992
  attributes = normalizeAttributes(path);
1993
+ isDynamic(path, {
1994
+ checkMember: true
1995
+ });
1993
1996
 
1994
1997
  const filteredChildren = filterChildren(path.get("children")),
1995
1998
  multi = checkLength(filteredChildren),
@@ -2001,7 +2004,6 @@ function createElement(path, { topLevel, hydratable }) {
2001
2004
  } else {
2002
2005
  const child = transformNode(path);
2003
2006
  if (markers && child.exprs.length) memo.push(t__namespace.stringLiteral("<!--#-->"));
2004
- if (hydratable && child.exprs.length) child.exprs[0] = t__namespace.arrowFunctionExpression([], child.exprs[0]);
2005
2007
  memo.push(getCreateTemplate(config, path, child)(path, child, true));
2006
2008
  if (markers && child.exprs.length) memo.push(t__namespace.stringLiteral("<!--/-->"));
2007
2009
  }
@@ -2064,7 +2066,12 @@ function createElement(path, { topLevel, hydratable }) {
2064
2066
  t__namespace.stringLiteral(tagName),
2065
2067
  transformed,
2066
2068
  childNodes.length
2067
- ? childNodes.length === 1
2069
+ ? hydratable
2070
+ ? t__namespace.arrowFunctionExpression(
2071
+ [],
2072
+ childNodes.length === 1 ? childNodes[0] : t__namespace.arrayExpression(childNodes)
2073
+ )
2074
+ : childNodes.length === 1
2068
2075
  ? childNodes[0]
2069
2076
  : t__namespace.arrayExpression(childNodes)
2070
2077
  : t__namespace.identifier("undefined"),
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.5",
4
+ "version": "0.34.7",
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": "cf98663093139bb1d6847359732b2f7235d30b61"
30
+ "gitHead": "df8d6142fe3d73ef2895f4bf54731eb514fb72ab"
31
31
  }