Skip to content

Commit c471ac8

Browse files
authored
fix: use native fetch if available (#551)
If you are in the Electron Renderer process, native fetch is available but it's ignored because the renderer does not respect the browser field of package.json, so we end up with `node-fetch` that uses a browser polyfill of the node `http` module which is very slow on Electron. Instead use native fetch if it's available or `node-fetch` if not, unless you're on the Electron Main process in which case use `electron-fetch` which uses the Electron `net` module which is faster than the node `http` module in that environment.
1 parent e05a31e commit c471ac8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ branches:
44
only:
55
- master
66
- /^release\/.*$/
7+
services:
8+
- xvfb
79
stages:
810
- check
911
- test
@@ -47,13 +49,11 @@ jobs:
4749

4850
- stage: test
4951
name: electron-main
50-
os: osx
5152
script:
5253
- npx aegir test -t electron-main --bail --timeout 60000
5354

5455
- stage: test
5556
name: electron-renderer
56-
os: osx
5757
script:
5858
- npx aegir test -t electron-renderer --bail --timeout 60000
5959
notifications:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"debug": "^4.1.1",
5656
"execa": "^4.0.0",
5757
"fs-extra": "^9.0.0",
58-
"ipfs-utils": "^3.0.0",
58+
"ipfs-utils": "^4.0.0",
5959
"joi": "^17.2.1",
6060
"merge-options": "^3.0.1",
6161
"multiaddr": "^8.0.0",

0 commit comments

Comments
 (0)