A vue 2 template compiler written in rust and exposed as a plugin for Vite and Rollup.js
This is a project that is in progress
-
Template
- Basic start and end detection (
<template>..</template>
) - Parsing
- Tags
- Text
- Vars
- Source maps
- Pug support?
- Convert to JS render method
- Static text
- Var (
{{ foo+bar }}
) - Support HTML escape characters
- Tag
- Name
- Children
- Args
- normal (
<tag foo="bar" />
) -
v-bind
-
v-on
-
v-if
,v-else-if
,v-else
-
v-for
-
v-pre
-
v-text
-
v-html
-
v-once
-
v-model
-
v-cloak
- Custom (
v-custom-directive
)
- normal (
-
<template>
element- Args
-
v-if
-
v-for
-
v-pre
-
v-slot
- with no data arg
- data arg
- working in combination with v-(if, if-else, else)
-
v-text
-
v-html
-
- Args
-
<slot>
element- Default slot
- Named slots
- Default slot content
- Slot args using v-bind
-
v-bind=".."
-
v-bind:value=".."
-
v-bind:foo=".." v-bind:bar=".." v-bind=".."
-
- Basic start and end detection (
-
Script
- Basic start and end detection (
<script>..</script>
) - Inject JS render function from template
- Support other script languages (typescript)
- Source maps
- Inject styles
- Global
- Scoped
- Basic start and end detection (
-
Style
- Basic start and end detection (
<style>..</style>
) - Style parsing
- Source maps
- Global
- Scoped
- Basic start and end detection (
-
Vite stuff
- Compiling of Vue components
- Component error handling
- Hot Module Reloading
-
Other
- Html comments
cargo install wasm-pack
wasm-pack build --target nodejs --dev && npm run dev
You can inspect what the vite is doing on: localhost:3000/__inspect