0Pricing
Vue Academy · Lesson

Vue Macros and Community Proposals

vue-macros library, experimental defineModel, defineOptions, setupSFC proposals.

Compiler Macros in script setup

In <script setup>, Vue provides compiler macros — functions like defineProps and defineEmits that are processed at compile time, not imported at runtime. Vue 3.4 and later added more, and the community vue-macros project experiments with even more.

vue-macros: An Experimentation Ground

vue-macros is a community library that ships experimental macros ahead of (or beyond) core Vue. Successful ideas sometimes graduate into core — defineModel started here before becoming stable.

// vite.config
import VueMacros from 'unplugin-vue-macros/vite'
import vue from '@vitejs/plugin-vue'

export default defineConfig({
  plugins: [VueMacros({ plugins: { vue: vue() } })]
})

All lessons in this course

  1. Vue Vapor Mode: Compile-Time Optimization
  2. Vite Ecosystem: Plugins and Tooling
  3. Vue Macros and Community Proposals
  4. Choosing the Right Vue Stack for 2025+
← Back to Vue Academy