Hi ππ» -- human being here,
I'm starting to learn WESL/WGSL/WebGPU and running into some tooling issues on my machine. It seems like there's some divergence between the most recent wesl.toml spec and the one used by wesl-js. I'm just learning about this ecosystem so I'm having to use an LLM to troubleshoot, so apologies for the slop. Clanker-generated output below:
Problem
wesl-plugin reads wesl.toml with a schema that doesn't match the official wesl-spec/WeslToml.md. Two differences:
- Top-level keys:
wesl-plugin reads edition, root, and include at the top level, whereas the spec nests them under a [package] section.
dependencies: wesl-plugin (0.6.53 through the latest 0.6.75) expects an array of strings β ["random_wgsl"] or ["auto"] β whereas the spec expects a [dependencies] table, e.g. random_wgsl = {}.
Because the formats are incompatible (TOML can't express both an array and a table for the same key, and the section layout differs), a single wesl.toml cannot satisfy both wesl-plugin and wgsl-analyzer:
- Array form β builds with Vite, but
wgsl-analyzer (v0.11.318) errors: Project discovery failed: ... invalid type: sequence, expected a map.
- Spec table form β
wgsl-analyzer is happy, but vite build fails with [wesl-plugin] ... dep.replaceAll is not a function.
The relevant code (confirmed in 0.6.75):
const depsArray = Array.isArray(dependencies) ? dependencies : [dependencies ?? "auto"];
const sanitizedDeps = autoDeps.map((dep) => dep.replaceAll("/", "_")); // assumes string deps
What I'd like
wesl-plugin to accept the spec-compliant wesl.toml format ([package] section + [dependencies] table), ideally while still accepting the current array form for backwards compatibility, so the same manifest works across the JS tooling and wgsl-analyzer/wesl-rs.
Repro
wesl@0.7.4 + wesl-plugin@0.6.53, Vite 7, with:
edition = "unstable_2025"
include = [ "./shaders/**/*.wesl" ]
root = "./shaders"
dependencies = ["random_wgsl"]
shaders/app.wesl: import random_wgsl::pcg_2u_3f;
Companion issue filed on wgsl-analyzer for the editor-side symptom: wgsl-analyzer/wgsl-analyzer#1211.
Hi ππ» -- human being here,
I'm starting to learn WESL/WGSL/WebGPU and running into some tooling issues on my machine. It seems like there's some divergence between the most recent
wesl.tomlspec and the one used bywesl-js. I'm just learning about this ecosystem so I'm having to use an LLM to troubleshoot, so apologies for the slop. Clanker-generated output below:Problem
wesl-pluginreadswesl.tomlwith a schema that doesn't match the officialwesl-spec/WeslToml.md. Two differences:wesl-pluginreadsedition,root, andincludeat the top level, whereas the spec nests them under a[package]section.dependencies:wesl-plugin(0.6.53 through the latest 0.6.75) expects an array of strings β["random_wgsl"]or["auto"]β whereas the spec expects a[dependencies]table, e.g.random_wgsl = {}.Because the formats are incompatible (TOML can't express both an array and a table for the same key, and the section layout differs), a single
wesl.tomlcannot satisfy bothwesl-pluginandwgsl-analyzer:wgsl-analyzer(v0.11.318) errors:Project discovery failed: ... invalid type: sequence, expected a map.wgsl-analyzeris happy, butvite buildfails with[wesl-plugin] ... dep.replaceAll is not a function.The relevant code (confirmed in
0.6.75):What I'd like
wesl-pluginto accept the spec-compliantwesl.tomlformat ([package]section +[dependencies]table), ideally while still accepting the current array form for backwards compatibility, so the same manifest works across the JS tooling andwgsl-analyzer/wesl-rs.Repro
wesl@0.7.4+wesl-plugin@0.6.53, Vite 7, with:shaders/app.wesl:import random_wgsl::pcg_2u_3f;Companion issue filed on
wgsl-analyzerfor the editor-side symptom: wgsl-analyzer/wgsl-analyzer#1211.