From 75409142540246bea97e13b93f19464bcee5b701 Mon Sep 17 00:00:00 2001 From: Jamon Holmgren Date: Mon, 30 Jul 2018 21:25:15 -0700 Subject: [PATCH 1/4] Proposal 0001 - Extract WebView From Core --- proposals/0001-template.md | 60 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 proposals/0001-template.md diff --git a/proposals/0001-template.md b/proposals/0001-template.md new file mode 100644 index 00000000..b808c138 --- /dev/null +++ b/proposals/0001-template.md @@ -0,0 +1,60 @@ +--- +title: Extract WebView From Core +author: +- Jamon Holmgren +date: 2018-07-30 +--- + +# RFC0000: Extract WebView From Core + +## Summary + +Extract the current WebView implementation from React Native Core and move it into a third party package. + +## Basic example + +Currently, WebView is included in React Native core: + +```jsx +import { WebView } from 'react-native'; +``` + +This would move it to an external package, like so: + +```jsx +import { WebView } from '@infinitered/react-native-webview'; +``` + +## Motivation + +The current WebView implementation is (to my knowledge) not used by Facebook internally. This leads (understandably) to a lack of first-class support for this core API. By moving the component to a third party that is more invested in supporting it, there will be better support. + +Additionally, with this component no longer included in core, there will be an opening for alternative third party WebView implementations, should anyone else wish to provide one. + +## Detailed design + +For the first release, the goal is to provide the same API, only replacing the import statement and otherwise backwards compatible. + +We will also want to update generated project boilerplates, such as create-react-native-app and Ignite, to use the new package. + +## Drawbacks + +This is a breaking change in that if someone simply updates their React Native version in an app that uses WebView and this core API is gone, their app will break. + +It also means there won't be an officially supported WebView in React Native, which may feel to some to be missing key functionality. + +## Alternatives + +The primary alternative is to keep the WebView in core. There are also existing third party WebViews, although none that are reliably cross-platform. + +## Adoption strategy + +This is a breaking change and existing React Native authors who use WebView will need to update their apps to access one of the third party solutions. For most, it should be as simple as `yarn add @infinitered/react-native-webview` and update their import statements. + +## How we teach this + +We will need to update the React Native documentation to point out that WebView is now moved to a third party module. + +## Unresolved questions + +None so far. From 78251fc2c39caca73284e819c5446534aafa1275 Mon Sep 17 00:00:00 2001 From: Jamon Holmgren Date: Mon, 30 Jul 2018 21:58:11 -0700 Subject: [PATCH 2/4] Updated with feedback from @axe-fb --- proposals/0001-template.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/proposals/0001-template.md b/proposals/0001-template.md index b808c138..f4166367 100644 --- a/proposals/0001-template.md +++ b/proposals/0001-template.md @@ -25,9 +25,11 @@ This would move it to an external package, like so: import { WebView } from '@infinitered/react-native-webview'; ``` +(Where this third-party package will live is an open question. See below.) + ## Motivation -The current WebView implementation is (to my knowledge) not used by Facebook internally. This leads (understandably) to a lack of first-class support for this core API. By moving the component to a third party that is more invested in supporting it, there will be better support. +The current WebView implementation is used by Facebook internally but not actively updated. This leads (understandably) to a lack of first-class support for this core API. By moving the component to a third party that is more invested in supporting it, there will be better support. Additionally, with this component no longer included in core, there will be an opening for alternative third party WebView implementations, should anyone else wish to provide one. @@ -57,4 +59,6 @@ We will need to update the React Native documentation to point out that WebView ## Unresolved questions -None so far. +There are a number of [WebView-related issues](https://github.com/facebook/react-native/search?q=webview&state=open&type=Issues) in the core React Native repo. We will need to have a plan to migrate those over to the new WebView repo. + +Additionally, we need to decide where this new repo will live. I am willing to host it under the `infinitered` organization (this motivates me more to keep it up to date and supported), but am open to other ideas such as `react-native-community`. From b9f2ba9158a62700b78446d4c344e2d140d6c29d Mon Sep 17 00:00:00 2001 From: Jamon Holmgren Date: Mon, 6 Aug 2018 18:40:47 -0700 Subject: [PATCH 3/4] Removes npm namespace --- proposals/{0001-template.md => 0001-webview.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename proposals/{0001-template.md => 0001-webview.md} (97%) diff --git a/proposals/0001-template.md b/proposals/0001-webview.md similarity index 97% rename from proposals/0001-template.md rename to proposals/0001-webview.md index f4166367..95eb28e2 100644 --- a/proposals/0001-template.md +++ b/proposals/0001-webview.md @@ -22,7 +22,7 @@ import { WebView } from 'react-native'; This would move it to an external package, like so: ```jsx -import { WebView } from '@infinitered/react-native-webview'; +import { WebView } from 'react-native-webview'; ``` (Where this third-party package will live is an open question. See below.) From 2ed77633cea227dac3c0e15c8d270f73576c7783 Mon Sep 17 00:00:00 2001 From: Jamon Holmgren Date: Tue, 7 Aug 2018 10:07:52 -0700 Subject: [PATCH 4/4] Remove another reference to @infinitered --- proposals/0001-webview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/0001-webview.md b/proposals/0001-webview.md index 95eb28e2..0df08f0b 100644 --- a/proposals/0001-webview.md +++ b/proposals/0001-webview.md @@ -51,7 +51,7 @@ The primary alternative is to keep the WebView in core. There are also existing ## Adoption strategy -This is a breaking change and existing React Native authors who use WebView will need to update their apps to access one of the third party solutions. For most, it should be as simple as `yarn add @infinitered/react-native-webview` and update their import statements. +This is a breaking change and existing React Native authors who use WebView will need to update their apps to access one of the third party solutions. For most, it should be as simple as `yarn add react-native-webview` and update their import statements. ## How we teach this