babel-plugin-jsx-dom-expressions 0.32.7 → 0.32.10

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 +13 -12
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -774,7 +774,7 @@ function transformAttributes$2(path, results) {
774
774
  values.push(t__namespace.logicalExpression("||", attr.value.expression, t__namespace.stringLiteral("")));
775
775
  quasis.push(t__namespace.TemplateElement({ raw: isLast ? "" : " " }));
776
776
  }
777
- i && attributes.splice(classAttributes[i].key, 1);
777
+ i && attributes.splice(attributes.indexOf(classAttributes[i]), 1);
778
778
  }
779
779
  if (values.length) first.value = t__namespace.JSXExpressionContainer(t__namespace.TemplateLiteral(quasis, values));
780
780
  else first.value = t__namespace.stringLiteral(quasis[0].value.raw);
@@ -1295,12 +1295,16 @@ function appendTemplates$1(path, templates) {
1295
1295
  };
1296
1296
  return t__namespace.variableDeclarator(
1297
1297
  template.id,
1298
- t__namespace.callExpression(
1299
- registerImportMethod(path, "template"),
1300
- [
1301
- t__namespace.templateLiteral([t__namespace.templateElement(tmpl, true)], []),
1302
- t__namespace.numericLiteral(template.elementCount)
1303
- ].concat(template.isSVG ? t__namespace.booleanLiteral(template.isSVG) : [])
1298
+ t__namespace.addComment(
1299
+ t__namespace.callExpression(
1300
+ registerImportMethod(path, "template"),
1301
+ [
1302
+ t__namespace.templateLiteral([t__namespace.templateElement(tmpl, true)], []),
1303
+ t__namespace.numericLiteral(template.elementCount)
1304
+ ].concat(template.isSVG ? t__namespace.booleanLiteral(template.isSVG) : [])
1305
+ ),
1306
+ 'leading',
1307
+ '#__PURE__'
1304
1308
  )
1305
1309
  );
1306
1310
  });
@@ -1638,7 +1642,7 @@ function transformAttributes$1(path, results) {
1638
1642
  if (attr.name.name === "classList") {
1639
1643
  if (t__namespace.isObjectExpression(expr) && !expr.properties.some(p => t__namespace.isSpreadElement(p))) {
1640
1644
  transformClasslistObject(path, expr, values, quasis);
1641
- i && attributes.splice(attributes.indexOf(classAttributes[i].node), 1);
1645
+ i && attributes.splice(attributes.indexOf(classAttributes[i]), 1);
1642
1646
  continue;
1643
1647
  }
1644
1648
  expr = t__namespace.callExpression(registerImportMethod(path, "ssrClassList"), [expr]);
@@ -1646,7 +1650,7 @@ function transformAttributes$1(path, results) {
1646
1650
  values.push(t__namespace.logicalExpression("||", expr, t__namespace.stringLiteral("")));
1647
1651
  quasis.push(t__namespace.TemplateElement({ raw: isLast ? "" : " " }));
1648
1652
  }
1649
- i && attributes.splice(attributes.indexOf(classAttributes[i].node), 1);
1653
+ i && attributes.splice(attributes.indexOf(classAttributes[i]), 1);
1650
1654
  }
1651
1655
  first.value = t__namespace.JSXExpressionContainer(t__namespace.TemplateLiteral(quasis, values));
1652
1656
  }
@@ -2506,9 +2510,6 @@ function transformThis(path) {
2506
2510
  ThisExpression(path) {
2507
2511
  thisId || (thisId = path.scope.generateUidIdentifier("self$"));
2508
2512
  path.replaceWith(thisId);
2509
- },
2510
- Function(p) {
2511
- p.skip();
2512
2513
  }
2513
2514
  });
2514
2515
  return node => {
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.7",
4
+ "version": "0.32.10",
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": "3acfcd6802238e587e01ebcc1d1a89459a1a07a9"
26
+ "gitHead": "1da59f42123c3be08a4766389d10b27922ece4af"
27
27
  }