fable-compiler / repl-legacy

http://fable.io/repl
MIT License
14 stars 10 forks source link

Save/Load state (code&html) from localStorage/urlQuery #23

Closed alfonsogarciacaro closed 6 years ago

alfonsogarciacaro commented 6 years ago

This PR adds the capability to save/load F# code (including HTML) from Browser localStorage or URL query. It also fixes other issues. @MangelMaxime For simplicity, I just copied the JS code from current REPL so there's no navigation management with Elmish.

With this we should be able to replace the old REPL :muscle: I haven't moved the compiler to a worker, but at least in my computer the performance is not bad. If possible, please give it a try and tell me what you think.

MangelMaxime commented 6 years ago

Thanks for the changes I will test it today.

For the performance, you don't have freeze anymore ? Because, I was having it with previous version of this repo and some people complain too about it.

alfonsogarciacaro commented 6 years ago

Sorry, I couldn't resist the urge to share it, it's published now 😅

About performance, it's not 100% fluid, but I can write more or less without problems. I guess in less powerful machines and other browsers there may be problems, let's see what people say.

MangelMaxime commented 6 years ago

No problem :D

For info, I cleaned the old branches because we were having a mess of them :)

MangelMaxime commented 6 years ago

Ah, and you didn't publish over the gh-pages ? Just asking because you said:

let's see what people say.

alfonsogarciacaro commented 6 years ago

Ah, I copied it directly to fable.io/repl and forgot to update fable.io/fable-repl, it should be fixed now. Hmm, there's a problem when sharing long scripts as they hit the URL length limit, we'll have to implement the server to store people's scripts so they can be shared.

MangelMaxime commented 6 years ago

Implementing the server should also allow us to fix Edge support. Or any browser which have a limited support of the glob urls