react-resolver
Advanced tools
Comparing version 3.0.1 to 3.0.2
# React Resolver Changelog | ||
### v3.0.2 - (2016-06-30) | ||
- Fix `@client()` not showing the loader. | ||
+ <https://github.com/ericclemmons/react-resolver/pull/39> | ||
### v3.0.1 - (2016-04-11) | ||
- Add support for React v15 | ||
+ <https://github.com/ericclemmons/react-resolver/pull/112> | ||
### v3.0.0 - (2016-03-01) | ||
@@ -4,0 +14,0 @@ |
{ | ||
"name": "react-resolver", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Async-rendering & data-fetching for universal React applications", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
# React Resolver Changelog | ||
### v3.0.2 - (2016-06-30) | ||
- Fix `@client()` not showing the loader. | ||
+ <https://github.com/ericclemmons/react-resolver/pull/39> | ||
### v3.0.1 - (2016-04-11) | ||
- Add support for React v15 | ||
+ <https://github.com/ericclemmons/react-resolver/pull/112> | ||
### v3.0.0 - (2016-03-01) | ||
@@ -4,0 +14,0 @@ |
@@ -7,2 +7,4 @@ "use strict"; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
@@ -24,2 +26,6 @@ | ||
var _Resolver = require("./Resolver"); | ||
var _Resolver2 = _interopRequireDefault(_Resolver); | ||
function client(Loader) { | ||
@@ -34,2 +40,14 @@ return function clientDecorator(Component) { | ||
enumerable: true | ||
}, { | ||
key: "childContextTypes", | ||
value: { | ||
resolver: _react2["default"].PropTypes.instanceOf(_Resolver2["default"]) | ||
}, | ||
enumerable: true | ||
}, { | ||
key: "contextTypes", | ||
value: { | ||
resolver: _react2["default"].PropTypes.instanceOf(_Resolver2["default"]) | ||
}, | ||
enumerable: true | ||
}]); | ||
@@ -42,3 +60,9 @@ | ||
this.state = { visible: process.env.NODE_ENV === "test" }; | ||
this.enqueue = this.enqueue.bind(this); | ||
this.queue = []; | ||
this.state = { | ||
bypass: process.env.NODE_ENV === "test", | ||
loaded: false, | ||
server: true | ||
}; | ||
} | ||
@@ -49,12 +73,51 @@ | ||
value: function componentDidMount() { | ||
this.setState({ visible: true }); | ||
this.setState({ server: false }, function () { | ||
var _this = this; | ||
Promise.all(this.queue).then(function () { | ||
return _this.setState({ loaded: true }); | ||
}); | ||
}); | ||
} | ||
}, { | ||
key: "enqueue", | ||
value: function enqueue(promise) { | ||
this.queue.push(promise); | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
if (!this.state.visible) { | ||
return Loader ? _react2["default"].createElement(Loader, null) : null; | ||
var _this2 = this; | ||
var _state = this.state; | ||
var bypass = _state.bypass; | ||
var loaded = _state.loaded; | ||
var server = _state.server; | ||
var loader = Loader ? _react2["default"].createElement(Loader, null) : null; | ||
if (server) { | ||
return loader; | ||
} | ||
return _react2["default"].createElement(Component, this.props); | ||
if (bypass || loaded) { | ||
return _react2["default"].createElement(Component, this.props); | ||
} | ||
return _react2["default"].createElement( | ||
"div", | ||
null, | ||
loader, | ||
_react2["default"].createElement( | ||
"div", | ||
{ style: { display: "none" } }, | ||
_react2["default"].createElement( | ||
_Resolver2["default"], | ||
{ onResolve: this.enqueue }, | ||
function (resolved) { | ||
return _react2["default"].createElement(Component, _extends({}, _this2.props, resolved)); | ||
} | ||
) | ||
) | ||
); | ||
} | ||
@@ -61,0 +124,0 @@ }]); |
{ | ||
"name": "react-resolver", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Async-rendering & data-fetching for universal React applications", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -17,6 +17,6 @@ ## Summary | ||
+ [client](/docs/api/Client.md) | ||
+ [context](/docs/api/Client.md) | ||
+ [resolve](/docs/api/Client.md) | ||
+ [Resolver](/docs/api/Client.md) | ||
+ [context](/docs/api/Context.md) | ||
+ [resolve](/docs/api/resolve.md) | ||
+ [Resolver](/docs/api/Resolver.md) | ||
- [Troubleshooting](/docs/Troubleshooting.md) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 16 instances in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
2215856
68
3
628
1
22