Skip to content

feat(macos): port RedBox 2.0 to AppKit#3047

Draft
Saadnajmi wants to merge 2 commits into
microsoft:0.85-mergefrom
Saadnajmi:saadnajmi/0-85-redbox2-appkit
Draft

feat(macos): port RedBox 2.0 to AppKit#3047
Saadnajmi wants to merge 2 commits into
microsoft:0.85-mergefrom
Saadnajmi:saadnajmi/0-85-redbox2-appkit

Conversation

@Saadnajmi

Copy link
Copy Markdown
Collaborator

Summary

Targets 0.85-merge with two focused commits:

  1. Sync the upstream React Native 0.85 RedBox 2.0 aggregate from
    [0.85] Backport RedBox 2.0 for iOS react/react-native#56640.
  2. Port the RedBox 2.0 controller to AppKit without changing iOS, tvOS, or
    visionOS behavior.

This draft introduces the canonical RedBox2/AppKit implementation before the
0.86 fork merge. It does not rebase any existing stack branch.

Structural sync

The upstream aggregate adds the RedBox feature flags, extracted controllers,
C++ ANSI/error/JscSafeUrl support and tests, HMR support, CocoaPods ownership,
SwiftPM ownership, and feature-flag generated output.

The duplicate produced 20 conflicted paths: RCTRedBox.mm plus 19 generated
feature-flag files. The coordinator/controller resolution follows the existing
0.85 stable structural precedent, while generated outputs were regenerated
from ReactNativeFeatureFlags.config.js.

AppKit delta

The AppKit commit changes five files. It:

  • enables redBoxV2IOS() selection on macOS while retaining the legacy
    controller when the flag is false;
  • adds the NSTableView RedBox2 UI, AppKit footer buttons/key equivalents,
    NSPasteboard copy support, and sheet lifecycle;
  • activates the target-version ANSI adapter on macOS;
  • preserves the upstream iOS projection byte-for-byte after removing macOS
    blocks and additive clauses.

The old a87eee7 legacy-controller blob and stale ANSI adapter blob are
excluded. The target-version C++ parser, ErrorParser, HMR client, JscSafeUrl,
and later-compatible legacy-controller carve-outs remain authoritative.

Validation

Passed:

  • exact S 47-path aggregate and bilateral conflict/provenance audit;
  • generated feature flags and focused Jest tests (11/11);
  • balanced [macOS] diff tags and iOS projection parity (5/5);
  • CocoaPods and SwiftPM source ownership;
  • RNTester Debug builds for macOS, iOS simulator, and visionOS simulator;
  • all four affected RedBox sources compiled on all three platforms with zero
    source-attributed diagnostics;
  • conflict-marker scan, git diff --check, graph/ref freeze, and clean
    Jujutsu working copy.

Native validation used a fresh no-local Git clone at exact AppKit commit
4ed3fb225714a6809cc69b8afdeffb88c0f8c80f. CocoaPods codegen ran first and
generated the required FBReactNativeSpec/AppSpecs headers.

The API comparison tool reports a pre-existing unrelated VirtualizedList delta
even for byte-identical base/candidate snapshots; the RedBox change contains no
JavaScript API delta.

Manual merge gate

Before merging this draft, manually enable redBoxV2IOS, trigger a JavaScript
error, and verify:

  • the RedBox2 sheet and NSTableView rows/source/call stack;
  • Copy and Option-Command-C copy through NSPasteboard;
  • Reload and Command-R;
  • Dismiss and Escape;
  • sheet close/reopen lifecycle.

The feature defaults to false and RNTester has no native override, so this GUI
smoke was not performed by the validation-only executor.

Stack follow-up

After the manual GUI gate and explicit approval:

  • recreate the 0.86/0.87 mainline subtree with merge-preserving Jujutsu
    rebases;
  • add version-appropriate AppKit commits on top of 0.83 and 0.85 stable lines;
  • leave 0.84 unchanged.

All current stack/* bookmarks remain unchanged by this PR.

fabriziocucci and others added 2 commits July 24, 2026 19:20
Based on react#56640.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

2 participants