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/dist/babel-plugin.js +3 -0
- package/dist/babel-plugin.js.map +2 -2
- package/dist/babel-plugin.min.js +1 -1
- package/dist/babel-plugin.min.js.map +2 -2
- package/dist/index.js +3 -0
- package/dist/index.js.map +2 -2
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +2 -2
- package/dist/vite-plugin.js +3 -0
- package/dist/vite-plugin.js.map +2 -2
- package/dist/vite-plugin.min.js +3 -3
- package/dist/vite-plugin.min.js.map +2 -2
- package/package.json +1 -1
- package/src/babel-plugin.js +7 -0
package/package.json
CHANGED
package/src/babel-plugin.js
CHANGED
|
@@ -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);
|