How to organize large fable project

Hello there,

I’m planning to add fable my full js project (nodejs + react). After reading a lot about other compile to js languages, I think f# with fable is one of the best, but one thing that bugs me a lot is the compilation speed.

With small projects fable works great, but fearing another typescript I put fable in stress. Here’s the example repo:

This has about 100.000 lines of example code. Of course, it’s not going to be easy parsing, but I expected some sort of incremental compilation. Any changes take 80s to recompile.

I did try to reduce the project to 17.000 lines of code, more realistic, splitted in three projects. Takes around 10s per file change, which I’d like to reduce to 5s at maximum.

How do companies with large fable codebases deal with this? Is there some sort of .fsproj magic that can help reduce compile times? Should every project have at maximum 5k lines of code? I don’t know dotnet enough to answer these questions, so any feedback would be really welcome.

Not really got advice on reducing compile times, but I’ve tested out how quickly webpack-dev-server recompiles a large-ish real-world Fable project on my machine, which might be more useful for realistic benchmarks.

  • Large-ish: ~6k LOC in project shared between client and server and ~14k in the client project
  • Real-world: built by Compositional IT - the company I work for - for a client

The recompilation speed seems to vary depending on how deep in the dependency tree the file is:

  • Lots of other files depending on the changed file (from either project): 10-20s
  • Last file in the client project (not required by any other files): 2-3s

Timings from me adding/removing blank lines and watching the clock.