Skip to content

Commit

Permalink
feat(web-components): support booleans in html attributes build time
Browse files Browse the repository at this point in the history
  • Loading branch information
aralroca committed Nov 11, 2023
1 parent 386b0fc commit 83d9342
Show file tree
Hide file tree
Showing 6 changed files with 224 additions and 58 deletions.
22 changes: 22 additions & 0 deletions src/utils/transform-jsx-to-reactive/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,28 @@ export const BRISA_IMPORT = {
name: "brisaElement",
},
},
{
type: "ImportSpecifier",
imported: {
type: "Identifier",
name: "_on",
},
local: {
type: "Identifier",
name: "_on",
},
},
{
type: "ImportSpecifier",
imported: {
type: "Identifier",
name: "_off",
},
local: {
type: "Identifier",
name: "_off",
},
},
],
source: {
type: "Literal",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("utils", () => {
propNames,
);
expect(output(importDeclaration)).toBe(
'import {brisaElement} from "brisa/client";',
'import {brisaElement, _on, _off} from "brisa/client";',
);
expect(output(wrappedComponent)).toBe(
toInline(`
Expand All @@ -56,7 +56,7 @@ describe("utils", () => {
propNames,
);
expect(output(importDeclaration)).toBe(
'import {brisaElement} from "brisa/client";',
'import {brisaElement, _on, _off} from "brisa/client";',
);
expect(output(wrappedComponent)).toBe(
toInline(`
Expand Down
Loading

0 comments on commit 83d9342

Please sign in to comment.