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

Upgrade to svelte 4 #88

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

Conversation

homostellaris
Copy link

@homostellaris homostellaris commented Mar 8, 2024

Raised a PR with the changes from running npx svelte-migrate@latest svelte-4 plus a couple of my own in package JSON (see commit messages for rationale on those).

I've no idea if this has broken anything but judging by the diff it looks very unlikely and this at least creates a branch to test - any suggestions on the best way to do this?

Obviously totally understand if this is not a priority but thought I could at least be as helpful as possible to try get this support in. If merged this would close #87.

Removed Sveltekit entirely as this is just a
component library which (hopefully) can be used
with both Svelte 3 and 4. Have Sveltekit as a
dependency raised peer dependency conflicts as
Sveltekit 2 is not compatible with Svelte 3 and
Sveltekit 1 is not compatible with Svelte 4.

Also updated a couple of other package versions to
resolve other peer dependency conflicts that arose
from updating the main package versions.
@@ -18,23 +18,19 @@
},
"homepage": "https://github.com/Oli8/spaper#readme",
"scripts": {
"dev": "svelte-kit dev",
Copy link
Owner

Choose a reason for hiding this comment

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

Those scripts are gone?

Copy link
Author

Choose a reason for hiding this comment

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

I think they're replaced with vite commands in newer versions of SvelteKit (e.g. vite dev).

But my suggestion was to remove SvelteKit entirely. I explain more in the PR description but if you remove it then you can have this as a lib that supports both Svelte 3 and 4 as a peer dependency. If you have SvelteKit as a dependency it'll only be able to support one or the other due to dependency conflicts.

@Oli8
Copy link
Owner

Oli8 commented Mar 13, 2024

Might be better/safer if I first upgrade sveltekit

@homostellaris
Copy link
Author

Might be better/safer if I first upgrade sveltekit

Just out of interest why do you need SvelteKit? It's just a Svelte component library right? So it may be used without SvelteKit or with another framework.

@Oli8
Copy link
Owner

Oli8 commented Mar 13, 2024

Might be better/safer if I first upgrade sveltekit

Just out of interest why do you need SvelteKit? It's just a Svelte component library right? So it may be used without SvelteKit or with another framework.

Sveltekit provides a great way to write svelte library
https://kit.svelte.dev/docs/packaging

Also note that currently the package.json of the repo is different from he final package.json of the packaged library, this changes in newer sveltekit version

@homostellaris
Copy link
Author

homostellaris commented Mar 13, 2024 via email

@Oli8
Copy link
Owner

Oli8 commented Mar 13, 2024

Although it's on the SvelteKit website it looks like it's just @sveltejs/package you need not @sveltejs/kit 🙂

Looks that way now but it was part of kit then

@homostellaris homostellaris marked this pull request as ready for review April 25, 2024 10:54
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.

Svelte 4 support?
2 participants