diff --git a/.depcheckrc.yml b/.depcheckrc.yml index 8eb09545ac93..f07a90b9a488 100644 --- a/.depcheckrc.yml +++ b/.depcheckrc.yml @@ -8,6 +8,7 @@ ignores: - '@lavamoat/webpack' - '@lavamoat/allow-scripts' - '@babel/runtime' + - 'react-compiler-runtime' - '@fortawesome/fontawesome-free' - 'punycode' # injected via build system @@ -83,6 +84,7 @@ ignores: - 'core-js-pure' # polyfills # babel - '@babel/plugin-transform-logical-assignment-operators' + - 'babel-plugin-react-compiler' # used in image optimization script - 'sharp' # trezor diff --git a/.eslintrc.js b/.eslintrc.js index e85ec510e7e4..8b38b1890d32 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -320,8 +320,9 @@ module.exports = { jsx: true, }, }, - plugins: ['react'], + plugins: ['react', 'react-compiler'], rules: { + 'react-compiler/react-compiler': 'error', 'react/no-unused-prop-types': 'error', 'react/no-unused-state': 'error', 'react/jsx-boolean-value': 'error', @@ -362,8 +363,9 @@ module.exports = { jsx: true, }, }, - plugins: ['react'], + plugins: ['react', 'react-compiler'], rules: { + 'react-compiler/react-compiler': 'error', 'react/no-unused-prop-types': 'warn', 'react/no-unused-state': 'warn', 'react/jsx-boolean-value': 'off', diff --git a/babel.config.js b/babel.config.js index 69ac5f5f70c9..e1e4e98d7fe1 100644 --- a/babel.config.js +++ b/babel.config.js @@ -2,6 +2,7 @@ const path = require('path'); module.exports = function (api) { api.cache(false); + const slash = `\\${path.sep}`; return { parserOpts: { strictMode: true, @@ -9,6 +10,15 @@ module.exports = function (api) { targets: { browsers: ['chrome >= 89', 'firefox >= 89'], }, + overrides: [ + { + test: new RegExp( + `^${path.join(__dirname, 'ui')}${slash}(?:components|contexts|hooks|layouts|pages)${slash}(?:.(?!\\.(?:test|stories|container)))+\\.(?:m?[jt]s|[jt]sx)$`, + 'u', + ), + plugins: [['babel-plugin-react-compiler', { target: '17' }]], + }, + ], plugins: [ // `browserify` is old and busted, and doesn't support `??=` (and other // logical assignment operators). This plugin lets us target es2020-level diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index a1040ce06a6c..768053b09e7f 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -2749,7 +2749,7 @@ }, "string.prototype.matchall>es-abstract>array-buffer-byte-length": { "packages": { - "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>es-abstract>is-array-buffer": true } }, @@ -3054,7 +3054,7 @@ }, "string.prototype.matchall>call-bind>call-bind-apply-helpers": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "browserify>has>function-bind": true } }, @@ -3066,7 +3066,7 @@ "string.prototype.matchall>call-bind>set-function-length": true } }, - "@lavamoat/webpack>json-stable-stringify>call-bound": { + "string.prototype.matchall>call-bound": { "packages": { "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, "string.prototype.matchall>get-intrinsic": true @@ -3339,14 +3339,14 @@ "string.prototype.matchall>define-properties>define-data-property": { "packages": { "string.prototype.matchall>call-bind>es-define-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>gopd": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>gopd": true } }, "string.prototype.matchall>define-properties": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true, "@lavamoat/webpack>json-stable-stringify>object-keys": true } }, @@ -3384,10 +3384,10 @@ "define": true } }, - "string.prototype.matchall>get-intrinsic>get-proto>dunder-proto": { + "eslint-plugin-react>es-iterator-helpers>has-proto>dunder-proto": { "packages": { "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, - "string.prototype.matchall>es-abstract>gopd": true + "string.prototype.matchall>gopd": true } }, "@toruslabs/eccrypto>elliptic": { @@ -3408,11 +3408,11 @@ "string.prototype.matchall>has-symbols": true, "browserify>util>is-arguments": true, "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-map": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-set": true, + "string.prototype.matchall>es-abstract>is-set": true, "eslint-plugin-react>array-includes>is-string": true, "@lavamoat/webpack>json-stable-stringify>isarray": true, "process": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>stop-iteration-iterator": true + "string.prototype.matchall>es-abstract>stop-iteration-iterator": true } }, "eth-lattice-keyring>gridplus-sdk>eth-eip712-util-browser": { @@ -3658,22 +3658,25 @@ "WeakRef": true }, "packages": { + "string.prototype.matchall>get-intrinsic>async-function": true, + "string.prototype.matchall>get-intrinsic>async-generator-function": true, "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, "string.prototype.matchall>call-bind>es-define-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>es-object-atoms": true, + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-object-atoms": true, "browserify>has>function-bind": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, + "string.prototype.matchall>get-intrinsic>generator-function": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, "string.prototype.matchall>has-symbols": true, - "axios>form-data>hasown": true, - "string.prototype.matchall>get-intrinsic>math-intrinsics": true + "eslint-plugin-react>hasown": true, + "eslint-plugin-react>array-includes>math-intrinsics": true } }, - "string.prototype.matchall>get-intrinsic>get-proto": { + "string.prototype.matchall>es-abstract>get-proto": { "packages": { - "string.prototype.matchall>get-intrinsic>get-proto>dunder-proto": true, - "string.prototype.matchall>es-abstract>es-object-atoms": true + "eslint-plugin-react>es-iterator-helpers>has-proto>dunder-proto": true, + "string.prototype.matchall>es-object-atoms": true } }, "eth-lattice-keyring>gridplus-sdk": { @@ -3713,12 +3716,12 @@ "eth-lattice-keyring>gridplus-sdk>uuid": true } }, - "string.prototype.matchall>es-abstract>has-property-descriptors": { + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": { "packages": { "string.prototype.matchall>call-bind>es-define-property": true } }, - "koa>is-generator-function>has-tostringtag": { + "axios>form-data>es-set-tostringtag>has-tostringtag": { "packages": { "string.prototype.matchall>has-symbols": true } @@ -3750,7 +3753,7 @@ "@toruslabs/eccrypto>elliptic>minimalistic-assert": true } }, - "axios>form-data>hasown": { + "eslint-plugin-react>hasown": { "packages": { "browserify>has>function-bind": true } @@ -3836,20 +3839,21 @@ }, "string.prototype.matchall>internal-slot": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, - "axios>form-data>hasown": true, + "string.prototype.matchall>es-errors": true, + "eslint-plugin-react>hasown": true, "string.prototype.matchall>side-channel": true } }, "browserify>util>is-arguments": { "packages": { "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-array-buffer": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>get-intrinsic": true } }, @@ -3860,8 +3864,8 @@ }, "@metamask/eth-token-tracker>deep-equal>which-boxed-primitive>is-boolean-object": { "packages": { - "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-callable": { @@ -3871,12 +3875,17 @@ }, "@metamask/eth-token-tracker>deep-equal>is-date-object": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, - "koa>is-generator-function": { + "browserify>util>is-generator-function": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>get-intrinsic>generator-function": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true, + "string.prototype.matchall>es-abstract>safe-regex-test": true } }, "@material-ui/core>@material-ui/styles>jss>is-in-browser": { @@ -3886,28 +3895,34 @@ }, "@metamask/eth-token-tracker>deep-equal>which-boxed-primitive>is-number-object": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-regex": { "packages": { - "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>gopd": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true, + "eslint-plugin-react>hasown": true } }, "string.prototype.matchall>es-abstract>is-shared-array-buffer": { "packages": { - "string.prototype.matchall>call-bind": true + "string.prototype.matchall>call-bound": true } }, "eslint-plugin-react>array-includes>is-string": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>es-to-primitive>is-symbol": { "packages": { - "string.prototype.matchall>has-symbols": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>has-symbols": true, + "string.prototype.matchall>es-abstract>safe-regex-test": true } }, "browserify>util>is-typed-array": { @@ -3917,7 +3932,7 @@ }, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakset": { "packages": { - "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>get-intrinsic": true } }, @@ -4262,7 +4277,9 @@ "gulp>vinyl-fs>object.assign": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>define-properties": true, + "string.prototype.matchall>es-object-atoms": true, "string.prototype.matchall>has-symbols": true, "@lavamoat/webpack>json-stable-stringify>object-keys": true } @@ -4519,6 +4536,14 @@ "react": true } }, + "react-compiler-runtime": { + "globals": { + "console.error": true + }, + "packages": { + "react": true + } + }, "react-dom": { "globals": { "HTMLIFrameElement": true, @@ -5008,10 +5033,10 @@ "packages": { "string.prototype.matchall>call-bind": true, "string.prototype.matchall>define-properties": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, - "string.prototype.matchall>regexp.prototype.flags>set-function-name": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, + "string.prototype.matchall>set-function-name": true } }, "react-markdown>remark-parse": { @@ -5097,6 +5122,13 @@ "browserify>buffer": true } }, + "string.prototype.matchall>es-abstract>safe-regex-test": { + "packages": { + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-abstract>is-regex": true + } + }, "react-dom>scheduler": { "globals": { "MessageChannel": true, @@ -5133,18 +5165,18 @@ "string.prototype.matchall>call-bind>set-function-length": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, - "string.prototype.matchall>es-abstract>gopd": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true + "string.prototype.matchall>gopd": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true } }, - "string.prototype.matchall>regexp.prototype.flags>set-function-name": { + "string.prototype.matchall>set-function-name": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>function.prototype.name>functions-have-names": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>set-function-name>functions-have-names": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true } }, "eth-method-registry>@metamask/ethjs-query>promise-to-callback>set-immediate-shim": { @@ -5164,22 +5196,22 @@ }, "string.prototype.matchall>side-channel>side-channel-list": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>es-abstract>object-inspect": true } }, "string.prototype.matchall>side-channel>side-channel-map": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, "string.prototype.matchall>es-abstract>object-inspect": true } }, "string.prototype.matchall>side-channel>side-channel-weakmap": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, "string.prototype.matchall>es-abstract>object-inspect": true, "string.prototype.matchall>side-channel>side-channel-map": true @@ -5187,7 +5219,7 @@ }, "string.prototype.matchall>side-channel": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>es-abstract>object-inspect": true, "string.prototype.matchall>side-channel>side-channel-list": true, "string.prototype.matchall>side-channel>side-channel-map": true, @@ -5206,11 +5238,12 @@ "@metamask/controller-utils>@spruceid/siwe-parser>valid-url": true } }, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>stop-iteration-iterator": { + "string.prototype.matchall>es-abstract>stop-iteration-iterator": { "globals": { "StopIteration": true }, "packages": { + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>internal-slot": true } }, @@ -5327,8 +5360,8 @@ }, "string.prototype.matchall>es-abstract>typed-array-buffer": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "browserify>util>is-typed-array": true } }, @@ -5450,7 +5483,7 @@ "packages": { "pumpify>inherits": true, "browserify>util>is-arguments": true, - "koa>is-generator-function": true, + "browserify>util>is-generator-function": true, "browserify>util>is-typed-array": true, "process": true, "browserify>util>which-typed-array": true @@ -5562,7 +5595,7 @@ "@metamask/eth-token-tracker>deep-equal>which-collection": { "packages": { "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-map": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-set": true, + "string.prototype.matchall>es-abstract>is-set": true, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakmap": true, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakset": true } @@ -5571,11 +5604,11 @@ "packages": { "string.prototype.matchall>es-abstract>available-typed-arrays": true, "string.prototype.matchall>call-bind": true, - "@lavamoat/webpack>json-stable-stringify>call-bound": true, + "string.prototype.matchall>call-bound": true, "browserify>util>which-typed-array>for-each": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } } } diff --git a/lavamoat/browserify/experimental/policy.json b/lavamoat/browserify/experimental/policy.json index a1040ce06a6c..768053b09e7f 100644 --- a/lavamoat/browserify/experimental/policy.json +++ b/lavamoat/browserify/experimental/policy.json @@ -2749,7 +2749,7 @@ }, "string.prototype.matchall>es-abstract>array-buffer-byte-length": { "packages": { - "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>es-abstract>is-array-buffer": true } }, @@ -3054,7 +3054,7 @@ }, "string.prototype.matchall>call-bind>call-bind-apply-helpers": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "browserify>has>function-bind": true } }, @@ -3066,7 +3066,7 @@ "string.prototype.matchall>call-bind>set-function-length": true } }, - "@lavamoat/webpack>json-stable-stringify>call-bound": { + "string.prototype.matchall>call-bound": { "packages": { "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, "string.prototype.matchall>get-intrinsic": true @@ -3339,14 +3339,14 @@ "string.prototype.matchall>define-properties>define-data-property": { "packages": { "string.prototype.matchall>call-bind>es-define-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>gopd": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>gopd": true } }, "string.prototype.matchall>define-properties": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true, "@lavamoat/webpack>json-stable-stringify>object-keys": true } }, @@ -3384,10 +3384,10 @@ "define": true } }, - "string.prototype.matchall>get-intrinsic>get-proto>dunder-proto": { + "eslint-plugin-react>es-iterator-helpers>has-proto>dunder-proto": { "packages": { "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, - "string.prototype.matchall>es-abstract>gopd": true + "string.prototype.matchall>gopd": true } }, "@toruslabs/eccrypto>elliptic": { @@ -3408,11 +3408,11 @@ "string.prototype.matchall>has-symbols": true, "browserify>util>is-arguments": true, "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-map": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-set": true, + "string.prototype.matchall>es-abstract>is-set": true, "eslint-plugin-react>array-includes>is-string": true, "@lavamoat/webpack>json-stable-stringify>isarray": true, "process": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>stop-iteration-iterator": true + "string.prototype.matchall>es-abstract>stop-iteration-iterator": true } }, "eth-lattice-keyring>gridplus-sdk>eth-eip712-util-browser": { @@ -3658,22 +3658,25 @@ "WeakRef": true }, "packages": { + "string.prototype.matchall>get-intrinsic>async-function": true, + "string.prototype.matchall>get-intrinsic>async-generator-function": true, "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, "string.prototype.matchall>call-bind>es-define-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>es-object-atoms": true, + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-object-atoms": true, "browserify>has>function-bind": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, + "string.prototype.matchall>get-intrinsic>generator-function": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, "string.prototype.matchall>has-symbols": true, - "axios>form-data>hasown": true, - "string.prototype.matchall>get-intrinsic>math-intrinsics": true + "eslint-plugin-react>hasown": true, + "eslint-plugin-react>array-includes>math-intrinsics": true } }, - "string.prototype.matchall>get-intrinsic>get-proto": { + "string.prototype.matchall>es-abstract>get-proto": { "packages": { - "string.prototype.matchall>get-intrinsic>get-proto>dunder-proto": true, - "string.prototype.matchall>es-abstract>es-object-atoms": true + "eslint-plugin-react>es-iterator-helpers>has-proto>dunder-proto": true, + "string.prototype.matchall>es-object-atoms": true } }, "eth-lattice-keyring>gridplus-sdk": { @@ -3713,12 +3716,12 @@ "eth-lattice-keyring>gridplus-sdk>uuid": true } }, - "string.prototype.matchall>es-abstract>has-property-descriptors": { + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": { "packages": { "string.prototype.matchall>call-bind>es-define-property": true } }, - "koa>is-generator-function>has-tostringtag": { + "axios>form-data>es-set-tostringtag>has-tostringtag": { "packages": { "string.prototype.matchall>has-symbols": true } @@ -3750,7 +3753,7 @@ "@toruslabs/eccrypto>elliptic>minimalistic-assert": true } }, - "axios>form-data>hasown": { + "eslint-plugin-react>hasown": { "packages": { "browserify>has>function-bind": true } @@ -3836,20 +3839,21 @@ }, "string.prototype.matchall>internal-slot": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, - "axios>form-data>hasown": true, + "string.prototype.matchall>es-errors": true, + "eslint-plugin-react>hasown": true, "string.prototype.matchall>side-channel": true } }, "browserify>util>is-arguments": { "packages": { "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-array-buffer": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>get-intrinsic": true } }, @@ -3860,8 +3864,8 @@ }, "@metamask/eth-token-tracker>deep-equal>which-boxed-primitive>is-boolean-object": { "packages": { - "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-callable": { @@ -3871,12 +3875,17 @@ }, "@metamask/eth-token-tracker>deep-equal>is-date-object": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, - "koa>is-generator-function": { + "browserify>util>is-generator-function": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>get-intrinsic>generator-function": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true, + "string.prototype.matchall>es-abstract>safe-regex-test": true } }, "@material-ui/core>@material-ui/styles>jss>is-in-browser": { @@ -3886,28 +3895,34 @@ }, "@metamask/eth-token-tracker>deep-equal>which-boxed-primitive>is-number-object": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-regex": { "packages": { - "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>gopd": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true, + "eslint-plugin-react>hasown": true } }, "string.prototype.matchall>es-abstract>is-shared-array-buffer": { "packages": { - "string.prototype.matchall>call-bind": true + "string.prototype.matchall>call-bound": true } }, "eslint-plugin-react>array-includes>is-string": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>es-to-primitive>is-symbol": { "packages": { - "string.prototype.matchall>has-symbols": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>has-symbols": true, + "string.prototype.matchall>es-abstract>safe-regex-test": true } }, "browserify>util>is-typed-array": { @@ -3917,7 +3932,7 @@ }, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakset": { "packages": { - "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>get-intrinsic": true } }, @@ -4262,7 +4277,9 @@ "gulp>vinyl-fs>object.assign": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>define-properties": true, + "string.prototype.matchall>es-object-atoms": true, "string.prototype.matchall>has-symbols": true, "@lavamoat/webpack>json-stable-stringify>object-keys": true } @@ -4519,6 +4536,14 @@ "react": true } }, + "react-compiler-runtime": { + "globals": { + "console.error": true + }, + "packages": { + "react": true + } + }, "react-dom": { "globals": { "HTMLIFrameElement": true, @@ -5008,10 +5033,10 @@ "packages": { "string.prototype.matchall>call-bind": true, "string.prototype.matchall>define-properties": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, - "string.prototype.matchall>regexp.prototype.flags>set-function-name": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, + "string.prototype.matchall>set-function-name": true } }, "react-markdown>remark-parse": { @@ -5097,6 +5122,13 @@ "browserify>buffer": true } }, + "string.prototype.matchall>es-abstract>safe-regex-test": { + "packages": { + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-abstract>is-regex": true + } + }, "react-dom>scheduler": { "globals": { "MessageChannel": true, @@ -5133,18 +5165,18 @@ "string.prototype.matchall>call-bind>set-function-length": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, - "string.prototype.matchall>es-abstract>gopd": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true + "string.prototype.matchall>gopd": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true } }, - "string.prototype.matchall>regexp.prototype.flags>set-function-name": { + "string.prototype.matchall>set-function-name": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>function.prototype.name>functions-have-names": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>set-function-name>functions-have-names": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true } }, "eth-method-registry>@metamask/ethjs-query>promise-to-callback>set-immediate-shim": { @@ -5164,22 +5196,22 @@ }, "string.prototype.matchall>side-channel>side-channel-list": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>es-abstract>object-inspect": true } }, "string.prototype.matchall>side-channel>side-channel-map": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, "string.prototype.matchall>es-abstract>object-inspect": true } }, "string.prototype.matchall>side-channel>side-channel-weakmap": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, "string.prototype.matchall>es-abstract>object-inspect": true, "string.prototype.matchall>side-channel>side-channel-map": true @@ -5187,7 +5219,7 @@ }, "string.prototype.matchall>side-channel": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>es-abstract>object-inspect": true, "string.prototype.matchall>side-channel>side-channel-list": true, "string.prototype.matchall>side-channel>side-channel-map": true, @@ -5206,11 +5238,12 @@ "@metamask/controller-utils>@spruceid/siwe-parser>valid-url": true } }, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>stop-iteration-iterator": { + "string.prototype.matchall>es-abstract>stop-iteration-iterator": { "globals": { "StopIteration": true }, "packages": { + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>internal-slot": true } }, @@ -5327,8 +5360,8 @@ }, "string.prototype.matchall>es-abstract>typed-array-buffer": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "browserify>util>is-typed-array": true } }, @@ -5450,7 +5483,7 @@ "packages": { "pumpify>inherits": true, "browserify>util>is-arguments": true, - "koa>is-generator-function": true, + "browserify>util>is-generator-function": true, "browserify>util>is-typed-array": true, "process": true, "browserify>util>which-typed-array": true @@ -5562,7 +5595,7 @@ "@metamask/eth-token-tracker>deep-equal>which-collection": { "packages": { "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-map": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-set": true, + "string.prototype.matchall>es-abstract>is-set": true, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakmap": true, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakset": true } @@ -5571,11 +5604,11 @@ "packages": { "string.prototype.matchall>es-abstract>available-typed-arrays": true, "string.prototype.matchall>call-bind": true, - "@lavamoat/webpack>json-stable-stringify>call-bound": true, + "string.prototype.matchall>call-bound": true, "browserify>util>which-typed-array>for-each": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } } } diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index a1040ce06a6c..768053b09e7f 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -2749,7 +2749,7 @@ }, "string.prototype.matchall>es-abstract>array-buffer-byte-length": { "packages": { - "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>es-abstract>is-array-buffer": true } }, @@ -3054,7 +3054,7 @@ }, "string.prototype.matchall>call-bind>call-bind-apply-helpers": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "browserify>has>function-bind": true } }, @@ -3066,7 +3066,7 @@ "string.prototype.matchall>call-bind>set-function-length": true } }, - "@lavamoat/webpack>json-stable-stringify>call-bound": { + "string.prototype.matchall>call-bound": { "packages": { "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, "string.prototype.matchall>get-intrinsic": true @@ -3339,14 +3339,14 @@ "string.prototype.matchall>define-properties>define-data-property": { "packages": { "string.prototype.matchall>call-bind>es-define-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>gopd": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>gopd": true } }, "string.prototype.matchall>define-properties": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true, "@lavamoat/webpack>json-stable-stringify>object-keys": true } }, @@ -3384,10 +3384,10 @@ "define": true } }, - "string.prototype.matchall>get-intrinsic>get-proto>dunder-proto": { + "eslint-plugin-react>es-iterator-helpers>has-proto>dunder-proto": { "packages": { "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, - "string.prototype.matchall>es-abstract>gopd": true + "string.prototype.matchall>gopd": true } }, "@toruslabs/eccrypto>elliptic": { @@ -3408,11 +3408,11 @@ "string.prototype.matchall>has-symbols": true, "browserify>util>is-arguments": true, "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-map": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-set": true, + "string.prototype.matchall>es-abstract>is-set": true, "eslint-plugin-react>array-includes>is-string": true, "@lavamoat/webpack>json-stable-stringify>isarray": true, "process": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>stop-iteration-iterator": true + "string.prototype.matchall>es-abstract>stop-iteration-iterator": true } }, "eth-lattice-keyring>gridplus-sdk>eth-eip712-util-browser": { @@ -3658,22 +3658,25 @@ "WeakRef": true }, "packages": { + "string.prototype.matchall>get-intrinsic>async-function": true, + "string.prototype.matchall>get-intrinsic>async-generator-function": true, "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, "string.prototype.matchall>call-bind>es-define-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>es-object-atoms": true, + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-object-atoms": true, "browserify>has>function-bind": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, + "string.prototype.matchall>get-intrinsic>generator-function": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, "string.prototype.matchall>has-symbols": true, - "axios>form-data>hasown": true, - "string.prototype.matchall>get-intrinsic>math-intrinsics": true + "eslint-plugin-react>hasown": true, + "eslint-plugin-react>array-includes>math-intrinsics": true } }, - "string.prototype.matchall>get-intrinsic>get-proto": { + "string.prototype.matchall>es-abstract>get-proto": { "packages": { - "string.prototype.matchall>get-intrinsic>get-proto>dunder-proto": true, - "string.prototype.matchall>es-abstract>es-object-atoms": true + "eslint-plugin-react>es-iterator-helpers>has-proto>dunder-proto": true, + "string.prototype.matchall>es-object-atoms": true } }, "eth-lattice-keyring>gridplus-sdk": { @@ -3713,12 +3716,12 @@ "eth-lattice-keyring>gridplus-sdk>uuid": true } }, - "string.prototype.matchall>es-abstract>has-property-descriptors": { + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": { "packages": { "string.prototype.matchall>call-bind>es-define-property": true } }, - "koa>is-generator-function>has-tostringtag": { + "axios>form-data>es-set-tostringtag>has-tostringtag": { "packages": { "string.prototype.matchall>has-symbols": true } @@ -3750,7 +3753,7 @@ "@toruslabs/eccrypto>elliptic>minimalistic-assert": true } }, - "axios>form-data>hasown": { + "eslint-plugin-react>hasown": { "packages": { "browserify>has>function-bind": true } @@ -3836,20 +3839,21 @@ }, "string.prototype.matchall>internal-slot": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, - "axios>form-data>hasown": true, + "string.prototype.matchall>es-errors": true, + "eslint-plugin-react>hasown": true, "string.prototype.matchall>side-channel": true } }, "browserify>util>is-arguments": { "packages": { "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-array-buffer": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>get-intrinsic": true } }, @@ -3860,8 +3864,8 @@ }, "@metamask/eth-token-tracker>deep-equal>which-boxed-primitive>is-boolean-object": { "packages": { - "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-callable": { @@ -3871,12 +3875,17 @@ }, "@metamask/eth-token-tracker>deep-equal>is-date-object": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, - "koa>is-generator-function": { + "browserify>util>is-generator-function": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>get-intrinsic>generator-function": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true, + "string.prototype.matchall>es-abstract>safe-regex-test": true } }, "@material-ui/core>@material-ui/styles>jss>is-in-browser": { @@ -3886,28 +3895,34 @@ }, "@metamask/eth-token-tracker>deep-equal>which-boxed-primitive>is-number-object": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-regex": { "packages": { - "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>gopd": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true, + "eslint-plugin-react>hasown": true } }, "string.prototype.matchall>es-abstract>is-shared-array-buffer": { "packages": { - "string.prototype.matchall>call-bind": true + "string.prototype.matchall>call-bound": true } }, "eslint-plugin-react>array-includes>is-string": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>es-to-primitive>is-symbol": { "packages": { - "string.prototype.matchall>has-symbols": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>has-symbols": true, + "string.prototype.matchall>es-abstract>safe-regex-test": true } }, "browserify>util>is-typed-array": { @@ -3917,7 +3932,7 @@ }, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakset": { "packages": { - "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>get-intrinsic": true } }, @@ -4262,7 +4277,9 @@ "gulp>vinyl-fs>object.assign": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>define-properties": true, + "string.prototype.matchall>es-object-atoms": true, "string.prototype.matchall>has-symbols": true, "@lavamoat/webpack>json-stable-stringify>object-keys": true } @@ -4519,6 +4536,14 @@ "react": true } }, + "react-compiler-runtime": { + "globals": { + "console.error": true + }, + "packages": { + "react": true + } + }, "react-dom": { "globals": { "HTMLIFrameElement": true, @@ -5008,10 +5033,10 @@ "packages": { "string.prototype.matchall>call-bind": true, "string.prototype.matchall>define-properties": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, - "string.prototype.matchall>regexp.prototype.flags>set-function-name": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, + "string.prototype.matchall>set-function-name": true } }, "react-markdown>remark-parse": { @@ -5097,6 +5122,13 @@ "browserify>buffer": true } }, + "string.prototype.matchall>es-abstract>safe-regex-test": { + "packages": { + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-abstract>is-regex": true + } + }, "react-dom>scheduler": { "globals": { "MessageChannel": true, @@ -5133,18 +5165,18 @@ "string.prototype.matchall>call-bind>set-function-length": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, - "string.prototype.matchall>es-abstract>gopd": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true + "string.prototype.matchall>gopd": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true } }, - "string.prototype.matchall>regexp.prototype.flags>set-function-name": { + "string.prototype.matchall>set-function-name": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>function.prototype.name>functions-have-names": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>set-function-name>functions-have-names": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true } }, "eth-method-registry>@metamask/ethjs-query>promise-to-callback>set-immediate-shim": { @@ -5164,22 +5196,22 @@ }, "string.prototype.matchall>side-channel>side-channel-list": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>es-abstract>object-inspect": true } }, "string.prototype.matchall>side-channel>side-channel-map": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, "string.prototype.matchall>es-abstract>object-inspect": true } }, "string.prototype.matchall>side-channel>side-channel-weakmap": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, "string.prototype.matchall>es-abstract>object-inspect": true, "string.prototype.matchall>side-channel>side-channel-map": true @@ -5187,7 +5219,7 @@ }, "string.prototype.matchall>side-channel": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>es-abstract>object-inspect": true, "string.prototype.matchall>side-channel>side-channel-list": true, "string.prototype.matchall>side-channel>side-channel-map": true, @@ -5206,11 +5238,12 @@ "@metamask/controller-utils>@spruceid/siwe-parser>valid-url": true } }, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>stop-iteration-iterator": { + "string.prototype.matchall>es-abstract>stop-iteration-iterator": { "globals": { "StopIteration": true }, "packages": { + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>internal-slot": true } }, @@ -5327,8 +5360,8 @@ }, "string.prototype.matchall>es-abstract>typed-array-buffer": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "browserify>util>is-typed-array": true } }, @@ -5450,7 +5483,7 @@ "packages": { "pumpify>inherits": true, "browserify>util>is-arguments": true, - "koa>is-generator-function": true, + "browserify>util>is-generator-function": true, "browserify>util>is-typed-array": true, "process": true, "browserify>util>which-typed-array": true @@ -5562,7 +5595,7 @@ "@metamask/eth-token-tracker>deep-equal>which-collection": { "packages": { "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-map": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-set": true, + "string.prototype.matchall>es-abstract>is-set": true, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakmap": true, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakset": true } @@ -5571,11 +5604,11 @@ "packages": { "string.prototype.matchall>es-abstract>available-typed-arrays": true, "string.prototype.matchall>call-bind": true, - "@lavamoat/webpack>json-stable-stringify>call-bound": true, + "string.prototype.matchall>call-bound": true, "browserify>util>which-typed-array>for-each": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } } } diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index a1040ce06a6c..768053b09e7f 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -2749,7 +2749,7 @@ }, "string.prototype.matchall>es-abstract>array-buffer-byte-length": { "packages": { - "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>es-abstract>is-array-buffer": true } }, @@ -3054,7 +3054,7 @@ }, "string.prototype.matchall>call-bind>call-bind-apply-helpers": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "browserify>has>function-bind": true } }, @@ -3066,7 +3066,7 @@ "string.prototype.matchall>call-bind>set-function-length": true } }, - "@lavamoat/webpack>json-stable-stringify>call-bound": { + "string.prototype.matchall>call-bound": { "packages": { "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, "string.prototype.matchall>get-intrinsic": true @@ -3339,14 +3339,14 @@ "string.prototype.matchall>define-properties>define-data-property": { "packages": { "string.prototype.matchall>call-bind>es-define-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>gopd": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>gopd": true } }, "string.prototype.matchall>define-properties": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true, "@lavamoat/webpack>json-stable-stringify>object-keys": true } }, @@ -3384,10 +3384,10 @@ "define": true } }, - "string.prototype.matchall>get-intrinsic>get-proto>dunder-proto": { + "eslint-plugin-react>es-iterator-helpers>has-proto>dunder-proto": { "packages": { "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, - "string.prototype.matchall>es-abstract>gopd": true + "string.prototype.matchall>gopd": true } }, "@toruslabs/eccrypto>elliptic": { @@ -3408,11 +3408,11 @@ "string.prototype.matchall>has-symbols": true, "browserify>util>is-arguments": true, "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-map": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-set": true, + "string.prototype.matchall>es-abstract>is-set": true, "eslint-plugin-react>array-includes>is-string": true, "@lavamoat/webpack>json-stable-stringify>isarray": true, "process": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>stop-iteration-iterator": true + "string.prototype.matchall>es-abstract>stop-iteration-iterator": true } }, "eth-lattice-keyring>gridplus-sdk>eth-eip712-util-browser": { @@ -3658,22 +3658,25 @@ "WeakRef": true }, "packages": { + "string.prototype.matchall>get-intrinsic>async-function": true, + "string.prototype.matchall>get-intrinsic>async-generator-function": true, "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, "string.prototype.matchall>call-bind>es-define-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>es-object-atoms": true, + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-object-atoms": true, "browserify>has>function-bind": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, + "string.prototype.matchall>get-intrinsic>generator-function": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, "string.prototype.matchall>has-symbols": true, - "axios>form-data>hasown": true, - "string.prototype.matchall>get-intrinsic>math-intrinsics": true + "eslint-plugin-react>hasown": true, + "eslint-plugin-react>array-includes>math-intrinsics": true } }, - "string.prototype.matchall>get-intrinsic>get-proto": { + "string.prototype.matchall>es-abstract>get-proto": { "packages": { - "string.prototype.matchall>get-intrinsic>get-proto>dunder-proto": true, - "string.prototype.matchall>es-abstract>es-object-atoms": true + "eslint-plugin-react>es-iterator-helpers>has-proto>dunder-proto": true, + "string.prototype.matchall>es-object-atoms": true } }, "eth-lattice-keyring>gridplus-sdk": { @@ -3713,12 +3716,12 @@ "eth-lattice-keyring>gridplus-sdk>uuid": true } }, - "string.prototype.matchall>es-abstract>has-property-descriptors": { + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": { "packages": { "string.prototype.matchall>call-bind>es-define-property": true } }, - "koa>is-generator-function>has-tostringtag": { + "axios>form-data>es-set-tostringtag>has-tostringtag": { "packages": { "string.prototype.matchall>has-symbols": true } @@ -3750,7 +3753,7 @@ "@toruslabs/eccrypto>elliptic>minimalistic-assert": true } }, - "axios>form-data>hasown": { + "eslint-plugin-react>hasown": { "packages": { "browserify>has>function-bind": true } @@ -3836,20 +3839,21 @@ }, "string.prototype.matchall>internal-slot": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, - "axios>form-data>hasown": true, + "string.prototype.matchall>es-errors": true, + "eslint-plugin-react>hasown": true, "string.prototype.matchall>side-channel": true } }, "browserify>util>is-arguments": { "packages": { "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-array-buffer": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>get-intrinsic": true } }, @@ -3860,8 +3864,8 @@ }, "@metamask/eth-token-tracker>deep-equal>which-boxed-primitive>is-boolean-object": { "packages": { - "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-callable": { @@ -3871,12 +3875,17 @@ }, "@metamask/eth-token-tracker>deep-equal>is-date-object": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, - "koa>is-generator-function": { + "browserify>util>is-generator-function": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>get-intrinsic>generator-function": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true, + "string.prototype.matchall>es-abstract>safe-regex-test": true } }, "@material-ui/core>@material-ui/styles>jss>is-in-browser": { @@ -3886,28 +3895,34 @@ }, "@metamask/eth-token-tracker>deep-equal>which-boxed-primitive>is-number-object": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-regex": { "packages": { - "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>gopd": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true, + "eslint-plugin-react>hasown": true } }, "string.prototype.matchall>es-abstract>is-shared-array-buffer": { "packages": { - "string.prototype.matchall>call-bind": true + "string.prototype.matchall>call-bound": true } }, "eslint-plugin-react>array-includes>is-string": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>es-to-primitive>is-symbol": { "packages": { - "string.prototype.matchall>has-symbols": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>has-symbols": true, + "string.prototype.matchall>es-abstract>safe-regex-test": true } }, "browserify>util>is-typed-array": { @@ -3917,7 +3932,7 @@ }, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakset": { "packages": { - "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>get-intrinsic": true } }, @@ -4262,7 +4277,9 @@ "gulp>vinyl-fs>object.assign": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>define-properties": true, + "string.prototype.matchall>es-object-atoms": true, "string.prototype.matchall>has-symbols": true, "@lavamoat/webpack>json-stable-stringify>object-keys": true } @@ -4519,6 +4536,14 @@ "react": true } }, + "react-compiler-runtime": { + "globals": { + "console.error": true + }, + "packages": { + "react": true + } + }, "react-dom": { "globals": { "HTMLIFrameElement": true, @@ -5008,10 +5033,10 @@ "packages": { "string.prototype.matchall>call-bind": true, "string.prototype.matchall>define-properties": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, - "string.prototype.matchall>regexp.prototype.flags>set-function-name": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, + "string.prototype.matchall>set-function-name": true } }, "react-markdown>remark-parse": { @@ -5097,6 +5122,13 @@ "browserify>buffer": true } }, + "string.prototype.matchall>es-abstract>safe-regex-test": { + "packages": { + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-abstract>is-regex": true + } + }, "react-dom>scheduler": { "globals": { "MessageChannel": true, @@ -5133,18 +5165,18 @@ "string.prototype.matchall>call-bind>set-function-length": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, - "string.prototype.matchall>es-abstract>gopd": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true + "string.prototype.matchall>gopd": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true } }, - "string.prototype.matchall>regexp.prototype.flags>set-function-name": { + "string.prototype.matchall>set-function-name": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>function.prototype.name>functions-have-names": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>set-function-name>functions-have-names": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true } }, "eth-method-registry>@metamask/ethjs-query>promise-to-callback>set-immediate-shim": { @@ -5164,22 +5196,22 @@ }, "string.prototype.matchall>side-channel>side-channel-list": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>es-abstract>object-inspect": true } }, "string.prototype.matchall>side-channel>side-channel-map": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, "string.prototype.matchall>es-abstract>object-inspect": true } }, "string.prototype.matchall>side-channel>side-channel-weakmap": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, "string.prototype.matchall>es-abstract>object-inspect": true, "string.prototype.matchall>side-channel>side-channel-map": true @@ -5187,7 +5219,7 @@ }, "string.prototype.matchall>side-channel": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>es-abstract>object-inspect": true, "string.prototype.matchall>side-channel>side-channel-list": true, "string.prototype.matchall>side-channel>side-channel-map": true, @@ -5206,11 +5238,12 @@ "@metamask/controller-utils>@spruceid/siwe-parser>valid-url": true } }, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>stop-iteration-iterator": { + "string.prototype.matchall>es-abstract>stop-iteration-iterator": { "globals": { "StopIteration": true }, "packages": { + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>internal-slot": true } }, @@ -5327,8 +5360,8 @@ }, "string.prototype.matchall>es-abstract>typed-array-buffer": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "browserify>util>is-typed-array": true } }, @@ -5450,7 +5483,7 @@ "packages": { "pumpify>inherits": true, "browserify>util>is-arguments": true, - "koa>is-generator-function": true, + "browserify>util>is-generator-function": true, "browserify>util>is-typed-array": true, "process": true, "browserify>util>which-typed-array": true @@ -5562,7 +5595,7 @@ "@metamask/eth-token-tracker>deep-equal>which-collection": { "packages": { "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-map": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-set": true, + "string.prototype.matchall>es-abstract>is-set": true, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakmap": true, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakset": true } @@ -5571,11 +5604,11 @@ "packages": { "string.prototype.matchall>es-abstract>available-typed-arrays": true, "string.prototype.matchall>call-bind": true, - "@lavamoat/webpack>json-stable-stringify>call-bound": true, + "string.prototype.matchall>call-bound": true, "browserify>util>which-typed-array>for-each": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } } } diff --git a/lavamoat/build-system/policy-override.json b/lavamoat/build-system/policy-override.json index c5e8950556e7..512734d809ab 100644 --- a/lavamoat/build-system/policy-override.json +++ b/lavamoat/build-system/policy-override.json @@ -11,7 +11,8 @@ "@babel/plugin-proposal-nullish-coalescing-operator": true, "@babel/plugin-proposal-object-rest-spread": true, "@babel/plugin-proposal-optional-chaining": true, - "@babel/preset-typescript": true + "@babel/preset-typescript": true, + "babel-plugin-react-compiler": true } }, "@babel/eslint-parser": { @@ -577,6 +578,21 @@ "process.stderr": true, "process.stdout": true } + }, + "babel-plugin-react-compiler": { + "builtin": { + "crypto": true, + "path": true, + "tty": true, + "util": true + }, + "globals": { + "process": true, + "console": true + }, + "packages": { + "@babel/core>@babel/types": true + } } } } diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index f3df2d66d4a2..497155b5ec35 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -62,6 +62,7 @@ "@babel/core>@babel/template": true, "depcheck>@babel/traverse": true, "@babel/core>@babel/types": true, + "babel-plugin-react-compiler": true, "@babel/core>convert-source-map": true, "nock>debug": true, "@babel/core>gensync": true, @@ -1408,10 +1409,13 @@ "eslint-plugin-react>array-includes": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>define-properties": true, "string.prototype.matchall>es-abstract": true, + "string.prototype.matchall>es-object-atoms": true, "string.prototype.matchall>get-intrinsic": true, - "eslint-plugin-react>array-includes>is-string": true + "eslint-plugin-react>array-includes>is-string": true, + "eslint-plugin-react>array-includes>math-intrinsics": true } }, "gulp>undertaker>bach>array-initial": { @@ -1425,6 +1429,16 @@ "gulp>undertaker>bach>array-last>is-number": true } }, + "eslint-plugin-react>array.prototype.findlast": { + "packages": { + "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>define-properties": true, + "string.prototype.matchall>es-abstract": true, + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-object-atoms": true, + "eslint-plugin-react>array.prototype.flatmap>es-shim-unscopables": true + } + }, "eslint-plugin-import>array.prototype.flat": { "packages": { "string.prototype.matchall>call-bind": true, @@ -1441,6 +1455,15 @@ "eslint-plugin-react>array.prototype.flatmap>es-shim-unscopables": true } }, + "eslint-plugin-react>array.prototype.tosorted": { + "packages": { + "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>define-properties": true, + "string.prototype.matchall>es-abstract": true, + "string.prototype.matchall>es-errors": true, + "eslint-plugin-react>array.prototype.flatmap>es-shim-unscopables": true + } + }, "gulp>glob-watcher>async-done": { "globals": { "process.nextTick": true @@ -1514,6 +1537,40 @@ "@babel/preset-env>babel-plugin-polyfill-corejs2>@babel/helper-define-polyfill-provider": true } }, + "babel-plugin-react-compiler": { + "builtin": { + "buffer": true, + "crypto": true, + "fs": true, + "os.homedir": true, + "os.release": true, + "path": true, + "tty": true, + "util": true + }, + "globals": { + "Buffer": true, + "File": true, + "TextDecoder": true, + "URL": true, + "__DEV__": true, + "atob": true, + "btoa": true, + "compile": true, + "console": true, + "define": true, + "document": true, + "findDirectiveEnablingMemoization": true, + "localStorage": true, + "navigator": true, + "performance.mark": true, + "performance.measure": true, + "process": true + }, + "packages": { + "@babel/core>@babel/types": true + } + }, "babelify": { "builtin": { "path.extname": true, @@ -1765,7 +1822,7 @@ }, "string.prototype.matchall>call-bind>call-bind-apply-helpers": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "browserify>has>function-bind": true } }, @@ -1777,7 +1834,7 @@ "string.prototype.matchall>call-bind>set-function-length": true } }, - "@lavamoat/webpack>json-stable-stringify>call-bound": { + "string.prototype.matchall>call-bound": { "packages": { "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, "string.prototype.matchall>get-intrinsic": true @@ -2302,14 +2359,14 @@ "string.prototype.matchall>define-properties>define-data-property": { "packages": { "string.prototype.matchall>call-bind>es-define-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>gopd": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>gopd": true } }, "string.prototype.matchall>define-properties": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true, "@lavamoat/webpack>json-stable-stringify>object-keys": true } }, @@ -2463,10 +2520,11 @@ "stylelint>postcss-html>htmlparser2>domelementtype": true } }, - "string.prototype.matchall>get-intrinsic>get-proto>dunder-proto": { + "eslint-plugin-react>es-iterator-helpers>has-proto>dunder-proto": { "packages": { "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, - "string.prototype.matchall>es-abstract>gopd": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>gopd": true } }, "unzipper>duplexer2": { @@ -2543,42 +2601,66 @@ "string.prototype.matchall>es-abstract": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>call-bind>es-define-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>es-object-atoms": true, + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-object-atoms": true, "axios>form-data>es-set-tostringtag": true, "string.prototype.matchall>es-abstract>es-to-primitive": true, + "string.prototype.matchall>es-abstract>function.prototype.name": true, "string.prototype.matchall>get-intrinsic": true, - "string.prototype.matchall>es-abstract>gopd": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true, - "string.prototype.matchall>es-abstract>has-proto": true, + "string.prototype.matchall>gopd": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true, + "eslint-plugin-react>es-iterator-helpers>has-proto": true, "string.prototype.matchall>has-symbols": true, - "axios>form-data>hasown": true, + "eslint-plugin-react>hasown": true, "string.prototype.matchall>internal-slot": true, "string.prototype.matchall>es-abstract>is-callable": true, "string.prototype.matchall>es-abstract>is-regex": true, "eslint-plugin-react>array-includes>is-string": true, + "eslint-plugin-react>array-includes>math-intrinsics": true, "string.prototype.matchall>es-abstract>object-inspect": true, "string.prototype.matchall>es-abstract>safe-regex-test": true, + "string.prototype.matchall>es-abstract>set-proto": true, "string.prototype.matchall>es-abstract>string.prototype.trim": true } }, - "string.prototype.matchall>es-abstract>es-object-atoms": { + "eslint-plugin-react>es-iterator-helpers": { + "globals": { + "Iterator": true + }, + "packages": { + "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>define-properties": true, + "string.prototype.matchall>es-abstract": true, + "string.prototype.matchall>es-errors": true, + "axios>form-data>es-set-tostringtag": true, + "string.prototype.matchall>get-intrinsic": true, + "eslint-plugin-react>es-iterator-helpers>globalthis": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true, + "eslint-plugin-react>es-iterator-helpers>has-proto": true, + "string.prototype.matchall>internal-slot": true, + "eslint-plugin-react>es-iterator-helpers>iterator.prototype": true, + "eslint-plugin-react>es-iterator-helpers>safe-array-concat": true + } + }, + "string.prototype.matchall>es-object-atoms": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true + "string.prototype.matchall>es-errors": true } }, "axios>form-data>es-set-tostringtag": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, - "koa>is-generator-function>has-tostringtag": true, - "axios>form-data>hasown": true + "axios>form-data>es-set-tostringtag>has-tostringtag": true, + "eslint-plugin-react>hasown": true } }, "eslint-plugin-react>array.prototype.flatmap>es-shim-unscopables": { "packages": { - "browserify>has": true + "eslint-plugin-react>hasown": true } }, "string.prototype.matchall>es-abstract>es-to-primitive": { @@ -2774,7 +2856,7 @@ "depcheck>is-core-module": true, "del>is-glob": true, "eslint>minimatch": true, - "eslint-plugin-react>object.values": true, + "eslint-plugin-import>object.values": true, "eslint-plugin-import>tsconfig-paths": true, "typescript": true } @@ -2847,25 +2929,30 @@ "globals": { "console.error": true, "console.log": true, + "console.warn": true, "process.argv.join": true, "process.cwd": true }, "packages": { "eslint-plugin-react>array-includes": true, + "eslint-plugin-react>array.prototype.findlast": true, "eslint-plugin-react>array.prototype.flatmap": true, + "eslint-plugin-react>array.prototype.tosorted": true, "eslint-plugin-react>doctrine": true, + "eslint-plugin-react>es-iterator-helpers": true, "eslint": true, "eslint-plugin-react>estraverse": true, + "eslint-plugin-react>hasown": true, "eslint-plugin-react>jsx-ast-utils": true, "eslint>minimatch": true, "eslint-plugin-react>object.entries": true, "eslint-plugin-react>object.fromentries": true, - "eslint-plugin-react>object.hasown": true, "eslint-plugin-react>object.values": true, "prop-types": true, "eslint-plugin-react>resolve": true, "eslint-plugin-react>semver": true, - "string.prototype.matchall": true + "string.prototype.matchall": true, + "eslint-plugin-react>string.prototype.repeat": true } }, "eslint-plugin-react-hooks": { @@ -3411,6 +3498,19 @@ "gulp-watch>chokidar>fsevents>node-pre-gyp": true } }, + "string.prototype.matchall>es-abstract>function.prototype.name": { + "globals": { + "document": true + }, + "packages": { + "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>define-properties": true, + "string.prototype.matchall>set-function-name>functions-have-names": true, + "eslint-plugin-react>hasown": true, + "string.prototype.matchall>es-abstract>is-callable": true + } + }, "@lavamoat/allow-scripts>@npmcli/run-script>node-gyp>npmlog>gauge": { "builtin": { "util.format": true @@ -3445,22 +3545,25 @@ "WeakRef": true }, "packages": { + "string.prototype.matchall>get-intrinsic>async-function": true, + "string.prototype.matchall>get-intrinsic>async-generator-function": true, "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, "string.prototype.matchall>call-bind>es-define-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>es-object-atoms": true, + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-object-atoms": true, "browserify>has>function-bind": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, + "string.prototype.matchall>get-intrinsic>generator-function": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, "string.prototype.matchall>has-symbols": true, - "axios>form-data>hasown": true, - "string.prototype.matchall>get-intrinsic>math-intrinsics": true + "eslint-plugin-react>hasown": true, + "eslint-plugin-react>array-includes>math-intrinsics": true } }, - "string.prototype.matchall>get-intrinsic>get-proto": { + "string.prototype.matchall>es-abstract>get-proto": { "packages": { - "string.prototype.matchall>get-intrinsic>get-proto>dunder-proto": true, - "string.prototype.matchall>es-abstract>es-object-atoms": true + "eslint-plugin-react>es-iterator-helpers>has-proto>dunder-proto": true, + "string.prototype.matchall>es-object-atoms": true } }, "gulp-zip>get-stream": { @@ -3582,6 +3685,12 @@ "stylelint>global-modules>global-prefix>which": true } }, + "eslint-plugin-react>es-iterator-helpers>globalthis": { + "packages": { + "string.prototype.matchall>define-properties": true, + "string.prototype.matchall>gopd": true + } + }, "globby": { "builtin": { "fs.Stats": true, @@ -3815,12 +3924,12 @@ "process.argv": true } }, - "string.prototype.matchall>es-abstract>has-property-descriptors": { + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": { "packages": { "string.prototype.matchall>call-bind>es-define-property": true } }, - "koa>is-generator-function>has-tostringtag": { + "axios>form-data>es-set-tostringtag>has-tostringtag": { "packages": { "string.prototype.matchall>has-symbols": true } @@ -3860,7 +3969,7 @@ "browserify>has>function-bind": true } }, - "axios>form-data>hasown": { + "eslint-plugin-react>hasown": { "packages": { "browserify>has>function-bind": true } @@ -3964,8 +4073,8 @@ }, "string.prototype.matchall>internal-slot": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, - "axios>form-data>hasown": true, + "string.prototype.matchall>es-errors": true, + "eslint-plugin-react>hasown": true, "string.prototype.matchall>side-channel": true } }, @@ -4014,7 +4123,7 @@ "process.versions": true }, "packages": { - "axios>form-data>hasown": true + "eslint-plugin-react>hasown": true } }, "gulp>glob-watcher>anymatch>micromatch>extglob>expand-brackets>define-property>is-descriptor>is-data-descriptor": { @@ -4034,7 +4143,8 @@ }, "@metamask/eth-token-tracker>deep-equal>is-date-object": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "gulp>glob-watcher>anymatch>micromatch>extglob>expand-brackets>define-property>is-descriptor": { @@ -4136,8 +4246,10 @@ }, "string.prototype.matchall>es-abstract>is-regex": { "packages": { - "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>gopd": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true, + "eslint-plugin-react>hasown": true } }, "gulp>gulp-cli>replace-homedir>is-absolute>is-relative": { @@ -4147,12 +4259,15 @@ }, "eslint-plugin-react>array-includes>is-string": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>es-to-primitive>is-symbol": { "packages": { - "string.prototype.matchall>has-symbols": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>has-symbols": true, + "string.prototype.matchall>es-abstract>safe-regex-test": true } }, "gulp>gulp-cli>replace-homedir>is-absolute>is-relative>is-unc-path": { @@ -4198,6 +4313,16 @@ "gulp>gulp-cli>matchdep>micromatch>snapdragon>base>cache-base>unset-value>has-value>isobject>isarray": true } }, + "eslint-plugin-react>es-iterator-helpers>iterator.prototype": { + "packages": { + "string.prototype.matchall>define-properties>define-data-property": true, + "string.prototype.matchall>es-object-atoms": true, + "string.prototype.matchall>get-intrinsic": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>has-symbols": true, + "string.prototype.matchall>set-function-name": true + } + }, "tailwindcss>jiti": { "builtin": { "assert": true, @@ -4252,7 +4377,7 @@ "@lavamoat/webpack>json-stable-stringify": { "packages": { "string.prototype.matchall>call-bind": true, - "@lavamoat/webpack>json-stable-stringify>call-bound": true, + "string.prototype.matchall>call-bound": true, "@lavamoat/webpack>json-stable-stringify>isarray": true, "@lavamoat/webpack>json-stable-stringify>jsonify": true, "@lavamoat/webpack>json-stable-stringify>object-keys": true @@ -4904,7 +5029,9 @@ "gulp>vinyl-fs>object.assign": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>define-properties": true, + "string.prototype.matchall>es-object-atoms": true, "string.prototype.matchall>has-symbols": true, "@lavamoat/webpack>json-stable-stringify>object-keys": true } @@ -4920,20 +5047,17 @@ "eslint-plugin-react>object.entries": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>define-properties": true, - "string.prototype.matchall>es-abstract": true + "string.prototype.matchall>es-object-atoms": true } }, "eslint-plugin-react>object.fromentries": { "packages": { "string.prototype.matchall>call-bind": true, "string.prototype.matchall>define-properties": true, - "string.prototype.matchall>es-abstract": true - } - }, - "eslint-plugin-react>object.hasown": { - "packages": { - "string.prototype.matchall>es-abstract": true + "string.prototype.matchall>es-abstract": true, + "string.prototype.matchall>es-object-atoms": true } }, "gulp-watch>anymatch>micromatch>object.omit": { @@ -4953,6 +5077,14 @@ "gulp>undertaker>arr-map>make-iterator": true } }, + "eslint-plugin-react>object.values": { + "packages": { + "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>define-properties": true, + "string.prototype.matchall>es-object-atoms": true + } + }, "@metamask/object-multiplex>once": { "packages": { "@metamask/object-multiplex>once>wrappy": true @@ -6486,10 +6618,10 @@ "packages": { "string.prototype.matchall>call-bind": true, "string.prototype.matchall>define-properties": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, - "string.prototype.matchall>regexp.prototype.flags>set-function-name": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, + "string.prototype.matchall>set-function-name": true } }, "@babel/preset-env>@babel/plugin-transform-dotall-regex>@babel/helper-create-regexp-features-plugin>regexpu-core": { @@ -6774,6 +6906,15 @@ "setTimeout.apply": true } }, + "eslint-plugin-react>es-iterator-helpers>safe-array-concat": { + "packages": { + "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>get-intrinsic": true, + "string.prototype.matchall>has-symbols": true, + "@lavamoat/webpack>json-stable-stringify>isarray": true + } + }, "koa>content-disposition>safe-buffer": { "builtin": { "buffer": true @@ -6931,8 +7072,8 @@ }, "string.prototype.matchall>es-abstract>safe-regex-test": { "packages": { - "string.prototype.matchall>call-bind": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>es-abstract>is-regex": true } }, @@ -7072,18 +7213,25 @@ "string.prototype.matchall>call-bind>set-function-length": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, - "string.prototype.matchall>es-abstract>gopd": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true + "string.prototype.matchall>gopd": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true } }, - "string.prototype.matchall>regexp.prototype.flags>set-function-name": { + "string.prototype.matchall>set-function-name": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>function.prototype.name>functions-have-names": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>set-function-name>functions-have-names": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true + } + }, + "string.prototype.matchall>es-abstract>set-proto": { + "packages": { + "eslint-plugin-react>es-iterator-helpers>has-proto>dunder-proto": true, + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-object-atoms": true } }, "gulp>gulp-cli>matchdep>micromatch>snapdragon>base>cache-base>set-value": { @@ -7115,22 +7263,22 @@ }, "string.prototype.matchall>side-channel>side-channel-list": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>es-abstract>object-inspect": true } }, "string.prototype.matchall>side-channel>side-channel-map": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, "string.prototype.matchall>es-abstract>object-inspect": true } }, "string.prototype.matchall>side-channel>side-channel-weakmap": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, "string.prototype.matchall>es-abstract>object-inspect": true, "string.prototype.matchall>side-channel>side-channel-map": true @@ -7138,7 +7286,7 @@ }, "string.prototype.matchall>side-channel": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>es-abstract>object-inspect": true, "string.prototype.matchall>side-channel>side-channel-list": true, "string.prototype.matchall>side-channel>side-channel-map": true, @@ -7349,18 +7497,33 @@ "string.prototype.matchall": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>define-properties": true, "string.prototype.matchall>es-abstract": true, + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-object-atoms": true, + "string.prototype.matchall>get-intrinsic": true, + "string.prototype.matchall>gopd": true, "string.prototype.matchall>has-symbols": true, - "string.prototype.matchall>regexp.prototype.flags": true + "string.prototype.matchall>regexp.prototype.flags": true, + "string.prototype.matchall>set-function-name": true + } + }, + "eslint-plugin-react>string.prototype.repeat": { + "packages": { + "string.prototype.matchall>define-properties": true, + "string.prototype.matchall>es-abstract": true } }, "string.prototype.matchall>es-abstract>string.prototype.trim": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>define-properties>define-data-property": true, "string.prototype.matchall>define-properties": true, "string.prototype.matchall>es-abstract": true, - "string.prototype.matchall>es-abstract>es-object-atoms": true + "string.prototype.matchall>es-object-atoms": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true } }, "browserify>string_decoder": { diff --git a/lavamoat/webpack/mv2/policy.json b/lavamoat/webpack/mv2/policy.json index 279f53d62340..7180f9e67979 100644 --- a/lavamoat/webpack/mv2/policy.json +++ b/lavamoat/webpack/mv2/policy.json @@ -2996,7 +2996,7 @@ }, "string.prototype.matchall>es-abstract>array-buffer-byte-length": { "packages": { - "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>es-abstract>is-array-buffer": true } }, @@ -3345,7 +3345,7 @@ }, "string.prototype.matchall>call-bind>call-bind-apply-helpers": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "browserify>has>function-bind": true } }, @@ -3357,7 +3357,7 @@ "string.prototype.matchall>call-bind>set-function-length": true } }, - "@lavamoat/webpack>json-stable-stringify>call-bound": { + "string.prototype.matchall>call-bound": { "packages": { "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, "string.prototype.matchall>get-intrinsic": true @@ -3661,14 +3661,14 @@ "string.prototype.matchall>define-properties>define-data-property": { "packages": { "string.prototype.matchall>call-bind>es-define-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>gopd": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>gopd": true } }, "string.prototype.matchall>define-properties": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true, "@lavamoat/webpack>json-stable-stringify>object-keys": true } }, @@ -3694,10 +3694,10 @@ "console.warn": true } }, - "string.prototype.matchall>get-intrinsic>get-proto>dunder-proto": { + "eslint-plugin-react>es-iterator-helpers>has-proto>dunder-proto": { "packages": { "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, - "string.prototype.matchall>es-abstract>gopd": true + "string.prototype.matchall>gopd": true } }, "@toruslabs/eccrypto>elliptic": { @@ -3721,11 +3721,11 @@ "string.prototype.matchall>has-symbols": true, "browserify>util>is-arguments": true, "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-map": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-set": true, + "string.prototype.matchall>es-abstract>is-set": true, "eslint-plugin-react>array-includes>is-string": true, "@lavamoat/webpack>json-stable-stringify>isarray": true, "process": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>stop-iteration-iterator": true + "string.prototype.matchall>es-abstract>stop-iteration-iterator": true } }, "eth-lattice-keyring>gridplus-sdk>eth-eip712-util-browser": { @@ -3986,16 +3986,19 @@ "WeakRef": true }, "packages": { + "string.prototype.matchall>get-intrinsic>async-function": true, + "string.prototype.matchall>get-intrinsic>async-generator-function": true, "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, "string.prototype.matchall>call-bind>es-define-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>es-object-atoms": true, + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-object-atoms": true, "browserify>has>function-bind": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, + "string.prototype.matchall>get-intrinsic>generator-function": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, "string.prototype.matchall>has-symbols": true, - "axios>form-data>hasown": true, - "string.prototype.matchall>get-intrinsic>math-intrinsics": true + "eslint-plugin-react>hasown": true, + "eslint-plugin-react>array-includes>math-intrinsics": true } }, "remote-redux-devtools>redux-devtools-core>get-params": { @@ -4003,10 +4006,10 @@ "GetParams": "write" } }, - "string.prototype.matchall>get-intrinsic>get-proto": { + "string.prototype.matchall>es-abstract>get-proto": { "packages": { - "string.prototype.matchall>get-intrinsic>get-proto>dunder-proto": true, - "string.prototype.matchall>es-abstract>es-object-atoms": true + "eslint-plugin-react>es-iterator-helpers>has-proto>dunder-proto": true, + "string.prototype.matchall>es-object-atoms": true } }, "eth-lattice-keyring>gridplus-sdk": { @@ -4049,12 +4052,12 @@ "eth-lattice-keyring>gridplus-sdk>uuid": true } }, - "string.prototype.matchall>es-abstract>has-property-descriptors": { + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": { "packages": { "string.prototype.matchall>call-bind>es-define-property": true } }, - "koa>is-generator-function>has-tostringtag": { + "axios>form-data>es-set-tostringtag>has-tostringtag": { "packages": { "string.prototype.matchall>has-symbols": true } @@ -4089,7 +4092,7 @@ "@toruslabs/eccrypto>elliptic>minimalistic-assert": true } }, - "axios>form-data>hasown": { + "eslint-plugin-react>hasown": { "packages": { "browserify>has>function-bind": true } @@ -4168,20 +4171,21 @@ }, "string.prototype.matchall>internal-slot": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, - "axios>form-data>hasown": true, + "string.prototype.matchall>es-errors": true, + "eslint-plugin-react>hasown": true, "string.prototype.matchall>side-channel": true } }, "browserify>util>is-arguments": { "packages": { "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-array-buffer": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>get-intrinsic": true } }, @@ -4192,8 +4196,8 @@ }, "@metamask/eth-token-tracker>deep-equal>which-boxed-primitive>is-boolean-object": { "packages": { - "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-callable": { @@ -4203,12 +4207,17 @@ }, "@metamask/eth-token-tracker>deep-equal>is-date-object": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, - "koa>is-generator-function": { + "browserify>util>is-generator-function": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>get-intrinsic>generator-function": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true, + "string.prototype.matchall>es-abstract>safe-regex-test": true } }, "@material-ui/core>@material-ui/styles>jss>is-in-browser": { @@ -4224,28 +4233,34 @@ }, "@metamask/eth-token-tracker>deep-equal>which-boxed-primitive>is-number-object": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-regex": { "packages": { - "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>gopd": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true, + "eslint-plugin-react>hasown": true } }, "string.prototype.matchall>es-abstract>is-shared-array-buffer": { "packages": { - "string.prototype.matchall>call-bind": true + "string.prototype.matchall>call-bound": true } }, "eslint-plugin-react>array-includes>is-string": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>es-to-primitive>is-symbol": { "packages": { - "string.prototype.matchall>has-symbols": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>has-symbols": true, + "string.prototype.matchall>es-abstract>safe-regex-test": true } }, "browserify>util>is-typed-array": { @@ -4255,7 +4270,7 @@ }, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakset": { "packages": { - "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>get-intrinsic": true } }, @@ -4602,7 +4617,9 @@ "gulp>vinyl-fs>object.assign": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>define-properties": true, + "string.prototype.matchall>es-object-atoms": true, "string.prototype.matchall>has-symbols": true, "@lavamoat/webpack>json-stable-stringify>object-keys": true } @@ -5420,10 +5437,10 @@ "packages": { "string.prototype.matchall>call-bind": true, "string.prototype.matchall>define-properties": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, - "string.prototype.matchall>regexp.prototype.flags>set-function-name": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, + "string.prototype.matchall>set-function-name": true } }, "react-markdown>remark-parse": { @@ -5542,6 +5559,13 @@ "buffer": true } }, + "string.prototype.matchall>es-abstract>safe-regex-test": { + "packages": { + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-abstract>is-regex": true + } + }, "remote-redux-devtools>socketcluster-client>sc-channel": { "packages": { "remote-redux-devtools>socketcluster-client>sc-channel>component-emitter": true @@ -5590,18 +5614,18 @@ "string.prototype.matchall>call-bind>set-function-length": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, - "string.prototype.matchall>es-abstract>gopd": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true + "string.prototype.matchall>gopd": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true } }, - "string.prototype.matchall>regexp.prototype.flags>set-function-name": { + "string.prototype.matchall>set-function-name": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>function.prototype.name>functions-have-names": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>set-function-name>functions-have-names": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true } }, "eth-method-registry>@metamask/ethjs-query>promise-to-callback>set-immediate-shim": { @@ -5622,22 +5646,22 @@ }, "string.prototype.matchall>side-channel>side-channel-list": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>es-abstract>object-inspect": true } }, "string.prototype.matchall>side-channel>side-channel-map": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, "string.prototype.matchall>es-abstract>object-inspect": true } }, "string.prototype.matchall>side-channel>side-channel-weakmap": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, "string.prototype.matchall>es-abstract>object-inspect": true, "string.prototype.matchall>side-channel>side-channel-map": true @@ -5645,7 +5669,7 @@ }, "string.prototype.matchall>side-channel": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>es-abstract>object-inspect": true, "string.prototype.matchall>side-channel>side-channel-list": true, "string.prototype.matchall>side-channel>side-channel-map": true, @@ -5687,11 +5711,12 @@ "remote-redux-devtools>socketcluster-client>uuid": true } }, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>stop-iteration-iterator": { + "string.prototype.matchall>es-abstract>stop-iteration-iterator": { "globals": { "StopIteration": true }, "packages": { + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>internal-slot": true } }, @@ -5795,8 +5820,8 @@ }, "string.prototype.matchall>es-abstract>typed-array-buffer": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "browserify>util>is-typed-array": true } }, @@ -5901,7 +5926,7 @@ "packages": { "pumpify>inherits": true, "browserify>util>is-arguments": true, - "koa>is-generator-function": true, + "browserify>util>is-generator-function": true, "browserify>util>is-typed-array": true, "process": true, "browserify>util>which-typed-array": true @@ -6009,7 +6034,7 @@ "@metamask/eth-token-tracker>deep-equal>which-collection": { "packages": { "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-map": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-set": true, + "string.prototype.matchall>es-abstract>is-set": true, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakmap": true, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakset": true } @@ -6018,11 +6043,11 @@ "packages": { "string.prototype.matchall>es-abstract>available-typed-arrays": true, "string.prototype.matchall>call-bind": true, - "@lavamoat/webpack>json-stable-stringify>call-bound": true, + "string.prototype.matchall>call-bound": true, "browserify>util>which-typed-array>for-each": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } } } diff --git a/lavamoat/webpack/mv3/policy.json b/lavamoat/webpack/mv3/policy.json index f87c76ca3ae4..e0773b136e2f 100644 --- a/lavamoat/webpack/mv3/policy.json +++ b/lavamoat/webpack/mv3/policy.json @@ -1895,7 +1895,7 @@ }, "string.prototype.matchall>es-abstract>array-buffer-byte-length": { "packages": { - "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>es-abstract>is-array-buffer": true } }, @@ -2096,7 +2096,7 @@ }, "string.prototype.matchall>call-bind>call-bind-apply-helpers": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "browserify>has>function-bind": true } }, @@ -2108,7 +2108,7 @@ "string.prototype.matchall>call-bind>set-function-length": true } }, - "@lavamoat/webpack>json-stable-stringify>call-bound": { + "string.prototype.matchall>call-bound": { "packages": { "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, "string.prototype.matchall>get-intrinsic": true @@ -2377,14 +2377,14 @@ "string.prototype.matchall>define-properties>define-data-property": { "packages": { "string.prototype.matchall>call-bind>es-define-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>gopd": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>gopd": true } }, "string.prototype.matchall>define-properties": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true, "@lavamoat/webpack>json-stable-stringify>object-keys": true } }, @@ -2410,10 +2410,10 @@ "console.warn": true } }, - "string.prototype.matchall>get-intrinsic>get-proto>dunder-proto": { + "eslint-plugin-react>es-iterator-helpers>has-proto>dunder-proto": { "packages": { "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, - "string.prototype.matchall>es-abstract>gopd": true + "string.prototype.matchall>gopd": true } }, "@toruslabs/eccrypto>elliptic": { @@ -2437,11 +2437,11 @@ "string.prototype.matchall>has-symbols": true, "browserify>util>is-arguments": true, "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-map": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-set": true, + "string.prototype.matchall>es-abstract>is-set": true, "eslint-plugin-react>array-includes>is-string": true, "@lavamoat/webpack>json-stable-stringify>isarray": true, "process": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>stop-iteration-iterator": true + "string.prototype.matchall>es-abstract>stop-iteration-iterator": true } }, "eth-ens-namehash": { @@ -2641,16 +2641,19 @@ "WeakRef": true }, "packages": { + "string.prototype.matchall>get-intrinsic>async-function": true, + "string.prototype.matchall>get-intrinsic>async-generator-function": true, "string.prototype.matchall>call-bind>call-bind-apply-helpers": true, "string.prototype.matchall>call-bind>es-define-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>es-object-atoms": true, + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-object-atoms": true, "browserify>has>function-bind": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, + "string.prototype.matchall>get-intrinsic>generator-function": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, "string.prototype.matchall>has-symbols": true, - "axios>form-data>hasown": true, - "string.prototype.matchall>get-intrinsic>math-intrinsics": true + "eslint-plugin-react>hasown": true, + "eslint-plugin-react>array-includes>math-intrinsics": true } }, "remote-redux-devtools>redux-devtools-core>get-params": { @@ -2658,18 +2661,18 @@ "GetParams": "write" } }, - "string.prototype.matchall>get-intrinsic>get-proto": { + "string.prototype.matchall>es-abstract>get-proto": { "packages": { - "string.prototype.matchall>get-intrinsic>get-proto>dunder-proto": true, - "string.prototype.matchall>es-abstract>es-object-atoms": true + "eslint-plugin-react>es-iterator-helpers>has-proto>dunder-proto": true, + "string.prototype.matchall>es-object-atoms": true } }, - "string.prototype.matchall>es-abstract>has-property-descriptors": { + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": { "packages": { "string.prototype.matchall>call-bind>es-define-property": true } }, - "koa>is-generator-function>has-tostringtag": { + "axios>form-data>es-set-tostringtag>has-tostringtag": { "packages": { "string.prototype.matchall>has-symbols": true } @@ -2704,7 +2707,7 @@ "@toruslabs/eccrypto>elliptic>minimalistic-assert": true } }, - "axios>form-data>hasown": { + "eslint-plugin-react>hasown": { "packages": { "browserify>has>function-bind": true } @@ -2770,20 +2773,21 @@ }, "string.prototype.matchall>internal-slot": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, - "axios>form-data>hasown": true, + "string.prototype.matchall>es-errors": true, + "eslint-plugin-react>hasown": true, "string.prototype.matchall>side-channel": true } }, "browserify>util>is-arguments": { "packages": { "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-array-buffer": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>get-intrinsic": true } }, @@ -2794,8 +2798,8 @@ }, "@metamask/eth-token-tracker>deep-equal>which-boxed-primitive>is-boolean-object": { "packages": { - "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-callable": { @@ -2805,12 +2809,17 @@ }, "@metamask/eth-token-tracker>deep-equal>is-date-object": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, - "koa>is-generator-function": { + "browserify>util>is-generator-function": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>get-intrinsic>generator-function": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true, + "string.prototype.matchall>es-abstract>safe-regex-test": true } }, "@material-ui/core>@material-ui/styles>jss>is-in-browser": { @@ -2826,28 +2835,34 @@ }, "@metamask/eth-token-tracker>deep-equal>which-boxed-primitive>is-number-object": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>is-regex": { "packages": { - "string.prototype.matchall>call-bind": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>gopd": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true, + "eslint-plugin-react>hasown": true } }, "string.prototype.matchall>es-abstract>is-shared-array-buffer": { "packages": { - "string.prototype.matchall>call-bind": true + "string.prototype.matchall>call-bound": true } }, "eslint-plugin-react>array-includes>is-string": { "packages": { - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>call-bound": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } }, "string.prototype.matchall>es-abstract>es-to-primitive>is-symbol": { "packages": { - "string.prototype.matchall>has-symbols": true + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>has-symbols": true, + "string.prototype.matchall>es-abstract>safe-regex-test": true } }, "browserify>util>is-typed-array": { @@ -2857,7 +2872,7 @@ }, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakset": { "packages": { - "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>get-intrinsic": true } }, @@ -3132,7 +3147,9 @@ "gulp>vinyl-fs>object.assign": { "packages": { "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>call-bound": true, "string.prototype.matchall>define-properties": true, + "string.prototype.matchall>es-object-atoms": true, "string.prototype.matchall>has-symbols": true, "@lavamoat/webpack>json-stable-stringify>object-keys": true } @@ -3895,10 +3912,10 @@ "packages": { "string.prototype.matchall>call-bind": true, "string.prototype.matchall>define-properties": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, - "string.prototype.matchall>regexp.prototype.flags>set-function-name": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, + "string.prototype.matchall>set-function-name": true } }, "react-markdown>remark-parse": { @@ -3998,6 +4015,13 @@ "buffer": true } }, + "string.prototype.matchall>es-abstract>safe-regex-test": { + "packages": { + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>es-abstract>is-regex": true + } + }, "remote-redux-devtools>socketcluster-client>sc-channel": { "packages": { "remote-redux-devtools>socketcluster-client>sc-channel>component-emitter": true @@ -4046,18 +4070,18 @@ "string.prototype.matchall>call-bind>set-function-length": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, - "string.prototype.matchall>es-abstract>gopd": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true + "string.prototype.matchall>gopd": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true } }, - "string.prototype.matchall>regexp.prototype.flags>set-function-name": { + "string.prototype.matchall>set-function-name": { "packages": { "string.prototype.matchall>define-properties>define-data-property": true, - "string.prototype.matchall>es-abstract>es-errors": true, - "string.prototype.matchall>es-abstract>function.prototype.name>functions-have-names": true, - "string.prototype.matchall>es-abstract>has-property-descriptors": true + "string.prototype.matchall>es-errors": true, + "string.prototype.matchall>set-function-name>functions-have-names": true, + "eslint-plugin-react>es-iterator-helpers>has-property-descriptors": true } }, "eth-method-registry>@metamask/ethjs-query>promise-to-callback>set-immediate-shim": { @@ -4078,22 +4102,22 @@ }, "string.prototype.matchall>side-channel>side-channel-list": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>es-abstract>object-inspect": true } }, "string.prototype.matchall>side-channel>side-channel-map": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, "string.prototype.matchall>es-abstract>object-inspect": true } }, "string.prototype.matchall>side-channel>side-channel-weakmap": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>get-intrinsic": true, "string.prototype.matchall>es-abstract>object-inspect": true, "string.prototype.matchall>side-channel>side-channel-map": true @@ -4101,7 +4125,7 @@ }, "string.prototype.matchall>side-channel": { "packages": { - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>es-abstract>object-inspect": true, "string.prototype.matchall>side-channel>side-channel-list": true, "string.prototype.matchall>side-channel>side-channel-map": true, @@ -4131,11 +4155,12 @@ "remote-redux-devtools>socketcluster-client>uuid": true } }, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>stop-iteration-iterator": { + "string.prototype.matchall>es-abstract>stop-iteration-iterator": { "globals": { "StopIteration": true }, "packages": { + "string.prototype.matchall>es-errors": true, "string.prototype.matchall>internal-slot": true } }, @@ -4225,8 +4250,8 @@ }, "string.prototype.matchall>es-abstract>typed-array-buffer": { "packages": { - "@lavamoat/webpack>json-stable-stringify>call-bound": true, - "string.prototype.matchall>es-abstract>es-errors": true, + "string.prototype.matchall>call-bound": true, + "string.prototype.matchall>es-errors": true, "browserify>util>is-typed-array": true } }, @@ -4304,7 +4329,7 @@ "packages": { "pumpify>inherits": true, "browserify>util>is-arguments": true, - "koa>is-generator-function": true, + "browserify>util>is-generator-function": true, "browserify>util>is-typed-array": true, "process": true, "browserify>util>which-typed-array": true @@ -4381,7 +4406,7 @@ "@metamask/eth-token-tracker>deep-equal>which-collection": { "packages": { "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-map": true, - "@metamask/eth-token-tracker>deep-equal>es-get-iterator>is-set": true, + "string.prototype.matchall>es-abstract>is-set": true, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakmap": true, "@metamask/eth-token-tracker>deep-equal>which-collection>is-weakset": true } @@ -4390,11 +4415,11 @@ "packages": { "string.prototype.matchall>es-abstract>available-typed-arrays": true, "string.prototype.matchall>call-bind": true, - "@lavamoat/webpack>json-stable-stringify>call-bound": true, + "string.prototype.matchall>call-bound": true, "browserify>util>which-typed-array>for-each": true, - "string.prototype.matchall>get-intrinsic>get-proto": true, - "string.prototype.matchall>es-abstract>gopd": true, - "koa>is-generator-function>has-tostringtag": true + "string.prototype.matchall>es-abstract>get-proto": true, + "string.prototype.matchall>gopd": true, + "axios>form-data>es-set-tostringtag>has-tostringtag": true } } } diff --git a/package.json b/package.json index 11f82d2e138c..92df2f261704 100644 --- a/package.json +++ b/package.json @@ -434,6 +434,7 @@ "react": "^17.0.2", "react-beautiful-dnd": "^13.1.1", "react-chartjs-2": "^5.2.0", + "react-compiler-runtime": "^1.0.0", "react-dom": "^17.0.2", "react-focus-lock": "^2.9.4", "react-idle-timer": "4.5.6", @@ -582,6 +583,7 @@ "addons-linter": "^6.28.0", "autoprefixer": "^10.4.19", "axios": "^1.12.0", + "babel-plugin-react-compiler": "^1.0.0", "babelify": "^10.0.0", "bify-module-groups": "^2.0.0", "browserify": "^17.0.0", @@ -613,8 +615,9 @@ "eslint-plugin-mocha": "^10.1.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^5.5.1", - "eslint-plugin-react": "^7.23.1", - "eslint-plugin-react-hooks": "^4.2.0", + "eslint-plugin-react": "^7.37.5", + "eslint-plugin-react-compiler": "19.1.0-rc.2", + "eslint-plugin-react-hooks": "^5.2.0", "eslint-plugin-storybook": "^0.6.15", "eslint-plugin-tailwindcss": "^3.18.0", "eta": "^3.2.0", @@ -650,7 +653,7 @@ "jsdom": "^16.7.0", "json-schema-to-ts": "^3.0.1", "jsonwebtoken": "^9.0.2", - "koa": "^2.7.0", + "koa": "^3.1.1", "lavamoat": "^10.0.0", "lavamoat-viz": "^7.0.5", "level": "^8.0.1", @@ -710,7 +713,7 @@ "terser-webpack-plugin": "^5.3.14", "through2": "^4.0.2", "ts-node": "^10.9.2", - "tsx": "^4.19.2", + "tsx": "^4.20.6", "tweetnacl": "^1.0.3", "typescript": "~5.4.5", "unzipper": "^0.12.3", diff --git a/ui/components/app/alert-system/general-alert/general-alert.tsx b/ui/components/app/alert-system/general-alert/general-alert.tsx index ea619a6450d2..a33719f4dcba 100644 --- a/ui/components/app/alert-system/general-alert/general-alert.tsx +++ b/ui/components/app/alert-system/general-alert/general-alert.tsx @@ -82,7 +82,7 @@ function AlertDetails({ return ( - {details instanceof Array ? ( + {Array.isArray(details) ? ( {details.map((detail, index) => ( diff --git a/ui/components/app/assets/token-cell/token-cell.test.tsx b/ui/components/app/assets/token-cell/token-cell.test.tsx index f6fd5732cb04..5d23438bd6c7 100644 --- a/ui/components/app/assets/token-cell/token-cell.test.tsx +++ b/ui/components/app/assets/token-cell/token-cell.test.tsx @@ -12,7 +12,7 @@ import { getPreferences, getCurrencyRates, getUseCurrencyRateCheck, - useSafeChainsListValidationSelector, + getUseSafeChainsListValidation, getEnabledNetworksByNamespace, } from '../../../../selectors'; import { @@ -193,7 +193,7 @@ describe('Token Cell', () => { if (selector === getUseCurrencyRateCheck) { return true; } - if (selector === useSafeChainsListValidationSelector) { + if (selector === getUseSafeChainsListValidation) { return true; } if (selector === getEnabledNetworksByNamespace) { diff --git a/ui/components/app/assets/token-list/token-list.tsx b/ui/components/app/assets/token-list/token-list.tsx index cf50ed7b9479..32a8f394c61d 100644 --- a/ui/components/app/assets/token-list/token-list.tsx +++ b/ui/components/app/assets/token-list/token-list.tsx @@ -141,8 +141,6 @@ function TokenList({ onTokenClick, safeChains }: TokenListProps) { return token; }); - - // eslint-disable-next-line react-hooks/exhaustive-deps }, [ isEvm, evmBalances, diff --git a/ui/components/app/currency-input/currency-input.js b/ui/components/app/currency-input/currency-input.js index 35696921912c..c12ddce40140 100644 --- a/ui/components/app/currency-input/currency-input.js +++ b/ui/components/app/currency-input/currency-input.js @@ -164,7 +164,6 @@ export default function CurrencyInput({ ); // tokenDecimalValue does not need to be in here, since this side effect is only for upstream updates - // eslint-disable-next-line react-hooks/exhaustive-deps }, [ hexValue, asset?.address, diff --git a/ui/components/app/currency-input/hooks/useProcessNewDecimalValue.tsx b/ui/components/app/currency-input/hooks/useProcessNewDecimalValue.tsx index 88ee8b462312..1ead7d50902a 100644 --- a/ui/components/app/currency-input/hooks/useProcessNewDecimalValue.tsx +++ b/ui/components/app/currency-input/hooks/useProcessNewDecimalValue.tsx @@ -16,6 +16,9 @@ export default function useProcessNewDecimalValue( isTokenPrimary: boolean, tokenToFiatConversionRate: Numeric | undefined, ) { + const tokenToFiatConversionRateToString = + tokenToFiatConversionRate?.toString(); + return useCallback( (newDecimalValue: string, isTokenPrimaryOverride?: boolean) => { let newFiatDecimalValue, newTokenDecimalValue; @@ -55,6 +58,7 @@ export default function useProcessNewDecimalValue( return { newFiatDecimalValue, newTokenDecimalValue }; }, - [tokenToFiatConversionRate?.toString(), isTokenPrimary, assetDecimals], + // `tokenToFiatConversionRate` intentionally excluded to ensure that re-renders are only triggered when conversion rate value actually changes. + [tokenToFiatConversionRateToString, isTokenPrimary, assetDecimals], ); } diff --git a/ui/components/app/currency-input/hooks/useTokenExchangeRate.tsx b/ui/components/app/currency-input/hooks/useTokenExchangeRate.tsx index a4799d94ce88..ad175566315e 100644 --- a/ui/components/app/currency-input/hooks/useTokenExchangeRate.tsx +++ b/ui/components/app/currency-input/hooks/useTokenExchangeRate.tsx @@ -66,6 +66,8 @@ export default function useTokenExchangeRate( contractExchangeRates[tokenAddress] || exchangeRates[tokenAddress]; if (!contractExchangeRate) { + // TODO: Fix "Calling setState from useMemo may trigger an infinite loop" + // eslint-disable-next-line react-compiler/react-compiler setExchangeRates((prev) => ({ ...prev, [tokenAddress]: LOADING, diff --git a/ui/components/app/identity/backup-and-sync-features-toggles/backup-and-sync-features-toggles.tsx b/ui/components/app/identity/backup-and-sync-features-toggles/backup-and-sync-features-toggles.tsx index 67d98054c2ae..229acb88695d 100644 --- a/ui/components/app/identity/backup-and-sync-features-toggles/backup-and-sync-features-toggles.tsx +++ b/ui/components/app/identity/backup-and-sync-features-toggles/backup-and-sync-features-toggles.tsx @@ -203,13 +203,14 @@ export const BackupAndSyncFeaturesToggles = () => { {t('backupAndSyncManageWhatYouSyncDescription')} - {backupAndSyncFeaturesTogglesSections.map((section) => - FeatureToggle({ - section, - isBackupAndSyncUpdateLoading, - isBackupAndSyncEnabled, - }), - )} + {backupAndSyncFeaturesTogglesSections.map((section) => ( + + ))} ); }; diff --git a/ui/components/app/modals/modal.js b/ui/components/app/modals/modal.js index 84ab98d88952..c7f1e8570305 100644 --- a/ui/components/app/modals/modal.js +++ b/ui/components/app/modals/modal.js @@ -1,3 +1,6 @@ +'use no memo'; +// TODO: Enable React Compiler once this has been migrated to a functional component. + import PropTypes from 'prop-types'; import React, { Component } from 'react'; diff --git a/ui/components/app/modals/qr-scanner/qr-scanner.component.js b/ui/components/app/modals/qr-scanner/qr-scanner.component.js index 51ae5a89a6ef..32f04dd5b3fd 100644 --- a/ui/components/app/modals/qr-scanner/qr-scanner.component.js +++ b/ui/components/app/modals/qr-scanner/qr-scanner.component.js @@ -179,7 +179,6 @@ export default function QRCodeScanner({ hideModal, qrCodeDetected }) { await checkEnvironment(); })(); // only renders when component is mounted and unmounted - // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(() => { diff --git a/ui/components/app/permission-page-container/permission-page-container.component.js b/ui/components/app/permission-page-container/permission-page-container.component.js index 2cd595e85df0..f5e26d5d311d 100644 --- a/ui/components/app/permission-page-container/permission-page-container.component.js +++ b/ui/components/app/permission-page-container/permission-page-container.component.js @@ -134,7 +134,7 @@ export default class PermissionPageContainer extends Component { onCancel = () => { const { request, rejectPermissionsRequest } = this.props; - rejectPermissionsRequest(request.metadata.id); + rejectPermissionsRequest(request?.metadata?.id); }; onSubmit = () => { @@ -169,7 +169,7 @@ export default class PermissionPageContainer extends Component { if (Object.keys(request.permissions).length > 0) { approvePermissionsRequest(request); } else { - rejectPermissionsRequest(request.metadata.id); + rejectPermissionsRequest(request?.metadata?.id); } }; diff --git a/ui/components/app/qr-hardware-popover/base-reader.js b/ui/components/app/qr-hardware-popover/base-reader.js index 4c9ed983d900..569f230415b3 100644 --- a/ui/components/app/qr-hardware-popover/base-reader.js +++ b/ui/components/app/qr-hardware-popover/base-reader.js @@ -1,4 +1,4 @@ -import React, { useEffect, useRef, useState } from 'react'; +import React, { useEffect, useRef, useState, useCallback } from 'react'; import log from 'loglevel'; import { URDecoder } from '@ngraveio/bc-ur'; import PropTypes from 'prop-types'; @@ -30,7 +30,7 @@ const BaseReader = ({ const [urDecoder, setURDecoder] = useState(new URDecoder()); const [progress, setProgress] = useState(0); - let permissionChecker = null; + const permissionCheckerRef = useRef(null); const mounted = useRef(false); const reset = () => { @@ -40,29 +40,7 @@ const BaseReader = ({ setProgress(0); }; - const checkEnvironment = async () => { - try { - const { environmentReady } = await WebcamUtils.checkStatus(); - if ( - !environmentReady && - getEnvironmentType() !== ENVIRONMENT_TYPE_FULLSCREEN - ) { - const currentUrl = new URL(window.location.href); - const currentHash = currentUrl.hash; - const currentRoute = currentHash ? currentHash.substring(1) : null; - global.platform.openExtensionInBrowser(currentRoute); - } - } catch (e) { - if (mounted.current) { - setError(e); - } - } - // initial attempt is required to trigger permission prompt - // eslint-disable-next-line no-use-before-define - return initCamera(); - }; - - const checkPermissions = async () => { + const checkPermissions = useCallback(async () => { try { const { permissions } = await WebcamUtils.checkStatus(); if (permissions) { @@ -74,7 +52,7 @@ const BaseReader = ({ setReady(READY_STATE.READY); } else if (mounted.current) { // Keep checking for permissions - permissionChecker = setTimeout(checkPermissions, SECOND); + permissionCheckerRef.current = setTimeout(checkPermissions, SECOND); setReady(READY_STATE.NEED_TO_ALLOW_ACCESS); } } catch (e) { @@ -82,7 +60,44 @@ const BaseReader = ({ setError(e); } } - }; + }, []); + + const initCamera = useCallback(() => { + try { + checkPermissions(); + } catch (e) { + if (!mounted.current) { + return; + } + if (e.name === 'NotAllowedError') { + log.info(`Permission denied: '${e}'`); + setReady(READY_STATE.NEED_TO_ALLOW_ACCESS); + } else { + setError(e); + } + } + }, [checkPermissions]); + + const checkEnvironment = useCallback(async () => { + try { + const { environmentReady } = await WebcamUtils.checkStatus(); + if ( + !environmentReady && + getEnvironmentType() !== ENVIRONMENT_TYPE_FULLSCREEN + ) { + const currentUrl = new URL(window.location.href); + const currentHash = currentUrl.hash; + const currentRoute = currentHash ? currentHash.substring(1) : null; + global.platform.openExtensionInBrowser(currentRoute); + } + } catch (e) { + if (mounted.current) { + setError(e); + } + } + // initial attempt is required to trigger permission prompt + return initCamera(); + }, [initCamera]); const handleScan = (data) => { try { @@ -105,30 +120,14 @@ const BaseReader = ({ } }; - const initCamera = () => { - try { - checkPermissions(); - } catch (e) { - if (!mounted.current) { - return; - } - if (e.name === 'NotAllowedError') { - log.info(`Permission denied: '${e}'`); - setReady(READY_STATE.NEED_TO_ALLOW_ACCESS); - } else { - setError(e); - } - } - }; - useEffect(() => { mounted.current = true; checkEnvironment(); return () => { mounted.current = false; - clearTimeout(permissionChecker); + clearTimeout(permissionCheckerRef.current); + permissionCheckerRef.current = null; }; - // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(() => { @@ -137,11 +136,10 @@ const BaseReader = ({ } else if (ready === READY_STATE.NEED_TO_ALLOW_ACCESS) { checkPermissions(); } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [ready]); + }, [ready, checkPermissions, initCamera]); const tryAgain = () => { - clearTimeout(permissionChecker); + clearTimeout(permissionCheckerRef.current); reset(); checkEnvironment(); }; diff --git a/ui/components/app/qr-hardware-popover/enhanced-reader.js b/ui/components/app/qr-hardware-popover/enhanced-reader.js index 2c58a7263beb..340983a4e011 100644 --- a/ui/components/app/qr-hardware-popover/enhanced-reader.js +++ b/ui/components/app/qr-hardware-popover/enhanced-reader.js @@ -42,7 +42,6 @@ const EnhancedReader = ({ handleScan }) => { }) .catch(log.info); }; - // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return ( diff --git a/ui/components/app/qr-hardware-popover/qr-hardware-popover.js b/ui/components/app/qr-hardware-popover/qr-hardware-popover.js index 5779a3740f72..21506313777f 100644 --- a/ui/components/app/qr-hardware-popover/qr-hardware-popover.js +++ b/ui/components/app/qr-hardware-popover/qr-hardware-popover.js @@ -27,7 +27,6 @@ const QRHardwarePopover = () => { // we want to block the changing by sign request id; const _txData = useMemo(() => { return txData; - // eslint-disable-next-line react-hooks/exhaustive-deps }, [activeScanRequest?.requestId]); const dispatch = useDispatch(); diff --git a/ui/components/app/snaps/snap-ui-renderer/snap-ui-renderer.js b/ui/components/app/snaps/snap-ui-renderer/snap-ui-renderer.js index f97107cf32e5..09f74cbe77d3 100644 --- a/ui/components/app/snaps/snap-ui-renderer/snap-ui-renderer.js +++ b/ui/components/app/snaps/snap-ui-renderer/snap-ui-renderer.js @@ -45,6 +45,9 @@ const SnapUIRendererComponent = ({ contentBackgroundColor, PERF_DEBUG, }) => { + // eslint-disable-next-line react-compiler/react-compiler + 'use no memo'; + const t = useI18nContext(); const interfaceState = useSelector( diff --git a/ui/components/app/terms-of-use-popup/terms-of-use-popup.js b/ui/components/app/terms-of-use-popup/terms-of-use-popup.js index 4b27cd507d4e..7adc9719e661 100644 --- a/ui/components/app/terms-of-use-popup/terms-of-use-popup.js +++ b/ui/components/app/terms-of-use-popup/terms-of-use-popup.js @@ -92,7 +92,6 @@ export default function TermsOfUsePopup({ onClose, onAccept }) { location: 'Terms Of Use Popover', }, }); - // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return ( diff --git a/ui/components/component-library/select-wrapper/select-wrapper.stories.tsx b/ui/components/component-library/select-wrapper/select-wrapper.stories.tsx index 6e836d00a7f1..3df8a86f85cc 100644 --- a/ui/components/component-library/select-wrapper/select-wrapper.stories.tsx +++ b/ui/components/component-library/select-wrapper/select-wrapper.stories.tsx @@ -172,8 +172,9 @@ UncontrolledValue.args = { }; export const UseSelectContext: StoryFn = (args) => { - // Note that the SelectContext is being used inside a component, because the SelectContext needs to be called within the SelectWrapper component and not before const CustomClose = () => { + // Note that the SelectContext is being used inside a component, because the SelectContext needs to be called within the SelectWrapper component and not before + // eslint-disable-next-line react-compiler/react-compiler const { toggleUncontrolledOpen } = useSelectContext(); return ( diff --git a/ui/components/component-library/text-field/text-field.tsx b/ui/components/component-library/text-field/text-field.tsx index 79a1f8f810a5..b8116ed09218 100644 --- a/ui/components/component-library/text-field/text-field.tsx +++ b/ui/components/component-library/text-field/text-field.tsx @@ -93,6 +93,8 @@ export const TextField: TextFieldComponent = React.forwardRef( // Check if an external ref (inputRef) is provided and is a ref object if (inputRef && 'current' in inputRef) { // Assign the input element reference to the external ref + // TODO: Use `ref` prop instead. `forwardRef` is deprecated in React v19. + // eslint-disable-next-line react-compiler/react-compiler inputRef.current = inputElementRef; } // Check if an external ref (inputRef) is a callback function diff --git a/ui/components/multichain/account-list-item-menu/account-list-item-menu.js b/ui/components/multichain/account-list-item-menu/account-list-item-menu.js index 01899176b97c..94d6db12ed47 100644 --- a/ui/components/multichain/account-list-item-menu/account-list-item-menu.js +++ b/ui/components/multichain/account-list-item-menu/account-list-item-menu.js @@ -83,7 +83,6 @@ export const AccountListItemMenu = ({ } else { lastItemRef.current = accountDetailsItemRef.current; } - // eslint-disable-next-line react-hooks/exhaustive-deps }, [ removeJWTItemRef.current, removeAccountItemRef.current, diff --git a/ui/components/multichain/account-picker/account-picker.js b/ui/components/multichain/account-picker/account-picker.js index 7cf8761b97e3..112826011905 100644 --- a/ui/components/multichain/account-picker/account-picker.js +++ b/ui/components/multichain/account-picker/account-picker.js @@ -43,9 +43,6 @@ export const AccountPicker = ({ showAvatarAccount = true, ...props }) => { - AccountPicker.propTypes = { - showAvatarAccount: PropTypes.bool, - }; const shortenedAddress = address ? shortenAddress(toChecksumHexAddress(address)) : ''; @@ -188,4 +185,8 @@ AccountPicker.propTypes = { * Additional className to be added to the AccountPicker */ className: PropTypes.string, + /** + * Represents if the avatar account should display + */ + showAvatarAccount: PropTypes.bool, }; diff --git a/ui/components/multichain/asset-picker-amount/asset-picker-modal/hooks/useAssetMetadata.ts b/ui/components/multichain/asset-picker-amount/asset-picker-modal/hooks/useAssetMetadata.ts index 3a435ad67779..1a8d3a5d5419 100644 --- a/ui/components/multichain/asset-picker-amount/asset-picker-modal/hooks/useAssetMetadata.ts +++ b/ui/components/multichain/asset-picker-amount/asset-picker-modal/hooks/useAssetMetadata.ts @@ -49,6 +49,7 @@ export const useAssetMetadata = ( shouldFetchMetadata && trimmedSearchQuery.length > 30 ) { + // eslint-disable-next-line react-compiler/react-compiler abortControllerRef.current = new AbortController(); const metadata = await fetchAssetMetadata( trimmedSearchQuery, @@ -70,7 +71,7 @@ export const useAssetMetadata = ( return undefined; } return undefined; - }, [shouldFetchMetadata, searchQuery]); + }, [shouldFetchMetadata, searchQuery, chainId, allowExternalServices]); return assetMetadata; }; diff --git a/ui/components/multichain/notification-detail-network-fee/notification-detail-network-fee.tsx b/ui/components/multichain/notification-detail-network-fee/notification-detail-network-fee.tsx index c00da6d3a14a..252b1cd1283a 100644 --- a/ui/components/multichain/notification-detail-network-fee/notification-detail-network-fee.tsx +++ b/ui/components/multichain/notification-detail-network-fee/notification-detail-network-fee.tsx @@ -1,6 +1,6 @@ import React, { useContext, useState, useEffect } from 'react'; import type { FC } from 'react'; -import type { NotificationServicesController } from '@metamask/notification-services-controller'; +import type { OnChainRawNotificationsWithNetworkFields } from '@metamask/notification-services-controller/notification-services'; import { useI18nContext } from '../../../hooks/useI18nContext'; import { MetaMetricsContext } from '../../../contexts/metametrics'; @@ -36,9 +36,6 @@ import { } from '../../../helpers/constants/design-system'; import Preloader from '../../ui/icon/preloader/preloader-icon.component'; -type OnChainRawNotificationsWithNetworkFields = - NotificationServicesController.Types.OnChainRawNotificationsWithNetworkFields; - type NetworkFees = { transactionFee: { transactionFeeInEther: string; @@ -86,8 +83,8 @@ const FeeDetail = ({ label, value }: { label: string; value: string }) => ( * @deprecated - we are planning to remove this component * @returns The NotificationDetailNetworkFee component. */ -// eslint-disable-next-line @typescript-eslint/no-unused-vars -const _NotificationDetailNetworkFee: FC = ({ +// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/naming-convention +const NotificationDetailNetworkFee_: FC = ({ notification, }) => { const t = useI18nContext(); @@ -105,7 +102,9 @@ const _NotificationDetailNetworkFee: FC = ({ useEffect(() => { const fetchNetworkFees = async () => { try { - const networkFeesData = await getNetworkFees(notification); + const networkFeesData = await getNetworkFees( + notification as Parameters[0], + ); if (networkFeesData) { setNetworkFees({ transactionFee: { @@ -124,7 +123,7 @@ const _NotificationDetailNetworkFee: FC = ({ } }; fetchNetworkFees(); - }, []); + }, [notification]); const handleClick = () => { if (!isOpen) { diff --git a/ui/components/multichain/pages/send/send.js b/ui/components/multichain/pages/send/send.js index 9400f08c705e..05ce1fa7080b 100644 --- a/ui/components/multichain/pages/send/send.js +++ b/ui/components/multichain/pages/send/send.js @@ -285,7 +285,6 @@ export const SendPage = ({ ); } // sendAnalytics should not result in the event refiring - // eslint-disable-next-line react-hooks/exhaustive-deps }, [trackEvent, swapQuotesError]); const onSubmit = async (event) => { diff --git a/ui/components/ui/icon/preloader/preloader-icon.component.js b/ui/components/ui/icon/preloader/preloader-icon.component.js index b478ee7dc7cd..df837abe40ed 100644 --- a/ui/components/ui/icon/preloader/preloader-icon.component.js +++ b/ui/components/ui/icon/preloader/preloader-icon.component.js @@ -19,6 +19,7 @@ const Preloader = ({ className, size }) => ( /> () => { - return
; -}); +jest.mock( + './horizontal-logo.js', + () => + function mockRender() { + return
; + }, +); describe('MetaFoxLogo', () => { it('should match snapshot with img width and height default set to 42', () => { diff --git a/ui/contexts/metametrics.js b/ui/contexts/metametrics.js index da4f3173eb9f..0460105f7726 100644 --- a/ui/contexts/metametrics.js +++ b/ui/contexts/metametrics.js @@ -235,6 +235,7 @@ export function MetaMetricsProvider({ children }) { // For backwards compatibility, attach the new methods as properties to trackEvent const trackEventWithMethods = trackEvent; + // eslint-disable-next-line react-compiler/react-compiler trackEventWithMethods.bufferedTrace = bufferedTrace; trackEventWithMethods.bufferedEndTrace = bufferedEndTrace; trackEventWithMethods.onboardingParentContext = onboardingParentContext; diff --git a/ui/ducks/confirm-alerts/confirm-alerts.ts b/ui/ducks/confirm-alerts/confirm-alerts.ts index e4ea9785be38..9717b7e4ad27 100644 --- a/ui/ducks/confirm-alerts/confirm-alerts.ts +++ b/ui/ducks/confirm-alerts/confirm-alerts.ts @@ -173,7 +173,7 @@ export type ConfirmAlertsState = { type UpdateAlertsAction = { type: 'UPDATE_ALERTS'; - ownerId: string; + ownerId: string | undefined; alerts: Alert[]; }; @@ -186,7 +186,7 @@ type SetAlertConfirmedAction = { type ClearAlertsAction = { type: 'CLEAR_ALERTS'; - ownerId: string; + ownerId: string | undefined; }; type Action = UpdateAlertsAction | SetAlertConfirmedAction | ClearAlertsAction; @@ -201,6 +201,10 @@ export default function confirmAlertsReducer( state: ConfirmAlertsState = INIT_STATE, action: Action, ) { + if (action.ownerId === undefined) { + return state; + } + switch (action.type) { case 'UPDATE_ALERTS': return { @@ -242,7 +246,7 @@ export default function confirmAlertsReducer( } export function updateAlerts( - ownerId: string, + ownerId: string | undefined, alerts: Alert[], ): UpdateAlertsAction { return { @@ -265,7 +269,7 @@ export function setAlertConfirmed( }; } -export function clearAlerts(ownerId: string): ClearAlertsAction { +export function clearAlerts(ownerId: string | undefined): ClearAlertsAction { return { type: 'CLEAR_ALERTS', ownerId, diff --git a/ui/ducks/swaps/swaps.js b/ui/ducks/swaps/swaps.js index 9f5eac8734b6..bcb064f70d75 100644 --- a/ui/ducks/swaps/swaps.js +++ b/ui/ducks/swaps/swaps.js @@ -1505,13 +1505,11 @@ export function cancelSwapsSmartTransaction(uuid) { }; } -export const getIsEstimatedReturnLow = ({ usedQuote, rawNetworkFees }) => { +export const useGetIsEstimatedReturnLow = ({ usedQuote, rawNetworkFees }) => { const sourceTokenAmount = calcTokenAmount( usedQuote?.sourceAmount, usedQuote?.sourceTokenInfo?.decimals, ); - // Disabled because it's not a hook - // eslint-disable-next-line react-hooks/rules-of-hooks const sourceTokenFiatAmount = useTokenFiatAmount( usedQuote?.sourceTokenInfo?.address, sourceTokenAmount || 0, @@ -1528,7 +1526,6 @@ export const getIsEstimatedReturnLow = ({ usedQuote, rawNetworkFees }) => { usedQuote?.destinationTokenInfo?.decimals, ); // Disabled because it's not a hook - // eslint-disable-next-line react-hooks/rules-of-hooks const destinationTokenFiatAmount = useTokenFiatAmount( usedQuote?.destinationTokenInfo?.address, destinationTokenAmount || 0, diff --git a/ui/helpers/higher-order-components/initialized/initialized.component.js b/ui/helpers/higher-order-components/initialized/initialized.component.js index 6c2561da2893..7ab8ad60dc25 100644 --- a/ui/helpers/higher-order-components/initialized/initialized.component.js +++ b/ui/helpers/higher-order-components/initialized/initialized.component.js @@ -16,6 +16,6 @@ export default function Initialized(props) { Initialized.propTypes = { completedOnboarding: PropTypes.bool, path: PropTypes.string, - component: PropTypes.object, + component: PropTypes.func, exact: PropTypes.bool, }; diff --git a/ui/helpers/utils/notification.util.ts b/ui/helpers/utils/notification.util.ts index 0f7bd5eedccd..ed78a311dd2b 100644 --- a/ui/helpers/utils/notification.util.ts +++ b/ui/helpers/utils/notification.util.ts @@ -410,7 +410,9 @@ export function hasNetworkFeeFields( return 'network_fee' in notification.payload.data; } -export const getNetworkFees = async (notification: OnChainRawNotification) => { +export const getNetworkFees = async ( + notification: OnChainRawNotificationsWithNetworkFields, +) => { if (!hasNetworkFeeFields(notification)) { throw new Error('Invalid notification type'); } diff --git a/ui/hooks/bridge/useRewards.ts b/ui/hooks/bridge/useRewards.ts index 9447352088b2..99b37734498d 100644 --- a/ui/hooks/bridge/useRewards.ts +++ b/ui/hooks/bridge/useRewards.ts @@ -1,3 +1,5 @@ +'use no memo'; + import { useState, useEffect, useCallback, useRef } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { BigNumber } from 'bignumber.js'; @@ -157,8 +159,8 @@ export const useRewardsWithQuote = ({ // Track the current account's linked timestamp to trigger useEffect when it changes const [currentAccountLinkedTimestamp, setCurrentAccountLinkedTimestamp] = useState(null); - // eslint-disable-next-line react-hooks/exhaustive-deps const debouncedEstimatePoints = useCallback( + // eslint-disable-next-line react-compiler/react-compiler debounce( async ( estimationQuoteArg: diff --git a/ui/hooks/gator-permissions/useGatorPermissions.ts b/ui/hooks/gator-permissions/useGatorPermissions.ts index 9714830c2648..1bd36df8c2a2 100644 --- a/ui/hooks/gator-permissions/useGatorPermissions.ts +++ b/ui/hooks/gator-permissions/useGatorPermissions.ts @@ -118,7 +118,6 @@ export function useGatorPermissions( }; // Note: cachedData is intentionally excluded from dependencies to prevent infinite loop // when fetchAndUpdateGatorPermissions updates the Redux store - // eslint-disable-next-line react-hooks/exhaustive-deps }, [dispatch, refreshInBackground]); return { diff --git a/ui/hooks/rewards/useValidateReferralCode.ts b/ui/hooks/rewards/useValidateReferralCode.ts index b0fcbd6c4101..a092286d215c 100644 --- a/ui/hooks/rewards/useValidateReferralCode.ts +++ b/ui/hooks/rewards/useValidateReferralCode.ts @@ -68,8 +68,8 @@ export const useValidateReferralCode = ( ); // Debounced validation - // eslint-disable-next-line react-hooks/exhaustive-deps const debouncedValidation = useCallback( + // eslint-disable-next-line react-compiler/react-compiler debounce(async (code: string) => { setUnknownError(false); const validationError = await validateCode(code); @@ -108,7 +108,6 @@ export const useValidateReferralCode = ( setReferralCode(initialValue); } // only run on mount or when initialValue changes - // eslint-disable-next-line react-hooks/exhaustive-deps }, [initialValue]); // Cleanup debounced function on unmount diff --git a/ui/hooks/snaps/useSnapNavigation.ts b/ui/hooks/snaps/useSnapNavigation.ts index 65b4e4733ef8..6a6230925cdc 100644 --- a/ui/hooks/snaps/useSnapNavigation.ts +++ b/ui/hooks/snaps/useSnapNavigation.ts @@ -5,7 +5,7 @@ import { getSnapRoute } from '../../helpers/utils/util'; const useSnapNavigation = () => { const navigate = useNavigate(); - const useSnapNavigate = useCallback( + const handleSnapNavigate = useCallback( (url: string) => { let path; const linkData = parseMetaMaskUrl(url); @@ -20,9 +20,9 @@ const useSnapNavigation = () => { ); return useMemo( () => ({ - useSnapNavigate, + handleSnapNavigate, }), - [useSnapNavigate], + [handleSnapNavigate], ); }; diff --git a/ui/hooks/useAsync.ts b/ui/hooks/useAsync.ts index 0b4e5a802224..57bcb77b9c1d 100644 --- a/ui/hooks/useAsync.ts +++ b/ui/hooks/useAsync.ts @@ -1,3 +1,5 @@ +'use no memo'; + import { useState, useEffect, @@ -115,6 +117,7 @@ export function useAsyncCallback( setResult(createErrorResult(error as Error)); } } + // eslint-disable-next-line react-compiler/react-compiler }, deps); return [execute, result]; diff --git a/ui/hooks/useCurrencyRatePolling.ts b/ui/hooks/useCurrencyRatePolling.ts index 124f68429d08..ed0aa6428124 100644 --- a/ui/hooks/useCurrencyRatePolling.ts +++ b/ui/hooks/useCurrencyRatePolling.ts @@ -3,7 +3,7 @@ import { useSelector } from 'react-redux'; import { getChainIdsToPoll, getUseCurrencyRateCheck, - useSafeChainsListValidationSelector, + getUseSafeChainsListValidation, } from '../selectors'; import { getEnabledChainIds } from '../selectors/multichain/networks'; import { @@ -30,7 +30,7 @@ const usePollingEnabled = () => { const useNativeCurrencies = (isPollingEnabled: boolean) => { const networkConfigurations = useSelector(getNetworkConfigurationsByChainId); const useSafeChainsListValidation = useSelector( - useSafeChainsListValidationSelector, + getUseSafeChainsListValidation, ); const [nativeCurrencies, setNativeCurrencies] = useState([]); const chainIds = useSelector(getChainIdsToPoll); diff --git a/ui/hooks/useIsOriginalNativeTokenSymbol.test.ts b/ui/hooks/useIsOriginalNativeTokenSymbol.test.ts index 0d5f0102bd02..5d12650cc08e 100644 --- a/ui/hooks/useIsOriginalNativeTokenSymbol.test.ts +++ b/ui/hooks/useIsOriginalNativeTokenSymbol.test.ts @@ -8,8 +8,8 @@ import { useIsOriginalNativeTokenSymbol } from './useIsOriginalNativeTokenSymbol const arrangeMocks = () => { // Mock Selectors - const mockUseSafeChainsListValidationSelector = jest - .spyOn(SelectorsModule, 'useSafeChainsListValidationSelector') + const mockGetUseSafeChainsListValidation = jest + .spyOn(SelectorsModule, 'getUseSafeChainsListValidation') .mockReturnValue(true); const createMockProviderConfig = () => @@ -26,7 +26,7 @@ const arrangeMocks = () => { .mockResolvedValue(true); return { - mockUseSafeChainsListValidationSelector, + mockGetUseSafeChainsListValidation, createMockProviderConfig, mockGetMultichainCurrentNetwork, mockIsOriginalNativeTokenSymbol, diff --git a/ui/hooks/useIsOriginalNativeTokenSymbol.ts b/ui/hooks/useIsOriginalNativeTokenSymbol.ts index 747b26757f6f..3a85c209f914 100644 --- a/ui/hooks/useIsOriginalNativeTokenSymbol.ts +++ b/ui/hooks/useIsOriginalNativeTokenSymbol.ts @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; import { CaipChainId, Hex } from '@metamask/utils'; -import { useSafeChainsListValidationSelector } from '../selectors'; +import { getUseSafeChainsListValidation } from '../selectors'; import { getMultichainCurrentNetwork } from '../selectors/multichain'; import { isEvmChainId } from '../../shared/lib/asset-utils'; @@ -18,7 +18,7 @@ export function useIsOriginalNativeTokenSymbol( ) { const [isOriginalNativeSymbol, setIsOriginalNativeSymbol] = useState(false); const useSafeChainsListValidation = useSelector( - useSafeChainsListValidationSelector, + getUseSafeChainsListValidation, ); const isEvm = isEvmChainId(chainId); diff --git a/ui/hooks/useIsOriginalTokenSymbol.js b/ui/hooks/useIsOriginalTokenSymbol.js index 8b12c118bf95..e88b70b4268b 100644 --- a/ui/hooks/useIsOriginalTokenSymbol.js +++ b/ui/hooks/useIsOriginalTokenSymbol.js @@ -38,7 +38,6 @@ export function useIsOriginalTokenSymbol(tokenAddress, tokenSymbol) { getTokenSymbolForToken(tokenAddress); // no need to wait for tokens to load, since we'd fetch without them if they aren't available - // eslint-disable-next-line react-hooks/exhaustive-deps }, [tokenAddress, tokenSymbol]); return isOriginalNativeSymbol; diff --git a/ui/hooks/useModalProps.test.ts b/ui/hooks/useModalProps.test.ts index c507d6b7c100..caca5ab765c3 100644 --- a/ui/hooks/useModalProps.test.ts +++ b/ui/hooks/useModalProps.test.ts @@ -1,3 +1,4 @@ +import { renderHook } from '@testing-library/react-hooks'; import { useModalProps } from './useModalProps'; const MOCK_PROPS = { @@ -26,7 +27,13 @@ jest.mock('../store/actions', () => ({ describe('useModalProps', () => { it('should return modal props and hideModal function', () => { - const { props, hideModal } = useModalProps(); + const { + result: { + current: { props, hideModal }, + }, + } = renderHook(() => { + return useModalProps(); + }); expect(props).toStrictEqual(MOCK_PROPS); expect(hideModal).toStrictEqual(expect.any(Function)); diff --git a/ui/hooks/useModalProps.ts b/ui/hooks/useModalProps.ts index 03d85f41aeb7..780ff778517e 100644 --- a/ui/hooks/useModalProps.ts +++ b/ui/hooks/useModalProps.ts @@ -1,4 +1,6 @@ +import { useMemo, useCallback } from 'react'; import { useSelector, useDispatch } from 'react-redux'; +import type { MetaMaskReduxState } from '../store/store'; import { hideModal } from '../store/actions'; type ModalProps = { @@ -9,14 +11,15 @@ type ModalProps = { }; export function useModalProps(): ModalProps { - // TODO: Fix in https://github.com/MetaMask/metamask-extension/issues/31973 - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const modalProps = useSelector((state: any) => { + const modalProps = useSelector((state: MetaMaskReduxState) => { return state.appState.modal.modalState?.props; }); const dispatch = useDispatch(); - const onHideModal = () => dispatch(hideModal()); + const onHideModal = useCallback(() => dispatch(hideModal()), [dispatch]); - return { props: modalProps, hideModal: onHideModal }; + return useMemo( + () => ({ props: modalProps, hideModal: onHideModal }), + [modalProps, onHideModal], + ); } diff --git a/ui/hooks/useMultiPolling.ts b/ui/hooks/useMultiPolling.ts index c28967ef2b51..96a6b1c34ded 100644 --- a/ui/hooks/useMultiPolling.ts +++ b/ui/hooks/useMultiPolling.ts @@ -17,19 +17,34 @@ const useMultiPolling = ( const completedOnboarding = useSelector(getCompletedOnboarding); const pollingTokens = useRef>(new Map()); + const prevPollingInputStringified = useRef(null); + const hasPollingInputChanged = + JSON.stringify(usePollingOptions.input) !== + prevPollingInputStringified.current; + + const isMounted = useRef(false); useEffect(() => { - if (!completedOnboarding) { - // don't start polling if no selected account or onboarding is not completed yet - return; + isMounted.current = true; + return () => { + isMounted.current = false; + }; + }, []); + + useEffect(() => { + if (!completedOnboarding || !hasPollingInputChanged) { + // don't start polling if no selected account, or onboarding is incomplete, or polling inputs haven't changed + return () => undefined; } // start new polls for (const input of usePollingOptions.input) { const key = JSON.stringify(input); if (!pollingTokens.current.has(key)) { - usePollingOptions - .startPolling(input) - .then((token) => pollingTokens.current.set(key, token)); + usePollingOptions.startPolling(input).then((token) => { + if (isMounted.current) { + pollingTokens.current.set(key, token); + } + }); } } @@ -44,19 +59,19 @@ const useMultiPolling = ( pollingTokens.current.delete(inputKey); } } - }, [ - completedOnboarding, - usePollingOptions.input && JSON.stringify(usePollingOptions.input), - ]); - // stop all polling on dismount - useEffect(() => { + prevPollingInputStringified.current = JSON.stringify( + usePollingOptions.input, + ); + + // stop all polling on dismount return () => { for (const token of pollingTokens.current.values()) { usePollingOptions.stopPollingByPollingToken(token); } + prevPollingInputStringified.current = null; }; - }, []); + }, [usePollingOptions, hasPollingInputChanged, completedOnboarding]); }; export default useMultiPolling; diff --git a/ui/hooks/useName.test.ts b/ui/hooks/useName.test.ts index 5d9f7aca716b..4a8e98e660e7 100644 --- a/ui/hooks/useName.test.ts +++ b/ui/hooks/useName.test.ts @@ -1,3 +1,4 @@ +import { renderHook } from '@testing-library/react-hooks'; import { FALLBACK_VARIATION, NameControllerState, @@ -47,13 +48,15 @@ describe('useName', () => { it('returns default values if no state', () => { getNamesMock.mockReturnValue({} as NameControllerState['names']); - const nameEntry = useName(VALUE_MOCK, TYPE_MOCK, VARIATION_MOCK); + renderHook(() => { + const nameEntry = useName(VALUE_MOCK, TYPE_MOCK, VARIATION_MOCK); - expect(nameEntry).toStrictEqual({ - name: null, - sourceId: null, - origin: null, - proposedNames: {}, + expect(nameEntry).toStrictEqual({ + name: null, + sourceId: null, + origin: null, + proposedNames: {}, + }); }); }); @@ -71,13 +74,15 @@ describe('useName', () => { }, }); - const nameEntry = useName(VALUE_MOCK, TYPE_MOCK, VARIATION_MOCK); + renderHook(() => { + const nameEntry = useName(VALUE_MOCK, TYPE_MOCK, VARIATION_MOCK); - expect(nameEntry).toStrictEqual({ - name: null, - sourceId: null, - origin: null, - proposedNames: {}, + expect(nameEntry).toStrictEqual({ + name: null, + sourceId: null, + origin: null, + proposedNames: {}, + }); }); }); @@ -95,13 +100,15 @@ describe('useName', () => { }, }); - const nameEntry = useName(VALUE_MOCK, TYPE_MOCK, VARIATION_MOCK); + renderHook(() => { + const nameEntry = useName(VALUE_MOCK, TYPE_MOCK, VARIATION_MOCK); - expect(nameEntry).toStrictEqual({ - name: NAME_MOCK, - sourceId: SOURCE_ID_MOCK, - proposedNames: PROPOSED_NAMES_MOCK, - origin: ORIGIN_MOCK, + expect(nameEntry).toStrictEqual({ + name: NAME_MOCK, + sourceId: SOURCE_ID_MOCK, + proposedNames: PROPOSED_NAMES_MOCK, + origin: ORIGIN_MOCK, + }); }); }); @@ -119,13 +126,15 @@ describe('useName', () => { }, }); - const nameEntry = useName(VALUE_MOCK, TYPE_MOCK, VARIATION_2_MOCK); + renderHook(() => { + const nameEntry = useName(VALUE_MOCK, TYPE_MOCK, VARIATION_2_MOCK); - expect(nameEntry).toStrictEqual({ - name: NAME_MOCK, - sourceId: SOURCE_ID_MOCK, - proposedNames: PROPOSED_NAMES_MOCK, - origin: ORIGIN_MOCK, + expect(nameEntry).toStrictEqual({ + name: NAME_MOCK, + sourceId: SOURCE_ID_MOCK, + proposedNames: PROPOSED_NAMES_MOCK, + origin: ORIGIN_MOCK, + }); }); }); @@ -144,13 +153,15 @@ describe('useName', () => { }, }); - const nameEntry = useName(VALUE_MOCK, TYPE_MOCK, VARIATION_2_MOCK); + renderHook(() => { + const nameEntry = useName(VALUE_MOCK, TYPE_MOCK, VARIATION_2_MOCK); - expect(nameEntry).toStrictEqual({ - name: NAME_MOCK, - sourceId: SOURCE_ID_MOCK, - proposedNames: PROPOSED_NAMES_MOCK, - origin: ORIGIN_MOCK, + expect(nameEntry).toStrictEqual({ + name: NAME_MOCK, + sourceId: SOURCE_ID_MOCK, + proposedNames: PROPOSED_NAMES_MOCK, + origin: ORIGIN_MOCK, + }); }); }); @@ -174,13 +185,15 @@ describe('useName', () => { }, }); - const nameEntry = useName(VALUE_MOCK, TYPE_MOCK, VARIATION_2_MOCK); + renderHook(() => { + const nameEntry = useName(VALUE_MOCK, TYPE_MOCK, VARIATION_2_MOCK); - expect(nameEntry).toStrictEqual({ - name: NAME_MOCK, - proposedNames: {}, - sourceId: SOURCE_ID_MOCK, - origin: ORIGIN_MOCK, + expect(nameEntry).toStrictEqual({ + name: NAME_MOCK, + proposedNames: {}, + sourceId: SOURCE_ID_MOCK, + origin: ORIGIN_MOCK, + }); }); }); }); @@ -199,13 +212,15 @@ describe('useName', () => { }, }); - const nameEntry = useName('0xAbC123', TYPE_MOCK, VARIATION_MOCK); + renderHook(() => { + const nameEntry = useName('0xAbC123', TYPE_MOCK, VARIATION_MOCK); - expect(nameEntry).toStrictEqual({ - name: NAME_MOCK, - sourceId: SOURCE_ID_MOCK, - proposedNames: PROPOSED_NAMES_MOCK, - origin: ORIGIN_MOCK, + expect(nameEntry).toStrictEqual({ + name: NAME_MOCK, + sourceId: SOURCE_ID_MOCK, + proposedNames: PROPOSED_NAMES_MOCK, + origin: ORIGIN_MOCK, + }); }); }); }); diff --git a/ui/hooks/useOriginTrustSignals.test.ts b/ui/hooks/useOriginTrustSignals.test.ts index 953d74da73e6..a59068582024 100644 --- a/ui/hooks/useOriginTrustSignals.test.ts +++ b/ui/hooks/useOriginTrustSignals.test.ts @@ -1,3 +1,4 @@ +import { renderHook } from '@testing-library/react-hooks'; import { RecommendedAction } from '@metamask/phishing-controller'; import { getUrlScanCacheResult } from '../selectors/selectors'; import { TrustSignalDisplayState } from './useTrustSignals'; @@ -29,16 +30,18 @@ describe('useOriginTrustSignals', () => { it('returns unknown state when selector returns undefined', () => { getUrlScanCacheResultMock.mockReturnValue(undefined); - const result = useOriginTrustSignals(''); - - expect(result).toStrictEqual({ - state: TrustSignalDisplayState.Unknown, - label: null, + renderHook(() => { + const result = useOriginTrustSignals(''); + + expect(result).toStrictEqual({ + state: TrustSignalDisplayState.Unknown, + label: null, + }); + expect(getUrlScanCacheResultMock).toHaveBeenCalledWith( + undefined, + undefined, + ); }); - expect(getUrlScanCacheResultMock).toHaveBeenCalledWith( - undefined, - undefined, - ); }); it('returns malicious state when recommendedAction is Block', () => { @@ -50,16 +53,18 @@ describe('useOriginTrustSignals', () => { timestamp: TIMESTAMP_MOCK, }); - const result = useOriginTrustSignals(ORIGIN_MOCK); - - expect(result).toStrictEqual({ - state: TrustSignalDisplayState.Malicious, - label: null, + renderHook(() => { + const result = useOriginTrustSignals(ORIGIN_MOCK); + + expect(result).toStrictEqual({ + state: TrustSignalDisplayState.Malicious, + label: null, + }); + expect(getUrlScanCacheResultMock).toHaveBeenCalledWith( + undefined, + DOMAIN_NAME_MOCK, + ); }); - expect(getUrlScanCacheResultMock).toHaveBeenCalledWith( - undefined, - DOMAIN_NAME_MOCK, - ); }); it('returns warning state when recommendedAction is Warn', () => { @@ -71,11 +76,13 @@ describe('useOriginTrustSignals', () => { timestamp: TIMESTAMP_MOCK, }); - const result = useOriginTrustSignals(ORIGIN_MOCK); + renderHook(() => { + const result = useOriginTrustSignals(ORIGIN_MOCK); - expect(result).toStrictEqual({ - state: TrustSignalDisplayState.Warning, - label: null, + expect(result).toStrictEqual({ + state: TrustSignalDisplayState.Warning, + label: null, + }); }); }); @@ -88,11 +95,13 @@ describe('useOriginTrustSignals', () => { timestamp: TIMESTAMP_MOCK, }); - const result = useOriginTrustSignals(ORIGIN_MOCK); + renderHook(() => { + const result = useOriginTrustSignals(ORIGIN_MOCK); - expect(result).toStrictEqual({ - state: TrustSignalDisplayState.Verified, - label: null, + expect(result).toStrictEqual({ + state: TrustSignalDisplayState.Verified, + label: null, + }); }); }); @@ -105,11 +114,13 @@ describe('useOriginTrustSignals', () => { timestamp: TIMESTAMP_MOCK, }); - const result = useOriginTrustSignals(ORIGIN_MOCK); + renderHook(() => { + const result = useOriginTrustSignals(ORIGIN_MOCK); - expect(result).toStrictEqual({ - state: TrustSignalDisplayState.Unknown, - label: null, + expect(result).toStrictEqual({ + state: TrustSignalDisplayState.Unknown, + label: null, + }); }); }); @@ -122,11 +133,13 @@ describe('useOriginTrustSignals', () => { timestamp: TIMESTAMP_MOCK, }); - const result = useOriginTrustSignals(ORIGIN_MOCK); + renderHook(() => { + const result = useOriginTrustSignals(ORIGIN_MOCK); - expect(result).toStrictEqual({ - state: TrustSignalDisplayState.Unknown, - label: null, + expect(result).toStrictEqual({ + state: TrustSignalDisplayState.Unknown, + label: null, + }); }); }); @@ -139,26 +152,30 @@ describe('useOriginTrustSignals', () => { timestamp: TIMESTAMP_MOCK, }); - const result = useOriginTrustSignals(ORIGIN_MOCK); + renderHook(() => { + const result = useOriginTrustSignals(ORIGIN_MOCK); - expect(result).toStrictEqual({ - state: TrustSignalDisplayState.Unknown, - label: null, + expect(result).toStrictEqual({ + state: TrustSignalDisplayState.Unknown, + label: null, + }); }); }); it('returns unknown state when origin is invalid URL', () => { getUrlScanCacheResultMock.mockReturnValue(undefined); - const result = useOriginTrustSignals('not-a-valid-url'); - - expect(result).toStrictEqual({ - state: TrustSignalDisplayState.Unknown, - label: null, + renderHook(() => { + const result = useOriginTrustSignals('not-a-valid-url'); + + expect(result).toStrictEqual({ + state: TrustSignalDisplayState.Unknown, + label: null, + }); + expect(getUrlScanCacheResultMock).toHaveBeenCalledWith( + undefined, + undefined, + ); }); - expect(getUrlScanCacheResultMock).toHaveBeenCalledWith( - undefined, - undefined, - ); }); }); diff --git a/ui/hooks/usePolling.ts b/ui/hooks/usePolling.ts index 5bbd022effce..71d2dd80a43e 100644 --- a/ui/hooks/usePolling.ts +++ b/ui/hooks/usePolling.ts @@ -13,16 +13,27 @@ const usePolling = ( ) => { const pollTokenRef = useRef(null); const cleanupRef = useRef void)>(null); - let isMounted = false; + + const prevPollingInputStringified = useRef(null); + const hasPollingInputChanged = + JSON.stringify(usePollingOptions.input) !== + prevPollingInputStringified.current; + + const isMounted = useRef(false); + useEffect(() => { + isMounted.current = true; + return () => { + isMounted.current = false; + }; + }, []); + useEffect(() => { - if (usePollingOptions.enabled === false) { + if (usePollingOptions.enabled === false || !hasPollingInputChanged) { return () => { // noop }; } - isMounted = true; - const cleanup = () => { if (pollTokenRef.current) { usePollingOptions.stopPollingByPollingToken(pollTokenRef.current); @@ -35,21 +46,24 @@ const usePolling = ( .startPolling(usePollingOptions.input) .then((pollToken) => { pollTokenRef.current = pollToken; - // TODO: Fix in https://github.com/MetaMask/metamask-extension/issues/31880 - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - cleanupRef.current = usePollingOptions.callback?.(pollToken) || null; - if (!isMounted) { + cleanupRef.current = usePollingOptions.callback?.(pollToken) ?? null; + if (!isMounted.current) { cleanup(); } }); + prevPollingInputStringified.current = JSON.stringify( + usePollingOptions.input, + ); + // Return a cleanup function to stop polling when the component unmounts return () => { - isMounted = false; + prevPollingInputStringified.current = null; cleanup(); }; }, [ - usePollingOptions.input && JSON.stringify(usePollingOptions.input), + usePollingOptions.input, + hasPollingInputChanged, usePollingOptions.enabled, ]); }; diff --git a/ui/hooks/useScrollRequired.js b/ui/hooks/useScrollRequired.js index 20ea25121227..3a4cd3ffd3ff 100644 --- a/ui/hooks/useScrollRequired.js +++ b/ui/hooks/useScrollRequired.js @@ -1,4 +1,4 @@ -import { useEffect, useRef, useState } from 'react'; +import { useCallback, useEffect, useRef, useState } from 'react'; import { debounce } from 'lodash'; import { usePrevious } from './usePrevious'; @@ -24,7 +24,7 @@ export const useScrollRequired = ( const [isScrollableState, setIsScrollable] = useState(false); const [isScrolledToBottomState, setIsScrolledToBottom] = useState(false); - const update = () => { + const update = useCallback(() => { if (!ref.current) { return; } @@ -51,7 +51,7 @@ export const useScrollRequired = ( if (!isScrollable || isScrolledToBottom) { setHasScrolledToBottom(true); } - }; + }, [isScrollableState, offsetPxFromBottom]); useEffect(update, [ref, ...dependencies]); @@ -59,7 +59,7 @@ export const useScrollRequired = ( if (prevOffsetHeight !== ref.current?.offsetHeight) { update(); } - }, [ref.current?.offsetHeight]); + }, [update, ref.current?.offsetHeight, prevOffsetHeight]); const scrollToBottom = () => { setIsScrolledToBottom(true); diff --git a/ui/hooks/useTrustSignals.test.ts b/ui/hooks/useTrustSignals.test.ts index 82ecc0cab24a..ab9fec28c50a 100644 --- a/ui/hooks/useTrustSignals.test.ts +++ b/ui/hooks/useTrustSignals.test.ts @@ -1,3 +1,4 @@ +import { renderHook } from '@testing-library/react-hooks'; import { NameType } from '@metamask/name-controller'; import { getAddressSecurityAlertResponse } from '../selectors'; import { @@ -60,15 +61,17 @@ describe('useTrustSignals', () => { label: TRUST_LABEL_MOCK, }); - const result = useTrustSignal( - VALUE_MOCK, - NameType.ETHEREUM_ADDRESS, - '0x1', - ); + renderHook(() => { + const result = useTrustSignal( + VALUE_MOCK, + NameType.ETHEREUM_ADDRESS, + '0x1', + ); - expect(result).toStrictEqual({ - state: TrustSignalDisplayState.Malicious, - label: TRUST_LABEL_MOCK, + expect(result).toStrictEqual({ + state: TrustSignalDisplayState.Malicious, + label: TRUST_LABEL_MOCK, + }); }); }); }); @@ -91,18 +94,20 @@ describe('useTrustSignals', () => { }, ]; - const results = useTrustSignals(requests); + renderHook(() => { + const results = useTrustSignals(requests); - expect(results).toHaveLength(1); - expect(results[0]).toStrictEqual({ - state: TrustSignalDisplayState.Malicious, - label: TRUST_LABEL_MOCK, - }); + expect(results).toHaveLength(1); + expect(results[0]).toStrictEqual({ + state: TrustSignalDisplayState.Malicious, + label: TRUST_LABEL_MOCK, + }); - expect(getAddressSecurityAlertResponseMock).toHaveBeenCalledWith( - undefined, - `ethereum:${VALUE_MOCK.toLowerCase()}`, - ); + expect(getAddressSecurityAlertResponseMock).toHaveBeenCalledWith( + undefined, + `ethereum:${VALUE_MOCK.toLowerCase()}`, + ); + }); }); it('returns unknown state when no chain id is provided', () => { @@ -121,12 +126,14 @@ describe('useTrustSignals', () => { }, ]; - const results = useTrustSignals(requests); + renderHook(() => { + const results = useTrustSignals(requests); - expect(results).toHaveLength(1); - expect(results[0]).toStrictEqual({ - state: TrustSignalDisplayState.Unknown, - label: null, + expect(results).toHaveLength(1); + expect(results[0]).toStrictEqual({ + state: TrustSignalDisplayState.Unknown, + label: null, + }); }); }); @@ -146,12 +153,14 @@ describe('useTrustSignals', () => { }, ]; - const results = useTrustSignals(requests); + renderHook(() => { + const results = useTrustSignals(requests); - expect(results).toHaveLength(1); - expect(results[0]).toStrictEqual({ - state: TrustSignalDisplayState.Warning, - label: WARNING_LABEL_MOCK, + expect(results).toHaveLength(1); + expect(results[0]).toStrictEqual({ + state: TrustSignalDisplayState.Warning, + label: WARNING_LABEL_MOCK, + }); }); }); @@ -171,12 +180,14 @@ describe('useTrustSignals', () => { }, ]; - const results = useTrustSignals(requests); + renderHook(() => { + const results = useTrustSignals(requests); - expect(results).toHaveLength(1); - expect(results[0]).toStrictEqual({ - state: TrustSignalDisplayState.Verified, - label: VERIFIED_LABEL_MOCK, + expect(results).toHaveLength(1); + expect(results[0]).toStrictEqual({ + state: TrustSignalDisplayState.Verified, + label: VERIFIED_LABEL_MOCK, + }); }); }); @@ -196,12 +207,14 @@ describe('useTrustSignals', () => { }, ]; - const results = useTrustSignals(requests); + renderHook(() => { + const results = useTrustSignals(requests); - expect(results).toHaveLength(1); - expect(results[0]).toStrictEqual({ - state: TrustSignalDisplayState.Unknown, - label: 'Benign Address', + expect(results).toHaveLength(1); + expect(results[0]).toStrictEqual({ + state: TrustSignalDisplayState.Unknown, + label: 'Benign Address', + }); }); }); @@ -221,12 +234,14 @@ describe('useTrustSignals', () => { }, ]; - const results = useTrustSignals(requests); + renderHook(() => { + const results = useTrustSignals(requests); - expect(results).toHaveLength(1); - expect(results[0]).toStrictEqual({ - state: TrustSignalDisplayState.Unknown, - label: 'Error occurred', + expect(results).toHaveLength(1); + expect(results[0]).toStrictEqual({ + state: TrustSignalDisplayState.Unknown, + label: 'Error occurred', + }); }); }); @@ -243,12 +258,14 @@ describe('useTrustSignals', () => { }, ]; - const results = useTrustSignals(requests); + renderHook(() => { + const results = useTrustSignals(requests); - expect(results).toHaveLength(1); - expect(results[0]).toStrictEqual({ - state: TrustSignalDisplayState.Unknown, - label: 'Some label', + expect(results).toHaveLength(1); + expect(results[0]).toStrictEqual({ + state: TrustSignalDisplayState.Unknown, + label: 'Some label', + }); }); }); @@ -267,12 +284,14 @@ describe('useTrustSignals', () => { }, ]; - const results = useTrustSignals(requests); + renderHook(() => { + const results = useTrustSignals(requests); - expect(results).toHaveLength(1); - expect(results[0]).toStrictEqual({ - state: TrustSignalDisplayState.Verified, - label: null, + expect(results).toHaveLength(1); + expect(results[0]).toStrictEqual({ + state: TrustSignalDisplayState.Verified, + label: null, + }); }); }); }); @@ -289,12 +308,14 @@ describe('useTrustSignals', () => { }, ]; - const results = useTrustSignals(requests); + renderHook(() => { + const results = useTrustSignals(requests); - expect(results).toHaveLength(1); - expect(results[0]).toStrictEqual({ - state: TrustSignalDisplayState.Unknown, - label: null, + expect(results).toHaveLength(1); + expect(results[0]).toStrictEqual({ + state: TrustSignalDisplayState.Unknown, + label: null, + }); }); }); @@ -309,12 +330,14 @@ describe('useTrustSignals', () => { }, ]; - const results = useTrustSignals(requests); + renderHook(() => { + const results = useTrustSignals(requests); - expect(results).toHaveLength(1); - expect(results[0]).toStrictEqual({ - state: TrustSignalDisplayState.Unknown, - label: null, + expect(results).toHaveLength(1); + expect(results[0]).toStrictEqual({ + state: TrustSignalDisplayState.Unknown, + label: null, + }); }); }); @@ -334,12 +357,14 @@ describe('useTrustSignals', () => { }, ]; - const results = useTrustSignals(requests); + renderHook(() => { + const results = useTrustSignals(requests); - expect(results).toHaveLength(1); - expect(results[0]).toStrictEqual({ - state: TrustSignalDisplayState.Loading, - label: null, + expect(results).toHaveLength(1); + expect(results[0]).toStrictEqual({ + state: TrustSignalDisplayState.Loading, + label: null, + }); }); }); }); @@ -373,36 +398,40 @@ describe('useTrustSignals', () => { }, ]; - const results = useTrustSignals(requests); + renderHook(() => { + const results = useTrustSignals(requests); - expect(results).toHaveLength(2); - expect(results[0]).toStrictEqual({ - state: TrustSignalDisplayState.Malicious, - label: TRUST_LABEL_MOCK, - }); - expect(results[1]).toStrictEqual({ - state: TrustSignalDisplayState.Verified, - label: VERIFIED_LABEL_MOCK, - }); + expect(results).toHaveLength(2); + expect(results[0]).toStrictEqual({ + state: TrustSignalDisplayState.Malicious, + label: TRUST_LABEL_MOCK, + }); + expect(results[1]).toStrictEqual({ + state: TrustSignalDisplayState.Verified, + label: VERIFIED_LABEL_MOCK, + }); - expect(getAddressSecurityAlertResponseMock).toHaveBeenCalledTimes(2); - expect(getAddressSecurityAlertResponseMock).toHaveBeenNthCalledWith( - 1, - undefined, - `ethereum:${VALUE_MOCK.toLowerCase()}`, - ); - expect(getAddressSecurityAlertResponseMock).toHaveBeenNthCalledWith( - 2, - undefined, - `ethereum:${VALUE_MOCK_2.toLowerCase()}`, - ); + expect(getAddressSecurityAlertResponseMock).toHaveBeenCalledTimes(2); + expect(getAddressSecurityAlertResponseMock).toHaveBeenNthCalledWith( + 1, + undefined, + `ethereum:${VALUE_MOCK.toLowerCase()}`, + ); + expect(getAddressSecurityAlertResponseMock).toHaveBeenNthCalledWith( + 2, + undefined, + `ethereum:${VALUE_MOCK_2.toLowerCase()}`, + ); + }); }); it('handles empty requests array', () => { - const results = useTrustSignals([]); + renderHook(() => { + const results = useTrustSignals([]); - expect(results).toHaveLength(0); - expect(getAddressSecurityAlertResponseMock).not.toHaveBeenCalled(); + expect(results).toHaveLength(0); + expect(getAddressSecurityAlertResponseMock).not.toHaveBeenCalled(); + }); }); }); @@ -428,16 +457,18 @@ describe('useTrustSignals', () => { }, ]; - const results = useTrustSignals(requests); + renderHook(() => { + const results = useTrustSignals(requests); - expect(results).toHaveLength(2); - expect(results[0]).toStrictEqual({ - state: TrustSignalDisplayState.Malicious, - label: TRUST_LABEL_MOCK, - }); - expect(results[1]).toStrictEqual({ - state: TrustSignalDisplayState.Malicious, - label: TRUST_LABEL_MOCK, + expect(results).toHaveLength(2); + expect(results[0]).toStrictEqual({ + state: TrustSignalDisplayState.Malicious, + label: TRUST_LABEL_MOCK, + }); + expect(results[1]).toStrictEqual({ + state: TrustSignalDisplayState.Malicious, + label: TRUST_LABEL_MOCK, + }); }); }); }); diff --git a/ui/hooks/useTrustSignals.ts b/ui/hooks/useTrustSignals.ts index 70b9e29a54bf..662d16105305 100644 --- a/ui/hooks/useTrustSignals.ts +++ b/ui/hooks/useTrustSignals.ts @@ -1,3 +1,6 @@ +'use no memo'; +// TODO: Fix - Calling `useTrustSignals` from `useTrustSignal`, which is not a component, violates the rules of hooks. + import { useSelector } from 'react-redux'; import { NameType } from '@metamask/name-controller'; import { getAddressSecurityAlertResponse } from '../selectors'; diff --git a/ui/layouts/route-with-layout.tsx b/ui/layouts/route-with-layout.tsx index e62958b7bfe1..61f6b0f59639 100644 --- a/ui/layouts/route-with-layout.tsx +++ b/ui/layouts/route-with-layout.tsx @@ -55,7 +55,6 @@ export const RouteWithLayout = ({ {typeof children === 'function' ? children(props) : children} ); - // eslint-disable-next-line react-hooks/exhaustive-deps }, [Layout, Component, childrenDep]); if (authenticated) { diff --git a/ui/pages/asset/components/asset-page.tsx b/ui/pages/asset/components/asset-page.tsx index 0d2e3c7c9d99..5d9d6efc0ef5 100644 --- a/ui/pages/asset/components/asset-page.tsx +++ b/ui/pages/asset/components/asset-page.tsx @@ -84,7 +84,7 @@ import { import { getInternalAccountBySelectedAccountGroupAndCaip } from '../../../selectors/multichain-accounts/account-tree'; import { useSafeChains } from '../../settings/networks-tab/networks-form/use-safe-chains'; import { useCurrentPrice } from '../hooks/useCurrentPrice'; -import { Asset } from '../types/asset'; +import { isNativeAsset, type Asset } from '../types/asset'; import { AssetMarketDetails } from './asset-market-details'; import AssetChart from './chart/asset-chart'; import TokenButtons from './token-buttons'; @@ -167,7 +167,7 @@ const AssetPage = ({ return false; } }) ?? { - // TODO: remve the fallback case where the mutichainTokenWithFiatAmount is undefined + // TODO: remove the fallback case where the mutichainTokenWithFiatAmount is undefined // Root cause: There is a race condition where when switching from a non-EVM network // to an EVM network, the mutichainTokenWithFiatAmount is undefined // This is a workaround to avoid the error @@ -211,7 +211,7 @@ const AssetPage = ({ const { currentPrice } = useCurrentPrice(asset); - let balance, tokenFiatAmount, assetId; + let balance, tokenFiatAmount, assetId, updatedAsset; if (isMultichainAccountsState2Enabled) { const assetWithBalance = accountGroupIdAssets[chainId]?.find( (item) => @@ -226,10 +226,13 @@ const AssetPage = ({ tokenFiatAmount = assetWithBalance?.fiat?.balance ?? 0; const tokenHexBalance = assetWithBalance?.rawBalance as string; - asset.balance = { - value: hexToDecimal(tokenHexBalance), - display: balance, - fiat: String(tokenFiatAmount), + updatedAsset = { + ...asset, + balance: { + value: hexToDecimal(tokenHexBalance), + display: balance, + fiat: String(tokenFiatAmount), + }, }; } else { const tokenHexBalance = @@ -249,10 +252,13 @@ const AssetPage = ({ : 0; // this is needed in order to assign the correct balances to TokenButtons before navigating to send/swap screens - asset.balance = { - value: hexToDecimal(tokenHexBalance), - display: String(balance), - fiat: String(tokenFiatAmount), + updatedAsset = { + ...asset, + balance: { + value: hexToDecimal(tokenHexBalance), + display: String(balance), + fiat: String(tokenFiatAmount), + }, }; } @@ -367,7 +373,7 @@ const AssetPage = ({ asset={tokenWithFiatAmount as TokenFiatDisplayInfo} /> - {type === AssetType.native ? ( + {isNativeAsset(updatedAsset) ? ( ) : ( - + )} )} - + & { + type: typeof AssetType.native; + isOriginalNativeSymbol: boolean; +}; + +export type TokenAsset = Omit & { + type: typeof AssetType.token; + address: string; + aggregators?: string[]; +}; + +export const isNativeAsset = (inputAsset: Asset): inputAsset is NativeAsset => + inputAsset.type === AssetType.native && + 'isOriginalNativeSymbol' in inputAsset && + typeof inputAsset.isOriginalNativeSymbol === 'boolean'; + +export const isTokenAsset = (inputAsset: Asset): inputAsset is TokenAsset => + inputAsset.type === AssetType.token && + 'address' in inputAsset && + typeof inputAsset.address === 'string' && + ('aggregators' in inputAsset + ? typeof inputAsset.aggregators === 'object' && + (!inputAsset.aggregators.length || + typeof inputAsset.aggregators[0] === 'string') + : true); diff --git a/ui/pages/bridge/awaiting-signatures/awaiting-signatures.tsx b/ui/pages/bridge/awaiting-signatures/awaiting-signatures.tsx index f968fb202b57..e6ef84a46274 100644 --- a/ui/pages/bridge/awaiting-signatures/awaiting-signatures.tsx +++ b/ui/pages/bridge/awaiting-signatures/awaiting-signatures.tsx @@ -79,7 +79,6 @@ export default function AwaitingSignatures() { token_to_amount: activeQuote?.quote?.destTokenAmount ?? '', }, }); - // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const isSwap = diff --git a/ui/pages/bridge/prepare/prepare-bridge-page.tsx b/ui/pages/bridge/prepare/prepare-bridge-page.tsx index ce2e7833a472..57e84312cc26 100644 --- a/ui/pages/bridge/prepare/prepare-bridge-page.tsx +++ b/ui/pages/bridge/prepare/prepare-bridge-page.tsx @@ -429,16 +429,20 @@ const PrepareBridgePage = ({ ], ); - const debouncedUpdateQuoteRequestInController = useCallback( + // `useRef` is used here to manually memoize a function reference. + // `useCallback` and React Compiler don't understand that `debounce` returns an inline function reference. + // The function contains reactive dependencies, but they are `dispatch` and an action, + // making it safe not to worry about recreating this function on dependency updates. + const debouncedUpdateQuoteRequestInController = useRef( debounce((...args: Parameters) => { dispatch(updateQuoteRequestParams(...args)); }, 300), - [dispatch], ); useEffect(() => { return () => { - debouncedUpdateQuoteRequestInController.cancel(); + // This `ref` is safe from unintended mutations, because it points to a function reference, not any reactive node or element. + debouncedUpdateQuoteRequestInController.current.cancel(); }; }, []); @@ -463,8 +467,10 @@ const PrepareBridgePage = ({ Boolean, ) as string[], }; - debouncedUpdateQuoteRequestInController(quoteParams, eventProperties); - // eslint-disable-next-line react-hooks/exhaustive-deps + debouncedUpdateQuoteRequestInController.current( + quoteParams, + eventProperties, + ); }, [quoteParams]); // Use smart slippage defaults @@ -807,7 +813,7 @@ const PrepareBridgePage = ({ if (!quoteParams) { return; } - debouncedUpdateQuoteRequestInController(quoteParams, { + debouncedUpdateQuoteRequestInController.current(quoteParams, { // TODO: Fix in https://github.com/MetaMask/metamask-extension/issues/31860 // eslint-disable-next-line @typescript-eslint/naming-convention stx_enabled: smartTransactionsEnabled, diff --git a/ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.js b/ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.js index 0a60924c4f35..d42de2739eb5 100644 --- a/ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.js +++ b/ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.js @@ -185,7 +185,6 @@ const ConfirmAddSuggestedToken = ({ useEffect(() => { goBackIfNoSuggestedTokensOnFirstRender(); - // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return ( diff --git a/ui/pages/confirm-decrypt-message/confirm-decrypt-message.component.js b/ui/pages/confirm-decrypt-message/confirm-decrypt-message.component.js index 4e26423fc896..321b34c7c4e8 100644 --- a/ui/pages/confirm-decrypt-message/confirm-decrypt-message.component.js +++ b/ui/pages/confirm-decrypt-message/confirm-decrypt-message.component.js @@ -212,7 +212,7 @@ const MessageBody = forwardRef( const onDecryptMessage = async (event) => { event.stopPropagation(event); - const params = messageData.msgParams; + const params = { ...messageData.msgParams }; params.metamaskId = messageData.id; const result = await dispatch(decryptMsgInline(params)); @@ -349,7 +349,7 @@ const Footer = ({ const onSubmitClick = async (event) => { event.stopPropagation(event); - const params = messageData.msgParams; + const params = { ...messageData.msgParams }; params.metamaskId = messageData.id; await dispatch(decryptMsg(params)); diff --git a/ui/pages/confirmations/components/confirm/info/hooks/useDecodedTransactionData.ts b/ui/pages/confirmations/components/confirm/info/hooks/useDecodedTransactionData.ts index d824638c021d..53f4eec35d75 100644 --- a/ui/pages/confirmations/components/confirm/info/hooks/useDecodedTransactionData.ts +++ b/ui/pages/confirmations/components/confirm/info/hooks/useDecodedTransactionData.ts @@ -7,7 +7,7 @@ import { decodeTransactionData } from '../../../../../../store/actions'; import { DecodedTransactionDataResponse } from '../../../../../../../shared/types/transaction-decode'; import { useConfirmContext } from '../../../../context/confirm'; import { hasTransactionData } from '../../../../../../../shared/modules/transaction.utils'; -import { use4ByteResolutionSelector } from '../../../../../../selectors'; +import { getUse4ByteResolution } from '../../../../../../selectors'; export function useDecodedTransactionData({ data, @@ -19,7 +19,7 @@ export function useDecodedTransactionData({ transactionTypeFilter?: string; } = {}): AsyncResult { const { currentConfirmation } = useConfirmContext(); - const isDecodeEnabled = useSelector(use4ByteResolutionSelector); + const isDecodeEnabled = useSelector(getUse4ByteResolution); const currentTransactionType = currentConfirmation?.type; const chainId = currentConfirmation?.chainId as Hex; diff --git a/ui/pages/confirmations/components/confirm/info/hooks/useFourByte.ts b/ui/pages/confirmations/components/confirm/info/hooks/useFourByte.ts index 32f4a778f94d..a637460f5f50 100644 --- a/ui/pages/confirmations/components/confirm/info/hooks/useFourByte.ts +++ b/ui/pages/confirmations/components/confirm/info/hooks/useFourByte.ts @@ -3,14 +3,14 @@ import { useEffect } from 'react'; import { Hex } from '@metamask/utils'; import { getKnownMethodData, - use4ByteResolutionSelector, + getUse4ByteResolution, } from '../../../../../../selectors'; import { getContractMethodData } from '../../../../../../store/actions'; import { hasTransactionData } from '../../../../../../../shared/modules/transaction.utils'; export const useFourByte = ({ to, data }: { to?: Hex; data?: Hex }) => { const dispatch = useDispatch(); - const isFourByteEnabled = useSelector(use4ByteResolutionSelector); + const isFourByteEnabled = useSelector(getUse4ByteResolution); const transactionTo = to as Hex | undefined; const transactionData = data as Hex | undefined; diff --git a/ui/pages/confirmations/components/confirm/info/hooks/useNestedTransactionLabels.ts b/ui/pages/confirmations/components/confirm/info/hooks/useNestedTransactionLabels.ts index f04a5ca70b52..940b9936f896 100644 --- a/ui/pages/confirmations/components/confirm/info/hooks/useNestedTransactionLabels.ts +++ b/ui/pages/confirmations/components/confirm/info/hooks/useNestedTransactionLabels.ts @@ -15,7 +15,7 @@ export function useNestedTransactionLabels({ const { data, to } = nestedTransaction; // It's safe to call useFourByte here because the length of nestedTransactions // remains stable throughout the component's lifecycle. - // eslint-disable-next-line react-hooks/rules-of-hooks + // eslint-disable-next-line react-compiler/react-compiler, react-hooks/rules-of-hooks const methodData = useFourByte({ data, to }); const functionName = methodData?.name; diff --git a/ui/pages/confirmations/components/confirm/info/shared/transaction-details/transaction-details.tsx b/ui/pages/confirmations/components/confirm/info/shared/transaction-details/transaction-details.tsx index a146b3f7ee57..424de35699b5 100644 --- a/ui/pages/confirmations/components/confirm/info/shared/transaction-details/transaction-details.tsx +++ b/ui/pages/confirmations/components/confirm/info/shared/transaction-details/transaction-details.tsx @@ -46,7 +46,7 @@ export const OriginRow = () => { return ( { diff --git a/ui/pages/confirmations/confirm/__snapshots__/confirm.test.tsx.snap b/ui/pages/confirmations/confirm/__snapshots__/confirm.test.tsx.snap index bae98f3dcf62..a0ea4e459b75 100644 --- a/ui/pages/confirmations/confirm/__snapshots__/confirm.test.tsx.snap +++ b/ui/pages/confirmations/confirm/__snapshots__/confirm.test.tsx.snap @@ -319,7 +319,7 @@ exports[`Confirm should match snapshot for signature - typed sign - V4 - PermitB >
{ const { blockExplorerUrl, ...finalArgs } = args; - finalArgs.rpcPrefs = { - blockExplorerUrl, - }; + const requestData = useMemo( + () => ({ + ...finalArgs, + rpcPrefs: { + blockExplorerUrl, + }, + }), + [finalArgs, blockExplorerUrl], + ); return ( diff --git a/ui/pages/confirmations/context/confirm/index.tsx b/ui/pages/confirmations/context/confirm/index.tsx index 1037aae2bd02..56a6bd61cbdc 100644 --- a/ui/pages/confirmations/context/confirm/index.tsx +++ b/ui/pages/confirmations/context/confirm/index.tsx @@ -65,9 +65,7 @@ export const ConfirmContextProvider: React.FC<{ ); }; -// TODO: Fix in https://github.com/MetaMask/metamask-extension/issues/31860 -// eslint-disable-next-line @typescript-eslint/naming-convention -export const useConfirmContext = () => { +export const useConfirmContext = () => { const context = useContext(ConfirmContext); if (!context) { throw new Error( @@ -75,7 +73,7 @@ export const useConfirmContext = () => { ); } return context as { - currentConfirmation: T; + currentConfirmation: CurrentConfirmation; isScrollToBottomCompleted: boolean; setIsScrollToBottomCompleted: (isScrollToBottomCompleted: boolean) => void; }; diff --git a/ui/pages/confirmations/hooks/alerts/transactions/AccountTypeMessage.tsx b/ui/pages/confirmations/hooks/alerts/transactions/AccountTypeMessage.tsx index 2797b8cb4ee8..8a2bd70ac137 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/AccountTypeMessage.tsx +++ b/ui/pages/confirmations/hooks/alerts/transactions/AccountTypeMessage.tsx @@ -1,3 +1,5 @@ +'use no memo'; + import React from 'react'; import { ButtonLink, Text } from '../../../../../components/component-library'; import { diff --git a/ui/pages/confirmations/hooks/alerts/transactions/NonContractAddressAlertMessage.tsx b/ui/pages/confirmations/hooks/alerts/transactions/NonContractAddressAlertMessage.tsx index 991de2e4cfb7..6723d544a4b9 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/NonContractAddressAlertMessage.tsx +++ b/ui/pages/confirmations/hooks/alerts/transactions/NonContractAddressAlertMessage.tsx @@ -1,3 +1,5 @@ +'use no memo'; + import { TransactionMeta } from '@metamask/transaction-controller'; import { Hex } from '@metamask/utils'; import React from 'react'; diff --git a/ui/pages/confirmations/hooks/alerts/transactions/PendingTransactionAlertMessage.tsx b/ui/pages/confirmations/hooks/alerts/transactions/PendingTransactionAlertMessage.tsx index ce2b1dcc28f8..65f1eb9d662b 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/PendingTransactionAlertMessage.tsx +++ b/ui/pages/confirmations/hooks/alerts/transactions/PendingTransactionAlertMessage.tsx @@ -1,3 +1,5 @@ +'use no memo'; + import React from 'react'; import { ButtonLink, Text } from '../../../../../components/component-library'; import { diff --git a/ui/pages/confirmations/hooks/alerts/transactions/ShieldCoverageAlertMessage.tsx b/ui/pages/confirmations/hooks/alerts/transactions/ShieldCoverageAlertMessage.tsx index 38c0eede6e03..b68479e88c1b 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/ShieldCoverageAlertMessage.tsx +++ b/ui/pages/confirmations/hooks/alerts/transactions/ShieldCoverageAlertMessage.tsx @@ -1,3 +1,5 @@ +'use no memo'; + import React from 'react'; import { ButtonLink, Text } from '../../../../../components/component-library'; import { diff --git a/ui/pages/confirmations/hooks/alerts/transactions/useAccountTypeUpgrade.ts b/ui/pages/confirmations/hooks/alerts/transactions/useAccountTypeUpgrade.ts index adf4aa442178..483b4afdec58 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/useAccountTypeUpgrade.ts +++ b/ui/pages/confirmations/hooks/alerts/transactions/useAccountTypeUpgrade.ts @@ -1,3 +1,5 @@ +'use no memo'; + import { useMemo } from 'react'; import { useI18nContext } from '../../../../../hooks/useI18nContext'; import { Alert } from '../../../../../ducks/confirm-alerts/confirm-alerts'; diff --git a/ui/pages/confirmations/hooks/alerts/transactions/useBurnAddressAlert.ts b/ui/pages/confirmations/hooks/alerts/transactions/useBurnAddressAlert.ts index 069c89387321..eb61cd428f06 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/useBurnAddressAlert.ts +++ b/ui/pages/confirmations/hooks/alerts/transactions/useBurnAddressAlert.ts @@ -1,3 +1,5 @@ +'use no memo'; + import { useMemo } from 'react'; import { Alert } from '../../../../../ducks/confirm-alerts/confirm-alerts'; import { Severity } from '../../../../../helpers/constants/design-system'; @@ -48,5 +50,5 @@ export function useBurnAddressAlert(): Alert[] { isBlocking: true, }, ]; - }, [hasBurnAddressRecipient]); + }, [hasBurnAddressRecipient, t]); } diff --git a/ui/pages/confirmations/hooks/alerts/transactions/useContractCode.ts b/ui/pages/confirmations/hooks/alerts/transactions/useContractCode.ts index 0649043b8703..a6d644173a15 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/useContractCode.ts +++ b/ui/pages/confirmations/hooks/alerts/transactions/useContractCode.ts @@ -1,3 +1,5 @@ +'use no memo'; + import { Hex } from '@metamask/utils'; import { addHexPrefix, padToEven } from 'ethereumjs-util'; import { useCallback } from 'react'; diff --git a/ui/pages/confirmations/hooks/alerts/transactions/useFirstTimeInteractionAlert.ts b/ui/pages/confirmations/hooks/alerts/transactions/useFirstTimeInteractionAlert.ts index d1fcb03aac7c..9c1f6893e6f5 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/useFirstTimeInteractionAlert.ts +++ b/ui/pages/confirmations/hooks/alerts/transactions/useFirstTimeInteractionAlert.ts @@ -1,3 +1,5 @@ +'use no memo'; + import { useMemo } from 'react'; import { TransactionMeta } from '@metamask/transaction-controller'; import { NameType } from '@metamask/name-controller'; diff --git a/ui/pages/confirmations/hooks/alerts/transactions/useGasEstimateFailedAlerts.ts b/ui/pages/confirmations/hooks/alerts/transactions/useGasEstimateFailedAlerts.ts index 15b05f2a1937..db36c0f6e25f 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/useGasEstimateFailedAlerts.ts +++ b/ui/pages/confirmations/hooks/alerts/transactions/useGasEstimateFailedAlerts.ts @@ -1,3 +1,5 @@ +'use no memo'; + import { TransactionMeta } from '@metamask/transaction-controller'; import { useMemo } from 'react'; import { Severity } from '../../../../../helpers/constants/design-system'; diff --git a/ui/pages/confirmations/hooks/alerts/transactions/useGasFeeLowAlerts.ts b/ui/pages/confirmations/hooks/alerts/transactions/useGasFeeLowAlerts.ts index 931efd07c9b6..063c84874fc8 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/useGasFeeLowAlerts.ts +++ b/ui/pages/confirmations/hooks/alerts/transactions/useGasFeeLowAlerts.ts @@ -1,3 +1,5 @@ +'use no memo'; + import { useMemo } from 'react'; import { TransactionMeta } from '@metamask/transaction-controller'; import { useGasFeeContext } from '../../../../../contexts/gasFee'; diff --git a/ui/pages/confirmations/hooks/alerts/transactions/useGasTooLowAlerts.ts b/ui/pages/confirmations/hooks/alerts/transactions/useGasTooLowAlerts.ts index 32db6c91cd95..801a3e2cbfce 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/useGasTooLowAlerts.ts +++ b/ui/pages/confirmations/hooks/alerts/transactions/useGasTooLowAlerts.ts @@ -1,3 +1,5 @@ +'use no memo'; + import { TransactionMeta } from '@metamask/transaction-controller'; import { useMemo } from 'react'; import { MIN_GAS_LIMIT_DEC } from '../../../send-legacy/send.constants'; diff --git a/ui/pages/confirmations/hooks/alerts/transactions/useInsufficientBalanceAlerts.ts b/ui/pages/confirmations/hooks/alerts/transactions/useInsufficientBalanceAlerts.ts index 3b5ac0fc1ef5..a69e16de554e 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/useInsufficientBalanceAlerts.ts +++ b/ui/pages/confirmations/hooks/alerts/transactions/useInsufficientBalanceAlerts.ts @@ -1,3 +1,5 @@ +'use no memo'; + import { TransactionMeta } from '@metamask/transaction-controller'; import { CaipChainId, Hex } from '@metamask/utils'; import { useMemo } from 'react'; diff --git a/ui/pages/confirmations/hooks/alerts/transactions/useMultipleApprovalsAlerts.ts b/ui/pages/confirmations/hooks/alerts/transactions/useMultipleApprovalsAlerts.ts index 98da34fdbf32..8febddb804e8 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/useMultipleApprovalsAlerts.ts +++ b/ui/pages/confirmations/hooks/alerts/transactions/useMultipleApprovalsAlerts.ts @@ -1,3 +1,5 @@ +'use no memo'; + import { NestedTransactionMetadata, SimulationErrorCode, diff --git a/ui/pages/confirmations/hooks/alerts/transactions/useNoGasPriceAlerts.ts b/ui/pages/confirmations/hooks/alerts/transactions/useNoGasPriceAlerts.ts index 38f65254eac1..e843ade115b1 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/useNoGasPriceAlerts.ts +++ b/ui/pages/confirmations/hooks/alerts/transactions/useNoGasPriceAlerts.ts @@ -1,3 +1,5 @@ +'use no memo'; + import { useSelector } from 'react-redux'; import { TransactionMeta, diff --git a/ui/pages/confirmations/hooks/alerts/transactions/useNonContractAddressAlerts.ts b/ui/pages/confirmations/hooks/alerts/transactions/useNonContractAddressAlerts.ts index 6d78d21bc860..480a92a91986 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/useNonContractAddressAlerts.ts +++ b/ui/pages/confirmations/hooks/alerts/transactions/useNonContractAddressAlerts.ts @@ -1,3 +1,5 @@ +'use no memo'; + import { TransactionMeta, TransactionType, diff --git a/ui/pages/confirmations/hooks/alerts/transactions/usePendingTransactionAlerts.ts b/ui/pages/confirmations/hooks/alerts/transactions/usePendingTransactionAlerts.ts index 62de67182363..004291752ead 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/usePendingTransactionAlerts.ts +++ b/ui/pages/confirmations/hooks/alerts/transactions/usePendingTransactionAlerts.ts @@ -1,3 +1,5 @@ +'use no memo'; + import { TransactionMeta } from '@metamask/transaction-controller'; import { useMemo } from 'react'; import { useSelector } from 'react-redux'; diff --git a/ui/pages/confirmations/hooks/alerts/transactions/useResimulationAlert.ts b/ui/pages/confirmations/hooks/alerts/transactions/useResimulationAlert.ts index 5f2ac4817804..fcac583cc0d4 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/useResimulationAlert.ts +++ b/ui/pages/confirmations/hooks/alerts/transactions/useResimulationAlert.ts @@ -1,3 +1,5 @@ +'use no memo'; + import { useMemo } from 'react'; import { TransactionMeta } from '@metamask/transaction-controller'; diff --git a/ui/pages/confirmations/hooks/alerts/transactions/useSigningOrSubmittingAlerts.ts b/ui/pages/confirmations/hooks/alerts/transactions/useSigningOrSubmittingAlerts.ts index 585754d21afc..7ea0fa890751 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/useSigningOrSubmittingAlerts.ts +++ b/ui/pages/confirmations/hooks/alerts/transactions/useSigningOrSubmittingAlerts.ts @@ -1,3 +1,5 @@ +'use no memo'; + import { TransactionMeta } from '@metamask/transaction-controller'; import { useMemo } from 'react'; import { useSelector } from 'react-redux'; diff --git a/ui/pages/confirmations/hooks/useAssetDetails.js b/ui/pages/confirmations/hooks/useAssetDetails.js index d62b68d2271a..fa6791efa77a 100644 --- a/ui/pages/confirmations/hooks/useAssetDetails.js +++ b/ui/pages/confirmations/hooks/useAssetDetails.js @@ -1,5 +1,5 @@ import { isEqual } from 'lodash'; -import { useState, useEffect } from 'react'; +import { useState, useEffect, useRef } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { getTokensByChainId } from '../../../ducks/metamask/metamask'; import { getAssetDetails } from '../../../helpers/utils/token-util'; @@ -18,6 +18,7 @@ export function useAssetDetails( transactionData, chainId, ) { + const isMounted = useRef(false); const dispatch = useDispatch(); // state selectors @@ -42,6 +43,13 @@ export function useAssetDetails( const prevTransactionData = usePrevious(transactionData); const prevTokenBalance = usePrevious(tokensWithBalances); + useEffect(() => { + isMounted.current = true; + return () => { + isMounted.current = false; + }; + }, []); + useEffect(() => { if (!tokenAddress && !userAddress && !transactionData) { return; @@ -57,7 +65,9 @@ export function useAssetDetails( nfts, chainId, ); - setCurrentAsset(assetDetails); + if (isMounted.current) { + setCurrentAsset(assetDetails); + } } catch (e) { console.warn('Unable to set asset details', { error: e, diff --git a/ui/pages/confirmations/hooks/useConfirmationAlertMetrics.ts b/ui/pages/confirmations/hooks/useConfirmationAlertMetrics.ts index 84bd123e4bee..eb5c0b905dc5 100644 --- a/ui/pages/confirmations/hooks/useConfirmationAlertMetrics.ts +++ b/ui/pages/confirmations/hooks/useConfirmationAlertMetrics.ts @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useState } from 'react'; +import { useCallback, useEffect, useMemo, useState } from 'react'; import { validate as isUuid } from 'uuid'; import useAlerts from '../../../hooks/useAlerts'; @@ -55,7 +55,31 @@ function getAlertName(alertKey: string): string { export function useConfirmationAlertMetrics() { const { currentConfirmation } = useConfirmContext(); const ownerId = currentConfirmation?.id ?? ''; + const { alerts, isAlertConfirmed } = useAlerts(ownerId); + const alertsProperties = useMemo(() => { + return alerts.length > 0 + ? { + // TODO: Fix in https://github.com/MetaMask/metamask-extension/issues/31860 + // eslint-disable-next-line @typescript-eslint/naming-convention + alert_triggered_count: alerts.length, + // TODO: Fix in https://github.com/MetaMask/metamask-extension/issues/31860 + // eslint-disable-next-line @typescript-eslint/naming-convention + alert_triggered: getAlertNames(alerts), + // TODO: Fix in https://github.com/MetaMask/metamask-extension/issues/31860 + // eslint-disable-next-line @typescript-eslint/naming-convention + alert_resolved_count: alerts.filter((alert) => + isAlertConfirmed(alert.key), + ).length, + // TODO: Fix in https://github.com/MetaMask/metamask-extension/issues/31860 + // eslint-disable-next-line @typescript-eslint/naming-convention + alert_resolved: getAlertNames( + alerts.filter((alert) => isAlertConfirmed(alert.key)), + ), + } + : undefined; + }, [alerts, isAlertConfirmed]); + const { updateSignatureEventFragment } = useSignatureEventFragment(); const { updateTransactionEventFragment } = useTransactionEventFragment(); @@ -75,28 +99,11 @@ export function useConfirmationAlertMetrics() { alert_action_clicked: [], }); - const properties = - alerts.length > 0 - ? { - // TODO: Fix in https://github.com/MetaMask/metamask-extension/issues/31860 - // eslint-disable-next-line @typescript-eslint/naming-convention - alert_triggered_count: alerts.length, - // TODO: Fix in https://github.com/MetaMask/metamask-extension/issues/31860 - // eslint-disable-next-line @typescript-eslint/naming-convention - alert_triggered: getAlertNames(alerts), - // TODO: Fix in https://github.com/MetaMask/metamask-extension/issues/31860 - // eslint-disable-next-line @typescript-eslint/naming-convention - alert_resolved_count: alerts.filter((alert) => - isAlertConfirmed(alert.key), - ).length, - // TODO: Fix in https://github.com/MetaMask/metamask-extension/issues/31860 - // eslint-disable-next-line @typescript-eslint/naming-convention - alert_resolved: getAlertNames( - alerts.filter((alert) => isAlertConfirmed(alert.key)), - ), - ...metricsProperties, - } + const properties = useMemo(() => { + return alertsProperties + ? { ...alertsProperties, ...metricsProperties } : undefined; + }, [alertsProperties, metricsProperties]); const trackAlertRender = useCallback((alertKey: string) => { setMetricsProperties((prevState) => { @@ -145,7 +152,13 @@ export function useConfirmationAlertMetrics() { } else { updateTransactionEventFragment({ properties }, ownerId); } - }, [JSON.stringify(properties), updateTransactionEventFragment, ownerId]); + }, [ + updateSignatureEventFragment, + updateTransactionEventFragment, + ownerId, + properties, + currentConfirmation, + ]); useEffect(() => { updateAlertMetrics(); diff --git a/ui/pages/confirmations/hooks/useGetTokenStandardAndDetails.ts b/ui/pages/confirmations/hooks/useGetTokenStandardAndDetails.ts index 8273c742102c..0dd988ea5a17 100644 --- a/ui/pages/confirmations/hooks/useGetTokenStandardAndDetails.ts +++ b/ui/pages/confirmations/hooks/useGetTokenStandardAndDetails.ts @@ -1,3 +1,4 @@ +import { useMemo } from 'react'; import { Hex } from '@metamask/utils'; import { TokenStandard } from '../../../../shared/constants/transaction'; @@ -29,17 +30,18 @@ export const useGetTokenStandardAndDetails = ( )) as TokenDetailsERC20; }, [tokenAddress]); - if (!details) { - return { decimalsNumber: undefined }; - } + return useMemo(() => { + if (!details) { + return { decimalsNumber: undefined }; + } + const { decimals, standard } = details; - const { decimals, standard } = details || {}; + if (standard === TokenStandard.ERC20) { + const parsedDecimals = + parseTokenDetailDecimals(decimals) ?? ERC20_DEFAULT_DECIMALS; + return { ...details, decimalsNumber: parsedDecimals }; + } - if (standard === TokenStandard.ERC20) { - const parsedDecimals = - parseTokenDetailDecimals(decimals) ?? ERC20_DEFAULT_DECIMALS; - details.decimalsNumber = parsedDecimals; - } - - return details; + return details; + }, [details]); }; diff --git a/ui/pages/create-account/connect-hardware/index.js b/ui/pages/create-account/connect-hardware/index.js index 1bb233ff5a0b..ddaa659f1dbd 100644 --- a/ui/pages/create-account/connect-hardware/index.js +++ b/ui/pages/create-account/connect-hardware/index.js @@ -1,3 +1,6 @@ +'use no memo'; +// TODO: Enable React Compiler once this has been migrated to a functional component. + import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; @@ -420,7 +423,6 @@ class ConnectHardwareForm extends Component { <> {this.context.t('troubleConnectingToLedgerU2FOnFirefox', [ - // eslint-disable-next-line react/jsx-key