skatejs/dom-diff

How to build a virtual tree from string of HTML?

Jarred-Sumner opened this issue · 6 comments

In the README, there's a section on building a virtual tree from a DSL:

Constructing a virtual tree

There is a built-in function for creating virtual elements:

import el from 'skatejs-dom-diff/vdom/element';

el('div', null,
  'Hello, ',
  el('span', { style: 'font-weight: bold'}, 'World!')
);

Is there anything like that, but where I can just pass in a string of HTML? For example:

<html><head></head><body>This is just an example</body></html>

I'd like to turn that string into a vtree from data fetched from the server remotely.

I could write something that does this, but it'd take time to make sure the various edgecases that I'm sure exist are properly handled.

There currently isn't something like that.

Also, we haven't been very active in this repo as of late. Skate is currently using Incremental DOM for rendering, but I've been thinking about allowing custom renderers to be specified. I still like the idea of this repo because it can diff dom -> dom, dom -> vdom, vdom -> dom and vdom -> vdom.

😢
On Thu, Oct 6, 2016 at 6:18 PM Trey Shugart notifications@github.com
wrote:

There currently isn't something like that.

Also, we haven't been very active in this repo as of late. Skate is
currently using Incremental DOM
https://github.com/google/incremental-dom for rendering, but I've been
thinking about allowing custom renderers to be specified. I still like the
idea of this repo because it can diff dom -> dom, dom -> vdom, vdom -> dom
and vdom -> vdom.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#99 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AArTSyV2jG5pJS9Tr1mK9d9ZRTWiGinvks5qxZ3NgaJpZM4KPn03
.

I'd be open to proposals for it, though, I'm not sure we'd have the capacity to implement it. FWIW I still use this library off and on, and it appears some others might be.

Would this need to be performant?

I no longer need this myself but maybe others will. Sorry for taking up
your time with this.
On Sat, Nov 19, 2016 at 4:53 PM Trey Shugart notifications@github.com
wrote:

Would this need to be performant?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#99 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AArTS_HDuauc_cbY19pA1y1w6fd2Kwlzks5q_sb9gaJpZM4KPn03
.

No problems. Thanks for letting me know :)