Skip to content

Commit d039212

Browse files
authored
Merge pull request #3 from jamonholmgren/proposal-0001
Proposal 0001 - Extract WebView From Core
2 parents 6217d51 + 2ed7763 commit d039212

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

Diff for: proposals/0001-webview.md

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: Extract WebView From Core
3+
author:
4+
- Jamon Holmgren
5+
date: 2018-07-30
6+
---
7+
8+
# RFC0000: Extract WebView From Core
9+
10+
## Summary
11+
12+
Extract the current WebView implementation from React Native Core and move it into a third party package.
13+
14+
## Basic example
15+
16+
Currently, WebView is included in React Native core:
17+
18+
```jsx
19+
import { WebView } from 'react-native';
20+
```
21+
22+
This would move it to an external package, like so:
23+
24+
```jsx
25+
import { WebView } from 'react-native-webview';
26+
```
27+
28+
(Where this third-party package will live is an open question. See below.)
29+
30+
## Motivation
31+
32+
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.
33+
34+
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.
35+
36+
## Detailed design
37+
38+
For the first release, the goal is to provide the same API, only replacing the import statement and otherwise backwards compatible.
39+
40+
We will also want to update generated project boilerplates, such as create-react-native-app and Ignite, to use the new package.
41+
42+
## Drawbacks
43+
44+
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.
45+
46+
It also means there won't be an officially supported WebView in React Native, which may feel to some to be missing key functionality.
47+
48+
## Alternatives
49+
50+
The primary alternative is to keep the WebView in core. There are also existing third party WebViews, although none that are reliably cross-platform.
51+
52+
## Adoption strategy
53+
54+
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.
55+
56+
## How we teach this
57+
58+
We will need to update the React Native documentation to point out that WebView is now moved to a third party module.
59+
60+
## Unresolved questions
61+
62+
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.
63+
64+
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`.

0 commit comments

Comments
 (0)