Skip to content

Commit 97cfda9

Browse files
authored
[TT-7097] Fetch transport support in browser and node envs (#42)
* [TT-7097] Fetch transport support in browser and node envs * version bump * Updated changelog
1 parent 4e44536 commit 97cfda9

File tree

9 files changed

+1806
-96
lines changed

9 files changed

+1806
-96
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# v4.0.4
2+
* Switched `isomorphic-unfetch` for `cross-fetch` for better browser support without polyfills.
3+
4+
# v4.0.3
5+
* Added GridSection Typescript types
6+
7+
# v4.0.2
8+
* Added custom headers injection to client configuration
9+
10+
# v4.0.1
11+
* Removed `pkginfo` for support in environments without a `package.json`
12+
113
# v4.0.0
214
* Updated Typescript transpilation `module` to `commonJS` and `target` to `es5`
315
* Added feature for client initialisation to either `browser` or `node` (defaults to `node`)

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,20 @@ A `TransportResponse` consists of the following properties:
133133
| __body__* | `any` |
134134
| __headers__ | `object` |
135135

136-
There are two built-in transports available with this library that you can use; either [isomorphic-unfetch][] or [axios][]. By specifying which transport you would like to use on initialisation of the `What3wordsService` or a client, if you wish to instantiate a client for yourself.
136+
There are two built-in transports available with this library that you can use; either [cross-fetch][] or [axios][]. By specifying which transport you would like to use on initialisation of the `What3wordsService` or a client, if you wish to instantiate a client for yourself.
137137

138138
#### Built-ins
139139

140140
There are two built-in transports available:
141141

142-
* [Isomorphic-unfetch][isomorphic-unfetch]
142+
* [Cross-fetch][cross-fetch]
143143
* [Axios][axios]
144144

145-
In order to use either of these you will need install the peer dependency. By default [isomorphic-unfetch][isomorphic-unfetch] is assumed by the `What3wordsService` or any instantiated client where no override is provided.
145+
In order to use either of these you will need install the peer dependency. By default [cross-fetch][cross-fetch] is assumed by the `What3wordsService` or any instantiated client where no override is provided.
146146

147147
[npm][]:
148148
```sh
149-
npm install isomorphic-unfetch
149+
npm install cross-fetch
150150
```
151151
or
152152
```sh
@@ -155,7 +155,7 @@ npm install axios
155155

156156
[yarn][]:
157157
```sh
158-
yarn add isomorphic-unfetch
158+
yarn add cross-fetch
159159
```
160160
or
161161
```sh
@@ -282,6 +282,6 @@ client.run(options)
282282

283283
[apidocs]: https://developer.what3words.com/public-api/docs
284284

285-
[isomorphic-unfetch]: https://www.npmjs.com/package/isomorphic-unfetch
285+
[cross-fetch]: https://www.npmjs.com/package/cross-fetch
286286

287287
[axios]: https://www.npmjs.com/package/axios

0 commit comments

Comments
 (0)