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

Replace deprecated mobiledoc-html-renderer with mobiledoc-dom-renderer #535

Closed
wants to merge 2 commits into from
Closed

Replace deprecated mobiledoc-html-renderer with mobiledoc-dom-renderer #535

wants to merge 2 commits into from

Conversation

YoranBrondsema
Copy link
Collaborator

No description provided.

@mixonic
Copy link
Contributor

mixonic commented Feb 21, 2017

@YoranBrondsema this would not be safe for running in Node. I'm not sure we are 100% safe for that now but it would be nice to get closer and not further away.

The suggested way to render as HTML is to use the DOM renderer and SimpleDOM. docs.

Can we simply drop the serializePost options for html or text? Only permit serialization to Mobiledoc, and if you need to serialize into an alternative format just bring you own renderer. It would simplify our build and make mobiledoc-kit smaller to remove the dependency on mobiledoc-html-renderer and mobiledoc-text-renderer entirely.

@bantic?

@bantic
Copy link
Collaborator

bantic commented Feb 21, 2017

Being able to simplify by dropping mobiledoc-*-renderer as dependencies is appealing, for sure.

The reason we use serializePost with 'html' and 'text' formats is for copying out of an editor. We can't drop those formats without dropping support for external pasting of copied mobiledoc content.

@YoranBrondsema
Copy link
Collaborator Author

@mixonic @bantic Does copy-pasting make sense in a Node.js environment? One application I can think of is in a Node.js-based desktop application such as the Atom editor. If so, I think we'd either have to have a user pass a DOM when initializing mobiledoc-kit or we add a dependency on SimpleDOM. If not, then we can assert beforehand that we must be in a browser-based environment to support copy-pasting.

@bantic
Copy link
Collaborator

bantic commented Mar 8, 2017

@YoranBrondsema I think you're right — copy/pasting doesn't make sense in a Node.js environment. Afaict event Atom or some other app running in electron will have access to a DOM. I am in favor of falling back to text serialization when there's not DOM available. I'll push up that change to this branch and get your thoughts.

@bantic
Copy link
Collaborator

bantic commented Mar 8, 2017

@YoranBrondsema
Copy link
Collaborator Author

@bantic Looks great, no comments. Thanks a lot for making this get through!

@bantic
Copy link
Collaborator

bantic commented Mar 9, 2017

closed for #538

@bantic bantic closed this Mar 9, 2017
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

Successfully merging this pull request may close these issues.

3 participants