Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove isomorphic-fetch #21811

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
"vision": "4.1.0",
"webpack": "3.6.0",
"webpack-merge": "4.1.0",
"whatwg-fetch": "^2.0.3",
"whatwg-fetch": "^2.0.4",
"wreck": "12.4.0",
"x-pack": "link:x-pack",
"yauzl": "2.7.0"
Expand Down
2 changes: 2 additions & 0 deletions src/dev/jest/setup/polyfills.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ bluebird.Promise.setScheduler(function (fn) { global.setImmediate.call(global, f

const MutationObserver = require('mutation-observer');
Object.defineProperty(window, 'MutationObserver', { value: MutationObserver });

require('whatwg-fetch');
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jest.mock('../metadata', () => ({
},
}));

import fetchMock from 'fetch-mock';
import fetchMock from 'fetch-mock/es5/client';
import { kfetch } from 'ui/kfetch';
import { isAutoCreateIndexError } from './error_auto_create_index';

Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/kfetch/kfetch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jest.mock('../metadata', () => ({
},
}));

import fetchMock from 'fetch-mock';
import fetchMock from 'fetch-mock/es5/client';
import { kfetch } from './kfetch';

describe('kfetch', () => {
Expand Down
1 change: 0 additions & 1 deletion src/ui/public/kfetch/kfetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* under the License.
*/

import 'isomorphic-fetch';
import { merge } from 'lodash';
import url from 'url';
import chrome from '../chrome';
Expand Down
4 changes: 4 additions & 0 deletions src/ui/public/kfetch/kfetch_abortable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ jest.mock('../metadata', () => ({
},
}));

import fetchMock from 'fetch-mock/es5/client';
import { kfetchAbortable } from './kfetch_abortable';

describe('kfetchAbortable', () => {
beforeEach(() => fetchMock.get('*', {}));
afterEach(() => fetchMock.restore());

it('should return an object with a fetching promise and an abort callback', () => {
const { fetching, abort } = kfetchAbortable({ pathname: 'my/path' });
expect(typeof fetching.then).toBe('function');
Expand Down
2 changes: 2 additions & 0 deletions x-pack/dev-tools/jest/setup/polyfills.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ bluebird.Promise.setScheduler(function (fn) { global.setImmediate.call(global, f

const MutationObserver = require('mutation-observer');
Object.defineProperty(window, 'MutationObserver', { value: MutationObserver });

require('whatwg-fetch');
2 changes: 1 addition & 1 deletion x-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@
"history": "4.7.2",
"humps": "2.0.1",
"icalendar": "0.7.1",
"isomorphic-fetch": "2.2.1",
"joi": "6.10.1",
"jquery": "^3.3.1",
"jstimezonedetect": "1.0.5",
Expand Down Expand Up @@ -166,6 +165,7 @@
"uuid": "3.0.1",
"venn.js": "0.2.9",
"webcola": "3.3.6",
"whatwg-fetch": "^2.0.4",
"xregexp": "3.2.0"
},
"engines": {
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/apm/public/services/rest/callApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/

import 'isomorphic-fetch';
import { camelizeKeys } from 'humps';
import { kfetch } from 'ui/kfetch';
import { startsWith } from 'lodash';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/

import 'isomorphic-fetch';
import { flatten, memoize } from 'lodash';
import { escapeQuotes } from './escape_kuery';
import { kfetch } from 'ui/kfetch';
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/ml/public/services/http_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
// service for interacting with the server

import chrome from 'ui/chrome';
import 'isomorphic-fetch';

import { addSystemApiHeader } from 'ui/system_api';

Expand Down
6 changes: 5 additions & 1 deletion x-pack/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3951,7 +3951,7 @@ isobject@^3.0.0, isobject@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"

isomorphic-fetch@2.2.1, isomorphic-fetch@^2.1.1:
isomorphic-fetch@^2.1.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
dependencies:
Expand Down Expand Up @@ -8158,6 +8158,10 @@ whatwg-fetch@>=0.10.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"

whatwg-fetch@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f"

whatwg-url@^6.3.0:
version "6.4.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.4.0.tgz#08fdf2b9e872783a7a1f6216260a1d66cc722e08"
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7136,7 +7136,7 @@ isobject@^3.0.0, isobject@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"

isomorphic-fetch@2.2.1, isomorphic-fetch@^2.1.1:
isomorphic-fetch@^2.1.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
dependencies:
Expand Down Expand Up @@ -14158,9 +14158,9 @@ whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3:
dependencies:
iconv-lite "0.4.19"

whatwg-fetch@>=0.10.0, whatwg-fetch@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"
whatwg-fetch@>=0.10.0, whatwg-fetch@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f"

whatwg-url@^4.1.0:
version "4.8.0"
Expand Down