next-urql
Advanced tools
Comparing version 0.3.7 to 0.3.8
# Changelog | ||
## 0.3.8 | ||
### Patch Changes | ||
- Bump `react-ssr-prepass` so it can get eliminated in the client-side bundle, this because the 1.2.1 version added "sideEffects:false", by [@JoviDeCroock](https://github.com/JoviDeCroock) (See [#809](https://github.com/FormidableLabs/urql/pull/809)) | ||
## 0.3.7 | ||
@@ -4,0 +10,0 @@ |
@@ -1,12 +0,7 @@ | ||
import React from "react"; | ||
import ssrPrepass from "react-ssr-prepass"; | ||
import { ssrExchange, createClient, dedupExchange, cacheExchange, fetchExchange, Provider } from "urql"; | ||
function _extends() { | ||
return (_extends = Object.assign || function(target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
var i, source, key; | ||
for (i = 1; i < arguments.length; i++) { | ||
source = arguments[i]; | ||
for (key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
@@ -21,6 +16,2 @@ target[key] = source[key]; | ||
var urqlClient = null; | ||
var ssrCache = null; | ||
function _ref(ssrEx) { | ||
@@ -61,7 +52,5 @@ return [ dedupExchange, cacheExchange, ssrEx, fetchExchange ]; | ||
var withUrql = function(ref) { | ||
var urqlClient = ref.urqlClient; | ||
var urqlState = ref.urqlState; | ||
var rest = function objectWithoutProperties(obj, exclude) { | ||
var target = {}; | ||
for (var k in obj) { | ||
var urqlClient = ref.urqlClient, urqlState = ref.urqlState, rest$1 = function objectWithoutProperties(obj, exclude) { | ||
var k, target = {}; | ||
for (k in obj) { | ||
if (Object.prototype.hasOwnProperty.call(obj, k) && -1 === exclude.indexOf(k)) { | ||
@@ -72,4 +61,3 @@ target[k] = obj[k]; | ||
return target; | ||
}(ref, [ "urqlClient", "urqlState" ]); | ||
var client = React.useMemo((function() { | ||
}(ref, [ "urqlClient", "urqlState" ]), rest = rest$1, client = React.useMemo((function() { | ||
if (urqlClient) { | ||
@@ -98,2 +86,3 @@ return urqlClient; | ||
function _temp2() { | ||
var props; | ||
if ("undefined" != typeof window) { | ||
@@ -104,3 +93,3 @@ return _extends({}, pageProps, { | ||
} | ||
var props = _extends({}, pageProps, { | ||
props = _extends({}, pageProps, { | ||
urqlClient: urqlClient | ||
@@ -115,13 +104,12 @@ }); | ||
} | ||
var AppTree, isApp, ctx, ref, urqlClient, ssrCache, pageProps; | ||
try { | ||
var AppTree = appOrPageCtx.AppTree; | ||
var isApp = !!appOrPageCtx.Component; | ||
var ctx = isApp ? appOrPageCtx.ctx : appOrPageCtx; | ||
var ref = initUrqlClient("function" == typeof clientConfig ? clientConfig(ctx) : clientConfig, mergeExchanges); | ||
var urqlClient = ref[0]; | ||
var ssrCache = ref[1]; | ||
if (urqlClient) { | ||
AppTree = appOrPageCtx.AppTree; | ||
ctx = (isApp = !!appOrPageCtx.Component) ? appOrPageCtx.ctx : appOrPageCtx; | ||
ref = initUrqlClient("function" == typeof clientConfig ? clientConfig(ctx) : clientConfig, mergeExchanges); | ||
ssrCache = ref[1]; | ||
if (urqlClient = ref[0]) { | ||
ctx.urqlClient = urqlClient; | ||
} | ||
var pageProps = {}; | ||
pageProps = {}; | ||
const _temp = function _ref5() { | ||
@@ -141,3 +129,15 @@ if (AppOrPage.getInitialProps) { | ||
var urqlClient, ssrCache; | ||
import React from "react"; | ||
import ssrPrepass from "react-ssr-prepass"; | ||
import { ssrExchange, createClient, dedupExchange, cacheExchange, fetchExchange, Provider } from "urql"; | ||
urqlClient = null; | ||
ssrCache = null; | ||
export { withUrqlClient }; | ||
//# sourceMappingURL=next-urql.es.js.map |
@@ -5,13 +5,8 @@ function _interopDefault(ex) { | ||
var React = _interopDefault(require("react")); | ||
var ssrPrepass = _interopDefault(require("react-ssr-prepass")); | ||
var urql = require("urql"); | ||
function _extends() { | ||
return (_extends = Object.assign || function(target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
var i, source, key; | ||
for (i = 1; i < arguments.length; i++) { | ||
source = arguments[i]; | ||
for (key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
@@ -26,6 +21,2 @@ target[key] = source[key]; | ||
var urqlClient = null; | ||
var ssrCache = null; | ||
function _ref(ssrEx) { | ||
@@ -60,2 +51,4 @@ return [ urql.dedupExchange, urql.cacheExchange, ssrEx, urql.fetchExchange ]; | ||
var React = _interopDefault(require("react")), ssrPrepass = _interopDefault(require("react-ssr-prepass")), urql = require("urql"), urqlClient = null, ssrCache = null; | ||
exports.withUrqlClient = function withUrqlClient(clientConfig, mergeExchanges) { | ||
@@ -67,7 +60,5 @@ if (void 0 === mergeExchanges) { | ||
var withUrql = function(ref) { | ||
var urqlClient = ref.urqlClient; | ||
var urqlState = ref.urqlState; | ||
var rest = function objectWithoutProperties(obj, exclude) { | ||
var target = {}; | ||
for (var k in obj) { | ||
var urqlClient = ref.urqlClient, urqlState = ref.urqlState, rest$1 = function objectWithoutProperties(obj, exclude) { | ||
var k, target = {}; | ||
for (k in obj) { | ||
if (Object.prototype.hasOwnProperty.call(obj, k) && -1 === exclude.indexOf(k)) { | ||
@@ -78,4 +69,3 @@ target[k] = obj[k]; | ||
return target; | ||
}(ref, [ "urqlClient", "urqlState" ]); | ||
var client = React.useMemo((function() { | ||
}(ref, [ "urqlClient", "urqlState" ]), rest = rest$1, client = React.useMemo((function() { | ||
if (urqlClient) { | ||
@@ -104,2 +94,3 @@ return urqlClient; | ||
function _temp2() { | ||
var props; | ||
if ("undefined" != typeof window) { | ||
@@ -110,3 +101,3 @@ return _extends({}, pageProps, { | ||
} | ||
var props = _extends({}, pageProps, { | ||
props = _extends({}, pageProps, { | ||
urqlClient: urqlClient | ||
@@ -121,13 +112,12 @@ }); | ||
} | ||
var AppTree, isApp, ctx, ref, urqlClient, ssrCache, pageProps; | ||
try { | ||
var AppTree = appOrPageCtx.AppTree; | ||
var isApp = !!appOrPageCtx.Component; | ||
var ctx = isApp ? appOrPageCtx.ctx : appOrPageCtx; | ||
var ref = initUrqlClient("function" == typeof clientConfig ? clientConfig(ctx) : clientConfig, mergeExchanges); | ||
var urqlClient = ref[0]; | ||
var ssrCache = ref[1]; | ||
if (urqlClient) { | ||
AppTree = appOrPageCtx.AppTree; | ||
ctx = (isApp = !!appOrPageCtx.Component) ? appOrPageCtx.ctx : appOrPageCtx; | ||
ref = initUrqlClient("function" == typeof clientConfig ? clientConfig(ctx) : clientConfig, mergeExchanges); | ||
ssrCache = ref[1]; | ||
if (urqlClient = ref[0]) { | ||
ctx.urqlClient = urqlClient; | ||
} | ||
var pageProps = {}; | ||
pageProps = {}; | ||
const _temp = function _ref5() { | ||
@@ -134,0 +124,0 @@ if (AppOrPage.getInitialProps) { |
{ | ||
"name": "next-urql", | ||
"version": "0.3.7", | ||
"version": "0.3.8", | ||
"description": "Convenience wrappers for using urql with NextJS.", | ||
@@ -29,3 +29,3 @@ "sideEffects": false, | ||
"build": "rollup -c ../../scripts/rollup/config.js", | ||
"prepare": "../../scripts/prepare/index.js", | ||
"prepare": "node ../../scripts/prepare/index.js", | ||
"prepublishOnly": "run-s clean build" | ||
@@ -54,3 +54,3 @@ }, | ||
"dependencies": { | ||
"react-ssr-prepass": "^1.1.2", | ||
"react-ssr-prepass": "^1.2.1", | ||
"urql": ">=1.9.4" | ||
@@ -57,0 +57,0 @@ }, |
<div align="center"> | ||
<img src="../../docs/assets/next-logo.png" alt="NextJS" height="200" width="200"> | ||
<img src="../../docs/assets/urql-logo.png" alt="urql" height="200" width="200"> | ||
<img src="../../packages/site/src/assets/sidebar-badge.svg" alt="urql" height="200" width="200"> | ||
<br /> | ||
@@ -5,0 +5,0 @@ <a href="https://npmjs.com/package/next-urql"> |
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
61011
322
Updatedreact-ssr-prepass@^1.2.1