From 3982f9dca4a19a3dfc7108f728b8f7e8333dfbc2 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Fri, 9 Apr 2021 09:45:03 -0700 Subject: [PATCH] Replace `fbjs/lib/invariant` with `invariant` (#3448) Summary: Migrates Relay off `fbjs/lib/invariant` onto the `invariant` npm package. Pull Request resolved: https://github.com/facebook/relay/pull/3448 Test Plan: Ran `yarn` and `yarn test` successfully. Reviewed By: yungsters Differential Revision: D27678952 Pulled By: kassens fbshipit-source-id: 722a82cedcb6a658d6af7afff0ed2de77ceb6a67 --- package.json | 1 + packages/react-relay/package.json | 1 + packages/relay-compiler/package.json | 1 + packages/relay-runtime/package.json | 3 ++- packages/relay-test-utils/package.json | 1 + scripts/getBabelOptions.js | 1 - yarn.lock | 2 +- 7 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8e8e836be9698..ed4012a681045 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "gulp-header": "2.0.9", "gulp-rename": "^2.0.0", "gulp-util": "3.0.8", + "invariant": "^2.2.4", "immutable": "~3.7.6", "jest": "^26.6.3", "nullthrows": "^1.1.1", diff --git a/packages/react-relay/package.json b/packages/react-relay/package.json index 3c67de1a5ae5b..1c139d8ef85a7 100644 --- a/packages/react-relay/package.json +++ b/packages/react-relay/package.json @@ -14,6 +14,7 @@ "dependencies": { "@babel/runtime": "^7.0.0", "fbjs": "^3.0.0", + "invariant": "^2.2.4", "nullthrows": "^1.1.1", "relay-runtime": "11.0.1" }, diff --git a/packages/relay-compiler/package.json b/packages/relay-compiler/package.json index 51dca88fc8779..8ea110b19614e 100644 --- a/packages/relay-compiler/package.json +++ b/packages/relay-compiler/package.json @@ -27,6 +27,7 @@ "fbjs": "^3.0.0", "glob": "^7.1.1", "immutable": "~3.7.6", + "invariant": "^2.2.4", "nullthrows": "^1.1.1", "relay-runtime": "11.0.1", "signedsource": "^1.0.0", diff --git a/packages/relay-runtime/package.json b/packages/relay-runtime/package.json index 7d1d5fac750f6..946eabb6786c2 100644 --- a/packages/relay-runtime/package.json +++ b/packages/relay-runtime/package.json @@ -12,7 +12,8 @@ "repository": "facebook/relay", "dependencies": { "@babel/runtime": "^7.0.0", - "fbjs": "^3.0.0" + "fbjs": "^3.0.0", + "invariant": "^2.2.4" }, "directories": { "": "./" diff --git a/packages/relay-test-utils/package.json b/packages/relay-test-utils/package.json index fa1e511e04735..07f0843dd818f 100644 --- a/packages/relay-test-utils/package.json +++ b/packages/relay-test-utils/package.json @@ -13,6 +13,7 @@ "dependencies": { "@babel/runtime": "^7.0.0", "fbjs": "^3.0.0", + "invariant": "^2.2.4", "relay-runtime": "11.0.1" }, "peerDependencies": { diff --git a/scripts/getBabelOptions.js b/scripts/getBabelOptions.js index 582b73aa209ce..c4bb05e5038b1 100644 --- a/scripts/getBabelOptions.js +++ b/scripts/getBabelOptions.js @@ -32,7 +32,6 @@ module.exports = function(options) { map: { Promise: 'promise-polyfill', areEqual: 'fbjs/lib/areEqual', - invariant: 'fbjs/lib/invariant', warning: 'fbjs/lib/warning', }, }, diff --git a/yarn.lock b/yarn.lock index 746bfb150bcf3..4c064466c3dfb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4172,7 +4172,7 @@ interpret@^1.4.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== -invariant@^2.2.2: +invariant@^2.2.2, invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==