Vale in the browser
v3.26.0 is the first release that ships Vale as a WebAssembly module. It's the same engine as the CLI, built for a JavaScript host: a browser, a browser extension, or Node. It runs with no server and no filesystem.
Each release now includes vale_3.26.0_wasm.tar.gz, which holds vale.wasm and the wasm_exec.js loader that matches it. The host passes the .vale.ini as a string and loads styles, vocabularies, and packages into an in-memory filesystem. Vale then lints:
- Markdown, MDX, MyST, Quarto, Org, HTML, and plain text, natively.
- YAML, JSON, and TOML, through Views.
- AsciiDoc, XML, and any other converted format whose HTML the host produces with a JavaScript converter.
ValeConverterOptionsreturns the arguments that make that HTML match what the CLI would produce.
ValeSuggest resolves an alert's fixes, and ValeResolveConfig reports which rules each section turns on, turns off, or changes the level of. Source-code linting needs tree-sitter, which uses CGo, so it stays CLI-only.
See the WebAssembly docs for the full API.
Thank you, FLOSS/fund
Vale received a $10,000 grant from FLOSS/fund to support Vale's expansion to the web. Grants like this keep Vale free and independent. Thank you to FLOSS/fund for supporting open-source infrastructure.
Changelog
- e2d4374 fix: Create bin/ before copying the wasm loader into it
- 0897e7f fix: A sentence or title capitalization rule no longer slows with each exception
- 8b9bfb9 feat: Resolve a configuration in the browser build
- bd1c0ba fix: An ignored class covers an image's alt text
- 305eba3 feat: string-config and in-memory entry points
- 8e5de35 feat: A Config reads its assets through a filesystem of its own
- 9eeba2d fix: Run a
Transformstylesheet with no network, writes, or directories - 0f91a65 feat: Lint a converted format in the browser from the host's HTML
- cb27bde feat: Build Vale for the browser