Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-estrela

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-estrela - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

4

package.json
{
"name": "babel-plugin-estrela",
"version": "0.1.0",
"version": "0.1.1",
"description": "A babel plugin to process estrela jsx/tsx files",

@@ -22,4 +22,6 @@ "main": "dist/index.js",

"@types/babel__core": "^7.1.19",
"esbuild": "^0.14.38",
"rimraf": "^3.0.2",
"ts-node": "^10.7.0"
}
}

@@ -5,2 +5,37 @@ # babel-plugin-estrela

### Estrela code example
```tsx
import { onDestroy } from 'estrela';
const App = () => {
// create a number state with initial value equal to 0.
let count = 0;
// create an updater interval function.
const interval = setInterval(() => count++, 1000);
// clean interval on destroy this component.
onDestroy(() => clearInterval(interval));
// return JSX element.
return <div>Count is { count * 2 }</div>
}
```
It will convert the code above to:
```js
import { h as _jsx, createProxyState as _$$ } from 'estrela/internal';
import { state, onDestroy } from 'estrela';
const App = () => {
const _$ = /*#__PURE__*/_$$();
_$.count = 0;
setInterval(() => _$.count++, 1000);
onDestroy(() => clearInterval(interval));
return /*#__PURE__*/h('div', null, 'Count is ', [_$.$.count, _count => _count * 2]);
}
```
## Install

@@ -17,3 +52,3 @@

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

@@ -23,2 +58,2 @@

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

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc