# babel-plugin-estrela

> A babel plugin to pre-process estrela jsx/tsx files

Latest version **0.12.1** (published 2024-06-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-estrela
pnpm add babel-plugin-estrela
yarn add babel-plugin-estrela
bun add babel-plugin-estrela
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.12.1 |
| Published | 2024-06-18 |
| First published | 2022-05-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 168.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Eduardo Rosostolato |
| Maintainers | rosostolato |
| Keywords | babel, babel-plugin, babel-plugin-estrela, estrela, jsx, tsx |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-estrela
- npm.io page: https://npm.io/package/babel-plugin-estrela

## Dependencies (5)

- [postcss](https://npm.io/package/postcss.md) ^8.4.16
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.19.1
- [autoprefixer](https://npm.io/package/autoprefixer.md) ^10.4.12
- [postcss-nested](https://npm.io/package/postcss-nested.md) ^5.0.6
- [postcss-selector-parser](https://npm.io/package/postcss-selector-parser.md) ^6.0.10

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.12.1 (latest) — 2024-06-18
- 0.12.0 — 2024-06-18
- 0.11.3 — 2023-08-16
- 0.11.2 — 2023-08-09
- 0.11.1 — 2023-08-09
- 0.11.0 — 2023-07-04
- 0.10.2 — 2022-07-13
- 0.10.1 — 2022-06-15
- 0.10.0 — 2022-06-15
- 0.3.1 — 2022-05-23
- 0.3.0 — 2022-05-23
- 0.2.1 — 2022-05-13
- 0.2.0 — 2022-05-13
- 0.1.1 — 2022-05-11
- 0.1.0 — 2022-05-11

## README

# babel-plugin-estrela

A babel plugin to pre-process jsx/tsx files for the estrela framework.

### Estrela code example

```tsx
import { onDestroy, signal } from 'estrela';

const App = () => {
  // create a signal with initial value equal to 0.
  const count = signal(0);

  // create an updater interval function.
  const interval = setInterval(() => count.update(x => x + 1), 1000);

  // clean interval on destroy this component.
  onDestroy(() => clearInterval(interval));

  // return JSX element.
  return <div>Count is {count() * 2}</div>;
};
```

It will transpile the code above to:

```js
import { template as _template, h as _h } from "estrela/template";
import { onDestroy, signal } from "estrela";

const _tmpl = _template("<div>Count is </div>");

const App = _props => {
  const count = signal(0);
  const interval = setInterval(() => count.update(x => x + 1), 1e3);
  onDestroy(() => clearInterval(interval));
  return _h(_tmpl, {
    "0": {
      "children": [[() => count() * 2, null]]
    }
  });
};
```

## Install

Using npm:

```bash
$ npm install --save-dev babel-plugin-estrela
```

or using yarn:

```bash
$ yarn add --dev babel-plugin-estrela
```

## Estrela

For more Estrela information, visit the github page at https://github.com/estrelajs/estrela/.

---
_Source: https://npm.io/package/babel-plugin-estrela · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
