mobx 6.13.2 → 6.13.4

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.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f91d2e1dc85a53b729c03bd28ab39ffcf0838403`](https://github.com/mobxjs/mobx/commit/f91d2e1dc85a53b729c03bd28ab39ffcf0838403) [#3935](https://github.com/mobxjs/mobx/pull/3935) Thanks [@tonyraoul](https://github.com/tonyraoul)! - Update typescript version to 5.6.2 and added support for esnext iterator helpers
8
+
9
+ ## 6.13.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [`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
14
+
3
15
  ## 6.13.2
4
16
 
5
17
  ### Patch Changes
@@ -42,7 +42,7 @@ export declare class Reaction implements IDerivation, IReactionPublic {
42
42
  private static readonly diffValueMask_;
43
43
  private flags_;
44
44
  isTracing_: TraceMode;
45
- constructor(name_: string, onInvalidate_: () => void, errorHandler_?: ((error: any, derivation: IDerivation) => void) | undefined, requiresObservable_?: any);
45
+ constructor(name_: string | undefined, onInvalidate_: () => void, errorHandler_?: ((error: any, derivation: IDerivation) => void) | undefined, requiresObservable_?: any);
46
46
  get isDisposed(): boolean;
47
47
  set isDisposed(newValue: boolean);
48
48
  get isScheduled(): boolean;
@@ -709,12 +709,19 @@ function decorate_20223_$1(mthd, context) {
709
709
  var _ann$options_$name, _ann$options_, _ann$options_$autoAct, _ann$options_2;
710
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);
711
711
  };
712
- // Backwards/Legacy behavior, expects makeObservable(this)
713
712
  if (kind == "field") {
714
- addInitializer(function () {
715
- storeAnnotation(this, name, ann);
716
- });
717
- 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
+ };
718
725
  }
719
726
  if (kind == "method") {
720
727
  var _this$options_2;
@@ -4391,7 +4398,7 @@ var ObservableMap = /*#__PURE__*/function () {
4391
4398
  _proto.values = function values() {
4392
4399
  var self = this;
4393
4400
  var keys = this.keys();
4394
- return makeIterable({
4401
+ return makeIterableForMap({
4395
4402
  next: function next() {
4396
4403
  var _keys$next = keys.next(),
4397
4404
  done = _keys$next.done,
@@ -4406,7 +4413,7 @@ var ObservableMap = /*#__PURE__*/function () {
4406
4413
  _proto.entries = function entries() {
4407
4414
  var self = this;
4408
4415
  var keys = this.keys();
4409
- return makeIterable({
4416
+ return makeIterableForMap({
4410
4417
  next: function next() {
4411
4418
  var _keys$next2 = keys.next(),
4412
4419
  done = _keys$next2.done,
@@ -4587,6 +4594,10 @@ var ObservableMap = /*#__PURE__*/function () {
4587
4594
  }();
4588
4595
  // eslint-disable-next-line
4589
4596
  var isObservableMap = /*#__PURE__*/createInstanceofPredicate("ObservableMap", ObservableMap);
4597
+ function makeIterableForMap(iterator) {
4598
+ iterator[Symbol.toStringTag] = "MapIterator";
4599
+ return makeIterable(iterator);
4600
+ }
4590
4601
  function convertToMap(dataStructure) {
4591
4602
  if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {
4592
4603
  return dataStructure;
@@ -4747,7 +4758,7 @@ var ObservableSet = /*#__PURE__*/function () {
4747
4758
  var nextIndex = 0;
4748
4759
  var keys = Array.from(this.keys());
4749
4760
  var values = Array.from(this.values());
4750
- return makeIterable({
4761
+ return makeIterableForSet({
4751
4762
  next: function next() {
4752
4763
  var index = nextIndex;
4753
4764
  nextIndex += 1;
@@ -4755,6 +4766,7 @@ var ObservableSet = /*#__PURE__*/function () {
4755
4766
  value: [keys[index], values[index]],
4756
4767
  done: false
4757
4768
  } : {
4769
+ value: undefined,
4758
4770
  done: true
4759
4771
  };
4760
4772
  }
@@ -4768,12 +4780,13 @@ var ObservableSet = /*#__PURE__*/function () {
4768
4780
  var self = this;
4769
4781
  var nextIndex = 0;
4770
4782
  var observableValues = Array.from(this.data_.values());
4771
- return makeIterable({
4783
+ return makeIterableForSet({
4772
4784
  next: function next() {
4773
4785
  return nextIndex < observableValues.length ? {
4774
4786
  value: self.dehanceValue_(observableValues[nextIndex++]),
4775
4787
  done: false
4776
4788
  } : {
4789
+ value: undefined,
4777
4790
  done: true
4778
4791
  };
4779
4792
  }
@@ -4876,6 +4889,10 @@ var ObservableSet = /*#__PURE__*/function () {
4876
4889
  }();
4877
4890
  // eslint-disable-next-line
4878
4891
  var isObservableSet = /*#__PURE__*/createInstanceofPredicate("ObservableSet", ObservableSet);
4892
+ function makeIterableForSet(iterator) {
4893
+ iterator[Symbol.toStringTag] = "SetIterator";
4894
+ return makeIterable(iterator);
4895
+ }
4879
4896
 
4880
4897
  var descriptorCache = /*#__PURE__*/Object.create(null);
4881
4898
  var REMOVE = "remove";
@@ -5865,11 +5882,7 @@ function unwrap(a) {
5865
5882
  }
5866
5883
 
5867
5884
  function makeIterable(iterator) {
5868
- iterator[Symbol.iterator] = getSelf;
5869
- return iterator;
5870
- }
5871
- function getSelf() {
5872
- return this;
5885
+ return Object.assign(Object.create(Iterator.prototype), iterator);
5873
5886
  }
5874
5887
 
5875
5888
  function isAnnotation(thing) {