Skip to content

MESH v0.12.0

Choose a tag to compare

@github-actions github-actions released this 14 Oct 01:11
· 64 commits to main since this release
9956198

MESH v0.12.0 release notes

Prepared 2026-10-13 (not yet released: v0.11.0 is the latest release).

v0.12 teaches the editor to format and indent MPRX. mesh-lsp answers Format Document, Format Selection and the indentation of the new line after Enter, so an .mprx file behaves in an editor the way HTML, XML or YAML does: the editor understands its scope. Nothing in the language, the compiler, the runtime or any document format changes; an application that changes nothing behaves as before.

Highlights

  • A formatter: mesh-format. A new crate that changes only whitespace between tokens. Whitespace-only text between tags, {expressions} and block markers is formatting (spec §3), and is re-indented: one level per element and per {#if} / {#each}, with {:else}, {:else if} and the closers one level out. A tag already written over several lines gets one attribute per line, with its > or /> on a line of its own; a tag on one line stays on one line. A run of blank lines becomes one, and the text ends with one newline. Text with a character other than whitespace in it, and everything inside {…}, is kept exactly as written.

    <list>                                  <list>
    {#if ready}                               {#if ready}
    <a />                  becomes              <a />
    {:else}                                   {:else}
        <b/>                                    <b />
    {/if}                                     {/if}
    </list>                                 </list>
  • It checks its own work. The tokens of the result must be exactly those of the source, or the formatter returns an error and the source stands. A source with syntax errors is not formatted (the structure its indentation follows is not known).

  • Three LSP requests. textDocument/formatting (Format Document), rangeFormatting (Format Selection: the edits of the whole formatting that touch the selection) and onTypeFormatting (trigger character: a newline; the new line is indented by the scope it is in, and this works while the file does not parse yet). They need no model and no check, and are never held. Indentation follows the editor's tabSize and insertSpaces.

  • Indentation rules for editors that read a language configuration. editors/vscode/language-configuration.json carries indent and outdent patterns and Enter rules (between a tag and its closer, between a block opener and its closer); the VS Code language configuration turns on editor.autoIndent and editor.formatOnType for MPRX. Other editors use the server.

Upgrading

Nothing has to change. Move @valancex/mesh-runtime, @valancex/mesh-compiler and @valancex/mesh-lsp to ^0.12.0 together (before 1.0 a minor is a new range) to get formatting; templates, manifests and programs compiled with 0.11 mean the same under 0.12.

To format from an editor that is not VS Code, ask the server: textDocument/formatting with tabSize and insertSpaces in options (manual).

Compatibility

  • Additive. Three new LSP capabilities (documentFormattingProvider, documentRangeFormattingProvider, documentOnTypeFormattingProvider) in initialize's result. A client that does not use them is unaffected.
  • Rust. A new workspace crate, mesh-format (format, format_edits, format_range_edits, indent_for_line, Options, Edit, Error); mesh-lsp depends on it. No existing crate's API changes.
  • npm. All packages move to 0.12.0 together; compileProgram, render and the other entries are unchanged.
  • No diagnostics change.

Stability

mesh-format's guarantee (only whitespace between tokens changes) and the three requests are stable on release. What the layout looks like (one attribute per line in a multi-line tag; blank lines collapsed; text with content never re-indented) can be refined in a later minor, always within that guarantee, and the changelog will say so.

Verification

cargo test --workspace (934 tests), cargo clippy --workspace --all-targets, cargo fmt --check, cargo doc with warnings as errors; mesh-format's 18 tests (layout, tabs, idempotence, selection, every valid example and fixture formats and stays formatted, indentation on Enter); the protocol tests for the three requests; the editor's indentation-rule tests.