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

feat(svelte5): incorporate Svelte 5 support into main entry point #375

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

mcous
Copy link
Collaborator

@mcous mcous commented May 14, 2024

Overview

Given that Svelte 5 has reached RC status, this PR incorporates Svelte 5 support back into the main index.js export while continuing to support Svelte 3 and 4.

Changes

This PR takes @yanick's SvelteTestingLibrary and Svelte5TestingLibrary idea, but switches the behavior modification from from a "is a" dependency model to a "has a" dependency model.

For our library's needs, the differences between Svelte 4 and 5 are small:

  • "render" - Call mount(Component) instead of new Component()
  • "cleanup" - Call unmount(component) instead of component.$destroy
  • "update props" - Use a $state signal for props instead of component.$set

svelte-testing-library layers on testing-library and public API niceties, which are common to all Svelte versions. Rather than including both the public API layer and the underlying render implementation in a pair of classes, the public API has been reworked back into set of exported functions. Those functions now have access to methods from a core module that provides a facade over the Svelte render differences listed above.

Status

@mcous mcous requested a review from yanick May 14, 2024 16:11
src/core-legacy.js Outdated Show resolved Hide resolved
@mcous mcous changed the base branch from svelte5-no-legacy to main May 15, 2024 19:29
@mcous mcous force-pushed the testing-core-mod branch 3 times, most recently from 7a4da48 to 8b5b8a5 Compare May 15, 2024 20:00
@mcous mcous removed the request for review from yanick May 15, 2024 20:00
@mcous mcous changed the base branch from main to next June 2, 2024 17:08
@mcous mcous force-pushed the testing-core-mod branch 8 times, most recently from 70f6d81 to 18b118b Compare June 9, 2024 19:02
@mcous mcous marked this pull request as ready for review June 9, 2024 19:03
@mcous mcous force-pushed the testing-core-mod branch from 18b118b to 87e46a6 Compare June 16, 2024 17:53
@mcous mcous force-pushed the testing-core-mod branch from 87e46a6 to ba6f67f Compare June 19, 2024 18:26
@mcous mcous force-pushed the testing-core-mod branch from ba6f67f to 6533bb3 Compare June 19, 2024 18:31
@mcous mcous merged commit 9dce164 into next Jun 20, 2024
24 checks passed
@mcous mcous deleted the testing-core-mod branch June 20, 2024 15:17
Copy link

🎉 This PR is included in version 5.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant