Skip to content

Commit

Permalink
Prettify
Browse files Browse the repository at this point in the history
  • Loading branch information
charpeni committed Feb 8, 2019
1 parent a5febfd commit f091868
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 33 deletions.
4 changes: 2 additions & 2 deletions docs/asyncstorage.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ Gets _all_ keys known to your app; for all callers, libraries, etc. Returns a `P
**Parameters:**
| Name | Type | Required | Description |
| -------- | ---------------------------------------------- | -------- | ---------------------------------------------------------- |
| Name | Type | Required | Description |
| -------- | ---------------------------------------------- | -------- | --------------------------------------------------------------- |
| callback | ?(error: ?Error, keys: ?Array<string>) => void | No | Function that will be called with all keys found and any error. |
---
Expand Down
2 changes: 1 addition & 1 deletion docs/building-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ If you made changes to React Native and submit a pull request, all tests will ru

## Making your changes available

See the [Publishing your own version of react native](publishing.md) for several options to make your changes available for your and other app projects.
See the [Publishing your own version of react native](publishing.md) for several options to make your changes available for your and other app projects.
6 changes: 3 additions & 3 deletions docs/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,9 @@ Android only. By default, it is 300ms.

Android only. When true, enables progressive jpeg streaming. https://frescolib.org/docs/progressive-jpegs.html

| Type | Required | Platform |
| ------ | -------- | -------- |
| bool | No | Android |
| Type | Required | Platform |
| ---- | -------- | -------- |
| bool | No | Android |

## Methods

Expand Down
4 changes: 3 additions & 1 deletion docs/integration-with-existing-apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -601,11 +601,12 @@ This is only used in dev mode when reloading JavaScript from the development ser

### Network Security Config (API level 28+)

> Starting with Android 9 (API level 28), cleartext traffic is disabled by default; this prevents your application from connecting to the React Native packager. These changes add domain rules that specifically allow cleartext traffic to the packager IPs.
> Starting with Android 9 (API level 28), cleartext traffic is disabled by default; this prevents your application from connecting to the React Native packager. These changes add domain rules that specifically allow cleartext traffic to the packager IPs.
#### 1. Create the following resource files

`app/src/debug/res/xml/network_security_config.xml`:

```xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
Expand All @@ -619,6 +620,7 @@ This is only used in dev mode when reloading JavaScript from the development ser
```

`app/src/release/res/xml/network_security_config.xml`:

```xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
Expand Down
11 changes: 6 additions & 5 deletions docs/network.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,10 @@ ws.onclose = (e) => {
## Known Issues with `fetch` and cookie based authentication

The following options are currently not working with `fetch`
- `redirect:manual`
- `credentials:omit`

* Having same name headers on Android will result in only the latest one being present. A temporary solution can be found here: https://github.com/facebook/react-native/issues/18837#issuecomment-398779994.
* Cookie based authentication is currently unstable. You can view some of the issues raised here: https://github.com/facebook/react-native/issues/23185
* As a minimum on iOS, when redirected through a `302`, if a `Set-Cookie` header is present, the cookie is not set properly. Since the redirect cannot be handled manually this might cause a scenario where infinite requests occur if the redirect is the result of an expired session.
* `redirect:manual`
* `credentials:omit`

- Having same name headers on Android will result in only the latest one being present. A temporary solution can be found here: https://github.com/facebook/react-native/issues/18837#issuecomment-398779994.
- Cookie based authentication is currently unstable. You can view some of the issues raised here: https://github.com/facebook/react-native/issues/23185
- As a minimum on iOS, when redirected through a `302`, if a `Set-Cookie` header is present, the cookie is not set properly. Since the redirect cannot be handled manually this might cause a scenario where infinite requests occur if the redirect is the result of an expired session.
4 changes: 2 additions & 2 deletions docs/permissionsandroid.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,6 @@ Prompts the user to enable multiple permissions in the same dialog and returns a

**Parameters:**

| Name | Type | Required | Description |
| ----------- | ----- | -------- | ------------------------------- |
| Name | Type | Required | Description |
| ----------- | ----- | -------- | -------------------------------- |
| permissions | array | Yes | Array of permissions to request. |
38 changes: 21 additions & 17 deletions docs/publishing.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ id: publishing-forks
title: Publish your own version of react native
---

TL;DR
---
## TL;DR

There is a docker image that helps you build the required Android sources without installing any additional tooling (other than [Docker](https://docs.docker.com/install/), which can be committed to a git branch as a fully functional React Native fork release.

Run this from a fork of the React Native [repo](https://github.com/facebook/react-native).

```
git checkout -d release/my-react-native-release
docker run --rm --name rn-build -v $PWD:/pwd -w /pwd reactnativecommunity/react-native-android /bin/sh -c "./gradlew installArchives"
Expand All @@ -17,45 +18,49 @@ git push
```

Install it in your app project package.json.

```
"dependencies": {
...
"react-native": "myName/react-native#release/my-react-native-release"
}
```

Rationale
---
## Rationale

The recommended approach to working with React Native is to always update to the latest version. No support is provided on older versions and if you run into issues the contributors will always ask you to upgrade to the latest version before even looking at your particular issue. Sometimes, though, you are temporarily stuck on an older React Native version, but you require some changes from newer versions urgently (bugfixes) without having to do a full upgrade right now. This situation should be short lived by definition and once you have the time, the real solution is to upgrade to the latest version.

With this goal of a shortlived fork of React Native in mind, you can publish your own version of React Native. The facebook/react-native repository contains all the dependencies required to be used directly as a git dependency, except for the Android React Native library binary (.aar).

Building
---
## Building

This binary needs to become available in your project's `node_modules/react-native/android` folder or directly in your gradle dependency of your Android app. You can achieve this in one of two ways: Git dependency branch, Android binary dependency through Maven.
This binary needs to become available in your project's `node_modules/react-native/android` folder or directly in your gradle dependency of your Android app. You can achieve this in one of two ways: Git dependency branch, Android binary dependency through Maven.

To build the .aar React Native library, you can follow the steps to [build from source](building-from-source.md) first to install all required tooling. Then to build the actual library, you can run the following in the root of your react-native checkout:
```$bash
To build the .aar React Native library, you can follow the steps to [build from source](building-from-source.md) first to install all required tooling. Then to build the actual library, you can run the following in the root of your react-native checkout:

```$bash
./gradlew :ReactAndroid:installArchives --no-daemon
```
```

If you don't want to install the required toolchain for building from source, you can use a prebuilt docker image to create a react native binary;

If you don't want to
install the required toolchain for building from source, you can use a prebuilt docker image to create a react native binary;
```
docker run --rm --name rn-build -v $PWD:/pwd -w /pwd reactnativecommunity/react-native-android /bin/sh -c "./gradlew installArchives"
```
docker run --rm --name rn-build -v $PWD:/pwd -w /pwd reactnativecommunity/react-native-android /bin/sh -c "./gradlew installArchives"
```

If you haven't used the Android NDK before or if you have a NDK version not exactly matching the required version for building React Native, this is the recommended approach.

The resulting binary can be made available to app projects in one of the two ways described below.

### Publishing to Maven/Nexus

Upload the binaries from the `android` folder to maven and point your Android app project gradle dependency for React Native to your Maven/Nexus dependency.

### Publishing to a git fork dependency

Instead of uploading to Maven/Nexus, you can add the binaries built in the previous steps to git, by changing the .gitignore and committing the binaries to your forked branch. This allows you to make your fork into a functioning git dependency for React Native app projects.

If you have changes that you want to actually merge to React Native, make them on another branch first and open a PR. To start making your dependency branch, make sure you are on a 'release/my-forked-release' branch, then merge any commits that you need from yourself or others into this branch. This release branch should never be merged into any other branch.
If you have changes that you want to actually merge to React Native, make them on another branch first and open a PR. To start making your dependency branch, make sure you are on a 'release/my-forked-release' branch, then merge any commits that you need from yourself or others into this branch. This release branch should never be merged into any other branch.

```$bash
# create .aar, then:
Expand All @@ -75,4 +80,3 @@ Now you can use this branch as a git dependency in your app project, by pointing
```

No other modifications to your dependencies should be necessary for your native changes to be included in your project.

9 changes: 8 additions & 1 deletion docs/scrollview.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,15 @@ Enables nested scrolling for Android API level 21+. Nested scrolling is supporte
### `scrollTo()`

```javascript
scrollTo(([y]: number), object, ([x]: number), ([animated]: boolean), ([duration]: number));
scrollTo(
([y]: number),
object,
([x]: number),
([animated]: boolean),
([duration]: number),
);
```

Scrolls to a given x, y offset, either immediately, with a smooth animation, or, for Android only, a custom animation duration time.

Example:
Expand Down
2 changes: 1 addition & 1 deletion website/blog/2019-01-07-state-of-react-native-community.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ In early 2019, we will have this new set of guidelines in place. Let us know wha

We are confident that with these changes, the community will become more collaborative so that when we reach 1.0, we will all continue to write (even more) awesome apps by leveraging this joint effort 🤗

----
---

I hope you are as excited as we are about the future of this community. We're excited to see all of you involved either in the conversations happening in the repositories listed above or via the awesome code you’ll produce.

Expand Down

0 comments on commit f091868

Please sign in to comment.