FXMisc / RichTextFX

Rich-text area for JavaFX
BSD 2-Clause "Simplified" License
1.19k stars 236 forks source link

Discussion : Collaborative Html Editor in Java and to run this natively in a web browser with WebFX #1005

Open evanvelikanov opened 3 years ago

evanvelikanov commented 3 years ago

I have always required a html editor (preferably collaborative). My options have been Prosemirror based Atlaskit-editor, and CKEditor. For collaborative Atlastkit-editor is the best option I have, and for a general purpose but powerful WYISYG html editor - CKEditor (these are my personal preferences).

To make these work in a JavaFX environment is not easy and quiet twisted. It is then I suddenly discover WebFX. WebFX makes it possible to run JavaFX in browser natively by transpiling it to well-behaved Javascript using TeaVm and GWT. It is different from JPro. WebFX can run offline also, as it runs natively in the browser.

I have been beating my head against a wall for almost two years, thinking of how I want to do it. I am convinced I have only two options:

  1. Use Atlaskit-editor and change my technology stack entirely to a Web based one (Reactjs etc.) and forget JavaFX (and also Java) and native mobile/desktop apps from the same common shared code base, creating apps which do not consume excessive resources. As of today this is the only and the only way I can find to do collaborative html text editor without having to pay.
  2. Use RichTextFX and first make a html editor and then dare make it collaborative (or atleast something in between). I don't think I would so much prefer the default javafx htmleditor but that might be another option.

I am more inclined to option 2, even though it is going to be much more hard work. The reason is I do not have the required skills and confidence to shift to a web based stack. JavaFX is much more approachable for me and I have used it over the past one decade. Making simple websites is different, but in terms of (1) performance, (2) write once run anywhere (which JavaFX has really becomes thanks to GluonVM, JPro, WebFX etc), (3) ease of maintenance (across even decades), (4) my familiarity with the ecosystem of tools, (5) my fear of obsolesce of my knowledge given the speed with which the web tech stack evolve etc, I would strongly defer a web based tech stack like Reactjs/Vue etc for any big project.

So, I just wanted to share my thoughts and get feedback on this.

I also wanted to let people who are developing important tools and ui elements for JavaFX know that the scope of your work is going to increase beyond just desktop/mobile apps. In near future you may see your javafx ui libraries running natively in the browser, because of WebFX. I suppose there are more people like me interested in using or are already working on Html editor written in JavaFX, I hope they will find this and some duplication of effort can be avoided. I think anybody making an html editor in javafx is likely to use RichTextFX. I hope if there is anybody like that they will find this ticket and know the significance of their work.

For reference some samples of WebFX :

SpaceFX (by HanSolo) https://spacefx.webfx.dev/

Modern gauge https://moderngauge.webfx.dev/

Particles https://particles.webfx.dev/

Mandelbrot (Heavy computation) https://mandelbrot.webfx.dev/

WebFX discussion page : https://github.com/webfx-project/webfx/discussions/4

Jugen commented 3 years ago

Hi @ivan-velikanova, this is nice thanks for sharing. Btw I'm running CKEditor 4 succesfully in my JavaFX desktop application (Patient Medical Records).

evanvelikanov commented 3 years ago

Hi @ivan-velikanova, this is nice thanks for sharing. Btw I'm running CKEditor 4 succesfully in my JavaFX desktop application (Patient Medical Records).

BTW after making my original post I started contemplating on using CKEditor it seems much more powerful and easy. But rest of the stuff by WebFX is still relevant.