ember-mobiledoc-editor
ember-mobiledoc-editor copied to clipboard
Fastboot compatibility
It looks like some work is needed to make this addon fastboot-compatible. It currently fails at boot time when it hits require("mobiledoc-kit")["registerGlobal"](window, document);
in mobiledoc-kit
's globals build.
(ref #51). Does that fix this issue, or do you see additional fastboot-related incompatibilities?
That's a start but more work is needed.
I think we will need to swap the DOM renderer out and the HTML renderer in.
Neat. @ef4 this package should not be requiring the mobiledoc-dom-renderer, instead it has its own bespoke editor that handles cursor edge cases, etc.
The HTML renderer would work, but we're also having good experience using the DOM renderer with simple-dom. Cards are just simple-dom compatible, and therefore work with browser DOM apis or can be converted into strings. It seems easier than writing a card once as DOM and once as HTML.
Of course if you plan to render Ember components for document display, you're basically already doing that, just Ember is using simple dom for you.
Then I think the work that's needed is ensuring that this package's bespoke editor always goes through simple DOM. I will work on that.
And/or that the instantiation of the editor itself is not executed during fastboot (b/c of what hooks are used). I think that would be the ideal, you don't want the editor itself to execute on the server.
So what thing exported by mobiledoc-kit would do the rendering instead of mobiledoc-kit/editor/editor
?
(This is why I thought I would need to import something like the html renderer.)
@ef4 What is your goal for FastBoot? That the editor's DOM is renderered, or just that the {{mobiledoc-editor}}
component is "FastBoot safe" and renders a dummy placeholder?
FWIW, the editor DOM is not the same as the HTML/DOM rendered by mobiledoc-html-renderer or mobiledoc-dom-renderer. I just want to make sure you're not using the editor to render content to non-editors (something the renderers should be used for).
I want the DOM rendered correctly, same as it would if it rendered in the browser. Users need to be able to trust that initial render is portable to either environment and looks the same.
For non-editors, I will also need to create an Ember component to wrap the renderer. Presumably as a separate addon, and not just another component in this repo? On Jan 31, 2016 9:50 PM, "Matthew Beale" [email protected] wrote:
@ef4 https://github.com/ef4 What is your goal for FastBoot? That the editor's DOM is renderered, or just that the {{mobiledoc-editor}} component is "FastBoot safe" and renders a dummy placeholder?
FWIW, the editor DOM is not the same as the HTML/DOM rendered by mobiledoc-html-renderer https://github.com/bustlelabs/mobiledoc-html-renderer or mobiledoc-dom-renderer https://github.com/bustlelabs/mobiledoc-dom-renderer. I just want to make sure you're not using the editor to render content to non-editors (something the renderers should be used for).
— Reply to this email directly or view it on GitHub https://github.com/bustlelabs/ember-mobiledoc-editor/issues/50#issuecomment-177724717 .