{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/1492","labels_url":"https://api.github.com/repos/facebook/react-native/issues/1492/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/1492/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/1492/events","html_url":"https://github.com/facebook/react-native/pull/1492","id":83972087,"number":1492,"title":"[WebView][Api Change] Support for local files, inline html and relative requires.","user":{"login":"JohnyDays","id":4540763,"avatar_url":"https://avatars.githubusercontent.com/u/4540763?v=3","gravatar_id":"","url":"https://api.github.com/users/JohnyDays","html_url":"https://github.com/JohnyDays","followers_url":"https://api.github.com/users/JohnyDays/followers","following_url":"https://api.github.com/users/JohnyDays/following{/other_user}","gists_url":"https://api.github.com/users/JohnyDays/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnyDays/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnyDays/subscriptions","organizations_url":"https://api.github.com/users/JohnyDays/orgs","repos_url":"https://api.github.com/users/JohnyDays/repos","events_url":"https://api.github.com/users/JohnyDays/events{/privacy}","received_events_url":"https://api.github.com/users/JohnyDays/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react-native/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7"},{"url":"https://api.github.com/repos/facebook/react-native/labels/GH%20Review:%20review-needed","name":"GH Review: review-needed","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-02T11:07:12Z","updated_at":"2015-11-13T10:32:19Z","closed_at":"2015-10-25T23:21:51Z","pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/1492","html_url":"https://github.com/facebook/react-native/pull/1492","diff_url":"https://github.com/facebook/react-native/pull/1492.diff","patch_url":"https://github.com/facebook/react-native/pull/1492.patch"},"body":"(This PR is not ready to be merged, creating it for feedback on the api as per recommendation from @brentvatne in #1481)\r\n\r\n# Features\r\n* Support for local files using the file protocol, e.g file://htdocs/index.html\r\n* Support for relative requires, e.g in the above file index.js would refer to htdocs/index.js\r\n* Support for inline html (Also supports relative requires through baseUrl, solves #1442) \r\n* Added 2 buttons and a local test folder to UIExplorer, for testing this (this can be replaced by automated tests perhaps? Apologies, my obj-c/react testing knowledge is still limited)\r\n\r\n# New api\r\n```javascript\r\n<WebView source={{uri: string, html: string, baseUrl: string}} />\r\n\r\n<WebView source={{uri: 'file://htdocs/index.html'}} />\r\n//is equivalent to \r\n<WebView source={{uri: 'index.html', baseUrl: '/htdocs'}} />\r\n\r\n//Can also directly input the contents of the above index.html\r\n<WebView source={{\r\n  baseUrl: '/htdocs', \r\n  html: '<script src=\"index.js\"></script>' /* this would load htdocs/index.js */}} />\r\n```\r\n\r\n# Future breaking changes\r\n\r\nBoth the ````url```` and ````html```` props are deprecated, in favor of the source object. ````url```` was also changed to the ````uri```` key, for parity with the ````<Image/>```` element's source object.\r\nThey still work as before if no source object is passed, although both methods do not seamlessly operate.\r\n\r\n# Issues with the current state\r\n\r\n- [ ] Setting inline html replaces the current navigation item. I'm not sure there is any relevant use case for having both uri's and inline html seamlessly navigate between one another, or even navigate between 2 different inline html(s). However, this could be accomplished by temporarily saving a file with the inline html, and pointing to it instead. I'm leaning more towards not supporting this though.\r\n- [ ] I'm not sure how to deprecate remapped properties (url and html), can I get some say-so on this?\r\n- [ ] Perhaps throw an exception if an invalid prop combination is passed? I'm not sure what the react recommended way is to indicate to the developer they have done this"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/156391502","html_url":"https://github.com/facebook/react-native/pull/1492#issuecomment-156391502","issue_url":"https://api.github.com/repos/facebook/react-native/issues/1492","id":156391502,"user":{"login":"gs-akhan","id":5646166,"avatar_url":"https://avatars.githubusercontent.com/u/5646166?v=3","gravatar_id":"","url":"https://api.github.com/users/gs-akhan","html_url":"https://github.com/gs-akhan","followers_url":"https://api.github.com/users/gs-akhan/followers","following_url":"https://api.github.com/users/gs-akhan/following{/other_user}","gists_url":"https://api.github.com/users/gs-akhan/gists{/gist_id}","starred_url":"https://api.github.com/users/gs-akhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gs-akhan/subscriptions","organizations_url":"https://api.github.com/users/gs-akhan/orgs","repos_url":"https://api.github.com/users/gs-akhan/repos","events_url":"https://api.github.com/users/gs-akhan/events{/privacy}","received_events_url":"https://api.github.com/users/gs-akhan/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T10:32:19Z","updated_at":"2015-11-13T10:32:19Z","body":"Amazing PR. This makes lot of sense. I am hoping this lands soon."}}