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

[Feature]: experimental-ct-svelte Svelte 5 support - svelte/internal won't be available #30278

Open
siliconcat opened this issue Apr 7, 2024 · 2 comments · May be fixed by #34715
Open

[Feature]: experimental-ct-svelte Svelte 5 support - svelte/internal won't be available #30278

siliconcat opened this issue Apr 7, 2024 · 2 comments · May be fixed by #34715

Comments

@siliconcat
Copy link

🚀 Feature Request

I was trying to run some component tests with a Svelte 5 development version. However I see that Svelte 5 has removed the svelte/internal package that is used in the experimental-ct-svelte module. It is "internal" and not for public use, so the risk was there.

import { detach as __pwDetach, insert as __pwInsert, noop as __pwNoop } from 'svelte/internal';

This then throws the error:

RollupError: "noop" is not exported by "../../node_modules/.pnpm/svelte@5.0.0-next.95/node_modules/svelte/src/internal/index.js", imported by "playwright/index.ts".

when trying to run the component test.

I understand that Svelte 5 is not there yet, and the component tests are a experimental feature, so the priorities are pretty low. I am happy to help if pointed to the right direction, but sadly I don't have enough understanding on how to address this or if there is any workaround.

Thanks!

Example

No response

Motivation

Svelte 5 will be out there one day and Playwright will make it greater with the component tests.

@sand4rt
Copy link
Collaborator

sand4rt commented Apr 27, 2024

The svelte/internal module is used for testing slots, but it appears that slots are replaced by snippets/render tags in Svelte 5. There are more breaking changes: https://svelte-5-preview.vercel.app/docs/breaking-changes so i think this will require a new @playwright/experimental-ct package unfortunately. Rich also mentions this in his presentation: https://www.youtube.com/live/gkJ09joGBZ4?si=zXhDBYYj9cYteOOF&t=8547 on Svelte Summit.

@SteveALee
Copy link

SteveALee commented Dec 26, 2024

The component API also changed. That probably explains why I get a typescript error on the mount param when trying the example in the docs with svelte 5 :(

Argument of type 'Component<Record<string, never>, {}, "">' is not assignable to parameter of type 'new (...args: any[]) => SvelteComponent'.
  Type 'Component<Record<string, never>, {}, "">' provides no match for the signature 'new (...args: any[]): SvelteComponent'.ts(2345)

@shfx shfx linked a pull request Feb 10, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants