3 releases (breaking)
0.2.0 | Jul 7, 2024 |
---|---|
0.1.0 | Nov 27, 2023 |
0.0.1 | Aug 7, 2023 |
#995 in Development tools
66 downloads per month
Used in 4 crates
(3 directly)
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
-
enum
bindings; - Type-only props/emit declarations;
- DEV-mode import usage checks;
-
-
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
inDEV
mode, then attaching a render function to the_sfc_
object; - Inlining template in
PROD
mode;
- Adding bindings
- Attaching additional information:
name
,scope
, etc.
Dependencies
~15MB
~290K SLoC