kit icon indicating copy to clipboard operation
kit copied to clipboard

The best 'hello world' you've ever seen

Open Rich-Harris opened this issue 6 years ago • 7 comments

The page you're greeted with when you first do npm run dev -- --open on your first npm init svelte project should serve several purposes:

  • it should look slick and beautiful and give you confidence that this is a well-built product crafted by people who care about well-designed user and developer experiences
  • it should give you very clear 'what now?' instructions, like 'edit src/routes/index.svelte' and 'visit https://svelte.dev to learn how to build Svelte apps'
  • it should give you some idea about the project structure (e.g. it could have an additional route, because otherwise you're left asking 'why is my App.svelte now called src/routes/index.svelte?')
  • it should demonstrate interactivity, rather than just being something you could have done with static HTML
  • it should elicit joy and delight, the way GREAT SUCCESS did, except without a) getting people riled up or b) being something that grates after a while
  • it should make other framework authors jealous

At the same time, if you're experienced with SvelteKit, it should be very quick and easy to remove the starter files to get started with your own stuff, so there shouldn't be too many routes/components/static assets.

Rich-Harris avatar Oct 29 '20 04:10 Rich-Harris

I think in terms of a "slick" experience that incites jealousy:

  • [ ] An SVG draw animation for the Svelte logo (demoing easing/transitions/svg)
  • [ ] Dark/Light mode switch (demoing a component file/css variables/reactivity)
  • [ ] Data fetching example
  • [ ] A pure SSG page
  • [ ] robots.txt / sitemap.xml (demoing serving of such files from "server routes")

I do find it (very slightly) annoying deleting the blog + pages + nav when I make a Sapper bug repro or similar, so perhaps a cli flag to create the demo project without the "skeleton app" files for people who have done this before.

antony avatar Oct 29 '20 09:10 antony

A flag to spit out just a skeleton directory structure would be great. A --template flag would be even better. Another option may be a CLI command that cleanly removes any cruft.

Jayphen avatar Nov 03 '20 10:11 Jayphen

A flag to spit out just a skeleton directory structure would be great. A --template flag would be even better. Another option may be a CLI command that cleanly removes any cruft.

Since we have create-svelte, I think it should be part of that setup wizard. The first question could be something like "Scaffold example app?".

dummdidumm avatar Nov 03 '20 10:11 dummdidumm

A template corresponding to the new Renderings. #244 Again figma svelte-template. As of now and as said above it's a bit hard for me to guess how much boilerplate you'll want to deliver. So I decided to move on with what I know so far ;-)

vedam avatar Dec 15 '20 13:12 vedam

@Rich-Harris Are you still considering this issue from Dec 2020 in the current roadmap? If it's the case, I would love to help 🙂

rafaelcamaram avatar Apr 07 '21 23:04 rafaelcamaram

Closing this now that we have https://netlify.demo.svelte.dev (the todos app is a little wonky due to a problem with the API, but there's a separate issue to look into that https://github.com/sveltejs/api.svelte.dev/issues/8)

Rich-Harris avatar Apr 19 '21 13:04 Rich-Harris

In case it's unintentional - netlify.demo.svelte.dev doesn't load.

braebo avatar Aug 12 '22 18:08 braebo