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
- Vue Vapor Mode: Compile-Time Optimization
- Vite Ecosystem: Plugins and Tooling
- Vue Macros and Community Proposals
- Choosing the Right Vue Stack for 2025+