{"action":"created","issue":{"url":"https://api.github.com/repos/leeoniya/domvm/issues/36","repository_url":"https://api.github.com/repos/leeoniya/domvm","labels_url":"https://api.github.com/repos/leeoniya/domvm/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/leeoniya/domvm/issues/36/comments","events_url":"https://api.github.com/repos/leeoniya/domvm/issues/36/events","html_url":"https://github.com/leeoniya/domvm/issues/36","id":142510302,"number":36,"title":"missing docs","user":{"login":"leeoniya","id":43234,"avatar_url":"https://avatars.githubusercontent.com/u/43234?v=3","gravatar_id":"","url":"https://api.github.com/users/leeoniya","html_url":"https://github.com/leeoniya","followers_url":"https://api.github.com/users/leeoniya/followers","following_url":"https://api.github.com/users/leeoniya/following{/other_user}","gists_url":"https://api.github.com/users/leeoniya/gists{/gist_id}","starred_url":"https://api.github.com/users/leeoniya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leeoniya/subscriptions","organizations_url":"https://api.github.com/users/leeoniya/orgs","repos_url":"https://api.github.com/users/leeoniya/repos","events_url":"https://api.github.com/users/leeoniya/events{/privacy}","received_events_url":"https://api.github.com/users/leeoniya/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/leeoniya/domvm/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":22,"created_at":"2016-03-22T00:30:24Z","updated_at":"2016-06-23T19:51:30Z","closed_at":null,"body":"Here is my (non-exhaustive) list of things to document. I will keep it updated as they are finished or as more are added.\r\n\r\n**API**\r\n- `domvm.utils.tick` + any other useful util methods\r\n- `vm.patch()`\r\n\t- `vm.patch(oldNode, newTpl)`\r\n\t- `vm.patch(oldNode, {style:..., class:...})`\r\n- `vm.api` (=== `this` in render() and init closure)\r\n- `domvm.view.extend(function(vm) {...})` (view monkey-patching)\r\n- `vm.unmount()`\r\n- `vm.mount(target, true)` will treat target as root and clear it first\r\n- `vm.update(newModel)` for `false`-handle views (stateful slots)\r\n- namespaced refs: `_ref: \"a.b.c\"` => `vm.refs.a.b.c`\r\n- exposed refs (`_ref: \"^moo\"`)\r\n\t- using them for a restricted event bus/selective sub-view redraw\r\n- node-level `_diff: [cmpFn, data1, data2]` as alternative to splitting off sub-views & caching old values\r\n- explicit tagging of child arrays `kids._expl = true`\r\n- `willUpdate` vm hook\r\n- passing hooks into sub-view from parent via `opts`\r\n- `[\"p.moo\", {class: \"active\"}` results in `<p class=\"moo active\">`\r\n- returning `false` from `render()` as sub-view perf optim (inactive sub-views, 0-diff)\r\n- `watch`, `hooks` and `evctx` params in view opts\r\n- full sigs of all callbacks/user-supplied funcs\r\n- examples of using `_data`\r\n- entire `watch` module\r\n\t- w.get/post/etc\r\n\t\t- signatures\r\n\t\t- success/error callbacks\r\n\t- w.prop\r\n\t\t- async props with initial values\r\n\t\t- asyc prop.update()\r\n\t\t- pass `false` to mutate without firing handler, or alternate handler\r\n\t\t- `middleWare` param for validation/value transforming\r\n\t- w.sync\r\n\t- w.fire\r\n- todo: add vm.route.extend?\r\n\r\n**General**\r\n- explain what that vm is the lib's native api portion of the ViewModel\r\n- make it clear that all views require a single root node\r\n- the fact that `name` and `_ref` implicitly set _key if not present\r\n- no need for explicit props of some common input attrs, like \".checked\" etc..\r\n- more detailed lifeycle hooks docs\r\n- more routing examples\r\n- document vtree/vm architecture https://github.com/leeoniya/domvm/issues/72#issuecomment-217569703\r\n\r\n**Footguns**\r\n- add section explaining handle/key and model persistence implications for state retention and DOM recycling\r\n- if model is destroyed and recreated on every redraw() (like via JSON.parse), opt view out of persistence to ensure dom is reused rather than re-created: `[myView, tempData, false]`\r\n- encourage use of sub-renderers to break up templates instead of sub-views when not necessary, since perf is better and nodes can carry persistent state via a combo of `_ref` and `_data`\r\n- explain that using _key is not a perf optimization and not required if model is persistent. and should be used only for json-style re-created data or to enforce destruction of state and prevent dom recycle.\r\n- show that while viewFn (init closure) and render() sigs are the same, the former is immutable while latter is mutable in cases of non-persistent models via `vm.update(newModel)` or `[myView, newModel, false]`\r\n- add section about ensuring that dynamic form elem props are always re-synced back to model\r\n- dont re-create event handlers inline, pull them out of render()\r\n- explain that dom event handlers have a sig of `handler(arg1..., e, node, vm)` if defined as `onclick: [handler, arg1, arg2]`, else `handler(e, node, vm)`.\r\n- debugging slow perf using DOMInstr\r\n- shorthand id/class attrs on elems must be in `div#id.class1.class2...` order\r\n- more visible docs about explicit child array restrictions & work-around\r\n- `mount(body, true)` from in-body script, ensure to wrap in `DOMContentLoaded`: https://github.com/leeoniya/domvm/issues/56#issuecomment-213210948\r\n- avoid holding references to the `vm.refs` object to dom nodes #58\r\n\r\n@lawrence-dol\r\n@iamjohnlong"},"comment":{"url":"https://api.github.com/repos/leeoniya/domvm/issues/comments/228163865","html_url":"https://github.com/leeoniya/domvm/issues/36#issuecomment-228163865","issue_url":"https://api.github.com/repos/leeoniya/domvm/issues/36","id":228163865,"user":{"login":"lawrence-dol","id":8662551,"avatar_url":"https://avatars.githubusercontent.com/u/8662551?v=3","gravatar_id":"","url":"https://api.github.com/users/lawrence-dol","html_url":"https://github.com/lawrence-dol","followers_url":"https://api.github.com/users/lawrence-dol/followers","following_url":"https://api.github.com/users/lawrence-dol/following{/other_user}","gists_url":"https://api.github.com/users/lawrence-dol/gists{/gist_id}","starred_url":"https://api.github.com/users/lawrence-dol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lawrence-dol/subscriptions","organizations_url":"https://api.github.com/users/lawrence-dol/orgs","repos_url":"https://api.github.com/users/lawrence-dol/repos","events_url":"https://api.github.com/users/lawrence-dol/events{/privacy}","received_events_url":"https://api.github.com/users/lawrence-dol/received_events","type":"User","site_admin":false},"created_at":"2016-06-23T19:51:30Z","updated_at":"2016-06-23T19:51:30Z","body":"I'd lean toward an 80/20 topical format with each topic split into Fundamentals and Experts section, and a separate alphabetical cross-reference index page that links to the appropriate places. That way the same pages can serve as a learning tool and a reference tool.\r\n\r\nI'd be quite happy to set up the outline once the format is agreed, or set something up by way of example for you to review. In my other life I teach, so I am pretty good at that kind of thing. I might be able to work on it this coming weekend; but definitely not the following two (vacation and then teaching on Saturday)."}}
{"actor":{"display_login":"lawrence-dol"}}