{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/7454","repository_url":"https://api.github.com/repos/Automattic/wp-calypso","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/7454/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/7454/comments","events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/7454/events","html_url":"https://github.com/Automattic/wp-calypso/pull/7454","id":171034121,"number":7454,"title":"Add phone-number library","user":{"login":"umurkontaci","id":991022,"avatar_url":"https://avatars.githubusercontent.com/u/991022?v=3","gravatar_id":"","url":"https://api.github.com/users/umurkontaci","html_url":"https://github.com/umurkontaci","followers_url":"https://api.github.com/users/umurkontaci/followers","following_url":"https://api.github.com/users/umurkontaci/following{/other_user}","gists_url":"https://api.github.com/users/umurkontaci/gists{/gist_id}","starred_url":"https://api.github.com/users/umurkontaci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umurkontaci/subscriptions","organizations_url":"https://api.github.com/users/umurkontaci/orgs","repos_url":"https://api.github.com/users/umurkontaci/repos","events_url":"https://api.github.com/users/umurkontaci/events{/privacy}","received_events_url":"https://api.github.com/users/umurkontaci/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Components","name":"Components","color":"006b75"},{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Domains","name":"Domains","color":"006b75"},{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"umurkontaci","id":991022,"avatar_url":"https://avatars.githubusercontent.com/u/991022?v=3","gravatar_id":"","url":"https://api.github.com/users/umurkontaci","html_url":"https://github.com/umurkontaci","followers_url":"https://api.github.com/users/umurkontaci/followers","following_url":"https://api.github.com/users/umurkontaci/following{/other_user}","gists_url":"https://api.github.com/users/umurkontaci/gists{/gist_id}","starred_url":"https://api.github.com/users/umurkontaci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umurkontaci/subscriptions","organizations_url":"https://api.github.com/users/umurkontaci/orgs","repos_url":"https://api.github.com/users/umurkontaci/repos","events_url":"https://api.github.com/users/umurkontaci/events{/privacy}","received_events_url":"https://api.github.com/users/umurkontaci/received_events","type":"User","site_admin":false},"assignees":[{"login":"umurkontaci","id":991022,"avatar_url":"https://avatars.githubusercontent.com/u/991022?v=3","gravatar_id":"","url":"https://api.github.com/users/umurkontaci","html_url":"https://github.com/umurkontaci","followers_url":"https://api.github.com/users/umurkontaci/followers","following_url":"https://api.github.com/users/umurkontaci/following{/other_user}","gists_url":"https://api.github.com/users/umurkontaci/gists{/gist_id}","starred_url":"https://api.github.com/users/umurkontaci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umurkontaci/subscriptions","organizations_url":"https://api.github.com/users/umurkontaci/orgs","repos_url":"https://api.github.com/users/umurkontaci/repos","events_url":"https://api.github.com/users/umurkontaci/events{/privacy}","received_events_url":"https://api.github.com/users/umurkontaci/received_events","type":"User","site_admin":false},{"login":"aidvu","id":1103398,"avatar_url":"https://avatars.githubusercontent.com/u/1103398?v=3","gravatar_id":"","url":"https://api.github.com/users/aidvu","html_url":"https://github.com/aidvu","followers_url":"https://api.github.com/users/aidvu/followers","following_url":"https://api.github.com/users/aidvu/following{/other_user}","gists_url":"https://api.github.com/users/aidvu/gists{/gist_id}","starred_url":"https://api.github.com/users/aidvu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aidvu/subscriptions","organizations_url":"https://api.github.com/users/aidvu/orgs","repos_url":"https://api.github.com/users/aidvu/repos","events_url":"https://api.github.com/users/aidvu/events{/privacy}","received_events_url":"https://api.github.com/users/aidvu/received_events","type":"User","site_admin":false},{"login":"klimeryk","id":3392497,"avatar_url":"https://avatars.githubusercontent.com/u/3392497?v=3","gravatar_id":"","url":"https://api.github.com/users/klimeryk","html_url":"https://github.com/klimeryk","followers_url":"https://api.github.com/users/klimeryk/followers","following_url":"https://api.github.com/users/klimeryk/following{/other_user}","gists_url":"https://api.github.com/users/klimeryk/gists{/gist_id}","starred_url":"https://api.github.com/users/klimeryk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klimeryk/subscriptions","organizations_url":"https://api.github.com/users/klimeryk/orgs","repos_url":"https://api.github.com/users/klimeryk/repos","events_url":"https://api.github.com/users/klimeryk/events{/privacy}","received_events_url":"https://api.github.com/users/klimeryk/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-08-14T00:07:52Z","updated_at":"2016-08-15T14:43:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/7454","html_url":"https://github.com/Automattic/wp-calypso/pull/7454","diff_url":"https://github.com/Automattic/wp-calypso/pull/7454.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/7454.patch"},"body":"This PR is part of #7453 and adds a phone number library for parsing and formatting numbers.\r\n\r\nI was able to simplify this to a point where I am almost satisfied. There will be tons of things to improve I believe, but I think it is vastly better than what's out in the wild.\r\n\r\nThis one comes with a vast amount of research done on other libraries to understand the phone numbers field.\r\n\r\nLocalized phone numbers are a beast and there are some libraries out there that does the same thing, but either they are terribly written, or they are huge behemoths that I don't want to include them in our builds. The most prominent one is [libphonenumber](https://github.com/googlei18n/libphonenumber), while it is super comprehensive, it is Java-centric and lacks quite a bit documentation, uses Clojure compiler, and has a size of *350 KB* when minified and *70KB* when gzipped.\r\n\r\nThis library is stateless and I think it has a clear API with a sound structure.\r\n \r\nIn `bin/build-metadata.js` we are consuming libphonenumber's metadata files and creating our own stripped down version. The file looks very big but it is very redundant hence very compressible (`8KB` minified and gzipped).\r\n\r\n\r\nThere might still be quirks around edge cases during formatting, so please do try to break it :)\r\n\r\nAnything that breaks should be added as a test, fixed and verified to prevent regressions in the future.\r\n\r\n/cc: @klimeryk @aidvu @wensco @Automattic/sdev-feed \r\n\r\nTest live: https://calypso.live/?branch=add/phone-number-library"},"comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments/239820304","html_url":"https://github.com/Automattic/wp-calypso/pull/7454#issuecomment-239820304","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/7454","id":239820304,"user":{"login":"klimeryk","id":3392497,"avatar_url":"https://avatars.githubusercontent.com/u/3392497?v=3","gravatar_id":"","url":"https://api.github.com/users/klimeryk","html_url":"https://github.com/klimeryk","followers_url":"https://api.github.com/users/klimeryk/followers","following_url":"https://api.github.com/users/klimeryk/following{/other_user}","gists_url":"https://api.github.com/users/klimeryk/gists{/gist_id}","starred_url":"https://api.github.com/users/klimeryk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klimeryk/subscriptions","organizations_url":"https://api.github.com/users/klimeryk/orgs","repos_url":"https://api.github.com/users/klimeryk/repos","events_url":"https://api.github.com/users/klimeryk/events{/privacy}","received_events_url":"https://api.github.com/users/klimeryk/received_events","type":"User","site_admin":false},"created_at":"2016-08-15T14:43:44Z","updated_at":"2016-08-15T14:43:44Z","body":"Thanks for the heads-up, @yoavf. I'm not familiar with any of them (yet!), but I'd love your opinion and assesement of the solution that Umur prepared here. Pinging also @southp, @jmdodd, @dllh, @ebinnion and @allendav who contributed to our fork of `AfterShip/phone`. Please have a look at this PR (and #7456 that builds upon it) to see if it could be used on the 2FA page too. It'd be best if we could agree on one library for parsing/validating phones as well as the component for inputting them."}}
{"actor":{"display_login":"klimeryk"}}