{"action":"created","issue":{"url":"https://api.github.com/repos/PolymerElements/polymer-starter-kit/issues/370","labels_url":"https://api.github.com/repos/PolymerElements/polymer-starter-kit/issues/370/labels{/name}","comments_url":"https://api.github.com/repos/PolymerElements/polymer-starter-kit/issues/370/comments","events_url":"https://api.github.com/repos/PolymerElements/polymer-starter-kit/issues/370/events","html_url":"https://github.com/PolymerElements/polymer-starter-kit/pull/370","id":107229639,"number":370,"title":"Remove double page refresh when adding jshint + js tasks","user":{"login":"didrocks","id":1823296,"avatar_url":"https://avatars.githubusercontent.com/u/1823296?v=3","gravatar_id":"","url":"https://api.github.com/users/didrocks","html_url":"https://github.com/didrocks","followers_url":"https://api.github.com/users/didrocks/followers","following_url":"https://api.github.com/users/didrocks/following{/other_user}","gists_url":"https://api.github.com/users/didrocks/gists{/gist_id}","starred_url":"https://api.github.com/users/didrocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/didrocks/subscriptions","organizations_url":"https://api.github.com/users/didrocks/orgs","repos_url":"https://api.github.com/users/didrocks/repos","events_url":"https://api.github.com/users/didrocks/events{/privacy}","received_events_url":"https://api.github.com/users/didrocks/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"nicolasgarnier","id":3766663,"avatar_url":"https://avatars.githubusercontent.com/u/3766663?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolasgarnier","html_url":"https://github.com/nicolasgarnier","followers_url":"https://api.github.com/users/nicolasgarnier/followers","following_url":"https://api.github.com/users/nicolasgarnier/following{/other_user}","gists_url":"https://api.github.com/users/nicolasgarnier/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolasgarnier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolasgarnier/subscriptions","organizations_url":"https://api.github.com/users/nicolasgarnier/orgs","repos_url":"https://api.github.com/users/nicolasgarnier/repos","events_url":"https://api.github.com/users/nicolasgarnier/events{/privacy}","received_events_url":"https://api.github.com/users/nicolasgarnier/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-09-18T15:58:19Z","updated_at":"2015-09-25T08:28:30Z","closed_at":"2015-09-24T15:13:26Z","pull_request":{"url":"https://api.github.com/repos/PolymerElements/polymer-starter-kit/pulls/370","html_url":"https://github.com/PolymerElements/polymer-starter-kit/pull/370","diff_url":"https://github.com/PolymerElements/polymer-starter-kit/pull/370.diff","patch_url":"https://github.com/PolymerElements/polymer-starter-kit/pull/370.patch"},"body":"Being convinced during the polymer summit by ebidel's talk to try es6\r\nwith polymer, I followed docs/add-es2015-support-babel.md.\r\n\r\nAdding jshint + js tasks triggers a double refresh request, but only the first\r\none is executed by the browser, and so, it runs most of the time previous\r\nversion of the code (transpiled by babel during last refresh). There is a thus\r\na race between the first browser refresh request and the transpilation of the\r\ncode.\r\n\r\ngulp serve gives, when saving a modified elements/**/*.html file:\r\n[18:13:42] Starting 'js'...\r\n[18:13:42] Starting 'jshint'...\r\n[PSK] Reloading Browsers...\r\n[18:13:44] Finished 'jshint' after 1.18 s\r\n[18:13:44] Finished 'js' after 1.76 s\r\n[PSK] Reloading Browsers...\r\n\r\nThis is due to the jshint task asking explicitely for a one time refresh.\r\nRemoving it fixes it and there is then only one refresh, once the code is\r\nproperly transpiled.\r\n\r\nThe new output of gulp serve once a js/html file is modified is:\r\n[18:22:49] Starting 'js'...\r\n[18:22:49] Starting 'jshint'...\r\n[18:22:50] Finished 'jshint' after 1.25 s\r\n[18:22:50] Finished 'js' after 1.62 s\r\n[PSK] Reloading Browsers...\r\n\r\nI don't see any reason why the jshint task (which is informational only) would\r\nneed to trigger a browser refresh, and thus, I removed it. I may miss something\r\nobvious though… :)\r\n"},"comment":{"url":"https://api.github.com/repos/PolymerElements/polymer-starter-kit/issues/comments/143159892","html_url":"https://github.com/PolymerElements/polymer-starter-kit/pull/370#issuecomment-143159892","issue_url":"https://api.github.com/repos/PolymerElements/polymer-starter-kit/issues/370","id":143159892,"user":{"login":"addyosmani","id":110953,"avatar_url":"https://avatars.githubusercontent.com/u/110953?v=3","gravatar_id":"","url":"https://api.github.com/users/addyosmani","html_url":"https://github.com/addyosmani","followers_url":"https://api.github.com/users/addyosmani/followers","following_url":"https://api.github.com/users/addyosmani/following{/other_user}","gists_url":"https://api.github.com/users/addyosmani/gists{/gist_id}","starred_url":"https://api.github.com/users/addyosmani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/addyosmani/subscriptions","organizations_url":"https://api.github.com/users/addyosmani/orgs","repos_url":"https://api.github.com/users/addyosmani/repos","events_url":"https://api.github.com/users/addyosmani/events{/privacy}","received_events_url":"https://api.github.com/users/addyosmani/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T08:28:30Z","updated_at":"2015-09-25T08:28:30Z","body":"Thanks for the review and testing @samccone! And once again thanks for the PR @didrocks!  "}}