Skip to content

Commit 12e5f14

Browse files
committed
Merge branch 'main' of github.com:microsoft/react-native-windows into boost-1.84
2 parents e171c66 + f1ea8c4 commit 12e5f14

7 files changed

Lines changed: 149 additions & 137 deletions

File tree

.ado/jobs/desktop-single.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,29 @@ steps:
2727
displayName: Install IIS
2828
2929
- pwsh: |
30-
Invoke-WebRequest `
30+
function Invoke-WebRequestWithRetry($Uri, $OutFile, $MaxRetries = 3) {
31+
for ($i = 1; $i -le $MaxRetries; $i++) {
32+
try {
33+
Write-Host "Downloading $OutFile (attempt $i of $MaxRetries)"
34+
Invoke-WebRequest -Uri $Uri -OutFile $OutFile
35+
return
36+
} catch {
37+
Write-Host "Attempt $i failed: $_"
38+
if ($i -eq $MaxRetries) { throw }
39+
Start-Sleep -Seconds (5 * $i)
40+
}
41+
}
42+
}
43+
44+
Invoke-WebRequestWithRetry `
3145
-Uri 'https://download.visualstudio.microsoft.com/download/pr/20598243-c38f-4538-b2aa-af33bc232f80/ea9b2ca232f59a6fdc84b7a31da88464/dotnet-hosting-8.0.3-win.exe' `
3246
-OutFile dotnet-hosting-8.0.3-win.exe
3347
3448
Write-Host 'Installing .NET hosting bundle'
3549
Start-Process -Wait -FilePath .\dotnet-hosting-8.0.3-win.exe -ArgumentList '/INSTALL', '/QUIET', '/NORESTART'
3650
Write-Host 'Installed .NET hosting bundle'
3751
38-
Invoke-WebRequest `
52+
Invoke-WebRequestWithRetry `
3953
-Uri 'https://download.visualstudio.microsoft.com/download/pr/f2ec926e-0d98-4a8b-8c70-722ccc2ca0e5/b59941b0c60f16421679baafdb7e9338/dotnet-sdk-7.0.407-win-x64.exe' `
4054
-OutFile dotnet-sdk-7.0.407-win-x64.exe
4155

.ado/jobs/linting.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,29 @@ jobs:
1616
variables: [template: ../variables/windows.yml]
1717
pool: ${{ parameters.AgentPool.Medium }}
1818
steps:
19-
- template: ../templates/checkout-shallow.yml
19+
- ${{ if eq(parameters.buildEnvironment, 'Continuous') }}:
20+
- template: ../templates/checkout-shallow.yml
21+
parameters:
22+
persistCredentials: true
23+
24+
# Extract the GitHub OAuth token that ADO uses to clone the repo.
25+
# Any authenticated token raises the GitHub API rate limit from 60 to
26+
# 5,000 req/hr, which prevents validate-overrides from being throttled.
27+
- pwsh: |
28+
$headerLine = git config --get-regexp "http.*\.extraheader" 2>$null | Select-Object -First 1
29+
if (-not $headerLine) {
30+
Write-Host "##vso[task.logissue type=warning]No HTTP extraheader found — validate-overrides will run without GitHub auth"
31+
exit 0
32+
}
33+
$encoded = ($headerLine.Split(' ')[-1]).Trim()
34+
$decoded = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($encoded))
35+
$token = $decoded.Split(':')[-1]
36+
Write-Host "Extracted GitHub OAuth token (length=$($token.Length))"
37+
Write-Host "##vso[task.setvariable variable=GitHubOAuthToken;issecret=true]$token"
38+
displayName: Extract GitHub OAuth token
39+
40+
- ${{ else }}:
41+
- template: ../templates/checkout-shallow.yml
2042

2143
- template: ../templates/prepare-js-env.yml
2244

@@ -28,6 +50,9 @@ jobs:
2850

2951
- script: yarn validate-overrides
3052
displayName: yarn validate-overrides
53+
${{ if eq(parameters.buildEnvironment, 'Continuous') }}:
54+
env:
55+
PLATFORM_OVERRIDE_GITHUB_TOKEN: $(GitHubOAuthToken)
3156

3257
- script: npx unbroken -q --local-only --allow-local-line-sections
3358
displayName: check local links in .md files
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Checkout the state of the repo at the time of the commit being tested,
22
# without full history.
3+
parameters:
4+
- name: persistCredentials
5+
type: boolean
6+
default: false
7+
38
steps:
49
- checkout: self
510
fetchDepth: 1
611
clean: false
712
submodules: false
813
lfs: false
14+
persistCredentials: ${{ parameters.persistCredentials }}

.github/workflows/move-issues-milestones.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

packages/@react-native-windows/tester/src/js/examples-win/Pointer/PointerClickEventsExample.windows.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,37 @@
1111
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
1212

1313
const React = require('react');
14-
import {Pressable, StyleSheet, View} from 'react-native';
14+
import {StyleSheet, View} from 'react-native';
1515
import RNTesterText from '../../components/RNTesterText';
1616

1717
function PointerClickEventsExample(): React.Node {
1818
const [text, setText] = React.useState(
1919
'onClick should cause the box to go red, onAuxClick will cause it go green',
2020
);
21-
const [bgColor, setBgColor]= React.useState('gray');
21+
const [bgColor, setBgColor] = React.useState('gray');
2222
return (
2323
<View>
2424
<View
2525
accessible
2626
testID="pointer-click-target"
2727
style={[styles.targetBox, {backgroundColor: bgColor}]}
28-
onClick={(e) => {
28+
onClick={e => {
2929
setBgColor('red');
30-
setText('onClick.nativeEvent: ' + JSON.stringify(e.nativeEvent, null, 2));
30+
setText(
31+
'onClick.nativeEvent: ' + JSON.stringify(e.nativeEvent, null, 2),
32+
);
3133
}}
32-
onAuxClick={(e) => {
34+
onAuxClick={e => {
3335
setBgColor('green');
34-
setText('onAuxClick.nativeEvent: ' + JSON.stringify(e.nativeEvent, null, 2));
36+
setText(
37+
'onAuxClick.nativeEvent: ' + JSON.stringify(e.nativeEvent, null, 2),
38+
);
3539
}}
3640
/>
37-
<RNTesterText accessible testID='pointer-click-text'>{text}</RNTesterText>
41+
<RNTesterText accessible testID="pointer-click-text">
42+
{text}
43+
</RNTesterText>
3844
</View>
39-
4045
);
4146
}
4247

@@ -46,8 +51,7 @@ exports.category = 'Basic';
4651
exports.title = 'Pointer Clicks';
4752
exports.documentationURL =
4853
'https://developer.mozilla.org/en-US/docs/Web/API/Element/auxclick_event';
49-
exports.description =
50-
'Tests that onClick and onAuxClick work.';
54+
exports.description = 'Tests that onClick and onAuxClick work.';
5155

5256
exports.examples = [
5357
{

packages/e2e-test-app-fabric/test/PointerClickEventsTest.test.ts

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ afterEach(async () => {
2020
await verifyNoErrorLogs();
2121
});
2222

23-
2423
describe('Pointer onClick Test', () => {
2524
test('onClick reports correct native event properties on left click', async () => {
2625
const component = await app.findElementByTestID('pointer-click-target');
@@ -33,7 +32,9 @@ describe('Pointer onClick Test', () => {
3332
await app.waitUntil(
3433
async () => {
3534
const currentText = await stateText.getText();
36-
return currentText.includes('"button": 0') && currentText.includes('onClick');
35+
return (
36+
currentText.includes('"button": 0') && currentText.includes('onClick')
37+
);
3738
},
3839
{
3940
timeout: 5000,
@@ -43,7 +44,10 @@ describe('Pointer onClick Test', () => {
4344
);
4445

4546
const text = await stateText.getText();
46-
expect(text).toMatchSnapshot();
47+
const nativeEvent = JSON.parse(text.split('onClick.nativeEvent: ')[1]);
48+
expect(typeof nativeEvent.target).toBe('number');
49+
nativeEvent.target = '<target>';
50+
expect(nativeEvent).toMatchSnapshot();
4751
});
4852
test('onAuxClick reports correct native event properties on middle click', async () => {
4953
const component = await app.findElementByTestID('pointer-click-target');
@@ -56,7 +60,10 @@ describe('Pointer onClick Test', () => {
5660
await app.waitUntil(
5761
async () => {
5862
const currentText = await stateText.getText();
59-
return currentText.includes('"button": 1') && currentText.includes('onAuxClick');
63+
return (
64+
currentText.includes('"button": 1') &&
65+
currentText.includes('onAuxClick')
66+
);
6067
},
6168
{
6269
timeout: 5000,
@@ -66,20 +73,26 @@ describe('Pointer onClick Test', () => {
6673
);
6774

6875
const text = await stateText.getText();
69-
expect(text).toMatchSnapshot();
76+
const nativeEvent = JSON.parse(text.split('onAuxClick.nativeEvent: ')[1]);
77+
expect(typeof nativeEvent.target).toBe('number');
78+
nativeEvent.target = '<target>';
79+
expect(nativeEvent).toMatchSnapshot();
7080
});
7181
test('onAuxClick reports correct native event properties on right click', async () => {
7282
const component = await app.findElementByTestID('pointer-click-target');
7383
await component.waitForDisplayed({ timeout: 5000 });
7484

75-
// Middle click triggers onPointerDown with button=2
85+
// Right click triggers onPointerDown with button=2
7686
await component.click({ button: 'right' });
7787
const stateText = await app.findElementByTestID('pointer-click-text');
7888

7989
await app.waitUntil(
8090
async () => {
8191
const currentText = await stateText.getText();
82-
return currentText.includes('"button": 2') && currentText.includes('onAuxClick');
92+
return (
93+
currentText.includes('"button": 2') &&
94+
currentText.includes('onAuxClick')
95+
);
8396
},
8497
{
8598
timeout: 5000,
@@ -89,7 +102,9 @@ describe('Pointer onClick Test', () => {
89102
);
90103

91104
const text = await stateText.getText();
92-
expect(text).toMatchSnapshot();
105+
const nativeEvent = JSON.parse(text.split('onAuxClick.nativeEvent: ')[1]);
106+
expect(typeof nativeEvent.target).toBe('number');
107+
nativeEvent.target = '<target>';
108+
expect(nativeEvent).toMatchSnapshot();
93109
});
94-
95110
});

0 commit comments

Comments
 (0)