mobx 6.13.1 → 6.13.3

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,17 @@
1
1
  # mobx
2
2
 
3
+ ## 6.13.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a1cf2c63ef92d3d42a5b42a23ff6c7a745664cfd`](https://github.com/mobxjs/mobx/commit/a1cf2c63ef92d3d42a5b42a23ff6c7a745664cfd) [#3902](https://github.com/mobxjs/mobx/pull/3902) Thanks [@jzhan-canva](https://github.com/jzhan-canva)! - Fix 2022.3 @action decorators on fields no longer require makeObservable
8
+
9
+ ## 6.13.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`f1f922152b45357a49ee6b310e9e0ecf38bd3955`](https://github.com/mobxjs/mobx/commit/f1f922152b45357a49ee6b310e9e0ecf38bd3955) [#3921](https://github.com/mobxjs/mobx/pull/3921) Thanks [@urugator](https://github.com/urugator)! - fix: #3919 new set methods not working with observable set
14
+
3
15
  ## 6.13.1
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -55,8 +55,8 @@ MobX is made possible by the generosity of the sponsors below, and many other [i
55
55
  <a href="https://upper.co/?utm_source=github_mobxjs_sponsorship&utm_medium=paid_acquisition&utm_campaign=sponsorship"><img src="https://mobx.js.org/assets/upper.png" align="center" width="100" title="UPPER" alt="UPPER"/></a>
56
56
  <a href="https://careers.dazn.com/"><img src="https://mobx.js.org/assets/dazn.png" align="center" width="100" title="DAZN" alt="DAZN"></a>
57
57
  <a href="https://talentplot.com/"><img src="https://mobx.js.org/assets/talentplot.png" align="center" width="100" title="talentplot" alt="talentplot"></a>
58
-
59
- ## <a href="https://www.easeus.com/?utm_source=github_mobxjs_sponsorship&utm_medium=readme&utm_campaign=sponsorship"><img src="https://mobx.js.org/assets/easeus.png" align="center" width="100" title="EaseUS" alt="EaseUS"/></a>
58
+ <a href="https://www.easeus.com/?utm_source=github_mobxjs_sponsorship&utm_medium=readme&utm_campaign=sponsorship"><img src="https://mobx.js.org/assets/easeus.png" align="center" width="100" title="EaseUS" alt="EaseUS"/></a>
59
+ <a href="https://route4me.com/"><img src="https://mobx.js.org/assets/route4me.png" align="center" width="100" title="Route Planner and Route Optimizer" alt="Route Planner and Route Optimizer"/></a>
60
60
 
61
61
  ## Introduction
62
62
 
@@ -206,15 +206,24 @@ function createInstanceofPredicate(name, theClass) {
206
206
  return isObject(x) && x[propName] === true;
207
207
  };
208
208
  }
209
+ /**
210
+ * Yields true for both native and observable Map, even across different windows.
211
+ */
209
212
  function isES6Map(thing) {
210
213
  return thing != null && Object.prototype.toString.call(thing) === "[object Map]";
211
214
  }
215
+ /**
216
+ * Makes sure a Map is an instance of non-inherited native or observable Map.
217
+ */
212
218
  function isPlainES6Map(thing) {
213
219
  var mapProto = Object.getPrototypeOf(thing);
214
220
  var objectProto = Object.getPrototypeOf(mapProto);
215
221
  var nullProto = Object.getPrototypeOf(objectProto);
216
222
  return nullProto === null;
217
223
  }
224
+ /**
225
+ * Yields true for both native and observable Set, even across different windows.
226
+ */
218
227
  function isES6Set(thing) {
219
228
  return thing != null && Object.prototype.toString.call(thing) === "[object Set]";
220
229
  }
@@ -700,12 +709,19 @@ function decorate_20223_$1(mthd, context) {
700
709
  var _ann$options_$name, _ann$options_, _ann$options_$autoAct, _ann$options_2;
701
710
  return createAction((_ann$options_$name = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.name) != null ? _ann$options_$name : name.toString(), m, (_ann$options_$autoAct = (_ann$options_2 = ann.options_) == null ? void 0 : _ann$options_2.autoAction) != null ? _ann$options_$autoAct : false);
702
711
  };
703
- // Backwards/Legacy behavior, expects makeObservable(this)
704
712
  if (kind == "field") {
705
- addInitializer(function () {
706
- storeAnnotation(this, name, ann);
707
- });
708
- return;
713
+ return function (initMthd) {
714
+ var _ann$options_3;
715
+ var mthd = initMthd;
716
+ if (!isAction(mthd)) {
717
+ mthd = _createAction(mthd);
718
+ }
719
+ if ((_ann$options_3 = ann.options_) != null && _ann$options_3.bound) {
720
+ mthd = mthd.bind(this);
721
+ mthd.isMobxAction = true;
722
+ }
723
+ return mthd;
724
+ };
709
725
  }
710
726
  if (kind == "method") {
711
727
  var _this$options_2;
@@ -4771,7 +4787,7 @@ var ObservableSet = /*#__PURE__*/function () {
4771
4787
  });
4772
4788
  };
4773
4789
  _proto.intersection = function intersection(otherSet) {
4774
- if (isES6Set(otherSet)) {
4790
+ if (isES6Set(otherSet) && !isObservableSet(otherSet)) {
4775
4791
  return otherSet.intersection(this);
4776
4792
  } else {
4777
4793
  var dehancedSet = new Set(this);
@@ -4779,7 +4795,7 @@ var ObservableSet = /*#__PURE__*/function () {
4779
4795
  }
4780
4796
  };
4781
4797
  _proto.union = function union(otherSet) {
4782
- if (isES6Set(otherSet)) {
4798
+ if (isES6Set(otherSet) && !isObservableSet(otherSet)) {
4783
4799
  return otherSet.union(this);
4784
4800
  } else {
4785
4801
  var dehancedSet = new Set(this);
@@ -4790,7 +4806,7 @@ var ObservableSet = /*#__PURE__*/function () {
4790
4806
  return new Set(this).difference(otherSet);
4791
4807
  };
4792
4808
  _proto.symmetricDifference = function symmetricDifference(otherSet) {
4793
- if (isES6Set(otherSet)) {
4809
+ if (isES6Set(otherSet) && !isObservableSet(otherSet)) {
4794
4810
  return otherSet.symmetricDifference(this);
4795
4811
  } else {
4796
4812
  var dehancedSet = new Set(this);
@@ -4804,7 +4820,7 @@ var ObservableSet = /*#__PURE__*/function () {
4804
4820
  return new Set(this).isSupersetOf(otherSet);
4805
4821
  };
4806
4822
  _proto.isDisjointFrom = function isDisjointFrom(otherSet) {
4807
- if (isES6Set(otherSet)) {
4823
+ if (isES6Set(otherSet) && !isObservableSet(otherSet)) {
4808
4824
  return otherSet.isDisjointFrom(this);
4809
4825
  } else {
4810
4826
  var dehancedSet = new Set(this);