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

feat: basic svelte templates #170

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

manuel3108
Copy link
Member

@manuel3108 manuel3108 commented Oct 18, 2024

Closes #168

Notes:

tbd:

  • see why this vite-env.d.ts is renamed to vite-env.d.ts. Do we even need this file?
  • inconsistent indentation in newly create files
  • fix tests
  • ordering and help text of svelte template (and possibly other templates, to avoid confusion)
    image

Copy link

changeset-bot bot commented Oct 18, 2024

🦋 Changeset detected

Latest commit: 62cfd9f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sv Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

pkg-pr-new bot commented Oct 18, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/sveltejs/cli/sv@170

commit: 62cfd9f

@manuel3108 manuel3108 changed the title feat(DRAFT): basic svelte templates feat: basic svelte templates Oct 18, 2024
@manuel3108
Copy link
Member Author

I think the only open question here is the ordering of the templates, i have screenshotted my preferred way above. We might need to improve the hints to make the differences clearer for the user

◆ Which template would you like?
│ ● SvelteKit minimal (barebones scaffolding for your new app)
│ ○ SvelteKit demo (showcase app with a word guessing game that works without JavaScript)
│ ○ Svelte minimal (barebones scaffolding for your new app)
│ ○ Svelte library (setup with svelte-package to help correctly package your library)

Another thing might be that we should unify the kit and svelte minimal templates. But that could be done later I think.

Copy link
Member

@benmccann benmccann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I filed the issue (#168) to bring this up for discussion, I'm worried about this confusing more users than it helps and that it raises the mental overhead and number of decisions that need to be made upfront.

If we include it, I would put it last and be clear that it's not something most users should reach for.

See these types of discussions:
https://www.reddit.com/r/sveltejs/comments/110kzpw/when_should_i_use_sveltekit_and_when_should_i_use/
https://www.reddit.com/r/sveltejs/comments/tv93l2/sveltekit_or_svelte_vite/

To quote khromov from that thread:

You should pretty much always use SvelteKit.
The exception are some edge cases where you might want some type of very specific bundling behavior, or when you are embedding the Svelte application into another non-Svelte site.
For example, when building Svelte UI in a WordPress plugin you might want to get just one resulting bundle file instead of the route-optimized builds SvelteKit generates. In this case you probably also don't care about routing, so the Vite version is a good alternative.

I also saw a number of users not understanding that you can build SPAs in SvelteKit (there are a couple of issues we should solve there, but I'd rather fix those than fragment the community and cause confusion).

I also think that we should make Routify a community adder. It's not what we would recommend folks to use as SvelteKit has 200x more usage and a number of developers working on it vs just a single developer.

Part of our job here is to lead users down a happy garden path and so I think we need to be careful here

packages/create/templates/svelte/.meta.json Outdated Show resolved Hide resolved
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
@manuel3108
Copy link
Member Author

Yeah, i had in mind that you mentioned this somewhat recently somewhere. I'm happy to close this as, this was a nice experiment to understand what create-svelte is doing and how it works, so this hasn't been a waste of time in any way!

@benmccann
Copy link
Member

I don't really know what the right answer is. It could make sense, but we need to be careful around how we present it, so should probably take some time post-launch to make sure we're doing it in a way that helps makes things clearer for users. I do worry about giving people an option with no docs and then they don't know what to do with it. I think that adding a docs page to svelte.dev about when and when not to use SvelteKit and how to accomplish different goals with it (SPA, embedded app, etc.) and how to build something with plain Vite is probably the first step

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

Successfully merging this pull request may close these issues.

Basic Vite template
2 participants