mobx-react 5.4.2 → 5.4.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/native.js CHANGED
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
6
 
7
+ var mobx = require('mobx');
7
8
  var React = require('react');
8
9
  var React__default = _interopDefault(React);
9
- var mobx = require('mobx');
10
10
  var reactNative = require('react-native');
11
11
 
12
12
  function _typeof(obj) {
@@ -60,25 +60,6 @@ function _defineProperty(obj, key, value) {
60
60
  return obj;
61
61
  }
62
62
 
63
- function _objectSpread(target) {
64
- for (var i = 1; i < arguments.length; i++) {
65
- var source = arguments[i] != null ? arguments[i] : {};
66
- var ownKeys = Object.keys(source);
67
-
68
- if (typeof Object.getOwnPropertySymbols === 'function') {
69
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
70
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
71
- }));
72
- }
73
-
74
- ownKeys.forEach(function (key) {
75
- _defineProperty(target, key, source[key]);
76
- });
77
- }
78
-
79
- return target;
80
- }
81
-
82
63
  function _inherits(subClass, superClass) {
83
64
  if (typeof superClass !== "function" && superClass !== null) {
84
65
  throw new TypeError("Super expression must either be null or a function");
@@ -138,33 +119,35 @@ function createCommonjsModule(fn, module) {
138
119
 
139
120
  var reactIs_production_min = createCommonjsModule(function (module, exports) {
140
121
  Object.defineProperty(exports,"__esModule",{value:!0});
141
- var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.forward_ref"):60112,n=b?Symbol.for("react.placeholder"):60113;
142
- function q(a){if("object"===typeof a&&null!==a){var p=a.$$typeof;switch(p){case c:switch(a=a.type,a){case l:case e:case g:case f:return a;default:switch(a=a&&a.$$typeof,a){case k:case m:case h:return a;default:return p}}case d:return p}}}exports.typeOf=q;exports.AsyncMode=l;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=m;exports.Fragment=e;exports.Profiler=g;exports.Portal=d;exports.StrictMode=f;
143
- exports.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===l||a===g||a===f||a===n||"object"===typeof a&&null!==a&&("function"===typeof a.then||a.$$typeof===h||a.$$typeof===k||a.$$typeof===m)};exports.isAsyncMode=function(a){return q(a)===l};exports.isContextConsumer=function(a){return q(a)===k};exports.isContextProvider=function(a){return q(a)===h};exports.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};
144
- exports.isForwardRef=function(a){return q(a)===m};exports.isFragment=function(a){return q(a)===e};exports.isProfiler=function(a){return q(a)===g};exports.isPortal=function(a){return q(a)===d};exports.isStrictMode=function(a){return q(a)===f};
122
+ var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,r=b?Symbol.for("react.memo"):
123
+ 60115,t=b?Symbol.for("react.lazy"):60116;function u(a){if("object"===typeof a&&null!==a){var q=a.$$typeof;switch(q){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return q}}case d:return q}}}function v(a){return u(a)===m}exports.typeOf=u;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;
124
+ exports.Profiler=g;exports.Portal=d;exports.StrictMode=f;exports.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||u(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return u(a)===k};exports.isContextProvider=function(a){return u(a)===h};
125
+ exports.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return u(a)===n};exports.isFragment=function(a){return u(a)===e};exports.isProfiler=function(a){return u(a)===g};exports.isPortal=function(a){return u(a)===d};exports.isStrictMode=function(a){return u(a)===f};
145
126
  });
146
127
 
147
128
  unwrapExports(reactIs_production_min);
148
129
  var reactIs_production_min_1 = reactIs_production_min.typeOf;
149
130
  var reactIs_production_min_2 = reactIs_production_min.AsyncMode;
150
- var reactIs_production_min_3 = reactIs_production_min.ContextConsumer;
151
- var reactIs_production_min_4 = reactIs_production_min.ContextProvider;
152
- var reactIs_production_min_5 = reactIs_production_min.Element;
153
- var reactIs_production_min_6 = reactIs_production_min.ForwardRef;
154
- var reactIs_production_min_7 = reactIs_production_min.Fragment;
155
- var reactIs_production_min_8 = reactIs_production_min.Profiler;
156
- var reactIs_production_min_9 = reactIs_production_min.Portal;
157
- var reactIs_production_min_10 = reactIs_production_min.StrictMode;
158
- var reactIs_production_min_11 = reactIs_production_min.isValidElementType;
159
- var reactIs_production_min_12 = reactIs_production_min.isAsyncMode;
160
- var reactIs_production_min_13 = reactIs_production_min.isContextConsumer;
161
- var reactIs_production_min_14 = reactIs_production_min.isContextProvider;
162
- var reactIs_production_min_15 = reactIs_production_min.isElement;
163
- var reactIs_production_min_16 = reactIs_production_min.isForwardRef;
164
- var reactIs_production_min_17 = reactIs_production_min.isFragment;
165
- var reactIs_production_min_18 = reactIs_production_min.isProfiler;
166
- var reactIs_production_min_19 = reactIs_production_min.isPortal;
167
- var reactIs_production_min_20 = reactIs_production_min.isStrictMode;
131
+ var reactIs_production_min_3 = reactIs_production_min.ConcurrentMode;
132
+ var reactIs_production_min_4 = reactIs_production_min.ContextConsumer;
133
+ var reactIs_production_min_5 = reactIs_production_min.ContextProvider;
134
+ var reactIs_production_min_6 = reactIs_production_min.Element;
135
+ var reactIs_production_min_7 = reactIs_production_min.ForwardRef;
136
+ var reactIs_production_min_8 = reactIs_production_min.Fragment;
137
+ var reactIs_production_min_9 = reactIs_production_min.Profiler;
138
+ var reactIs_production_min_10 = reactIs_production_min.Portal;
139
+ var reactIs_production_min_11 = reactIs_production_min.StrictMode;
140
+ var reactIs_production_min_12 = reactIs_production_min.isValidElementType;
141
+ var reactIs_production_min_13 = reactIs_production_min.isAsyncMode;
142
+ var reactIs_production_min_14 = reactIs_production_min.isConcurrentMode;
143
+ var reactIs_production_min_15 = reactIs_production_min.isContextConsumer;
144
+ var reactIs_production_min_16 = reactIs_production_min.isContextProvider;
145
+ var reactIs_production_min_17 = reactIs_production_min.isElement;
146
+ var reactIs_production_min_18 = reactIs_production_min.isForwardRef;
147
+ var reactIs_production_min_19 = reactIs_production_min.isFragment;
148
+ var reactIs_production_min_20 = reactIs_production_min.isProfiler;
149
+ var reactIs_production_min_21 = reactIs_production_min.isPortal;
150
+ var reactIs_production_min_22 = reactIs_production_min.isStrictMode;
168
151
 
169
152
  var reactIs = createCommonjsModule(function (module) {
170
153
 
@@ -173,22 +156,19 @@ var reactIs = createCommonjsModule(function (module) {
173
156
  }
174
157
  });
175
158
 
176
- var _ReactIs$ForwardRef;
177
-
178
- function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
179
-
180
159
  /**
181
160
  * Copyright 2015, Yahoo! Inc.
182
161
  * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
183
162
  */
184
163
 
185
-
186
164
  var REACT_STATICS = {
187
165
  childContextTypes: true,
166
+ contextType: true,
188
167
  contextTypes: true,
189
168
  defaultProps: true,
190
169
  displayName: true,
191
170
  getDefaultProps: true,
171
+ getDerivedStateFromError: true,
192
172
  getDerivedStateFromProps: true,
193
173
  mixins: true,
194
174
  propTypes: true,
@@ -205,7 +185,16 @@ var KNOWN_STATICS = {
205
185
  arity: true
206
186
  };
207
187
 
208
- var TYPE_STATICS = _defineProperty$1({}, reactIs.ForwardRef, (_ReactIs$ForwardRef = {}, _defineProperty$1(_ReactIs$ForwardRef, '$$typeof', true), _defineProperty$1(_ReactIs$ForwardRef, 'render', true), _ReactIs$ForwardRef));
188
+ var FORWARD_REF_STATICS = {
189
+ '$$typeof': true,
190
+ render: true,
191
+ defaultProps: true,
192
+ displayName: true,
193
+ propTypes: true
194
+ };
195
+
196
+ var TYPE_STATICS = {};
197
+ TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
209
198
 
210
199
  var defineProperty = Object.defineProperty;
211
200
  var getOwnPropertyNames = Object.getOwnPropertyNames;
@@ -589,8 +578,8 @@ var proxiedInjectorProps = {
589
578
  configurable: true,
590
579
  enumerable: true
591
580
  }
592
- /**
593
- * Store Injection
581
+ /**
582
+ * Store Injection
594
583
  */
595
584
 
596
585
  };
@@ -674,11 +663,11 @@ function grabStoresByName(storeNames) {
674
663
  return nextProps;
675
664
  };
676
665
  }
677
- /**
678
- * higher order component that injects stores to a child.
679
- * takes either a varargs list of strings, which are stores read from the context,
680
- * or a function that manually maps the available stores from the context to props:
681
- * storesToProps(mobxStores, props, context) => newProps
666
+ /**
667
+ * higher order component that injects stores to a child.
668
+ * takes either a varargs list of strings, which are stores read from the context,
669
+ * or a function that manually maps the available stores from the context to props:
670
+ * storesToProps(mobxStores, props, context) => newProps
682
671
  */
683
672
 
684
673
 
@@ -716,8 +705,8 @@ function inject()
716
705
 
717
706
  var mobxAdminProperty = mobx.$mobx || "$mobx";
718
707
  var mobxIsUnmounted = newSymbol("isUnmounted");
719
- /**
720
- * dev tool support
708
+ /**
709
+ * dev tool support
721
710
  */
722
711
 
723
712
  var isDevtoolsEnabled = false;
@@ -730,11 +719,11 @@ var skipRenderKey = newSymbol("skipRender");
730
719
  var isForcingUpdateKey = newSymbol("isForcingUpdate"); // Using react-is had some issues (and operates on elements, not on types), see #608 / #609
731
720
 
732
721
  var ReactForwardRefSymbol = typeof React.forwardRef === "function" && React.forwardRef(function (_props, _ref) {})["$$typeof"];
733
- /**
734
- * Helper to set `prop` to `this` as non-enumerable (hidden prop)
735
- * @param target
736
- * @param prop
737
- * @param value
722
+ /**
723
+ * Helper to set `prop` to `this` as non-enumerable (hidden prop)
724
+ * @param target
725
+ * @param prop
726
+ * @param value
738
727
  */
739
728
 
740
729
  function setHiddenProp(target, prop, value) {
@@ -774,13 +763,13 @@ function trackComponents() {
774
763
  function useStaticRendering(useStaticRendering) {
775
764
  isUsingStaticRendering = useStaticRendering;
776
765
  }
777
- /**
778
- * Errors reporter
766
+ /**
767
+ * Errors reporter
779
768
  */
780
769
 
781
770
  var errorsReporter = new EventEmitter();
782
- /**
783
- * Utilities
771
+ /**
772
+ * Utilities
784
773
  */
785
774
 
786
775
  function patch$1(target, funcName) {
@@ -855,15 +844,15 @@ function makeComponentReactive(render) {
855
844
 
856
845
  var initialName = this.displayName || this.name || this.constructor && (this.constructor.displayName || this.constructor.name) || "<component>";
857
846
  var rootNodeID = this._reactInternalInstance && this._reactInternalInstance._rootNodeID || this._reactInternalInstance && this._reactInternalInstance._debugID || this._reactInternalFiber && this._reactInternalFiber._debugID;
858
- /**
859
- * If props are shallowly modified, react will render anyway,
860
- * so atom.reportChanged() should not result in yet another re-render
847
+ /**
848
+ * If props are shallowly modified, react will render anyway,
849
+ * so atom.reportChanged() should not result in yet another re-render
861
850
  */
862
851
 
863
852
  setHiddenProp(this, skipRenderKey, false);
864
- /**
865
- * forceUpdate will re-assign this.props. We don't want that to cause a loop,
866
- * so detect these changes
853
+ /**
854
+ * forceUpdate will re-assign this.props. We don't want that to cause a loop,
855
+ * so detect these changes
867
856
  */
868
857
 
869
858
  setHiddenProp(this, isForcingUpdateKey, false); // wire up reactive render
@@ -900,8 +889,8 @@ function makeComponentReactive(render) {
900
889
  this.render = reactiveRender;
901
890
  return reactiveRender.call(this);
902
891
  }
903
- /**
904
- * ReactiveMixin
892
+ /**
893
+ * ReactiveMixin
905
894
  */
906
895
 
907
896
 
@@ -984,8 +973,8 @@ function makeObservableProp(target, propName) {
984
973
  }
985
974
  });
986
975
  }
987
- /**
988
- * Observer function / decorator
976
+ /**
977
+ * Observer function / decorator
989
978
  */
990
979
 
991
980
 
@@ -1027,14 +1016,13 @@ function observer(arg1, arg2) {
1027
1016
 
1028
1017
  if (ReactForwardRefSymbol && componentClass["$$typeof"] === ReactForwardRefSymbol) {
1029
1018
  var _baseRender = componentClass.render;
1030
- if (typeof _baseRender !== "function") throw new Error("render property of ForwardRef was not a function");
1031
- return _objectSpread({}, componentClass, {
1032
- render: function render() {
1033
- var _arguments = arguments;
1034
- return React__default.createElement(Observer, null, function () {
1035
- return _baseRender.apply(undefined, _arguments);
1036
- });
1037
- }
1019
+ if (typeof _baseRender !== "function") throw new Error("render property of ForwardRef was not a function"); // TODO: do we need to hoist statics from baseRender to the forward ref?
1020
+
1021
+ return React.forwardRef(function ObserverForwardRef() {
1022
+ var _arguments = arguments;
1023
+ return React__default.createElement(Observer, null, function () {
1024
+ return _baseRender.apply(undefined, _arguments);
1025
+ });
1038
1026
  });
1039
1027
  } // Stateless function component:
1040
1028
  // If it is function but doesn't seem to be a react class constructor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobx-react",
3
- "version": "5.4.2",
3
+ "version": "5.4.3",
4
4
  "description": "React bindings for MobX. Create fully reactive components.",
5
5
  "main": "index.js",
6
6
  "jsnext:main": "index.module.js",
@@ -54,9 +54,9 @@
54
54
  "opn-cli": "^3.1.0",
55
55
  "prettier": "^1.7.2",
56
56
  "prop-types": "^15.6.0",
57
- "react": "^16.0.0",
58
- "react-dom": "^16.0.0",
59
- "react-test-renderer": "^16.0.0",
57
+ "react": "^16.6.3",
58
+ "react-dom": "^16.6.3",
59
+ "react-test-renderer": "^16.6.3",
60
60
  "regenerator-runtime": "^0.12.1",
61
61
  "request": "^2.83.0",
62
62
  "rollup": "^0.66.2",