Skip to content

[pull] main from microsoft:main #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open

Conversation

pull[bot]
Copy link

@pull pull bot commented Apr 24, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

## Summary:

It's not clear (both to humans and to build tools like `nx`) that the
only packages we fork from the React Native monorepo upstream are `
'react-native' --> 'react-native-macos'` and
`'@react-native/virtualized-lists' -->
'@react-native-mac/virtualized-lists'`. The rest of the packages should
essentially only ever be used in local development, while the published
package `react-native-macos` uses the upstream versions of these
packages. We can solve this by marking the packages as private.

## Test Plan:

IIRC, this caused some build failure last time I tried this.. let's see
how CI reacts to this change. Further testing with `nx release` should
be done locally to make sure the nx build graph stops marking the
unforked monoreppo packages as dependencies.
@pull pull bot added the ⤵️ pull label Apr 24, 2025
hansenyy and others added 28 commits May 15, 2025 16:22
## Summary:

`findLastestVersionWithArtifact` fails to find older versions of Hermes
prebuilds because the Maven endpoint it uses does not return all
versions.

Resolves #2499

## Test Plan:

`pod install` output from RNTA with RN 0.78.2 and RNM 0.78.3

![image](https://github.com/user-attachments/assets/a6984ba0-87c0-4304-95d1-4a5b054b44fa)
## Summary:

`TextPropsMacOS` has been using `MouseEvent` defined by web as opposed
to React's.

## Test Plan:

n/a
… non null (#2515)

## Summary:

Internally, we build with
[UndefinedBehaviorSanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html),
which caught an instance of a method returning nil while marked as non
null. Apple documentation says that method should return an empty array
as a fallback, so let's do that.

## Test Plan:

Tested internally.
## Summary:

I found that RNTester works with Hermes, so let's enable it in our CIs!

This requires a bit of extra finagling to get the correct version. The
implementation of `podspec_source_build_from_github_merge_base` shows
how to do this.

## Test Plan:

If CIs pass, we're good!

---------

Co-authored-by: Adam Gleitman <[email protected]>
## Summary:

I had previously created a documentation website in a new repo at
r[eact-native-macos-docs](https://github.com/microsoft/react-native-macos-docs),
however due to how Github Pages works, I can't easily publish that to
microsoft.github.io/react-native-macos. So... let's move it here.

## Test Plan:

`yarn start` deploys the website locally, successfully.
The `yarn start` command in `packages/rn-tester` was failing because the
binary name in the `react-native` package didn't match the package name
`react-native-macos`.

## Problem
- Running `yarn start` in `packages/rn-tester` resulted in "command not
found: react-native-macos"
- Users had to use `npx react-native-macos start` as a workaround
- The issue was that the `bin` field in
`packages/react-native/package.json` defined the binary as
`"react-native"` instead of `"react-native-macos"`

## Solution
1. **Updated binary name**: Changed the `bin` field in
`packages/react-native/package.json` from `"react-native": "cli.js"` to
`"react-native-macos": "cli.js"` to match the package name
2. **Fixed script paths**: Updated the `start` and `android` scripts in
`packages/rn-tester/package.json` to use the correct relative path to
the binary: `../../node_modules/.bin/react-native-macos`

## Testing
- ✅ `yarn start` now works from `packages/rn-tester` directory
- ✅ `yarn start` works from root directory (delegates to rn-tester)
- ✅ `npx react-native-macos start` continues to work as before
- ✅ Test scripts in `scripts/objc-test.sh` continue to work (they use
`yarn start` from rn-tester context)

Both the standard React Native workflow (`yarn start`) and the existing
workaround (`npx react-native-macos start`) now function correctly.

Fixes #2528.

> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> -
`https://api.github.com/repos/react-native-community/rn-diff-purge/tags`
> - Triggering command: `node
/home/REDACTED/work/react-native-macos/react-native-macos/node_modules/.bin/react-native
start ` (http block)
> - Triggering command: `node ../../node_modules/.bin/react-native-macos
start ` (http block)
> - Triggering command: `/usr/local/bin/node
../../node_modules/.bin/react-native-macos start ` (http block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to my [firewall allow
list](https://gh.io/copilot/firewall-config)
>
> </details>



<!-- START COPILOT CODING AGENT TIPS -->
---

💬 Share your feedback on Copilot coding agent for the chance to win a
$200 gift card! Click
[here](https://survey.alchemer.com/s3/8343779/Copilot-Coding-agent) to
start the survey.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Saadnajmi <[email protected]>
Bumps [undici](https://github.com/nodejs/undici) from 5.28.5 to 5.29.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/nodejs/undici/releases">undici's
releases</a>.</em></p>
<blockquote>
<h2>v5.29.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix tests in v5.x for Node 20 by <a
href="https://github.com/mcollina"><code>@​mcollina</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4104">nodejs/undici#4104</a></li>
<li>Removed clients with unrecoverable errors from the Pool <a
href="https://redirect.github.com/nodejs/undici/pull/4088">nodejs/undici#4088</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/nodejs/undici/compare/v5.28.5...v5.29.0">https://github.com/nodejs/undici/compare/v5.28.5...v5.29.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/nodejs/undici/commit/9528f6853a72a637823e863f1dd12ec47a3fc9e7"><code>9528f68</code></a>
Bumped v5.29.0</li>
<li><a
href="https://github.com/nodejs/undici/commit/f1d75a4e107866110c48003f00e5d0de52ef2cce"><code>f1d75a4</code></a>
increase timeout for redirect test</li>
<li><a
href="https://github.com/nodejs/undici/commit/2d31ed61f7ca12ef6d89a323dc236346364ac379"><code>2d31ed6</code></a>
remove fuzzing tests</li>
<li><a
href="https://github.com/nodejs/undici/commit/6b36d49cb2fa14217baa11b6fd27ee20b661ea4c"><code>6b36d49</code></a>
fix redirect test in Node v16</li>
<li><a
href="https://github.com/nodejs/undici/commit/648dd8f7ba3654db09a095361a167e3576db8cd0"><code>648dd8f</code></a>
more fix for the wpt runner on Windows</li>
<li><a
href="https://github.com/nodejs/undici/commit/a0516bae59b6aa8aa8124f9ae5cfed79541d10e2"><code>a0516ba</code></a>
don't use internal header state for cookies (<a
href="https://redirect.github.com/nodejs/undici/issues/3295">#3295</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/87ce4af0e58657506cedb2d07a5ba24f964b733f"><code>87ce4af</code></a>
fix test/client for node 20</li>
<li><a
href="https://github.com/nodejs/undici/commit/c2c8fd55b778267ad8b2e9ee04218c038a5d02af"><code>c2c8fd5</code></a>
fix: accept v20 SSL specific error for alpn selection in http/2</li>
<li><a
href="https://github.com/nodejs/undici/commit/82200bd10b7073ac235f8fc48d4daa82b350cd4c"><code>82200bd</code></a>
[v6.x] fix wpts on windows (<a
href="https://redirect.github.com/nodejs/undici/issues/4093">#4093</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/47546fa68d04eec5b96ab93225c3bc08b77cd94f"><code>47546fa</code></a>
test: fix windows wpt (<a
href="https://redirect.github.com/nodejs/undici/issues/4050">#4050</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/nodejs/undici/compare/v5.28.5...v5.29.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=undici&package-manager=npm_and_yarn&previous-version=5.28.5&new-version=5.29.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/microsoft/react-native-macos/network/alerts).

</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…2531)

## Summary:

This is a follow-up to #2524 where we expect the RNCore version to be
explicitly specified as a peer dependency in our stable branches.

#2530 brings this in for 0.74-stable; this brings it into the main
branch for cherry-picking into other branches.

## Test Plan:

If CIs pass, we're good.

This shouldn't do anything on the main branch anyway, since we don't run
through any of the peer dependency logic. Either way, a quick run of
RNTester validates that we're still getting our Hermes version via the
same `git merge-base` approach.

---------

Co-authored-by: Adam Gleitman <[email protected]>
## Summary:

Discovered when cherry-picking #2531 into #2530. I didn't catch it
before because we don't actually run through this part on the main
branch.

## Test Plan:

No effects on main branch, but #2530 CIs should succeed now.

Co-authored-by: Adam Gleitman <[email protected]>
## Summary:

Our NX release dry run job depends on a read-only GitHub token (I'm
pretty sure...) which is hard to get with Azure Pipelines. Let's move
the job to Github Actions. In the process, I also updated both the dry
run and the Azure Pipelines publish job to read our publish tag directly
from `nx.json` instead of having it set in YAML. Not sure why we didn't
do that earlier.. I'll have to go check those PRs to see if we had a
strong reason.

## Test Plan:

CI should pass
The `verifyNpmAuth` function in `.ado/scripts/prepublish-check.mjs` was
failing in CI with:

```
❌ Auth token for 'https://registry.npmjs.org/' returned error code E403
```

This occurred because the function performs two npm checks:
1. `npm whoami --registry <registry>` - verifies user authentication ✅
2. `npm token list --registry <registry>` - attempts to list user tokens
❌

While the first check succeeds (confirming the user is authenticated),
the second check fails with E403 because some npm tokens don't have
permission to list tokens, even though they can publish packages
successfully.

## Solution

Made a minimal change to treat E403 errors from `npm token list` as
non-fatal warnings:

```javascript
// Before - All token list errors were fatal
throw new Error(`Auth token for '${registry}' returned error code ${errorCode}`);

// After - E403 is non-fatal, others still throw
if (errorCode === "E403") {
  info(`Token verification skipped: token doesn't have permission to list tokens (${errorCode})`);
} else {
  throw new Error(`Auth token for '${registry}' returned error code ${errorCode}`);
}
```

## Benefits

- ✅ **Fixes CI publishing** - No more E403 failures blocking npm publish
jobs
- ✅ **Maintains security** - `npm whoami` still validates authentication
properly
- ✅ **Preserves existing behavior** - All other error codes (E401,
ENEEDAUTH, etc.) still throw as before
- ✅ **Zero breaking changes** - Fully backward compatible
- ✅ **Clear logging** - Informative message when E403 occurs

## Testing

- Script syntax validation passes
- Code formatting with Prettier is correct
- Manual testing confirms E403 errors are now non-fatal
- All other error scenarios continue to work as expected
- Script runs successfully with all existing options

This surgical fix resolves the specific CI authentication issue while
preserving all existing safeguards and functionality.

Fixes #2546.

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

Co-authored-by: Saad Najmi <[email protected]>
## Summary:

Add a link to React Native Windows on our docs site. Remove some
redundant files while we're at it.

## Test Plan:

<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/697cb911-846a-4a61-a9cd-00cb00f72670"
/>
## Summary:

Function keys on macOS currently get dispatched with the value from the
underlying NS*FunctionKey code point. For instance, a `F12` event gets
dispatched as `\uf70f` for
[NS12FunctionKey](https://developer.apple.com/documentation/appkit/nsf12functionkey?language=objc).
To clean this up, we should dispatch the same strings we use on other
platforms (i.e. `'F12'` for the F12 key).

## Test Plan:
I used a pressable component with a `onKeyDown` handler in
`RNTester-macOS` to test keyboard events. With this change, the function
keys come in as `F12`, `F11` etc... instead of the underlying
NS*FunctionKey code points.

---------

Co-authored-by: Colin Heffernan <[email protected]>
## Summary:

This is fixed upstream with
facebook#52472 . Let's commit (and
backport) a smaller fix for now.

## Test Plan:

Minimal repro of bug is this code below. Basically, you can't focus on
"Pressable Child 2" twice by clicking on the container

```
      <Pressable style={{backgroundColor: 'lightblue', padding: 10, gap: 10}} onPress={() => {myRef.current.focus();}}>
          <Text>Pressable Container</Text>
          <Pressable><Text>Pressable Child 1</Text></Pressable>
          <Pressable ref={myRef}><Text>Pressable Child 2</Text></Pressable>
          <Pressable><Text>Pressable Child 3</Text></Pressable>
      </Pressable>
```
## Summary:

This PR does several things at once, all in order to improve release
flow.

- Updates Yarn to 4.9.2 (Contains a speed fix by @dannyvv )
- Moves our namespace from `@react-native-mac` to `@react-native-macos`
(Turns out @dannyvv had ownership of it, and transferred it so our bot
can use it 😄)
- Updates NX to version 21.

That last one comes with a bunch of changes, as NX 21 comes with a
revamped implementation of `nx release`:
- Moves the project relationship from "independent" to the default
"fixed". This means 'react-native-macos` and
`@react-native-macos/virtualized-lists` will always have the same
version, and git tags / changelings are all centralized on the
react-native-macos version, and follow `v*.*.*`
- Updates our package `nx-release-version` from being a generator to a
version action. This is a new thing with Nx 21's release flow. It
behaves the same.
- Now, by default, local dependency protocols are preserved. We still
can't use this with Yarn 4 & nx to publish, so on stable branches, I'll
undo the `workspace:*` for just react-native-macos's dependency on
virtualized lists.

Between simplifying the graph with the "fixed" project relationship,
preserving the local dependency protocols, and maybe some logic update
to ns release's bump algorithm, `nx release` now does what I want it to
and _only_ bumps react-native-macos and virtualized-lists, instead of
also bumping private packages like rn-tester, and
@react-native/oss-library-example. This unblocks a persistent bug I had
on the stable branches where releases would fail after version bump.

## Test Plan:

`nx release --dry-run` seems  to do what I want it to.
## Summary:

Introduce [Yarn Constraints](https://yarnpkg.com/features/constraints)
to the repository, that check a few things:

1. Enforce that on release branches, we have a peer dependency on React
Native (used for Hermes version lookup, and aligning other dependencies)
2. Enforce that all `@react-native` scoped dependencies use that
version.
3. Enforce that all public `@react-native-macos` packages align with our
react-native-macos version. Some notes..
  - This is effectively only `@react-native-macos/virtualized-lists`
- `public`, because `@react-native-macos/nx-release-version` is private

## Test Plan:

Earlier version of this PR without fixes from `yarn constraints --fix`
properly failed CI:

<img width="1185" height="514" alt="image"
src="https://github.com/user-attachments/assets/0021c531-d57f-4b4a-80f9-ac42d57abef1"
/>
…#2594)

## Summary:

RCTUILabel doesn't like it if we set message to nil, which we
accidentally did by loading our viewController into a window (which
calls viewDidLoad, which creates our label and sets message) before we
have set our property. Simple fix to call code in the right order.

## Test Plan:

<img width="1392" height="860" alt="image"
src="https://github.com/user-attachments/assets/c6158b2c-4f8f-4348-9eb0-e863ec72a9e1"
/>
## Summary:

In our version action, we overrode `afterAllProjectsVersioned` without
calling the base one. The base one updated our Yarn lock. Let's make
sure to call the base one.
## Summary:

With #2560 and followup changes, we call `yarn npm publish` directly
instead of `nx release publish` (Which indirectly used npm publish).
Yarn's NPM publish command grabs its auth token from `.yarnrc.yml`, not
`.npmrc`. Let's update our CI steps that set this.


## Test Plan:

Tested that I can call `yarn config set / unset` to set and unset these
values.
## Summary:

Our `prepublish-check` assumed we used a `.npmrc` file to publish.
However, we're now using Yarn V4 which uses its' `.yarnrc.yml` to set
your registry and auth token. Update the check to handle both.
…oid (#2624)

## Summary:

Only set the keyboard event handlers on macOS. This matches what React
Native Windows does.
While here, update our pod file lock and pbxproj. 

## Test Plan:

Fixes a bug where <Text> had the keyboard handlers on it set, which red
boxed since the handlers don't exist in their native components.

---------

Co-authored-by: Tommy Nguyen <[email protected]>
Saadnajmi and others added 9 commits August 11, 2025 10:33
## Summary:

Last round of publishes failed on the `.npmrc` file not being created.
Let's just pass the values directly to the npm publish command like we
do in `0.74-stable`.
## Summary:

Cherry pick
facebook@ef7f714
, so we can merge this separately from #2620 and not block the CI there.

```
Summary:
Pull Request resolved: facebook#48670

The `LICENSE-docs` was needed when this repo was also containing the reactnative.dev docs. As this is not the case anymore, this file is unncessary.

Changelog:
[Internal] [Changed] - Remove unnecessary LICENSE-docs

Reviewed By: cipolleschi

Differential Revision: D68156336

fbshipit-source-id: 489bf2cb95916c20eb61bfb00e34b8e271bc08e3
```

Co-authored-by: Nicola Corti <[email protected]>
## Summary:

Previously, we always centered the window, which got a bit annoying
during debugging when I'd like to have it remember the last position as
I relaunch it. This is probably a good thing to do in general, so let's
do it in `RCTAppDelegate`.

## Test Plan:

Removed any saved frame by running `defaults delete
Microsoft.RNTester-macOS`: window is centered
Resize window and move it and close and relaunch: old position is
remembered.
## Summary:

Fix a couple of static view config validation warnings by adding
`focusable` to the macOS view config.

## Test Plan:

Less warnings in RNTester when I launch it.
## Summary:

In general, we prefer to use `RCTPlatformView` (`#define NSView`) over
`RCTUIView` (subclass of NSView for iOS interop) as it tends to have
less "Expected NSView, but got subclass of NSView" style errors. This
changes fixes one of those errors
)

## Summary:

Move over the remaining jobs from Azure Pipelines to Github Actions.
This includes porting over the commented out integration tests. Delete
most of the Azure Pipelines code. What should be left is just the
release pipeline.


## Test Plan:

The CI :D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants