{"action":"created","issue":{"url":"https://api.github.com/repos/shakacode/react_on_rails/issues/251","labels_url":"https://api.github.com/repos/shakacode/react_on_rails/issues/251/labels{/name}","comments_url":"https://api.github.com/repos/shakacode/react_on_rails/issues/251/comments","events_url":"https://api.github.com/repos/shakacode/react_on_rails/issues/251/events","html_url":"https://github.com/shakacode/react_on_rails/pull/251","id":130458964,"number":251,"title":"Optimize efficiency of EnsureAssetsCompiled functionality","user":{"login":"robwise","id":6173488,"avatar_url":"https://avatars.githubusercontent.com/u/6173488?v=3","gravatar_id":"","url":"https://api.github.com/users/robwise","html_url":"https://github.com/robwise","followers_url":"https://api.github.com/users/robwise/followers","following_url":"https://api.github.com/users/robwise/following{/other_user}","gists_url":"https://api.github.com/users/robwise/gists{/gist_id}","starred_url":"https://api.github.com/users/robwise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robwise/subscriptions","organizations_url":"https://api.github.com/users/robwise/orgs","repos_url":"https://api.github.com/users/robwise/repos","events_url":"https://api.github.com/users/robwise/events{/privacy}","received_events_url":"https://api.github.com/users/robwise/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/shakacode/react_on_rails/labels/review-needed","name":"review-needed","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-02-01T19:31:01Z","updated_at":"2016-02-02T05:30:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/shakacode/react_on_rails/pulls/251","html_url":"https://github.com/shakacode/react_on_rails/pull/251","diff_url":"https://github.com/shakacode/react_on_rails/pull/251.diff","patch_url":"https://github.com/shakacode/react_on_rails/pull/251.patch"},"body":"This commit changes the EnsureAssetsCompiled feature that ensures\r\nRSpec tests are run with the latest webpack bundles. Previously,\r\nwebpack bundles would be rebuilt every test run, whether or not\r\nthey actually needed to be. While one could around this by running\r\nwebpack in the background to rebuild the static assets, doing so\r\nrequired users to name their webpack build script exactly correct\r\nas the technique relied on a `pgrep`.\r\n\r\nInstead, the functionality checks the mdate on each generated webpack\r\nbundle/asset against the mdate of every file inside of the `client`\r\ndirectory, which is all encapsulated by the standard library method\r\n`FileUtils.uptodate?` and is very performant. This eliminates the\r\nneed to check for an existing webpack process because the webpack\r\nbundles will be up to date anyway if the latter is running.\r\n\r\nThis required adding some fixtures for proper testing. These can be\r\nfound in `spec/react_on_rails/fixtures/webpack_assets`.\r\n\r\n<!-- Reviewable:start -->\r\n[<img src=\"https://reviewable.io/review_button.svg\" height=\"40\" alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/shakacode/react_on_rails/251)\r\n<!-- Reviewable:end -->\r\n"},"comment":{"url":"https://api.github.com/repos/shakacode/react_on_rails/issues/comments/178384394","html_url":"https://github.com/shakacode/react_on_rails/pull/251#issuecomment-178384394","issue_url":"https://api.github.com/repos/shakacode/react_on_rails/issues/251","id":178384394,"user":{"login":"samnang","id":131172,"avatar_url":"https://avatars.githubusercontent.com/u/131172?v=3","gravatar_id":"","url":"https://api.github.com/users/samnang","html_url":"https://github.com/samnang","followers_url":"https://api.github.com/users/samnang/followers","following_url":"https://api.github.com/users/samnang/following{/other_user}","gists_url":"https://api.github.com/users/samnang/gists{/gist_id}","starred_url":"https://api.github.com/users/samnang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samnang/subscriptions","organizations_url":"https://api.github.com/users/samnang/orgs","repos_url":"https://api.github.com/users/samnang/repos","events_url":"https://api.github.com/users/samnang/events{/privacy}","received_events_url":"https://api.github.com/users/samnang/received_events","type":"User","site_admin":false},"created_at":"2016-02-02T05:30:34Z","updated_at":"2016-02-02T05:30:34Z","body":"\n\n\n\n\n\n\n\n*[spec/react_on_rails/webpack_assets_status_checker_spec.rb, line 14 \\[r3\\]](https://reviewable.io:443/reviews/shakacode/react_on_rails/251#-K9VSJCM7uMxP7FJJuCv:-K9VSJCNUKqp33Msh0xs:-1680451484) ([raw file](https://github.com/shakacode/react_on_rails/blob/f9946d00a39f894db082afb7a59ab35c7bfed657/spec/react_on_rails/webpack_assets_status_checker_spec.rb#L14)):*\nNo need to take any action. Be careful of overused `let`\n\nhttps://robots.thoughtbot.com/lets-not\n\n---\n\n\n*Comments from the [review on Reviewable.io](https://reviewable.io:443/reviews/shakacode/react_on_rails/251)*\n<!-- Sent from Reviewable.io -->\n"}}