{"action":"created","issue":{"url":"https://api.github.com/repos/skatejs/skatejs/issues/1453","repository_url":"https://api.github.com/repos/skatejs/skatejs","labels_url":"https://api.github.com/repos/skatejs/skatejs/issues/1453/labels{/name}","comments_url":"https://api.github.com/repos/skatejs/skatejs/issues/1453/comments","events_url":"https://api.github.com/repos/skatejs/skatejs/issues/1453/events","html_url":"https://github.com/skatejs/skatejs/issues/1453","id":337628589,"node_id":"MDU6SXNzdWUzMzc2Mjg1ODk=","number":1453,"title":"Idea: a DOM node can contain contexts, and subnodes can get them by unique reference","user":{"login":"trusktr","id":297678,"node_id":"MDQ6VXNlcjI5NzY3OA==","avatar_url":"https://avatars3.githubusercontent.com/u/297678?v=4","gravatar_id":"","url":"https://api.github.com/users/trusktr","html_url":"https://github.com/trusktr","followers_url":"https://api.github.com/users/trusktr/followers","following_url":"https://api.github.com/users/trusktr/following{/other_user}","gists_url":"https://api.github.com/users/trusktr/gists{/gist_id}","starred_url":"https://api.github.com/users/trusktr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trusktr/subscriptions","organizations_url":"https://api.github.com/users/trusktr/orgs","repos_url":"https://api.github.com/users/trusktr/repos","events_url":"https://api.github.com/users/trusktr/events{/privacy}","received_events_url":"https://api.github.com/users/trusktr/received_events","type":"User","site_admin":false},"labels":[{"id":78094227,"node_id":"MDU6TGFiZWw3ODA5NDIyNw==","url":"https://api.github.com/repos/skatejs/skatejs/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":981871003,"node_id":"MDU6TGFiZWw5ODE4NzEwMDM=","url":"https://api.github.com/repos/skatejs/skatejs/labels/idea","name":"idea","color":"f7b4c1","default":false},{"id":773955986,"node_id":"MDU6TGFiZWw3NzM5NTU5ODY=","url":"https://api.github.com/repos/skatejs/skatejs/labels/package:%20skatejs","name":"package: skatejs","color":"70efcb","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2018-07-02T19:02:05Z","updated_at":"2018-07-12T08:31:33Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I was looking at\r\n\r\nhttps://github.com/skatejs/skatejs/blob/6d9fd2c1f6380ee1497e4286fe627660175e80d0/packages/skatejs/src/with-context.js#L10-L14\r\n\r\nIt looks like a sub-context can block one that is higher up. So if I stick a node in the middle of the tree with a context, it'll prevent a leaf node from getting a context from the top of the tree.\r\n\r\nWhat does React do?\r\n\r\nWhat if we change `set context` so that contexts inherit:\r\n\r\n```js\r\n    set context(context: Object): void {\r\n      if (!this._context)\r\n        this._context = Object.create(this.context);\r\n          \r\n      Object.assign(this._context, context); // naive copy, could be better\r\n    }\r\n```\r\n\r\nThis reminds me of `$scope` in Angular 1, which inherit from parent scopes.\r\n\r\nThe problem with this would be that, if we re-parent a node that has a context to another parent, the inheritance of the context would still be based on the old location which might not make sense. To solve this we could use connected/disconnected callbacks to change the prototype of the moved node's context."},"comment":{"url":"https://api.github.com/repos/skatejs/skatejs/issues/comments/404433579","html_url":"https://github.com/skatejs/skatejs/issues/1453#issuecomment-404433579","issue_url":"https://api.github.com/repos/skatejs/skatejs/issues/1453","id":404433579,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDQzMzU3OQ==","user":{"login":"trusktr","id":297678,"node_id":"MDQ6VXNlcjI5NzY3OA==","avatar_url":"https://avatars3.githubusercontent.com/u/297678?v=4","gravatar_id":"","url":"https://api.github.com/users/trusktr","html_url":"https://github.com/trusktr","followers_url":"https://api.github.com/users/trusktr/followers","following_url":"https://api.github.com/users/trusktr/following{/other_user}","gists_url":"https://api.github.com/users/trusktr/gists{/gist_id}","starred_url":"https://api.github.com/users/trusktr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trusktr/subscriptions","organizations_url":"https://api.github.com/users/trusktr/orgs","repos_url":"https://api.github.com/users/trusktr/repos","events_url":"https://api.github.com/users/trusktr/events{/privacy}","received_events_url":"https://api.github.com/users/trusktr/received_events","type":"User","site_admin":false},"created_at":"2018-07-12T08:31:33Z","updated_at":"2018-07-12T08:31:33Z","author_association":"CONTRIBUTOR","body":"Something that came to mind: it could be possible to make my second PR implementation fall back to the no-parent-require singleton approach when there's no common Skate ancestor between Skate subtrees and a context needs to be shared between them all."}}
{"actor":{"display_login":"trusktr"}}