-
Notifications
You must be signed in to change notification settings - Fork 123
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
Svelte REPL PermaSharing. #446
Comments
On my quest to find the source code for the Svelte5 REPL I ended up here. I think this issue can be closed now? https://svelte-5-preview.vercel.app/ stores state in the hash. |
https://svelte-5-preview.vercel.app/ is temporary and will go away when Svelte 5 is launched |
There's an open question about what the nature of the more permanent REPL for Svelte 5 will be. There are definitely benefits to encoding the whole thing in the URL (permalinks, no database), but the Svelte 4 mechanism also has benefits. If we could come up with a good way to combine these two (maybe default to automatically creating hash fragment permalinks, but let the user save/overwrite a given version in the database?), then that would be nice. |
There have been issues raised about sharing REPL contents. Currently REPL sharing relies on the author ideally forking their REPL and not deleting it or modifying it at some point in future.
#339 Encapsulated URL Sharing
#113 Changing content if not forked
I got the idea from Shawn Wang @swyx, where he was talking about using the URL for state management. I thought this might be a great way to share Svelte REPL code without server storage requirements, and the content would be permanent rather than relying on author keeping the code unmodified and available. In fact it would mean less server requirements as the forking would be less. It could also be possible to run the generated link through a shortener service to make it's length more reasonable. However this may limit the permanence factor relying on another service.
The general idea would be during onMount of the REPL, it would look for
data
andname
params in the URL, and if present loads that data instead of the stock hello world.To give live illustration of the premise is tough. This is because services such as the Svelte REPL itself, Stackblitz etc make it hard to see/change the URL. The code represents a bare bones proof of concept, and talking point on whether is worthwhile to pursue a PR.
If you wanted to run the code you can fork it here
https://github.com/cycle4passion/https---github.com-cycle4passion-svelte-repl-permashare
but you can get the idea with this.
The text was updated successfully, but these errors were encountered: