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

Svelte template does not support v5 preview #17609

Closed
7 tasks done
nileshtrivedi opened this issue Jul 3, 2024 · 5 comments
Closed
7 tasks done

Svelte template does not support v5 preview #17609

nileshtrivedi opened this issue Jul 3, 2024 · 5 comments

Comments

@nileshtrivedi
Copy link

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
Copy link
Contributor

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
Copy link
Author

nileshtrivedi commented Jul 7, 2024

@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
Copy link
Contributor

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
Copy link
Author

@rschristian The breaking changes are listed here.

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

  • Create a Svelte 4 project with npm create vite@latest
  • Change dependency versions in package.json:
"@sveltejs/vite-plugin-svelte": "4.0.0-next.3",
"svelte": "5.0.0-next.175",
  • In main.js, use mount(App, {}) rather than new App({}).

But I am not sure what else might be broken.

@dominikg
Copy link
Contributor

dominikg commented Jul 8, 2024

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

@dominikg dominikg closed this as not planned Won't fix, can't repro, duplicate, stale Jul 8, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants