@cerebral/babel-plugin
v2.0.0
Published
This plugin transforms the typed proxies into template literal tags.
Keywords
Readme
@cerebral/babel-plugin
Cerebral Proxies
Proxies provide a more natural syntax for accessing paths in your state and sequences. They require the @cerebral/babel-plugin which transforms them into template literal tags behind the scenes.
The proxy syntax is recommended for most applications as it's more readable and integrates better with TypeScript. Tags are still supported for compatibility and for projects that don't use Babel.
Setup for Proxies
Install the babel plugin:
npm install --save-dev @cerebral/babel-pluginAdd it to your Babel configuration:
{ "plugins": ["@cerebral"] }
When to Use Which Approach
- Use Tags: When you want to quickly get started without additional configuration or if you're not using Babel
- Use Proxies: When you prefer the cleaner syntax or need full TypeScript support
