Skip to content

Commit 7540914

Browse files
committed
Proposal 0001 - Extract WebView From Core
1 parent 948f004 commit 7540914

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

proposals/0001-template.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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 '@infinitered/react-native-webview';
26+
```
27+
28+
## Motivation
29+
30+
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.
31+
32+
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.
33+
34+
## Detailed design
35+
36+
For the first release, the goal is to provide the same API, only replacing the import statement and otherwise backwards compatible.
37+
38+
We will also want to update generated project boilerplates, such as create-react-native-app and Ignite, to use the new package.
39+
40+
## Drawbacks
41+
42+
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.
43+
44+
It also means there won't be an officially supported WebView in React Native, which may feel to some to be missing key functionality.
45+
46+
## Alternatives
47+
48+
The primary alternative is to keep the WebView in core. There are also existing third party WebViews, although none that are reliably cross-platform.
49+
50+
## Adoption strategy
51+
52+
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.
53+
54+
## How we teach this
55+
56+
We will need to update the React Native documentation to point out that WebView is now moved to a third party module.
57+
58+
## Unresolved questions
59+
60+
None so far.

0 commit comments

Comments
 (0)