Skip to content

feat(react-compiler): enable react-compiler-analyzer lint on PR runs and apply --fix#36224

Open
Hotell wants to merge 7 commits into
microsoft:masterfrom
Hotell:react-compiler/enable-rca
Open

feat(react-compiler): enable react-compiler-analyzer lint on PR runs and apply --fix#36224
Hotell wants to merge 7 commits into
microsoft:masterfrom
Hotell:react-compiler/enable-rca

Conversation

@Hotell
Copy link
Copy Markdown
Contributor

@Hotell Hotell commented May 19, 2026

Description

Enable the react-compiler-analyzer--lint target in the PR CI pipeline as a dedicated parallel job and fix 'use no memo' directives across all v9 packages, and clean up a deprecated ESLint rule.

Motivation

  • Running the React Compiler analysis as a separate parallel job keeps the critical-path main job lean while still catching React Compiler compatibility regressions before merge.
  • Applying --fix across all react-components/** ensures up to date baseline — no false positives
    • react compiler analyzer identifies redundant use no memo directives. TLDR, if compiler bails out, the use no memo is redundant and our lint command flags it
  • The lines-around-directive rule has been deprecated since 2017 and causes unnecessary lint errors on directives like 'use no memo'.

Follow up

it seems we use use no memo directive on purpose in some style hooks, compiler is able compile those as they don't modify the references rather re-set the state. We will check the actual need of the no memo as a follow up.

Modules to check:

  • packages/react-components/react-calendar-compat/library/src/components/Calendar/useCalendarStyles.styles.ts
  • packages/react-components/react-calendar-compat/library/src/components/CalendarDay/useCalendarDayStyles.styles.ts
  • packages/react-components/react-calendar-compat/library/src/components/CalendarDayGrid/useCalendarDayGridStyles.styles.ts
  • packages/react-components/react-calendar-compat/library/src/components/CalendarMonth/useCalendarMonthStyles.styles.ts
  • packages/react-components/react-calendar-compat/library/src/components/CalendarPicker/useCalendarPickerStyles.styles.ts
  • packages/react-components/react-calendar-compat/library/src/components/CalendarYear/useCalendarYearStyles.styles.ts
  • packages/react-components/react-carousel/library/src/components/CarouselButton/useCarouselButtonStyles.styles.ts
  • packages/react-components/react-tabs/library/src/components/Tab/useTabStyles.styles.ts
  • packages/react-components/react-teaching-popover/library/src/components/TeachingPopoverCarouselFooterButton/useTeachingPopoverCarouselFooterButtonStyles.styles.ts

Changes

  1. .github/workflows/pr.yml
    • Remove react-compiler-analyzer--lint from the main job's nx affected task list.
    • Add a new react-compiler-analyzer job that runs in parallel with the existing jobs (main, e2e, react-major-versions-integration). It checks out the repo, derives affected SHAs, and runs yarn nx affected -t react-compiler-analyzer--lint --nxBail.
  2. package.json — Bump @fluentui/react-compiler-analyzer from 0.0.0-experimental.rc-analyzer.20260505-0d531266b1.0 to 0.0.0-experimental.rc-analyzer.20260514-5d0a891a8f.0.
  3. react-components/** — Run react-compiler-analyzer --fix across all v9 packages: removed redundant 'use no memo' directives and added justification comments to valid ones (~380 files changed).
  4. packages/eslint-plugin/src/configs/core.js — Disable the deprecated lines-around-directive ESLint rule (deprecated since ESLint v4, inherited from airbnb config).
  5. yarn.lock — Updated lockfile reflecting the version bump.

@github-actions github-actions Bot added the CI label May 19, 2026
@Hotell Hotell added the React Compiler React Compiler integration and related work label May 19, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

📊 Bundle size report

✅ No changes found

@github-actions
Copy link
Copy Markdown

Pull request demo site: URL

Comment thread .github/workflows/pr.yml
@Hotell Hotell changed the title ci(pr): enable react-compiler-analyzer lint on PR runs ci(pr): enable react-compiler-analyzer lint on PR runs and apply --fix May 19, 2026
@Hotell Hotell marked this pull request as ready for review May 19, 2026 17:26
@Hotell Hotell changed the title ci(pr): enable react-compiler-analyzer lint on PR runs and apply --fix feat(react-compiler): enable react-compiler-analyzer lint on PR runs and apply --fix May 19, 2026
@Hotell Hotell requested a review from CampbellOwen May 21, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Build System CI React Compiler React Compiler integration and related work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants