mobx 6.15.0 → 6.15.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # mobx
2
2
 
3
+ ## 6.15.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`52ddce0f179a461b85e578554e35e94bf76edf3c`](https://github.com/mobxjs/mobx/commit/52ddce0f179a461b85e578554e35e94bf76edf3c) [#4642](https://github.com/mobxjs/mobx/pull/4642) Thanks [@kubk](https://github.com/kubk)! - Restore npm release build target forwarding so published tarballs include the standalone ESM development and production bundles.
8
+
9
+ ## 6.15.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`df81c144fb148b64140d761aa61f032a7f429e12`](https://github.com/mobxjs/mobx/commit/df81c144fb148b64140d761aa61f032a7f429e12) [#4523](https://github.com/mobxjs/mobx/pull/4523) Thanks [@exzos28](https://github.com/exzos28)! - Make `FlowCancellationError` a proper `Error` instance while preserving its previous string representation.
14
+
15
+ - [`21fc4de6c09a77caf115aedd2fe6df972637412b`](https://github.com/mobxjs/mobx/commit/21fc4de6c09a77caf115aedd2fe6df972637412b) [#4626](https://github.com/mobxjs/mobx/pull/4626) Thanks [@kubk](https://github.com/kubk)! - Export `CancellablePromise` from the public `mobx` entrypoint.
16
+
3
17
  ## 6.15.0
4
18
 
5
19
  ### Minor Changes
package/README.md CHANGED
@@ -48,7 +48,7 @@ MobX is made possible by the generosity of the sponsors below, and many other [i
48
48
  **🥈 Silver sponsors (\$500+ total contributions):**<br/>
49
49
 
50
50
  <a href="https://mantro.net/jobs/warlock"><img src="https://mobx.js.org/assets/mantro.png" align="center" width="100" title="mantro GmbH" alt="mantro GmbH"></a>
51
- <a href="https://www.xh.com/"><img src="https://mobx.js.org/assets/xh.png" align="center" width="100" title="Extremely Heavy" alt="Extremely Heavy" /></a>
51
+ <a href="https://xh.io/"><img src="https://mobx.js.org/assets/xh.png" align="center" width="100" title="Extremely Heavy Industries" alt="Extremely Heavy Industries" /></a>
52
52
  <a href="https://www.algolia.com/"><img src="https://mobx.js.org/assets/algolia.jpg" align="center" width="100" title="Algolia" alt="Algolia" /></a>
53
53
  <a href="https://space307.com/?utm_source=sponsorship&utm_medium=mobx&utm_campaign=readme"><img src="https://mobx.js.org/assets/space307.png" align="center" width="100" title="Space307" alt="Space307"/></a>
54
54
  <a href="https://blokt.com/"><img src="https://mobx.js.org/assets/blokt.jpg" align="center" width="100" title="Blokt" alt="Blokt"/></a>
@@ -1,11 +1,11 @@
1
1
  import { Annotation } from "../internal";
2
2
  import type { ClassMethodDecorator } from "../types/decorator_fills";
3
3
  export declare const FLOW = "flow";
4
- export declare function FlowCancellationError(): void;
5
- export declare namespace FlowCancellationError {
6
- var prototype: any;
4
+ export declare class FlowCancellationError extends Error {
5
+ constructor();
6
+ toString(): string;
7
7
  }
8
- export declare function isFlowCancellationError(error: Error): boolean;
8
+ export declare function isFlowCancellationError(error: Error): error is FlowCancellationError;
9
9
  export type CancellablePromise<T> = Promise<T> & {
10
10
  cancel(): void;
11
11
  };
@@ -292,6 +292,13 @@ function _arrayLikeToArray(r, a) {
292
292
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
293
293
  return n;
294
294
  }
295
+ function _construct(t, e, r) {
296
+ if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
297
+ var o = [null];
298
+ o.push.apply(o, e);
299
+ var p = new (t.bind.apply(t, o))();
300
+ return r && _setPrototypeOf(p, r.prototype), p;
301
+ }
295
302
  function _defineProperties(e, r) {
296
303
  for (var t = 0; t < r.length; t++) {
297
304
  var o = r[t];
@@ -329,9 +336,29 @@ function _extends() {
329
336
  return n;
330
337
  }, _extends.apply(null, arguments);
331
338
  }
339
+ function _getPrototypeOf(t) {
340
+ return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
341
+ return t.__proto__ || Object.getPrototypeOf(t);
342
+ }, _getPrototypeOf(t);
343
+ }
332
344
  function _inheritsLoose(t, o) {
333
345
  t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
334
346
  }
347
+ function _isNativeFunction(t) {
348
+ try {
349
+ return -1 !== Function.toString.call(t).indexOf("[native code]");
350
+ } catch (n) {
351
+ return "function" == typeof t;
352
+ }
353
+ }
354
+ function _isNativeReflectConstruct() {
355
+ try {
356
+ var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
357
+ } catch (t) {}
358
+ return (_isNativeReflectConstruct = function () {
359
+ return !!t;
360
+ })();
361
+ }
335
362
  function _setPrototypeOf(t, e) {
336
363
  return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
337
364
  return t.__proto__ = e, t;
@@ -358,6 +385,28 @@ function _unsupportedIterableToArray(r, a) {
358
385
  return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
359
386
  }
360
387
  }
388
+ function _wrapNativeSuper(t) {
389
+ var r = "function" == typeof Map ? new Map() : void 0;
390
+ return _wrapNativeSuper = function (t) {
391
+ if (null === t || !_isNativeFunction(t)) return t;
392
+ if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
393
+ if (void 0 !== r) {
394
+ if (r.has(t)) return r.get(t);
395
+ r.set(t, Wrapper);
396
+ }
397
+ function Wrapper() {
398
+ return _construct(t, arguments, _getPrototypeOf(this).constructor);
399
+ }
400
+ return Wrapper.prototype = Object.create(t.prototype, {
401
+ constructor: {
402
+ value: Wrapper,
403
+ enumerable: !1,
404
+ writable: !0,
405
+ configurable: !0
406
+ }
407
+ }), _setPrototypeOf(Wrapper, t);
408
+ }, _wrapNativeSuper(t);
409
+ }
361
410
 
362
411
  var storedAnnotationsSymbol = /*#__PURE__*/Symbol("mobx-stored-annotations");
363
412
  /**
@@ -1576,7 +1625,7 @@ var ComputedValue = /*#__PURE__*/function () {
1576
1625
  }
1577
1626
  }
1578
1627
  // to check for cycles
1579
- ;
1628
+ ;
1580
1629
  /**
1581
1630
  * Returns the current value of this computed value.
1582
1631
  * Will evaluate its computation first if needed.
@@ -3016,10 +3065,21 @@ function unique(list) {
3016
3065
  }
3017
3066
 
3018
3067
  var generatorId = 0;
3019
- function FlowCancellationError() {
3020
- this.message = "FLOW_CANCELLED";
3021
- }
3022
- FlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);
3068
+ var FlowCancellationError = /*#__PURE__*/function (_Error) {
3069
+ function FlowCancellationError() {
3070
+ var _this;
3071
+ _this = _Error.call(this, "FLOW_CANCELLED") || this;
3072
+ Object.setPrototypeOf(_this, (this instanceof FlowCancellationError ? this.constructor : void 0).prototype);
3073
+ _this.name = "FlowCancellationError";
3074
+ return _this;
3075
+ }
3076
+ _inheritsLoose(FlowCancellationError, _Error);
3077
+ var _proto = FlowCancellationError.prototype;
3078
+ _proto.toString = function toString() {
3079
+ return "Error: " + this.message;
3080
+ };
3081
+ return FlowCancellationError;
3082
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
3023
3083
  function isFlowCancellationError(error) {
3024
3084
  return error instanceof FlowCancellationError;
3025
3085
  }
@@ -5031,7 +5091,7 @@ var ObservableObjectAdministration = /*#__PURE__*/function () {
5031
5091
  }
5032
5092
  }
5033
5093
  // Trap for "in"
5034
- ;
5094
+ ;
5035
5095
  _proto.has_ = function has_(key) {
5036
5096
  if (!globalState.trackingDerivation) {
5037
5097
  // Skip key subscription outside derivation
@@ -5163,7 +5223,7 @@ var ObservableObjectAdministration = /*#__PURE__*/function () {
5163
5223
  return true;
5164
5224
  }
5165
5225
  // If original descriptor becomes relevant, move this to annotation directly
5166
- ;
5226
+ ;
5167
5227
  _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {
5168
5228
  if (proxyTrap === void 0) {
5169
5229
  proxyTrap = false;
@@ -5215,7 +5275,7 @@ var ObservableObjectAdministration = /*#__PURE__*/function () {
5215
5275
  return true;
5216
5276
  }
5217
5277
  // If original descriptor becomes relevant, move this to annotation directly
5218
- ;
5278
+ ;
5219
5279
  _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {
5220
5280
  if (proxyTrap === void 0) {
5221
5281
  proxyTrap = false;