{"action":"created","issue":{"url":"https://api.github.com/repos/picodom/picodom/issues/94","repository_url":"https://api.github.com/repos/picodom/picodom","labels_url":"https://api.github.com/repos/picodom/picodom/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/picodom/picodom/issues/94/comments","events_url":"https://api.github.com/repos/picodom/picodom/issues/94/events","html_url":"https://github.com/picodom/picodom/issues/94","id":296582811,"number":94,"title":"2.0 API","user":{"login":"JorgeBucaran","id":56996,"avatar_url":"https://avatars1.githubusercontent.com/u/56996?v=4","gravatar_id":"","url":"https://api.github.com/users/JorgeBucaran","html_url":"https://github.com/JorgeBucaran","followers_url":"https://api.github.com/users/JorgeBucaran/followers","following_url":"https://api.github.com/users/JorgeBucaran/following{/other_user}","gists_url":"https://api.github.com/users/JorgeBucaran/gists{/gist_id}","starred_url":"https://api.github.com/users/JorgeBucaran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JorgeBucaran/subscriptions","organizations_url":"https://api.github.com/users/JorgeBucaran/orgs","repos_url":"https://api.github.com/users/JorgeBucaran/repos","events_url":"https://api.github.com/users/JorgeBucaran/events{/privacy}","received_events_url":"https://api.github.com/users/JorgeBucaran/received_events","type":"User","site_admin":false},"labels":[{"id":608774642,"url":"https://api.github.com/repos/picodom/picodom/labels/DISCUSSION","name":"DISCUSSION","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2018-02-13T01:24:02Z","updated_at":"2018-02-14T09:00:01Z","closed_at":null,"author_association":"OWNER","body":"Picodom@2.0.0 is coming to you very soon. The signature of <samp>patch</samp> needs to change, and I need your feedback to get it right.\r\n\r\nCloses\r\n- https://github.com/picodom/picodom/issues/80: I don't understand this issue.\r\n- https://github.com/picodom/picodom/issues/77: I will add new tests.\r\n- https://github.com/picodom/picodom/issues/92: Either one of below proposals will enable you to target a DOM element to be replaced instead of always pre-pending to a container.\r\n- https://github.com/picodom/picodom/issues/89: The \"Double Espresso Steamed Soy Milk Foam\" proposal below fixes this issue, but I'll likely proceed with \"Bitter Tea\" and close that issue as wontfix. There is no way to please everyone.\r\n- https://github.com/picodom/picodom/issues/65: I'll give a shot at adding types for VDOM events and close there.\r\n\r\n\r\n### Bitter Tea\r\n\r\nBring back the old pre-1.0 signature. This API is more flexible and easier to implement at the expense of a slightly worse developer experience (is it?). The justification is that Picodom is intended to be used to create tiny Hyperapp-like view frameworks instead of directly consumed. Still, this is IMO much better than similar popular alternatives.\r\n\r\n```js\r\nimport { h, patch } from \"picodom\"\r\n\r\n// First and every other patch.\r\nlet element = patch(\r\n  container,\r\n  element,\r\n  oldNode,\r\n  newNode\r\n)\r\n```\r\n\r\n### Double Espresso Steamed Soy Milk Foam\r\n\r\nThis proposal arguably improves the surface API providing at the expense of \"slightly\" less flexibility. This also has out of the box SSR DOM rehydration. This API makes consuming picodom directly more fun, but a bit awkward to integrate into your own library because you need to be aware there would be essentially two ways to call <samp>patch</samp>, the first time you call it, and every other time.\r\n\r\nSSR recycling is enabled by providing a <samp>recycleElement</samp> to patch that works the same way as https://github.com/hyperapp/hyperapp/pull/590.\r\n\r\n```js\r\nimport { h, patch } from \"picodom\"\r\n\r\n// First patch.\r\nlet element = patch(vnode, containerElement)\r\n\r\n// or first patch with server side rendered rehydration\r\n\r\nlet element = patch(vnode, containerElement, recycleElement)\r\n\r\n// Every other patch.\r\npatch(vnode, element)\r\n```\r\n\r\n/cc  @mindplay-dk @JSteunou  @estrattonbailey @pspeter3 @maxholman @dancespiele"},"comment":{"url":"https://api.github.com/repos/picodom/picodom/issues/comments/365538254","html_url":"https://github.com/picodom/picodom/issues/94#issuecomment-365538254","issue_url":"https://api.github.com/repos/picodom/picodom/issues/94","id":365538254,"user":{"login":"jameswilddev","id":3138458,"avatar_url":"https://avatars1.githubusercontent.com/u/3138458?v=4","gravatar_id":"","url":"https://api.github.com/users/jameswilddev","html_url":"https://github.com/jameswilddev","followers_url":"https://api.github.com/users/jameswilddev/followers","following_url":"https://api.github.com/users/jameswilddev/following{/other_user}","gists_url":"https://api.github.com/users/jameswilddev/gists{/gist_id}","starred_url":"https://api.github.com/users/jameswilddev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jameswilddev/subscriptions","organizations_url":"https://api.github.com/users/jameswilddev/orgs","repos_url":"https://api.github.com/users/jameswilddev/repos","events_url":"https://api.github.com/users/jameswilddev/events{/privacy}","received_events_url":"https://api.github.com/users/jameswilddev/received_events","type":"User","site_admin":false},"created_at":"2018-02-14T09:00:01Z","updated_at":"2018-02-14T09:00:01Z","author_association":"NONE","body":"In the case of the calendar example, it feels to me that the calendar should be its own VDOM as it is re-rendered at a different time to its surroundings.\r\n\r\nIf you can (or could?) include a raw DOM element in your VDOM, this would be quite easy to do from the API consumer end."}}
{"actor":{"display_login":"jameswilddev"}}