Skip to content

Commit cb4b1f0

Browse files
committed
fix: remove constructor overload
The original intent was for typing generation tools like svelte2tsx to use the virtual constructor instead, but it does more harm than good. Most notably, the TS error message when props are wrong becomes completely useless. It's better for tooling to silence the deprecation message and switch over to a new virtual constructor once we remove the deprecated one.
1 parent b7af2ff commit cb4b1f0

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

.changeset/ten-worms-reflect.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: remove constructor overload

packages/svelte/src/main/public.d.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,6 @@ export class SvelteComponent<
5252
Slots extends Record<string, any> = any
5353
> {
5454
[prop: string]: any;
55-
56-
/**
57-
* For type checking capabilities only.
58-
* Does not exist at runtime.
59-
* ### DO NOT USE!
60-
*/
61-
constructor(props: Props);
6255
/**
6356
* @deprecated This constructor only exists when using the `asClassComponent` compatibility helper, which
6457
* is a stop-gap solution. Migrate towards using `mount` or `createRoot` instead. See

0 commit comments

Comments
 (0)