/vue2-rs

Primary LanguageRustMIT LicenseMIT

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)
      • <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
      • <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=".."
  • 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
  • Style

    • Basic start and end detection (<style>..</style>)
    • Style parsing
    • Source maps
    • Global
    • Scoped
  • Vite stuff

    • Compiling of Vue components
    • Component error handling
    • Hot Module Reloading
  • Other

    • Html comments

Development

Links

Setup

cargo install wasm-pack

Build WASM file and run vite to test

wasm-pack build --target nodejs --dev && npm run dev

You can inspect what the vite is doing on: localhost:3000/__inspect