From 31a127f3657b6f041f82e6f3d67f3be25dce898f Mon Sep 17 00:00:00 2001 From: Jacky Efendi Date: Fri, 2 Nov 2018 15:34:39 +0700 Subject: [PATCH] Replace isomorphic-fetch with isomorphic-unfetch for smaller size --- .../fbjs-scripts/third-party-module-map.json | 2 +- packages/fbjs/CHANGELOG.md | 2 +- packages/fbjs/package.json | 2 +- packages/fbjs/src/__forks__/fetch.js | 2 +- packages/fbjs/yarn.lock | 79 ++++++++++++------- 5 files changed, 55 insertions(+), 32 deletions(-) diff --git a/packages/fbjs-scripts/third-party-module-map.json b/packages/fbjs-scripts/third-party-module-map.json index c37a5c63..940a4323 100644 --- a/packages/fbjs-scripts/third-party-module-map.json +++ b/packages/fbjs-scripts/third-party-module-map.json @@ -2,7 +2,7 @@ "core-js/library/es6/map": "core-js/library/es6/map", "core-js/library/es6/set": "core-js/library/es6/set", "fbjs-css-vars": "fbjs-css-vars", - "isomorphic-fetch": "isomorphic-fetch", + "isomorphic-unfetch": "isomorphic-unfetch", "object-assign": "object-assign", "promise": "promise", "promise/setimmediate/done": "promise/setimmediate/done", diff --git a/packages/fbjs/CHANGELOG.md b/packages/fbjs/CHANGELOG.md index 24be8f59..b116b8e3 100644 --- a/packages/fbjs/CHANGELOG.md +++ b/packages/fbjs/CHANGELOG.md @@ -100,7 +100,7 @@ ### Changed - `ErrorUtils`: Re-uses any global instance that already exists -- `fetch`: Switched to `isomorphic-fetch` when a global implementation is missing +- `fetch`: Switched to `isomorphic-unfetch` when a global implementation is missing - `shallowEqual`: handles `NaN` values appropriately (as equal), now using `Object.is` semantics diff --git a/packages/fbjs/package.json b/packages/fbjs/package.json index b3671160..6f498ed6 100644 --- a/packages/fbjs/package.json +++ b/packages/fbjs/package.json @@ -66,7 +66,7 @@ "dependencies": { "core-js": "^2.4.1", "fbjs-css-vars": "^1.0.0", - "isomorphic-fetch": "^2.1.1", + "isomorphic-unfetch": "^3.0.0", "loose-envify": "^1.0.0", "object-assign": "^4.1.0", "promise": "^7.1.1", diff --git a/packages/fbjs/src/__forks__/fetch.js b/packages/fbjs/src/__forks__/fetch.js index c5d36818..1940972a 100644 --- a/packages/fbjs/src/__forks__/fetch.js +++ b/packages/fbjs/src/__forks__/fetch.js @@ -15,5 +15,5 @@ if (global.fetch) { module.exports = global.fetch.bind(global); } else { - module.exports = require('isomorphic-fetch'); + module.exports = require('isomorphic-unfetch'); } diff --git a/packages/fbjs/yarn.lock b/packages/fbjs/yarn.lock index ac710452..89dd5e0b 100644 --- a/packages/fbjs/yarn.lock +++ b/packages/fbjs/yarn.lock @@ -806,7 +806,40 @@ babel-plugin-syntax-trailing-function-commas@^7.0.0-beta.0: resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-7.0.0-beta.0.tgz#aa213c1435e2bffeb6fca842287ef534ad05d5cf" integrity sha512-Xj9XuRuz3nTSbaTXWv3itLOcxyF4oPD8douBBmj7U9BBC6nEBYfyOJYQMf/8PJAFotC62UY5dFfIGEPr7WswzQ== -babel-preset-fbjs@^3.0.0, "babel-preset-fbjs@file:../babel-preset-fbjs": +babel-preset-fbjs@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/babel-preset-fbjs/-/babel-preset-fbjs-3.1.0.tgz#6d1438207369d96384d09257b01602dd0dda6608" + integrity sha512-j+B9xZsnqWFxHaqt3B8aFYftSgrcgbO5NF3mTtHYd6R442NJW2aBk3k+XvxXwIia98UuZxCg8psZY79bXbhwew== + dependencies: + "@babel/plugin-proposal-class-properties" "^7.0.0" + "@babel/plugin-proposal-object-rest-spread" "^7.0.0" + "@babel/plugin-syntax-class-properties" "^7.0.0" + "@babel/plugin-syntax-flow" "^7.0.0" + "@babel/plugin-syntax-jsx" "^7.0.0" + "@babel/plugin-syntax-object-rest-spread" "^7.0.0" + "@babel/plugin-transform-arrow-functions" "^7.0.0" + "@babel/plugin-transform-block-scoped-functions" "^7.0.0" + "@babel/plugin-transform-block-scoping" "^7.0.0" + "@babel/plugin-transform-classes" "^7.0.0" + "@babel/plugin-transform-computed-properties" "^7.0.0" + "@babel/plugin-transform-destructuring" "^7.0.0" + "@babel/plugin-transform-flow-strip-types" "^7.0.0" + "@babel/plugin-transform-for-of" "^7.0.0" + "@babel/plugin-transform-function-name" "^7.0.0" + "@babel/plugin-transform-literals" "^7.0.0" + "@babel/plugin-transform-member-expression-literals" "^7.0.0" + "@babel/plugin-transform-modules-commonjs" "^7.0.0" + "@babel/plugin-transform-object-super" "^7.0.0" + "@babel/plugin-transform-parameters" "^7.0.0" + "@babel/plugin-transform-property-literals" "^7.0.0" + "@babel/plugin-transform-react-display-name" "^7.0.0" + "@babel/plugin-transform-react-jsx" "^7.0.0" + "@babel/plugin-transform-shorthand-properties" "^7.0.0" + "@babel/plugin-transform-spread" "^7.0.0" + "@babel/plugin-transform-template-literals" "^7.0.0" + babel-plugin-syntax-trailing-function-commas "^7.0.0-beta.0" + +"babel-preset-fbjs@file:../babel-preset-fbjs": version "3.0.1" dependencies: "@babel/plugin-proposal-class-properties" "^7.0.0" @@ -1380,13 +1413,6 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -encoding@^0.1.11: - version "0.1.12" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" - integrity sha1-U4tm8+5izRq1HsMjgp0flIDHS+s= - dependencies: - iconv-lite "~0.4.13" - end-of-stream@~0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-0.1.5.tgz#8e177206c3c80837d85632e8b9359dfe8b2f6eaf" @@ -2199,7 +2225,7 @@ iconv-lite@0.4.23: dependencies: safer-buffer ">= 2.1.2 < 3" -iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@^0.4.4: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -2500,7 +2526,7 @@ is-relative@^1.0.0: dependencies: is-unc-path "^1.0.0" -is-stream@^1.0.1, is-stream@^1.1.0: +is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= @@ -2561,13 +2587,13 @@ isobject@^3.0.0, isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= -isomorphic-fetch@^2.1.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" - integrity sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk= +isomorphic-unfetch@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/isomorphic-unfetch/-/isomorphic-unfetch-3.0.0.tgz#de6d80abde487b17de2c400a7ef9e5ecc2efb362" + integrity sha512-V0tmJSYfkKokZ5mgl0cmfQMTb7MLHsBMngTkbLY0eXvKqiVRRoZP04Ly+KhKrJfKtzC9E6Pp15Jo+bwh7Vi2XQ== dependencies: - node-fetch "^1.0.1" - whatwg-fetch ">=0.10.0" + node-fetch "^2.2.0" + unfetch "^4.0.0" isstream@~0.1.2: version "0.1.2" @@ -3504,13 +3530,10 @@ needle@^2.2.1: iconv-lite "^0.4.4" sax "^1.2.4" -node-fetch@^1.0.1: - version "1.7.3" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" - integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== - dependencies: - encoding "^0.1.11" - is-stream "^1.0.1" +node-fetch@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.2.0.tgz#4ee79bde909262f9775f731e3656d0db55ced5b5" + integrity sha512-OayFWziIxiHY8bCUyLX6sTpDH8Jsbp4FfYd1j1f7vZyfgkcOnAyM4oQR16f8a0s7Gl/viMGRey8eScYk4V4EZA== node-int64@^0.4.0: version "0.4.0" @@ -4792,6 +4815,11 @@ unc-path-regex@^0.1.2: resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" integrity sha1-5z3T17DXxe2G+6xrCufYxqadUPo= +unfetch@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.0.1.tgz#8750c4c7497ade75d40387d7dbc4ba024416b8f6" + integrity sha512-HzDM9NgldcRvHVDb/O9vKoUszVij30Yw5ePjOZJig8nF/YisG7QN/9CBXZ8dsHLouXMeLZ82r+Jod9M2wFkEbQ== + union-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" @@ -4944,11 +4972,6 @@ whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: dependencies: iconv-lite "0.4.23" -whatwg-fetch@>=0.10.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" - integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== - whatwg-mimetype@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.2.0.tgz#a3d58ef10b76009b042d03e25591ece89b88d171"