Skip to content
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

"Share" action for JS output? #48

Open
dsyme opened this issue Sep 26, 2018 · 8 comments
Open

"Share" action for JS output? #48

dsyme opened this issue Sep 26, 2018 · 8 comments

Comments

@dsyme
Copy link

dsyme commented Sep 26, 2018

I'm wondering if there can be some kind of "share" action for the JS output, e.g. something that brings up a dialog with a bunch of options including

  • copy and paste JS (minified?) for an embedded Iframe or straight JS
  • copy and paste a shorter snippet that embeds an iframe referring to server-hosted content

Basically anything that lets you share/embed the thing you've developed rather than the development environment.

@ncave
Copy link
Contributor

ncave commented Sep 26, 2018

Sharing through url + url shortener service or GitHubGist as back-end? Just thinking aloud.

@forki
Copy link
Contributor

forki commented Sep 26, 2018 via email

@MangelMaxime
Copy link
Member

One of the ideas I would like to explore is using the GitHub gist as a back-end because it's free.

In order to do that, we need to use the Github API and we can't do it using anonymous because the limitation is really strong. My idea is to use google cloud function free service in order to use OAuth from Github. Why google cloud function? Because their free service is really generous and I think it should be enough for our need.

By using OAuth we can ask the user to connect its GitHub account in order to make his code persistent. He can then access a history, share the Gist directly and load the REPL from it.

If we have a persistent storage somewhere, we can then create a Preview only mode where we just run the code as if it was an embedded application. And show an Edit button which allows him to import the code into the REPL with editor etc.

We still do everything on the browser no backend need except for login the GitHub account. And because we already have the compiled JS code, loading can be fast because we don't need to initialize the FCS instance to play the code.

I did some research and know that all of that should be possible if we agree on the features, make a real feature list so we all know where we go and from here choose an offer to develop the OAuth sign-in mechanism to link the GitHub account :).

Please note I don't know well cloud function hosting so I can be wrong :)

@MangelMaxime
Copy link
Member

I think there is also Azure that offers some of their services for free.

capture d ecran 2018-09-26 a 22 20 40

So depending on what we get it can be enough to do the OAuth part.

@forki
Copy link
Contributor

forki commented Sep 27, 2018 via email

@MangelMaxime
Copy link
Member

Good to know, so perhaps if we try to make a POC we can then see if this is viable and if this 150 credits can be enough. If someone accepts to host the code under their account.

@alfonsogarciacaro
Copy link
Member

I'd love to have a way so users can easily share snippets besides the built-in samples, though I'm a bit wary about trying to turn the REPL into a full-blown development platform with code distribution capabilities. This can increase maintenance efforts and distract efforts from improving the development experience with the Fable CLI tool.

That said, maybe it's not so difficult, I've been proven wrong many other times ;)

@ReedCopsey
Copy link

ReedCopsey commented Nov 27, 2018

I love the idea of gists as a storage mechanism, like #83. Would be very nice if you could store f# side (and load via url) to effectively share the environment, as well as just sharing the js output.

Gist is also nice for this since you'd get a code view that's easy to read outside of the repl as well,especially given all of the options for embedding gists, etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants