repl icon indicating copy to clipboard operation
repl copied to clipboard

Componentize REPL

Open alfonsogarciacaro opened this issue 7 years ago • 2 comments

Continuation of https://github.com/fable-compiler/repl-legacy/issues/42

I renamed the repositories. @citymeterio It's probably better if you remove your local copy and clone fable-compiler/repl again.

We should write down a plan to make it easier to embed the REPL in other webs. These are the different parts composing the REPL currently, should all go into the package or only some of them?

  • F# compiler + Fable bundle: This is generated in the Fable CI server (AppVeyor)
  • Worker: prevents locking the UI and contains some helpers to communicate with the Fable bundle
  • Metadata + Fable REPL library: The REPL needs to load several netstandard dlls to compile F# code
  • Monaco integration: Tooltip, go to definition, autocompletion... providers
  • UI

alfonsogarciacaro avatar Nov 06 '18 09:11 alfonsogarciacaro

* F# compiler + Fable bundle: This is generated in the Fable CI server (AppVeyor)

I think the current way of doing is fine for now. We can already think that the REPL is a client of these features.

* Worker: prevents locking the UI and contains some helpers to communicate with the Fable bundle

We should be able to compile the Worker project and become a client of it ourself. Its mean replace this line to include the JavaScript lib or something like that and not the fsproj file.

* Metadata + Fable REPL library: The REPL needs to load several netstandard dlls to compile F# code

I think we are doing that part in the worker code no ? If yes, I think we should stick with encouraging the user to user the worker. But we should make it "easy" to extends the dlls loaded and pre-compiled libraries so people can customize their env.

* Monaco integration: Tooltip, go to definition, autocompletion... providers

We should make it an Elmish or React components. That's focus on the current F# tab editor only.

* UI

Not much to do here as the UI is unique per application, for me it's the user code responsible of that.


I would like to complete some features in the REPL before creating the components version because I am cleaning some part of it.

MangelMaxime avatar Nov 06 '18 10:11 MangelMaxime

You're right. We should provide a Worker component that handles all Fable bundle + .dll loading for the user, so they just need to communicate with it through messages (we can provide the Shared.fs file). Generating the .dlls and the precompiled library is a bit complicated, so for now I would make this transparent to the user.

I guess we should also add the version number to the worker file name to prevent browser caching when users update the version.

alfonsogarciacaro avatar Nov 07 '18 10:11 alfonsogarciacaro