Skip to content

Commit cc1e0c9

Browse files
committed
Minor clarifications
1 parent 82d0b9a commit cc1e0c9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

_blogposts/2025-11-11-reforging-build-system.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Button.res (your source code)
114114
├─ Button.mjs # JavaScript output
115115
├─ Button.cmi # Module's public API signature
116116
├─ Button.cmt # Typed AST
117-
└─ Button.cmj # Optimization metadata
117+
└─ Button.cmj # Optimization metadata (function arity, cross-module inlining)
118118
```
119119

120120
The `.cmi` file is automatically generated for every module. It acts as a contract or table of contents that describes what other modules can see and import from your module. It contains your type definitions and function signatures, but only the public ones.
@@ -160,7 +160,9 @@ But it will not contain `internalHelper` because it is not listed in the `.resi`
160160

161161
### Hash-Based Interface Stability Detection
162162

163-
To detect whether a module's interface has changed, the build system computes a hash of the `.cmi` file before and after compilation. If the hashes match, dependent modules can skip recompilation. The previous system used timestamp-based detection through Ninja's `restat` feature, which worked well for single packages but was less reliable in monorepo scenarios. The explicit hash-based approach provides consistent behaviour across package boundaries.
163+
To detect whether a module's interface has changed, the build system computes a hash of the `.cmi` file before and after compilation. If the hashes match, dependent modules can skip recompilation.
164+
165+
The previous system used timestamp-based detection through Ninja's `restat` feature, which worked well for single packages. While both approaches aim to avoid unnecessary recompilation, the explicit hash-based method provides more predictable behaviour, especially when dealing with timestamp issues across filesystems or in containerized environments. It also provides consistent behaviour across package boundaries in monorepos.
164166

165167
### Faster Module Resolution with Flat Directory Layout
166168

0 commit comments

Comments
 (0)