Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can svelte-lexical use excalidraw? #77

Open
theslyprofessor opened this issue Apr 16, 2024 · 6 comments
Open

Can svelte-lexical use excalidraw? #77

theslyprofessor opened this issue Apr 16, 2024 · 6 comments

Comments

@theslyprofessor
Copy link

Hi,
I'm a bit of a beginner here and I'm wondering if this framework is suitable for using lexical with excalidraw?

I saw this article discussing support for lexical with excalidraw: excalidraw/excalidraw#6718

Thanks

@umaranis
Copy link
Owner

Hi @theslyprofessor ,

Lexical’s excalidraw plugin is not ported to svelte-lexical yet. All lexical plugins are coded in react and to use them with this project , we have to port it to svelte.

If you are willing to work on the port, I can assist you with it.

@theslyprofessor
Copy link
Author

Yes! I am definitely interested in helping out.

@theslyprofessor
Copy link
Author

Let me know whenever you can the best way that I can help, incorporating it would help me finish my PhD: [email protected]

@umaranis
Copy link
Owner

Hi @theslyprofessor ,

I just got the time to look at it in detail. Earlier, I missed the fact that excalidraw is implemented in React.

Usually, when we port a plugin from lexical to svelte-lexical, we have to port the plugin code from react to svelte. But in this case, the lexical plugin depends on a package (excalidraw) written in react. So, first, we will have to port it to svelte. This is going to be a huge task I believe.

@YugoCode
Copy link

Here is a working demo of using excalidraw with Svelte: https://www.sveltelab.dev/yg89k40qsw1uufc
Basically, you will add React as a dependency and use a wrapper to call and interact with excalidraw from Svelte.

There are some libraries which help you with that, i.e. using React components in Svelte:

Of course this should only be a workaround until there is a real Svelte port. But I think it's better to use such wrappers instead of having no excalidraw support at all. And performance wise I haven't seen any issues with the linked demo above.

@umaranis What do you say?

@umaranis
Copy link
Owner

Hi @YugoCode ,
Thanks for sharing a working example 🙂
Yes, I agree to provide these workarounds until we have a port.
But we will have to make it very clear what the dependencies are and have library users explicitly include such plugins (rather than including them by default).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants