{"action":"opened","number":7186,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/7186","id":67620830,"html_url":"https://github.com/facebook/react-native/pull/7186","diff_url":"https://github.com/facebook/react-native/pull/7186.diff","patch_url":"https://github.com/facebook/react-native/pull/7186.patch","issue_url":"https://api.github.com/repos/facebook/react-native/issues/7186","number":7186,"state":"open","locked":false,"title":"Fix `RCTConvert UIFont` loosing styles","user":{"login":"grabbou","id":2464966,"avatar_url":"https://avatars.githubusercontent.com/u/2464966?v=3","gravatar_id":"","url":"https://api.github.com/users/grabbou","html_url":"https://github.com/grabbou","followers_url":"https://api.github.com/users/grabbou/followers","following_url":"https://api.github.com/users/grabbou/following{/other_user}","gists_url":"https://api.github.com/users/grabbou/gists{/gist_id}","starred_url":"https://api.github.com/users/grabbou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grabbou/subscriptions","organizations_url":"https://api.github.com/users/grabbou/orgs","repos_url":"https://api.github.com/users/grabbou/repos","events_url":"https://api.github.com/users/grabbou/events{/privacy}","received_events_url":"https://api.github.com/users/grabbou/received_events","type":"User","site_admin":false},"body":"This fixes odd issue #2140 that is a regression (at least that's how I feel). I think the biggest problem here was that our unit tests are only testing one part - making UIFont out of a json. \r\n\r\nWhat was failing were the `[RCTConvert UIFont:font withSize:@\"\"]` etc that can be found in e.g. `TextInput` where we export styling properties. The reason we haven't found the issue before is 99% of the codebase uses this method directly, only TextInput as far as I am aware uses these partial helper methods.\r\n\r\nThis is a WIP as the rest of the code is still broken (for non-standard font families). I am debugging it right now & adding missing test cases.\r\n\r\nThe problem itself can be divided into two cases, first one is non-system fonts (WIP) and the second one, already solved is: `System` font.\r\n\r\nIn case of `System` font - the first time we receive `json` that can be of this shape:\r\n```\r\n{fontSize: 15}\r\n```\r\nit will infer the fontFamily to be `System` (default value when missing) and correctly return `systemFontOfSize`. However, next time we supply such font to the same method, it will no longer take it as a system font since it's font name does not equal `System` (and in fact - it should, because that's what we have returned). \r\n\r\n`TextInput` however calls the helper straight away https://github.com/facebook/react-native/blob/master/Libraries/Text/RCTTextFieldManager.m#L100 with most likely a default font set by the constructor (which has a real system font family, not `System`). That makes the RCTConvert assume it's a custom user font and do all these checks below.\r\n\r\nAnd since the 2nd part still has some bugs, that explains why setting multiple properties on a TextInput strips them out as well as does not work at all under some circumstances.","created_at":"2016-04-23T22:34:10Z","updated_at":"2016-04-23T22:34:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/react-native/pulls/7186/commits","review_comments_url":"https://api.github.com/repos/facebook/react-native/pulls/7186/comments","review_comment_url":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/7186/comments","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/8bf22999a17e4cb5eb8b0aae69525ca36848475b","head":{"label":"grabbou:fix/rct-convert-regression","ref":"fix/rct-convert-regression","sha":"8bf22999a17e4cb5eb8b0aae69525ca36848475b","user":{"login":"grabbou","id":2464966,"avatar_url":"https://avatars.githubusercontent.com/u/2464966?v=3","gravatar_id":"","url":"https://api.github.com/users/grabbou","html_url":"https://github.com/grabbou","followers_url":"https://api.github.com/users/grabbou/followers","following_url":"https://api.github.com/users/grabbou/following{/other_user}","gists_url":"https://api.github.com/users/grabbou/gists{/gist_id}","starred_url":"https://api.github.com/users/grabbou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grabbou/subscriptions","organizations_url":"https://api.github.com/users/grabbou/orgs","repos_url":"https://api.github.com/users/grabbou/repos","events_url":"https://api.github.com/users/grabbou/events{/privacy}","received_events_url":"https://api.github.com/users/grabbou/received_events","type":"User","site_admin":false},"repo":{"id":53650816,"name":"react-native","full_name":"grabbou/react-native","owner":{"login":"grabbou","id":2464966,"avatar_url":"https://avatars.githubusercontent.com/u/2464966?v=3","gravatar_id":"","url":"https://api.github.com/users/grabbou","html_url":"https://github.com/grabbou","followers_url":"https://api.github.com/users/grabbou/followers","following_url":"https://api.github.com/users/grabbou/following{/other_user}","gists_url":"https://api.github.com/users/grabbou/gists{/gist_id}","starred_url":"https://api.github.com/users/grabbou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grabbou/subscriptions","organizations_url":"https://api.github.com/users/grabbou/orgs","repos_url":"https://api.github.com/users/grabbou/repos","events_url":"https://api.github.com/users/grabbou/events{/privacy}","received_events_url":"https://api.github.com/users/grabbou/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/grabbou/react-native","description":"A framework for building native apps with React.","fork":true,"url":"https://api.github.com/repos/grabbou/react-native","forks_url":"https://api.github.com/repos/grabbou/react-native/forks","keys_url":"https://api.github.com/repos/grabbou/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grabbou/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grabbou/react-native/teams","hooks_url":"https://api.github.com/repos/grabbou/react-native/hooks","issue_events_url":"https://api.github.com/repos/grabbou/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/grabbou/react-native/events","assignees_url":"https://api.github.com/repos/grabbou/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/grabbou/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/grabbou/react-native/tags","blobs_url":"https://api.github.com/repos/grabbou/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grabbou/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grabbou/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/grabbou/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grabbou/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/grabbou/react-native/languages","stargazers_url":"https://api.github.com/repos/grabbou/react-native/stargazers","contributors_url":"https://api.github.com/repos/grabbou/react-native/contributors","subscribers_url":"https://api.github.com/repos/grabbou/react-native/subscribers","subscription_url":"https://api.github.com/repos/grabbou/react-native/subscription","commits_url":"https://api.github.com/repos/grabbou/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/grabbou/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/grabbou/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/grabbou/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/grabbou/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/grabbou/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grabbou/react-native/merges","archive_url":"https://api.github.com/repos/grabbou/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grabbou/react-native/downloads","issues_url":"https://api.github.com/repos/grabbou/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/grabbou/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/grabbou/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/grabbou/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grabbou/react-native/labels{/name}","releases_url":"https://api.github.com/repos/grabbou/react-native/releases{/id}","deployments_url":"https://api.github.com/repos/grabbou/react-native/deployments","created_at":"2016-03-11T08:15:47Z","updated_at":"2016-04-23T13:57:48Z","pushed_at":"2016-04-23T22:24:56Z","git_url":"git://github.com/grabbou/react-native.git","ssh_url":"git@github.com:grabbou/react-native.git","clone_url":"https://github.com/grabbou/react-native.git","svn_url":"https://github.com/grabbou/react-native","homepage":"http://facebook.github.io/react-native/","size":51424,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"ea8f58418401ff03626828282be94415b318efec","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":29028775,"name":"react-native","full_name":"facebook/react-native","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/react-native","description":"A framework for building native apps with React.","fork":false,"url":"https://api.github.com/repos/facebook/react-native","forks_url":"https://api.github.com/repos/facebook/react-native/forks","keys_url":"https://api.github.com/repos/facebook/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/react-native/teams","hooks_url":"https://api.github.com/repos/facebook/react-native/hooks","issue_events_url":"https://api.github.com/repos/facebook/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/react-native/events","assignees_url":"https://api.github.com/repos/facebook/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/react-native/tags","blobs_url":"https://api.github.com/repos/facebook/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/react-native/languages","stargazers_url":"https://api.github.com/repos/facebook/react-native/stargazers","contributors_url":"https://api.github.com/repos/facebook/react-native/contributors","subscribers_url":"https://api.github.com/repos/facebook/react-native/subscribers","subscription_url":"https://api.github.com/repos/facebook/react-native/subscription","commits_url":"https://api.github.com/repos/facebook/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/react-native/merges","archive_url":"https://api.github.com/repos/facebook/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/react-native/downloads","issues_url":"https://api.github.com/repos/facebook/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/react-native/labels{/name}","releases_url":"https://api.github.com/repos/facebook/react-native/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/react-native/deployments","created_at":"2015-01-09T18:10:16Z","updated_at":"2016-04-23T22:22:10Z","pushed_at":"2016-04-23T22:04:38Z","git_url":"git://github.com/facebook/react-native.git","ssh_url":"git@github.com:facebook/react-native.git","clone_url":"https://github.com/facebook/react-native.git","svn_url":"https://github.com/facebook/react-native","homepage":"http://facebook.github.io/react-native/","size":92013,"stargazers_count":31130,"watchers_count":31130,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6155,"mirror_url":null,"open_issues_count":707,"forks":6155,"open_issues":707,"watchers":31130,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/7186"},"html":{"href":"https://github.com/facebook/react-native/pull/7186"},"issue":{"href":"https://api.github.com/repos/facebook/react-native/issues/7186"},"comments":{"href":"https://api.github.com/repos/facebook/react-native/issues/7186/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/react-native/pulls/7186/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/react-native/pulls/7186/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/react-native/statuses/8bf22999a17e4cb5eb8b0aae69525ca36848475b"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":37,"deletions":3,"changed_files":2}}