{"action":"created","comment":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/48470402","id":48470402,"diff_hunk":"@@ -1,184 +1,171 @@\n-> * 原文链接 : [Introducing Pokedex.org: a progressive webapp for Pokémon fans — Pocket JavaScript](http://www.pocketjavascript.com/blog/2015/11/23/introducing-pokedex-org)\n+>\t* 原文链接 : [Introducing Pokedex.org: a progressive webapp for Pokémon fans — Pocket JavaScript](http://www.pocketjavascript.com/blog/2015/11/23/introducing-pokedex-org)\n * 原文作者 : [NOLAN LAWSON](http://www.pocketjavascript.com/?author=539b3a09e4b0dc27b9618c7a)\n * 译文出自 : [掘金翻译计划](https://github.com/xitu/gold-miner)\n-* 译者 : \n+* 译者 : RobertWang\n * 校对者: \n-* 状态 :  待定\n+* 状态 : Done - Version 1\n \n-The mobile web has a bad reputation these days. Everyone agrees it's slow, but there's no shortage of differing opinions on how to fix it.\n+-----\n \n-Recently, Jeff Atwood argued convincingly that [the state of single-threaded JavaScript on Android is poor](https://meta.discourse.org/t/the-state-of-javascript-on-android-in-2015-is-poor/33889). Then Henrik Joreteg questioned [the viability of JavaScript frameworks on mobile](https://joreteg.com/blog/viability-of-js-frameworks-on-mobile) altogether, saying that tools like Ember and Angular are just too bloated for mobile networks to bear. (See also [these](https://aerotwist.com/blog/the-cost-of-frameworks/) [posts](http://tomdale.net/2015/11/javascript-frameworks-and-mobile-performance/) for a good follow-up discussion.)\n+# Pokedex.org 给宠物小精灵爱好者的 web app 的技术选型\n \n-So to recap: Atwood says the problem is single-threadedness; Joreteg says it's mobile networks. And in my opinion, they're both right. As someone who does nearly as much Android development as web development, I can tell you first-hand that the network and concurrency are two of my primary concerns when writing a performant native app.\n+移动网站有个坏名声。大家都认为它很慢，但在如何修复的问题上并不缺少不同的意见。\n \n-Ask any iOS or Android developer how we make our apps so fast, and most likely you'll hear about two major strategies:\n+近日，`Jeff Atwood` 令人信服地指出[在Android设备上的单线程JavaScript的状态表现差](https://meta.discourse.org/t/the-state-of-javascript-on-android-in-2015-is-poor/33889)。然后 `Henrik Joreteg` 也质疑[JavaScript框架的在移动端生存能力](https://joreteg.com/blog/viability-of-js-frameworks-on-mobile)，他说对于在移动网络上承担像 `Ember` 和 `Angular` 的框架是太过臃肿。(为了后续良好的讨论，请参见[这些](https://aerotwist.com/blog/the-cost-of-frameworks/) [文章](http://tomdale.net/2015/11/javascript-frameworks-and-mobile-performance/))\n \n-1.  **Eliminate network calls.** Chatty network activity can kill the performance of a mobile app, even on a good 3G or 4G connection. Staring at a loading spinner is not a good user experience.\n-2.  **Use background threads.** To hit a silky-smooth 60 FPS, your operations on the main thread must take less than 16ms. Anything unrelated to the UI should be offloaded to a background thread.\n+回顾一下：`Atwood` 说，问题是单线程; `Joreteg` 说，问题是移动网络。我认为他们都是对的。正如做 `Android` 开发的人与做 `web` 开发的人几乎一样多，我会直接告诉你网络和并发能力这两方面是当我写一份原生应用的性能表现时最关心的问题。\n \n-I believe the web is as capable of solving these problems as native apps, but most web developers just aren't aware that the tools are out there. For the network and concurrency problems, the web has two very good answers:\n+问任何 `iOS` 或 `Android` 开发者，怎样使我们的应用更快，极有可能你将听到以下两个主要的策略：\n \n-I decided to put these ideas together and build a webapp with a rich, interactive experience that's every bit as compelling as a native app, but is also \"just\" a web site. Following guidelines from the Chrome team, I built [Pokedex.org](http://pokedex.org/) – a [progressive webapp](https://infrequently.org/2015/06/progressive-apps-escaping-tabs-without-losing-our-soul/) that works offline, can be launched from the home screen, and runs at 60 FPS even on mediocre Android phones. This blog post explains how I did it.\n+1.  **禁用网络通话** 即使是在较好的 `3G` 或 `4G` 连接状态下，健谈的网络活动将使移动应用严重损失性能。让用户盯着加载进度并不是良好的用户体验。\n+2.  **使用后台线程** 要产生 60`FPS` 的流畅感，你在主线程上的操作必须少于 16ms。任何与 UI(用户界面) 不相关的工作都将转交给一个后台线程去完成。\n \n-## Pokémon – an ambitious target\n+我认为 `web` 作为原生应用能够解决这些问题，只是大多数 `Web` 开发人员不知道这些工具就在外面。对于网络和并发性的问题，`web` 有两个非常好的答案：","path":"TODO/introducing-pokedex-org.md","position":35,"original_position":35,"commit_id":"d403177054ce8590131d7c92e48b9444b3fe8fd2","original_commit_id":"d403177054ce8590131d7c92e48b9444b3fe8fd2","user":{"login":"Zhangjd","id":5930031,"avatar_url":"https://avatars.githubusercontent.com/u/5930031?v=3","gravatar_id":"","url":"https://api.github.com/users/Zhangjd","html_url":"https://github.com/Zhangjd","followers_url":"https://api.github.com/users/Zhangjd/followers","following_url":"https://api.github.com/users/Zhangjd/following{/other_user}","gists_url":"https://api.github.com/users/Zhangjd/gists{/gist_id}","starred_url":"https://api.github.com/users/Zhangjd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zhangjd/subscriptions","organizations_url":"https://api.github.com/users/Zhangjd/orgs","repos_url":"https://api.github.com/users/Zhangjd/repos","events_url":"https://api.github.com/users/Zhangjd/events{/privacy}","received_events_url":"https://api.github.com/users/Zhangjd/received_events","type":"User","site_admin":false},"body":"我认为以web的能力能像native apps那样解决这些问题，只是大多数web开发者不知道工具就在那儿。\r\n(这两个答案是什么呢？漏掉了，请看原文)\r\n1. 离线优先（比如IndexedDB和ServiceWorkers)\r\n2. Web workers","created_at":"2015-12-28T09:39:40Z","updated_at":"2015-12-28T09:39:40Z","html_url":"https://github.com/xitu/gold-miner/pull/85#discussion_r48470402","pull_request_url":"https://api.github.com/repos/xitu/gold-miner/pulls/85","_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/48470402"},"html":{"href":"https://github.com/xitu/gold-miner/pull/85#discussion_r48470402"},"pull_request":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/85"}}},"pull_request":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/85","id":54614390,"html_url":"https://github.com/xitu/gold-miner/pull/85","diff_url":"https://github.com/xitu/gold-miner/pull/85.diff","patch_url":"https://github.com/xitu/gold-miner/pull/85.patch","issue_url":"https://api.github.com/repos/xitu/gold-miner/issues/85","number":85,"state":"open","locked":false,"title":"《Pokedex.org 给宠物小精灵爱好者的 web app 的技术选型》翻译完成","user":{"login":"RobertWang","id":870106,"avatar_url":"https://avatars.githubusercontent.com/u/870106?v=3","gravatar_id":"","url":"https://api.github.com/users/RobertWang","html_url":"https://github.com/RobertWang","followers_url":"https://api.github.com/users/RobertWang/followers","following_url":"https://api.github.com/users/RobertWang/following{/other_user}","gists_url":"https://api.github.com/users/RobertWang/gists{/gist_id}","starred_url":"https://api.github.com/users/RobertWang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobertWang/subscriptions","organizations_url":"https://api.github.com/users/RobertWang/orgs","repos_url":"https://api.github.com/users/RobertWang/repos","events_url":"https://api.github.com/users/RobertWang/events{/privacy}","received_events_url":"https://api.github.com/users/RobertWang/received_events","type":"User","site_admin":false},"body":"《Pokedex.org 给宠物小精灵爱好者的 web app 的技术选型》翻译完，请确认","created_at":"2015-12-27T09:15:57Z","updated_at":"2015-12-28T09:39:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"61b47cd64d1eef35c9448c7997475219b02706e0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/xitu/gold-miner/pulls/85/commits","review_comments_url":"https://api.github.com/repos/xitu/gold-miner/pulls/85/comments","review_comment_url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xitu/gold-miner/issues/85/comments","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/d403177054ce8590131d7c92e48b9444b3fe8fd2","head":{"label":"RobertWang:master","ref":"master","sha":"d403177054ce8590131d7c92e48b9444b3fe8fd2","user":{"login":"RobertWang","id":870106,"avatar_url":"https://avatars.githubusercontent.com/u/870106?v=3","gravatar_id":"","url":"https://api.github.com/users/RobertWang","html_url":"https://github.com/RobertWang","followers_url":"https://api.github.com/users/RobertWang/followers","following_url":"https://api.github.com/users/RobertWang/following{/other_user}","gists_url":"https://api.github.com/users/RobertWang/gists{/gist_id}","starred_url":"https://api.github.com/users/RobertWang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobertWang/subscriptions","organizations_url":"https://api.github.com/users/RobertWang/orgs","repos_url":"https://api.github.com/users/RobertWang/repos","events_url":"https://api.github.com/users/RobertWang/events{/privacy}","received_events_url":"https://api.github.com/users/RobertWang/received_events","type":"User","site_admin":false},"repo":{"id":48596875,"name":"gold-miner","full_name":"RobertWang/gold-miner","owner":{"login":"RobertWang","id":870106,"avatar_url":"https://avatars.githubusercontent.com/u/870106?v=3","gravatar_id":"","url":"https://api.github.com/users/RobertWang","html_url":"https://github.com/RobertWang","followers_url":"https://api.github.com/users/RobertWang/followers","following_url":"https://api.github.com/users/RobertWang/following{/other_user}","gists_url":"https://api.github.com/users/RobertWang/gists{/gist_id}","starred_url":"https://api.github.com/users/RobertWang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobertWang/subscriptions","organizations_url":"https://api.github.com/users/RobertWang/orgs","repos_url":"https://api.github.com/users/RobertWang/repos","events_url":"https://api.github.com/users/RobertWang/events{/privacy}","received_events_url":"https://api.github.com/users/RobertWang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RobertWang/gold-miner","description":"掘金翻译计划，翻译掘金上优质的英文文章","fork":true,"url":"https://api.github.com/repos/RobertWang/gold-miner","forks_url":"https://api.github.com/repos/RobertWang/gold-miner/forks","keys_url":"https://api.github.com/repos/RobertWang/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RobertWang/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RobertWang/gold-miner/teams","hooks_url":"https://api.github.com/repos/RobertWang/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/RobertWang/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/RobertWang/gold-miner/events","assignees_url":"https://api.github.com/repos/RobertWang/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/RobertWang/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/RobertWang/gold-miner/tags","blobs_url":"https://api.github.com/repos/RobertWang/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RobertWang/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RobertWang/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/RobertWang/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RobertWang/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/RobertWang/gold-miner/languages","stargazers_url":"https://api.github.com/repos/RobertWang/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/RobertWang/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/RobertWang/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/RobertWang/gold-miner/subscription","commits_url":"https://api.github.com/repos/RobertWang/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/RobertWang/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/RobertWang/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/RobertWang/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/RobertWang/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/RobertWang/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RobertWang/gold-miner/merges","archive_url":"https://api.github.com/repos/RobertWang/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RobertWang/gold-miner/downloads","issues_url":"https://api.github.com/repos/RobertWang/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/RobertWang/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/RobertWang/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/RobertWang/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RobertWang/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/RobertWang/gold-miner/releases{/id}","created_at":"2015-12-26T02:21:15Z","updated_at":"2015-12-26T02:21:13Z","pushed_at":"2015-12-27T09:13:01Z","git_url":"git://github.com/RobertWang/gold-miner.git","ssh_url":"git@github.com:RobertWang/gold-miner.git","clone_url":"https://github.com/RobertWang/gold-miner.git","svn_url":"https://github.com/RobertWang/gold-miner","homepage":"http://gold.xitu.io","size":316,"stargazers_count":0,"watchers_count":0,"language":null,"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":"master"}},"base":{"label":"xitu:master","ref":"master","sha":"2547ce8d463e1207e13ec0e304adc045d85a053d","user":{"login":"xitu","id":10482599,"avatar_url":"https://avatars.githubusercontent.com/u/10482599?v=3","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"repo":{"id":45512989,"name":"gold-miner","full_name":"xitu/gold-miner","owner":{"login":"xitu","id":10482599,"avatar_url":"https://avatars.githubusercontent.com/u/10482599?v=3","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xitu/gold-miner","description":"掘金翻译计划，翻译掘金上优质的英文文章","fork":false,"url":"https://api.github.com/repos/xitu/gold-miner","forks_url":"https://api.github.com/repos/xitu/gold-miner/forks","keys_url":"https://api.github.com/repos/xitu/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xitu/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xitu/gold-miner/teams","hooks_url":"https://api.github.com/repos/xitu/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/xitu/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/xitu/gold-miner/events","assignees_url":"https://api.github.com/repos/xitu/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/xitu/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/xitu/gold-miner/tags","blobs_url":"https://api.github.com/repos/xitu/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xitu/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xitu/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/xitu/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/xitu/gold-miner/languages","stargazers_url":"https://api.github.com/repos/xitu/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/xitu/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/xitu/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/xitu/gold-miner/subscription","commits_url":"https://api.github.com/repos/xitu/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/xitu/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/xitu/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/xitu/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/xitu/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/xitu/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xitu/gold-miner/merges","archive_url":"https://api.github.com/repos/xitu/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xitu/gold-miner/downloads","issues_url":"https://api.github.com/repos/xitu/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/xitu/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/xitu/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/xitu/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xitu/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/xitu/gold-miner/releases{/id}","created_at":"2015-11-04T03:29:13Z","updated_at":"2015-12-28T09:01:51Z","pushed_at":"2015-12-28T08:23:23Z","git_url":"git://github.com/xitu/gold-miner.git","ssh_url":"git@github.com:xitu/gold-miner.git","clone_url":"https://github.com/xitu/gold-miner.git","svn_url":"https://github.com/xitu/gold-miner","homepage":"http://gold.xitu.io","size":544,"stargazers_count":76,"watchers_count":76,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":26,"forks":39,"open_issues":26,"watchers":76,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/85"},"html":{"href":"https://github.com/xitu/gold-miner/pull/85"},"issue":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/85"},"comments":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/85/comments"},"review_comments":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/85/comments"},"review_comment":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/85/commits"},"statuses":{"href":"https://api.github.com/repos/xitu/gold-miner/statuses/d403177054ce8590131d7c92e48b9444b3fe8fd2"}}}}