Comparing version 1.2.0-beta.1 to 1.2.0
@@ -1002,2 +1002,5 @@ import { useEffect, useLayoutEffect, createContext, useContext, useState, createElement, useRef, useCallback, useDebugValue } from 'react'; | ||
if (suspense && isUndefined(data) && key) { | ||
// Always update fetcher and config refs even with the Suspense mode. | ||
fetcherRef.current = fetcher; | ||
configRef.current = config; | ||
throw isUndefined(error) ? revalidate(WITH_DEDUPE) : error; | ||
@@ -1004,0 +1007,0 @@ } |
@@ -1004,2 +1004,5 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
if (suspense && isUndefined(data) && key) { | ||
// Always update fetcher and config refs even with the Suspense mode. | ||
fetcherRef.current = fetcher; | ||
configRef.current = config; | ||
throw isUndefined(error) ? revalidate(WITH_DEDUPE) : error; | ||
@@ -1006,0 +1009,0 @@ } |
@@ -19,2 +19,13 @@ import { useEffect, useLayoutEffect, useState, useRef, useCallback } from 'react'; | ||
var __assign = function() { | ||
__assign = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
@@ -76,10 +87,2 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
var useIsomorphicLayoutEffect = IS_SERVER ? useEffect : useLayoutEffect; | ||
// This assignment is to extend the Navigator type to use effectiveType. | ||
var navigatorConnection = typeof navigator !== 'undefined' && | ||
navigator.connection; | ||
// Adjust the config based on slow connection status (<= 70Kbps). | ||
!IS_SERVER && | ||
navigatorConnection && | ||
(['slow-2g', '2g'].includes(navigatorConnection.effectiveType) || | ||
navigatorConnection.saveData); | ||
@@ -172,28 +175,2 @@ // use WeakMap to store the object->key mapping | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
var __assign = function() { | ||
__assign = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var normalize = function (args) { | ||
@@ -200,0 +177,0 @@ return isFunction(args[1]) |
@@ -25,2 +25,13 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
var __assign = function() { | ||
__assign = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
@@ -82,10 +93,2 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
var useIsomorphicLayoutEffect = IS_SERVER ? react.useEffect : react.useLayoutEffect; | ||
// This assignment is to extend the Navigator type to use effectiveType. | ||
var navigatorConnection = typeof navigator !== 'undefined' && | ||
navigator.connection; | ||
// Adjust the config based on slow connection status (<= 70Kbps). | ||
!IS_SERVER && | ||
navigatorConnection && | ||
(['slow-2g', '2g'].includes(navigatorConnection.effectiveType) || | ||
navigatorConnection.saveData); | ||
@@ -178,28 +181,2 @@ // use WeakMap to store the object->key mapping | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
var __assign = function() { | ||
__assign = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var normalize = function (args) { | ||
@@ -206,0 +183,0 @@ return isFunction(args[1]) |
{ | ||
"name": "swr", | ||
"version": "1.2.0-beta.1", | ||
"version": "1.2.0", | ||
"description": "React Hooks library for remote data fetching", | ||
"keywords": [ | ||
"swr", | ||
"react", | ||
"hooks", | ||
"request", | ||
"cache", | ||
"fetch" | ||
], | ||
"main": "./dist/index.js", | ||
@@ -36,3 +44,3 @@ "module": "./dist/index.esm.js", | ||
], | ||
"repository": "vercel/swr", | ||
"repository": "github:vercel/swr", | ||
"homepage": "https://swr.vercel.app", | ||
@@ -43,6 +51,6 @@ "license": "MIT", | ||
"build": "yarn build:core && yarn build:infinite && yarn build:immutable", | ||
"watch": "yalc publish && node scripts/watch.js", | ||
"watch:core": "node scripts/watch.js core", | ||
"watch:infinite": "node scripts/watch.js infinite", | ||
"watch:immutable": "node scripts/watch.js immutable", | ||
"watch": "npm-run-all -p watch:core watch:infinite watch:immutable", | ||
"watch:core": "yarn build:core -w", | ||
"watch:infinite": "yarn build:infinite -w", | ||
"watch:immutable": "yarn build:immutable -w", | ||
"build:core": "bunchee src/index.ts --no-sourcemap", | ||
@@ -57,5 +65,3 @@ "build:infinite": "bunchee index.ts --cwd infinite --no-sourcemap", | ||
"lint:fix": "yarn lint --fix", | ||
"test": "jest --coverage", | ||
"register": "yarn link && cd node_modules/react && yarn link", | ||
"dev-next": "node scripts/dev-next.js" | ||
"test": "jest --coverage" | ||
}, | ||
@@ -79,3 +85,4 @@ "husky": { | ||
"devDependencies": { | ||
"@swc-node/jest": "1.3.3", | ||
"@swc/core": "1.2.129", | ||
"@swc/jest": "0.2.17", | ||
"@testing-library/jest-dom": "5.14.1", | ||
@@ -87,3 +94,3 @@ "@testing-library/react": "12.0.0", | ||
"@typescript-eslint/parser": "5.8.0", | ||
"bunchee": "1.8.0", | ||
"bunchee": "1.8.2", | ||
"eslint": "8.3.0", | ||
@@ -98,2 +105,3 @@ "eslint-config-prettier": "8.3.0", | ||
"lint-staged": "8.2.1", | ||
"next": "12.0.8", | ||
"npm-run-all": "4.1.5", | ||
@@ -106,4 +114,4 @@ "prettier": "2.5.0", | ||
"rimraf": "3.0.2", | ||
"typescript": "4.4.3", | ||
"yalc": "1.0.0-pre.53" | ||
"swr": "link:./", | ||
"typescript": "4.4.3" | ||
}, | ||
@@ -113,3 +121,10 @@ "peerDependencies": { | ||
}, | ||
"dependencies": {} | ||
"prettier": { | ||
"semi": false, | ||
"singleQuote": true, | ||
"useTabs": false, | ||
"trailingComma": "none", | ||
"tabWidth": 2, | ||
"arrowParens": "avoid" | ||
} | ||
} |
@@ -14,3 +14,3 @@ [![SWR](https://assets.vercel.com/image/upload/v1572289618/swr/banner.png)](https://swr.vercel.app) | ||
</a> | ||
<a aria-label="License" href="https://github.com/zeit/swr/blob/main/LICENSE"> | ||
<a aria-label="License" href="https://github.com/vercel/swr/blob/main/LICENSE"> | ||
<img alt="" src="https://badgen.net/npm/license/swr"> | ||
@@ -17,0 +17,0 @@ </a> |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
226231
49
4588
0
28