{"action":"created","comment":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments/35778407","id":35778407,"diff_hunk":"@@ -482,7 +487,13 @@ Marionette.CollectionView = Marionette.View.extend({\n \n   // render the child view\n   renderChildView: function(view, index) {\n+    if (!(view instanceof Marionette.View)) {\n+      Marionette.triggerMethodOn(view, 'before:render', view);\n+    }\n     view.render();\n+    if (!(view instanceof Marionette.View)) {","path":"src/collection-view.js","position":56,"original_position":56,"commit_id":"730914c6087351f4214a4e7d5ec2957c135578b6","original_commit_id":"730914c6087351f4214a4e7d5ec2957c135578b6","user":{"login":"jmeas","id":2322305,"avatar_url":"https://avatars.githubusercontent.com/u/2322305?v=3","gravatar_id":"","url":"https://api.github.com/users/jmeas","html_url":"https://github.com/jmeas","followers_url":"https://api.github.com/users/jmeas/followers","following_url":"https://api.github.com/users/jmeas/following{/other_user}","gists_url":"https://api.github.com/users/jmeas/gists{/gist_id}","starred_url":"https://api.github.com/users/jmeas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmeas/subscriptions","organizations_url":"https://api.github.com/users/jmeas/orgs","repos_url":"https://api.github.com/users/jmeas/repos","events_url":"https://api.github.com/users/jmeas/events{/privacy}","received_events_url":"https://api.github.com/users/jmeas/received_events","type":"User","site_admin":false},"body":"Actually, looks like it's used multiple times throughout the app. This makes me wanna vom a little but `isMarionetteView` could be a helper we introduce lol","created_at":"2015-07-29T16:14:58Z","updated_at":"2015-07-29T16:14:58Z","html_url":"https://github.com/marionettejs/backbone.marionette/pull/2658#discussion_r35778407","pull_request_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2658","_links":{"self":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments/35778407"},"html":{"href":"https://github.com/marionettejs/backbone.marionette/pull/2658#discussion_r35778407"},"pull_request":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2658"}}},"pull_request":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2658","id":39193294,"html_url":"https://github.com/marionettejs/backbone.marionette/pull/2658","diff_url":"https://github.com/marionettejs/backbone.marionette/pull/2658.diff","patch_url":"https://github.com/marionettejs/backbone.marionette/pull/2658.patch","issue_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2658","number":2658,"state":"open","locked":false,"title":"Improve support for Backbone.View childViews","user":{"login":"ianmstew","id":4119765,"avatar_url":"https://avatars.githubusercontent.com/u/4119765?v=3","gravatar_id":"","url":"https://api.github.com/users/ianmstew","html_url":"https://github.com/ianmstew","followers_url":"https://api.github.com/users/ianmstew/followers","following_url":"https://api.github.com/users/ianmstew/following{/other_user}","gists_url":"https://api.github.com/users/ianmstew/gists{/gist_id}","starred_url":"https://api.github.com/users/ianmstew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianmstew/subscriptions","organizations_url":"https://api.github.com/users/ianmstew/orgs","repos_url":"https://api.github.com/users/ianmstew/repos","events_url":"https://api.github.com/users/ianmstew/events{/privacy}","received_events_url":"https://api.github.com/users/ianmstew/received_events","type":"User","site_admin":false},"body":"**This PR**\r\n\r\n1. Cleans up collection-view and on-attach specs.\r\n2. Significantly improves Backbone View child view test coverage (fixes #2657).  Moving child views to Backbone.View in `collection-view.spec.js` and `on-attach.spec.js` broke a handful of existing tests.\r\n3. Fixes #2651.\r\n4. Adds support for `before:render`, `render`, `before:destroy`, `destroy`, and `dom:refresh` view lifecycle events specifically for Backbone.View child views of Regions (and therefore LayoutViews) and CollectionViews.  This _completely fixed_ the broken tests in **(2)** above.\r\n\r\n**Thoughts on better testing**\r\n\r\nTo improve on testing the Backbone View child view case, I converted `collection-view.spec.js` and `on-attach.spec.js` to use Backbone View child views by default.  I imagine this approach can be carried forward to future test cases and backward to any other existing child view test cases.\r\n\r\n**Note on dom:refresh support for Backbone.View**\r\n\r\nI had to add a flag `_isDomRefreshMonitored` to views within `Marionette.MonitorDOMRefresh` in order to gain `dom:refresh` from Backbone.Views shown by `Region#show` (see [Region#show commit diff](https://github.com/ianmstew/backbone.marionette/commit/730914c6087351f4214a4e7d5ec2957c135578b6#diff-b8da5292cb07ec757ac64e78ff5af5c1R204)).  Please let me know if anyone disapproves.","created_at":"2015-07-03T19:23:08Z","updated_at":"2015-07-29T16:14:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ac71ff9aa986ba474d8ae3ea89a438556f1bee03","assignee":null,"milestone":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/milestones/32","html_url":"https://github.com/marionettejs/backbone.marionette/milestones/v2.4.3","labels_url":"https://api.github.com/repos/marionettejs/backbone.marionette/milestones/32/labels","id":1182945,"number":32,"title":"v2.4.3","description":null,"creator":{"login":"ianmstew","id":4119765,"avatar_url":"https://avatars.githubusercontent.com/u/4119765?v=3","gravatar_id":"","url":"https://api.github.com/users/ianmstew","html_url":"https://github.com/ianmstew","followers_url":"https://api.github.com/users/ianmstew/followers","following_url":"https://api.github.com/users/ianmstew/following{/other_user}","gists_url":"https://api.github.com/users/ianmstew/gists{/gist_id}","starred_url":"https://api.github.com/users/ianmstew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianmstew/subscriptions","organizations_url":"https://api.github.com/users/ianmstew/orgs","repos_url":"https://api.github.com/users/ianmstew/repos","events_url":"https://api.github.com/users/ianmstew/events{/privacy}","received_events_url":"https://api.github.com/users/ianmstew/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":7,"state":"open","created_at":"2015-06-26T17:26:26Z","updated_at":"2015-07-29T14:14:10Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2658/commits","review_comments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2658/comments","review_comment_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments{/number}","comments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2658/comments","statuses_url":"https://api.github.com/repos/marionettejs/backbone.marionette/statuses/730914c6087351f4214a4e7d5ec2957c135578b6","head":{"label":"ianmstew:backbone-view-support","ref":"backbone-view-support","sha":"730914c6087351f4214a4e7d5ec2957c135578b6","user":{"login":"ianmstew","id":4119765,"avatar_url":"https://avatars.githubusercontent.com/u/4119765?v=3","gravatar_id":"","url":"https://api.github.com/users/ianmstew","html_url":"https://github.com/ianmstew","followers_url":"https://api.github.com/users/ianmstew/followers","following_url":"https://api.github.com/users/ianmstew/following{/other_user}","gists_url":"https://api.github.com/users/ianmstew/gists{/gist_id}","starred_url":"https://api.github.com/users/ianmstew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianmstew/subscriptions","organizations_url":"https://api.github.com/users/ianmstew/orgs","repos_url":"https://api.github.com/users/ianmstew/repos","events_url":"https://api.github.com/users/ianmstew/events{/privacy}","received_events_url":"https://api.github.com/users/ianmstew/received_events","type":"User","site_admin":false},"repo":{"id":32547338,"name":"backbone.marionette","full_name":"ianmstew/backbone.marionette","owner":{"login":"ianmstew","id":4119765,"avatar_url":"https://avatars.githubusercontent.com/u/4119765?v=3","gravatar_id":"","url":"https://api.github.com/users/ianmstew","html_url":"https://github.com/ianmstew","followers_url":"https://api.github.com/users/ianmstew/followers","following_url":"https://api.github.com/users/ianmstew/following{/other_user}","gists_url":"https://api.github.com/users/ianmstew/gists{/gist_id}","starred_url":"https://api.github.com/users/ianmstew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianmstew/subscriptions","organizations_url":"https://api.github.com/users/ianmstew/orgs","repos_url":"https://api.github.com/users/ianmstew/repos","events_url":"https://api.github.com/users/ianmstew/events{/privacy}","received_events_url":"https://api.github.com/users/ianmstew/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ianmstew/backbone.marionette","description":"The Backbone Framework","fork":true,"url":"https://api.github.com/repos/ianmstew/backbone.marionette","forks_url":"https://api.github.com/repos/ianmstew/backbone.marionette/forks","keys_url":"https://api.github.com/repos/ianmstew/backbone.marionette/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ianmstew/backbone.marionette/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ianmstew/backbone.marionette/teams","hooks_url":"https://api.github.com/repos/ianmstew/backbone.marionette/hooks","issue_events_url":"https://api.github.com/repos/ianmstew/backbone.marionette/issues/events{/number}","events_url":"https://api.github.com/repos/ianmstew/backbone.marionette/events","assignees_url":"https://api.github.com/repos/ianmstew/backbone.marionette/assignees{/user}","branches_url":"https://api.github.com/repos/ianmstew/backbone.marionette/branches{/branch}","tags_url":"https://api.github.com/repos/ianmstew/backbone.marionette/tags","blobs_url":"https://api.github.com/repos/ianmstew/backbone.marionette/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ianmstew/backbone.marionette/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ianmstew/backbone.marionette/git/refs{/sha}","trees_url":"https://api.github.com/repos/ianmstew/backbone.marionette/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ianmstew/backbone.marionette/statuses/{sha}","languages_url":"https://api.github.com/repos/ianmstew/backbone.marionette/languages","stargazers_url":"https://api.github.com/repos/ianmstew/backbone.marionette/stargazers","contributors_url":"https://api.github.com/repos/ianmstew/backbone.marionette/contributors","subscribers_url":"https://api.github.com/repos/ianmstew/backbone.marionette/subscribers","subscription_url":"https://api.github.com/repos/ianmstew/backbone.marionette/subscription","commits_url":"https://api.github.com/repos/ianmstew/backbone.marionette/commits{/sha}","git_commits_url":"https://api.github.com/repos/ianmstew/backbone.marionette/git/commits{/sha}","comments_url":"https://api.github.com/repos/ianmstew/backbone.marionette/comments{/number}","issue_comment_url":"https://api.github.com/repos/ianmstew/backbone.marionette/issues/comments{/number}","contents_url":"https://api.github.com/repos/ianmstew/backbone.marionette/contents/{+path}","compare_url":"https://api.github.com/repos/ianmstew/backbone.marionette/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ianmstew/backbone.marionette/merges","archive_url":"https://api.github.com/repos/ianmstew/backbone.marionette/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ianmstew/backbone.marionette/downloads","issues_url":"https://api.github.com/repos/ianmstew/backbone.marionette/issues{/number}","pulls_url":"https://api.github.com/repos/ianmstew/backbone.marionette/pulls{/number}","milestones_url":"https://api.github.com/repos/ianmstew/backbone.marionette/milestones{/number}","notifications_url":"https://api.github.com/repos/ianmstew/backbone.marionette/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ianmstew/backbone.marionette/labels{/name}","releases_url":"https://api.github.com/repos/ianmstew/backbone.marionette/releases{/id}","created_at":"2015-03-19T21:32:03Z","updated_at":"2015-03-19T21:32:05Z","pushed_at":"2015-07-29T03:35:35Z","git_url":"git://github.com/ianmstew/backbone.marionette.git","ssh_url":"git@github.com:ianmstew/backbone.marionette.git","clone_url":"https://github.com/ianmstew/backbone.marionette.git","svn_url":"https://github.com/ianmstew/backbone.marionette","homepage":"http://marionettejs.com","size":10794,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"marionettejs:patch","ref":"patch","sha":"6916096070973f8f50a78e33fa45d169a124f704","user":{"login":"marionettejs","id":2273169,"avatar_url":"https://avatars.githubusercontent.com/u/2273169?v=3","gravatar_id":"","url":"https://api.github.com/users/marionettejs","html_url":"https://github.com/marionettejs","followers_url":"https://api.github.com/users/marionettejs/followers","following_url":"https://api.github.com/users/marionettejs/following{/other_user}","gists_url":"https://api.github.com/users/marionettejs/gists{/gist_id}","starred_url":"https://api.github.com/users/marionettejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marionettejs/subscriptions","organizations_url":"https://api.github.com/users/marionettejs/orgs","repos_url":"https://api.github.com/users/marionettejs/repos","events_url":"https://api.github.com/users/marionettejs/events{/privacy}","received_events_url":"https://api.github.com/users/marionettejs/received_events","type":"Organization","site_admin":false},"repo":{"id":2965621,"name":"backbone.marionette","full_name":"marionettejs/backbone.marionette","owner":{"login":"marionettejs","id":2273169,"avatar_url":"https://avatars.githubusercontent.com/u/2273169?v=3","gravatar_id":"","url":"https://api.github.com/users/marionettejs","html_url":"https://github.com/marionettejs","followers_url":"https://api.github.com/users/marionettejs/followers","following_url":"https://api.github.com/users/marionettejs/following{/other_user}","gists_url":"https://api.github.com/users/marionettejs/gists{/gist_id}","starred_url":"https://api.github.com/users/marionettejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marionettejs/subscriptions","organizations_url":"https://api.github.com/users/marionettejs/orgs","repos_url":"https://api.github.com/users/marionettejs/repos","events_url":"https://api.github.com/users/marionettejs/events{/privacy}","received_events_url":"https://api.github.com/users/marionettejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/marionettejs/backbone.marionette","description":"The Backbone Framework","fork":false,"url":"https://api.github.com/repos/marionettejs/backbone.marionette","forks_url":"https://api.github.com/repos/marionettejs/backbone.marionette/forks","keys_url":"https://api.github.com/repos/marionettejs/backbone.marionette/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marionettejs/backbone.marionette/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marionettejs/backbone.marionette/teams","hooks_url":"https://api.github.com/repos/marionettejs/backbone.marionette/hooks","issue_events_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/events{/number}","events_url":"https://api.github.com/repos/marionettejs/backbone.marionette/events","assignees_url":"https://api.github.com/repos/marionettejs/backbone.marionette/assignees{/user}","branches_url":"https://api.github.com/repos/marionettejs/backbone.marionette/branches{/branch}","tags_url":"https://api.github.com/repos/marionettejs/backbone.marionette/tags","blobs_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/refs{/sha}","trees_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marionettejs/backbone.marionette/statuses/{sha}","languages_url":"https://api.github.com/repos/marionettejs/backbone.marionette/languages","stargazers_url":"https://api.github.com/repos/marionettejs/backbone.marionette/stargazers","contributors_url":"https://api.github.com/repos/marionettejs/backbone.marionette/contributors","subscribers_url":"https://api.github.com/repos/marionettejs/backbone.marionette/subscribers","subscription_url":"https://api.github.com/repos/marionettejs/backbone.marionette/subscription","commits_url":"https://api.github.com/repos/marionettejs/backbone.marionette/commits{/sha}","git_commits_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/commits{/sha}","comments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/comments{/number}","issue_comment_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/comments{/number}","contents_url":"https://api.github.com/repos/marionettejs/backbone.marionette/contents/{+path}","compare_url":"https://api.github.com/repos/marionettejs/backbone.marionette/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marionettejs/backbone.marionette/merges","archive_url":"https://api.github.com/repos/marionettejs/backbone.marionette/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marionettejs/backbone.marionette/downloads","issues_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues{/number}","pulls_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls{/number}","milestones_url":"https://api.github.com/repos/marionettejs/backbone.marionette/milestones{/number}","notifications_url":"https://api.github.com/repos/marionettejs/backbone.marionette/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marionettejs/backbone.marionette/labels{/name}","releases_url":"https://api.github.com/repos/marionettejs/backbone.marionette/releases{/id}","created_at":"2011-12-12T16:36:09Z","updated_at":"2015-07-29T14:25:29Z","pushed_at":"2015-07-29T14:13:10Z","git_url":"git://github.com/marionettejs/backbone.marionette.git","ssh_url":"git@github.com:marionettejs/backbone.marionette.git","clone_url":"https://github.com/marionettejs/backbone.marionette.git","svn_url":"https://github.com/marionettejs/backbone.marionette","homepage":"http://marionettejs.com","size":22636,"stargazers_count":6341,"watchers_count":6341,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1254,"mirror_url":null,"open_issues_count":136,"forks":1254,"open_issues":136,"watchers":6341,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2658"},"html":{"href":"https://github.com/marionettejs/backbone.marionette/pull/2658"},"issue":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2658"},"comments":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2658/comments"},"review_comments":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2658/comments"},"review_comment":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2658/commits"},"statuses":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/statuses/730914c6087351f4214a4e7d5ec2957c135578b6"}}}}