Vize

Hex.pm Documentation

Elixir bindings for Vize, a Vue.js toolchain written in Rust. Parse, analyze, lint, and compile Vue single-file components from Elixir, including Vapor mode and its intermediate representation, plus a LightningCSS-based CSS pipeline.

{:ok, result} =
Vize.compile_sfc("""
<template><button @click="count++">{{ count }}</button></template>
<script setup>
import { ref } from "vue"
const count = ref(0)
</script>
<style scoped>button { color: blue }</style>
""", filename: "Counter.vue")
result.code # JavaScript module
result.css # scoped CSS

Installation

def deps do
[{:vize, "~> 0.16"}]
end

Precompiled NIFs are downloaded for macOS, Linux (glibc and musl), and Windows, so no Rust toolchain is needed. To build from source, set VIZE_EX_BUILD=1 and install Rust 1.95 or later.

What it covers

Volt uses Vize to build Vue apps, and PhoenixVapor uses it to render Vue templates as LiveView.

Documentation

Guides, a cheatsheet, and the API reference are on HexDocs.

Part of Elixir Volt

vize compiles and analyzes Vue single-file components from Elixir, including Vapor-mode IR for BEAM-native rendering.

It is part of a frontend stack that runs inside the BEAM — builds, JS runtimes, icons, and Vue-to-LiveView compilation as supervised parts of the application instead of external toolchain processes. See the Elixir Volt organization for the rest, and Building Blocks for the Future Web for the thesis, architecture, and roadmap that tie them together.

License

MIT