Skip to content

Upgrade to svelte 4 - #88

Open
homostellaris wants to merge 2 commits into
Oli8:mainfrom
homostellaris:upgrade-to-svelte-4
Open

Upgrade to svelte 4#88
homostellaris wants to merge 2 commits into
Oli8:mainfrom
homostellaris:upgrade-to-svelte-4

Conversation

@homostellaris

@homostellaris homostellaris commented Mar 8, 2024

Copy link
Copy Markdown

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.
Comment thread package.json
},
"homepage": "https://github.com/Oli8/spaper#readme",
"scripts": {
"dev": "svelte-kit dev",

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

Oli8 commented Mar 13, 2024

Copy link
Copy Markdown
Owner

Might be better/safer if I first upgrade sveltekit

@homostellaris

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

Oli8 commented Mar 13, 2024

Copy link
Copy Markdown
Owner

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

homostellaris commented Mar 13, 2024 via email

Copy link
Copy Markdown
Author

@Oli8

Oli8 commented Mar 13, 2024

Copy link
Copy Markdown
Owner

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