Semantic Diff

#9315 Use the top-level suffix when package-specs is missing

2 commits

a531dc3ae031fa9468e2825dfc32bafe76178169..pr-9315

560c47625 · cknitt + Claude · Nov 17, 2026, 19:51 UTC

Use the top-level suffix for the default package spec

Why

Without "package-specs", the build used a default spec with its own suffix ".js", so a top-level "suffix" was ignored with no warning. The default spec now has no suffix of its own and falls back to the top-level one, like an explicit spec without "suffix" does. Fixes #9312.

modifiedConfig default package spec, Config.decode_package_specs

representation
Before
After
{"suffix": ".res.mjs"} ↦ src/Main.js{"suffix": ".res.mjs"} ↦ src/Main.res.mjs{} ↦ src/Main.js{} ↦ src/Main.js

Review

  • Was ".js" deliberate? No. The Rust build system had the same hard-coded default since its first version, and the OCaml port kept it with a test that pinned it. That test now expects the top-level suffix.
a6694b754 · cknitt + Claude · Nov 17, 2026, 20:07 UTC

Update the build system tests for the default spec suffix

Two tests set a top-level suffix without package-specs and expected .js. The gentype/explicit-suffix snapshot now shows .mjs output, matching its genType imports. The focused dependency test now expects .mjs for the root and its dependency, which sets ".cjs" of its own. A new package-specs case covers the default spec on its own.