GitHub PullRequestReviewCommentEvent at 2014-11-14 19:34:32
Repository: ractive
Actor: martypdx
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/ractivejs/ractive/pulls/comments/20380579","id":20380579,"diff_hunk":"@@ -45,6 +52,7 @@ export default function ( component, Component, data, mappings, yieldTemplate )\n \t\tel: null,\n \t\tappend: true,\n \t\tdata: data,\n+\t\tinlinePartials: inlinePartials,","path":"src/virtualdom/items/Component/initialise/createInstance.js","position":36,"original_position":36,"commit_id":"c7b71c112dd62a81c3658f03a9b9c64d8c178f5e","original_commit_id":"c7b71c112dd62a81c3658f03a9b9c64d8c178f5e","user":{"login":"martypdx","id":478864,"avatar_url":"https://avatars.githubusercontent.com/u/478864?v=3","gravatar_id":"","url":"https://api.github.com/users/martypdx","html_url":"https://github.com/martypdx","followers_url":"https://api.github.com/users/martypdx/followers","following_url":"https://api.github.com/users/martypdx/following{/other_user}","gists_url":"https://api.github.com/users/martypdx/gists{/gist_id}","starred_url":"https://api.github.com/users/martypdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martypdx/subscriptions","organizations_url":"https://api.github.com/users/martypdx/orgs","repos_url":"https://api.github.com/users/martypdx/repos","events_url":"https://api.github.com/users/martypdx/events{/privacy}","received_events_url":"https://api.github.com/users/martypdx/received_events","type":"User","site_admin":false},"body":"okay done. I moved it to `._inlinePartials` on the ractive instance as well if it's a ractive only thing at this point.","created_at":"2014-11-14T19:34:32Z","updated_at":"2014-11-14T19:34:32Z","html_url":"https://github.com/ractivejs/ractive/pull/1456#discussion_r20380579","pull_request_url":"https://api.github.com/repos/ractivejs/ractive/pulls/1456","_links":{"self":{"href":"https://api.github.com/repos/ractivejs/ractive/pulls/comments/20380579"},"html":{"href":"https://github.com/ractivejs/ractive/pull/1456#discussion_r20380579"},"pull_request":{"href":"https://api.github.com/repos/ractivejs/ractive/pulls/1456"}}},"pull_request":{"url":"https://api.github.com/repos/ractivejs/ractive/pulls/1456","id":24096609,"html_url":"https://github.com/ractivejs/ractive/pull/1456","diff_url":"https://github.com/ractivejs/ractive/pull/1456.diff","patch_url":"https://github.com/ractivejs/ractive/pull/1456.patch","issue_url":"https://api.github.com/repos/ractivejs/ractive/issues/1456","number":1456,"state":"closed","locked":false,"title":"Scoped inline partials and named yields - RFC","user":{"login":"evs-chris","id":161978,"avatar_url":"https://avatars.githubusercontent.com/u/161978?v=3","gravatar_id":"","url":"https://api.github.com/users/evs-chris","html_url":"https://github.com/evs-chris","followers_url":"https://api.github.com/users/evs-chris/followers","following_url":"https://api.github.com/users/evs-chris/following{/other_user}","gists_url":"https://api.github.com/users/evs-chris/gists{/gist_id}","starred_url":"https://api.github.com/users/evs-chris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evs-chris/subscriptions","organizations_url":"https://api.github.com/users/evs-chris/orgs","repos_url":"https://api.github.com/users/evs-chris/repos","events_url":"https://api.github.com/users/evs-chris/events{/privacy}","received_events_url":"https://api.github.com/users/evs-chris/received_events","type":"User","site_admin":false},"body":"This attempts to address a handful of issues ( #583, #1317, #1429, #1173 ). It basically moves inline partial parsing to the conversion process instead of having a shotgun regex extraction before beginning conversion. After the template is parsed, the partial nodes are extracted from the template and attached to the parent nearest instance (base or component). This allows:\r\n\r\n```html\r\n{{>part1}}\r\n<!-- {{>part1}} -->\r\n  I am part1 in the base instance\r\n<!-- {{/part1}} -->\r\n<cmp>\r\n  <!-- {{>part1}} -->\r\n    I am part1 attached to this cmp\r\n  <!-- {{/part1}} -->\r\n</cmp>\r\n```\r\n\r\n`cmp` can have a template (or partials) include `{{>part1}}`, and the instance from the template will have its provided partial overridden with the inline partial. Partials can still be defined anywhere in the template, and they will still be stuck on their nearest Ractive parent.\r\n\r\n### Named yields\r\n\r\nYielders get an extra conversion step, like partial context, that allows a name to be specified after `yield` e.g. `{{yield foo}}`. Instead of referencing a single `yieldTemplate` though, they reference either the root content of the component (internally represented as the name `''`) or an inline partial from the content of the component. Only inline partials from the component content can be referenced. The same rule of one yielder per component still applies, but it is expanded to one yielder per name per component.\r\n\r\n```html\r\n<cmp>\r\n  base content\r\n  <!-- {{>yieldMe}} -->\r\n    I can be yielded\r\n  <!-- {{/yieldMe}} -->\r\n</cmp\r\n```\r\n```js\r\nvar cmp = Ractive.extend({\r\n  template: '{{yield}} {{yield yieldMe}}'\r\n});\r\n// results in 'base content I can be yielded'\r\n```\r\n\r\n### Proposed extra section\r\n\r\nThe inline partial syntax is sometimes a little cumbersome. With the moving of the partial extraction process to be inline with the rest of parsing, an additional section could easily be introduced, since all it would need to do would be to drop the appropriate node in the template. Partial extraction and scoping would handle the rest. I like something like\r\n\r\n```html\r\n{{#block foo}}\r\n  inline partial content as usual\r\n{{/block}}\r\n<!-- or -->\r\n{{#yield foo}}\r\n  the same\r\n{{/yield}}\r\n<!-- UPDATE -->\r\n{{#partial foo}}\r\n  bar\r\n{{/partial}}\r\n```\r\n\r\n### Issues\r\n* ~~There are no tests yet.~~\r\n* ~~Only allows `{{ }}` and `[[ ]]` for inline partials definitions. This can be addressed. It is left out for now because I didn't want to create a regex for every parse attempt for partials.~~\r\n* If there isn't a base instance with all necessary components in place passed to the parser, the components won't get their inline partials. I don't think components work if they aren't already available at fragment-making time anyway.\r\n* Yielders and inline partials can be mixed within a component, which may be confusing. I see that flexibility as beneficial, though.\r\n* The differences between partials and yielders has blurred in my head, so I'm not sure I haven't broken something terribly. The existing tests pass though.","created_at":"2014-11-08T03:50:45Z","updated_at":"2014-11-14T19:34:32Z","closed_at":"2014-11-14T17:46:24Z","merged_at":"2014-11-14T17:46:24Z","merge_commit_sha":"813aae74146b78e96a1b555b4e2d0ca7831e8db3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ractivejs/ractive/pulls/1456/commits","review_comments_url":"https://api.github.com/repos/ractivejs/ractive/pulls/1456/comments","review_comment_url":"https://api.github.com/repos/ractivejs/ractive/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ractivejs/ractive/issues/1456/comments","statuses_url":"https://api.github.com/repos/ractivejs/ractive/statuses/c7b71c112dd62a81c3658f03a9b9c64d8c178f5e","head":{"label":"evs-chris:partial-anywhere","ref":"partial-anywhere","sha":"c7b71c112dd62a81c3658f03a9b9c64d8c178f5e","user":{"login":"evs-chris","id":161978,"avatar_url":"https://avatars.githubusercontent.com/u/161978?v=3","gravatar_id":"","url":"https://api.github.com/users/evs-chris","html_url":"https://github.com/evs-chris","followers_url":"https://api.github.com/users/evs-chris/followers","following_url":"https://api.github.com/users/evs-chris/following{/other_user}","gists_url":"https://api.github.com/users/evs-chris/gists{/gist_id}","starred_url":"https://api.github.com/users/evs-chris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evs-chris/subscriptions","organizations_url":"https://api.github.com/users/evs-chris/orgs","repos_url":"https://api.github.com/users/evs-chris/repos","events_url":"https://api.github.com/users/evs-chris/events{/privacy}","received_events_url":"https://api.github.com/users/evs-chris/received_events","type":"User","site_admin":false},"repo":{"id":21874947,"name":"ractive","full_name":"evs-chris/ractive","owner":{"login":"evs-chris","id":161978,"avatar_url":"https://avatars.githubusercontent.com/u/161978?v=3","gravatar_id":"","url":"https://api.github.com/users/evs-chris","html_url":"https://github.com/evs-chris","followers_url":"https://api.github.com/users/evs-chris/followers","following_url":"https://api.github.com/users/evs-chris/following{/other_user}","gists_url":"https://api.github.com/users/evs-chris/gists{/gist_id}","starred_url":"https://api.github.com/users/evs-chris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evs-chris/subscriptions","organizations_url":"https://api.github.com/users/evs-chris/orgs","repos_url":"https://api.github.com/users/evs-chris/repos","events_url":"https://api.github.com/users/evs-chris/events{/privacy}","received_events_url":"https://api.github.com/users/evs-chris/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/evs-chris/ractive","description":"Next-generation DOM manipulation","fork":true,"url":"https://api.github.com/repos/evs-chris/ractive","forks_url":"https://api.github.com/repos/evs-chris/ractive/forks","keys_url":"https://api.github.com/repos/evs-chris/ractive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/evs-chris/ractive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/evs-chris/ractive/teams","hooks_url":"https://api.github.com/repos/evs-chris/ractive/hooks","issue_events_url":"https://api.github.com/repos/evs-chris/ractive/issues/events{/number}","events_url":"https://api.github.com/repos/evs-chris/ractive/events","assignees_url":"https://api.github.com/repos/evs-chris/ractive/assignees{/user}","branches_url":"https://api.github.com/repos/evs-chris/ractive/branches{/branch}","tags_url":"https://api.github.com/repos/evs-chris/ractive/tags","blobs_url":"https://api.github.com/repos/evs-chris/ractive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/evs-chris/ractive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/evs-chris/ractive/git/refs{/sha}","trees_url":"https://api.github.com/repos/evs-chris/ractive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/evs-chris/ractive/statuses/{sha}","languages_url":"https://api.github.com/repos/evs-chris/ractive/languages","stargazers_url":"https://api.github.com/repos/evs-chris/ractive/stargazers","contributors_url":"https://api.github.com/repos/evs-chris/ractive/contributors","subscribers_url":"https://api.github.com/repos/evs-chris/ractive/subscribers","subscription_url":"https://api.github.com/repos/evs-chris/ractive/subscription","commits_url":"https://api.github.com/repos/evs-chris/ractive/commits{/sha}","git_commits_url":"https://api.github.com/repos/evs-chris/ractive/git/commits{/sha}","comments_url":"https://api.github.com/repos/evs-chris/ractive/comments{/number}","issue_comment_url":"https://api.github.com/repos/evs-chris/ractive/issues/comments/{number}","contents_url":"https://api.github.com/repos/evs-chris/ractive/contents/{+path}","compare_url":"https://api.github.com/repos/evs-chris/ractive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/evs-chris/ractive/merges","archive_url":"https://api.github.com/repos/evs-chris/ractive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/evs-chris/ractive/downloads","issues_url":"https://api.github.com/repos/evs-chris/ractive/issues{/number}","pulls_url":"https://api.github.com/repos/evs-chris/ractive/pulls{/number}","milestones_url":"https://api.github.com/repos/evs-chris/ractive/milestones{/number}","notifications_url":"https://api.github.com/repos/evs-chris/ractive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/evs-chris/ractive/labels{/name}","releases_url":"https://api.github.com/repos/evs-chris/ractive/releases{/id}","created_at":"2014-07-15T20:34:51Z","updated_at":"2014-07-15T20:55:36Z","pushed_at":"2014-11-14T17:19:50Z","git_url":"git://github.com/evs-chris/ractive.git","ssh_url":"git@github.com:evs-chris/ractive.git","clone_url":"https://github.com/evs-chris/ractive.git","svn_url":"https://github.com/evs-chris/ractive","homepage":"http://ractivejs.org","size":14996,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"ractivejs:dev","ref":"dev","sha":"2cefd74b49cd7b547755ebe59ab88d5f9025f568","user":{"login":"ractivejs","id":4751469,"avatar_url":"https://avatars.githubusercontent.com/u/4751469?v=3","gravatar_id":"","url":"https://api.github.com/users/ractivejs","html_url":"https://github.com/ractivejs","followers_url":"https://api.github.com/users/ractivejs/followers","following_url":"https://api.github.com/users/ractivejs/following{/other_user}","gists_url":"https://api.github.com/users/ractivejs/gists{/gist_id}","starred_url":"https://api.github.com/users/ractivejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ractivejs/subscriptions","organizations_url":"https://api.github.com/users/ractivejs/orgs","repos_url":"https://api.github.com/users/ractivejs/repos","events_url":"https://api.github.com/users/ractivejs/events{/privacy}","received_events_url":"https://api.github.com/users/ractivejs/received_events","type":"Organization","site_admin":false},"repo":{"id":5245894,"name":"ractive","full_name":"ractivejs/ractive","owner":{"login":"ractivejs","id":4751469,"avatar_url":"https://avatars.githubusercontent.com/u/4751469?v=3","gravatar_id":"","url":"https://api.github.com/users/ractivejs","html_url":"https://github.com/ractivejs","followers_url":"https://api.github.com/users/ractivejs/followers","following_url":"https://api.github.com/users/ractivejs/following{/other_user}","gists_url":"https://api.github.com/users/ractivejs/gists{/gist_id}","starred_url":"https://api.github.com/users/ractivejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ractivejs/subscriptions","organizations_url":"https://api.github.com/users/ractivejs/orgs","repos_url":"https://api.github.com/users/ractivejs/repos","events_url":"https://api.github.com/users/ractivejs/events{/privacy}","received_events_url":"https://api.github.com/users/ractivejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ractivejs/ractive","description":"Next-generation DOM manipulation","fork":false,"url":"https://api.github.com/repos/ractivejs/ractive","forks_url":"https://api.github.com/repos/ractivejs/ractive/forks","keys_url":"https://api.github.com/repos/ractivejs/ractive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ractivejs/ractive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ractivejs/ractive/teams","hooks_url":"https://api.github.com/repos/ractivejs/ractive/hooks","issue_events_url":"https://api.github.com/repos/ractivejs/ractive/issues/events{/number}","events_url":"https://api.github.com/repos/ractivejs/ractive/events","assignees_url":"https://api.github.com/repos/ractivejs/ractive/assignees{/user}","branches_url":"https://api.github.com/repos/ractivejs/ractive/branches{/branch}","tags_url":"https://api.github.com/repos/ractivejs/ractive/tags","blobs_url":"https://api.github.com/repos/ractivejs/ractive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ractivejs/ractive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ractivejs/ractive/git/refs{/sha}","trees_url":"https://api.github.com/repos/ractivejs/ractive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ractivejs/ractive/statuses/{sha}","languages_url":"https://api.github.com/repos/ractivejs/ractive/languages","stargazers_url":"https://api.github.com/repos/ractivejs/ractive/stargazers","contributors_url":"https://api.github.com/repos/ractivejs/ractive/contributors","subscribers_url":"https://api.github.com/repos/ractivejs/ractive/subscribers","subscription_url":"https://api.github.com/repos/ractivejs/ractive/subscription","commits_url":"https://api.github.com/repos/ractivejs/ractive/commits{/sha}","git_commits_url":"https://api.github.com/repos/ractivejs/ractive/git/commits{/sha}","comments_url":"https://api.github.com/repos/ractivejs/ractive/comments{/number}","issue_comment_url":"https://api.github.com/repos/ractivejs/ractive/issues/comments/{number}","contents_url":"https://api.github.com/repos/ractivejs/ractive/contents/{+path}","compare_url":"https://api.github.com/repos/ractivejs/ractive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ractivejs/ractive/merges","archive_url":"https://api.github.com/repos/ractivejs/ractive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ractivejs/ractive/downloads","issues_url":"https://api.github.com/repos/ractivejs/ractive/issues{/number}","pulls_url":"https://api.github.com/repos/ractivejs/ractive/pulls{/number}","milestones_url":"https://api.github.com/repos/ractivejs/ractive/milestones{/number}","notifications_url":"https://api.github.com/repos/ractivejs/ractive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ractivejs/ractive/labels{/name}","releases_url":"https://api.github.com/repos/ractivejs/ractive/releases{/id}","created_at":"2012-07-31T13:08:09Z","updated_at":"2014-11-14T15:12:10Z","pushed_at":"2014-11-14T17:49:42Z","git_url":"git://github.com/ractivejs/ractive.git","ssh_url":"git@github.com:ractivejs/ractive.git","clone_url":"https://github.com/ractivejs/ractive.git","svn_url":"https://github.com/ractivejs/ractive","homepage":"http://ractivejs.org","size":41206,"stargazers_count":3280,"watchers_count":3280,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":224,"mirror_url":null,"open_issues_count":146,"forks":224,"open_issues":146,"watchers":3280,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/ractivejs/ractive/pulls/1456"},"html":{"href":"https://github.com/ractivejs/ractive/pull/1456"},"issue":{"href":"https://api.github.com/repos/ractivejs/ractive/issues/1456"},"comments":{"href":"https://api.github.com/repos/ractivejs/ractive/issues/1456/comments"},"review_comments":{"href":"https://api.github.com/repos/ractivejs/ractive/pulls/1456/comments"},"review_comment":{"href":"https://api.github.com/repos/ractivejs/ractive/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ractivejs/ractive/pulls/1456/commits"},"statuses":{"href":"https://api.github.com/repos/ractivejs/ractive/statuses/c7b71c112dd62a81c3658f03a9b9c64d8c178f5e"}}}}