{"id":16266223,"url":"https://github.com/phoenix-ru/fervid","last_synced_at":"2025-05-15T00:06:34.536Z","repository":{"id":148141427,"uuid":"544999698","full_name":"phoenix-ru/fervid","owner":"phoenix-ru","description":"All-in-One Vue compiler written in Rust","archived":false,"fork":false,"pushed_at":"2025-05-01T07:30:18.000Z","size":16920,"stargazers_count":409,"open_issues_count":22,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-01T08:28:57.061Z","etag":null,"topics":["compiler","rust","sfc","vue","vue3"],"latest_commit_sha":null,"homepage":"https://phoenix-ru.github.io/fervid/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phoenix-ru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"phoenix-ru"}},"created_at":"2022-10-03T15:55:37.000Z","updated_at":"2025-04-14T16:23:28.000Z","dependencies_parsed_at":"2024-02-22T23:24:42.782Z","dependency_job_id":"8656f85c-295b-4edd-bd6f-f5a404420c9d","html_url":"https://github.com/phoenix-ru/fervid","commit_stats":{"total_commits":398,"total_committers":8,"mean_commits":49.75,"dds":"0.40452261306532666","last_synced_commit":"8b6920220ed4728d298d4df5f61bbd5d1d2253b9"},"previous_names":["phoenix-ru/rust-vue-compiler"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoenix-ru%2Ffervid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoenix-ru%2Ffervid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoenix-ru%2Ffervid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoenix-ru%2Ffervid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phoenix-ru","download_url":"https://codeload.github.com/phoenix-ru/fervid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254249198,"owners_count":22039029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","rust","sfc","vue","vue3"],"created_at":"2024-10-10T17:40:22.203Z","updated_at":"2025-05-15T00:06:34.493Z","avatar_url":"https://github.com/phoenix-ru.png","language":"Rust","funding_links":["https://github.com/sponsors/phoenix-ru"],"categories":["Rust"],"sub_categories":[],"readme":"\u003cdiv style=\"text-align: center\"\u003e\n\u003cimg src=\"logo.png\" width=\"280\" height=\"120\"\u003e\n\u003c/div\u003e\n\n# fervid\nAll-In-One Vue compiler written in Rust.\nCurrently in alpha stage, the closest goal is to reach feature-parity with the current [Vue SFC compiler](https://sfc.vuejs.org).\n\n\n## Getting started\nInstructions on how to use `fervid` in Vue CLI and Vite are coming very soon!\n\n\n## Progress till MVP ![84%](https://geps.dev/progress/84)\nA minimal target of this project includes (see [Roadmap](#roadmap)):\n- Vue 3 code generation;\n- [unplugin](https://github.com/unjs/unplugin) integration;\n- [Farm](https://github.com/farm-fe/farm) native plugin;\n- Dev/prod mode support;\n- `\u003cscript setup\u003e` support;\n- Example Vue project with configuration;\n- Performance comparison.\n\n## Is it correct?\nThis project uses [Vue SFC playground](https://sfc.vuejs.org) as its reference to compare the output.\nAs of November 2023, fervid is capable of producing the DEV and PROD code almost identical to the official compiler, with some differences in:\n- Context variables. This includes usages like `{{ foo + bar.buzz }}` or `\u003cdiv v-if=\"isShown\"\u003e`.\n  Support for them in fervid is almost complete.\n- [WIP] Patch flags. These are used to help Vue runtime when diffing the VNodes. If a VNode only has one prop which is dynamic, and all the other props and text are static, this needs to be conveyed to Vue for fast updates.\n  Support for them is ongoing.\n\nTo check correctness of fervid, you can compare the [playground output](https://phoenix-ru.github.io/fervid/) to the output of [official compiler](https://play.vuejs.org).\n\nPlease note that \"correctness\" of output will depend on the version of Vue, as Vue team may change the output and/or behaviour of the compiler. This is a challenge for fervid.\n\n## Is it fast?\nYes, it is incredibly fast. In fact, below is a benchmark run for a [test component](crates/fervid/benches/fixtures/input.vue).\n\n```\n  @vue/compiler-sfc:\n    954 ops/s, ±1.15%     | slowest, 98.42% slower\n\n  @fervid/napi sync:\n    6 464 ops/s, ±0.08%   | 89.29% slower\n\n  @fervid/napi async (4 threads):\n    11 624 ops/s, ±2.12%  | 80.73% slower\n\n  @fervid/napi async CPUS (23 threads):\n    60 329 ops/s, ±0.67%  | fastest\n```\n\n\u003c!-- \n| Action                     | Mean time    |\n|----------------------------|--------------|\n| Parsing                    | 5.58µs       |\n| Code generation: CSR + DEV | 16.26µs      | --\u003e\n\n\u003e Note: results are for AMD Ryzen 9 7900X running on Fedora 38 with kernel version 6.5.9\n\n\u003c!-- Micro-benchmarking has been done using Criterion, code for benchmarks can be found in `benches` directory. --\u003e\nBenchmarking in Node.js has been done using [`benny`](https://github.com/caderek/benny), slightly modified to take `libuv` threads into consideration.\n[Source code for a benchmark](crates/fervid_napi/benchmark/bench.ts).\n\nBetter benchmarking is a TODO and has a lower priority compared to feature-completeness and usability in real-world scenarios, so **Pull Requests are welcome**.\n\n## Crates\n\n### `fervid` ![wip](https://badgen.net/badge/Status/In%20progress/blue)\nThe main crate. It exports a `compile` method which glues all the stages together, from taking a source string to outputting compiled code and assets.\nFor finer-grained compilation you can use other crates directly.\n\n### `fervid_core` ![alpha](https://badgen.net/badge/Status/Alpha%20-%20almost%20stable/cyan)\nThe core structures and functionality shared across crates.\n\n### `fervid_parser` ![alpha](https://badgen.net/badge/Status/Alpha%20-%20almost%20stable/cyan)\nParser for Vue SFC based on [swc_html_parser](https://rustdoc.swc.rs/swc_html_parser/).\n\n### `fervid_transform` ![alpha](https://badgen.net/badge/Status/Alpha%20-%20feedback%20welcome/cyan)\nThis crate is responsible for AST transformation.\nHandles `\u003cscript\u003e` and `\u003cscript setup\u003e` analysis and transformations, along with Typescript.\nBased on [SWC](https://github.com/swc-project/swc) and provides fast and correct transforms without using regular expressions.\n\n### `fervid_css` ![alpha](https://badgen.net/badge/Status/Alpha%20-%20feedback%20welcome/cyan)\nWorks on the `\u003cstyle\u003e` block and enables `scoped` styles, CSS Modules and Vue-specific transformations. The backbone of this crate is [swc_css_parser](https://crates.io/crates/swc_css_parser).\n\n### `fervid_napi` ![alpha](https://badgen.net/badge/Status/Alpha%20-%20feedback%20welcome/cyan)\nNAPI-rs bindings for usage in Node.js.\n\n### `fervid_deno` ![future](https://badgen.net/badge/Status/Planned/orange)\nDeno bindings for usage in Deno.\n\n### `fervid_plugin` and `fervid_plugin_api` ![future](https://badgen.net/badge/Status/Planned/orange)\nThese crates allow authoring plugins for `fervid` in Rust using dynamically loaded libraries (`.so`, `.dll` and `.dylib`).\nThese plugins allow anyone to customize how a Vue SFC is parsed, optimized and code-generated.\n\n## Roadmap\nParser\n- [x] Template parsing\n- [x] W3 Spec compliance\n\nTransformer\n- [x] Template scope construction\n- [ ] Error reporting\n- [x] JS/TS imports analysis (powered by swc_ecma_parser)\n- [x] `setup`/`data`/`props` analysis\n- [x] Processing `\u003cstyle scoped\u003e`\n- [ ] `\u003cscript setup\u003e` support\n  - [x] Bindings collection;\n  - [x] Return statement: inline vs render function;\n  - [x] defineProps\n  - [x] defineEmits\n  - [x] defineExpose\n  - [x] defineOptions\n  - [x] defineSlots\n  - [x] defineModel\n  - [ ] Tests\n\nCode generator\n- [ ] Basic Vue3 code generation\n  - [x] Elements\n    - [x] `createElementVNode`\n    - [x] Attributes\n      - [x] Static + Dynamic\n      - [x] `style` merging\n      - [x] `class` merging\n    - [x] Children\n  - [x] Components\n    - [x] `createVNode`\n    - [x] Slots\n  - [x] Context-awareness (`_ctx`, `$data`, `$setup`)\n  - [x] Directives\n    - [x] v-on\n    - [x] v-bind\n    - [x] v-if / v-else-if / v-else\n    - [x] v-for\n    - [x] v-show\n    - [x] v-slot\n    - [x] v-model\n    - [x] v-cloak\n    - [x] v-html\n    - [x] v-memo\n    - [x] v-once\n    - [x] v-pre\n    - [x] v-text\n    - [x] Custom directives\n  - [x] Built-in components\n    - [x] keep-alive\n    - [x] component\n    - [x] transition\n    - [x] transition-group\n    - [x] teleport\n    - [x] slot\n    - [x] suspense\n  - [ ] Patch flags\n  - [ ] Hoisting\n\n- [x] DEV/PROD mode\n- [x] Hot Module Replacement (HMR)\n- [ ] Vue 2.7 support\n- [ ] SSR with inline critical CSS support\n- [ ] Eager pre-compilation of Vue imports (avoid unneccessary bundler-\u003ecompiler calls)\n\nIntegrations\n- [x] WASM binary (unpublished)\n- [x] NAPI binary [@fervid/napi](https://www.npmjs.com/package/@fervid/napi)\n- [x] [unplugin](https://github.com/unjs/unplugin) (in progress)\n- [ ] [Farm](https://github.com/farm-fe/farm) native plugin\n- [ ] [Turbopack](https://github.com/vercel/turbo) plugin (when plugin system is defined)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoenix-ru%2Ffervid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphoenix-ru%2Ffervid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoenix-ru%2Ffervid/lists"}