Switching Rich Text Editors, Part 1: Picking Tiptap
ashbyhq.com
ashbyhq.com
You definetily can! We used Slate `0.47.x` at Leadsimple[0] and we went through the same hustle and decided to go with Slate again! We have both versions running in production for 3 months now, and we didn't have any problem. You can add separate versions of the same library using a feature of `yarn` which allows you to declare `"slate": "^0.47"` and `"slate-latest": "npm:slate@^0.72.0"`. Then, in your code you just need import `slate` when you want the older version, and `slate-latest` when you use the new one. We also had to inline some stuff because `yarn` isn't the smartest when solving dependencies, but it sure is possible :). It wasn't easy, but the end result is amazing, and REALLY fast, hasn't caused any problem to us.
Custom schema is not just powerful but also essential for cross platform rich text editing/rendering. For example most rich text editors that work really well on the web is almost always broken in some way in a native android/ios app. Why? usually we ignore the schema and dump a black box json/html as rendering format and then deal with editing issues with that format when we actually port the app to mobile platforms.
For me it makes sense to just go with markdown or a very customizable rich text schema if it's worth it - so that rich text editing works smoothly across platforms.
I would definitely recommend it to pretty much anyone since you can adapt it to your needs.
I eventually settled for plain text in a simple textarea, with basic possibilities for markup by allowing Markdown. No more struggling with different browsers, no struggling with how the RTE looks and feels, no incompatibility issues with the underlying database, etc.
Still not saying everybody has the same use case as I have (no code website system), but I wouldn't trade my current peace of mind for even the best looking RTE.
The problem: there is no money to be made in writing software libraries these days, no matter how much a working solution is needed. So sadly, we're going to be stuck with all these suboptimal solutions for many years to come.
In hindsight, we should've just had a GitHub-style markdown editor: https://mxstbr.com/thoughts/tech-choice-regrets-at-spectrum
It sounds like the situation has improved since then! I'll definitely try Tiptap if I ever need to build another RTE.
That said, I haven't had to make that decision for a long time. Markdown editors have become noticeably friendlier, perhaps the difference isn't that big anymore and I'm out of date?
https://github.com/quilljs/quill/issues/3359 ("Is quill dead?") Multiple open CVE with no plans to address, 1.1k open issues.
We're on the lookout for better options and a way forward, so apart from that this post is much appreciated!
One of the big gotchas I've had with TipTap is that it's extremely sluggish once you get to more than 300 words or so and you're using different formatting options. There's a multi-second delay between typing the word and the text appearing in the screen.
The APIs are pretty nice, and I was able to convert to/from Markdown with it easier than other solutions I looked at, but the performance really reduces usability.
I've only used the FOSS version, so maybe TipTap Pro is better.
https://bugs.chromium.org/p/chromium/issues/detail?id=107671...
I sort of regret that choice now. I ran into a lot of bugs when integrating it which I had to manually work around; issues go months without being addressed; and there still isn't good cross-platform support, especially for Android. With a more active contributor base, Slate could be a fantastic library, but I get the feeling that it's in maintenance mode now, with not many major changes in the past year and a v1.0 still far in the future.
Tiptap looks like it might be a good choice now, but I find it off-putting that I can't insert links in the demo editor on Tiptap's website (https://tiptap.dev), especially for my use case (a note-taking app whose core concept revolves around links).
>What we're building At Ashby, we’re on a mission to help professionals excel at their jobs with software. We believe current software is barely scratching the surface and the most promising productivity improvements haven’t materialized yet.
We’re starting with a suite of products that help talent leaders, recruiters, and managers excel at hiring. Prior to starting Ashby, our Co-Founder and CEO, Benji, experienced the limitations of current products first hand. This experience has created a relentless focus to solve recruiting’s toughest problems with powerful and delightful software.
I guess they have a product that is similar to lever or greenhouse atm
> While Google is useful, ranking in Google Search is a popularity contest, not a quality test. To be exhaustive, we started with the initial list of libraries we found back in 2019 and used the references to other libraries in their documentation to find more.
In this case NPM and GitHub search are great for this. You can also sort by many important attributes and filter by keywords.
The other point that was unaddressed is to actually read the source code. Is the source easy to understand? Depending on the library the source code might be an important source of documentation.
I was also considering Slate, but have found this rather annoying bug https://github.com/ianstormtaylor/slate/issues/4833, which is surprising as it doesn't look like some rare edge case, and breaks something that seems to be like basic functionality for an editor. Had to re-consider.
It’s a year since I last tried something similar and I think I ended up layering elements on top of where I wanted them from outside the editable element in combination with marks.
Don’t take my word for it though as a little out of practice with TipTap, it and ProseMirror are awesome though!
Like for example if you wanted a Wordpress style story editor in rails is there an obvious option?
You have been warned…
https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Edit...
[0]: I suggest you to take a look in Chrome debugger how it works. Quite funny piece of code. It is written in jQuery + vanilla JS, so it will be very easy to spot the whole algorithm.
I'm not sure when that changed, but it's definitely worth noting.
This is a topic I have been very interested lately. I had been lucky to start using since Slate 0.61.x, but I cannot say anything good about it. It has a major problem with managing large documents [0]. I tried to introduce multiple improvements of performance, but it is very ungrateful project – change in one place affects many things at the same time. I am shocked, how many projects are still using it. For example, open-sourced Notabase [1]. My 4+ weeks with Slate.js completely killed motivation, and I was only thinking to put a whole project to litter.
In the result of being unhappy, I switched to Draft.js. It was 2020, and I was eager to try it out, so I did. Sadly, in 2020 there was also the last release [2]. Initially, I didn't like how it works. I preferred the Slate data model. Also, the draft.js project felt not maintained at that time (by looking at commits activity, issues and pull-requests). It is written in the Flow which I detest. I spent few weeks to try "merge" the draft.js and sentry with doing a "rewrite" to TypeScript. Obviously, quickly I realized myself it is stupid idea.
Then, I took a look at ReMirror. Yet another problem that was struggling with maintenance and active contributors. It is based on ProseMirror, so I thought it is better choice than previous. ReMirror is overly complex for simple things. It was hard to find any help - neither by googling examples nor via ReMirror's Discord (it was dead silence there).
After that, I have found information about the TipTap. Back then, there was only provided support for Vue.js. Fortunately, it was that time, when they have promised the v2 with React support. I skipped it to wait for the new version.
Maybe, a raw ProseMirror with React? Yep, tried it, but I wasn't very happy of the result. I knew the TipTap v2 will be released and there were already existing projects that were using ProseMirror behind the scene, for example: Outline's rich-markdown-editor[3]. It has tons of built-in components that I had with Slate. I was extremely happy about it, because "everything what I needed" was there – typical bold, italic, code, code block, quote, multi-level list and even table editing. Really awesome piece of code! However, authors decided they are opting for TipTap and they have archived repository on GitHub, which means officially the project is dead.
I had no time to test Quill.js. It looked interesting, but it has noticeable poor development pace, and it looks a dead project with many bugs.
Currently, I am using the TipTap v2 and I can't say how happy I am now. I guess I will stick with it for longer. However, I know the journey to find the best Rich Text Editor has not ended :sweat-emoji:. There are more alternatives, for example Stylo [4] that I've found in this week.
[0] Try to copy the contents of https://www.slatejs.org/examples/huge-document and paste it back. In a result, my Firefox on Macbook M1 hangs.
[1]: https://notabase.io/
[2]: https://github.com/facebook/draft-js/releases/tag/v0.11.7
[3]: https://github.com/outline/rich-markdown-editor
[4]: https://stylojs.com/