Skip to content

feat(react-native): close remaining legacy parity gaps#1198

Merged
BYK merged 3 commits into
mainfrom
byk/feat/react-native-parity
Jul 3, 2026
Merged

feat(react-native): close remaining legacy parity gaps#1198
BYK merged 3 commits into
mainfrom
byk/feat/react-native-parity

Conversation

@BYK

@BYK BYK commented Jul 3, 2026

Copy link
Copy Markdown
Member

Tightens the react-native commands to full functional parity with the legacy Rust CLI for all supported (Hermes / modern) React Native configurations — the last remaining behavioral gaps after the command port.

What changed

react-native xcode

  • Info.plist C preprocessing — when INFOPLIST_PREPROCESS=YES, run the plist through cc -xc -P -E (with INFOPLIST_OTHER_PREPROCESSOR_FLAGS / INFOPLIST_PREPROCESSOR_DEFINITIONS), gated behind the legacy-matching --allow-xcode-infoplist-preprocessing flag.
  • xcodebuild discovery outside Xcode — when XCODE_VERSION_ACTUAL isn't set, locate a single .xcodeproj, read xcodebuild -list -json for targets/configurations, and pull the first target's INFOPLIST_FILE/PROJECT_DIR from xcodebuild -showBuildSettings (Release config, else Debug). Ports the legacy XcodeProjectInfo path.

react-native gradle + xcode

  • --wait / --wait-for are now real — they block until the server finishes processing the upload (state "ok"), with a --wait-for <secs> cap. Threaded through a new optional wait/maxWaitMs on uploadSourcemaps and a waitForOk/deadlineMs on pollAssembly. Default behavior is unchanged for every other caller (returns on ok/created), so the heavily-used sourcemap upload path is untouched.

Intentionally out of scope (documented): RAM-bundle unpacking. It's a pre-Hermes format React Native itself deprecated; the command emits a clear error and the docs say so.

Tests (+8, full suite 8411 passed)

  • xcode-env: cc preprocessing (used when allowed, skipped when not), xcodebuild discovery (resolves via Release config; returns null with no .xcodeproj) — execFileSync mocked so it runs on Linux CI.
  • resolveUploadWait: no-flags / --wait / --wait-for mapping.
  • gradle: --wait/--wait-for thread wait/maxWaitMs into the upload.

typecheck / lint / check:deps / check:fragments all pass. Docs fragment + generated skill updated.

Closes the remaining react-native parity gaps; combined with the earlier ports, the TS CLI now matches the legacy CLI's functionality for all supported RN setups.

…ait)

Tightens the react-native commands to full parity for supported (Hermes/modern)
RN configs:

- xcode: Info.plist C preprocessing (`INFOPLIST_PREPROCESS=YES`) via `cc`, gated
  behind `--allow-xcode-infoplist-preprocessing` (matches the legacy flag).
- xcode: discover the release via `xcodebuild -list -json` +
  `-showBuildSettings` when run outside an Xcode build phase (no
  `XCODE_VERSION_ACTUAL`).
- gradle + xcode: `--wait`/`--wait-for` now actually block until the server
  finishes processing (state "ok"), with a `--wait-for` cap. Wired through a new
  `wait`/`maxWaitMs` option on `uploadSourcemaps` and a `waitForOk`/`deadlineMs`
  option on `pollAssembly` (default behavior unchanged for all other callers).

RAM-bundle unpacking is intentionally left unsupported and documented as such —
it is a pre-Hermes format React Native itself deprecated.

New: shared `resolveUploadWait`, xcode-env `discoverInfoPlist` C-preprocess +
xcodebuild paths. Tests: preprocessing, xcodebuild discovery, resolveUploadWait,
and gradle --wait/--wait-for plumbing (8 new). Full suite 8411 passed.
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-1198/

Built to branch gh-pages at 2026-07-03 17:44 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Comment thread src/lib/react-native/xcode-env.ts Outdated
Comment thread src/lib/api/sourcemaps.ts
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ Patch coverage is 80.73%. Project has 5307 uncovered lines.
✅ Project coverage is 81.88%. Comparing base (base) to head (head).

Files with missing lines (3)
File Patch % Lines
src/lib/react-native/xcode-env.ts 84.27% ⚠️ 14 Missing and 14 partials
src/lib/api/sourcemaps.ts 45.45% ⚠️ 6 Missing
src/commands/react-native/xcode.ts 66.67% ⚠️ 1 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    81.78%    81.88%     +0.1%
==========================================
  Files          423       423         —
  Lines        29194     29282       +88
  Branches     18980     19051       +71
==========================================
+ Hits         23874     23975      +101
- Misses        5320      5307       -13
- Partials      1968      1987       +19

Generated by Codecov Action

- gradle: correct stale --wait/--wait-for flag briefs (still claimed the flags
  were no-ops); they now match the real behavior + generated docs.
- Validate --wait-for: reject NaN / non-positive seconds with a ValidationError
  before uploading (previously produced a confusing post-upload timeout).
- xcode-env: resolve INFOPLIST_FILE with path.resolve so an absolute plist path
  is honored (join silently concatenated it).

Tests: pollAssembly waitForOk matrix (default returns on "created"; waitForOk
blocks through "created"→"ok"), --wait-for rejection cases. Full suite 8416.
@BYK

BYK commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

Self-review (critical, via subagent)

Verdict: no Critical/High regressions. Addressed the actionable findings in 875065d.

Verified no regression (the important ones):

  • pollAssembly has exactly one caller (uploadSourcemaps); debug-files/proguard/dart run their own assemble loops. The default path (waitForOk=false) still returns on "ok" or "created" — byte-equivalent to before. Now covered by a test.
  • The _uploadArtifactBundle error-vs-early-return reordering is behavior-neutral (state is a mutually-exclusive enum); the main sourcemap upload command (no wait) is unchanged.
  • Shell-outs use execFileSync (no shell); xcodebuild/cc absent on non-macOS → caught → graceful null fallback. All new catches log.debug.

Fixed:

  • Stale gradle --wait/--wait-for flag briefs (still said "accepted for compatibility").
  • --wait-for now rejects NaN/non-positive seconds with a ValidationError (previously became a confusing post-upload timeout).
  • INFOPLIST_FILE resolved with path.resolve so an absolute plist path is honored.

Consciously kept (parity): with --wait, if the server leaves the bundle in "created" past the cap, it times out (408) — this is the point of --wait and matches legacy --wait semantics.

getBuildVars split on \n only, so a CRLF line ending would leave a trailing
\r on the parsed value (e.g. INFOPLIST_FILE), producing an invalid path. Split
on /\r?\n/ (matching Rust's .lines()). Test now emits CRLF output.
@BYK BYK merged commit 564f0fc into main Jul 3, 2026
32 checks passed
@BYK BYK deleted the byk/feat/react-native-parity branch July 3, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant