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

Svelte 5: Typescript generics in components are marked as deprecated #9586

Closed
mr-josh opened this issue Nov 21, 2023 · 2 comments
Closed

Svelte 5: Typescript generics in components are marked as deprecated #9586

mr-josh opened this issue Nov 21, 2023 · 2 comments

Comments

@mr-josh
Copy link

mr-josh commented Nov 21, 2023

Describe the bug

Typescript marks components with generics as deprecated.

Reproduction

https://github.com/mr-josh/svelte-5-generics-issue

Is not too hard to reproduce in any project. Using either script tag generics or the $$Generic helper will trigger this issue.

Confirmed on local and in a codespace linux machine.

Logs

The signature '(options: ComponentConstructorOptions<{ value: string; }>): Component__SvelteComponent_<string>' of '$$_tnenopmoC0C' is deprecated.js(6387)

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz     
    Memory: 7.19 GB / 15.94 GB
  Binaries:
    Node: 20.3.0 - C:\Program Files\nodejs\node.EXE
    npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.3636.0), Chromium (119.0.2151.72)
    Internet Explorer: 11.0.19041.3636
  npmPackages:
    svelte: ^5.0.0-next.1 => 5.0.0-next.9

Severity

annoyance

@dummdidumm dummdidumm added this to the 5.0 milestone Nov 22, 2023
@dummdidumm
Copy link
Member

Either we un-deprecate the constructor, which could give the false premise of this working, or we adjust language tools to use the new constructor if version 5 is detected. I lean towards the latter.

@dummdidumm
Copy link
Member

Fixed in latest version of the VS Code extension / svelte-check

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

No branches or pull requests

2 participants