{"action":"created","issue":{"url":"https://api.github.com/repos/ben-eb/midas/issues/4","repository_url":"https://api.github.com/repos/ben-eb/midas","labels_url":"https://api.github.com/repos/ben-eb/midas/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/ben-eb/midas/issues/4/comments","events_url":"https://api.github.com/repos/ben-eb/midas/issues/4/events","html_url":"https://github.com/ben-eb/midas/issues/4","id":161091913,"number":4,"title":"Refactor: Investigate outputting an AST rather than HTML","user":{"login":"ben-eb","id":1282980,"avatar_url":"https://avatars.githubusercontent.com/u/1282980?v=3","gravatar_id":"","url":"https://api.github.com/users/ben-eb","html_url":"https://github.com/ben-eb","followers_url":"https://api.github.com/users/ben-eb/followers","following_url":"https://api.github.com/users/ben-eb/following{/other_user}","gists_url":"https://api.github.com/users/ben-eb/gists{/gist_id}","starred_url":"https://api.github.com/users/ben-eb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ben-eb/subscriptions","organizations_url":"https://api.github.com/users/ben-eb/orgs","repos_url":"https://api.github.com/users/ben-eb/repos","events_url":"https://api.github.com/users/ben-eb/events{/privacy}","received_events_url":"https://api.github.com/users/ben-eb/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ben-eb/midas/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/ben-eb/midas/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-19T20:55:21Z","updated_at":"2016-06-20T10:46:16Z","closed_at":null,"body":"Leaving this here for a reference, it's low down on my priority list for now.\r\n\r\nI'm considering making this module output something that is more compatible with React, and other consumers, which work best with a node tree instead of setting HTML dangerously.\r\n\r\nWe can do this by using https://github.com/wooorm/hastscript and https://github.com/Matt-Esch/virtual-dom/tree/master/virtual-hyperscript. Also, we can use https://github.com/wooorm/hast-util-to-html to keep a HTML output, but not make it the default. Finally, we can use https://github.com/wooorm/hast-to-hyperscript to transform the HAST tree to another output.\r\n\r\nHelp welcome if you have any experience in this area. 😄 "},"comment":{"url":"https://api.github.com/repos/ben-eb/midas/issues/comments/227109616","html_url":"https://github.com/ben-eb/midas/issues/4#issuecomment-227109616","issue_url":"https://api.github.com/repos/ben-eb/midas/issues/4","id":227109616,"user":{"login":"wooorm","id":944406,"avatar_url":"https://avatars.githubusercontent.com/u/944406?v=3","gravatar_id":"","url":"https://api.github.com/users/wooorm","html_url":"https://github.com/wooorm","followers_url":"https://api.github.com/users/wooorm/followers","following_url":"https://api.github.com/users/wooorm/following{/other_user}","gists_url":"https://api.github.com/users/wooorm/gists{/gist_id}","starred_url":"https://api.github.com/users/wooorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wooorm/subscriptions","organizations_url":"https://api.github.com/users/wooorm/orgs","repos_url":"https://api.github.com/users/wooorm/repos","events_url":"https://api.github.com/users/wooorm/events{/privacy}","received_events_url":"https://api.github.com/users/wooorm/received_events","type":"User","site_admin":false},"created_at":"2016-06-20T10:46:16Z","updated_at":"2016-06-20T10:46:16Z","body":"Cool! I believe it won’t be very hard, there are few places where HTML is actually built, and most are already done in a manner similar to virtual dom creation (e.g., [`span()`](https://github.com/ben-eb/midas/blob/33a0da2f01c8dd7c954b8aa9f3edf1603d62d109/src/stringifier.js#L26)).\r\n\r\nCreating elements is pretty standardised between the hyperscript syntaxes, but there are big differences in how classes are handled: `hyperscript` must have them in the tag-name (`span.midas-foo`), `virtual-dom/h` / `hastscript` allows that too, but `React.createElement` doesn’t.  On the other hand, `React.createElement`, `virtual-dom/h`, and `hastscript` all allow a `className` property in the `props` object (`hyperscript` doesn’t).\r\n\r\nYou can either allow user’s to pass in their own `h()`, and mention `hyperscript` isn’t properly supported (they should do that conversion themselves if they want it), or go the whole way with `hastscript` / `hast-util-to-hyperscript`.\r\n\r\nAnd, next to that, `hast-util-to-html` has the best conversion to HTML to my knowledge, so using that to still provide support for compiled HTML gets a :+1: from me."}}
{"actor":{"display_login":"wooorm"}}