Skip to content

Commit

Permalink
fix: attribute-passing for angular and stencil enabled in options (#1668
Browse files Browse the repository at this point in the history
)

* fix: attribute-passing for angular and stencil enabled in options

* fix: attribute-passing

* chore: update snapshots

* fix: issue with shouldAddAttributePassing

* chore: update snapshots
  • Loading branch information
nmerget authored Jan 29, 2025
1 parent 2a6aa82 commit d24889d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/weak-frogs-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/mitosis': patch
---

[angular,stencil] Fix attribute-passing in options
18 changes: 2 additions & 16 deletions packages/core/src/helpers/web-components/attribute-passing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,8 @@ export const getAttributePassingString = (typescript?: boolean) => {
);
};

export const shouldAddAttributePassing = (
json: MitosisComponent,
options: BaseTranspilerOptions,
) => {
const metaAttributePassingAsString = String(json.meta.useMetadata?.attributePassing?.enabled);

if (options.attributePassing?.enabled && metaAttributePassingAsString !== 'false') {
return false;
}

if (metaAttributePassingAsString === 'true') {
return true;
}

return options.attributePassing?.enabled;
};
export const shouldAddAttributePassing = (json: MitosisComponent, options: BaseTranspilerOptions) =>
options.attributePassing?.enabled || json.meta.useMetadata?.attributePassing?.enabled;

export const getAddAttributePassingRef = (
json: MitosisComponent,
Expand Down

0 comments on commit d24889d

Please sign in to comment.