aboutsummaryrefslogtreecommitdiffstats
path: root/packages/utils
diff options
context:
space:
mode:
Diffstat (limited to 'packages/utils')
-rw-r--r--packages/utils/CHANGELOG.json29
-rw-r--r--packages/utils/CHANGELOG.md14
-rw-r--r--packages/utils/README.md15
-rw-r--r--packages/utils/package.json13
-rw-r--r--packages/utils/src/fetchAsync.ts3
5 files changed, 67 insertions, 7 deletions
diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json
index 0ac49952b..33690bb33 100644
--- a/packages/utils/CHANGELOG.json
+++ b/packages/utils/CHANGELOG.json
@@ -1,5 +1,34 @@
[
{
+ "version": "1.0.1",
+ "changes": [
+ {
+ "note": "Add `AbortController` polyfill to `fetchAsync`",
+ "pr": 903
+ }
+ ],
+ "timestamp": 1532357734
+ },
+ {
+ "timestamp": 1532043000,
+ "version": "1.0.0",
+ "changes": [
+ {
+ "note": "Add `fetchAsync` which adds a default timeout to all requests",
+ "pr": 874
+ }
+ ]
+ },
+ {
+ "timestamp": 1531919263,
+ "version": "0.7.3",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "0.7.2",
"changes": [
{
diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md
index e2464232c..deae9daae 100644
--- a/packages/utils/CHANGELOG.md
+++ b/packages/utils/CHANGELOG.md
@@ -1,10 +1,22 @@
<!--
-This file is auto-generated using the monorepo-scripts package. Don't edit directly.
+changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
Edit the package's CHANGELOG.json file only.
-->
CHANGELOG
+## v1.0.1 - _July 23, 2018_
+
+ * Add `AbortController` polyfill to `fetchAsync` (#903)
+
+## v1.0.0 - _July 20, 2018_
+
+ * Add `fetchAsync` which adds a default timeout to all requests (#874)
+
+## v0.7.3 - _July 18, 2018_
+
+ * Dependencies updated
+
## v0.7.2 - _July 9, 2018_
* Added errorUtils.spawnSwitchErr
diff --git a/packages/utils/README.md b/packages/utils/README.md
index c637c9af5..c9a2f5846 100644
--- a/packages/utils/README.md
+++ b/packages/utils/README.md
@@ -22,6 +22,21 @@ If your project is in [TypeScript](https://www.typescriptlang.org/), add the fol
import { addressUtils, bigNumberConfigs, classUtils, intervalUtils, promisify } from '@0xproject/utils';
```
+## Troubleshooting
+
+If you are still seeing TS type errors complaining about missing DOM types such as `Response`:
+
+```
+error TS2304: Cannot find name 'Response'.
+```
+
+Then you need to explicitly add the `dom` lib to your compiler options in `tsconfig.json`. The `dom` library is included by default, but customizing the `lib` option can cause it to be dropped.
+
+```
+"compilerOptions": {
+ "lib": [..., "dom"],
+```
+
## Contributing
We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
diff --git a/packages/utils/package.json b/packages/utils/package.json
index b2658f491..382604fdd 100644
--- a/packages/utils/package.json
+++ b/packages/utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@0xproject/utils",
- "version": "0.7.2",
+ "version": "1.0.0",
"engines": {
"node": ">=6.12"
},
@@ -24,8 +24,8 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/utils/README.md",
"devDependencies": {
- "@0xproject/monorepo-scripts": "^0.2.2",
- "@0xproject/tslint-config": "^0.4.21",
+ "@0xproject/monorepo-scripts": "^1.0.0",
+ "@0xproject/tslint-config": "^1.0.0",
"@types/lodash": "4.14.104",
"copyfiles": "^1.2.0",
"make-promises-safe": "^1.1.0",
@@ -35,12 +35,13 @@
"typescript": "2.7.1"
},
"dependencies": {
- "@0xproject/types": "^1.0.0",
- "@0xproject/typescript-typings": "^0.4.2",
+ "@0xproject/types": "^1.0.0-rc.1",
+ "@0xproject/typescript-typings": "^1.0.0",
"@types/node": "^8.0.53",
+ "abortcontroller-polyfill": "^1.1.9",
"bignumber.js": "~4.1.0",
"detect-node": "2.0.3",
- "ethereum-types": "^0.0.2",
+ "ethereum-types": "^1.0.0",
"ethereumjs-util": "^5.1.1",
"ethers": "3.0.22",
"isomorphic-fetch": "^2.2.1",
diff --git a/packages/utils/src/fetchAsync.ts b/packages/utils/src/fetchAsync.ts
index c02e5baba..b4c85718d 100644
--- a/packages/utils/src/fetchAsync.ts
+++ b/packages/utils/src/fetchAsync.ts
@@ -1,5 +1,8 @@
import isNode = require('detect-node');
import 'isomorphic-fetch';
+// WARNING: This needs to be imported after isomorphic-fetch: https://github.com/mo/abortcontroller-polyfill#using-it-on-browsers-without-fetch
+// tslint:disable-next-line:ordered-imports
+import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only';
export const fetchAsync = async (
endpoint: string,