vitejs / vite

Next generation frontend tooling. It's fast!
http://vitejs.dev
MIT License
66.15k stars 5.91k forks source link

Svelte template does not support v5 preview #17609

Closed nileshtrivedi closed 6 days ago

nileshtrivedi commented 1 week ago

Describe the bug

I want to build a new project with Svelte v5 (which has reached release candidate, but not GA). npm create svelte@latest offers me the choice to try Svelte preview (i.e. v5) but this creates a Svelte Kit project which I do not want.

To create a Svelte only project, I tried npm create vite@latest (as suggested on https://svelte.dev/docs/introduction ) but this defaults to v4 and does not give me the choice to use Svelte 5 preview.

Reproduction

npm create vite@latest

Steps to reproduce

Run npm create vite@latest and notice it does not prompt me for using Svelte 5 (the way, npm create svelte@latest does) and observe package.json which uses Svelte ^4.2.18.

System Info

System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Pro
    Memory: 319.61 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.asdf/installs/nodejs/20.11.0/bin/node
    Yarn: 1.22.21 - ~/.asdf/installs/nodejs/20.11.0/bin/yarn
    npm: 10.2.4 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 9.0.6 - ~/.asdf/installs/nodejs/20.11.0/bin/pnpm
    bun: 1.0.33 - ~/.asdf/shims/bun
  Browsers:
    Chrome: 126.0.6478.127
    Safari: 17.5
  npmPackages:
    vite: ^5.3.1 => 5.3.3

Used Package Manager

npm

Logs

No response

Validations

rschristian commented 1 week ago

Run npm create vite@latest and notice it does not prompt me for using Svelte 5

Why would you expect create-vite, a framework-agnostic tool, to offer previews/beta/whatever versions per framework? I think this is expecting a bit much?

nileshtrivedi commented 1 week ago

@rschristian This is the officially recommended way of building a Svelte JS project (though their primary recommendation is to create a Svelte Kit project): https://svelte.dev/docs/introduction

And Svelte 5 reached Release Candidate more than 2 months ago: https://svelte.dev/blog/svelte-5-release-candidate

Is it unreasonable to expect to be able to actually start experimenting with Svelte5 projects with the RC release and to find and report issues, to prepare for Svelte 5 final release?

Perhaps I should rephrase this as "Support Svelte4 and Svelte5 separately" because Svelte 5 seems to be a major architectural change?

rschristian commented 1 week ago

Is it unreasonable to expect to be able to actually start experimenting with Svelte5 projects with the RC release generated via create-vite and to find and report issues, to prepare for Svelte 5 final release?

I'm no maintainer here, but yes, I would say so. Pending release, any support (outside the direct ecosystem) should be a pleasant surprise, far from expected -- and that goes for every lib.

Besides, it doesn't look like it's much manual work? Svelte 4 components are supported with a few exceptions?

nileshtrivedi commented 1 week ago

@rschristian The breaking changes are listed here.

I got the first page to load by making these manual changes:

But I am not sure what else might be broken.

dominikg commented 6 days ago

The steps outlined above look right to me. The svelte template in create-vite is going to be updated to svelte5 once that has a stable release.

If you have questions about svelte5 rc, please join https://svelte.dev/chat and check out https://discord.com/channels/457912077277855764/1153350350158450758