Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@loadable/component

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loadable/component - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [4.0.2](https://github.com/smooth-code/loadable-components/compare/v4.0.1...v4.0.2) (2018-10-31)
### Bug Fixes
* **component:** fix lazy usage ([d711ee0](https://github.com/smooth-code/loadable-components/commit/d711ee0))
## [4.0.1](https://github.com/smooth-code/loadable-components/compare/v4.0.0...v4.0.1) (2018-10-30)

@@ -8,0 +19,0 @@

30

dist/loadable.cjs.js

@@ -245,2 +245,3 @@ 'use strict';

});
return this.promise;
};

@@ -305,4 +306,6 @@

loadable.lazy = lazy;
return loadable;
return {
loadable: loadable,
lazy: lazy
};
}

@@ -321,3 +324,4 @@

/* eslint-disable no-use-before-define, react/no-multi-comp */
var loadable = createLoadable({
var _createLoadable = createLoadable({
resolve: resolveComponent,

@@ -329,6 +333,9 @@ render: function render(_ref) {

}
});
}),
loadable = _createLoadable.loadable,
lazy = _createLoadable.lazy;
/* eslint-disable no-use-before-define, react/no-multi-comp */
var library = createLoadable({
var _createLoadable$1 = createLoadable({
onLoad: function onLoad(result, props) {

@@ -354,3 +361,5 @@ if (result && props.ref) {

}
});
}),
loadable$1 = _createLoadable$1.loadable,
lazy$1 = _createLoadable$1.lazy;

@@ -398,8 +407,11 @@ /* eslint-disable no-underscore-dangle, camelcase */

/* eslint-disable no-underscore-dangle */
loadable.lib = library;
var loadable$2 = loadable;
loadable$2.lib = loadable$1;
var lazy$2 = lazy;
lazy$2.lib = lazy$1;
var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = sharedInternals;
exports.default = loadable;
exports.default = loadable$2;
exports.lazy = lazy$2;
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
exports.library = library;
exports.loadComponents = loadComponents;

@@ -239,2 +239,3 @@ import React from 'react';

});
return this.promise;
};

@@ -299,4 +300,6 @@

loadable.lazy = lazy;
return loadable;
return {
loadable: loadable,
lazy: lazy
};
}

@@ -315,3 +318,4 @@

/* eslint-disable no-use-before-define, react/no-multi-comp */
var loadable = createLoadable({
var _createLoadable = createLoadable({
resolve: resolveComponent,

@@ -323,6 +327,9 @@ render: function render(_ref) {

}
});
}),
loadable = _createLoadable.loadable,
lazy = _createLoadable.lazy;
/* eslint-disable no-use-before-define, react/no-multi-comp */
var library = createLoadable({
var _createLoadable$1 = createLoadable({
onLoad: function onLoad(result, props) {

@@ -348,3 +355,5 @@ if (result && props.ref) {

}
});
}),
loadable$1 = _createLoadable$1.loadable,
lazy$1 = _createLoadable$1.lazy;

@@ -392,6 +401,9 @@ /* eslint-disable no-underscore-dangle, camelcase */

/* eslint-disable no-underscore-dangle */
loadable.lib = library;
var loadable$2 = loadable;
loadable$2.lib = loadable$1;
var lazy$2 = lazy;
lazy$2.lib = lazy$1;
var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = sharedInternals;
export default loadable;
export { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, library, loadComponents };
export default loadable$2;
export { lazy$2 as lazy, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, loadComponents };

@@ -244,2 +244,3 @@ (function (global, factory) {

});
return this.promise;
};

@@ -304,4 +305,6 @@

loadable.lazy = lazy;
return loadable;
return {
loadable: loadable,
lazy: lazy
};
}

@@ -679,3 +682,4 @@

/* eslint-disable no-use-before-define, react/no-multi-comp */
var loadable = createLoadable({
var _createLoadable = createLoadable({
resolve: resolveComponent,

@@ -687,6 +691,9 @@ render: function render(_ref) {

}
});
}),
loadable = _createLoadable.loadable,
lazy = _createLoadable.lazy;
/* eslint-disable no-use-before-define, react/no-multi-comp */
var library = createLoadable({
var _createLoadable$1 = createLoadable({
onLoad: function onLoad(result, props) {

@@ -712,3 +719,5 @@ if (result && props.ref) {

}
});
}),
loadable$1 = _createLoadable$1.loadable,
lazy$1 = _createLoadable$1.lazy;

@@ -756,8 +765,11 @@ /* eslint-disable no-underscore-dangle, camelcase */

/* eslint-disable no-underscore-dangle */
loadable.lib = library;
var loadable$2 = loadable;
loadable$2.lib = loadable$1;
var lazy$2 = lazy;
lazy$2.lib = lazy$1;
var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = sharedInternals;
exports.default = loadable;
exports.default = loadable$2;
exports.lazy = lazy$2;
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
exports.library = library;
exports.loadComponents = loadComponents;

@@ -764,0 +776,0 @@

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t(e.loadable={},e.React)}(this,function(e,f){"use strict";function p(e,t){if(!e){var r=Error("loadable: "+t);throw r.framesToPop=1,r.name="Invariant Violation",r}}function t(e){console.warn("loadable: "+e)}var n=(f=f&&f.hasOwnProperty("default")?f.default:f).createContext(),r="__LOADABLE_STATE__",o="data-loadable-chunk",a=Object.freeze({DEFAULT_LOADABLE_STATE_KEY:r,DATA_LOADABLE_CHUNK:o,invariant:p,Context:n});function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function y(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}var h=function(r){return function(t){return f.createElement(n.Consumer,null,function(e){return f.createElement(r,d({loadableState:e},t))})}},i=function(e){return e};function c(e){var t=e.resolve,c=void 0===t?i:t,s=e.render,l=e.onLoad;function r(e,u){void 0===u&&(u={});var t,n="function"==typeof(t=e)?{requireAsync:t}:t;function o(e){n.requireAsync(e).catch(function(){})}var r=h(function(r){function e(e){var t;return t=r.call(this,e)||this,p(!e.loadableState||n.requireSync,"SSR requires `@loadable/babel`, please install it"),e.loadableState&&e.loadableState.addPrefetchedChunk(n.chunkName(e)),t}y(e,r);var t=e.prototype;return t.componentDidMount=function(){o(this.props)},t.render=function(){return null},e}(f.Component)),a=h(function(r){function e(e){var t;return(t=r.call(this,e)||this).state={result:null,error:null,loading:!0},p(!e.loadableState||n.requireSync,"SSR requires `@loadable/babel`, please install it"),e.loadableState?(n.requireAsync(e).catch(function(){}),t.loadSync(),e.loadableState.addChunk(n.chunkName(e)),function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t)):(n.isReady&&n.isReady(e)&&t.loadSync(),t)}y(e,r);var t=e.prototype;return t.componentDidMount=function(){this.state.loading?this.loadAsync():this.state.error||this.triggerOnLoad()},t.triggerOnLoad=function(){var e=this;l&&setTimeout(function(){l(e.state.result,e.props)})},t.loadSync=function(){if(this.state.loading)try{var e=n.requireSync(this.props),t=c(e,{Loadable:i});this.state.result=t,this.state.loading=!1}catch(e){this.state.error=e}},t.loadAsync=function(){var t=this;this.promise=this.promise||n.requireAsync(this.props).then(function(e){t.setState({result:c(e,{Loadable:i}),loading:!1},function(){return t.triggerOnLoad()})}).catch(function(e){t.setState({error:e,loading:!1})})},t.render=function(){var e=this.props,t=e.forwardedRef,r=e.fallback,n=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])<0&&(o[r]=e[r]);return o}(e,["forwardedRef","fallback","loadableState"]),o=this.state,a=o.error,i=o.loading,c=o.result;if(i&&u.suspense)throw this.loadAsync();if(a)throw a;var l=r||u.fallback||null;return i?l:s({loading:i,fallback:l,result:c,options:u,props:d({},n,{ref:t})})},e}(f.Component)),i=f.forwardRef(function(e,t){return f.createElement(a,d({forwardedRef:t},e))});return i.Prefetch=r,i.prefetch=o,i}return r.lazy=function(e,t){return r(e,d({},t,{suspense:!0}))},r}function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function u(e,t){return e(t={exports:{}},t.exports),t.exports}var s=u(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,i=r?Symbol.for("react.strict_mode"):60108,c=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,s=r?Symbol.for("react.forward_ref"):60112;function f(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case u:case a:case i:return e;default:switch(e=e&&e.$$typeof){case l:case s:case c:return e;default:return t}}case o:return t}}}t.typeOf=f,t.AsyncMode=u,t.ContextConsumer=l,t.ContextProvider=c,t.Element=n,t.ForwardRef=s,t.Fragment=a,t.Portal=o,t.StrictMode=i,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===u||e===i||"object"==typeof e&&null!==e&&(e.$$typeof===c||e.$$typeof===l||e.$$typeof===s)},t.isAsyncMode=function(e){return f(e)===u},t.isContextConsumer=function(e){return f(e)===l},t.isContextProvider=function(e){return f(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return f(e)===s},t.isFragment=function(e){return f(e)===a},t.isPortal=function(e){return f(e)===o},t.isStrictMode=function(e){return f(e)===i}});l(s);var b=u(function(e,t){});l(b);var m=u(function(e){e.exports=s}),v={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},_={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},S={};S[m.ForwardRef]={$$typeof:!0,render:!0};var g=Object.defineProperty,w=Object.getOwnPropertyNames,O=Object.getOwnPropertySymbols,P=Object.getOwnPropertyDescriptor,A=Object.getPrototypeOf,C=Object.prototype;var E=function e(t,r,n){if("string"==typeof r)return t;if(C){var o=A(r);o&&o!==C&&e(t,o,n)}var a=w(r);O&&(a=a.concat(O(r)));for(var i=S[t.$$typeof]||v,c=S[r.$$typeof]||v,l=0;l<a.length;++l){var u=a[l];if(!(_[u]||n&&n[u]||c&&c[u]||i&&i[u])){var s=P(r,u);try{g(t,u,s)}catch(e){}}}return t};var j=c({resolve:function(e,t){var r=e.default||e;return E(t.Loadable,r,{prefetch:!0,Prefetch:!0}),r},render:function(e){return f.createElement(e.result,e.props)}}),x=c({onLoad:function(e,t){e&&t.ref&&("function"==typeof t.ref?t.ref(e):t.ref.current=e)},render:function(e){var t=e.props;return!e.loading&&t.children?t.children(e.result):null}}),L="undefined"!=typeof window,$="undefined"!=typeof __webpack_require__;j.lib=x;var R=a;e.default=j,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R,e.library=x,e.loadComponents=function(e){return(e=L?window[r]:null)?(p($,"`loadComponents()` is only compatible with Webpack"),Promise.all(e.map(function(e){return __webpack_require__.e(e).catch(function(e){if(!e.message.match(/missing:/))throw e})})).catch(function(e){t("`loadComponents()` has failed"),t(e)})):(L||t("`loadComponents()` must be called in browser only"),0<document.querySelectorAll("script["+o+"]").length?t("`loadComponents()` is not required if you use `@loadable/webpack-plugin`"):t("`loadComponents()` requires a state in the page, please inject scripts server-side"),Promise.resolve())},Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t(e.loadable={},e.React)}(this,function(e,f){"use strict";function d(e,t){if(!e){var r=Error("loadable: "+t);throw r.framesToPop=1,r.name="Invariant Violation",r}}function t(e){console.warn("loadable: "+e)}var n=(f=f&&f.hasOwnProperty("default")?f.default:f).createContext(),r="__LOADABLE_STATE__",o="data-loadable-chunk",a=Object.freeze({DEFAULT_LOADABLE_STATE_KEY:r,DATA_LOADABLE_CHUNK:o,invariant:d,Context:n});function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function y(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}var b=function(r){return function(t){return f.createElement(n.Consumer,null,function(e){return f.createElement(r,p({loadableState:e},t))})}},i=function(e){return e};function l(e){var t=e.resolve,l=void 0===t?i:t,s=e.render,c=e.onLoad;function r(e,u){void 0===u&&(u={});var t,n="function"==typeof(t=e)?{requireAsync:t}:t;function o(e){n.requireAsync(e).catch(function(){})}var r=b(function(r){function e(e){var t;return t=r.call(this,e)||this,d(!e.loadableState||n.requireSync,"SSR requires `@loadable/babel`, please install it"),e.loadableState&&e.loadableState.addPrefetchedChunk(n.chunkName(e)),t}y(e,r);var t=e.prototype;return t.componentDidMount=function(){o(this.props)},t.render=function(){return null},e}(f.Component)),a=b(function(r){function e(e){var t;return(t=r.call(this,e)||this).state={result:null,error:null,loading:!0},d(!e.loadableState||n.requireSync,"SSR requires `@loadable/babel`, please install it"),e.loadableState?(n.requireAsync(e).catch(function(){}),t.loadSync(),e.loadableState.addChunk(n.chunkName(e)),function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t)):(n.isReady&&n.isReady(e)&&t.loadSync(),t)}y(e,r);var t=e.prototype;return t.componentDidMount=function(){this.state.loading?this.loadAsync():this.state.error||this.triggerOnLoad()},t.triggerOnLoad=function(){var e=this;c&&setTimeout(function(){c(e.state.result,e.props)})},t.loadSync=function(){if(this.state.loading)try{var e=n.requireSync(this.props),t=l(e,{Loadable:i});this.state.result=t,this.state.loading=!1}catch(e){this.state.error=e}},t.loadAsync=function(){var t=this;return this.promise=this.promise||n.requireAsync(this.props).then(function(e){t.setState({result:l(e,{Loadable:i}),loading:!1},function(){return t.triggerOnLoad()})}).catch(function(e){t.setState({error:e,loading:!1})}),this.promise},t.render=function(){var e=this.props,t=e.forwardedRef,r=e.fallback,n=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])<0&&(o[r]=e[r]);return o}(e,["forwardedRef","fallback","loadableState"]),o=this.state,a=o.error,i=o.loading,l=o.result;if(i&&u.suspense)throw this.loadAsync();if(a)throw a;var c=r||u.fallback||null;return i?c:s({loading:i,fallback:c,result:l,options:u,props:p({},n,{ref:t})})},e}(f.Component)),i=f.forwardRef(function(e,t){return f.createElement(a,p({forwardedRef:t},e))});return i.Prefetch=r,i.prefetch=o,i}return{loadable:r,lazy:function(e,t){return r(e,p({},t,{suspense:!0}))}}}function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function u(e,t){return e(t={exports:{}},t.exports),t.exports}var s=u(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,i=r?Symbol.for("react.strict_mode"):60108,l=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,s=r?Symbol.for("react.forward_ref"):60112;function f(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case u:case a:case i:return e;default:switch(e=e&&e.$$typeof){case c:case s:case l:return e;default:return t}}case o:return t}}}t.typeOf=f,t.AsyncMode=u,t.ContextConsumer=c,t.ContextProvider=l,t.Element=n,t.ForwardRef=s,t.Fragment=a,t.Portal=o,t.StrictMode=i,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===u||e===i||"object"==typeof e&&null!==e&&(e.$$typeof===l||e.$$typeof===c||e.$$typeof===s)},t.isAsyncMode=function(e){return f(e)===u},t.isContextConsumer=function(e){return f(e)===c},t.isContextProvider=function(e){return f(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return f(e)===s},t.isFragment=function(e){return f(e)===a},t.isPortal=function(e){return f(e)===o},t.isStrictMode=function(e){return f(e)===i}});c(s);var h=u(function(e,t){});c(h);var m=u(function(e){e.exports=s}),v={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},_={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},S={};S[m.ForwardRef]={$$typeof:!0,render:!0};var g=Object.defineProperty,w=Object.getOwnPropertyNames,O=Object.getOwnPropertySymbols,P=Object.getOwnPropertyDescriptor,A=Object.getPrototypeOf,C=Object.prototype;var E=function e(t,r,n){if("string"==typeof r)return t;if(C){var o=A(r);o&&o!==C&&e(t,o,n)}var a=w(r);O&&(a=a.concat(O(r)));for(var i=S[t.$$typeof]||v,l=S[r.$$typeof]||v,c=0;c<a.length;++c){var u=a[c];if(!(_[u]||n&&n[u]||l&&l[u]||i&&i[u])){var s=P(r,u);try{g(t,u,s)}catch(e){}}}return t};var j=l({resolve:function(e,t){var r=e.default||e;return E(t.Loadable,r,{prefetch:!0,Prefetch:!0}),r},render:function(e){return f.createElement(e.result,e.props)}}),x=j.loadable,L=j.lazy,$=l({onLoad:function(e,t){e&&t.ref&&("function"==typeof t.ref?t.ref(e):t.ref.current=e)},render:function(e){var t=e.props;return!e.loading&&t.children?t.children(e.result):null}}),R=$.lazy,T="undefined"!=typeof window,q="undefined"!=typeof __webpack_require__;var k=x;k.lib=$.loadable;var D=L;D.lib=R;var M=a;e.default=k,e.lazy=D,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=M,e.loadComponents=function(e){return(e=T?window[r]:null)?(d(q,"`loadComponents()` is only compatible with Webpack"),Promise.all(e.map(function(e){return __webpack_require__.e(e).catch(function(e){if(!e.message.match(/missing:/))throw e})})).catch(function(e){t("`loadComponents()` has failed"),t(e)})):(T||t("`loadComponents()` must be called in browser only"),0<document.querySelectorAll("script["+o+"]").length?t("`loadComponents()` is not required if you use `@loadable/webpack-plugin`"):t("`loadComponents()` requires a state in the page, please inject scripts server-side"),Promise.resolve())},Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "@loadable/component",
"description": "React code splitting made easy.",
"version": "4.0.1",
"version": "4.0.2",
"main": "dist/loadable.cjs.js",

@@ -39,3 +39,3 @@ "module": "dist/loadable.es.js",

},
"gitHead": "ae51b16411cedb14b57db8258594ddd20a921f09"
"gitHead": "cfcdb177bf53cbeab774e643b34d0c047ed6eda3"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc