Matt-Esch / virtual-dom

A Virtual DOM and diffing algorithm
MIT License
11.67k stars 777 forks source link

h(html) ? #109

Closed rauchg closed 9 years ago

rauchg commented 10 years ago

jQuery style node initialization:

h('<p class="woot">', { style: { dynamic: val } })
Raynos commented 10 years ago

We avoided this because we didn't want to add the complexity of a html parser or a regex.

However:

var h = require('virtual-hyperscript')
h('p.woot', { style: { dynamic: val } })

Will work today, where the first argument is a CSS style selector thing.

rauchg commented 10 years ago

We don't need to support the entire HTML grammar though. This would make expressing attributes a lot easier i think.

rauchg commented 10 years ago

Also, why does virtual-dom have its own h/ directory? How is it different from virtual-hyperscript?

rauchg commented 10 years ago

I now see that the plan is to merge it.

Raynos commented 10 years ago

@guille I prematurely pulled virtual-hyperscript out, we do plan to merge them :)

benlesh commented 9 years ago

For the sake of developer ergonomics, is there any effort already under way to parse some sort of markup into a series of virtual-dom? It could be a useful build step for something like Grunt, Gulp or Brococli.

rauchg commented 9 years ago

should be trivial for you to generate it using the rxjs transformer

Raynos commented 9 years ago

@blesh https://github.com/Matt-Esch/virtual-dom/wiki#html-to-vdom

neonstalwart commented 9 years ago

cleaning up old tickets - open another issue if there's something here which is still not resolved