@builder.io/mitosis@0.9.0
·
42 commits
to main
since this release
Minor Changes
-
8ad66fd: [angular]: Angular v17.2+ uses signals as a new feature.
This allows the generator to match better with other targets (onUpdatebecomeseffect).This PR will rewrite the complete Angular generator to match all new features for Angular.
You can access the new Angular generator by using the
api="signals"inside your mitosis config e.g.:/** * @type {import('@builder.io/mitosis'.MitosisConfig)} */ module.exports = { files: 'src/**', targets: ['angular', 'react', 'vue'], options: { angular: { api: 'signals', }, react: {}, vue: {}, }, };
Furthermore, this PR will fix some issues with the angular output by using Babel instead of search and replace. Additionally, we use
@ifetc. to provide a better output.Some features are not yet implemented for signals api:
-
Spread props -
<div {...rest}>{children}</div> -
Dynamic components:
export default function MyComponent(props) { const [obj, setObj] = useState(FooComponent); return <obj>{props.children}</obj>; }
There are some new metadata properties for Angular if you use the signals api:
useMetadata({ angular: { signals: { writeable: ['disabled'], required: ['label'], }, }, });
writeablewill usemodel()to enable two-way binding for the property.requiredwill convert theinputto arequiredinput.
-
Patch Changes
- a65e72b: JSX generator properly escapes single character > and <