mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-16 09:01:38 +08:00
文档优化
This commit is contained in:
51
README.md
51
README.md
@@ -1,35 +1,10 @@
|
||||
# react-native-update [](http://badge.fury.io/js/react-native-update)
|
||||
|
||||
本组件是面向 React Native 提供热更新功能的组件,建议结合[Update 服务](https://update.reactnative.cn/)使用。
|
||||
本组件是面向 React Native 提供热更新功能的组件,请结合[Update 服务](https://update.reactnative.cn/)使用。
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
注意,在 iOS 上使用热更新有被拒的可能。被拒之后可以按此步骤单独屏蔽 iOS 端(`react-native-update`版本需 >= 5.3.2):
|
||||
</summary>
|
||||
### 快速开始
|
||||
|
||||
1. 如果 RN 版本>=0.60,在项目根目录下编辑或创建 react-native.config.js,添加如下内容
|
||||
|
||||
```js
|
||||
// react-native.config.js
|
||||
module.exports = {
|
||||
dependencies: {
|
||||
'react-native-update': {
|
||||
platforms: {
|
||||
ios: null, // 阻止ios模块自动链接
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
2. 如果在原生代码端尚未配置,则跳过下面文档中的 ios 端的配置。如果已经配置,则按文档的步骤反向操作(添加的 ios 代码删去)。
|
||||
3. 如果是 0.60 以上版本或使用了 cocoapods,在 ios 目录中再次运行 pod install,确保 Podfile 和 Podfile.lock 中都没有'react-native-update'。如果 RN 版本<0.60,则运行`react-native unlink react-native-update`。
|
||||
4. 在 js 代码里调用 checkUpdate()方法前,判断 Platform.OS,如果是 ios 平台则直接 return 跳过。
|
||||
</details>
|
||||
|
||||
### 最近更新
|
||||
|
||||
请查阅[最近更新文档](CHANGELOG.md)。
|
||||
请查看[文档](/docs)
|
||||
|
||||
### 优势
|
||||
|
||||
@@ -39,26 +14,6 @@ module.exports = {
|
||||
4. meta 信息及开放 API,提供更高扩展性。
|
||||
5. 跨越多个版本进行更新时,只需要下载**一个更新包**,不需要逐版本依次更新。
|
||||
|
||||
### 安装与快速入门
|
||||
|
||||
请查阅
|
||||
|
||||
- [文档-快速入门-准备工作](docs/guide.md)。
|
||||
|
||||
- [文档-快速入门-添加热更新功能](docs/guide2.md)。
|
||||
|
||||
- [文档-快速入门-发布版本](docs/guide3.md)。
|
||||
|
||||
- [文档-常见问题与高级指南](docs/faq_advance.md)。
|
||||
|
||||
### 命令行工具
|
||||
|
||||
请查阅[文档-命令行工具](docs/cli.md)。
|
||||
|
||||
### API 接口
|
||||
|
||||
请查阅[文档-API 接口](docs/api.md)。
|
||||
|
||||
### 本地开发
|
||||
|
||||
```
|
||||
|
0
docs/.nojekyll
Normal file
0
docs/.nojekyll
Normal file
53
docs/README.md
Normal file
53
docs/README.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# react-native-update [](http://badge.fury.io/js/react-native-update)
|
||||
|
||||
本组件是面向 React Native 提供热更新功能的组件,请结合[Update 服务](https://update.reactnative.cn/)使用。
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
注意,在 iOS 上使用热更新有被拒的可能。被拒之后可以按此步骤单独屏蔽 iOS 端(`react-native-update`版本需 >= 5.3.2):
|
||||
</summary>
|
||||
|
||||
1. 如果 RN 版本>=0.60,在项目根目录下编辑或创建 react-native.config.js,添加如下内容
|
||||
|
||||
```js
|
||||
// react-native.config.js
|
||||
module.exports = {
|
||||
dependencies: {
|
||||
'react-native-update': {
|
||||
platforms: {
|
||||
ios: null, // 阻止ios模块自动链接
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
2. 如果在原生代码端尚未配置,则跳过下面文档中的 ios 端的配置。如果已经配置,则按文档的步骤反向操作(添加的 ios 代码删去)。
|
||||
3. 如果是 0.60 以上版本或使用了 cocoapods,在 ios 目录中再次运行 pod install,确保 Podfile 和 Podfile.lock 中都没有'react-native-update'。如果 RN 版本<0.60,则运行`react-native unlink react-native-update`。
|
||||
4. 在 js 代码里调用 checkUpdate()方法前,判断 Platform.OS,如果是 ios 平台则直接 return 跳过。
|
||||
</details>
|
||||
|
||||
### 优势
|
||||
|
||||
1. 命令行工具&网页双端管理,版本发布过程简单便捷,完全可以集成 CI。
|
||||
2. 基于 bsdiff 算法创建的**超小更新包**,通常版本迭代后在 1-10KB 之间,避免数百 KB 的流量消耗。
|
||||
3. 支持崩溃回滚,安全可靠。
|
||||
4. meta 信息及开放 API,提供更高扩展性。
|
||||
5. 跨越多个版本进行更新时,只需要下载**一个更新包**,不需要逐版本依次更新。
|
||||
|
||||
### 本地开发
|
||||
|
||||
```
|
||||
$ git clone git@github.com:reactnativecn/react-native-pushy.git
|
||||
$ cd react-native-pushy/Example/testHotUpdate
|
||||
$ yarn
|
||||
$ yarn start
|
||||
```
|
||||
|
||||
本地库文件使用 yarn link 链接,因此可直接在源文件中修改,在 testHotUpdate 项目中调试。
|
||||
|
||||
### 关于我们
|
||||
|
||||
本组件由[React Native 中文网](https://reactnative.cn/)独家发布,如有定制需求可以[联系我们](https://reactnative.cn/about.html#content)。
|
||||
|
||||
关于此插件发现任何问题,可以前往[Issues](https://github.com/reactnativecn/react-native-pushy/issues)或者[中文社区](http://bbs.reactnative.cn/category/7)发帖提问。
|
10
docs/_sidebar.md
Normal file
10
docs/_sidebar.md
Normal file
@@ -0,0 +1,10 @@
|
||||
- 安装与快速入门
|
||||
|
||||
- [准备工作](guide.md)
|
||||
- [添加热更新功能](guide2.md)
|
||||
- [发布版本](guide3.md)
|
||||
- [常见问题与高级指南](faq_advance.md)
|
||||
|
||||
- [API接口](api.md)
|
||||
- [命令行工具](cli.md)
|
||||
- [最近更新](changelog.md)
|
@@ -52,7 +52,7 @@ npm i react-native-update@4.x
|
||||
请记得一定要重新编译(react-native run-ios或run-android命令编译,或在Xcode/Android Studio中重新编译)。
|
||||
|
||||
|
||||
## 一、手动link
|
||||
## 手动link
|
||||
|
||||
如果RN版本 >= 0.60则可以跳过此步骤
|
||||
|
||||
@@ -112,7 +112,7 @@ date +%s > "$DEST/pushy_build_time.txt"
|
||||
- 在`getPackages()` 方法中增加 `new UpdatePackage()`(注意上一行可能要增加一个逗号)
|
||||
</details>
|
||||
|
||||
## 二、配置Bundle URL
|
||||
## 配置Bundle URL
|
||||
|
||||
注意此步骤无论任何版本,目前都需要手动配置。
|
||||
|
||||
@@ -174,7 +174,7 @@ public class MainApplication extends Application implements ReactApplication {
|
||||
}
|
||||
```
|
||||
|
||||
## 三、登录与创建应用
|
||||
## 登录与创建应用
|
||||
|
||||
首先请在<https://update.reactnative.cn>注册帐号,然后在你的项目根目录下运行以下命令:
|
||||
|
||||
|
26
docs/index.html
Normal file
26
docs/index.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>react-native-update - react-native hot update</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta name="description" content="react-native hot update">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script>
|
||||
window.$docsify = {
|
||||
name: 'react-native-update',
|
||||
repo: 'https://github.com/reactnativecn/react-native-pushy',
|
||||
homepage: '../README.md',
|
||||
formatUpdated: '{MM}/{DD} {HH}:{mm}',
|
||||
loadSidebar: true,
|
||||
subMaxLevel: 2,
|
||||
auto2top: true
|
||||
}
|
||||
</script>
|
||||
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user