what-compiler 0.6.1 → 0.6.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "what-compiler",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "JSX compiler for What Framework - transforms JSX to optimized DOM operations",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -436,6 +436,7 @@ export default function whatBabelPlugin({ types: t }) {
436
436
  for (const attr of el.attributes) {
437
437
  if (t.isJSXSpreadAttribute(attr)) continue;
438
438
  const name = getAttrName(attr);
439
+ if (name === 'key') continue;
439
440
  if (name.startsWith('on') || name.startsWith('bind:') || name.includes('|')) continue;
440
441
 
441
442
  let domName = name;
@@ -642,6 +643,9 @@ export default function whatBabelPlugin({ types: t }) {
642
643
 
643
644
  const attrName = getAttrName(attr);
644
645
 
646
+ // Strip key prop — WhatFW has no virtual DOM, so key is meaningless (issue #6)
647
+ if (attrName === 'key') continue;
648
+
645
649
  // Ref handling — assign element to ref object/callback
646
650
  if (attrName === 'ref') {
647
651
  const refExpr = getAttributeValue(attr.value);
@@ -1098,6 +1102,9 @@ export default function whatBabelPlugin({ types: t }) {
1098
1102
 
1099
1103
  const attrName = getAttrName(attr);
1100
1104
 
1105
+ // Strip key prop — WhatFW has no virtual DOM, so key is meaningless (issue #6)
1106
+ if (attrName === 'key') continue;
1107
+
1101
1108
  // Handle bind: attributes for components
1102
1109
  if (isBindingAttribute(attrName)) {
1103
1110
  const bindProp = getBindingProperty(attrName);