You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@anthonybailey The vast majority of the modifications were done by the migration script, and consists of prop migrations (declaring the interface type and destructuring the $props variable), rewriting variables into using $state or $derived, etc. Sometimes I compressed a variable declaration and modification in effect to a single $derived declaration, like in Banner.svelte with dismissed. Sometimes I had to initialize a variable that was not initialized, like with type in Link.svelte, since otherwise there would be an error with passing undefined to a $bindable() with fallback. LinkWithoutIcon.svelte changed a bit, since I converted the smoothScroll action into an attachment. In order to avoid svelte/legacy imports, I changed event handlers to invoke event.preventDefault() or event.stopPropagation() in places like chat/+page.svelte. In some places like CommunitiesList.svelte, I wasn't sure if a const is supposed to be reactive, but I made it $derived, since otherwise I got a warning. I also added some API response type declarations in uk-mp-contact-status.ts and uk-postcode-to-mp.ts in order to suppress some eslint warnings, which is not really relevant to the purpose of this PR, but it let me pass the checks.
We could create a svelte5 branch with the result of the script to get a diff with the manual adjustments (I personally can't atm) but not sure if that's necessary
@Wituareard Good idea. I ran the migration script on a recent version of main and uploaded it without changing anything. Here's the diff with the current version of this branch. It's much shorter (+338/-364 instead of +1203/-740) so should be easier to read.
Thanks! Are you sure about $derived in Banner.svelte? Iiuc it makes dismissed = true temporary, the same goes for hasImageError in NewsCard.svelte. The rest looks good to me, but I have yet to do proper testing
@Wituareard You are right about Banner.svelte, I misinterpreted how it's supposed to work. In NewsCard.svelte, that variable is supposed to become false every time an image link is passed, but then might be changed to true if NetlifyImage fails. So it's supposed to be temporary. But I reversed the value of the variable by mistake. The current diff is here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are still some
svelte/legacyimports that should be removed, but that can be finished later.