0.15.1 • Published 7 months ago

babel-plugin-solid-labels v0.15.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

banner

NPM JavaScript Style Guide

Install

npm install babel-plugin-solid-labels
yarn add babel-plugin-solid-labels
pnpm add babel-plugin-solid-labels

Features

  • 🏷 Labels: Turn labels into SolidJS utility calls!
  • 💬 Comments: Turn comments into SolidJS utility calls, too!
  • ⏱ Compile-time Functions: Use functions that are evaluated during compile-time!
  • 📦 Auto Imports: No need to import SolidJS utilities, explicitly!
  • 🤝 JS and TS Friendly!

Usage

Typescript

<any file>.d.ts

/// <reference types="babel-plugin-solid-labels" />

Babel

.babelrc

{
  "plugins": [
    ["babel-plugin-solid-labels", { "dev": false }]
  ]
}

Vite

vite-plugin-solid

// vite.config.js
import { defineConfig } from 'vite';
import solidPlugin from 'vite-plugin-solid';
import solidLabels from 'babel-plugin-solid-labels';

export default defineConfig({
  plugins: [
    solidPlugin({
      babel: {
        plugins: [
          [solidLabels, { dev: process.env.NODE_ENV !== 'production' }]
        ],
      },
    }),
  ],
});

solid-start

// vite.config.js
import { defineConfig } from 'vite';
import solidStart from 'solid-start';
import solidLabels from 'babel-plugin-solid-labels';

export default defineConfig({
  plugins: [
    solidStart({
      babel: {
        plugins: [
          [solidLabels, { dev: process.env.NODE_ENV !== 'production' }]
        ],
      },
    }),
  ],
});

Disabling features

You can disable some features by passing disabled option to the plugin options.

{
  disabled: {
    labels: {
      signal: true,
    },
    pragma: {
      '@signal': true,
    },
    ctf: {
      $signal: true,
    },
  }
}

Limitations

  • Detecting shadowed identifier for signal and memo.

Sponsors

Sponsors

License

MIT © lxsmnsyc

0.15.0

7 months ago

0.15.1

7 months ago

0.14.7

1 year ago

0.14.5

1 year ago

0.14.0

1 year ago

0.14.1

1 year ago

0.14.2

1 year ago

0.14.3

1 year ago

0.14.4

1 year ago

0.13.0

1 year ago

0.12.1

2 years ago

0.12.0

2 years ago

0.11.2

2 years ago

0.11.3

2 years ago

0.9.6

2 years ago

0.9.5

2 years ago

0.11.0

2 years ago

0.10.1

2 years ago

0.11.1

2 years ago

0.10.0

2 years ago

0.9.4

3 years ago

0.9.0

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.8.0

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago