Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@vue-jsx-vapor/macros

vuejs720MIT2.6.2TypeScript support: included

Macros for Vue JSX Vapor

transform, vue-jsx, macros, volar, vapor

readme

vue-jsx-vapor

NPM version

Vapor Mode of Vue JSX.

Features

  • ⚡️ High Performance: It has the same performance as Vue Vapor!
  • ⚒️ Directives: Support all build-in directives of Vue.
  • ✨ Macros: Support most macros of Vue, Friendly to JSX.
  • 🌈 Hot Module Replacement: Support functional components or defined by defineComponent.
  • 🦾 Type Safe: Provide Volar plugin support by install TS Macro (VSCode plugin).
  • ⚙️ ESLint: Provide an ESLint plugin for vue-jsx-vapor to automatically format code.

Installation

npm i vue-jsx-vapor

Usage

<summary>Vite</summary>
// vite.config.ts
import VueJsxVapor from 'vue-jsx-vapor/vite'

export default defineConfig({
  plugins: [VueJsxVapor()],
})

Example: playground/


<summary>Rollup</summary>
// rollup.config.js
import VueJsxVapor from 'vue-jsx-vapor/rollup'

export default {
  plugins: [VueJsxVapor()],
}


<summary>Webpack</summary>
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [require('vue-jsx-vapor/webpack')()],
}


<summary>Nuxt</summary>
// nuxt.config.js
export default defineNuxtConfig({
  modules: ['vue-jsx-vapor/nuxt'],
})

This module works for both Nuxt 2 and Nuxt Vite


<summary>Vue CLI</summary>
// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [require('vue-jsx-vapor/webpack')()],
  },
}


<summary>esbuild</summary>
// esbuild.config.js
import { build } from 'esbuild'
import VueJsxVapor from 'vue-jsx-vapor/esbuild'

build({
  plugins: [VueJsxVapor()],
})


changelog

2.6.2 (2025-08-08)

Bug Fixes

  • babel: import createComponentWithFallback from vue-jsx-vapor (0c5b966)
  • runtime: correct props type for h (443945b)
  • runtime: normalizeNode slots for createComponentWithFallback (2f8e6fc)

Features

  • compiler: add withFallback option to compile components to createComponentWithFallback (0c2d470)
  • macros: add verification feature for return keyword (65c6a5e)

2.6.1 (2025-08-05)

Bug Fixes

  • macros: correct types for defineComponent and defineVaporComponent (8a79bdb)

2.6.0 (2025-07-29)

Bug Fixes

  • macros: allow VariableStatement for defineModel (9769f27)
  • macros: prevent return defineComponent for generic component (dc64b7f)
  • macros: return DefineComponent type for defineComponent (5803b5e)

Features

  • introduce @vue-jsx-vapor/runtime (27add9e)
  • vue-jsx-vapor: support functional props for h (4fb5d61)

2.5.4-beta.1 (2025-07-23)

2.5.3 (2025-07-22)

Features

  • compiler: add fast-remove flag (4e549e1)
  • compiler: support JSXComponent in JSXExpressionContainer (c69e8ca)
  • eslint: support template literal interpolation for define-style (5be5080)
  • macros/volar: allow define styles after the ReturnStatement (255479b)
  • vue-jsx-vapor: support h and Fragment (c4e0bbe)

2.5.2 (2025-07-17)

Bug Fixes

  • ts-macro: prevent useSelector undefined error (1800b44)
  • vue-jsx-vapor: generate correct HMR (27179f6)

Features

  • macros: support vue sfc (0106c80)
  • vue-jsx-vapor: support vue sfc (c24d3c7)

2.5.1 (2025-07-13)

Bug Fixes

  • compiler: remove compiler error for v-slots (033d62f)
  • compiler: use underscores instead of colons for cached name (0ffd1c6)

Features

  • compiler: generate more efficient runtime code for specific interpolation patterns (3c22e74)
  • compiler: support JSXNamespacedName for v-model (941fb83)
  • vue-jsx-vapor: add getCurrentInstance (067f018)

2.5.0 (2025-07-07)

Features

2.4.8 (2025-07-05)

Bug Fixes

  • compiler: use parseExpression instead of walkIdentifiers (13fa2f4)

2.4.7 (2025-07-04)

Features

  • support functional component in interop mode (26afc8c)

2.4.6 (2025-06-27)

Bug Fixes

  • compiler-vapor: properly locate last if node (9633b9c)
  • compiler: correct execution order of operations (485e709)
  • compiler: prevent v-for components from being single root (9c10b3b)

Features

  • add sourceMap option (9566477)
  • vue-jsx-vapor: add class and style for IntrinsicAttributes (997045f)

2.4.5 (2025-06-12)

Features

  • eslint: enhance offset calculation for defineStyle formatting (7d53c74)
  • macros: improve handling of required props in defineComponent (1889468)

2.4.4 (2025-06-03)

Features

  • vue-jsx-vapor: expose jsx-runtime/dom (2802d74)

2.4.3 (2025-06-01)

Bug Fixes

  • compiler: use createNodes instead of setNodes for v-slot (1c5cf09)

2.4.2 (2025-05-29)

Bug Fixes

  • comiler: unwrap type for expressions (a5c0c85)
  • vue-jsx-vapor: remove pauseTracking (78fcc0a)

Features

  • vue-jsx-vapor: support array expression (bccb5ef)

2.4.1 (2025-05-26)

Bug Fixes

  • vue-jsx-vapor: expose correct jsx-runtime type (bdd3613)

Features

  • macros: use vue-jsx-vapor/runtime to support browser environments (20be1a0)

2.4.0 (2025-05-26)

Bug Fixes

  • babel: add typescript plugin for parse (2d0cd50)
  • vue-jsx-vapor/volar: correct passing macros's options (21d8b0a)

Features

  • macros/define-style: support navigation for css-modules (710127d)
  • macros: add JSX support for auto generate props (4cfcc0d)
  • macros: props allowed to be overridden for defineComponent (2f5ce4a)
  • vue-jsx-vapor: add pauseTracking and pauseTracking for createNodes (617eb2f)
  • vue-jsx-vapor: introduce useProps and useFullProps (69041a7)
  • vue-jsx-vapor: support custom HTMLAttributes for jsx-runtime (22fb370)

2.3.6 (2025-05-12)

Features

  • vue-jsx-vapor: support vaporComponent for createNodes (403a800)

2.3.5 (2025-05-05)

Features

  • macros: support :slotted for defineStyle (fb10489)

2.3.4 (2025-05-02)

Bug Fixes

  • eslint/jsx-sort-props: correct sort for reservedProps (7ddd014)
  • macros: make alias option optional (d459bd1)

2.3.3 (2025-04-28)

Features

  • compiler: defaults prop.value to true when it is null (e653e77)
  • macros: automatically infer type from default value (d7b31d6)
  • macros: automatically infer type from default value for defineModel (47c139e)

2.3.2 (2025-04-26)

Bug Fixes

  • macros/volar: add semicolon for defineComponent (1289cb3)

2.3.1 (2025-04-25)

2.3.0 (2025-04-10)

Features

  • introduce eslint (f241afa)
  • macros/defineComponent: support auto return functional component for SSR (c0b310f)

2.2.0 (2025-04-05)

Features

  • vue-jsx-vapor: support SSR (1ae4fe9)

2.1.8 (2025-03-28)

Bug Fixes

  • vue-jsx-vapor: prevent register HMR in production environment (cab7de4)

2.1.7 (2025-03-25)

Bug Fixes

  • macros/volar: use _MACROSctx to infer type (0a5b315)

Features

  • vue-jsx-vapor: support hmr (c1091da)
  • vue-jsx-vapor: support hmr for functional components (faed7fa)

Performance Improvements

  • macors/volar: optimize infer type performance (bebec2b)

2.1.6 (2025-03-20)

Bug Fixes

  • compiler: use modelValueModifiers instead of modelModifiers (563b2f0)
  • macros: remove lib option (9548729)

2.1.5 (2025-03-19)

Features

  • compiler: support v-text directive (98a24d6)

2.1.4 (2025-03-18)

Features

  • vue-jsx-vapor: use virtual code to support browser environments (db1660e)

2.1.3 (2025-03-18)

Bug Fixes

  • compiler: move next, child and nthChild before the setInsertionState (d12a086)

2.1.2 (2025-03-17)

Bug Fixes

2.1.1 (2025-03-17)

Bug Fixes

  • compiler: missing modifiers (32849a7)
  • compiler: remove empty modifiers (dce2e83)
  • compiler: use setInsertionState instead of insert (2fae757)

Features

  • compiler: support empty expression for event with modifiers (187bf8c)

2.1.0 (2025-03-16)

Bug Fixes

Features

  • vue-jsx-vapor: add jsxImportSource support (b5e051d)

2.0.1 (2025-03-12)

Features

  • macros: add semicolon prefix for defineExpose (1f7171e)

2.0.0 (2025-03-12)

1.7.0 (2025-03-11)

Bug Fixes

1.6.0 (2025-03-10)

Features

  • volar: auto infer type for useRef (0e44f13)

(2025-03-09)

Bug Fixes

Features

  • add interop mode (f46592c)
  • babel: support nested source maps (3e69eba)
  • babel: support source map (17d7ea7)
  • compiler: remove babel/parser (ac494d1)
  • compiler: support native v-if directive (18b77fc)
  • compiler: support native v-slot directive (9db436d)
  • compiler: support nested component slot (a17e04e)
  • compiler: support string source (4293948)
  • compiler: support v-once directive (16a6b49)
  • compiler: support v-text directive (e1445ae)
  • introducing babel-plugin (dd2e384)
  • support AST node compilation (06eb0a3)
  • unplugin: add filename option for source map (10a6909)
  • unplugin: add volar plugin (7bf1284)
  • unplugin: expose raw to support browser environments (4dc2ffc)

Reverts

  • unplugin: add effectScope for helper code (dfb640b)
  • vue/vapor (ea9f738)