Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
priv/ts/npm.lock linguist-generated
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
sudo apt-get update
sudo apt-get install --yes inotify-tools
mix deps.get
mix volt.priv.vendor priv/ts
npm ci
npx playwright install --with-deps chromium
latest-command: MIX_ENV=dev mix lint && MIX_ENV=test mix test
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ volt-*.tar

# Git worktrees for parallel agent work
.worktrees/
/priv/ts/node_modules/
4 changes: 4 additions & 0 deletions .reach.exs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ infrastructure = [
"Volt.Cache",
"Volt.Dev",
"Volt.Dev.Cleanup",
"Volt.Dev.Error",
"Volt.Priv.Vendor",
"Volt.DevServer.ClientTag",
"Volt.Dev.Assets",
"Volt.Dev.Session.Call",
"Volt.Dev.Session.State",
Expand All @@ -147,6 +150,7 @@ infrastructure = [
"Volt.Dev.ConsoleForwarder.Payload",
"Volt.ETS",
"Volt.HMR.Boundary",
"Volt.HMR.Errors",
"Volt.HMR.GlobGraph",
"Volt.HMR.ImportGraph",
"Volt.HMR.ModuleGraph",
Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@

## Unreleased

### Breaking changes

- Lint diagnostics are `OXC.Diagnostic` maps: severities are `:error` and `:warning`, and locations are 1-based `position` and `span` instead of byte offsets. Parse errors are diagnostics too, without a `rule`.
- Lint `:plugins`, `:env`, and `:globals` take names as strings, as in an oxlint config file, such as `plugins: ["typescript", "react"]` and `env: ["browser"]`. Atom names raise an `ArgumentError`.
- Custom lint rules report findings with AST `start` and `end` offsets instead of `span`.
- `Volt.JS.Transforms.Imports.rewrite!/3` raises `OXC.Error` on parse errors.
- HMR `error` messages carry the current `errors` as `Volt.Dev.Error` entries instead of a `path` and `reason`; an empty list hides the overlay.

### Added

- The error overlay shows each error's file, line, column, source frame, and hint.
- The error overlay is a `<volt-error-overlay>` element rendered with lit-html into a Shadow DOM, so the app's styles cannot affect it.
- Highlight the error overlay's source frame with the optional `lumis` dependency and its parser packages, such as `lumis_wasm_typescript`.
- `Volt.HMR.error/3` takes a `:title` for the overlay heading, such as `"Render error"`. `Volt.HMR.clear_error/2` hides errors reported with `Volt.HMR.error/3`. Errors stay current until cleared, so browsers that connect later show them.
- The dev server adds the HMR client to HTML pages the app renders.
- `mix volt.priv.vendor` vendors npm packages for browser code under `priv`, keeping only the files the sources reach, for the Hex package rather than git. `Volt.Priv.bundle!/3` bundles a `priv` entry with them and vendors on first use in a git or path checkout. See "Browser code with npm packages" in the plugins guide.
- The error overlay shows a diagnostic's stacktrace.

### Changed

- Require `oxc` 0.18.1, `vize` 0.15, `quickbeam` 0.11.2, and `json_codec` 0.3.

### Fixed

- Show the error overlay when a page loads with a module that fails to compile. The client previously loaded only through the failing module graph.
- Hide the overlay once errors are fixed, and report Tailwind build failures, including at startup.
- Reload the page after the HMR connection returns, since the server may have restarted.
- Type-aware checks run the type-aware rules that lint categories such as `"correctness"` select, honoring individual rule settings and per-file overrides ([#40](https://github.com/elixir-volt/volt/issues/40)).
- Type-aware checks extract single-file component scripts with the configured Volt plugins instead of the oxlint plugin names.

## 0.18.1 - 2026-09-15

### Added
Expand Down
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ config :volt, :format,
arrow_parens: :always

config :volt, :lint,
plugins: [:typescript, :import, :unicorn],
plugins: ["typescript", "import", "unicorn"],
rules: %{
"no-unused-expressions" => :allow,
"no-unused-vars" => :warn,
Expand Down
2 changes: 1 addition & 1 deletion examples/react/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ config :volt, :format,
single_quote: true

config :volt, :lint,
plugins: [:typescript, :react],
plugins: ["typescript", "react"],
tsgolint: System.find_executable("tsgolint"),
rules: %{
"correctness" => :deny,
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ config :volt, :format,
single_quote: true

config :volt, :lint,
plugins: [:typescript],
plugins: ["typescript"],
tsgolint: System.find_executable("tsgolint"),
rules: %{
"correctness" => :deny,
Expand Down
2 changes: 1 addition & 1 deletion examples/svelte/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ config :volt, :format,
single_quote: true

config :volt, :lint,
plugins: [:typescript],
plugins: ["typescript"],
tsgolint: System.find_executable("tsgolint"),
rules: %{
"correctness" => :deny,
Expand Down
2 changes: 1 addition & 1 deletion examples/vanilla/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ config :volt, :format,
single_quote: true

config :volt, :lint,
plugins: [:typescript],
plugins: ["typescript"],
tsgolint: System.find_executable("tsgolint"),
rules: %{
"correctness" => :deny,
Expand Down
4 changes: 3 additions & 1 deletion examples/vanilla/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ defmodule VanillaExample.MixProject do
{:jason, "~> 1.2"},
{:dns_cluster, "~> 0.2.0"},
{:bandit, ">= 1.12.5 and < 2.0.0"},
{:volt, path: "../..", override: true}
{:volt, path: "../..", override: true},
{:lumis, "~> 0.10", only: :dev},
{:lumis_wasm_typescript, "~> 0.26", only: :dev}
]
end

Expand Down
Loading
Loading