Skip to content

fix(all): recompile dependents on signature change in watch - #5084

Merged
MangelMaxime merged 1 commit into
mainfrom
fix/watch-dependencies
Oct 15, 2026
Merged

MangelMaxime merged 1 commit into
mainfrom
fix/watch-dependencies

Conversation

@MangelMaxime

Copy link
Copy Markdown
Member

Reproduction (Fable 5.21)

  1. Two files, Lib.fs then Main.fs:

    // Lib.fs
    module Lib
    type R = { A: int; B: string }
    // Main.fs
    module Main
    let r = { Lib.A = 1; Lib.B = "x" }
  2. Run dotnet fable --watch. Main.js contains new R(1, "x").

  3. Edit only Lib.fs: swap the fields to { B: string; A: int }. Save.

  4. Fable recompiles Lib.fs only. Main.js still contains new R(1, "x") while the constructor now expects (B, A), so at runtime r.B is 1 and r.A is "x". A fresh dotnet fable gives the correct new R("x", 1).

The same steps with other edits to Lib.fs leave Main.js stale in the same way: changing an enum case value or a [<Literal>] used in Main.fs keeps the old constant, and changing a function's return type keeps the old string x replacement. If Main.fs also happens to call a method of Lib.fs, the overload suffix registers a dependency for the whole file and everything comes out right, which is why this stayed hidden.

Measurements

Watch cycles on tests/Js/Main, before vs after:

Edit Before After
Body-only edit in Util/Util.fs 1.5s 1.4s, no signature pass
Body-only edit in a leaf test file 0.33s 0.33s
New function added to Util/Util.fs 1.4s, 3 files, dependents stale 3.0s, 24 files, correct

@MangelMaxime MangelMaxime changed the title fix(cli): recompile dependents on signature change in watch fix(all): recompile dependents on signature change in watch Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Python Type Checking Results (Pyright)

Metric Value
Total errors 36
Files with errors 5
Excluded files 4
New errors ❌ Yes

⚠️ New Files with Errors

These files are NOT in the exclude list and must be fixed or added to pyrightconfig.ci.json:

File Errors Status
temp/tests/Python/fable_modules/thoth_json_core/codec.py 2 ⚠️ NEW
Excluded files with errors (4 files)

These files have known type errors and are excluded from CI. Remove from pyrightconfig.ci.json as errors are fixed.

File Errors Status
temp/tests/Python/test_hash_set.py 18 Excluded
temp/tests/Python/test_applicative.py 12 Excluded
temp/tests/Python/test_nested_and_recursive_pattern.py 2 Excluded
temp/tests/Python/fable_modules/thoth_json_python/encode.py 2 Excluded

@MangelMaxime
MangelMaxime merged commit 87fc89f into main Oct 15, 2026
50 of 52 checks passed
@MangelMaxime
MangelMaxime deleted the fix/watch-dependencies branch October 15, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant