-
Notifications
You must be signed in to change notification settings - Fork 309
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
(fable-compiler, REPL) Incremental building for projects with multiple files #1648
Comments
A good first step towards it would be adding parse and typecheck caches (with hashed keys to reduce GC). |
If we manage to get this the next (or parallel step) would be to add support for libraries and the question would be how to resolve the package references without resorting to MSBuild (or could we communicate with it?). I mention it because Fable 2.1 will be distributed through npm so it'd be interesting to add an option to fable-loader to switch the dotnet or js compiler. However, the libraries will still be distributed through Nuget. We already tried distributing F# libraries with npm in Fable 0.7 but it didn't play very well with F# tooling. Though we could entertain again the idea if it helps fable-compiler(-js), what do you think?
|
@alfonsogarciacaro Currently the On a side-note, if you need to rename the |
Thanks! Yes, probably renaming it's a good idea 👍 The mention about packages distributed through npm was not about precompiled libraries, sorry I was not clear, just the same way as we do now (sources + .dll). I'm reluctant to distribute precompiled libraries because there may be issues when using a different compiler version. Actually, it already happened in the repl fable-compiler/repl#80 I was thinking that it could be easier to resolve package dependencies if they're in npm. But you're right, we can just get the information from projects.asset.json if necessary. Forget what I said 😸 |
I opted for simplicity and not changing the current interface. Functionality is the same, just recompile the whole project every time, if something can be reused, it will be. If you hold on to the checker, and if no source was changed, or only a few at the end, it will be much much faster the second time. There is also an explicit cache clean method, if memory pressure becomes an issue. |
@alfonsogarciacaro The next step will be to try the |
Awesome! I guess the cache is invalidated with content hashes, right? Which means it'll work both on the node app and the browser repl. |
@alfonsogarciacaro Correct, |
I edited my comment above, but you were faster to reply ;) I'll implement this in |
@alfonsogarciacaro I'm not sure what you mean by uniforming, currently |
We're starting to have many flavors of Fable & friends, sometimes with duplicated behavior (as you just mentioned for fable-compiler-js and fable-splitter) which complicates maintenance. I was thinking that maybe we could forget about the dotnet/js division (becoming blurrier) and just have components with common protocols so it's easy to combine them. We could have these main categories:
So in this view, It's work but it may save us from trouble in the future. What do you think? |
BTW, I remember the flattened structure in fable-splitter was done to avoid problems with files coming from outside the project folder. Has this been solved now? |
It was always a TODO: to come up with a better way of doing that. I think I have, and it's very minimal. It seems to work fine but it hasn't been tested on a large number of projects yet by the public. Technically it can be introduced as an alternative option in The main reason I'm not sure we can make the compiler tooling completely interchangeable with dotnet, as we're probably not going to re-implement all the features of MSBuild. There will be differences and corner cases and projects that need manual intervention to compile, but we can aim for a good percentage of the simpler F# projects, hopefully most of them are like that. |
Published as fable-compiler-js 1.0.0-alpha-001. We probably need a test project so people can quickly give it a go. |
@alfonsogarciacaro Any F#-only Fable-oriented project should do. |
Closing as the stated goal is accomplished (see above), please reopen if needed. |
As we now have a use case for potentially editing multiple files in a future version of the REPL, it would be nice if we can do incremental builds so we don't have to recompile all files every time there is a change.
Continuing the discussion from here.
The text was updated successfully, but these errors were encountered: