vue2-rs
A vue 2 template compiler written in rust and exposed as a plugin for
Vite and Rollup.js
WORK IN PROGRESS
This is a project that is in progress
TODO List
-
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
Development
Links
Setup
cargo install wasm-packBuild WASM file and run vite to test
wasm-pack build --target nodejs --dev && npm run devYou can inspect what the vite is doing on:
localhost:3000/__inspect
On this page
Languages
Rust95.8%JavaScript2.8%Vue1.2%HTML0.2%
Contributors
MIT License
Created January 12, 2022
Updated October 4, 2023