svelte icon indicating copy to clipboard operation
svelte copied to clipboard

replace examples page

Open Rich-Harris opened this issue 2 years ago • 5 comments

per https://github.com/sveltejs/svelte/pull/8578#issuecomment-1569083255

Rich-Harris avatar May 31 '23 15:05 Rich-Harris

Vercel build is failing because the examples page never linked to the /blog example. it is only for the REPL embed on the blog post its referring to. Maybe add an image for it or filter it out in lib/server/examples/index.js?

PuruVJ avatar May 31 '23 15:05 PuruVJ

So if I understand correctly, this keeps the examples, but changes the navigation so that there's a page listing all of them and then you click it and it takes you to just that example?

I kind of think that having the examples in the left pane as we do now is really nice for navigating between examples. Having to click back to a separate page to navigate to a different example adds extra steps. But I would probably remove the thumbnails from the current left nav as they don't add much and mean that the left nav is far less compact.

benmccann avatar May 31 '23 15:05 benmccann

It's just really weird and pointless to have /examples/hello-world and /repl/hello-world be basically identical except for the fact that the /examples page has less space and you can't save any changes you make. If we care that much about not having to navigate between pages, then incorporating the menu on /repl (but collapsible) would make more sense, I think.

Also, I forgot dark mode exists.

Rich-Harris avatar May 31 '23 15:05 Rich-Harris

TBH I agree with Ben. Examples page is very convenient in its current form, and I can browse all examples as well as trying out stuff. This PR adds an extra step to an already convenient page. I suggest keeping it as is, barring some style tweaks if you want to

PuruVJ avatar Jun 01 '23 16:06 PuruVJ

A concept we discussed on Discord was including a dropdown menu:

examples

I think at that point we could possibly combine the REPL and Examples into a Playground or something along those lines. My main concern would be dumping people into the REPL and feeling a bit lost whereas the Examples provide a nice jumping off point. I wonder if a left bar like we have in the Examples now might make a bit more sense from that perspective, but maybe with some tweaks like reduced margin, no images, and being collapsible so that it doesn't take up too much space and be too distracting for just straight REPL users. We could then have it expanded by default if you just visit svelte.dev/playground, but collapsed if you visit a specific saved REPL like svelte.dev/playground/5e140076757c4a9cab98628fff08d9cd?version=3.59.1

benmccann avatar Jun 11 '23 21:06 benmccann