chore: migrate to yarn modern#35747
Conversation
479d2cd to
df4487b
Compare
📊 Bundle size reportUnchanged fixtures
|
| @@ -38,7 +38,7 @@ runs: | |||
| cache: 'yarn' | |||
There was a problem hiding this comment.
🕵🏾♀️ visual changes to review in the Visual Change Report
vr-tests-react-components/CalendarCompat 4 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/CalendarCompat.multiDayView - Dark Mode.default.chromium.png | 1094 | Changed |
| vr-tests-react-components/CalendarCompat.multiDayView - High Contrast.default.chromium.png | 1197 | Changed |
| vr-tests-react-components/CalendarCompat.multiDayView.default.chromium_1.png | 479 | Changed |
| vr-tests-react-components/CalendarCompat.multiDayView.default.chromium.png | 478 | Changed |
vr-tests-react-components/Charts-DonutChart 3 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Charts-DonutChart.Dynamic - Dark Mode.default.chromium.png | 7530 | Changed |
| vr-tests-react-components/Charts-DonutChart.Dynamic - RTL.default.chromium.png | 5570 | Changed |
| vr-tests-react-components/Charts-DonutChart.Dynamic.default.chromium.png | 5581 | Changed |
vr-tests-react-components/Menu 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Menu.Nested Submenus Small Viewport Stacked.nested menu.chromium.png | 399 | Changed |
vr-tests-react-components/Menu Converged - submenuIndicator slotted content 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default - RTL.submenus open.chromium.png | 404 | Changed |
vr-tests-react-components/Positioning 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Positioning.Positioning end.chromium.png | 882 | Changed |
| vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png | 149 | Changed |
vr-tests-react-components/TagPicker 4 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/TagPicker.disabled - Dark Mode.disabled input hover.chromium.png | 658 | Changed |
| vr-tests-react-components/TagPicker.disabled - RTL.chromium.png | 635 | Changed |
| vr-tests-react-components/TagPicker.disabled - High Contrast.chromium.png | 1319 | Changed |
| vr-tests-react-components/TagPicker.disabled.disabled input hover.chromium.png | 677 | Changed |
vr-tests-web-components/Accordion 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-web-components/Accordion. - Dark Mode.normal.chromium_1.png | 3154 | Changed |
vr-tests-web-components/Avatar 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-web-components/Avatar. - Dark Mode.normal.chromium_1.png | 298 | Changed |
vr-tests-web-components/MenuList 4 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-web-components/MenuList. - Dark Mode.normal.chromium.png | 498 | Changed |
| vr-tests-web-components/MenuList. - RTL.1st selected.chromium_2.png | 39384 | Changed |
| vr-tests-web-components/MenuList. - RTL.normal.chromium_1.png | 39083 | Changed |
| vr-tests-web-components/MenuList. - RTL.2nd selected.chromium_3.png | 38816 | Changed |
vr-tests-web-components/TextInput 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-web-components/TextInput. - Dark Mode.normal.chromium_1.png | 288 | Changed |
vr-tests/Callout 9 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests/Callout.Bottom center.default.chromium.png | 2128 | Changed |
| vr-tests/Callout.Left top edge.default.chromium.png | 2183 | Changed |
| vr-tests/Callout.Bottom right edge - RTL.default.chromium.png | 1124 | Changed |
| vr-tests/Callout.Left bottom edge.default.chromium.png | 3182 | Changed |
| vr-tests/Callout.Gap space 25.default.chromium.png | 2195 | Changed |
| vr-tests/Callout.No beak.default.chromium.png | 2192 | Changed |
| vr-tests/Callout.No callout width specified.default.chromium.png | 2143 | Changed |
| vr-tests/Callout.Rendering callout attached to a rectangle.default.chromium.png | 1835 | Changed |
| vr-tests/Callout.Root.default.chromium.png | 2195 | Changed |
vr-tests/Coachmark 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests/Coachmark.Collapsed.default.chromium.png | 159 | Changed |
vr-tests/Keytip 3 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests/Keytip.Disabled.default.chromium.png | 24 | Changed |
| vr-tests/Keytip.Offset.default.chromium.png | 86 | Changed |
| vr-tests/Keytip.Root.default.chromium.png | 55 | Changed |
vr-tests/react-charting-AreaChart 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests/react-charting-AreaChart.Custom Accessibility.default.chromium.png | 11 | Changed |
vr-tests/react-charting-GaugeChart 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests/react-charting-GaugeChart.Basic.default.chromium.png | 2 | Changed |
vr-tests/react-charting-MultiStackBarChart 4 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests/react-charting-MultiStackBarChart.Basic_Absolute - RTL.default.chromium.png | 343 | Changed |
| vr-tests/react-charting-MultiStackBarChart.Basic_Absolute.default.chromium.png | 359 | Changed |
| vr-tests/react-charting-MultiStackBarChart.Basic_PartToWhole - RTL.default.chromium.png | 343 | Changed |
| vr-tests/react-charting-MultiStackBarChart.Basic_PartToWhole.default.chromium.png | 359 | Changed |
There were 7 duplicate changes discarded. Check the build logs for more information.
7bdc1bc to
6b5f740
Compare
|
Pull request demo site: URL |
5e16b71 to
b40e143
Compare
| "packages/*", | ||
| "packages/react-components/*", | ||
| "packages/react-components/*/*", | ||
| "!packages/react-components/react-jsx-runtime/jsx-runtime", |
There was a problem hiding this comment.
Yarn classic was silently skipping directories without name in package.json files, Yarn modern is more stricter and we need to exclude these sub paths explicitly
1435cc5 to
1e47bea
Compare
| "nx": "21.6.10", | ||
| "p-queue": "6.6.2", | ||
| "parse-diff": "0.7.1", | ||
| "patch-package": "8.0.0", |
There was a problem hiding this comment.
yarn v4 has native support for patching, we can remove that
f891481 to
4aff9a8
Compare
| "bin": { | ||
| "storybook-llms-extractor": "./bin/storybook-llms-extractor.js" | ||
| }, | ||
| "bin": "./bin/storybook-llms-extractor.js", |
There was a problem hiding this comment.
yarn automatically makes bin as shorthand and removes empty peerDependencies
a827a55 to
7adf9fc
Compare
Yarn Modern's `yarn run -T` only resolves scripts, not binaries. NX infers test-ssr targets using `yarn run -T test-ssr` which fails because test-ssr is a binary from @fluentui/scripts-test-ssr, not a script. Adding it as a root script makes it resolvable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Husky (git hook manager) and nano-staged (pre-commit lint runner) were accidentally dropped during the Yarn Modern migration. The .husky/ directory with hooks still existed but husky wasn't being initialized on install. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move YARN_ENABLE_IMMUTABLE_INSTALLS: false from global workflow env to individual generator steps that actually need it. The global env contradicted the explicit --immutable flag on yarn install, making the intent unclear. Now the install is unambiguously immutable, and only NX generators (which create/remove packages and modify the lockfile) opt out. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| "just": "just-scripts", | ||
| "lint": "just-scripts lint" | ||
| "build": "yarn run -T just-scripts build", | ||
| "clean": "yarn run -T just-scripts clean", |
There was a problem hiding this comment.
classic yarn added all binaries to PATH, yarn modern resolves binaries from workspace's own dependencies. run -T (top-level) helps to explicitly resolve from root
| "**/prismjs": "^1.30.0", | ||
| "**/@tensile-perf/runner/express": "^4.22.1", | ||
| "**/tar-fs": "^2.1.4", | ||
| "jackspeak": "2.1.1", | ||
| "**/micromatch/braces": "^3.0.3", | ||
| "**/just-scripts-utils/tar": "^7.5.7", | ||
| "**/body-parser/qs": "^6.14.2", | ||
| "**/@cypress/request/qs": "^6.14.2" |
There was a problem hiding this comment.
yarn modern was silently dropping the **/ entries, flattened resolutions to keep security fixes
Remove 13 resolutions (@swc/helpers, tslib, 10 d3 packages, lodash) that were added as a safety net during migration but are unnecessary. yarn dedupe --strategy highest already prevents duplication. Some of these resolutions were actually harmful — forcing tslib v2 onto packages expecting v1, and d3-array v3 onto ranges requiring v2. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Restore d3 library resolutions that were removed in the previous commit. Without them, Yarn Modern resolves d3 packages to multiple versions (e.g., d3-array 2.12.1 + 3.2.4) because transitive deps use cross-major ranges like "1 - 2". The chart packages then bundle both copies, adding ~13.6 kB to every chart component export. The @swc/helpers, tslib, and lodash resolutions remain removed as they don't affect bundle size. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| "d3-selection": "3.0.0", | ||
| "d3-shape": "3.2.0", | ||
| "d3-time": "3.1.0", | ||
| "d3-time-format": "3.0.0" |
There was a problem hiding this comment.
The chart packages (@fluentui/react-charting, @fluentui/react-charts) depend on d3 v3.x libraries. Some transitive dependencies use cross-major ranges like "d3-array": "1 - 2" or "d3-array": "2 - 3". Without resolutions, Yarn Modern resolves these to separate versions (e.g., d3-array@2.12.1 alongside d3-array@3.2.4)


Migrated FluentUI monorepo from Yarn Classic (v3 bundled CLI) to Yarn Modern (Berry v4.12.0) using nodeLinker: node-modules for full compatibility. No PnP - traditional node_modules/ structure is preserved.
Previous Behavior
Yarn v1
New Behavior
Yarn v4
Yarn binary & configuration
Scripts: just-scripts build → yarn run -T just-scripts build
Resolutions
Syntax change: modern yarn doesn't preserve **/parent/child glob resolutions in practice (strips them during yarn install), so security overrides were flattened from master's scoped form.