hperrin / svelte-material-ui

Svelte Material UI Components
https://sveltematerialui.com/
Apache License 2.0
3.33k stars 285 forks source link

Remove reliance on `svelte2tsx/svelte-jsx` #665

Open dummdidumm opened 2 months ago

dummdidumm commented 2 months ago

Is your feature request related to a problem? Please describe. The current smui typings reference svelte2tsx/svelte-jsx. This d.ts file is outdated as it's mainly related to Svelte 3. It's also not to be treated publicly, it's an implementation detail of the svelte2tsx package. I suggest to remove its usage from smui and therefore remove the dependency on svelte2tsx from the project.

Describe the solution you'd like My hunch is that the references are from a time when svelte/elements (the import) didn't exist in Svelte yet. If you want to extend types for a button for example, you should instead import the corresponding interface from that import and use that. If it's purely for not having to type certain types like EventHandler, then those types should be recreated within your type definition file instead.

Also see https://svelte.dev/docs/typescript#enhancing-built-in-dom-types

Describe alternatives you've considered If this doesn't work for some reason I'd like to understand better what this is exactly used for.