Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 35945e9

Browse files
committed
Merge pull request #122 from Microsoft/release_doc_updates
Adding release detail
2 parents 39679ed + 46f32cd commit 35945e9

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,14 @@ If an update is available, it will be silently downloaded, and installed the nex
207207
208208
Once your app has been configured and distributed to your users, and you've made some JS changes, it's time to release it to them instantly! If you're not using React Native to bundle images (via `require('./foo.png')`), then perform the following steps. Otherwise, skip to the next section instead:
209209
210-
1. Execute `react-native bundle` (passing the appropriate parameters) in order to generate the updated JS bundle for your app. You can place this file wherever you want via the `--bundle-output` flag, since the exact location isn't relevant for CodePush purposes.
210+
1. Execute `react-native bundle` (passing the appropriate parameters, see example below) in order to generate the updated JS bundle for your app. You can place this file wherever you want via the `--bundle-output` flag, since the exact location isn't relevant for CodePush purposes. It's important, however, that you set `--dev false` so that your JS code is optimized appropriately and any "yellow box" warnings won't be displayed.
211211
212212
2. Execute `code-push release <appName> <jsBundleFilePath> <appStoreVersion> --deploymentName <deploymentName>` in order to publish the generated JS bundle to the server. The `<jsBundleFilePath>` parameter should equal the value you provided to the `--bundle-output` flag in step #1. Additionally, the `<appStoreVersion>` parameter should equal the exact app store version (i.e. the semver version end users would see when installing it) you want this CodePush update to target.
213213
214214
Example Usage:
215215
216216
```
217-
react-native bundle --platform ios --entry-file index.ios.js --bundle-output codepush.js
217+
react-native bundle --platform ios --entry-file index.ios.js --bundle-output codepush.js --dev false
218218
code-push release MyApp codepush.js 1.0.2
219219
```
220220
@@ -224,19 +224,24 @@ And that's it! for more information regarding the CLI and how the release (or pr
224224
225225
## Releasing Updates (JavaScript + images)
226226
227-
If you are using the new React Native [assets system](https://facebook.github.io/react-native/docs/images.html#content), as opposed to loading your images from the network and/or platform-specific mechanisms (e.g. iOS asset catalogs), then you can't simply pass your jsbundle to CodePush as demonstrated above. You need to provide your images as well. To do this, simply use the following workflow:
227+
*Note: Android doesn't currently support deploying assets, so you must use the previous release strategy instead.*
228228
229-
1. When calling `react-native bundle`, specify that your assets and JS bundle go into a new "release" folder (you can call this anything, but it shouldn't contain any other files). For example:
229+
If you are using the new React Native [assets system](https://facebook.github.io/react-native/docs/images.html#content), as opposed to loading your images from the network and/or platform-specific mechanisms (e.g. iOS asset catalogs), then you can't simply pass your jsbundle to CodePush as demonstrated above. You **MUST** provide your images as well. To do this, simply use the following workflow:
230+
231+
1. Create a new directory that can be used to organize your app's release assets (i.e. the JS bundle and your images). We recommend calling this directory "release" but it can be named anything. If you create this directory within your project's directory, make sure to add it to your `.gitignore` file, since you don't want it checked into source control.
232+
233+
2. When calling `react-native bundle`, specify that your assets and JS bundle go into the directory you created in #1, and that you want a non-dev build for your respective platform and entry file. For example, assuming you called this directory "release", you could run the following command:
230234
231235
```
232236
react-native bundle \
233237
--platform ios \
234238
--entry-file index.ios.js \
235239
--bundle-output ./release/main.jsbundle \
236240
--assets-dest ./release
241+
--dev false
237242
```
238243
239-
2. Execute `code-push release`, passing the path to the directory you used in #1 as the "package" parameter (e.g. `code-push release Foo ./release 1.0.0`). The code-push CLI will automatically handle zipping up the contents for you, so don't worry about handling that yourself.
244+
3. Execute `code-push release`, passing the path to the directory you created in #1 as the "package" parameter (e.g. `code-push release Foo ./release 1.0.0`). The code-push CLI will automatically handle zipping up the contents for you, so don't worry about handling that yourself.
240245
241246
Additionally, the CodePush client supports differential updates, so even though you are releasing your JS bundle and assets on every update, your end users will only actually download the files they need. The service handles this automatically so that you can focus on creating awesome apps and we can worry about optimizing end user downloads.
242247

0 commit comments

Comments
 (0)