Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 2d94b29

Browse files
committed
perf + fix for attributes and custom VNode
1 parent 148bf5b commit 2d94b29

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

packages/plugin-layout/src/ZoneNode.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ export class ZoneNode extends ContainerNode {
4343
_removeAtIndex(index: number): void {
4444
const child = this.childVNodes[index];
4545
super._removeAtIndex(index);
46-
delete this.hidden[child.id];
46+
if (this.hidden) {
47+
delete this.hidden[child.id];
48+
}
4749
}
4850
}

packages/plugin-theme/src/ThemeXmlDomParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class ThemeXmlDomParser extends AbstractParser<Node> {
2020
async parse(item: Element): Promise<VNode[]> {
2121
const theme = new ThemeNode({ theme: item.getAttribute('name') });
2222
const attributes = this.engine.parseAttributes(item);
23-
attributes.classList.remove('name');
23+
attributes.remove('name');
2424
if (attributes.length) {
2525
theme.modifiers.append(attributes);
2626
}

packages/plugin-xml/src/Attributes.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,12 @@ export class Attributes extends Modifier {
5454
if (this._record) {
5555
clone._record = makeVersionable({ ...this._record });
5656
}
57-
clone.style = this.style.clone();
58-
clone.classList = this.classList.clone();
57+
if (this.style.length) {
58+
clone.style = this.style.clone();
59+
}
60+
if (this.classList.length) {
61+
clone.classList = this.classList.clone();
62+
}
5963
return clone;
6064
}
6165
/**

0 commit comments

Comments
 (0)