repl icon indicating copy to clipboard operation
repl copied to clipboard

Ideas to improve the REPL

Open alfonsogarciacaro opened this issue 7 years ago • 6 comments

  • Let the user save multiple samples with different names in browser storage

  • Let users easily share snippets like http://fssnip.net/ (requires a server)

  • Enable tutorials that go step by step and change the code in the REPL.

  • Make it easy to embed the repl in other sites (so people can make their own tutorials).

This should be already possible with an iframe, and I also made it so the full repl won't be reloaded on hash changes (this could be a way to paste new code in the repl), but I guess we need a query parameter to disable some editors to fit the repl in a smaller size.

alfonsogarciacaro avatar Aug 03 '18 21:08 alfonsogarciacaro

Let the user save multiple samples with different names in browser storage

Should be doable by adding a new section in the sidebar. We need to think about it because it isn't easy to show lot of info in the sidebar and perhaps we will need a modal to offer good UX to choose, clean the info in storage.

Let users easily share snippets like http://fssnip.net/ (requires a server)

This is probably doable even by using free ressource like Firebase functions. From what I understand firebase free plan is pretty generous.

Make it easy to embed the repl in other sites (so people can make their own tutorials).

I think for this one we should think in the other direction. If we create the REPL as an Elmish component then even the officiel "Fable repl" site would be a consumer of the REPL components.

I think we could offer several components like:

  • an editor that's integrate with FCS for intellisense and so
  • explain how to trigger a build
  • a component to generate the iframe view

Like that people can pick what they need like the editor and the build trigger. But only display the output code etc.

MangelMaxime avatar Aug 04 '18 07:08 MangelMaxime

Yes, using a component was the original idea, but given that setting up the infrastructure is not trivial (worker, loading assemblies), I thought maybe an iframe was easier for now. But you're right, we should probably strive to create the component and let users configure it as much as they want :+1:

alfonsogarciacaro avatar Aug 04 '18 13:08 alfonsogarciacaro

Maybe some offline capabilities? Reloading takes too long and it downloads a lot of data. Having a service worker to cache the files might be a nice addition.

Nhowka avatar Aug 05 '18 20:08 Nhowka

That's a great idea @nhowka! I've not much experience yet with service workers, do you have any pointers? Also, is it an issue that the files are downloaded from the web worker?

alfonsogarciacaro avatar Aug 06 '18 16:08 alfonsogarciacaro

@alfonsogarciacaro I may be wrong, but I believe that the service worker can capture fetch events from everywhere. I'll make some tests and check if just creating a cache to save the requests on it is enough.

Nhowka avatar Aug 06 '18 16:08 Nhowka

Hello, some random user here. Unreal Engine support, obviously!

whitetigle avatar Oct 28 '18 00:10 whitetigle