Conversation
Generated by 🚫 dangerJS |
|
TODO
|
|
Most satisfying commit ever, deleting the entire rich-text-editor and with it all the DraftJS plugins: 806858c 😍 Threads are now also rendered with the thread renderer, so all that's really left to do is to fix syntax highlighting and move thread editing to plaintext!!! |
|
Latest commit moves thread editing to plaintext 🤯I extracted the thread input components and re-used them—this leads to a bit of a strange UX right now, but we can clean that up for sure. Most importantly it works! |
|
I have started the process of completely removing the DraftJS and ImmutableJS dependencies from the frontend bundles, and it is going alright so far! The one big hangup that I have right now is editing. That initial conversion is unnecessary, it should be possible to convert the raw content state directly to markdown. We might have to fork /cc @sstur |
|
Actually, now that I think about it the inverse is also true: when showing the preview we also first convert the markdown to DraftJS EditorState and then convert that to raw. So essentially, we have to build a converter from markdown to raw content state and another one from raw content state to markdown without the conversion to DraftJS in the middle. |
|
Found a pretty bad bug:
|
You did not remove the Also, when you edit a code block it is transformed into a normal-markdown-style-codeblock with four spaces, not a GFM markdown one. Still a code block, at least if you remove the \ like I said you should! 😉 Good catches on the other bugs, will clean that up! |
I have fixed everything except for this, I cannot replicate this. Pressing |
|
Actually, I think I know what this is: you were probably editing the thread in the slider. We have a global event listener in the composer, I will clean that up to be local that should fix it! |
|
Okay the latest commit makes CMD+Enter work while editing and should also fix the bug because I have moved the CMD+Enter listener to be local to the editor, rather than global to the entire doc! 🎉 This should be ready to go now 💯 |
With regards to: "it should be possible to convert the raw content state directly to markdown" |
We should just use GFM - this is really weird :P |
|
Just pushed some layout fixes. Please double check that overflowing and layout all looks good on your end, on both mobile + desktop. I think it's solid now. |
Scratch that, I just realised I already did an upstream patch for this for the chat input 🤦♂️ Just need to use the |
|
Thanks for cleaning this up, will double check on Mon! 💯 |
|
This should be good to go now @brianlovin, ready to ship! 🎉 |
|
Excellent work!! I'll prod cut today |







Status
Deploy after merge (delete what needn't be deployed)
This is a heavy WIP/prototype. I want to try to kick DraftJS + ImmutableJS + plugins out of our JavaScript bundle entirely. This is feasible since #4564 and #4472 were merged, as the only thing they are still used for on the frontend is editing and rendering threads.
It is definitely possible to move thread editing to plaintext, so I am investigating the possibility of creating a thread content renderer with
redraft. If that is possible, I am going to continue with editing.To make sure I cover all features, I created an extensive markdown test file:
Click to see test markdown file
Note: remove the backslash at the end of the code block
Here is what the test file renders right now (yes, embeds are appended at the end instead of the middle... that's a bug):
Let's see if I can get to that exact result with
redraft! Wish me luck 🤞