0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-29 00:22:05 +01:00
svelte/.changeset/small-papayas-laugh.md
Simon H 9a99554379
breaking: remove Component type, keep using SvelteComponent instead (#9413)
I came to the conclusion that when we're making up arbitrary types, we might as well keep the old class. That way:
- one less thing to worry about (language tools and other tooling basically can continue to spit out SvelteComponent )
- we can more clearly mark $set , the constructor etc as being deprecated and no longer functioning unless you use that legacy compatibility mode
- much more ergonomic to type for the user:
  - const someInstance: SvelteComponent<..> instead of const someInstance: ReturnType<typeof Component<..>>
  - If you're using generics, you can do export class MyComponent<T> extends SvelteComponent<{ prop: T }> {} instead of having to type out the whole function in a way that I'm not even sure how to do with generics
2023-11-13 17:23:05 +01:00

93 B

svelte
patch

breaking: remove Component type, keep using SvelteComponent instead