Skip to content

@builder.io/mitosis@0.9.0

Choose a tag to compare

@builderio-bot builderio-bot released this 03 Apr 18:32
· 42 commits to main since this release
7262d03

Minor Changes

  • 8ad66fd: [angular]: Angular v17.2+ uses signals as a new feature.
    This allows the generator to match better with other targets (onUpdate becomes effect).

    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 @if etc. 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'],
        },
      },
    });
    • writeable will use model() to enable two-way binding for the property.
    • required will convert the input to a required input.

Patch Changes

  • a65e72b: JSX generator properly escapes single character > and <