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

chore: Migrate galactic-sovereign-frontend to Svelte 5 #26

Merged

Conversation

Knoblauchpilze
Copy link
Owner

@Knoblauchpilze Knoblauchpilze commented Nov 1, 2024

Work

Background

Svelte released their V5 back in April and after letting a bit of time pass it seems like a good time to migrate to this new version.

They prepared a migration guide which goes over the main changes. Notably this version brings a new way to handle reactivity. There's also a migration script available.

How did we do it?

We just used the script they provided.

How did it go?

The outcome was encouraging but we had a couple of cases where a <table> did not contain a <tbody>. There's a lengthy discussion whether this is actually good or not (see issue 9785) but in our case it does not matter too much and we fixed it.

We also have a couple of legacy behavior that the script did not manage to convert. This includes code in the StyledActionButton and in the overview and buildings page.

As this PR is already quite big we will tackle those in a follow-up.

Update:

  • The StyledActionButton legacy usage was fixed in 8c72c12.
  • Refactoring the overview and buildings pages was done in multiple steps
    • Changes to the data loading model were done in 41b3ea3 -> 39a7e04.
    • Similar modifications to the overview page were done in da52eb6.
    • The switch to use runes happened in b25a0b0.

Tests

Running the code locally still works as expected.

Future work

We also need to migrate the user-dashboard project.

Additionally a couple of improvements to the readability could be done (explaining the replacement pattern for images and apply prettier as a Makefile target): this was done in e7ff297.

@Knoblauchpilze Knoblauchpilze changed the title Feature/migrate galactic sovereign frontend to svelte 5 chore: Migrate galactic-sovereign-frontend to Svelte 5 Nov 1, 2024
@Knoblauchpilze Knoblauchpilze merged commit ae42eb5 into master Nov 2, 2024
16 checks passed
@Knoblauchpilze Knoblauchpilze deleted the feature/migrate-galactic-sovereign-frontend-to-svelte-5 branch November 2, 2024 10:01
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.

1 participant