babel-plugin-jsx-dom-expressions 0.37.18 → 0.37.20

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 +6 -4
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -159,6 +159,7 @@ const SVGElements = /*#__PURE__*/ new Set([
159
159
  "feDiffuseLighting",
160
160
  "feDisplacementMap",
161
161
  "feDistantLight",
162
+ "feDropShadow",
162
163
  "feFlood",
163
164
  "feFuncA",
164
165
  "feFuncB",
@@ -363,7 +364,7 @@ function isDynamic(path, { checkMember, checkTags, checkCallExpressions = true,
363
364
  return true;
364
365
  }
365
366
 
366
- if (checkTags && (t__namespace.isJSXElement(expr) || t__namespace.isJSXFragment(expr))) {
367
+ if (checkTags && (t__namespace.isJSXElement(expr) || (t__namespace.isJSXFragment(expr) && expr.children.length))) {
367
368
  return true;
368
369
  }
369
370
 
@@ -397,7 +398,7 @@ function isDynamic(path, { checkMember, checkTags, checkCallExpressions = true,
397
398
  checkTags ? (dynamic = true) && p.stop() : p.skip();
398
399
  },
399
400
  JSXFragment(p) {
400
- checkTags ? (dynamic = true) && p.stop() : p.skip();
401
+ checkTags && p.node.children.length ? (dynamic = true) && p.stop() : p.skip();
401
402
  }
402
403
  });
403
404
  return dynamic;
@@ -1216,7 +1217,7 @@ function transformAttributes$2(path, results) {
1216
1217
  )
1217
1218
  )
1218
1219
  );
1219
- } else if (t__namespace.isCallExpression(value.expression)) {
1220
+ } else {
1220
1221
  const refIdentifier = path.scope.generateUidIdentifier("_ref$");
1221
1222
  results.exprs.unshift(
1222
1223
  t__namespace.variableDeclaration("var", [
@@ -2796,7 +2797,7 @@ function transformAttributes(path, results) {
2796
2797
  )
2797
2798
  )
2798
2799
  );
2799
- } else if (t__namespace.isCallExpression(value.expression)) {
2800
+ } else {
2800
2801
  const refIdentifier = path.scope.generateUidIdentifier("_ref$");
2801
2802
  results.exprs.unshift(
2802
2803
  t__namespace.variableDeclaration("var", [
@@ -3546,6 +3547,7 @@ function transformNode(path, info = {}) {
3546
3547
  : !info.componentChild &&
3547
3548
  (config.generate !== "ssr" || info.fragmentChild) &&
3548
3549
  t__namespace.isCallExpression(node.expression) &&
3550
+ !t__namespace.isCallExpression(node.expression.callee) &&
3549
3551
  !t__namespace.isMemberExpression(node.expression.callee) &&
3550
3552
  node.expression.arguments.length === 0
3551
3553
  ? node.expression.callee
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.37.18",
4
+ "version": "0.37.20",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -31,5 +31,5 @@
31
31
  "devDependencies": {
32
32
  "@babel/core": "^7.20.12"
33
33
  },
34
- "gitHead": "0a64479959852532d861f70fe6da13ee3d084530"
34
+ "gitHead": "b23587fced8d2dea9a97bccaa6e8985ce963f137"
35
35
  }