sites icon indicating copy to clipboard operation
sites copied to clipboard

REPL: Optional human-readable slugs as permalink URLs

Open rmunn opened this issue 3 years ago • 0 comments

By now, I have created quite a few REPLs as examples to link from GitHub issues or Discord chat. Some of them are one-offs, and I will eventually delete them. But others are examples I plan to keep around long-term. It would be nice to be able to link to them with some kind of human-readable permalink URL, e.g. http://example.com/svelte.dev/repl/rmunn/derived-stores-example instead of http://example.com/svelte.dev/repl/123456789abcdef123456789abcdef.

The question of where to store the permalink-to-REPL-ID mapping would, of course, have to be answered, and so far I haven't given that one any thought. I just thought that having a link name like username/slug-chosen-by-the-user would be nicer to see in Discord chat.

Combining this with the proposal at https://github.com/sveltejs/sites/issues/113#issuecomment-599312105 (appending /0, /1, /2 to the URL to keep track of different versions of the REPL) would produce quite a nice effect. A REPL permalink without a trailing /N would load the most recent version of that REPL, but if you needed to go back to a previous version (say, to show how it used to work back in Svelte 3.x but now with Svelte 3.y you can do something different), you can add /N to the link.

rmunn avatar Mar 25 '22 02:03 rmunn