facebook / lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
https://lexical.dev
MIT License
19.96k stars 1.7k forks source link

Feature: Full featured vanillajs example #5964

Open HolyOne opened 7 months ago

HolyOne commented 7 months ago

I tried the vanilla-js example which works fine except there is no toolbar. To bring lexical to .net platform and other platforms with ease, I suggest lexical would have a fully working vanillajs example so it could be migrated to any platform easily with a common api.

StyleT commented 7 months ago

Hi! Thanks for the input here. I think toolbar and all other components really depend on React for UI rendering, so while it's possible to do similar UI in vanilla JS - it may be quite suboptimal.

Can you pls elaborate on why you can't use React within .NET apps?

I think we can do potentially preact (smaller React), but you do need some library to handle DOM outside of Lexical conveniently.

HolyOne commented 7 months ago

Blazor has its own way to access dom and it is as big as react. Using both libraries would make it overcomplicated and big.

A pure javascript lexicon would not only be beneficial for blazor lexicon development but also be good for having an abstraction to build on all languages

On Fri, 26 Apr 2024, 01:12 Vlad Fedosov, @.***> wrote:

Hi! Thanks for the input here. I think toolbar and all other components really depend on React for UI rendering, so while it's possible to do similar UI in vanilla JS - it may be quite suboptimal.

Can you pls elaborate on why you can't use React within .NET apps?

I think we can do potentially preact https://preactjs.com/ (smaller React), but you do need some library to handle DOM outside of Lexical conveniently.

— Reply to this email directly, view it on GitHub https://github.com/facebook/lexical/issues/5964#issuecomment-2078257947, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACHVYK6HAP7IAUARLWHUUTY7F5ULAVCNFSM6AAAAABGZTCUWCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZYGI2TOOJUG4 . You are receiving this because you authored the thread.Message ID: @.***>

StyleT commented 7 months ago

Can you provide some example of Lexical/Blazor integration? W/o toolbar of course. If it can be an interactive sandbox - would be awesome.

StyleT commented 7 months ago

Also pls elaborate on how usage of preact here (3kb of code) would be worse then some custom written JS to manipulate DOM

HolyOne commented 6 months ago

Blazor integration does not seem possible without addin react over blazor. Blazor is not js, it is webassembly and it can call javascript functions from c# code. I dont know much about preact but I guess it also has its own dom access layer like react