Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

adobe/babel-plugin-transform-twist

babel-plugin-transform-twist

Build Status

This babel plugin provides support for the syntax features of twist that are common to any UI framework that you might use twist with. Specifically, it implements:

  • Configuring decorators for auto-import.
  • Allowing
  • Configuring JSX tags for auto-import.

Quick Reference

Plugin Options:

{
    autoImport: {
        'Store': {
            module: '@twist/core',
            export: 'StoreDecorator',
            inherits: {
                module: '@twist/core',
                export: 'Store'
            }
        }
        'ui:button': {
            module: 'my-ui-library',
            export: 'Button'
        }
    }
}

With the above options, the following code:

@Store
class MyStore {
    getView() {
        return <ui:button>My Button</ui:button>;
    }
}

becomes:

import { StoreDecorator, Store } from '@twist/core';
import { Button } from 'my-ui-library';

@StoreDecorator
class MyStore extends Store {
    getView() {
        return <Button>My Button</Button>;
    }
}

About

Babel plugin for the Twist library

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published