feat(svelte5): incorporate Svelte 5 support into main entry point #375
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.
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
andSvelte5TestingLibrary
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:
mount(Component)
instead ofnew Component()
unmount(component)
instead ofcomponent.$destroy
$state
signal for props instead ofcomponent.$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 acore
module that provides a facade over the Svelte render differences listed above.Status
BlockedWorking in Jest - CallcompileModule
for.svelte.js
files in Svelte 5 svelteness/svelte-jester#282