From 23cb2449337c6e49752a8d5c412a8b33ea37062a Mon Sep 17 00:00:00 2001 From: nodkz Date: Wed, 23 May 2018 15:54:02 +0600 Subject: [PATCH] fix: move repo to `relay-tools` organization --- CHANGELOG.md | 67 +++++++++++++++++++++++++++++++++------------------- README.md | 19 +++++++-------- package.json | 7 +++--- 3 files changed, 56 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0f6255..7bd6117 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,75 +1,94 @@ ## 0.0.0-semantically-released (March 04, 2017) + This package publishing automated by [semantic-release](https://github.com/semantic-release/semantic-release). -[Changelog](https://github.com/nodkz/react-relay-network-layer/releases) is generated automatically and can be found here: https://github.com/nodkz/react-relay-network-layer/releases +[Changelog](https://github.com/relay-tools/react-relay-network-layer/releases) is generated automatically and can be found here: https://github.com/relay-tools/react-relay-network-layer/releases ## 1.4.0 (February 06, 2017) -- feat(Mutation): Add support to multiple files upload [relay#586](https://github.com/facebook/relay/issues/586). #38 (thanks to @giautm) -- fix(Auth middleware): Only first request that failed during tokenRefresh was retries. #37 (thanks to @alexxv) -- chore(Packages): Update dev packages. Add yarn. + +* feat(Mutation): Add support to multiple files upload [relay#586](https://github.com/facebook/relay/issues/586). #38 (thanks to @giautm) +* fix(Auth middleware): Only first request that failed during tokenRefresh was retries. #37 (thanks to @alexxv) +* chore(Packages): Update dev packages. Add yarn. ## 1.3.9 (December 30, 2016) -- Auth middleware: when client makes multiples relay requests with expired token, we only need to refresh token once for those requests. #32 (thanks to @alexxv) + +* Auth middleware: when client makes multiples relay requests with expired token, we only need to refresh token once for those requests. #32 (thanks to @alexxv) ## 1.3.8 (December 22, 2016) -- Configurable header name for auth middleware #28 (thanks to @tehwalris) -For `auth` middleware added `header` option: name of the HTTP header to pass the token in (default: `'Authorization'`). + +* Configurable header name for auth middleware #28 (thanks to @tehwalris) + For `auth` middleware added `header` option: name of the HTTP header to pass the token in (default: `'Authorization'`). ## 1.3.7 (December 18, 2016) -- Fix `formatRequestErrors` for Absinthe (GraphQL for Elixir) #27 (thanks to @redjohn) + +* Fix `formatRequestErrors` for Absinthe (GraphQL for Elixir) #27 (thanks to @redjohn) ## 1.3.6 (October 11, 2016) + #### Thanks to @kosmikko for his PR #21 -- Catch unhandled promises, (closes #7 Red screen for react-native when network problem occurs). -- Add tests. -- Remove unnecessary wrapping Promise. + +* Catch unhandled promises, (closes #7 Red screen for react-native when network problem occurs). +* Add tests. +* Remove unnecessary wrapping Promise. ## 1.3.5 (October 4, 2016) -- Handle malformed or non existent JSON in response (#20). Thanks to @JonathanUsername -- Return main promise. Thanks to @helfer https://github.com/graphql/express-graphql/pull/99 -Returning the main promise will let you do things like time execution and perform some cleanups after the request is processed. + +* Handle malformed or non existent JSON in response (#20). Thanks to @JonathanUsername +* Return main promise. Thanks to @helfer https://github.com/graphql/express-graphql/pull/99 + Returning the main promise will let you do things like time execution and perform some cleanups after the request is processed. ## 1.3.4 (August 29, 2016) -* fix: support `express-graphql@0.5.4`. Thanks @genbit [issue #19](https://github.com/nodkz/react-relay-network-layer/issues/19) + +* fix: support `express-graphql@0.5.4`. Thanks @genbit [issue #19](https://github.com/relay-tools/react-relay-network-layer/issues/19) ## 1.3.3 (August 5, 2016) -* fix: batch express middleware. It should not call next middleware. Thanks @genbit [issue #13](https://github.com/nodkz/react-relay-network-layer/issues/13) + +* fix: batch express middleware. It should not call next middleware. Thanks @genbit [issue #13](https://github.com/relay-tools/react-relay-network-layer/issues/13) ## 1.3.2 (July 28, 2016) + * fix: gqErrors middleware, it does not display errors for single request (thanks to @jibingeo) ## 1.3.1 (July 12, 2016) -* fix: catch react-native error, when network request fails, eg. offline ([issue #7](https://github.com/nodkz/react-relay-network-layer/issues/7)). + +* fix: catch react-native error, when network request fails, eg. offline ([issue #7](https://github.com/relay-tools/react-relay-network-layer/issues/7)). ## 1.2.0 (June 21, 2016) -* fix: remove `whatwg-fetch` polyfill, due problem in React Native ([issue #8](https://github.com/nodkz/react-relay-network-layer/issues/8)). + +* fix: remove `whatwg-fetch` polyfill, due problem in React Native ([issue #8](https://github.com/relay-tools/react-relay-network-layer/issues/8)). If your client does not have `fetch` global method, you should include polyfill explicitly in you code: + ```js - import 'whatwg-fetch'; // for old browsers - or - import 'node-fetch'; // for old node versions - or - import 'fetch-everywhere'; // fresh isomorphic fetch polyfill, that supports all clients (not tested ;) +import 'whatwg-fetch'; // for old browsers +or; +import 'node-fetch'; // for old node versions +or; +import 'fetch-everywhere'; // fresh isomorphic fetch polyfill, that supports all clients (not tested ;) ``` + Thanks to @roman01la and @edvinerikson. ## 1.1.4 (June 15, 2016) + * feat: add `allowEmptyToken` option for `authMiddleware` to allow made a request without Authorization header if token is empty ## 1.1.3 (June 13, 2016) + * fix: files upload with auth middleware (thanks to @alexanderlamb) ## 1.1.2 (May 27, 2016) + * feat: improve performance of `graphqlBatchHTTPWrapper`, by removing JSON.parse ## 1.1.1 (May 27, 2016) + * fix: add support for express-graphql@0.5.2 ## 1.1.0 (May 17, 2016) * feat: Add `json` param to `response`. Now it's available for middleware in bubbling phase (res.json). * feat: new middleware `gqErrors` - display `errors` data to console from graphql response -![gqErrorsMiddleware](https://cloud.githubusercontent.com/assets/1946920/15324650/28582d12-1c69-11e6-9ef3-6834dee031e6.png) + ![gqErrorsMiddleware](https://cloud.githubusercontent.com/assets/1946920/15324650/28582d12-1c69-11e6-9ef3-6834dee031e6.png) * experimental: `deferMiddleware`, right now it's only inform Relay that NetworkLayer support this feature. See discussion about `defer` here [relay/issues/288](https://github.com/facebook/relay/issues/288) ## 1.0.3 (May 4, 2016) diff --git a/README.md b/README.md index 5ac4289..afded81 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![](https://img.shields.io/npm/v/react-relay-network-modern.svg)](https://www.npmjs.com/package/react-relay-network-modern) [![npm](https://img.shields.io/npm/dt/react-relay-network-modern.svg)](http://www.npmtrends.com/react-relay-network-modern) -[![Travis](https://img.shields.io/travis/nodkz/react-relay-network-modern.svg?maxAge=2592000)](https://travis-ci.org/nodkz/react-relay-network-modern) +[![Travis](https://img.shields.io/travis/relay-tools/react-relay-network-modern.svg?maxAge=2592000)](https://travis-ci.org/relay-tools/react-relay-network-modern) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) ![FlowType compatible](https://img.shields.io/badge/flowtype-compatible-brightgreen.svg) @@ -10,9 +10,9 @@ The `ReactRelayNetworkModern` is a [Network Layer for Relay Modern](https://facebook.github.io/relay/docs/network-layer.html) with various middlewares which can manipulate requests/responses on the fly (change auth headers, request url or perform some fallback if request fails), batch several relay request by timeout into one http request, cache queries. -Network Layer for Relay Classic can be found [here](https://github.com/nodkz/react-relay-network-layer). +Network Layer for Relay Classic can be found [here](https://github.com/relay-tools/react-relay-network-layer). -Migration guide from v1 to v2 can be found [here](https://github.com/nodkz/react-relay-network-modern/releases/tag/v2.0.0). +Migration guide from v1 to v2 can be found [here](https://github.com/relay-tools/react-relay-network-modern/releases/tag/v2.0.0). `ReactRelayNetworkModern` can be used in browser, react-native or node server for rendering. Under the hood this module uses global `fetch` method. So if your client is too old, please import explicitly proper polyfill to your code (eg. `whatwg-fetch`, `node-fetch` or `fetch-everywhere`). @@ -57,7 +57,7 @@ import { RelayNetworkLayer } from 'react-relay-network-modern/es'; ### Build-in middlewares: -* **your custom inline middleware** - [see example](https://github.com/nodkz/react-relay-network-modern#example-of-injecting-networklayer-with-middlewares-on-the-client-side) below where added `credentials` and `headers` to the `fetch` method. +* **your custom inline middleware** - [see example](https://github.com/relay-tools/react-relay-network-modern#example-of-injecting-networklayer-with-middlewares-on-the-client-side) below where added `credentials` and `headers` to the `fetch` method. * `next => req => { /* your modification of 'req' object */ return next(req); }` * **urlMiddleware** - for manipulating fetch `url` on fly via thunk. * `url` - string for single request. Can be Promise or function(req). (default: `/graphql`). @@ -86,7 +86,7 @@ import { RelayNetworkLayer } from 'react-relay-network-modern/es'; * `forceRetry` - function(cb, delay), when request is delayed for next retry, middleware will call this function and pass to it a callback and delay time. When you call this callback `cb`, middleware will proceed request immediately (default: `false`). * `allowMutations` - by default retries disabled for mutations, you may allow process retries for them passing `true`. (default: `false`) * `allowFormData` - by default retries disabled for file Uploads, you may enable it passing `true` (default: `false`) -* **batchMiddleware** - gather some period of time relay-requests and sends it as one http-request. You server must support batch request, [how to setup your server](https://github.com/nodkz/react-relay-network-modern#example-how-to-enable-batching) +* **batchMiddleware** - gather some period of time relay-requests and sends it as one http-request. You server must support batch request, [how to setup your server](https://github.com/relay-tools/react-relay-network-modern#example-how-to-enable-batching) * `batchUrl` - string. Url of the server endpoint for batch request execution. Can be function(requestMap) or Promise. (default: `/graphql/batch`) * `batchTimeout` - integer in milliseconds, period of time for gathering multiple requests before sending them to the server. Will delay sending of the requests on specified in this option period of time, so be careful and keep this value small. (default: `0`) * `maxBatchSize` - integer representing maximum size of request to be sent in a single batch. Once a request hits the provided size in length a new batch request is ran. Actual for hardcoded limit in 100kb per request in [express-graphql](https://github.com/graphql/express-graphql/blob/master/src/parseBody.js#L112) module. (default: `102400` characters, roughly 100kb for 1-byte characters or 200kb for 2-byte characters) @@ -109,7 +109,7 @@ import { RelayNetworkLayer } from 'react-relay-network-modern/es'; ### Standalone package middlewares: -* [**react-relay-network-modern-ssr**](https://github.com/nodkz/react-relay-network-modern-ssr) - client/server middleware for server-side rendering (SSR). On server side it makes requests directly via `graphql-js` and your `schema`, cache payloads and serialize them for putting to HTML. On client side it loads provided payloads and renders them in sync mode without visible flashes and loaders. +* [**react-relay-network-modern-ssr**](https://github.com/relay-tools/react-relay-network-modern-ssr) - client/server middleware for server-side rendering (SSR). On server side it makes requests directly via `graphql-js` and your `schema`, cache payloads and serialize them for putting to HTML. On client side it loads provided payloads and renders them in sync mode without visible flashes and loaders. ### Example of injecting NetworkLayer with middlewares on the **client side**. @@ -211,7 +211,6 @@ Available options: * **subscribeFn** - if you use subscriptions in your app, you may provide this function which will be passed to [RelayNetwork](https://github.com/facebook/relay/blob/master/packages/relay-runtime/network/RelayNetwork.js). * **noThrow** - **EXPERIMENTAL (May be deprecated in the future)** set true to not throw when an error response is given by the server, and to instead handle errors in your app code. - ### Server-side rendering (SSR) For performant server-side rendering with `node 8` and above recommended to use special build of this network layer. Also you may execute `graphql` directly without http-request if you write custom middleware. All this recommendations present in following example: @@ -323,7 +322,7 @@ server.listen(port, () => { }); ``` -[More complex example](https://github.com/nodkz/react-relay-network-modern/blob/master/examples/dataLoaderPerBatchRequest.js) of how you can use a single [DataLoader](https://github.com/facebook/dataloader) for all (batched) queries within a one HTTP-request. +[More complex example](https://github.com/relay-tools/react-relay-network-modern/blob/master/examples/dataLoaderPerBatchRequest.js) of how you can use a single [DataLoader](https://github.com/facebook/dataloader) for all (batched) queries within a one HTTP-request. If you are on Koa@2, [koa-graphql-batch](https://github.com/mattecapu/koa-graphql-batch) provides the same functionality as `graphqlBatchHTTPWrapper` (see its docs for usage example). @@ -348,8 +347,8 @@ Internally batching in NetworkLayer prepare list of queries `[ {id, query, varia I actively welcome pull requests with code and doc fixes. Also if you made great middleware and want share it within this module, please feel free to open PR. -[CHANGELOG](https://github.com/nodkz/react-relay-network-modern/blob/master/CHANGELOG.md) +[CHANGELOG](https://github.com/relay-tools/react-relay-network-modern/blob/master/CHANGELOG.md) # License -[MIT](https://github.com/nodkz/react-relay-network-modern/blob/master/LICENSE.md) +[MIT](https://github.com/relay-tools/react-relay-network-modern/blob/master/LICENSE.md) diff --git a/package.json b/package.json index 95b0eb5..3b546dd 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "module": "mjs/index.mjs", "repository": { "type": "git", - "url": "https://github.com/nodkz/react-relay-network-modern.git" + "url": "https://github.com/relay-tools/react-relay-network-modern.git" }, "keywords": [ "relay", @@ -23,11 +23,12 @@ "jwt", "auth token" ], + "author": "Pavel Chertorogov @nodkz", "license": "MIT", "bugs": { - "url": "https://github.com/nodkz/react-relay-network-modern/issues" + "url": "https://github.com/relay-tools/react-relay-network-modern/issues" }, - "homepage": "https://github.com/nodkz/react-relay-network-modern#readme", + "homepage": "https://github.com/relay-tools/react-relay-network-modern#readme", "dependencies": {}, "peerDependencies": { "relay-runtime": ">=1.4.0"