babel-plugin-jsx-dom-expressions 0.32.10 → 0.32.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.
- package/index.js +8 -6
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -286,6 +286,9 @@ function isDynamic(path, { checkMember, checkTags, checkCallExpressions = true,
|
|
|
286
286
|
let dynamic;
|
|
287
287
|
path.traverse({
|
|
288
288
|
Function(p) {
|
|
289
|
+
if (t__namespace.isObjectMethod(p.node) && p.node.computed) {
|
|
290
|
+
dynamic = isDynamic(p.get("key"), { checkMember, checkTags, checkCallExpressions, native });
|
|
291
|
+
}
|
|
289
292
|
p.skip();
|
|
290
293
|
},
|
|
291
294
|
CallExpression(p) {
|
|
@@ -2215,11 +2218,7 @@ function convertComponentIdentifier(node) {
|
|
|
2215
2218
|
} else if (t__namespace.isJSXMemberExpression(node)) {
|
|
2216
2219
|
const prop = convertComponentIdentifier(node.property);
|
|
2217
2220
|
const computed = t__namespace.isStringLiteral(prop);
|
|
2218
|
-
return t__namespace.memberExpression(
|
|
2219
|
-
convertComponentIdentifier(node.object),
|
|
2220
|
-
prop,
|
|
2221
|
-
computed
|
|
2222
|
-
);
|
|
2221
|
+
return t__namespace.memberExpression(convertComponentIdentifier(node.object), prop, computed);
|
|
2223
2222
|
}
|
|
2224
2223
|
|
|
2225
2224
|
return node;
|
|
@@ -2272,7 +2271,10 @@ function transformComponent(path) {
|
|
|
2272
2271
|
isDynamic(attribute.get("argument"), {
|
|
2273
2272
|
checkMember: true
|
|
2274
2273
|
}) && (dynamicSpread = true)
|
|
2275
|
-
? t__namespace.isCallExpression(node.argument) &&
|
|
2274
|
+
? t__namespace.isCallExpression(node.argument) &&
|
|
2275
|
+
!node.argument.arguments.length &&
|
|
2276
|
+
!t__namespace.isCallExpression(node.argument.callee) &&
|
|
2277
|
+
!t__namespace.isMemberExpression(node.argument.callee)
|
|
2276
2278
|
? node.argument.callee
|
|
2277
2279
|
: t__namespace.arrowFunctionExpression([], node.argument)
|
|
2278
2280
|
: node.argument
|
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.32.
|
|
4
|
+
"version": "0.32.11",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"@babel/types": "^7.16.0",
|
|
24
24
|
"html-entities": "2.3.2"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "d4b76380fe65699d7d57b99df26247ddf56561f5"
|
|
27
27
|
}
|