Skip to content

refactor(FR-2616): rely on React Compiler ('use memo') for memoization#6857

Merged
graphite-app[bot] merged 1 commit into
mainfrom
04-22-refactor_fr-2616_rely_on_react_compiler_use_memo_for_memoization
Apr 23, 2026
Merged

refactor(FR-2616): rely on React Compiler ('use memo') for memoization#6857
graphite-app[bot] merged 1 commit into
mainfrom
04-22-refactor_fr-2616_rely_on_react_compiler_use_memo_for_memoization

Conversation

@nowgnuesLee
Copy link
Copy Markdown
Contributor

resolves #NNN (FR-MMM)

Checklist: (if applicable)

  • Documentation
  • Minium required manager version
  • Specific setting for review (eg., KB link, endpoint or how to setup)
  • Minimum requirements to check during review
  • Test case(s) to demonstrate the difference of before/after

Copy link
Copy Markdown
Contributor Author

nowgnuesLee commented Apr 22, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements 8.91% 1831/20559
🔴 Branches 8.08% 1165/14421
🔴 Functions 5.28% 294/5565
🔴 Lines 8.64% 1723/19948

Test suite run success

865 tests passing in 40 suites.

Report generated by 🧪jest coverage report action from e109675

@nowgnuesLee nowgnuesLee force-pushed the 04-22-refactor_fr-2616_rely_on_react_compiler_use_memo_for_memoization branch from 4cc35d4 to 9e0defc Compare April 22, 2026 02:00
@nowgnuesLee nowgnuesLee force-pushed the 04-21-test_fr-2633_add_unit_tests_for_stokenloginboundary branch from 29873c3 to 19fb0f2 Compare April 22, 2026 02:00
@nowgnuesLee nowgnuesLee force-pushed the 04-22-refactor_fr-2616_rely_on_react_compiler_use_memo_for_memoization branch 2 times, most recently from f80af6f to 6dcbbec Compare April 22, 2026 02:38
@nowgnuesLee nowgnuesLee force-pushed the 04-21-test_fr-2633_add_unit_tests_for_stokenloginboundary branch from 19fb0f2 to 5991ab4 Compare April 22, 2026 02:38
@nowgnuesLee nowgnuesLee force-pushed the 04-22-refactor_fr-2616_rely_on_react_compiler_use_memo_for_memoization branch from 6dcbbec to 19bc0b6 Compare April 22, 2026 03:43
@nowgnuesLee nowgnuesLee force-pushed the 04-21-test_fr-2633_add_unit_tests_for_stokenloginboundary branch 2 times, most recently from a4cd73c to 31e44f6 Compare April 22, 2026 03:53
@nowgnuesLee nowgnuesLee force-pushed the 04-22-refactor_fr-2616_rely_on_react_compiler_use_memo_for_memoization branch from 19bc0b6 to 0e60f45 Compare April 22, 2026 03:53
@nowgnuesLee nowgnuesLee marked this pull request as ready for review April 23, 2026 06:09
Copilot AI review requested due to automatic review settings April 23, 2026 06:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors memoization patterns to rely on the React Compiler ('use memo') instead of manual useCallback wrappers, and documents this as a project rule.

Changes:

  • Removed useCallback wrappers in useSToken and STokenLoginBoundary in favor of plain functions under React Compiler memoization.
  • Added/ensured 'use memo' directives on relevant components.
  • Added a .claude rule document for React Compiler memoization guidance and updated the related spec metadata.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
react/src/hooks/useSToken.ts Drops useCallback for the returned clear function, relying on compiler memoization.
react/src/components/STokenLoginBoundary.tsx Removes useCallback handlers and adds 'use memo' directives to components.
.specs/draft-stoken-login-boundary/metadata.json Updates spec tracking metadata for a closed/redundant subtask.
.claude/rules/react-compiler-memoization.md Documents the “prefer React Compiler memoization” rule for the codebase.

Comment thread react/src/components/STokenLoginBoundary.tsx
@nowgnuesLee nowgnuesLee force-pushed the 04-22-refactor_fr-2616_rely_on_react_compiler_use_memo_for_memoization branch from 0e60f45 to 35db452 Compare April 23, 2026 07:57
@nowgnuesLee nowgnuesLee force-pushed the 04-21-test_fr-2633_add_unit_tests_for_stokenloginboundary branch 2 times, most recently from 53a39ab to 61ad3d1 Compare April 23, 2026 08:02
@nowgnuesLee nowgnuesLee force-pushed the 04-22-refactor_fr-2616_rely_on_react_compiler_use_memo_for_memoization branch from 35db452 to 3edbd01 Compare April 23, 2026 08:02
@nowgnuesLee nowgnuesLee force-pushed the 04-21-test_fr-2633_add_unit_tests_for_stokenloginboundary branch from 61ad3d1 to 8dd4a80 Compare April 23, 2026 08:35
@nowgnuesLee nowgnuesLee force-pushed the 04-22-refactor_fr-2616_rely_on_react_compiler_use_memo_for_memoization branch from 3edbd01 to 9b8a859 Compare April 23, 2026 08:35
Copy link
Copy Markdown
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

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

LGTM

@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Apr 23, 2026

Merge activity

#6857)

resolves #NNN (FR-MMM)
<!-- replace NNN, MMM with the GitHub issue number and the corresponding Jira issue number. -->

<!--
Please precisely, concisely, and concretely describe what this PR changes, the rationale behind codes,
and how it affects the users and other developers.
-->

**Checklist:** (if applicable)

- [ ] Documentation
- [ ] Minium required manager version
- [ ] Specific setting for review (eg., KB link, endpoint or how to setup)
- [ ] Minimum requirements to check during review
- [ ] Test case(s) to demonstrate the difference of before/after
@graphite-app graphite-app Bot force-pushed the 04-21-test_fr-2633_add_unit_tests_for_stokenloginboundary branch from 8dd4a80 to f96e136 Compare April 23, 2026 10:35
@graphite-app graphite-app Bot force-pushed the 04-22-refactor_fr-2616_rely_on_react_compiler_use_memo_for_memoization branch from 9b8a859 to e109675 Compare April 23, 2026 10:36
Base automatically changed from 04-21-test_fr-2633_add_unit_tests_for_stokenloginboundary to main April 23, 2026 10:44
@graphite-app graphite-app Bot merged commit e109675 into main Apr 23, 2026
8 checks passed
@graphite-app graphite-app Bot deleted the 04-22-refactor_fr-2616_rely_on_react_compiler_use_memo_for_memoization branch April 23, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants