Skip to content

Commit 7d3e9e1

Browse files
yangshunhramos
authored andcommitted
Update Docusaurus to 1.3.0 (facebook#422)
1 parent 5995e3d commit 7d3e9e1

File tree

11 files changed

+2335
-156
lines changed

11 files changed

+2335
-156
lines changed

docs/contributing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ There are many ways to contribute to React Native, and many of them do not invol
1919
* Read through the [React Native docs](http://facebook.github.io/react-native/). If you find anything that is confusing or can be improved, you can make edits by clicking "Edit" at the top of most docs.
2020
* Browse [Stack Overflow](https://stackoverflow.com/questions/tagged/react-native) and answer questions. This will help you get familiarized with common pitfalls or misunderstandings, which can be useful when contributing updates to the documentation.
2121
* Take a look at the [features requested](https://react-native.canny.io/feature-requests) by others in the community and consider opening a pull request if you see something you want to work on.
22-
* Before opening your pull request, make sure you have fully tested your changes. Test your changes locally and by running the various tests provided.
23-
* For information on how to build the React Native project locally with your changes, make sure to read through the [Building React Native from source guide](https://facebook.github.io/react-native/docs/building-from-source.html).
22+
* Before opening your pull request, make sure you have fully tested your changes. Test your changes locally and by running the various tests provided.
23+
* For information on how to build the React Native project locally with your changes, make sure to read through the [Building React Native from source guide](https://facebook.github.io/react-native/docs/building-from-source.html).
2424
* Check out the [Testing your changes guide](https://facebook.github.io/react-native/docs/testing.html) to find out about the numerous tests which has been provided to help ensure that any new changes wont cause a regression.
2525

2626
Contributions are very welcome. If you think you need help planning your contribution, please hop into [#react-native](https://discord.gg/0ZcbPKXt5bZjGY5n) and let people know you're looking for a mentor.

docs/removing-default-permissions.md

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,63 +7,63 @@ By default, some permissions are added to your Android APK.
77

88
The default permissions that get added are:
99

10-
* android.permission.INTERNET - Required for debug mode.
11-
* android.permission.SYSTEM_ALERT_WINDOW - Required for debug mode.
12-
* android.permission.READ_PHONE_STATE - Not required for debug or production.
13-
* android.permission.WRITE_EXTERNAL_STORAGE - Not required for debug or production.
14-
* android.permission.READ_EXTERNAL_STORAGE - Not required for debug or production.
10+
* android.permission.INTERNET - Required for debug mode.
11+
* android.permission.SYSTEM_ALERT_WINDOW - Required for debug mode.
12+
* android.permission.READ_PHONE_STATE - Not required for debug or production.
13+
* android.permission.WRITE_EXTERNAL_STORAGE - Not required for debug or production.
14+
* android.permission.READ_EXTERNAL_STORAGE - Not required for debug or production.
1515

1616
1. Let's start by removing `READ_PHONE_STATE`, `WRITE_EXTERNAL_STORAGE`, and `READ_EXTERNAL_STORAGE` from both production and debug APKs, as it is not required in either. These storage permissions are still not needed if `AsyncStorage` module is in use, so it is safe to remove from both production and debug.
1717
2. Open your `android/app/src/main/AndroidManifest.xml` file.
1818
3. Even though these three permissions are not listed in the manifest they get added in. We add the three permissions with `tools:node="remove"` attribute, to make sure it gets removed during build. Note that the package identifier will be different, for below it is "com.myapp" because the project was created with `react-native init myapp`.
19-
20-
```diff
21-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22-
package="com.myappid"
23-
+ xmlns:tools="http://schemas.android.com/tools"
24-
>
25-
26-
<uses-permission android:name="android.permission.INTERNET" />
27-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
28-
+ <uses-permission tools:node="remove" android:name="android.permission.READ_PHONE_STATE" />
29-
+ <uses-permission tools:node="remove" android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
30-
+ <uses-permission tools:node="remove" android:name="android.permission.READ_EXTERNAL_STORAGE" />
31-
32-
<application
33-
android:name=".MainApplication"
34-
android:label="@string/app_name"
35-
android:icon="@mipmap/ic_launcher"
36-
android:allowBackup="false"
37-
android:theme="@style/AppTheme">
38-
<activity
39-
android:name=".MainActivity"
40-
android:label="@string/app_name"
41-
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
42-
android:windowSoftInputMode="adjustResize">
43-
<intent-filter>
44-
<action android:name="android.intent.action.MAIN" />
45-
<category android:name="android.intent.category.LAUNCHER" />
46-
</intent-filter>
47-
</activity>
48-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
49-
</application>
50-
51-
</manifest>
52-
```
53-
19+
20+
```diff
21+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22+
package="com.myappid"
23+
+ xmlns:tools="http://schemas.android.com/tools"
24+
>
25+
26+
<uses-permission android:name="android.permission.INTERNET" />
27+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
28+
+ <uses-permission tools:node="remove" android:name="android.permission.READ_PHONE_STATE" />
29+
+ <uses-permission tools:node="remove" android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
30+
+ <uses-permission tools:node="remove" android:name="android.permission.READ_EXTERNAL_STORAGE" />
31+
32+
<application
33+
android:name=".MainApplication"
34+
android:label="@string/app_name"
35+
android:icon="@mipmap/ic_launcher"
36+
android:allowBackup="false"
37+
android:theme="@style/AppTheme">
38+
<activity
39+
android:name=".MainActivity"
40+
android:label="@string/app_name"
41+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
42+
android:windowSoftInputMode="adjustResize">
43+
<intent-filter>
44+
<action android:name="android.intent.action.MAIN" />
45+
<category android:name="android.intent.category.LAUNCHER" />
46+
</intent-filter>
47+
</activity>
48+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
49+
</application>
50+
51+
</manifest>
52+
```
53+
5454
4. Now let's remove `SYSTEM_ALERT_WINDOW` from the production APK only.
5555
5. Go to the `android/app/src/` directory. Create a new directory inside this directory, called `release`. (path: `android/app/src/release/`)
5656
6. Inside this `android/app/src/release/` directory create a `AndroidManifest.xml` file. (path: `android/app/src/release/AndroidManifest.xml`)
5757
7. Inside this file paste the following conents. Note, make sure to update your package identifier from "com.myapp" to what yours is.
5858

59-
```diff
60-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
61-
package="com.myapp"
62-
xmlns:tools="http://schemas.android.com/tools">
63-
64-
<uses-permission tools:node="remove" android:name="android.permission.SYSTEM_ALERT_WINDOW" />
65-
66-
</manifest>
67-
```
68-
59+
```diff
60+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
61+
package="com.myapp"
62+
xmlns:tools="http://schemas.android.com/tools">
63+
64+
<uses-permission tools:node="remove" android:name="android.permission.SYSTEM_ALERT_WINDOW" />
65+
66+
</manifest>
67+
```
68+
6969
That's it. We did not remove the `INTERNET` permission as pretty much all apps use it. Now whenever you create a production APK all these 4 permissions will be removed. When you create a debug APK (`react-native run-android`) it will install the APK with only the three permissions removed, and `SYSTEM_ALERT_WINDOW` will remain.

website/core/RemarkablePlugins.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function ReactNativeWebPlayer(md) {
171171
return (
172172
'<div class="web-player">' +
173173
htmlForCodeBlock(sampleCode) +
174-
`<iframe style="margin-top: 4" width="880" height="${
174+
`<iframe style="margin-top: 4" width="100%" height="${
175175
parseParams(paramsString).platform === 'android' ? '425' : '420'
176176
}" data-src="//cdn.rawgit.com/dabbott/react-native-web-player/gh-v${WEB_PLAYER_VERSION}/index.html${hash}" frame-border="0"></iframe>` +
177177
`</div>` +

website/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
"props": "Props",
9696
"pushnotificationios": "PushNotificationIOS",
9797
"refreshcontrol": "RefreshControl",
98+
"removing-default-permissions": "Removing Default Permissions",
9899
"running-on-device": "Running On Device",
99100
"running-on-simulator-ios": "Running On Simulator",
100101
"safeareaview": "SafeAreaView",

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"*.{js,json,css,md}": ["prettier --write", "git add"]
3737
},
3838
"dependencies": {
39-
"docusaurus": "^1.0.15",
39+
"docusaurus": "^1.3.0",
4040
"highlight.js": "^9.12.0",
4141
"remarkable": "^1.7.1"
4242
},

website/siteConfig.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ const siteConfig = {
5656
theme: "solarized-dark"
5757
},
5858
gaTrackingId: "UA-41298772-2",
59-
scripts: ["https://snack.expo.io/embed.js", baseUrl + "js/codeblocks.js"]
59+
scripts: ["https://snack.expo.io/embed.js", baseUrl + "js/codeblocks.js"],
60+
cleanUrl: true
6061
};
6162

6263
module.exports = siteConfig;

website/static/css/codeblocks.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
/** React Native Web Player **/
2+
.web-player {
3+
margin-bottom: 1em;
4+
}
5+
26
.web-player > iframe {
37
display: none;
48
}

website/static/css/hero.css

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,12 @@
3636
background: #2d2d2d;
3737
padding: 50px 0;
3838
color: #fdf3e7;
39-
font-weight: 300;
40-
text-align: center;
39+
text-align: center;
4140
}
4241

4342
.hero .text {
4443
font-size: 300%;
4544
text-align: center;
46-
height: 44px;
4745
}
4846

4947
.hero .minitext {
@@ -67,7 +65,7 @@
6765
}
6866

6967
.buttons-unit a {
70-
color:white;
68+
color: white;
7169
}
7270

7371
.buttons-unit .button {

website/static/css/react-native.css

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ body {
3333

3434
a {
3535
color: $secondaryColor;
36-
text-decoration: none !important;
3736
}
3837

3938
input#search_input_react {
@@ -147,7 +146,6 @@ code {
147146

148147
p {
149148
font-size: 18px;
150-
line-height: 1.4;
151149
}
152150

153151
.big-button {
@@ -202,7 +200,6 @@ p {
202200

203201
.hljs {
204202
line-height: 20px;
205-
border-left: 4px solid #05a5d1;
206203
background-color: rgba(5, 165, 209, 0.05);
207204
}
208205

website/static/css/tabs.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
.toggler {
2+
margin-bottom: 1em;
3+
}
14
.toggler li {
25
display: inline-block;
36
position: relative;
@@ -48,4 +51,3 @@
4851
text-decoration: none !important;
4952
color: $secondaryColor;
5053
}
51-

0 commit comments

Comments
 (0)