Skip to content

1277 react compiler 적용#1281

Merged
ParkSungju01 merged 10 commits into
developfrom
1277-react-compiler-적용
Jun 27, 2026

Hidden character warning

The head ref may contain hidden characters: "1277-react-compiler-\uc801\uc6a9"
Merged

1277 react compiler 적용#1281
ParkSungju01 merged 10 commits into
developfrom
1277-react-compiler-적용

Conversation

@ParkSungju01

@ParkSungju01 ParkSungju01 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What is this PR? 🔍

Changes 📝

React Compiler를 적용 후 컴파일러가 자동으로 메모이제이션 하기 용이한 useMemo, useCallback을 제거하여 코드를 단순화 하였습니다. 또한 react compiler lint에 위반되는 기존 코드들을 수정하였습니다.

useMemo 제거 조건

  • 가벼운 계산을 수행
  • 단순 배열/객체 변환 역할 수행
  • useEffect의 의존성으로 쓰이지 않는 값
  • Context Value로 넘기지 않는 값

useCallback 제거 조건

  • useEffect나 useMemo의 의존성으로 들어가지 않는 함수
  • 이벤트 핸들러로만 호출되는 함수
  • React.memo된 하위 컴포넌트에 props로 넘기지 않는 함수

lint 오류 수정중 CustomLecture 컴포넌트는 수정리스크가 큰 시간표 폼이라, 이번 작업에서 구조를 바꾸기보다 Compiler 적용 대상에서 제외하는 예외처리를 하였습니다.

Test CheckList ✅

  • 기능 정상작동 여부 체크
  • yarn build

Precaution

✔️ Please check if the PR fulfills these requirements

  • It's submitted to the correct branch, not the develop branch unconditionally?
  • If on a hotfix branch, ensure it targets main?
  • There are no warning message when you run yarn lint

Summary by CodeRabbit

  • Refactor

    • 여러 화면과 입력 흐름에서 계산 로직과 이벤트 처리를 단순화해 렌더링 동작을 정리했습니다.
    • 인증, 날짜 선택, 검색, 페이지 파라미터 처리 등에서 상태 초기화와 동기화 방식이 개선되었습니다.
    • 일부 목록/표/폼 화면의 렌더링이 더 일관되게 동작하도록 조정했습니다.
  • Chores

    • React 컴파일러 관련 설정과 개발 의존성이 추가·업데이트되었습니다.

@ParkSungju01 ParkSungju01 added the 🔨 Refactor 코드 리팩토링 label Jun 25, 2026
@ParkSungju01 ParkSungju01 linked an issue Jun 25, 2026 that may be closed by this pull request
3 tasks
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ParkSungju01, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 10 minutes and 22 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 011fdb9b-5bf0-4605-96b4-7316d60d1250

📥 Commits

Reviewing files that changed from the base of the PR and between 3fbda51 and 0622592.

⛔ Files ignored due to path filters (2)
  • .pnp.cjs is excluded by !.pnp.cjs and included by **
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock, !yarn.lock and included by **
📒 Files selected for processing (3)
  • package.json
  • src/components/Auth/SignupPage/Steps/MobileVerificationStep/index.tsx
  • src/pages/bus/city/index.tsx

Walkthrough

React Compiler 활성화 설정과 관련 패키지/디렉티브가 추가되었습니다. 여러 컴포넌트와 페이지에서 useMemo/useCallback 기반 계산이 즉시 계산이나 일반 함수로 바뀌었고, 일부 가입·프로필 폼의 초기 상태와 타이머 처리도 조정되었습니다.

Changes

React Compiler 적용 및 메모이제이션 정리

Layer / File(s) Summary
Toolchain setup
next.config.mjs, package.json, src/components/Auth/SignupPage/Steps/Terms/index.tsx, src/components/TimetablePage/components/CustomLecture/index.tsx
React Compiler 활성화, babel-plugin-react-compiler 추가, eslint-plugin-react-hooks 버전 갱신, use no memo 디렉티브, ESLint 규칙 비활성화 주석이 반영되었습니다.
Article and lost-item derivations
src/components/Articles/LostItemWritePage/components/*, src/components/Articles/hooks/usePagination.ts, src/components/IndexComponents/IndexLostItem/index.tsx, src/pages/_app.tsx, src/pages/articles/index.tsx, src/pages/lost-item/index.tsx
달력 날짜, 날짜 범위, 페이지네이션, 카드 메시지, 페이지 제목과 쿼리 값이 렌더 시점에 직접 계산됩니다.
Callvan component handlers
src/components/Callvan/components/*
AddPostForm, 채팅 색상 맵, 필터 토글, 검색, 드롭다운 스크롤 핸들러가 일반 함수와 즉시 계산으로 바뀝니다.
Page-level handlers
src/pages/callvan/..., src/pages/lost-item/chat/index.tsx
Callvan 쿼리 파생값, 알림 클릭, lost-item 채팅 업로드/전송 핸들러가 직접 처리 흐름으로 바뀝니다.
Club, store, course, and user helpers
src/components/Club/..., src/components/Course/hooks/useSelectedCourses.ts, src/components/IndexComponents/IndexStore/index.tsx, src/components/Store/StorePage/components/SearchBarModal/index.tsx, src/components/ui/UserInfoModal/hooks/useUserInfoModal.ts
소개 편집, 검색 입력, 시간 목록, 선택 학점, 정보 누락 계산, 외부 이동, 검색 모달 입력이 즉시 계산으로 바뀝니다.
Form initialization and verification
src/components/Auth/SignupPage/Steps/MobileVerificationStep/index.tsx, src/components/GraduationCalculatorPage/components/StudentForm/index.tsx, src/pages/auth/modifyinfo/index.tsx
SMS 인증 타이머와 초기화, 전공 옵션 파생, 학과 선택, 비밀번호와 성별 초기 상태와 검증 흐름이 다시 구성됩니다.
Layout mount and portal
src/components/layout/Header/PCHeader/index.tsx, src/components/modal/Modal/PortalProvider.tsx
헤더의 마운트 판정, 메가메뉴 렌더링 구조, 모달 포털 대상 선택이 useMount 기반으로 바뀝니다.
Bus timetable rows
src/pages/bus/city/index.tsx
평일/주말 타입과 오전/오후 시간표 행이 렌더 시점에 직접 구성됩니다.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • hyejun0228
  • JeongWon-CHO
  • Soundbar91
  • taejinn
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning src/components/IndexComponents/IndexStore/index.tsxhrefassign으로 바꾸는 변경은 React Compiler 적용 범위와 직접 관련이 없습니다. 이 탐색 변경은 별도 PR로 분리하거나, 필요성에 대한 이슈 근거를 추가해 범위 내 변경임을 명확히 하세요.
Docstring Coverage ⚠️ Warning Docstring coverage is 3.03% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 React Compiler 적용이라는 핵심 변경을 간결하게 요약하고 있습니다.
Linked Issues check ✅ Passed React Compiler 설정 추가와 대체 가능한 useMemo/useCallback 제거가 이슈 요구와 일치합니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 1277-react-compiler-적용

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ff1451 ff1451 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

Comment thread eslint.config.mjs Outdated
Comment on lines +61 to +62
'react-hooks/rules-of-hooks':'error',
'react-hooks/exhaustive-deps':'warn',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...reactHooks.configs['recommended-latest'].rules,

이거 수정하신 이유가 있을까요?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기존설정이 React compiler 전용 룰까지 전부 켜서 기존 코드에서 compiler 룰에 걸리는 부분이 모두 에러로 잡히는 바람에 compiler 전용 lint만 제거하기 위해서 수정했습니다

@ff1451 ff1451 Jun 25, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 린트 규칙은 리액트에서 공식적으로 만들어진 규칙이며 권장되는 규칙인데 react compiler를 키면서 에러가 발생한다면 에러를 끄는게 아니라 해당 코드들을 수정하는게 맞다고 생각해요. 공식 문서

문서에서도 적혀있듯 에러가 발생하는 부분이 발견되면 컴파일러가 해당 부분을 자동으로 건너띄어 앱 자체에 문제는 없지만 건너뛰는만큼 컴파일러가 최적화를 못한다는 말이기도 해요 그렇기 때문에 바로 수정을 하기엔 구조 자체를수정해야하는 부분이거나 일반적으로 어쩔 수 없이 사용되는 부분이라면 해당 부분만 린트 규칙을 비활성화 하고 넘어갈 수는 있지만 린트 규칙을 제외하는 것은 좋지 않을 것 같아요

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 그렇군요 수정해보겠습니다!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
src/components/TimetablePage/components/CustomLecture/index.tsx (1)

1-3: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

파일 전역 eslint-disable은 범위를 너무 넓게 잡았습니다.

react-hooks/refsreact-hooks/set-state-in-effect를 파일 전체에서 끄면, 지금 문제뿐 아니라 이후에 들어올 실제 hook 위반도 같이 가려집니다. 가능하면 문제 나는 블록/라인에만 한정해서 disable 하거나, 해당 effect/ref 로직을 작은 훅으로 분리해 원인을 드러내는 편이 안전합니다. 장점은 회귀 방지와 리뷰 가능성 유지이고, 단점은 당장 약간의 정리가 필요하다는 점입니다.

As per path instructions, src/**는 가독성·안정성·유지보수 용이성을 우선 검토해야 합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/TimetablePage/components/CustomLecture/index.tsx` around lines
1 - 3, The file-wide react-hooks disables in CustomLecture are too broad and can
hide future hook violations. Narrow the suppression for react-hooks/refs and
react-hooks/set-state-in-effect to only the specific offending block, or
refactor the related ref/effect logic into a smaller hook/component so the lint
exceptions stay local. Use the CustomLecture component and the affected hook/ref
usage as the anchor when updating the lint annotations.

Source: Path instructions

src/components/Auth/SignupPage/Steps/Terms/index.tsx (1)

1-1: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

파일 전체를 use no memo로 빼기보다 useWatch로 구독 범위를 줄이는 편이 좋겠습니다.

지금은 watch(TERMS_NAMES), watch('...'), watch(TERMS_NAMES.slice(0, 2))가 섞여 있어서 컴포넌트 전체를 컴파일러 대상에서 제외한 형태입니다. 필요한 필드만 useWatch로 구독하면 재렌더 범위를 줄이면서 이 디렉티브를 제거할 여지가 생깁니다. 장점은 React Compiler 이점을 유지하고 구독 범위를 명확히 할 수 있다는 점이고, 단점은 필드 선언이 조금 늘어난다는 점입니다.

예시
-'use no memo';
+// 가능하면 디렉티브 제거

-import { useFormContext } from 'react-hook-form';
+import { useFormContext, useWatch } from 'react-hook-form';

 export default function Terms({ onNext }: TermsProps) {
-  const { register, setValue, watch } = useFormContext();
+  const { control, register, setValue } = useFormContext();
   const isMobile = useMediaQuery();
-  const watchAllTerms = watch(TERMS_NAMES);
+  const watchAllTerms = useWatch({ control, name: TERMS_NAMES });
+  const [privacyAgreement, koinAgreement, marketingAgreement] = watchAllTerms;
+  const canProceed = [privacyAgreement, koinAgreement].every(Boolean);

As per path instructions, src/**는 가독성·안정성·테스트/유지보수 용이성을 우선 검토해야 하고 src/components/**는 불필요한 리렌더링 패턴을 확인해야 합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/Auth/SignupPage/Steps/Terms/index.tsx` at line 1, The Terms
step is opting out of React Compiler with a file-level directive instead of
narrowing subscriptions. Replace the mixed `watch(...)` usage in
`Terms/index.tsx` with `useWatch` for the specific fields used by this
component, so only the relevant terms inputs re-render. After moving the
subscriptions into `useWatch`, remove the `'use no memo'` directive and keep the
existing `TERMS_NAMES`-based logic aligned with the new field-level watchers.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/components/Articles/LostItemWritePage/components/MobileDatePicker/MobileDatePicker.tsx`:
- Around line 21-24: Keep the getDateRange result memoized in MobileDatePicker
so years, months, days, currentYear, currentMonth, and currentDay stay
referentially stable across renders; otherwise the useLayoutEffect that depends
on these values will retrigger on every render and repeatedly call
syncScrollPosition(...). Restore the memoization around the getDateRange call in
MobileDatePicker.tsx and ensure the effect dependencies continue to point at the
stable values used for scroll synchronization.

In `@src/components/Auth/SignupPage/Steps/MobileVerificationStep/index.tsx`:
- Around line 82-84: `checkVerificationCode`의 onSuccess에서 등록된 60초 타이머를 정리하지 않아
`CORRECT` 메시지가 나중에 `DEFAULT`로 덮어써집니다. `MobileVerificationStep`의
`checkVerificationCode` 성공 처리에 `clearVerificationMessageTimer()`를 추가해,
`sendSMSToUser`에서 설정한 `verificationMessageTimerRef`가 남아 있지 않도록 하세요. 필요하면
`sendSMSToUser`와 `clearVerificationMessageTimer`의 흐름을 함께 확인해 인증 성공 시점에 타이머가 항상
취소되도록 맞춰주세요.

In `@src/pages/bus/city/index.tsx`:
- Around line 73-85: `bus_timetables`가 없거나 null일 때 `.find()`에서 렌더가 깨질 수 있으니,
`todayTimetable`을 계산하는 `timetable.info.bus_timetables` 접근에 기존처럼 빈 배열 fallback을
유지하세요. `dayType`, `todayTimetable`, `departInfo`, `processedTimetable` 주변에서 API
응답이 비어도 안전하게 동작하도록 `info.bus_timetables`를 배열로 보정한 뒤 찾도록 수정하면 됩니다.

---

Nitpick comments:
In `@src/components/Auth/SignupPage/Steps/Terms/index.tsx`:
- Line 1: The Terms step is opting out of React Compiler with a file-level
directive instead of narrowing subscriptions. Replace the mixed `watch(...)`
usage in `Terms/index.tsx` with `useWatch` for the specific fields used by this
component, so only the relevant terms inputs re-render. After moving the
subscriptions into `useWatch`, remove the `'use no memo'` directive and keep the
existing `TERMS_NAMES`-based logic aligned with the new field-level watchers.

In `@src/components/TimetablePage/components/CustomLecture/index.tsx`:
- Around line 1-3: The file-wide react-hooks disables in CustomLecture are too
broad and can hide future hook violations. Narrow the suppression for
react-hooks/refs and react-hooks/set-state-in-effect to only the specific
offending block, or refactor the related ref/effect logic into a smaller
hook/component so the lint exceptions stay local. Use the CustomLecture
component and the affected hook/ref usage as the anchor when updating the lint
annotations.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6cebe864-0ae1-466f-8992-2cc781c40ba2

📥 Commits

Reviewing files that changed from the base of the PR and between 2b6af9b and 3fbda51.

⛔ Files ignored due to path filters (2)
  • .pnp.cjs is excluded by !.pnp.cjs and included by **
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock, !yarn.lock and included by **
📒 Files selected for processing (33)
  • next.config.mjs
  • package.json
  • src/components/Articles/LostItemWritePage/components/Calendar/index.tsx
  • src/components/Articles/LostItemWritePage/components/MobileDatePicker/MobileDatePicker.tsx
  • src/components/Articles/hooks/usePagination.ts
  • src/components/Auth/SignupPage/Steps/MobileVerificationStep/index.tsx
  • src/components/Auth/SignupPage/Steps/Terms/index.tsx
  • src/components/Callvan/components/AddPostForm/index.tsx
  • src/components/Callvan/components/CallvanChatRoom/index.tsx
  • src/components/Callvan/components/CallvanFilterPanel/index.tsx
  • src/components/Callvan/components/CallvanPageLayout/index.tsx
  • src/components/Callvan/components/DateDropdown/index.tsx
  • src/components/Callvan/components/TimeDropdown/index.tsx
  • src/components/Club/ClubDetailPage/components/ClubIntrodution/index.tsx
  • src/components/Club/ClubListPage/components/ClubSearchContainer/index.tsx
  • src/components/Club/NewClubEvent/components/TimePicker/index.tsx
  • src/components/Course/hooks/useSelectedCourses.ts
  • src/components/GraduationCalculatorPage/components/StudentForm/index.tsx
  • src/components/IndexComponents/IndexLostItem/index.tsx
  • src/components/IndexComponents/IndexStore/index.tsx
  • src/components/Store/StorePage/components/SearchBarModal/index.tsx
  • src/components/TimetablePage/components/CustomLecture/index.tsx
  • src/components/layout/Header/PCHeader/index.tsx
  • src/components/modal/Modal/PortalProvider.tsx
  • src/components/ui/UserInfoModal/hooks/useUserInfoModal.ts
  • src/pages/_app.tsx
  • src/pages/articles/index.tsx
  • src/pages/auth/modifyinfo/index.tsx
  • src/pages/bus/city/index.tsx
  • src/pages/callvan/index.tsx
  • src/pages/callvan/notifications/index.tsx
  • src/pages/lost-item/chat/index.tsx
  • src/pages/lost-item/index.tsx

Comment thread src/pages/bus/city/index.tsx
@ParkSungju01 ParkSungju01 requested a review from ff1451 June 27, 2026 12:46

@ff1451 ff1451 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

@ParkSungju01 ParkSungju01 merged commit 107742b into develop Jun 27, 2026
4 checks passed
@github-actions github-actions Bot deleted the 1277-react-compiler-적용 branch June 27, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

React Compiler 적용 및 제거 가능 useMemo, useCallback 제거

2 participants