Skip to content

Conversation

@peterpeterparker
Copy link
Member

@peterpeterparker peterpeterparker commented Dec 10, 2024

Motivation

We want to use the most recent tools, but we also want to avoid being left behind, notably in terms of security. For example, SvelteKit is going to patch a minor issue with cookies only in a future version. That's why we are migrating to Svelte v5.

Notes

This PR updates the dependencies and makes the required configuration changes. No components are migrated since Svelte v5 is backward compatible with how Svelte v4 is composed.

Changes - App

  • Bump Svelte v5 and related dependencies
  • Set peer as Svelte v5

Changes - Tests

  • Bump Svelte Testing library
  • Mock ResizeObserver and element.animate required by Svelte v5
  • Update tests using $on and $set as documented https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes
  • Rename test files having to use $state for test purpose because "rune is only available inside .svelte and .svelte.js/ts files"
  • Remove svelte/internal config overwrite ("Your application, or one of its dependencies, imported from 'svelte/internal', which was a private module used by Svelte 4 components that no longer exists in Svelte 5.")

Changes - Screenshots

  • The popover screenshots are modified because on main the code snippet of the targeted page was actually not rendered correctly. A new line was missing and the type of the property export let button: HTMLButtonElement | undefined was not rendered. I did not managed to fix that on main.

@peterpeterparker peterpeterparker requested review from a team as code owners December 10, 2024 05:40
@peterpeterparker peterpeterparker marked this pull request as draft December 10, 2024 05:44
peterpeterparker added a commit that referenced this pull request Dec 10, 2024
# Motivation

Svelte v5 appears to add `<!---->` comments in the DOM when rendering
deprecated `slot` elements. As a result, the tooltip tests that read
HTML to compare text would not be compatible.

# Notes

Related to PR #548.

# Changes

- Replace usage of `innerHTML` to compare text in the `Tooltip` test
with `textContent`.
@peterpeterparker peterpeterparker marked this pull request as ready for review December 11, 2024 06:03
@peterpeterparker peterpeterparker marked this pull request as draft December 11, 2024 06:03
peterpeterparker added a commit that referenced this pull request Dec 17, 2024
# Motivation

Using an `$on` callback for testing is deprecated in Svelte v5 (PR
#548). Instead, we will now use the `events` option of `render`, which
itself will eventually be replaced by the library. To minimize changes
in the Svelte v5 PR, we refactored the test to use a utility function
that handles rendering and event binding.

# Changes

- Introduce and use `renderWithEvents` utilitiy.

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
@peterpeterparker peterpeterparker marked this pull request as ready for review March 3, 2025 06:39
@peterpeterparker peterpeterparker marked this pull request as draft March 3, 2025 06:39
@peterpeterparker peterpeterparker marked this pull request as ready for review March 24, 2025 05:46
@peterpeterparker peterpeterparker changed the title build: svelte v5 (without components migration) build: svelte v5 Mar 24, 2025
Copy link
Contributor

@mstrasinskis mstrasinskis left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@peterpeterparker peterpeterparker merged commit b7303bf into main Mar 24, 2025
12 checks passed
@peterpeterparker peterpeterparker deleted the build/svelte-v5-libs branch March 24, 2025 15:19
peterpeterparker added a commit that referenced this pull request Mar 24, 2025
# Motivation

We want to release a major version to rollout the migration to Svelte v5
(#548).

# Changes

- Bump `v6.0.0`
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