Skip to content

Switch to using yarn v4#15925

Merged
acoates-ms merged 13 commits into
microsoft:mainfrom
acoates-ms:yarn4
Apr 6, 2026
Merged

Switch to using yarn v4#15925
acoates-ms merged 13 commits into
microsoft:mainfrom
acoates-ms:yarn4

Conversation

@acoates-ms
Copy link
Copy Markdown
Contributor

@acoates-ms acoates-ms commented Apr 3, 2026

Description

Currently we are using midgard-yarn which is a custom fork of yarnv1 to improve perfomance. Most of the performance improvements in this fork were adopted by yarn 4. So we can move of the more custom midgard-yarn, on to a more broadly supported version of yarn.

@acoates-ms acoates-ms changed the title Yarn4 Switch to using yarn v4 Apr 6, 2026
@acoates-ms acoates-ms marked this pull request as ready for review April 6, 2026 17:17
@acoates-ms acoates-ms requested review from a team as code owners April 6, 2026 17:17
Copy link
Copy Markdown
Contributor

@iamAbhi-916 iamAbhi-916 left a comment

Choose a reason for hiding this comment

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

LGTM

@acoates-ms acoates-ms enabled auto-merge (squash) April 6, 2026 17:29
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 6, 2026

Performance Test Results

Branch: yarn4
Commit: b5ceca8b
Time: 2026-04-06T22:59:16.590Z
Tests: 160/161 passed

❌ Regressions Detected

FlatList

Scenario Baseline Current Change Status
FlatList rerender 9.50ms 13.10ms +44.4%

FlatList rerender: Duration increased by 44.4% / +4.00ms (threshold: 10% & 3ms)

✅ Passed

147 scenario(s) across 27 suite(s) — no regressions

SectionList

Scenario Mean Median StdDev Renders vs Baseline
SectionList mount 5.00ms 4.50ms ±1.83ms 1 -10.0%
SectionList unmount 0.20ms 0.00ms ±0.42ms 0 +0.0%
SectionList rerender 13.30ms 13.00ms ±2.83ms 2 +23.8%
SectionList with-3-sections-15-items 7.70ms 7.50ms ±2.21ms 1 +36.4%
SectionList with-5-sections-50-items 7.40ms 6.50ms ±2.22ms 1 +8.3%
SectionList with-10-sections-200-items 5.30ms 5.00ms ±0.82ms 1 -9.1%
SectionList with-20-sections-200-items 4.90ms 5.00ms ±1.73ms 1 +0.0%
SectionList with-section-separator 1.90ms 2.00ms ±0.32ms 1 +0.0%
SectionList with-item-separator 4.10ms 4.00ms ±1.52ms 1 +100.0%
SectionList with-header-footer 1.70ms 1.50ms ±0.82ms 1 -25.0%
SectionList with-section-footer 2.90ms 2.00ms ±2.18ms 1 +0.0%
SectionList with-sticky-section-headers 2.20ms 2.00ms ±1.03ms 1 +0.0%
SectionList with-empty-list 0.60ms 1.00ms ±0.52ms 1 +0.0%
SectionList with-50-sections-1000-items 3.10ms 2.00ms ±2.85ms 1 +0.0%

TouchableOpacity

Scenario Mean Median StdDev Renders vs Baseline
TouchableOpacity mount 0.80ms 1.00ms ±0.42ms 1 +0.0%
TouchableOpacity unmount 0.60ms 0.00ms ±1.58ms 0 +0.0%
TouchableOpacity rerender 1.10ms 1.00ms ±0.57ms 2 +0.0%
TouchableOpacity custom-active-opacity 0.90ms 1.00ms ±0.32ms 1 +0.0%
TouchableOpacity disabled 0.60ms 1.00ms ±0.52ms 1 +0.0%
TouchableOpacity with-all-handlers 0.70ms 1.00ms ±0.48ms 1 +0.0%
TouchableOpacity with-hit-slop 1.00ms 1.00ms ±0.00ms 1 +0.0%
TouchableOpacity with-delay 1.20ms 1.00ms ±0.63ms 1 +0.0%
TouchableOpacity nested 1.80ms 2.00ms ±0.92ms 1 +100.0%
TouchableOpacity multiple-10 6.73ms 6.00ms ±1.83ms 1 +0.0%
TouchableOpacity multiple-50 29.73ms 28.00ms ±4.30ms 1 -3.4%
TouchableOpacity multiple-100 44.67ms 49.00ms ±12.08ms 1 -2.0%

ScrollView

Scenario Mean Median StdDev Renders vs Baseline
ScrollView mount 0.30ms 0.00ms ±0.48ms 1 +0.0%
ScrollView unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
ScrollView rerender 0.70ms 1.00ms ±0.48ms 2 +0.0%
ScrollView children-20 3.73ms 4.00ms ±0.88ms 1 +0.0%
ScrollView children-100 18.27ms 18.00ms ±4.20ms 1 +12.5%
ScrollView horizontal 3.80ms 3.50ms ±1.40ms 1 -12.5%
ScrollView sticky-headers 2.90ms 3.00ms ±0.88ms 1 +0.0%
ScrollView scroll-indicators 0.70ms 1.00ms ±0.48ms 1 +0.0%
ScrollView nested 1.70ms 1.00ms ±1.06ms 1 +0.0%
ScrollView content-container-style 1.10ms 1.00ms ±0.57ms 1 +0.0%
ScrollView children-500 21.07ms 19.00ms ±3.99ms 1 +0.0%

TouchableHighlight

Scenario Mean Median StdDev Renders vs Baseline
TouchableHighlight mount 0.40ms 0.00ms ±0.52ms 1 -100.0%
TouchableHighlight unmount 0.10ms 0.00ms ±0.32ms 0 +0.0%
TouchableHighlight rerender 0.50ms 0.50ms ±0.53ms 2 -50.0%
TouchableHighlight custom-underlay-color 0.50ms 0.50ms ±0.53ms 1 +Infinity%
TouchableHighlight custom-active-opacity 0.30ms 0.00ms ±0.48ms 1 +0.0%
TouchableHighlight disabled 0.50ms 0.50ms ±0.53ms 1 +Infinity%
TouchableHighlight with-all-handlers 0.30ms 0.00ms ±0.48ms 1 +0.0%
TouchableHighlight with-hit-slop 0.30ms 0.00ms ±0.48ms 1 +0.0%
TouchableHighlight nested-touchables 0.80ms 1.00ms ±0.42ms 1 +0.0%
TouchableHighlight multiple-touchables-10 3.40ms 3.00ms ±1.07ms 1 +0.0%
TouchableHighlight multiple-touchables-50 16.30ms 16.50ms ±2.98ms 1 +32.0%
TouchableHighlight multiple-touchables-100 27.50ms 28.50ms ±4.40ms 1 +26.7%

Pressable

Scenario Mean Median StdDev Renders vs Baseline
Pressable mount 0.50ms 0.50ms ±0.53ms 1 +Infinity%
Pressable unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Pressable rerender 0.70ms 1.00ms ±0.48ms 2 +100.0%
Pressable with-all-handlers 0.50ms 0.50ms ±0.53ms 1 +Infinity%
Pressable with-style-function 0.30ms 0.00ms ±0.48ms 1 +0.0%
Pressable disabled 0.40ms 0.00ms ±0.52ms 1 +0.0%
Pressable with-hit-slop 0.20ms 0.00ms ±0.42ms 1 +0.0%
Pressable nested 0.70ms 1.00ms ±0.48ms 1 +0.0%
Pressable multiple-10 3.07ms 3.00ms ±0.46ms 1 +0.0%
Pressable multiple-50 18.80ms 19.00ms ±3.14ms 1 +35.7%
Pressable multiple-100 18.67ms 14.00ms ±11.57ms 1 +16.7%

Modal

Scenario Mean Median StdDev Renders vs Baseline
Modal mount 0.20ms 0.00ms ±0.42ms 1 +0.0%
Modal unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Modal rerender 0.30ms 0.00ms ±0.48ms 2 +0.0%
Modal slide-animation 0.30ms 0.00ms ±0.48ms 1 +0.0%
Modal fade-animation 0.30ms 0.00ms ±0.48ms 1 +0.0%
Modal transparent 0.40ms 0.00ms ±0.52ms 1 +0.0%
Modal with-callbacks 0.40ms 0.00ms ±0.52ms 1 +0.0%
Modal rich-content 1.60ms 2.00ms ±0.52ms 1 +0.0%
Modal with-accessibility 0.20ms 0.00ms ±0.42ms 1 +0.0%

Image

Scenario Mean Median StdDev Renders vs Baseline
Image mount 0.10ms 0.00ms ±0.32ms 1 +0.0%
Image unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Image rerender 0.20ms 0.00ms ±0.42ms 2 +0.0%
Image with-resize-mode 0.10ms 0.00ms ±0.32ms 1 +0.0%
Image with-border-radius 0.10ms 0.00ms ±0.32ms 1 +0.0%
Image with-tint-color 0.20ms 0.00ms ±0.42ms 1 +0.0%
Image with-blur-radius 0.20ms 0.00ms ±0.42ms 1 +0.0%
Image with-accessibility 0.20ms 0.00ms ±0.42ms 1 +0.0%
Image multiple-10 0.87ms 1.00ms ±0.35ms 1 +0.0%
Image multiple-50 3.87ms 4.00ms ±0.35ms 1 +33.3%
Image multiple-100 8.13ms 8.00ms ±1.19ms 1 +0.0%

ActivityIndicator

Scenario Mean Median StdDev Renders vs Baseline
ActivityIndicator mount 0.20ms 0.00ms ±0.42ms 1 +0.0%
ActivityIndicator unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
ActivityIndicator rerender 0.60ms 0.00ms ±1.26ms 2 +0.0%
ActivityIndicator size-large 0.20ms 0.00ms ±0.42ms 1 +0.0%
ActivityIndicator size-small 0.20ms 0.00ms ±0.42ms 1 +0.0%
ActivityIndicator with-color 0.10ms 0.00ms ±0.32ms 1 +0.0%
ActivityIndicator not-animating 0.20ms 0.00ms ±0.42ms 1 +0.0%
ActivityIndicator with-accessibility 0.10ms 0.00ms ±0.32ms 1 +0.0%
ActivityIndicator multiple-10 1.00ms 1.00ms ±0.00ms 1 +0.0%
ActivityIndicator multiple-50 3.67ms 4.00ms ±0.72ms 1 +0.0%
ActivityIndicator multiple-100 8.07ms 8.00ms ±0.88ms 1 +14.3%

Switch

Scenario Mean Median StdDev Renders vs Baseline
Switch mount 0.30ms 0.00ms ±0.48ms 1 +0.0%
Switch unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Switch rerender 0.40ms 0.00ms ±0.52ms 2 -100.0%
Switch value-true 0.20ms 0.00ms ±0.42ms 1 +0.0%
Switch disabled 0.30ms 0.00ms ±0.48ms 1 +0.0%
Switch custom-colors 0.30ms 0.00ms ±0.48ms 1 +0.0%
Switch on-value-change 0.20ms 0.00ms ±0.42ms 1 +0.0%
Switch with-accessibility 0.30ms 0.00ms ±0.48ms 1 +0.0%
Switch multiple-10 1.60ms 2.00ms ±0.51ms 1 +0.0%
Switch multiple-50 9.93ms 9.00ms ±2.46ms 1 +0.0%
Switch multiple-100 17.67ms 17.00ms ±2.32ms 1 +6.3%

Button

Scenario Mean Median StdDev Renders vs Baseline
Button mount 0.60ms 1.00ms ±0.52ms 1 +0.0%
Button unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Button rerender 1.20ms 1.00ms ±1.14ms 2 +0.0%
Button disabled 0.70ms 1.00ms ±0.48ms 1 +0.0%
Button with-color 0.50ms 0.50ms ±0.53ms 1 +0.0%
Button with-accessibility 0.50ms 0.50ms ±0.53ms 1 -50.0%
Button multiple-10 5.53ms 5.00ms ±1.41ms 1 -16.7%
Button multiple-50 21.67ms 24.00ms ±8.06ms 1 -11.1%
Button multiple-100 15.33ms 15.00ms ±2.61ms 1 -21.1%

TextInput

Scenario Mean Median StdDev Renders vs Baseline
TextInput mount 0.20ms 0.00ms ±0.42ms 1 +0.0%
TextInput unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
TextInput rerender 0.30ms 0.00ms ±0.48ms 2 +0.0%
TextInput multiline 0.20ms 0.00ms ±0.42ms 1 +0.0%
TextInput with-value 0.10ms 0.00ms ±0.32ms 1 +0.0%
TextInput styled 0.20ms 0.00ms ±0.42ms 1 +0.0%
TextInput multiple-100 8.13ms 8.00ms ±1.64ms 1 +14.3%

View

Scenario Mean Median StdDev Renders vs Baseline
View mount 0.30ms 0.00ms ±0.48ms 1 +0.0%
View unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
View rerender 0.30ms 0.00ms ±0.48ms 2 +0.0%
View nested-50 3.87ms 4.00ms ±1.30ms 1 +33.3%
View nested-100 8.60ms 8.00ms ±1.84ms 1 +14.3%
View shadow 0.20ms 0.00ms ±0.42ms 1 +0.0%
View border-radius 0.10ms 0.00ms ±0.32ms 1 +0.0%
View nested-500 17.80ms 10.00ms ±14.00ms 1 +0.0%

Text

Scenario Mean Median StdDev Renders vs Baseline
Text mount 0.10ms 0.00ms ±0.32ms 1 +0.0%
Text unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Text rerender 0.30ms 0.00ms ±0.48ms 2 +0.0%
Text long-1000 0.20ms 0.00ms ±0.42ms 1 +0.0%
Text nested 0.20ms 0.00ms ±0.42ms 1 +0.0%
Text styled 0.20ms 0.00ms ±0.42ms 1 +0.0%
Text multiple-100 9.20ms 9.00ms ±1.74ms 1 +28.6%

SectionList.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
SectionList native mount 5.59ms 5.33ms ±0.77ms 1 -18.1%

FlatList.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
FlatList native mount 5.97ms 5.48ms ±1.35ms 1 -40.6%

TouchableHighlight.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
TouchableHighlight native mount 1.64ms 1.60ms ±0.12ms 1 -23.5%

TouchableOpacity.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
TouchableOpacity native mount 2.27ms 2.13ms ±0.29ms 1 -32.0%

Pressable.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Pressable native mount 2.06ms 1.87ms ±0.34ms 1 -25.5%

ScrollView.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
ScrollView native mount 5.13ms 5.68ms ±1.33ms 1 +40.2%

ActivityIndicator.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
ActivityIndicator native mount 1.67ms 1.65ms ±0.16ms 1 -33.6%

TextInput.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
TextInput native mount 2.67ms 2.73ms ±0.41ms 1 -33.1%

Switch.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Switch native mount 1.34ms 1.27ms ±0.18ms 1 -26.5%

Button.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Button native mount 2.23ms 2.04ms ±0.46ms 1 -21.5%

Modal.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Modal native mount 1.27ms 1.28ms ±0.07ms 1 +5.0%

Image.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Image native mount 2.10ms 2.07ms ±0.36ms 1 -8.6%

View.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
View native mount 1.36ms 1.30ms ±0.22ms 1 -8.9%

Text.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Text native mount 1.66ms 1.61ms ±0.19ms 1 -7.3%

@acoates-ms acoates-ms requested a review from a team as a code owner April 6, 2026 20:24
Comment on lines +7 to 12
# Remove postinstall to avoid running build during install
- pwsh: |
$packageJson = Get-Content ./package.json | ConvertFrom-Json
$packageJson.scripts = $packageJson.scripts | Select-Object * -ExcludeProperty postinstall
$packageJson | ConvertTo-Json | Out-File ./package.json
displayName: Remove postinstall
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.

you could set enableScripts: false too?

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.

Oh you did. So do we need this still?

@acoates-ms acoates-ms merged commit ccc5cfe into microsoft:main Apr 6, 2026
31 of 32 checks passed
@acoates-ms acoates-ms deleted the yarn4 branch April 7, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants