You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I wanted to use this library in Astro but I ran into issues. However, other Svelte libraries that use flatpickr, for example carbon-components-svelte work fine.
This is some feedback I got from people more knowledgable about types:
[svelte-flatpickr] is very weirdly packaged, it only has a single export using a non-standard export name and it declares its types using a fake module
I don't really know how we would support that without implementing Svelte's module resolution I assume. If the package just exposed the files normally, you could just import the Svelte components.
I tried fixing this to open a pull request but I couldn't quite get it to work locally and I don't have time to look into it more. I tried setting up a new project and following the instructions about packaging from the SvelteKit docs which gave me better types and made it work in Astro, but I couldn't figure out how to migrate this repository to the "correct" format without "starting from scratch".
I thought I'd leave an issue here to let you know that a more standard way of exporting the component and its types would be very helpful for Astro users and possibly others too!
The text was updated successfully, but these errors were encountered:
Yeah, the types are basically tacked on as an afterthought at this point. This library wasn't written in TypeScript, and at the time of writing SvelteKit didn't exist and there was no standard way to export types for Svelte libraries. To my recollection, Svelte didn't even support types when this package was authored.
For what it's worth, this package should be exposing the files normally, I'm not sure what that is referring to. Would definitely appreciate help here if anyone else is familiar with migration. The types right now were basically just intended for consumption by IDEs, which seems to work correctly, but not necessarily build tools. I'll try to take a look at integration with Astro one of these days, but help would definitely be appreciated.
Hi! I wanted to use this library in Astro but I ran into issues. However, other Svelte libraries that use flatpickr, for example
carbon-components-svelte
work fine.This is some feedback I got from people more knowledgable about types:
I tried fixing this to open a pull request but I couldn't quite get it to work locally and I don't have time to look into it more. I tried setting up a new project and following the instructions about packaging from the SvelteKit docs which gave me better types and made it work in Astro, but I couldn't figure out how to migrate this repository to the "correct" format without "starting from scratch".
I thought I'd leave an issue here to let you know that a more standard way of exporting the component and its types would be very helpful for Astro users and possibly others too!
The text was updated successfully, but these errors were encountered: