SWC plugin for transform Vue3-jsx syntax

Overview

swc-plugin-transform-vue3-jsx

npm size

πŸ’‘ SWC plugin for faster conversion vue3-jsx.

Installation

npm

npm install swc-plugin-transform-vue3-jsx -D

yarn

yarn add swc-plugin-transform-vue3-jsx -D

Usage

.swcrc

{
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "tsx": true
    }
  },
  "experimental": {
    "plugins": [["swc-plugin-transform-vue3-jsx", {}]]
  }
}

VS @vue/babel-plugin-jsx

  1. βœ… New option reactStyle: Convert react-jsx syntax into vue3-jsx equivalent conversion product, which is convenient for developers to quickly convert react-projects into vue-projects.
  2. βœ… New Option transformOnUpdateEvent: To convert any property that looks like onUpdateXxx to an onUpdate:xxx property (which is not a legal prop-name due to JSX's own rules), often used for naive-UI.
  3. βœ… New Option transformVSlot: To convert any property that looks like v-slot:xxx to an v-slots={{"xxx": ...}} property.
  4. βœ… New Option transformSlot: To convert tag that named slot to a vnodeChild expression.
  5. βœ… New Option hmr: Generate the HMR code.
  6. βœ… New Option vModel and 'vOn'.
  7. πŸ€₯ Option isCustomElement renamed to customElement, and only string arrays are supported(SWC only supports json options).
  8. βš’οΈ More radical optimization algorithm.
  9. βš’οΈ Fixed some bugs for @vue/babel-plugin-jsx.

Usage

options

include

Type: string[]

Default: [/.*/.toString()]

A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should operate on.

exclude

Type: string[]

Default: undefined

A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should ignore.

transformOn

Type: boolean

Default: false

transform on: { click: xx } to onClick: xxx

optimize

Type: boolean

Default: false

enable optimization or not. It's not recommended to enable it If you are not familiar with Vue 3.

customElement

Type: string[]

Default: undefined

configuring custom elements.

.e.g

;['my-custom-element', /^my-[a-z0-9-]+$/.toString()]

mergeProps

Type: boolean

Default: true

merge static and dynamic class / style attributes / onXXX handlers

enableObjectSlots

Type: boolean

Default: true

Whether to enable object slots (mentioned below the document) syntax". It might be useful in JSX, but it will add a lot of toObjectSlots call expressions which increase your bundle size. And v-slots is still available even if enableObjectSlots is turned off.

pragma

Type: string

Default: createVNode

Replace the function used when compiling JSX expressions.

reactStyle (New)

Type: boolean

Default: false

Convert react-jsx syntax into vue3-jsx equivalent conversion product, which is convenient for developers to quickly convert react-projects into vue-projects.

.e.g <div className="class-1" dangerouslySetInnerHTML={html} /> => <div class="class-1" v-html={html} />

.e.g <label htmlFor="xxx">...</label> => <label for="xxx">...</label>

transformOnUpdateEvent (New)

Type: boolean

Default: false

To convert any property that looks like onUpdateXxx to an onUpdate:xxx property (which is not a legal prop-name due to JSX's own rules), often used for naive-UI.

.e.g <NInput onUpdateValue={onUpdate} /> => <NInput onUpdate:value={onUpdate} />

transformVSlot (New)

Type: boolean

Default: false

To convert any property that looks like v-slot:xxx to an v-slots={{"xxx": ...}} property.

.e.g <Comp v-slot:my-slot={ () => [<input/>] } /> => <NInput v-slots={{ "my-slot": () => [<input/>] }} />

transformSlot (New)

Type: boolean

Default: false

To convert tag that named slot to a vnodeChild expression.

.e.g <slot name="item" data={data}></slot> => renderSlot('item', { data })

vModel (New)

Type: boolean

Default: true

vOn (New)

Type: boolean

Default: true

hmr (New)

Type: boolean

Default: false

Generate the HMR code.

Syntax

directive syntax

in vue template

<comp v-directive:argument.modifier="expression" />

is same as jsx

<comp v-directive:argument_modifier={expression} />

or

<comp vDirective:argument_modifier={expression} />

Content

functional component

const App = () => <div>Vue 3.0</div>

with render

const App = {
  render() {
    return <div>Vue 3.0</div>
  }
}
import { withModifiers, defineComponent } from 'vue'

const App = defineComponent({
  setup() {
    const count = ref(0)

    const inc = () => {
      count.value++
    }

    return () => <div onClick={withModifiers(inc, ['self'])}>{count.value}</div>
  }
})

Fragment

const App = () => (
  <>
    <span>I'm</span>
    <span>Fragment</span>
  </>
)

Attributes / Props

const App = () => <input type="email" />

with a dynamic binding:

const placeholderText = 'email'
const App = () => <input type="email" placeholder={placeholderText} />

Directives

v-show

const App = {
  data() {
    return { visible: true }
  },
  render() {
    return <input v-show={this.visible} />
  }
}

v-model

Note: You should pass the second param as string for using arg.

<input v-model={val} />

Will compile to:

createVNode('input', {
  modelValue: val,
  'onUpdate:modelValue': $event => (val = $event)
})
<input v-model:argument_modifier={val} />

Will compile to:

createVNode('input', {
  argument: val,
  argumentModifiers: {
    modifier: true
  },
  'onUpdate:argument': $event => (val = $event)
})
<input v-model={[val, ['modifier']]} />
createVNode('input', {
  modelValue: val,
  modelValueModifiers: {
    modifier: true
  },
  'onUpdate:modelValue': $event => (val = $event)
})
<A v-model={[val, 'argument', ['modifier']]} />

Will compile to:

createVNode(A, {
  argument: val,
  argumentModifiers: {
    modifier: true
  },
  'onUpdate:argument': $event => (val = $event)
})

v-models

Note: You should pass a Two-dimensional Arrays to v-models.

<A v-models={[[foo], [bar, 'bar']]} />
<A
  v-models={[
    [foo, 'foo'],
    [bar, 'bar']
  ]}
/>
<A
  v-models={[
    [foo, ['modifier']],
    [bar, 'bar', ['modifier']]
  ]}
/>

Will compile to:

createVNode(A, {
  modelValue: foo,
  modelValueModifiers: {
    modifier: true
  },
  'onUpdate:modelValue': $event => (foo = $event),
  bar: bar,
  barModifiers: {
    modifier: true
  },
  'onUpdate:bar': $event => (bar = $event)
})

custom directive

Recommended when using string arguments

const App = {
  directives: { custom: customDirective },
  setup() {
    return () => <a v-custom:arg={val} />
  }
}
const App = {
  directives: { custom: customDirective },
  setup() {
    return () => <a v-custom={[val, 'arg', ['a', 'b']]} />
  }
}

Slot

Note: In jsx, v-slot should be replace with v-slots

const A = (props, { slots }) => (
  <>
    <h1>{slots.default ? slots.default() : 'foo'}</h1>
    <h2>{slots.bar?.()}</h2>
  </>
)

const App = {
  setup() {
    const slots = {
      bar: () => [<span>B</span>]
    }
    return () => (
      <A v-slots={slots}>
        <div>A</div>
      </A>
    )
  }
}

// or

const App = {
  setup() {
    const slots = {
      default: () => [<div>A</div>],
      bar: () => [<span>B</span>]
    }
    return () => <A v-slots={slots} />
  }
}

// or you can use object slots when `enableObjectSlots` is not false.
const App = {
  setup() {
    return () => (
      <>
        <A>
          {{
            default: () => [<div>A</div>],
            bar: () => [<span>B</span>]
          }}
        </A>
        <B>{() => 'foo'}</B>
      </>
    )
  }
}

Give a ⭐️ if this project helped you!

License

MIT License Β© 2022 xxXyh1908

You might also like...
A VtubeStudio plugin that allows iFacialMocap to stream data to the app, enabling full apple ARkit facial tracking to be used for 2D Vtuber models.

facelink_rs A VtubeStudio plugin that allows iFacialMocap to stream data to the app, enabling full apple ARkit facial tracking to be used for 2D Vtube

A rollup plugin that compile Rust code into WebAssembly modules

rollup-plugin-rust tl;dr -- see examples This is a rollup plugin that loads Rust code so it can be interop with Javascript base project. Currently, th

A plugin for Devzat that can tell the time at various timezones.

Devzat Time Teller On Devzat, people come from all around the time. It is sometime hard to know what time it is for other peoples. This plugin let you

Replicated storage docker plugin.

Fractal Docker Plugin This plugin handles the creation and deletion of docker volumes backed by copy-on-write filesystems (BTRFS currently), regular s

Bioinformatics plugin for nushell.

Nushell bio A bioinformatics plugin for nushell. The aim initially is to create a bunch of parsers for all of the common bioinformatics file formats a

A Foundry plugin that enables you to plot charts within solidity.

πŸ–ŒοΈ solplot A Foundry plugin that enables you to plot charts within solidity. Installation First, make sure that you have Rust installed. Then install

Component-based state machine plugin for Bevy

seldom_state is a component-based state machine plugin for Bevy. It's useful for AI, player state, and other entities that occupy various states. It allows for greater reusability of state logic between entities, compared to managing mutually-exclusive components directly in your systems.

Analog subtractive synth (VST Plugin) made with Rust

Synja Analog subtractive synth (VST3 Plugin) made with Rust. More an experiment in making a VST and learning Rust than a production quality Synth, but

πŸ₯ƒ A plugin for swizzling Tauri’s NSWindow to NSPanel

Swizzle Tauri's NSWindow to NSPanel Install There are three general methods of installation that we can recommend. Use crates.io and npm (easiest, and

Comments
  • unknown field `experimental`,

    unknown field `experimental`,

    Describe the bug

    [email protected] @swc/[email protected] [email protected] I used the swc config by npm README

    {
      "jsc": {
        "parser": {
          "syntax": "typescript",
          "tsx": true
        }
      },
      "experimental": {
        "plugins": [
          [
            "swc-plugin-transform-vue3-jsx",
            {}
          ]
        ]
      }
    }
    

    When I run my project by npm run dev And console shows

    ERROR in ./index.js
    Module build failed (from ./node_modules/swc-loader/src/index.js):
    Error: failed to process input file
    
    Caused by:
        0: failed to read swcrc file (D:\html-test\vue-component\index.js)
        1: failed to deserialize .swcrc (json) file: unmatched data: 0:0
        2: unknown field `experimental`, expected one of `env`, `test`, `exclude`, `jsc`, `module`, `minify`, `inputSourceMap`, `sourceMaps`, `inlineSourcesContent`, `emitSourceMapColumns`, `error`, `isModule`, `$schema`
    
    ERROR in ./node_modules/webpack-dev-server/client/index.js?protocol=ws%3A&hostname=0.0.0.0&port=8080&pathname=%2Fws&logging=info&overlay=true&reconnect=10&hot=true&live-reload=true
    Module build failed (from ./node_modules/swc-loader/src/index.js):
    Error: failed to process input file
    
    Caused by:
        0: failed to read swcrc file (D:\html-test\vue-component\node_modules\webpack-dev-server\client\index.js)
        1: failed to deserialize .swcrc (json) file: unmatched data: 0:0
        2: unknown field `experimental`, expected one of `env`, `test`, `exclude`, `jsc`, `module`, `minify`, `inputSourceMap`, `sourceMaps`, `inlineSourcesContent`, `emitSourceMapColumns`, `error`, `isModule`, `$schema`
    
    ERROR in ./node_modules/webpack/hot/dev-server.js
    Module build failed (from ./node_modules/swc-loader/src/index.js):
    Error: failed to process input file
    
    Caused by:
        0: failed to read swcrc file (D:\html-test\vue-component\node_modules\webpack\hot\dev-server.js)
        1: failed to deserialize .swcrc (json) file: unmatched data: 0:0
        2: unknown field `experimental`, expected one of `env`, `test`, `exclude`, `jsc`, `module`, `minify`, `inputSourceMap`, `sourceMaps`, `inlineSourcesContent`, `emitSourceMapColumns`, `error`, `isModule`, `$schema`
    
    webpack 5.74.0 compiled with 3 errors in 1213 ms
    

    And then I change the .swcrc config. Set the plugin to **jsc**.experimental.plugins

    And console shows that:

    thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: LayoutError', C:\Users\xyh\.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b\rkyv-0.7.37\src\impls\core\mod.rs:265:67
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: LayoutError', C:\Users\xyh\.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b\rkyv-0.7.37\src\impls\core\mod.rs:265:67
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    thread 'thread '<unnamed><unnamed>' panicked at '' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("D:\\html-test\\vue-component\\index.js")'
    
    Caused by:
        0: failed to invoke `swc-plugin-transform-vue3-jsx` as js transform plugin at node_modules\swc-plugin-transform-vue3-jsx\wasm\swc_plugin_transform_vue3_jsx.wasm
        1: RuntimeError: unreachable
               at __rust_start_panic (<module>[3650]:0x26ebcd)
               at rust_panic (<module>[3641]:0x26e8a1)
               at std::panicking::rust_panic_with_hook::h5af4a166307aff48 (<module>[3640]:0x26e81e)
               at std::panicking::begin_panic_handler::{{closure}}::h42a9871ead2de5e8 (<module>[3627]:0x26da84)
               at std::sys_common::backtrace::__rust_end_short_backtrace::h42a6bde96d4a4a1f (<module>[3626]:0x26d9c3)
               at rust_begin_unwind (<module>[3635]:0x26e16e)
               at core::panicking::panic_fmt::h33d7d4c3033d60da (<module>[3741]:0x2755b3)
               at core::result::unwrap_failed::h5d36bed23403009b (<module>[3790]:0x27c9aa)
               at rkyv::impls::core::<impl rkyv::DeserializeUnsized<[U],D> for [T]>::deserialize_unsized::hee071365124018f7 (<module>[616]:0x9e588)
               at rkyv::impls::core::<impl rkyv::DeserializeUnsized<[U],D> for [T]>::deserialize_unsized::h8a52658b03ad48cd (<module>[796]:0xbbe0b)
               at swc_common::plugin::serialized::PluginSerializedBytes::deserialize::h7ddc6846d758ad97 (<module>[332]:0x55773)
               at swc_common::plugin::serialized::deserialize_from_ptr::h6ff5de1a9851235b (<module>[331]:0x55507)
               at __transform_plugin_process_impl (<module>[633]:0x9f4b3)
               at __transform_plugin_process_impl.command_export (<module>[3877]:0x282843)
        2: unreachablethread 'failed to invoke plugin: failed to invoke plugin on 'Some("D:\\html-test\\vue-component\\node_modules\\webpack-dev-server\\client\\index.js")'
    
    Caused by:
        0: failed to invoke `swc-plugin-transform-vue3-jsx` as js transform plugin at node_modules\swc-plugin-transform-vue3-jsx\wasm\swc_plugin_transform_vue3_jsx.wasm
        1: RuntimeError: out of bounds memory access
               at memcpy (<module>[3691]:0x2728a1)
               at <swc_atoms::EncodeJsWord as rkyv::with::DeserializeWith<<alloc::string::String as rkyv::Archive>::Archived,string_cache::atom::Atom<swc_atoms::JsWordStaticSet>,D>>::deserialize_with::hbbe23ffa24ec7b13 (<module>[315]:0x53e68)
               at rkyv::impls::core::<impl rkyv::DeserializeUnsized<[U],D> for [T]>::deserialize_unsized::hdbbc5437aae83928 (<module>[180]:0x2ac70)
               at rkyv::impls::core::<impl rkyv::DeserializeUnsized<[U],D> for [T]>::deserialize_unsized::h8a52658b03ad48cd (<module>[796]:0xbbc2b)
               at swc_common::plugin::serialized::PluginSerializedBytes::deserialize::h7ddc6846d758ad97 (<module>[332]:0x55773)
               at swc_common::plugin::serialized::deserialize_from_ptr::h6ff5de1a9851235b (<module>[331]:0x55507)
               at __transform_plugin_process_impl (<module>[633]:0x9f4b3)
               at __transform_plugin_process_impl.command_export (<module>[3877]:0x282843)
        2: heap_get_oob', ', <unnamed>C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\swc-0.237.1\src\plugin.rsC:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\swc-0.237.1\src\plugin.rs' panicked at '::failed to invoke plugin: failed to invoke plugin on 'Some("D:\\html-test\\vue-component\\node_modules\\webpack\\hot\\dev-server.js")'
    
    Caused by:
        0: failed to invoke `swc-plugin-transform-vue3-jsx` as js transform plugin at node_modules\swc-plugin-transform-vue3-jsx\wasm\swc_plugin_transform_vue3_jsx.wasm
        1: RuntimeError: unreachable
               at __rust_start_panic (<module>[3650]:0x26ebcd)
               at rust_panic (<module>[3641]:0x26e8a1)
               at std::panicking::rust_panic_with_hook::h5af4a166307aff48 (<module>[3640]:0x26e81e)
               at std::panicking::begin_panic_handler::{{closure}}::h42a9871ead2de5e8 (<module>[3627]:0x26da84)
               at std::sys_common::backtrace::__rust_end_short_backtrace::h42a6bde96d4a4a1f (<module>[3626]:0x26d9c3)
               at rust_begin_unwind (<module>[3635]:0x26e16e)
               at core::panicking::panic_fmt::h33d7d4c3033d60da (<module>[3741]:0x2755b3)
               at core::result::unwrap_failed::h5d36bed23403009b (<module>[3790]:0x27c9aa)
               at swc_ecma_ast::stmt::_::<impl rkyv::Deserialize<swc_ecma_ast::stmt::Stmt,__D> for <swc_ecma_ast::stmt::Stmt as rkyv::Archive>::Archived>::deserialize::h8de37e391cd35ce2 (<module>[119]:0x1ecc0)
               at swc_ecma_ast::stmt::_::<impl rkyv::Deserialize<swc_ecma_ast::stmt::Stmt,__D> for <swc_ecma_ast::stmt::Stmt as rkyv::Archive>::Archived>::deserialize::h8de37e391cd35ce2 (<module>[859]:0xd4765)
               at rkyv::impls::alloc::boxed::<impl rkyv::Deserialize<alloc::boxed::Box<T>,D> for rkyv::boxed::ArchivedBox<<T as rkyv::ArchiveUnsized>::Archived>>::deserialize::hc86113c77e42016d (<module>[860]:0xd6187)
               at swc_ecma_ast::stmt::_::<impl rkyv::Deserialize<swc_ecma_ast::stmt::Stmt,__D> for <swc_ecma_ast::stmt::Stmt as rkyv::Archive>::Archived>::deserialize::h8de37e391cd35ce2 (<module>[859]:0xd4ad3)
               at rkyv::impls::core::<impl rkyv::DeserializeUnsized<[U],D> for [T]>::deserialize_unsized::h8a52658b03ad48cd (<module>[796]:0xbce41)
               at swc_common::plugin::serialized::PluginSerializedBytes::deserialize::h7ddc6846d758ad97 (<module>[332]:0x55773)
               at swc_common::plugin::serialized::deserialize_from_ptr::h6ff5de1a9851235b (<module>[331]:0x55507)
               at __transform_plugin_process_impl (<module>[633]:0x9f4b3)
               at __transform_plugin_process_impl.command_export (<module>[3877]:0x282843)
        2: unreachable228228', :C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\swc-0.237.1\src\plugin.rs14::
    14228note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
    :14
    2 assets
    12 modules
    
    ERROR in ./index.js
    Module build failed (from ./node_modules/swc-loader/src/index.js):
    Error: failed to handle: failed to invoke plugin: failed to invoke plugin on 'Some("D:\\html-test\\vue-component\\index.js")'
    
    Caused by:
        0: failed to invoke `swc-plugin-transform-vue3-jsx` as js transform plugin at node_modules\swc-plugin-transform-vue3-jsx\wasm\swc_plugin_transform_vue3_jsx.wasm
        1: RuntimeError: unreachable
               at __rust_start_panic (<module>[3650]:0x26ebcd)
               at rust_panic (<module>[3641]:0x26e8a1)
               at std::panicking::rust_panic_with_hook::h5af4a166307aff48 (<module>[3640]:0x26e81e)
               at std::panicking::begin_panic_handler::{{closure}}::h42a9871ead2de5e8 (<module>[3627]:0x26da84)
               at std::sys_common::backtrace::__rust_end_short_backtrace::h42a6bde96d4a4a1f (<module>[3626]:0x26d9c3)
               at rust_begin_unwind (<module>[3635]:0x26e16e)
               at core::panicking::panic_fmt::h33d7d4c3033d60da (<module>[3741]:0x2755b3)
               at core::result::unwrap_failed::h5d36bed23403009b (<module>[3790]:0x27c9aa)
               at rkyv::impls::core::<impl rkyv::DeserializeUnsized<[U],D> for [T]>::deserialize_unsized::hee071365124018f7 (<module>[616]:0x9e588)
               at rkyv::impls::core::<impl rkyv::DeserializeUnsized<[U],D> for [T]>::deserialize_unsized::h8a52658b03ad48cd (<module>[796]:0xbbe0b)
               at swc_common::plugin::serialized::PluginSerializedBytes::deserialize::h7ddc6846d758ad97 (<module>[332]:0x55773)
               at swc_common::plugin::serialized::deserialize_from_ptr::h6ff5de1a9851235b (<module>[331]:0x55507)
               at __transform_plugin_process_impl (<module>[633]:0x9f4b3)
               at __transform_plugin_process_impl.command_export (<module>[3877]:0x282843)
        2: unreachable
    
    ERROR in ./node_modules/webpack-dev-server/client/index.js?protocol=ws%3A&hostname=0.0.0.0&port=8080&pathname=%2Fws&logging=info&overlay=true&reconnect=10&hot=true&live-reload=true
    Module build failed (from ./node_modules/swc-loader/src/index.js):
    Error: failed to handle: failed to invoke plugin: failed to invoke plugin on 'Some("D:\\html-test\\vue-component\\node_modules\\webpack-dev-server\\client\\index.js")'
    
    Caused by:
        0: failed to invoke `swc-plugin-transform-vue3-jsx` as js transform plugin at node_modules\swc-plugin-transform-vue3-jsx\wasm\swc_plugin_transform_vue3_jsx.wasm
        1: RuntimeError: out of bounds memory access
               at memcpy (<module>[3691]:0x2728a1)
               at <swc_atoms::EncodeJsWord as rkyv::with::DeserializeWith<<alloc::string::String as rkyv::Archive>::Archived,string_cache::atom::Atom<swc_atoms::JsWordStaticSet>,D>>::deserialize_with::hbbe23ffa24ec7b13 (<module>[315]:0x53e68)
               at rkyv::impls::core::<impl rkyv::DeserializeUnsized<[U],D> for [T]>::deserialize_unsized::hdbbc5437aae83928 (<module>[180]:0x2ac70)
               at rkyv::impls::core::<impl rkyv::DeserializeUnsized<[U],D> for [T]>::deserialize_unsized::h8a52658b03ad48cd (<module>[796]:0xbbc2b)
               at swc_common::plugin::serialized::PluginSerializedBytes::deserialize::h7ddc6846d758ad97 (<module>[332]:0x55773)
               at swc_common::plugin::serialized::deserialize_from_ptr::h6ff5de1a9851235b (<module>[331]:0x55507)
               at __transform_plugin_process_impl (<module>[633]:0x9f4b3)
               at __transform_plugin_process_impl.command_export (<module>[3877]:0x282843)
        2: heap_get_oob
    
    ERROR in ./node_modules/webpack/hot/dev-server.js
    Module build failed (from ./node_modules/swc-loader/src/index.js):
    Error: failed to handle: failed to invoke plugin: failed to invoke plugin on 'Some("D:\\html-test\\vue-component\\node_modules\\webpack\\hot\\dev-server.js")'
    
    Caused by:
        0: failed to invoke `swc-plugin-transform-vue3-jsx` as js transform plugin at node_modules\swc-plugin-transform-vue3-jsx\wasm\swc_plugin_transform_vue3_jsx.wasm
        1: RuntimeError: unreachable
               at __rust_start_panic (<module>[3650]:0x26ebcd)
               at rust_panic (<module>[3641]:0x26e8a1)
               at std::panicking::rust_panic_with_hook::h5af4a166307aff48 (<module>[3640]:0x26e81e)
               at std::panicking::begin_panic_handler::{{closure}}::h42a9871ead2de5e8 (<module>[3627]:0x26da84)
               at std::sys_common::backtrace::__rust_end_short_backtrace::h42a6bde96d4a4a1f (<module>[3626]:0x26d9c3)
               at rust_begin_unwind (<module>[3635]:0x26e16e)
               at core::panicking::panic_fmt::h33d7d4c3033d60da (<module>[3741]:0x2755b3)
               at core::result::unwrap_failed::h5d36bed23403009b (<module>[3790]:0x27c9aa)
               at swc_ecma_ast::stmt::_::<impl rkyv::Deserialize<swc_ecma_ast::stmt::Stmt,__D> for <swc_ecma_ast::stmt::Stmt as rkyv::Archive>::Archived>::deserialize::h8de37e391cd35ce2 (<module>[119]:0x1ecc0)
               at swc_ecma_ast::stmt::_::<impl rkyv::Deserialize<swc_ecma_ast::stmt::Stmt,__D> for <swc_ecma_ast::stmt::Stmt as rkyv::Archive>::Archived>::deserialize::h8de37e391cd35ce2 (<module>[859]:0xd4765)
               at rkyv::impls::alloc::boxed::<impl rkyv::Deserialize<alloc::boxed::Box<T>,D> for rkyv::boxed::ArchivedBox<<T as rkyv::ArchiveUnsized>::Archived>>::deserialize::hc86113c77e42016d (<module>[860]:0xd6187)
               at swc_ecma_ast::stmt::_::<impl rkyv::Deserialize<swc_ecma_ast::stmt::Stmt,__D> for <swc_ecma_ast::stmt::Stmt as rkyv::Archive>::Archived>::deserialize::h8de37e391cd35ce2 (<module>[859]
    

    playground-url

    No response

    Expected generated code

    No response

    opened by 601286825nj 0
[SWC plugin] workaround for jest

[SWC plugin] workaround for jest This is a SWC plugin to handle jest compatibility issues. This SWC plugin should be used with @swc/jest. usage instal

magic-akari 17 Dec 19, 2022
A swc plugin that automatically converts React component libraries into "React Client Component"

A swc plugin that automatically converts React component libraries into "React Client Component". For example, you can automatically convert components from @mui into "React Client Component" without having to wrap a component that uses "use client".

xiaotian 3 Jul 12, 2023
swc node binding use wasm

node_swc swc node binding use wasm Build Make sure you have rust wasm-pack installed. $ yarn build # build wasm, node Usage import { parseSync, printS

δΌŠζ’’ε°” 23 Sep 8, 2022
An experimental transpiler to bring tailwind macros to SWC πŸš€

stailwc (speedy tailwind compiler) This is an experimental SWC transpiler to bring compile time tailwind macros to SWC (and nextjs) a-la twin macro. T

Alexander Lyon 139 Dec 20, 2022
Lapce vue plugin, support vue (SFC) syntax highlight, autocomplate,types check

Lapce Plugin for Vue (based volar) Preview Usage Required: Lapce version must be greater than 2.0, and you can use Lapce nightly version. click here t

xiaoxin 32 Dec 26, 2022
Plugin to request a relaunch when uploading a Skyline plugin through cargo skyline

restart-plugin A skyline plugin for allowing cargo-skyline (or other tools) to restart your game without you having to touch your controller. Install

null 1 Nov 21, 2021
Experimental syntax for Rust

Osy.rs Experimental syntax for Rust Hey everyone, this readme needs work! The spec has been roughed out in Osy.rs_spec.alpha, but the file could be be

null 3 Dec 17, 2021
Motoko concrete syntax parser in Rust.

motoko.rs Motoko concrete syntax parser and dynamic evaluator (VM) in Rust. Motoko VM The Motoko VM explores a more dynamic way for Motoko to execute.

DFINITY 8 Dec 15, 2022
This plugin provides an interface for storing unencrypted values on the application cache folder.

Tauri Plugin Store This plugin provides an interface for storing unencrypted values on the application cache folder. Architecture This repo shape migh

Tauri 128 Jan 1, 2023
This is a Pomodoro Clock implemented as a Zellij plugin.

Pomodoro Clock This is a Pomodoro Clock implemented as a Zellij plugin. It shows a Pomodoro time as well as current date time. Prerequisite You must i

Tw 15 Nov 14, 2022