Skip to content

Commit 173bbf7

Browse files
committed
Integrated React Compiler
1 parent 346af6a commit 173bbf7

4 files changed

Lines changed: 124 additions & 1 deletion

File tree

eslint.config.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
import eslint from "@eslint/js";
22
import tseslint from "typescript-eslint";
33
import react from "eslint-plugin-react";
4+
import reactHooks from "eslint-plugin-react-hooks";
45
import prettierRecommended from "eslint-plugin-prettier/recommended";
56

67
export default tseslint.config(
78
eslint.configs.recommended,
89
react.configs.flat.recommended,
910
prettierRecommended,
1011
...tseslint.configs.recommended,
12+
{
13+
plugins: {
14+
"react-hooks": reactHooks,
15+
},
16+
rules: {
17+
...reactHooks.configs.recommended.rules,
18+
},
19+
},
1120
{
1221
settings: {
1322
react: {

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@
2323
"@types/react": "^19.2.2",
2424
"@vitejs/plugin-react": "^5.0.4",
2525
"@vitest/coverage-v8": "^4.0.1",
26+
"babel-plugin-react-compiler": "1.0.0",
2627
"eslint": "^9.38.0",
2728
"eslint-config-prettier": "^10.1.8",
2829
"eslint-plugin-prettier": "^5.5.4",
2930
"eslint-plugin-react": "^7.37.5",
31+
"eslint-plugin-react-hooks": "^7.0.0",
3032
"jsdom": "^27.0.1",
3133
"prettier": "^3.6.2",
3234
"typescript": "^5.9.3",

vite.config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ import react from "@vitejs/plugin-react";
33
import path from "path";
44

55
export default defineConfig({
6-
plugins: [react({ jsxRuntime: "automatic" })],
6+
plugins: [
7+
react({
8+
jsxRuntime: "automatic",
9+
babel: {
10+
plugins: ["babel-plugin-react-compiler"],
11+
},
12+
}),
13+
],
714
resolve: {
815
alias: {
916
"@": path.resolve(__dirname, "./src"),

yarn.lock

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,27 @@
4343
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.28.4.tgz#96fdf1af1b8859c8474ab39c295312bfb7c24b04"
4444
integrity sha512-YsmSKC29MJwf0gF8Rjjrg5LQCmyh+j/nD8/eP7f+BeoQTKYqs9RoWbjGOdy0+1Ekr68RJZMUOPVQaQisnIo4Rw==
4545

46+
"@babel/core@^7.24.4":
47+
version "7.28.5"
48+
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.28.5.tgz#4c81b35e51e1b734f510c99b07dfbc7bbbb48f7e"
49+
integrity sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==
50+
dependencies:
51+
"@babel/code-frame" "^7.27.1"
52+
"@babel/generator" "^7.28.5"
53+
"@babel/helper-compilation-targets" "^7.27.2"
54+
"@babel/helper-module-transforms" "^7.28.3"
55+
"@babel/helpers" "^7.28.4"
56+
"@babel/parser" "^7.28.5"
57+
"@babel/template" "^7.27.2"
58+
"@babel/traverse" "^7.28.5"
59+
"@babel/types" "^7.28.5"
60+
"@jridgewell/remapping" "^2.3.5"
61+
convert-source-map "^2.0.0"
62+
debug "^4.1.0"
63+
gensync "^1.0.0-beta.2"
64+
json5 "^2.2.3"
65+
semver "^6.3.1"
66+
4667
"@babel/core@^7.28.4":
4768
version "7.28.4"
4869
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.28.4.tgz#12a550b8794452df4c8b084f95003bce1742d496"
@@ -75,6 +96,17 @@
7596
"@jridgewell/trace-mapping" "^0.3.28"
7697
jsesc "^3.0.2"
7798

99+
"@babel/generator@^7.28.5":
100+
version "7.28.5"
101+
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.28.5.tgz#712722d5e50f44d07bc7ac9fe84438742dd61298"
102+
integrity sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==
103+
dependencies:
104+
"@babel/parser" "^7.28.5"
105+
"@babel/types" "^7.28.5"
106+
"@jridgewell/gen-mapping" "^0.3.12"
107+
"@jridgewell/trace-mapping" "^0.3.28"
108+
jsesc "^3.0.2"
109+
78110
"@babel/helper-compilation-targets@^7.27.2":
79111
version "7.27.2"
80112
resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz#46a0f6efab808d51d29ce96858dd10ce8732733d"
@@ -123,6 +155,11 @@
123155
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz#a7054dcc145a967dd4dc8fee845a57c1316c9df8"
124156
integrity sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==
125157

158+
"@babel/helper-validator-identifier@^7.28.5":
159+
version "7.28.5"
160+
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz#010b6938fab7cb7df74aa2bbc06aa503b8fe5fb4"
161+
integrity sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==
162+
126163
"@babel/helper-validator-option@^7.27.1":
127164
version "7.27.1"
128165
resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz#fa52f5b1e7db1ab049445b421c4471303897702f"
@@ -143,6 +180,13 @@
143180
dependencies:
144181
"@babel/types" "^7.28.4"
145182

183+
"@babel/parser@^7.24.4", "@babel/parser@^7.28.5":
184+
version "7.28.5"
185+
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.28.5.tgz#0b0225ee90362f030efd644e8034c99468893b08"
186+
integrity sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==
187+
dependencies:
188+
"@babel/types" "^7.28.5"
189+
146190
"@babel/plugin-transform-react-jsx-self@^7.27.1":
147191
version "7.27.1"
148192
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz#af678d8506acf52c577cac73ff7fe6615c85fc92"
@@ -184,6 +228,19 @@
184228
"@babel/types" "^7.28.4"
185229
debug "^4.3.1"
186230

231+
"@babel/traverse@^7.28.5":
232+
version "7.28.5"
233+
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.28.5.tgz#450cab9135d21a7a2ca9d2d35aa05c20e68c360b"
234+
integrity sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==
235+
dependencies:
236+
"@babel/code-frame" "^7.27.1"
237+
"@babel/generator" "^7.28.5"
238+
"@babel/helper-globals" "^7.28.0"
239+
"@babel/parser" "^7.28.5"
240+
"@babel/template" "^7.27.2"
241+
"@babel/types" "^7.28.5"
242+
debug "^4.3.1"
243+
187244
"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.25.4", "@babel/types@^7.27.1", "@babel/types@^7.28.2", "@babel/types@^7.28.4":
188245
version "7.28.4"
189246
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.4.tgz#0a4e618f4c60a7cd6c11cb2d48060e4dbe38ac3a"
@@ -192,6 +249,14 @@
192249
"@babel/helper-string-parser" "^7.27.1"
193250
"@babel/helper-validator-identifier" "^7.27.1"
194251

252+
"@babel/types@^7.26.0", "@babel/types@^7.28.5":
253+
version "7.28.5"
254+
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.5.tgz#10fc405f60897c35f07e85493c932c7b5ca0592b"
255+
integrity sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==
256+
dependencies:
257+
"@babel/helper-string-parser" "^7.27.1"
258+
"@babel/helper-validator-identifier" "^7.28.5"
259+
195260
"@bcoe/v8-coverage@^1.0.2":
196261
version "1.0.2"
197262
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-1.0.2.tgz#bbe12dca5b4ef983a0d0af4b07b9bc90ea0ababa"
@@ -1075,6 +1140,13 @@ available-typed-arrays@^1.0.7:
10751140
dependencies:
10761141
possible-typed-array-names "^1.0.0"
10771142

1143+
babel-plugin-react-compiler@1.0.0:
1144+
version "1.0.0"
1145+
resolved "https://registry.yarnpkg.com/babel-plugin-react-compiler/-/babel-plugin-react-compiler-1.0.0.tgz#bdf7360a23a4d5ebfca090255da3893efd07425f"
1146+
integrity sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw==
1147+
dependencies:
1148+
"@babel/types" "^7.26.0"
1149+
10781150
balanced-match@^1.0.0:
10791151
version "1.0.2"
10801152
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
@@ -1523,6 +1595,17 @@ eslint-plugin-prettier@^5.5.4:
15231595
prettier-linter-helpers "^1.0.0"
15241596
synckit "^0.11.7"
15251597

1598+
eslint-plugin-react-hooks@^7.0.0:
1599+
version "7.0.0"
1600+
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.0.tgz#a255a1db826ea42b0e37f160430e4bd0b4b659f9"
1601+
integrity sha512-fNXaOwvKwq2+pXiRpXc825Vd63+KM4DLL40Rtlycb8m7fYpp6efrTp1sa6ZbP/Ap58K2bEKFXRmhURE+CJAQWw==
1602+
dependencies:
1603+
"@babel/core" "^7.24.4"
1604+
"@babel/parser" "^7.24.4"
1605+
hermes-parser "^0.25.1"
1606+
zod "^3.22.4 || ^4.0.0"
1607+
zod-validation-error "^3.0.3 || ^4.0.0"
1608+
15261609
eslint-plugin-react@^7.37.5:
15271610
version "7.37.5"
15281611
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz#2975511472bdda1b272b34d779335c9b0e877065"
@@ -1885,6 +1968,18 @@ hasown@^2.0.2:
18851968
dependencies:
18861969
function-bind "^1.1.2"
18871970

1971+
hermes-estree@0.25.1:
1972+
version "0.25.1"
1973+
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.25.1.tgz#6aeec17d1983b4eabf69721f3aa3eb705b17f480"
1974+
integrity sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==
1975+
1976+
hermes-parser@^0.25.1:
1977+
version "0.25.1"
1978+
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.25.1.tgz#5be0e487b2090886c62bd8a11724cd766d5f54d1"
1979+
integrity sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==
1980+
dependencies:
1981+
hermes-estree "0.25.1"
1982+
18881983
html-encoding-sniffer@^4.0.0:
18891984
version "4.0.0"
18901985
resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz#696df529a7cfd82446369dc5193e590a3735b448"
@@ -3324,6 +3419,16 @@ yocto-queue@^0.1.0:
33243419
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
33253420
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
33263421

3422+
"zod-validation-error@^3.0.3 || ^4.0.0":
3423+
version "4.0.2"
3424+
resolved "https://registry.yarnpkg.com/zod-validation-error/-/zod-validation-error-4.0.2.tgz#bc605eba49ce0fcd598c127fee1c236be3f22918"
3425+
integrity sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==
3426+
3427+
"zod@^3.22.4 || ^4.0.0":
3428+
version "4.1.12"
3429+
resolved "https://registry.yarnpkg.com/zod/-/zod-4.1.12.tgz#64f1ea53d00eab91853195653b5af9eee68970f0"
3430+
integrity sha512-JInaHOamG8pt5+Ey8kGmdcAcg3OL9reK8ltczgHTAwNhMys/6ThXHityHxVV2p3fkw/c+MAvBHFVYHFZDmjMCQ==
3431+
33273432
zustand@^5.0.8:
33283433
version "5.0.8"
33293434
resolved "https://registry.yarnpkg.com/zustand/-/zustand-5.0.8.tgz#b998a0c088c7027a20f2709141a91cb07ac57f8a"

0 commit comments

Comments
 (0)