Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> "building a text-annotation based app"

I'm going to assume that you are talking about a desktop-based webapp that is also responsive, and not a native app.

I have 10+ years of experience doing front-end, with probably over a dozen React packages self-published in npm, and also tried making a rich text editor ~6 years back[1]. I actually recommend starting with no framework at all (please read on).

Creating a rich text editor might be the hardest thing you can do in "normal" front-end (excluding some more advanced "frontend" fields like 3D or games). You can either manipulate raw cursors, which will be very tricky because I'm not even sure you have access to all the right APIs (specially on mobile), or you can attempt to use Contenteditable, which is a hell of its own[2].

"All problems start with caret placing and multi browser support" [3]

That said, I believe 90% of the complexity of your app will be here, around the actual interaction with the <textarea> or <div contenteditable> that you will be using. For that, no framework will really help you, at all. So my recommendation is to first get that working, which will take weeks/months and probably thousands of lines of code, and then worry about placing the little hovering boxes in their place (the "UI"), which is like 30-40 lines of JS/CSS[4].

Once you have this core interaction working, you can also wrap it in your preferred frontend framework for other people to easily use it.

[1] https://github.com/franciscop/modern-editor

[2] https://answerly.io/blog/my-pain-developing-a-wysiwyg-editor...

[3] https://news.ycombinator.com/item?id=27938702

[4] https://stackoverflow.com/q/4495626/938236



Might make sense to just start with an existing rich text editor (with a friendly license) that you fork. You'll have your own needs but a large part of any editor is common to every other editor. Or maybe you could just spend a few days reviewing the source of existing editors as inspiration. Seems nuts to just go for it yourself especially since OP is saying they aren't super experienced in TS FE.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: