date-picker icon indicating copy to clipboard operation
date-picker copied to clipboard

Add "Usage with Svelte" to documentation

Open mcmxcdev opened this issue 5 years ago • 6 comments

Is your feature request related to a problem? Please describe. I am working on a client project with Svelte and this date picker would be a great replacement for the current one that I am using.

Describe the solution you'd like Add instructions of how to get Duet Date Picker up and running with Svelte.

mcmxcdev avatar Jan 21 '21 18:01 mcmxcdev

Hey. Would you be able to make a PR for this? I have zero experience with Svelte, so I would not be able (or confident!) writing instructions

WickyNilliams avatar Jan 28 '21 11:01 WickyNilliams

Yes, I can try to get it up and running with Svelte and provide a PR once I find the time!

mcmxcdev avatar Jan 28 '21 12:01 mcmxcdev

Thanks, appreciate it!

WickyNilliams avatar Jan 28 '21 13:01 WickyNilliams

I tried to follow the instructions similar to Vue.js but was unable to get neither a starter template for Svelte nor Sapper to work with duetds date-picker. It would probably require a person more familiar with web components to tackle this.

mcmxcdev avatar Jan 29 '21 22:01 mcmxcdev

Since Svelte is a compiler and has no virtual DOM; and any Svelte project itself can compile as a web component, it would be a bit weird to try and integrate Duet as a web component.

A correct way to integrate would be to use Svelte to import the Typescript and then build a Svelte component with the right props from there.

Wolfr avatar May 20 '21 12:05 Wolfr

Not sure how svelte not having a virtual DOM changes anything? A web component doesn't require virtual DOM. Stencil uses one, but its an implementation detail from an external perspective.

Maybe some code can help illustrate what you mean. As I said above I have zero experience with svelte so maybe I'm missing something

WickyNilliams avatar May 20 '21 13:05 WickyNilliams