Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fastboot compatibility #50

Open
ef4 opened this issue Jan 26, 2016 · 8 comments
Open

Fastboot compatibility #50

ef4 opened this issue Jan 26, 2016 · 8 comments

Comments

@ef4
Copy link
Contributor

ef4 commented Jan 26, 2016

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.

@bantic
Copy link
Contributor

bantic commented Jan 26, 2016

(ref #51). Does that fix this issue, or do you see additional fastboot-related incompatibilities?

@ef4
Copy link
Contributor Author

ef4 commented Jan 26, 2016

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.

@mixonic
Copy link
Contributor

mixonic commented Jan 26, 2016

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.

@ef4
Copy link
Contributor Author

ef4 commented Jan 30, 2016

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.

@mixonic
Copy link
Contributor

mixonic commented Feb 1, 2016

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.

@ef4
Copy link
Contributor Author

ef4 commented Feb 1, 2016

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.)

@mixonic
Copy link
Contributor

mixonic commented Feb 1, 2016

@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).

@ef4
Copy link
Contributor Author

ef4 commented Feb 1, 2016

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" notifications@github.com 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
#50 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants