-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-compile deleted files after project changes in watch mode #3684
Re-compile deleted files after project changes in watch mode #3684
Conversation
Thank you for the PR. I took some time to look why The new cache mechanism is a bit more agressive in the sense that if it sees Fable compiled with In the past, it was working because Fable was much less agressive but this is what leads to some scenario where you would see several version of the same library inside of I tried to adapt the new cache system to detect when Fable triggers the process from watching the fsproj changes but in the end we still end up in the state where Fable consider the cache invalid meaning that we probably need to clean it. Because I think that the files are kept in memory inside of Fable or FCS, recompiled the whole If we need to revisit this problem in the future here are the places where we need to look:
|
@OrfeasZ @MangelMaxime thanks for the PR. I've tested it with my project and encountered an issue with import { Union, Record } from "../fable-library.4.10.0/Types.js";
import { union_type, record_type, class_type, int32_type, string_type } from "../fable-library.4.10.0/Reflection.js";
import { remove, add, tryFind, empty } from "../fable-library.4.10.0/Map.js";
import { comparePrimitives } from "../fable-library.4.10.0/Util.js";
import { some, map, defaultArg } from "../fable-library.4.10.0/Option.js";
import { PromiseBuilder__Delay_62FBFDE1, PromiseBuilder__Run_212F1D4B } from "../Fable.Promise.3.2.0/Promise.fs.js";
import { promise } from "../Fable.Promise.3.2.0/PromiseImpl.fs.js";
import { Cmd_none, Cmd_OfPromise_either } from "../Fable.Elmish.4.1.0/cmd.fs.js";
import { singleton } from "../fable-library.4.10.0/List.js"; However, after any changes to the import { Union, Record } from "../demo/fable_modules/fable-library.4.1.3/Types.js";
import { union_type, record_type, class_type, int32_type, string_type } from "../demo/fable_modules/fable-library.4.1.3/Reflection.js";
import { remove, tryFind, add, empty } from "../demo/fable_modules/fable-library.4.1.3/Map.js";
import { comparePrimitives } from "../demo/fable_modules/fable-library.4.1.3/Util.js";
import { some, map, defaultArg } from "../demo/fable_modules/fable-library.4.1.3/Option.js";
import { Cmd_none, Cmd_OfPromise_either } from "../demo/fable_modules/Fable.Elmish.4.0.1/cmd.fs.js";
import { PromiseBuilder__Delay_62FBFDE1, PromiseBuilder__Run_212F1D4B } from "../demo/fable_modules/Fable.Promise.3.2.0/Promise.fs.js";
import { promise } from "../demo/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js";
import { singleton } from "../demo/fable_modules/fable-library.4.1.3/List.js"; Additionally, the corresponding |
Hello @lukaszkrzywizna, The imports being incorrect is because I included the generated Fable files in the package. I believe the I released version 2.1.0 of |
@MangelMaxime It works. Big thanks 🙇 |
This is a fix for issue #3641, where Fable (in watch mode) will delete the files in
fable_modules
after a watched project file (.fsproj
) changes, but won't recompile them after populating them again.I'm not sure if this is the best way to do this, since @MangelMaxime mentioned that it might be better to not delete these files to begin with instead, but I did notice there was a
TODO
around this code so decided to implement it this way instead.