Skip to content

Upgrade to Svelte 5 #1066

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

Merged
merged 17 commits into from
Mar 7, 2025
Merged

Upgrade to Svelte 5 #1066

merged 17 commits into from
Mar 7, 2025

Conversation

FyreByrd
Copy link

@FyreByrd FyreByrd commented Jan 30, 2025

Upgraded project to use latest version of Svelte.
Upgraded a few other libraries

  • Will need to wait another month-ish to upgrade Tailwind/DaisyUI
  • svelte-flatpickr has broken peer dependency on Svelte < 5, and does not appear to be upgraded anytime soon

Copy link
Member

@chrisvire chrisvire left a comment

Choose a reason for hiding this comment

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

I see changes in here that are not related to "Upgrade to Svelte 5". I believe it is important to only include the changes related to the upgrade. This will be important looking back at the changes later.

@FyreByrd
Copy link
Author

FyreByrd commented Feb 3, 2025

I see changes in here that are not related to "Upgrade to Svelte 5". I believe it is important to only include the changes related to the upgrade. This will be important looking back at the changes later.

I have updated the branch to just have the Svelte 5 changes, with a few exceptions:

  • I upgraded all the rest of our frontend dependencies to make sure they all work with Svelte 5
  • I replaced some instances of stores with the $state rune

@FyreByrd
Copy link
Author

As of right now, I have two possible fixes for the flatpickr issue.

svelte-flatpickr-plus

branch: https://github.com/sillsdev/appbuilder-portal/tree/fix/flatpickr

Has some peer dependency warnings because the library also includes the dependencies for the documentation website.

Pikaday

branch: https://github.com/sillsdev/appbuilder-portal/tree/fix/use-pikaday

Isn't the prettiest, but I was able to finagle it to work for our use case for now. Part of the reason for this one is that the next major version of DaisyUI has styling for this library.

FyreByrd added 15 commits March 5, 2025 13:27
This was done to ensure that all our dependencies work with Svelte 5.
svelte-flatpickr has a broken peer dependency, but appears to otherwise work.

Note: TailwindCSS and DaisyUI have new major versions in about a month.
BullMQAdapter is in fact the correct adapter since we are using bullmq, not bull

This was to solve an issue that may have been introduced by upgrading all the dependencies.
This was not an issue before Svelte 5. My assumption is that it has something to do with how Svelte 5 uses Proxies for deep reactivity.
@FyreByrd
Copy link
Author

FyreByrd commented Mar 5, 2025

Fixed merge conflicts

Copy link
Member

@chrisvire chrisvire left a comment

Choose a reason for hiding this comment

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

👍

icon,
width,
tooltip = '',
class: classes = ''
Copy link
Member

Choose a reason for hiding this comment

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

Why class vs classes?

Copy link
Author

Choose a reason for hiding this comment

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

I kept the original prop name from before the Svelte 5 upgrade. In both Svelte 4 and Svelte 5 it is an error to have a prop directly named class, probably because it is a reserved keyword in JS/TS

@FyreByrd FyreByrd merged commit eb12350 into feature/svelte Mar 7, 2025
2 checks passed
@FyreByrd FyreByrd deleted the upgrade/svelte-5 branch March 7, 2025 14:16
FyreByrd added a commit that referenced this pull request Apr 23, 2025
* Trivial changes from migration

* Fix imports

* Handle migration-tasks

* Remove all svelte/legacy

* Migrate some components/pages that failed earlier

* Upgrade some packages

This was done to ensure that all our dependencies work with Svelte 5.
svelte-flatpickr has a broken peer dependency, but appears to otherwise work.

Note: TailwindCSS and DaisyUI have new major versions in about a month.

* Use BullMQAdapter

BullMQAdapter is in fact the correct adapter since we are using bullmq, not bull

This was to solve an issue that may have been introduced by upgrading all the dependencies.

* Use snippets for Pagination component

* Replace writable with $state

* Remove erroneous $state()

* Add peer-dependency override for svelte-flatpickr

* Fix package-lock for platform-specific deps

This bug cause the issue: npm/cli#4828

* Fix infinite loop bug in SortTable

This was not an issue before Svelte 5. My assumption is that it has something to do with how Svelte 5 uses Proxies for deep reactivity.

* Fix styling on LanguageCodeTypeahead

* Fix pagination for Svelte 5

* Fix infinite loop bug for user invite

* Change user invite button style
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.

2 participants