@revopush/react-native-code-push 2.5.0-rc.5 → 2.5.0-rc.7

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.
@@ -56,7 +56,7 @@ dependencies {
56
56
  // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
57
57
  //noinspection GradleDynamicVersion
58
58
 
59
- implementation "org.revopush:revopush-diff:0.0.5"
59
+ implementation "org.revopush:revopush-diff:0.0.7"
60
60
  implementation "com.facebook.react:react-native:+"
61
61
  }
62
62
  }
@@ -156,12 +156,17 @@ gradle.projectsEvaluated {
156
156
  }
157
157
 
158
158
  project.extensions.findByName("androidComponents")?.finalizeDsl { extension ->
159
- // disable PNG crunching for release builds to align APK resources with what Metro builds
160
- extension.buildTypes.named("release") {
161
- crunchPngs = false
162
- }
159
+ // This disables density-based APK splitting for the App Bundle
160
+ extension.bundle.density.enableSplit = false
161
+
162
+ extension.androidResources.noCompress += "png"
163
163
 
164
164
  extension.buildTypes.all { buildType ->
165
+ // disable PNG crunching for release builds to align APK resources with what Metro builds
166
+ if(!buildType.debuggable){
167
+ crunchPngs = false
168
+ }
169
+
165
170
  // to prevent incorrect long value restoration from strings.xml we need to wrap it with double quotes
166
171
  // https://github.com/microsoft/cordova-plugin-code-push/issues/264
167
172
  buildType.resValue('string', "CODE_PUSH_APK_BUILD_TIME", String.format("\"%d\"", System.currentTimeMillis()))
@@ -36,9 +36,7 @@ public class FileUtils {
36
36
  }
37
37
  }
38
38
 
39
- if (!file.delete()) {
40
- CodePushUtils.log("Error deleting file " + file.getName());
41
- }
39
+ file.delete();
42
40
  }
43
41
 
44
42
  public static boolean fileAtPathExists(String filePath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revopush/react-native-code-push",
3
- "version": "2.5.0-rc.5",
3
+ "version": "2.5.0-rc.7",
4
4
  "description": "React Native plugin for the CodePush service",
5
5
  "main": "CodePush.js",
6
6
  "typings": "typings/react-native-code-push.d.ts",
@@ -52,7 +52,7 @@ function getBundleResourceEntries(resourcesDir, assetsDir) {
52
52
 
53
53
  const normalizePath = (it) => path.join(CODE_PUSH_FOLDER_PREFIX, it).replace(/\\/g, "/")
54
54
  return {
55
- resources: Object.fromEntries(resourceFilesRelative.map((it) => [path.parse(it).name, normalizePath(it)])),
55
+ resources: Object.fromEntries(resourceFilesRelative.map((it) => [normalizePath(it), path.parse(it).name])),
56
56
  assets: Object.fromEntries(assetsFilesRelative.map((it) => [it.replace(/\\/g, "/"), normalizePath(it)]))
57
57
  }
58
58
  }
@@ -122,8 +122,8 @@ export interface SyncOptions {
122
122
 
123
123
  /**
124
124
  * Specifies the minimum number of seconds that the app needs to have been in the background before restarting the app. This property
125
- * only applies to updates which are installed using `InstallMode.ON_NEXT_RESUME` or `InstallMode.ON_NEXT_SUSPEND`, and can be useful
126
- * for getting your update in front of end users sooner, without being too obtrusive. Defaults to `0`, which has the effect of applying
125
+ * only applies to updates which are installed using `InstallMode.ON_NEXT_RESUME` or `InstallMode.ON_NEXT_SUSPEND`, and can be useful
126
+ * for getting your update in front of end users sooner, without being too obtrusive. Defaults to `0`, which has the effect of applying
127
127
  * the update immediately after a resume or unless the app suspension is long enough to not matter, regardless how long it was in the background.
128
128
  */
129
129
  minimumBackgroundDuration?: number;
@@ -144,6 +144,12 @@ export interface SyncOptions {
144
144
  * one or more of the default values.
145
145
  */
146
146
  rollbackRetryOptions?: RollbackRetryOptions;
147
+
148
+ /**
149
+ * Indicates whether you would like to ignore failed updates. This is useful in scenarios where you want to install an update irrespective
150
+ * of whether the previous update was successful or not.
151
+ */
152
+ ignoreFailedUpdates?: Boolean;
147
153
  }
148
154
 
149
155
  export interface UpdateDialog {
@@ -257,7 +263,7 @@ declare namespace CodePush {
257
263
  * Asks the CodePush service whether the configured app deployment has an update available.
258
264
  *
259
265
  * @param deploymentKey The deployment key to use to query the CodePush server for an update.
260
- *
266
+ *
261
267
  * @param handleBinaryVersionMismatchCallback An optional callback for handling target binary version mismatch
262
268
  */
263
269
  function checkForUpdate(deploymentKey?: string, handleBinaryVersionMismatchCallback?: HandleBinaryVersionMismatchCallback): Promise<RemotePackage | null>;
@@ -267,12 +273,12 @@ declare namespace CodePush {
267
273
  *
268
274
  * @param updateState The state of the update you want to retrieve the metadata for. Defaults to UpdateState.RUNNING.
269
275
  */
270
- function getUpdateMetadata(updateState?: UpdateState) : Promise<LocalPackage|null>;
276
+ function getUpdateMetadata(updateState?: UpdateState): Promise<LocalPackage | null>;
271
277
 
272
278
  /**
273
279
  * Notifies the CodePush runtime that an installed update is considered successful.
274
280
  */
275
- function notifyAppReady(): Promise<StatusReport|void>;
281
+ function notifyAppReady(): Promise<StatusReport | void>;
276
282
 
277
283
  /**
278
284
  * Allow CodePush to restart the app.
@@ -326,7 +332,7 @@ declare namespace CodePush {
326
332
  /**
327
333
  * Indicates that you want to install the update, but don't want to restart the app until the next time
328
334
  * the end user resumes it from the background. This way, you don't disrupt their current session,
329
- * but you can get the update in front of them sooner then having to wait for the next natural restart.
335
+ * but you can get the update in front of them sooner then having to wait for the next natural restart.
330
336
  * This value is appropriate for silent installs that can be applied on resume in a non-invasive way.
331
337
  */
332
338
  ON_NEXT_RESUME,
@@ -347,30 +353,30 @@ declare namespace CodePush {
347
353
  * The app is up-to-date with the CodePush server.
348
354
  */
349
355
  UP_TO_DATE,
350
-
356
+
351
357
  /**
352
358
  * An available update has been installed and will be run either immediately after the
353
359
  * syncStatusChangedCallback function returns or the next time the app resumes/restarts,
354
360
  * depending on the InstallMode specified in SyncOptions
355
361
  */
356
362
  UPDATE_INSTALLED,
357
-
363
+
358
364
  /**
359
365
  * The app had an optional update which the end user chose to ignore.
360
366
  * (This is only applicable when the updateDialog is used)
361
367
  */
362
368
  UPDATE_IGNORED,
363
-
369
+
364
370
  /**
365
371
  * The sync operation encountered an unknown error.
366
372
  */
367
373
  UNKNOWN_ERROR,
368
-
374
+
369
375
  /**
370
376
  * There is an ongoing sync operation running which prevents the current call from being executed.
371
377
  */
372
378
  SYNC_IN_PROGRESS,
373
-
379
+
374
380
  /**
375
381
  * The CodePush server is being queried for an update.
376
382
  */