release: WRNexusJS 0.2.38

This commit is contained in:
2026-07-15 10:26:24 +05:30
parent 17a535d4dc
commit 98445c2ec7
56 changed files with 311 additions and 104 deletions
+47 -1
View File
@@ -243,7 +243,9 @@ component ParentCard {
expect(output).toContain('data-component="ChildCard"');
expect(output).toContain('title="${__wireAttr(title)}"');
expect(output).toContain('title="${__wireProp(title)}"');
expect(output).toContain("function __wireProp");
});
test("parses a layout block", () => {
@@ -737,3 +739,47 @@ component Banner {
expect(output).toContain("Visible");
expect(output).toContain("Hidden");
});
test("component array props support each blocks", () => {
const output = generate(
parse(`
component HighlightList {
props {
highlights = []
}
view {
{#each highlights as highlight}
<p>{highlight.title}</p>
{/each}
}
}
`),
);
expect(output).toContain("Array.isArray(def)");
expect(output).toContain("JSON.parse(v)");
expect(output).toContain("highlights");
});
test("page component props evaluate whole expressions", () => {
const output = generate(
parse(`
page Home {
view {
<HighlightList
enabled="{true}"
highlights="{[
{ title: 'First' },
{ title: 'Second' }
]}"
/>
}
}
`),
);
expect(output).toContain("__wrnexusPropAttr(true)");
expect(output).toContain("__wrnexusPropAttr([");
});