From ddf73df07c70f8db9713d4fd899ccd7545446713 Mon Sep 17 00:00:00 2001 From: Yangshun Date: Tue, 28 Sep 2021 19:07:50 +0800 Subject: [PATCH] v4.0.2 --- CHANGELOG.md | 4 ++++ dist/FluxUtils.js | 54 ++++++++++++++++++++++++++++++++----------- dist/FluxUtils.min.js | 6 ++--- package.json | 2 +- 4 files changed, 49 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6872236e..e4a71a98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +### 4.0.2 + +- Added support for `UNSAFE_componentWillReceiveProps` lifecycle method + ### 4.0.1 - Upgrade `fbemitter` dependency to 3.x diff --git a/dist/FluxUtils.js b/dist/FluxUtils.js index 077bd24a..af3a43af 100644 --- a/dist/FluxUtils.js +++ b/dist/FluxUtils.js @@ -98,7 +98,17 @@ return /******/ (function(modules) { // webpackBootstrap function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; + + _setPrototypeOf(subClass, superClass); + } + + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); } function ownKeys(object, enumerableOnly) { @@ -106,9 +116,13 @@ return /******/ (function(modules) { // webpackBootstrap if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); + + if (enumerableOnly) { + symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + } + keys.push.apply(keys, symbols); } @@ -277,6 +291,10 @@ return /******/ (function(modules) { // webpackBootstrap var _proto = ContainerClass.prototype; _proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps, nextContext) { + if (_Base.prototype.UNSAFE_componentWillReceiveProps) { + _Base.prototype.UNSAFE_componentWillReceiveProps.call(this, nextProps, nextContext); + } + if (_Base.prototype.componentWillReceiveProps) { _Base.prototype.componentWillReceiveProps.call(this, nextProps, nextContext); } @@ -598,9 +616,9 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; function _createForOfIteratorHelper(o, allowArrayLike) { - var it; + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { + if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; @@ -633,7 +651,7 @@ return /******/ (function(modules) { // webpackBootstrap err; return { s: function s() { - it = o[Symbol.iterator](); + it = it.call(o); }, n: function n() { var step = it.next(); @@ -823,7 +841,7 @@ return /******/ (function(modules) { // webpackBootstrap /* 6 */ /***/ (function(module, exports, __webpack_require__) { - /** @license React v17.0.1 + /** @license React v17.0.2 * react.development.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -840,7 +858,7 @@ return /******/ (function(modules) { // webpackBootstrap var _assign = __webpack_require__(7); // TODO: this is special because it gets imported during build. - var ReactVersion = '17.0.1'; // ATTENTION + var ReactVersion = '17.0.2'; // ATTENTION // When adding new symbols to this file, // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' // The Symbol used to tag the ReactElement-like types. If there is no native Symbol @@ -3294,9 +3312,9 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; function _createForOfIteratorHelper(o, allowArrayLike) { - var it; + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { + if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; @@ -3329,7 +3347,7 @@ return /******/ (function(modules) { // webpackBootstrap err; return { s: function s() { - it = o[Symbol.iterator](); + it = it.call(o); }, n: function n() { var step = it.next(); @@ -3506,7 +3524,17 @@ return /******/ (function(modules) { // webpackBootstrap function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; + + _setPrototypeOf(subClass, superClass); + } + + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); } function _defineProperty(obj, key, value) { diff --git a/dist/FluxUtils.min.js b/dist/FluxUtils.min.js index 83cc1ff4..c9c5d73a 100644 --- a/dist/FluxUtils.min.js +++ b/dist/FluxUtils.min.js @@ -7,7 +7,7 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FluxUtils=e():t.FluxUtils=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){t.exports.Container=r(1),t.exports.Mixin=r(9),t.exports.ReduceStore=r(10),t.exports.Store=r(11)},function(t,e,r){"use strict";function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function u(t){var e,r;for(e=1;e2?r-2:0),i=2;i2?r-2:0),i=2;i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return u=!0,s=!1,{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return u=t.done,t},e:function(t){s=!0,c=t},f:function(){try{u||null==r.return||r.return()}finally{if(s)throw c}}}}function o(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{withProps:!1};return t=t.filter(function(t){return!!t}),{getInitialState:function(){return s(this),e.withProps?this.constructor.calculateState(null,this.props):this.constructor.calculateState(null,void 0)},componentWillMount:function(){var r,n=this,o=!1,i=function(){o=!0};this._fluxMixinSubscriptions=t.map(function(t){return t.addListener(i)}),r=function(){o&&n.setState(function(t){return e.withProps?n.constructor.calculateState(t,n.props):n.constructor.calculateState(t,void 0)}),o=!1},this._fluxMixinStoreGroup=new c(t,r)},componentWillUnmount:function(){var t,e,r;this._fluxMixinStoreGroup.release(),t=n(this._fluxMixinSubscriptions);try{for(t.s();!(e=t.n()).done;)r=e.value,r.remove()}catch(e){t.e(e)}finally{t.f()}this._fluxMixinSubscriptions=[]}}}function s(t){t.constructor.calculateState?void 0:a(!1)}var c=r(3),a=r(4);t.exports=u},function(t,e,r){"use strict";function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var u=r(11),s=r(18),c=r(4),a=function(t){function e(e){var r;return r=t.call(this,e)||this,i(n(r),"_state",void 0),r._state=r.getInitialState(),r}o(e,t);var r=e.prototype;return r.getState=function(){return this._state},r.getInitialState=function(){return s("FluxReduceStore","getInitialState")},r.reduce=function(t,e){return s("FluxReduceStore","reduce")},r.areEqual=function(t,e){return t===e},r.__invokeOnDispatch=function(t){var e,r;this.__changed=!1,e=this._state,r=this.reduce(e,t),void 0===r?c(!1):void 0,this.areEqual(e,r)||(this._state=r,this.__emitChange()),this.__changed&&this.__emitter.emit(this.__changeEvent)},e}(u);t.exports=a},function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(12),i=o.EventEmitter,u=r(4),s=function(){function t(t){var e=this;n(this,"_dispatchToken",void 0),n(this,"__changed",void 0),n(this,"__changeEvent",void 0),n(this,"__className",void 0),n(this,"__dispatcher",void 0),n(this,"__emitter",void 0),this.__className=this.constructor.name,this.__changed=!1,this.__changeEvent="change",this.__dispatcher=t,this.__emitter=new i,this._dispatchToken=t.register(function(t){e.__invokeOnDispatch(t)})}var e=t.prototype;return e.addListener=function(t){return this.__emitter.addListener(this.__changeEvent,t)},e.getDispatcher=function(){return this.__dispatcher},e.getDispatchToken=function(){return this._dispatchToken},e.hasChanged=function(){return this.__dispatcher.isDispatching()?void 0:u(!1),this.__changed},e.__emitChange=function(){this.__dispatcher.isDispatching()?void 0:u(!1),this.__changed=!0},e.__invokeOnDispatch=function(t){this.__changed=!1,this.__onDispatch(t),this.__changed&&this.__emitter.emit(this.__changeEvent)},e.__onDispatch=function(t){u(!1)},t}();t.exports=s},function(t,e,r){var n={EventEmitter:r(13),EmitterSubscription:r(14)};t.exports=n},function(t,e,r){"use strict";var n=r(14),o=r(16),i=r(4),u=r(17),s=function(){function t(){this._subscriber=new o,this._currentSubscription=null}var e=t.prototype;return e.addListener=function(t,e,r){return this._subscriber.addSubscription(t,new n(this._subscriber,e,r))},e.once=function(t,e,r){var n=this;return this.addListener(t,function(){n.removeCurrentListener(),e.apply(r,arguments)})},e.removeAllListeners=function(t){this._subscriber.removeAllSubscriptions(t)},e.removeCurrentListener=function(){this._currentSubscription?void 0:i(!1),this._subscriber.removeSubscription(this._currentSubscription)},e.listeners=function(t){var e=this._subscriber.getSubscriptionsForType(t);return e?e.filter(u.thatReturnsTrue).map(function(t){return t.listener}):[]},e.emit=function(t){var e,r,n,o,i=this._subscriber.getSubscriptionsForType(t);if(i){for(e=Object.keys(i),r=0;r=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return i=!0,u=!1,{s:function(){c=c.call(t)},n:function(){var t=c.next();return i=t.done,t},e:function(t){u=!0,s=t},f:function(){try{i||null==c.return||c.return()}finally{if(u)throw s}}}}function o(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{withProps:!1};return t=t.filter(function(t){return!!t}),{getInitialState:function(){return s(this),e.withProps?this.constructor.calculateState(null,this.props):this.constructor.calculateState(null,void 0)},componentWillMount:function(){var r,n=this,o=!1,i=function(){o=!0};this._fluxMixinSubscriptions=t.map(function(t){return t.addListener(i)}),r=function(){o&&n.setState(function(t){return e.withProps?n.constructor.calculateState(t,n.props):n.constructor.calculateState(t,void 0)}),o=!1},this._fluxMixinStoreGroup=new c(t,r)},componentWillUnmount:function(){var t,e,r;this._fluxMixinStoreGroup.release(),t=n(this._fluxMixinSubscriptions);try{for(t.s();!(e=t.n()).done;)r=e.value,r.remove()}catch(e){t.e(e)}finally{t.f()}this._fluxMixinSubscriptions=[]}}}function s(t){t.constructor.calculateState?void 0:a(!1)}var c=r(3),a=r(4);t.exports=u},function(t,e,r){"use strict";function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function u(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(11),c=r(18),a=r(4),f=function(t){function e(e){var r;return r=t.call(this,e)||this,u(n(r),"_state",void 0),r._state=r.getInitialState(),r}o(e,t);var r=e.prototype;return r.getState=function(){return this._state},r.getInitialState=function(){return c("FluxReduceStore","getInitialState")},r.reduce=function(t,e){return c("FluxReduceStore","reduce")},r.areEqual=function(t,e){return t===e},r.__invokeOnDispatch=function(t){var e,r;this.__changed=!1,e=this._state,r=this.reduce(e,t),void 0===r?a(!1):void 0,this.areEqual(e,r)||(this._state=r,this.__emitChange()),this.__changed&&this.__emitter.emit(this.__changeEvent)},e}(s);t.exports=f},function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(12),i=o.EventEmitter,u=r(4),s=function(){function t(t){var e=this;n(this,"_dispatchToken",void 0),n(this,"__changed",void 0),n(this,"__changeEvent",void 0),n(this,"__className",void 0),n(this,"__dispatcher",void 0),n(this,"__emitter",void 0),this.__className=this.constructor.name,this.__changed=!1,this.__changeEvent="change",this.__dispatcher=t,this.__emitter=new i,this._dispatchToken=t.register(function(t){e.__invokeOnDispatch(t)})}var e=t.prototype;return e.addListener=function(t){return this.__emitter.addListener(this.__changeEvent,t)},e.getDispatcher=function(){return this.__dispatcher},e.getDispatchToken=function(){return this._dispatchToken},e.hasChanged=function(){return this.__dispatcher.isDispatching()?void 0:u(!1),this.__changed},e.__emitChange=function(){this.__dispatcher.isDispatching()?void 0:u(!1),this.__changed=!0},e.__invokeOnDispatch=function(t){this.__changed=!1,this.__onDispatch(t),this.__changed&&this.__emitter.emit(this.__changeEvent)},e.__onDispatch=function(t){u(!1)},t}();t.exports=s},function(t,e,r){var n={EventEmitter:r(13),EmitterSubscription:r(14)};t.exports=n},function(t,e,r){"use strict";var n=r(14),o=r(16),i=r(4),u=r(17),s=function(){function t(){this._subscriber=new o,this._currentSubscription=null}var e=t.prototype;return e.addListener=function(t,e,r){return this._subscriber.addSubscription(t,new n(this._subscriber,e,r))},e.once=function(t,e,r){var n=this;return this.addListener(t,function(){n.removeCurrentListener(),e.apply(r,arguments)})},e.removeAllListeners=function(t){this._subscriber.removeAllSubscriptions(t)},e.removeCurrentListener=function(){this._currentSubscription?void 0:i(!1),this._subscriber.removeSubscription(this._currentSubscription)},e.listeners=function(t){var e=this._subscriber.getSubscriptionsForType(t);return e?e.filter(u.thatReturnsTrue).map(function(t){return t.listener}):[]},e.emit=function(t){var e,r,n,o,i=this._subscriber.getSubscriptionsForType(t);if(i){for(e=Object.keys(i),r=0;r