From aa596da50694f7cbc44a2eea990aa20a2dacb927 Mon Sep 17 00:00:00 2001 From: nobody Date: Sun, 20 Sep 2020 08:33:44 +0200 Subject: [PATCH] Added: react-lifecycles-compat v3.0.4 (#114) --- core/mappings.js | 1 + core/resources.js | 5 +++++ modules/internal/helpers.js | 3 +++ pages/updates/updates.html | 1 + .../3.0.4/react-lifecycles-compat.min.jsm | 1 + 5 files changed, 11 insertions(+) create mode 100644 resources/react-lifecycles-compat/3.0.4/react-lifecycles-compat.min.jsm diff --git a/core/mappings.js b/core/mappings.js index cf06d797..2b0a0021 100644 --- a/core/mappings.js +++ b/core/mappings.js @@ -408,6 +408,7 @@ var mappings = { 'moment@{version}/moment.min.': resources.moment, 'mootools@{version}/lib/mootools-core-{version}-server.': resources.mootools, 'mootools@{version}/lib/mootools-core-{version}-server.min.': resources.mootools, + 'react-lifecycles-compat@{version}/react-lifecycles-compat.': resources.reactLifecyclesCompat, 'p2p-media-loader-core@latest/build/p2p-media-loader-core.min.js': resources.p2pMediaLoaderCore, 'p2p-media-loader-hlsjs@latest/build/p2p-media-loader-hlsjs.min.js': resources.p2pMediaLoaderHlsJS, 'popper.js@{version}/dist/umd/popper.': resources.popperJS, diff --git a/core/resources.js b/core/resources.js index 694d809f..69ca8995 100644 --- a/core/resources.js +++ b/core/resources.js @@ -615,6 +615,11 @@ var resources = { 'path': 'resources/react-dom/{version}/umd/react-dom.production.min.jsm', 'type': 'application/javascript' }, + // react-lifecycles-compat + 'reactLifecyclesCompat': { + 'path': 'resources/react-lifecycles-compat/{version}/react-lifecycles-compat.min.jsm', + 'type': 'application/javascript' + }, // rickshaw 'rickshawJS': { 'path': 'resources/rickshaw/{version}/rickshaw.min.jsm', diff --git a/modules/internal/helpers.js b/modules/internal/helpers.js index 5e32b102..0b2d78f5 100644 --- a/modules/internal/helpers.js +++ b/modules/internal/helpers.js @@ -511,6 +511,8 @@ helpers.setLastVersion = function (type, version) { return '16.13.1'; } else if (type.includes('/react-dom/16.')) { return '16.13.1'; + } else if (type.includes('/react-lifecycles-compat/')) { + return '3.0.4'; } else if (type.includes('/rickshaw/1.')) { return '1.6.6'; } else if (type.includes('/scriptaculous/1.')) { @@ -601,6 +603,7 @@ helpers.compareVersion = function (v1, v2) { }; const ListOfFiles = { + 'react-lifecycles-compat.min.jsm': 'react lifecycles compat', 'prop-types.min.jsm': 'prop-types', 'history.min.jsm': 'history', 'axios.min.jsm': 'Axios', diff --git a/pages/updates/updates.html b/pages/updates/updates.html index 64b5d507..cdc8ad01 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -29,6 +29,7 @@
  • Added: Axios v0.20.0 (#114)
  • Added: history v4.10.1 (#114)
  • Added: prop-types v15.7.2 (#114)
  • +
  • Added: react-lifecycles-compat v3.0.4 (#114)
  • diff --git a/resources/react-lifecycles-compat/3.0.4/react-lifecycles-compat.min.jsm b/resources/react-lifecycles-compat/3.0.4/react-lifecycles-compat.min.jsm new file mode 100644 index 00000000..68b22352 --- /dev/null +++ b/resources/react-lifecycles-compat/3.0.4/react-lifecycles-compat.min.jsm @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.reactLifecyclesCompat={})}(this,function(e){"use strict";function t(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==e&&void 0!==e&&this.setState(e)}function n(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!==n&&void 0!==n?n:null}.bind(this))}function o(e,t){try{var n=this.props,o=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,o)}finally{this.props=n,this.state=o}}t.__suppressDeprecationWarning=!0,n.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,e.polyfill=function(e){var i=e.prototype;if(!i||!i.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof i.getSnapshotBeforeUpdate)return e;var p=null,l=null,r=null;if("function"==typeof i.componentWillMount?p="componentWillMount":"function"==typeof i.UNSAFE_componentWillMount&&(p="UNSAFE_componentWillMount"),"function"==typeof i.componentWillReceiveProps?l="componentWillReceiveProps":"function"==typeof i.UNSAFE_componentWillReceiveProps&&(l="UNSAFE_componentWillReceiveProps"),"function"==typeof i.componentWillUpdate?r="componentWillUpdate":"function"==typeof i.UNSAFE_componentWillUpdate&&(r="UNSAFE_componentWillUpdate"),null!==p||null!==l||null!==r){var s=e.displayName||e.name,a="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+s+" uses "+a+" but also contains the following legacy lifecycles:"+(null!==p?"\n "+p:"")+(null!==l?"\n "+l:"")+(null!==r?"\n "+r:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(i.componentWillMount=t,i.componentWillReceiveProps=n),"function"==typeof i.getSnapshotBeforeUpdate){if("function"!=typeof i.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");i.componentWillUpdate=o;var c=i.componentDidUpdate;i.componentDidUpdate=function(e,t,n){var o=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;c.call(this,e,t,o)}}return e},Object.defineProperty(e,"__esModule",{value:!0})});