So far, we have these technical prototypes:
1- https://wordpress.github.io/gutenberg/tinymce-per-block/
2- https://wordpress.github.io/gutenberg/tinymce-single/ (Single TinyMCE, uncontrolled, no grammar, HTML parsing)
tinymce.getContent
(Feel free to add any other technical prototype here)
I'm creating this issue so we can compare the pros/cons of each approach to help us decide which approach we choose to implement.
Here are my feelings about these two prototypes:
Pros:
Cons:
Pros:
Cons
Based on this experimental prototype https://github.com/WordPress/gutenberg/pull/113 I tried to work on a mixed approach where we use TinyMCE as a wrapper but rerender its content based on state changes. After some exploration, this approach feels like trying to recreate DraftJS or ProseMirror. And I don't think it's the right way to use TinyMCE.
Thanks for creating this ticket.
As we compare we should also think of #3, as that seems dependant on which approach we choose.
I think Prototype 2 is the way to go, although it might be more of a pain because it will involve a lot more TinyMCE work, ultimately it would probably be the best approach forward for now.
Harder to reuse the blocks outside the editor?
I think that would not be a con for Prototype 2, as long as the API for defining Block Types and Control types provides enough data for something other than TinyMCE to use. I think we should develop an Block Type/Control Type defining API that will be used to feed a highly Custom TinyMCE instance. Data from the Block Type/Control Type could also be used to feed something else potentially in the future.
As much as it is probably not palatable, Prototype 2 mirrors the most of how WordPress already works and TinyMCE does a lot, which to me makes it a very sensible path forward.
Most helpful comment
Here are my feelings about these two prototypes:
Prototype 1:
Pros:
Cons:
Prototype 2:
Pros:
Cons
Based on this experimental prototype https://github.com/WordPress/gutenberg/pull/113 I tried to work on a mixed approach where we use TinyMCE as a wrapper but rerender its content based on state changes. After some exploration, this approach feels like trying to recreate DraftJS or ProseMirror. And I don't think it's the right way to use TinyMCE.