babel-plugin-jsx-dom-expressions 0.34.2 → 0.34.5
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 +20 -5
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1416,9 +1416,18 @@ function registerTemplate(path, results) {
|
|
|
1416
1416
|
templateId ? [templateId] : []
|
|
1417
1417
|
)
|
|
1418
1418
|
: results.hasCustomElement
|
|
1419
|
-
? t__namespace.callExpression(
|
|
1420
|
-
|
|
1421
|
-
|
|
1419
|
+
? t__namespace.callExpression(
|
|
1420
|
+
registerImportMethod(path, "untrack", getRendererConfig(path, "dom").moduleName),
|
|
1421
|
+
[
|
|
1422
|
+
t__namespace.arrowFunctionExpression(
|
|
1423
|
+
[],
|
|
1424
|
+
t__namespace.callExpression(
|
|
1425
|
+
t__namespace.memberExpression(t__namespace.identifier("document"), t__namespace.identifier("importNode")),
|
|
1426
|
+
[templateId, t__namespace.booleanLiteral(true)]
|
|
1427
|
+
)
|
|
1428
|
+
)
|
|
1429
|
+
]
|
|
1430
|
+
)
|
|
1422
1431
|
: t__namespace.callExpression(t__namespace.memberExpression(templateId, t__namespace.identifier("cloneNode")), [
|
|
1423
1432
|
t__namespace.booleanLiteral(true)
|
|
1424
1433
|
])
|
|
@@ -1439,9 +1448,14 @@ function wrapDynamics$1(path, dynamics) {
|
|
|
1439
1448
|
dynamics[0].key === "classList" || dynamics[0].key === "style"
|
|
1440
1449
|
? t__namespace.identifier("_$p")
|
|
1441
1450
|
: undefined;
|
|
1442
|
-
if (
|
|
1451
|
+
if (
|
|
1452
|
+
dynamics[0].key.startsWith("class:") &&
|
|
1453
|
+
!t__namespace.isBooleanLiteral(dynamics[0].value) &&
|
|
1454
|
+
!t__namespace.isUnaryExpression(dynamics[0].value)
|
|
1455
|
+
) {
|
|
1443
1456
|
dynamics[0].value = t__namespace.unaryExpression("!", t__namespace.unaryExpression("!", dynamics[0].value));
|
|
1444
1457
|
}
|
|
1458
|
+
|
|
1445
1459
|
return t__namespace.expressionStatement(
|
|
1446
1460
|
t__namespace.callExpression(effectWrapperId, [
|
|
1447
1461
|
t__namespace.arrowFunctionExpression(
|
|
@@ -1464,7 +1478,8 @@ function wrapDynamics$1(path, dynamics) {
|
|
|
1464
1478
|
const identifier = path.scope.generateUidIdentifier("v$");
|
|
1465
1479
|
if (key.startsWith("class:") && !t__namespace.isBooleanLiteral(value) && !t__namespace.isUnaryExpression(value)) {
|
|
1466
1480
|
value = t__namespace.unaryExpression("!", t__namespace.unaryExpression("!", value));
|
|
1467
|
-
}
|
|
1481
|
+
}
|
|
1482
|
+
identifiers.push(identifier);
|
|
1468
1483
|
decls.push(t__namespace.variableDeclarator(identifier, value));
|
|
1469
1484
|
if (key === "classList" || key === "style") {
|
|
1470
1485
|
const prev = t__namespace.memberExpression(prevId, identifier);
|
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.
|
|
4
|
+
"version": "0.34.5",
|
|
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": "
|
|
30
|
+
"gitHead": "cf98663093139bb1d6847359732b2f7235d30b61"
|
|
31
31
|
}
|