Skip to content

Commit 72dc005

Browse files
committed
Merge branch 'main' into prices-v3-upgrade
2 parents 0c67149 + f167e26 commit 72dc005

File tree

452 files changed

+3817
-3083
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

452 files changed

+3817
-3083
lines changed

.depcheckrc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ignores:
88
- '@lavamoat/webpack'
99
- '@lavamoat/allow-scripts'
1010
- '@babel/runtime'
11+
- 'react-compiler-runtime'
1112
- '@fortawesome/fontawesome-free'
1213
- 'punycode'
1314
# injected via build system
@@ -83,6 +84,7 @@ ignores:
8384
- 'core-js-pure' # polyfills
8485
# babel
8586
- '@babel/plugin-transform-logical-assignment-operators'
87+
- 'babel-plugin-react-compiler'
8688
# used in image optimization script
8789
- 'sharp'
8890
# trezor

.eslintrc.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,9 @@ module.exports = {
320320
jsx: true,
321321
},
322322
},
323-
plugins: ['react'],
323+
plugins: ['react', 'react-compiler'],
324324
rules: {
325+
'react-compiler/react-compiler': 'error',
325326
'react/no-unused-prop-types': 'error',
326327
'react/no-unused-state': 'error',
327328
'react/jsx-boolean-value': 'error',
@@ -362,8 +363,9 @@ module.exports = {
362363
jsx: true,
363364
},
364365
},
365-
plugins: ['react'],
366+
plugins: ['react', 'react-compiler'],
366367
rules: {
368+
'react-compiler/react-compiler': 'error',
367369
'react/no-unused-prop-types': 'warn',
368370
'react/no-unused-state': 'warn',
369371
'react/jsx-boolean-value': 'off',

app/scripts/background.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,8 @@ export async function loadStateFromPersistence(backup) {
918918
migrations,
919919
defaultVersion: process.env.WITH_STATE
920920
? // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires, node/global-require
921-
require('../../test/e2e/default-fixture').FIXTURE_STATE_METADATA_VERSION
921+
require('../../test/e2e/fixtures/fixture-builder')
922+
.FIXTURE_STATE_METADATA_VERSION
922923
: null,
923924
});
924925

app/scripts/fixtures/generate-wallet-state.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ import { cloneDeep } from 'lodash';
55
import { hexToDecimal } from '../../../shared/modules/conversion.utils';
66
import { UI_NOTIFICATIONS } from '../../../shared/notifications';
77
import { WALLET_PASSWORD } from '../../../test/e2e/constants';
8-
import { E2E_SRP, defaultFixture } from '../../../test/e2e/default-fixture';
9-
import FixtureBuilder from '../../../test/e2e/fixture-builder';
8+
import {
9+
E2E_SRP,
10+
defaultFixture,
11+
} from '../../../test/e2e/fixtures/default-fixture';
12+
import FixtureBuilder from '../../../test/e2e/fixtures/fixture-builder';
1013
import { encryptorFactory } from '../lib/encryptor-factory';
1114
import { normalizeSafeAddress } from '../lib/multichain/address';
1215
import { getRootMessenger } from '../lib/messenger';

app/scripts/lib/network-controller/messenger-action-handlers.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ describe('onRpcEndpointUnavailable', () => {
7575
event: 'RPC Service Unavailable',
7676
properties: {
7777
chain_id_caip: 'eip155:11155111',
78+
rpc_domain: 'example.com',
7879
rpc_endpoint_url: 'example.com',
7980
},
8081
});
@@ -104,6 +105,7 @@ describe('onRpcEndpointUnavailable', () => {
104105
properties: {
105106
chain_id_caip: 'eip155:11155111',
106107
http_status: 420,
108+
rpc_domain: 'example.com',
107109
rpc_endpoint_url: 'example.com',
108110
},
109111
});
@@ -132,6 +134,7 @@ describe('onRpcEndpointUnavailable', () => {
132134
event: 'RPC Service Unavailable',
133135
properties: {
134136
chain_id_caip: 'eip155:11155111',
137+
rpc_domain: 'custom',
135138
rpc_endpoint_url: 'custom',
136139
},
137140
});
@@ -228,6 +231,7 @@ describe('onRpcEndpointDegraded', () => {
228231
event: 'RPC Service Degraded',
229232
properties: {
230233
chain_id_caip: 'eip155:11155111',
234+
rpc_domain: 'example.com',
231235
rpc_endpoint_url: 'example.com',
232236
},
233237
});
@@ -257,6 +261,7 @@ describe('onRpcEndpointDegraded', () => {
257261
properties: {
258262
chain_id_caip: 'eip155:11155111',
259263
http_status: 420,
264+
rpc_domain: 'example.com',
260265
rpc_endpoint_url: 'example.com',
261266
},
262267
});
@@ -285,6 +290,7 @@ describe('onRpcEndpointDegraded', () => {
285290
event: 'RPC Service Degraded',
286291
properties: {
287292
chain_id_caip: 'eip155:11155111',
293+
rpc_domain: 'custom',
288294
rpc_endpoint_url: 'custom',
289295
},
290296
});

app/scripts/lib/network-controller/messenger-action-handlers.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,16 @@ export function trackRpcEndpointEvent(
137137
return;
138138
}
139139

140+
const sanitizedUrl = isPublicEndpointUrl(endpointUrl, infuraProjectId)
141+
? onlyKeepHost(endpointUrl)
142+
: 'custom';
143+
140144
// The names of Segment properties have a particular case.
141145
/* eslint-disable @typescript-eslint/naming-convention */
142146
const properties = {
143147
chain_id_caip: `eip155:${hexToNumber(chainId)}`,
144-
rpc_endpoint_url: isPublicEndpointUrl(endpointUrl, infuraProjectId)
145-
? onlyKeepHost(endpointUrl)
146-
: 'custom',
148+
rpc_domain: sanitizedUrl,
149+
rpc_endpoint_url: sanitizedUrl, // @deprecated - Will be removed in a future release.
147150
...(isObject(error) &&
148151
'httpStatus' in error &&
149152
isValidJson(error.httpStatus)

babel.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,23 @@ const path = require('path');
22

33
module.exports = function (api) {
44
api.cache(false);
5+
const slash = `\\${path.sep}`;
56
return {
67
parserOpts: {
78
strictMode: true,
89
},
910
targets: {
1011
browsers: ['chrome >= 89', 'firefox >= 89'],
1112
},
13+
overrides: [
14+
{
15+
test: new RegExp(
16+
`^${path.join(__dirname, 'ui')}${slash}(?:components|contexts|hooks|layouts|pages)${slash}(?:.(?!\\.(?:test|stories|container)))+\\.(?:m?[jt]s|[jt]sx)$`,
17+
'u',
18+
),
19+
plugins: [['babel-plugin-react-compiler', { target: '17' }]],
20+
},
21+
],
1222
plugins: [
1323
// `browserify` is old and busted, and doesn't support `??=` (and other
1424
// logical assignment operators). This plugin lets us target es2020-level

0 commit comments

Comments
 (0)