@ngxs/store 3.7.3-dev.master-5b116c1 → 3.7.3-dev.master-d470dff

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.
@@ -472,6 +472,9 @@
472
472
  * Run in development mode. This will add additional debugging features:
473
473
  * - Object.freeze on the state and actions to guarantee immutability
474
474
  * (default: false)
475
+ *
476
+ * @deprecated This property is no longer necessary when the Ivy compiler is used.
477
+ * We'll determine the development mode through the `ngDevMode`. It's still essential with View Engine.
475
478
  * @type {?}
476
479
  */
477
480
  NgxsConfig.prototype.developmentMode;
@@ -2261,9 +2264,22 @@
2261
2264
  */
2262
2265
  function (actionOrActions) { return _this._dispatcher.dispatch(actionOrActions); })
2263
2266
  };
2264
- return this._config.developmentMode
2265
- ? ensureStateAndActionsAreImmutable(rootStateOperations)
2266
- : rootStateOperations;
2267
+ // We have to have that duplication since this will allow us to tree-shake `ensureStateAndActionsAreImmutable`
2268
+ // and `deepFreeze` in Ivy production build.
2269
+ // The below `if` condition checks 2 things:
2270
+ // 1) if we're in View Engine (`ngDevMode` is `undefined`)
2271
+ // 2) if we're running tests, we should fallback to `config.developmentMode` to be backwards-compatible
2272
+ if (typeof ngDevMode === 'undefined' || (ngDevMode && internals.isAngularInTestMode())) {
2273
+ return this._config.developmentMode
2274
+ ? ensureStateAndActionsAreImmutable(rootStateOperations)
2275
+ : rootStateOperations;
2276
+ }
2277
+ else {
2278
+ // If we're in Ivy and not running tests, then tree-shake `ensureStateAndActionsAreImmutable` and `deepFreeze`.
2279
+ return ngDevMode
2280
+ ? ensureStateAndActionsAreImmutable(rootStateOperations)
2281
+ : rootStateOperations;
2282
+ }
2267
2283
  };
2268
2284
  /**
2269
2285
  * @param {?} results
@@ -2310,7 +2326,6 @@
2310
2326
  */
2311
2327
  InternalStateOperations.prototype._config;
2312
2328
  }
2313
- // We make it as a separate function and not the class method to tree-shake it in the future.
2314
2329
  /**
2315
2330
  * @param {?} root
2316
2331
  * @return {?}