react-native-ota-hot-update 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +11 -9
  2. package/package.json +10 -4
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # react-native-ota-hot-update
2
2
 
3
- A React Native module that allows you to control hot update same as Code Push, less config than Code Push, you can control version manager, hosting bundle js by your self, this library just control install the hot update after bundle js downloaded from your side. As we know, Code push is going to retirement in next year, that why i create that library for you can control bundle js from your backend side.
3
+ A React Native module that allows you to control hot update same as Code Push, less config than Code Push, you can control version manager, hosting bundle js by your self, this library just control install the hot update after bundle js downloaded from your side. As we know, Code push is going to retirement soon, that why i create that library for you can control bundle js from your backend side.
4
4
 
5
5
 
6
6
  iOS GIF | Android GIF
@@ -12,7 +12,7 @@ iOS GIF | Android GIF
12
12
 
13
13
  ## New architecture supported
14
14
 
15
- New architecture backward compatibility supported from version 2, it also supported old architecture, for source code of old architecture please refer to branch `oldArch`
15
+ New architecture backward compatibility supported from version 2, it also supported old architecture, for source code of version 1.x.x please refer to branch `oldArch`, you might need install version 1.x.x if you are using react native < 0.70
16
16
 
17
17
  ## Installation
18
18
 
@@ -86,29 +86,31 @@ android:requestLegacyExternalStorage="true"
86
86
  `
87
87
 
88
88
  ## That's it, can check the example code
89
+ `Remember hot update just work at release mode, debug mode won't working`
90
+
89
91
 
90
92
  Here is the guideline to control bundle js by yourself, in here i am using Firebase storage to store bundlejs file and a json file that announce new version is comming:
91
93
 
92
- #### 1.Add these script into your package.json to export bundlejs file:
94
+ #### 1.Add these script into your package.json to export bundlejs file and source map file:
93
95
 
94
96
  - For react native CLI:
95
97
  ```bash
96
98
  "scripts": {
97
- "export-android": "mkdir -p android/output && react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/output/index.android.bundle --assets-dest android/output && cd android && find output -type f | zip index.android.bundle.zip -@ && cd .. && rm -rf android/output",
98
- "export-ios": "mkdir -p ios/output && react-native bundle --platform ios --dev false --entry-file index.js --bundle-output ios/output/main.jsbundle --assets-dest ios/output && cd ios && find output -type f | zip main.jsbundle.zip -@ && cd .. && rm -rf ios/output"
99
+ "export-android": "mkdir -p android/output && react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/output/index.android.bundle --assets-dest android/output --sourcemap-output android/sourcemap.js && cd android && find output -type f | zip index.android.bundle.zip -@ && zip sourcemap.zip sourcemap.js && cd .. && rm -rf android/output && rm -rf android/sourcemap.js",
100
+ "export-ios": "mkdir -p ios/output && react-native bundle --platform ios --dev false --entry-file index.js --bundle-output ios/output/main.jsbundle --assets-dest ios/output --sourcemap-output ios/sourcemap.js && cd ios && find output -type f | zip main.jsbundle.zip -@ && zip sourcemap.zip sourcemap.js && cd .. && rm -rf ios/output && rm -rf ios/sourcemap.js"
99
101
  }
100
102
  ```
101
103
  - For expo / expo bare project:
102
104
 
103
105
  ```bash
104
106
  "scripts": {
105
- "export-android": "mkdir -p android/output && npx expo export:embed --platform android --entry-file node_modules/expo/AppEntry.js --bundle-output android/output/index.android.bundle --dev false --assets-dest android/output && cd android && find output -type f | zip index.android.bundle.zip -@ && cd .. && rm -rf android/output",
106
- "export-ios": "mkdir -p ios/output && npx expo export:embed --platform ios --entry-file node_modules/expo/AppEntry.js --bundle-output ios/output/main.jsbundle --dev false --assets-dest ios/output && cd ios && find output -type f | zip main.jsbundle.zip -@ && cd .. && rm -rf ios/output"
107
+ "export-android": "mkdir -p android/output && npx expo export:embed --platform android --entry-file node_modules/expo/AppEntry.js --bundle-output android/output/index.android.bundle --dev false --assets-dest android/output --sourcemap-output android/sourcemap.js && cd android && find output -type f | zip index.android.bundle.zip -@ && zip sourcemap.zip sourcemap.js && cd .. && rm -rf android/output && rm -rf android/sourcemap.js",
108
+ "export-ios": "mkdir -p ios/output && npx expo export:embed --platform ios --entry-file node_modules/expo/AppEntry.js --bundle-output ios/output/main.jsbundle --dev false --assets-dest ios/output --sourcemap-output ios/sourcemap.js && cd ios && find output -type f | zip main.jsbundle.zip -@ && zip sourcemap.zip sourcemap.js && cd .. && rm -rf ios/output && rm -rf ios/sourcemap.js"
107
109
  }
108
110
  ```
109
111
  For expo you might need check path of `--entry-file node_modules/expo/AppEntry.js`, get it from package.json / main
110
112
 
111
- These commands are export bundle file and compress it as a zip file, one for android and one for ios. You can create your own script that export and auto upload to your server.
113
+ These commands are export bundle file and source map file then compress it as a zip file, one for android and one for ios. You can create your own script that export and auto upload to your server. For source map file you can ignore or use that with your purpose to debug in release mode.
112
114
 
113
115
  Then create an json file: `update.json` like that:
114
116
  ```bash
@@ -191,4 +193,4 @@ The same method as `react-native-blob-util` or `rn-fetch-blob`
191
193
 
192
194
  ## License
193
195
 
194
- [MIT](LICENSE.md)
196
+ [MIT](LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ota-hot-update",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Hot update for react native",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -46,9 +46,15 @@
46
46
  "release": "release-it"
47
47
  },
48
48
  "keywords": [
49
- "react-native",
50
- "ios",
51
- "android"
49
+ "hot-update",
50
+ "ota",
51
+ "code-push",
52
+ "update",
53
+ "react-native-hotupdate",
54
+ "react-native-codepush",
55
+ "ota-hot-update",
56
+ "custom-ota",
57
+ "rn-hotupdate"
52
58
  ],
53
59
  "repository": {
54
60
  "type": "git",