Skip to content

refactor(react): audit remaining compiler-era memoization and add guardrails #486

Description

@BleedingDev

Context

PR #482 removed redundant manual memoization made unnecessary by React Compiler, while preserving memoization that protects semantic identity for effects, state sync, external editors, and integration boundaries. Follow up with a smaller audit so future PRs do not reintroduce performance-only useMemo / useCallback / memo patterns in compiled apps.

Depends On

Scope

  • Audit remaining useMemo, useCallback, and memo usage in compiled React app surfaces.
  • Keep memoization where it is required for semantics, for example:
    • dependency identity used by effects that update state
    • editor/plugin instances
    • external library contracts
    • intentionally stable callback identity passed outside React
  • Remove only clearly redundant performance-only memoization.
  • Add a short convention note or local guideline if the repo has an appropriate place for it.
  • Do not mix this with Next version upgrades or Rust compiler migration.

Validation

  • Run focused lint/tests for touched apps.
  • Run Nx affected lint/test locally under repo Node 24 before pushing.
  • Confirm review bots have 0 unresolved comments.

Acceptance Criteria

  • Remaining manual memoization is either removed or intentionally justified by surrounding code.
  • New guideline/notes make the distinction clear for future compiler-era changes.
  • CI is green.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions