3 releases (breaking)

0.2.0 Jul 7, 2024
0.1.0 Nov 27, 2023
0.0.1 Aug 7, 2023

#1001 in Development tools

Download history 53/week @ 2024-07-01 130/week @ 2024-07-08 35/week @ 2024-07-15 67/week @ 2024-07-22 41/week @ 2024-07-29 8/week @ 2024-08-19 27/week @ 2024-08-26 25/week @ 2024-09-02 8/week @ 2024-09-09 29/week @ 2024-09-16 52/week @ 2024-09-23 7/week @ 2024-09-30 4/week @ 2024-10-07 29/week @ 2024-10-14

92 downloads per month
Used in 4 crates (3 directly)

Apache-2.0

375KB
8K SLoC

fervid_transform

Part of the fervid project, an all-in-one Vue compiler. This crate is responsible for the transformations in the template, such as optimizing the AST or transforming the JS/TS expressions in the AST nodes.

In the future this crate may accommodate the <style> transformations as well, which are currently in its own crate.

script

A set of Rust APIs for processing Vue's <script> and <script setup>.

Roadmap

  • <script> support

    • Top-level declarations and imports;
    • data bindings;
    • props;
    • computed;
    • setup;
    • inject;
    • emits;
    • components;
    • methods;
    • expose;
    • name;
    • directives;
  • <script setup> support

    • Top-level declarations and imports;
    • Binding types (using bit-flags instead of enum);
    • Compiler macros:
      • defineProps(...);
      • defineProps<...>();
      • defineEmits(...);
      • defineEmits<...>();
      • defineExpose;
      • defineOptions;
      • defineSlots;
  • TypeScript support

  • Additional features

    • useCssVars;
    • Top-level await;
  • Compilation order

    • Analysis of scripts;
    • Merging scripts into an Options API object
      • Trivial field-by-field merging;
      • Non-trivial merging using { ...legacy, ...setup };
    • Attaching compiled template
      • Adding bindings return in DEV mode, then attaching a render function to the _sfc_ object;
      • Inlining template in PROD mode;
    • Attaching additional information: name, scope, etc.

Dependencies

~14MB
~292K SLoC