Skip to content

Commit 26d1260

Browse files
committed
feat(suite): enable react compiler
1 parent 2ddb7aa commit 26d1260

File tree

6 files changed

+64
-8
lines changed

6 files changed

+64
-8
lines changed

packages/eslint/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@
2020
"eslint-plugin-react": "^7.37.4",
2121
"eslint-plugin-react-hooks": "^5.1.0",
2222
"typescript-eslint": "^8.23.0"
23+
},
24+
"dependencies": {
25+
"eslint-plugin-react-compiler": "19.0.0-beta-40c6c23-20250301"
2326
}
2427
}

packages/eslint/src/reactConfig.mjs

+2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import pluginReact from 'eslint-plugin-react';
2+
import reactCompiler from 'eslint-plugin-react-compiler';
23
import pluginReactHooks from 'eslint-plugin-react-hooks';
34

45
export const reactConfig = [
56
// React
67
pluginReact.configs.flat.recommended,
8+
reactCompiler.configs.recommended,
79
{
810
languageOptions: {
911
...pluginReact.configs.flat.recommended.languageOptions,

packages/suite-build/configs/base.webpack.config.ts

+2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ const config: webpack.Configuration = {
120120
preprocess: true,
121121
},
122122
],
123+
['babel-plugin-react-compiler', { target: '19' }],
124+
123125
...(isDev ? ['react-refresh/babel'] : []),
124126
],
125127
},

packages/suite-build/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"@trezor/bundler-security": "workspace:*",
2727
"@trezor/suite": "workspace:*",
2828
"babel-loader": "^9.1.3",
29+
"babel-plugin-react-compiler": "19.0.0-beta-40c6c23-20250301",
2930
"babel-plugin-styled-components": "^2.1.4",
3031
"copy-webpack-plugin": "^12.0.2",
3132
"crypto-browserify": "^3.12.0",

packages/suite-web/vite.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ export default defineConfig({
180180
fileName: false,
181181
},
182182
],
183+
['babel-plugin-react-compiler', { target: '19' }],
183184
],
184185
},
185186
}),

yarn.lock

+55-8
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ __metadata:
138138
languageName: node
139139
linkType: hard
140140

141-
"@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.13.16, @babel/core@npm:^7.18.5, @babel/core@npm:^7.18.9, @babel/core@npm:^7.20.0, @babel/core@npm:^7.23.9, @babel/core@npm:^7.25.2, @babel/core@npm:^7.26.0":
141+
"@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.13.16, @babel/core@npm:^7.18.5, @babel/core@npm:^7.18.9, @babel/core@npm:^7.20.0, @babel/core@npm:^7.23.9, @babel/core@npm:^7.24.4, @babel/core@npm:^7.25.2, @babel/core@npm:^7.26.0":
142142
version: 7.26.9
143143
resolution: "@babel/core@npm:7.26.9"
144144
dependencies:
@@ -611,6 +611,18 @@ __metadata:
611611
languageName: node
612612
linkType: hard
613613

614+
"@babel/plugin-proposal-private-methods@npm:^7.18.6":
615+
version: 7.18.6
616+
resolution: "@babel/plugin-proposal-private-methods@npm:7.18.6"
617+
dependencies:
618+
"@babel/helper-create-class-features-plugin": "npm:^7.18.6"
619+
"@babel/helper-plugin-utils": "npm:^7.18.6"
620+
peerDependencies:
621+
"@babel/core": ^7.0.0-0
622+
checksum: 10/22d8502ee96bca99ad2c8393e8493e2b8d4507576dd054490fd8201a36824373440106f5b098b6d821b026c7e72b0424ff4aeca69ed5f42e48f029d3a156d5ad
623+
languageName: node
624+
linkType: hard
625+
614626
"@babel/plugin-proposal-private-property-in-object@npm:7.21.0-placeholder-for-preset-env.2":
615627
version: 7.21.0-placeholder-for-preset-env.2
616628
resolution: "@babel/plugin-proposal-private-property-in-object@npm:7.21.0-placeholder-for-preset-env.2"
@@ -1774,7 +1786,7 @@ __metadata:
17741786
languageName: node
17751787
linkType: hard
17761788

1777-
"@babel/types@npm:^7.0.0, @babel/types@npm:^7.18.2, @babel/types@npm:^7.18.9, @babel/types@npm:^7.20.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.24.7, @babel/types@npm:^7.25.2, @babel/types@npm:^7.25.9, @babel/types@npm:^7.26.9, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3":
1789+
"@babel/types@npm:^7.0.0, @babel/types@npm:^7.18.2, @babel/types@npm:^7.18.9, @babel/types@npm:^7.19.0, @babel/types@npm:^7.20.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.24.7, @babel/types@npm:^7.25.2, @babel/types@npm:^7.25.9, @babel/types@npm:^7.26.9, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3":
17781790
version: 7.26.9
17791791
resolution: "@babel/types@npm:7.26.9"
17801792
dependencies:
@@ -9730,7 +9742,6 @@ __metadata:
97309742
"@types/invity-api": "npm:^1.1.5"
97319743
react: "npm:^19.0.0"
97329744
react-redux: "npm:8.0.7"
9733-
uuid: "npm:^11.0.5"
97349745
languageName: unknown
97359746
linkType: soft
97369747

@@ -12150,6 +12161,7 @@ __metadata:
1215012161
eslint-plugin-jsx-a11y: "npm:^6.10.2"
1215112162
eslint-plugin-local-rules: "npm:^3.0.2"
1215212163
eslint-plugin-react: "npm:^7.37.4"
12164+
eslint-plugin-react-compiler: "npm:19.0.0-beta-40c6c23-20250301"
1215312165
eslint-plugin-react-hooks: "npm:^5.1.0"
1215412166
typescript-eslint: "npm:^8.23.0"
1215512167
languageName: unknown
@@ -12352,6 +12364,7 @@ __metadata:
1235212364
"@types/webpack-bundle-analyzer": "npm:^4.7.0"
1235312365
"@types/webpack-plugin-serve": "npm:^1.4.6"
1235412366
babel-loader: "npm:^9.1.3"
12367+
babel-plugin-react-compiler: "npm:19.0.0-beta-40c6c23-20250301"
1235512368
babel-plugin-styled-components: "npm:^2.1.4"
1235612369
copy-webpack-plugin: "npm:^12.0.2"
1235712370
crypto-browserify: "npm:^3.12.0"
@@ -16425,6 +16438,15 @@ __metadata:
1642516438
languageName: node
1642616439
linkType: hard
1642716440

16441+
"babel-plugin-react-compiler@npm:19.0.0-beta-40c6c23-20250301":
16442+
version: 19.0.0-beta-40c6c23-20250301
16443+
resolution: "babel-plugin-react-compiler@npm:19.0.0-beta-40c6c23-20250301"
16444+
dependencies:
16445+
"@babel/types": "npm:^7.19.0"
16446+
checksum: 10/01d517805ae09c92c1d43b9048a5e07fe9e612803f856571e9d61da0dd686a38a04f062c323007814430f9f6600c4fc79cbc9e8d43007a932ddb43760f231551
16447+
languageName: node
16448+
linkType: hard
16449+
1642816450
"babel-plugin-react-native-web@npm:~0.19.13":
1642916451
version: 0.19.13
1643016452
resolution: "babel-plugin-react-native-web@npm:0.19.13"
@@ -22433,6 +22455,22 @@ __metadata:
2243322455
languageName: node
2243422456
linkType: hard
2243522457

22458+
"eslint-plugin-react-compiler@npm:19.0.0-beta-40c6c23-20250301":
22459+
version: 19.0.0-beta-40c6c23-20250301
22460+
resolution: "eslint-plugin-react-compiler@npm:19.0.0-beta-40c6c23-20250301"
22461+
dependencies:
22462+
"@babel/core": "npm:^7.24.4"
22463+
"@babel/parser": "npm:^7.24.4"
22464+
"@babel/plugin-proposal-private-methods": "npm:^7.18.6"
22465+
hermes-parser: "npm:^0.25.1"
22466+
zod: "npm:^3.22.4"
22467+
zod-validation-error: "npm:^3.0.3"
22468+
peerDependencies:
22469+
eslint: ">=7"
22470+
checksum: 10/c7943e245c3c32259bb6bcef7b2cb5ecb8e0965f39cb17c9e6f98d164a9ff608aa360ccb4c4d15411fc7b7ad2007a4c81269814ec0eb09d6cf5a67b487f95a0a
22471+
languageName: node
22472+
linkType: hard
22473+
2243622474
"eslint-plugin-react-hooks@npm:^5.1.0":
2243722475
version: 5.1.0
2243822476
resolution: "eslint-plugin-react-hooks@npm:5.1.0"
@@ -25862,7 +25900,7 @@ __metadata:
2586225900
languageName: node
2586325901
linkType: hard
2586425902

25865-
"hermes-parser@npm:0.25.1":
25903+
"hermes-parser@npm:0.25.1, hermes-parser@npm:^0.25.1":
2586625904
version: 0.25.1
2586725905
resolution: "hermes-parser@npm:0.25.1"
2586825906
dependencies:
@@ -44153,10 +44191,19 @@ __metadata:
4415344191
languageName: node
4415444192
linkType: hard
4415544193

44156-
"zod@npm:^3.21.4, zod@npm:^3.22.3, zod@npm:^3.23.8":
44157-
version: 3.23.8
44158-
resolution: "zod@npm:3.23.8"
44159-
checksum: 10/846fd73e1af0def79c19d510ea9e4a795544a67d5b34b7e1c4d0425bf6bfd1c719446d94cdfa1721c1987d891321d61f779e8236fde517dc0e524aa851a6eff1
44194+
"zod-validation-error@npm:^3.0.3":
44195+
version: 3.4.0
44196+
resolution: "zod-validation-error@npm:3.4.0"
44197+
peerDependencies:
44198+
zod: ^3.18.0
44199+
checksum: 10/b98b1bbba14a3bb31649a1566c8c5a5213ec70dcaa2cbb1e89db00d56648a446225b35a8f6768471730d7013f4f141cd70c2b9740d69e6433ebfa148aecdac2f
44200+
languageName: node
44201+
linkType: hard
44202+
44203+
"zod@npm:^3.21.4, zod@npm:^3.22.3, zod@npm:^3.22.4, zod@npm:^3.23.8":
44204+
version: 3.24.2
44205+
resolution: "zod@npm:3.24.2"
44206+
checksum: 10/604c62a8cf8e330d78b106a557f4b44f5d14845d20b1360a423ccc09b58cb8525ccf7e4b40cf1bd4852d22393d2c67774b5817ec5a2fedab25f543b36ed15943
4416044207
languageName: node
4416144208
linkType: hard
4416244209

0 commit comments

Comments
 (0)