{"id":47197534,"url":"https://github.com/elixir-volt/vize_ex","last_synced_at":"2026-03-17T16:01:47.227Z","repository":{"id":343865185,"uuid":"1179011381","full_name":"elixir-volt/vize_ex","owner":"elixir-volt","description":"Elixir bindings for the Vize Vue.js toolchain — compile, lint, and analyze Vue SFCs via Rust NIFs","archived":false,"fork":false,"pushed_at":"2026-03-12T16:15:22.000Z","size":67,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-14T01:59:59.245Z","etag":null,"topics":["compiler","elixir","nif","rust","ssr","vapor","vue"],"latest_commit_sha":null,"homepage":"https://vizejs.dev","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elixir-volt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-11T15:42:24.000Z","updated_at":"2026-03-13T22:22:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/elixir-volt/vize_ex","commit_stats":null,"previous_names":["dannote/vize_ex","elixir-volt/vize_ex"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/elixir-volt/vize_ex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-volt%2Fvize_ex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-volt%2Fvize_ex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-volt%2Fvize_ex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-volt%2Fvize_ex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elixir-volt","download_url":"https://codeload.github.com/elixir-volt/vize_ex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-volt%2Fvize_ex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30504208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-14T10:22:08.196Z","status":"ssl_error","status_checked_at":"2026-03-14T10:21:46.902Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","elixir","nif","rust","ssr","vapor","vue"],"created_at":"2026-03-13T12:08:05.438Z","updated_at":"2026-03-15T14:01:29.021Z","avatar_url":"https://github.com/elixir-volt.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vize\n\nElixir bindings for the [Vize](https://vizejs.dev) Vue.js toolchain via Rust NIFs.\n\nCompile, lint, and analyze Vue Single File Components at native speed —\nincluding Vapor mode IR for BEAM-native SSR.\n\n## Features\n\n- **Compile** Vue SFCs to JavaScript + CSS (DOM, Vapor, SSR modes)\n- **Template** compilation — standalone template → render function\n- **Vapor IR** — get the intermediate representation as Elixir maps for BEAM-native rendering\n- **SSR** — server-side rendering compilation with `_push()` codegen\n- **Lint** Vue SFCs with built-in rules\n- **Content hashes** — template, script, and style hashes for HMR change detection\n- **CSS compilation** — standalone LightningCSS pipeline with autoprefixing, minification, and Vue scoped styles\n\n## Installation\n\n```elixir\ndef deps do\n  [\n    {:vize, \"~\u003e 0.6.0\"}\n  ]\nend\n```\n\nRequires a Rust toolchain (`rustup` recommended). The NIF compiles automatically on `mix compile`.\n\n## Usage\n\n### Compile SFC\n\n```elixir\n{:ok, result} = Vize.compile_sfc(\"\"\"\n\u003ctemplate\u003e\n  \u003cbutton @click=\"count++\"\u003e{{ count }}\u003c/button\u003e\n\u003c/template\u003e\n\n\u003cscript setup\u003e\nimport { ref } from 'vue'\nconst count = ref(0)\n\u003c/script\u003e\n\n\u003cstyle scoped\u003e\nbutton { color: blue; }\n\u003c/style\u003e\n\"\"\")\n\nresult.code     # Generated JavaScript\nresult.css      # Compiled CSS\nresult.errors   # []\n```\n\nPass a filename for stable scoped CSS `data-v-xxxx` attributes and content hashes:\n\n```elixir\n{:ok, result} = Vize.compile_sfc(source, filename: \"App.vue\")\n\nresult.template_hash  # \"de5ddf78a0f8d31a\"\nresult.style_hash     # \"3efafd39ec9747f9\"\nresult.script_hash    # \"1a8dae0fef50c189\"\n```\n\n### Vapor Mode\n\n```elixir\n{:ok, result} = Vize.compile_vapor(\"\u003cdiv\u003e{{ msg }}\u003c/div\u003e\")\nresult.code       # Vapor JS (no virtual DOM)\nresult.templates  # Static HTML templates\n```\n\n### Vapor IR (for BEAM-native SSR)\n\n```elixir\n{:ok, ir} = Vize.vapor_ir(\"\u003cdiv :class=\\\"cls\\\"\u003e{{ msg }}\u003c/div\u003e\")\n\nir.templates             # [\"\u003cdiv\u003e \u003c/div\u003e\"]\nir.element_template_map  # [{0, 0}]  — element ID → template index\nir.block                 # %{operations: [...], effects: [...], returns: [...]}\n```\n\nThe IR exposes every Vue construct as Elixir maps with `:kind` atoms:\n\n| Kind | Vue Feature |\n|------|-------------|\n| `:set_text` | `{{ expr }}` |\n| `:set_prop` | `:attr=\"expr\"` |\n| `:set_html` | `v-html` |\n| `:set_dynamic_props` | `v-bind=\"obj\"` |\n| `:set_event` | `@event=\"handler\"` |\n| `:if_node` | `v-if` / `v-else-if` / `v-else` |\n| `:for_node` | `v-for` |\n| `:create_component` | `\u003cComponent /\u003e` |\n| `:directive` | `v-show`, `v-model`, custom |\n\nStatic expressions are tagged as `{:static, \"value\"}` tuples,\ndynamic expressions are plain strings.\n\n### Vapor Split (for Phoenix LiveView)\n\n```elixir\n{:ok, split} = Vize.vapor_split(\"\u003cdiv :class=\\\"cls\\\"\u003e\u003cp\u003e{{ msg }}\u003c/p\u003e\u003c/div\u003e\")\n\nsplit.statics  # [\"\u003cdiv class=\\\"\", \"\\\"\u003e\u003cp\u003e\", \"\u003c/p\u003e\u003c/div\u003e\"]\nsplit.slots    # [%{kind: :set_prop, values: [\"cls\"]}, %{kind: :set_text, values: [\"msg\"]}]\n```\n\nProduces a statics/slots split ready for `%Phoenix.LiveView.Rendered{}`.\nAll HTML manipulation (tag tree parsing, marker injection, splitting) happens\nin the NIF. Sub-blocks for `v-if` / `v-for` are recursively split.\n\nUsed by [PhoenixVapor](https://github.com/elixir-volt/phoenix_vapor) to render\nVue templates as native LiveView output.\n\n### SSR Compilation\n\n```elixir\n{:ok, result} = Vize.compile_ssr(\"\u003cdiv\u003e{{ msg }}\u003c/div\u003e\")\nresult.code      # JS with _push() calls\nresult.preamble  # Import statements\n```\n\n### Template Compilation\n\n```elixir\n{:ok, result} = Vize.compile_template(\"\u003cdiv v-if=\\\"show\\\"\u003e{{ msg }}\u003c/div\u003e\")\nresult.code     # Render function\nresult.helpers  # [\"createElementVNode\", \"toDisplayString\", ...]\n```\n\n### Lint\n\n```elixir\n{:ok, diagnostics} = Vize.lint(\"\u003ctemplate\u003e\u003cimg\u003e\u003c/template\u003e\", \"App.vue\")\n```\n\n### Parse SFC\n\n```elixir\n{:ok, descriptor} = Vize.parse_sfc(source)\ndescriptor.template      # %{content: \"...\", lang: nil, ...}\ndescriptor.script_setup  # %{content: \"...\", setup: true, ...}\ndescriptor.styles        # [%{content: \"...\", scoped: true, ...}]\n```\n\n### CSS Compilation\n\nStandalone CSS compilation via LightningCSS — parse, autoprefix, and minify CSS\nindependently of SFC compilation:\n\n```elixir\n{:ok, result} = Vize.compile_css(\".foo { color: red; user-select: none }\", minify: true)\nresult.code\n# \".foo{color:red;-webkit-user-select:none;user-select:none}\"\n```\n\nWith Vue scoped styles:\n\n```elixir\n{:ok, result} = Vize.compile_css(\".foo { color: red }\", scoped: true, scope_id: \"data-v-abc123\")\nresult.code\n# \".foo[data-v-abc123] { color: red }\"\n```\n\nBrowser targeting:\n\n```elixir\n{:ok, result} = Vize.compile_css(css, targets: %{chrome: 80, firefox: 78, safari: 14})\n```\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-volt%2Fvize_ex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felixir-volt%2Fvize_ex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-volt%2Fvize_ex/lists"}