Skip to content

feat(react-native)!: support only the New Architecture (RN ≥ 0.84, React ≥ 19.2)#140

Open
istarkov wants to merge 1 commit into
erweixin:mainfrom
istarkov:feat/rn-new-arch-only
Open

feat(react-native)!: support only the New Architecture (RN ≥ 0.84, React ≥ 19.2)#140
istarkov wants to merge 1 commit into
erweixin:mainfrom
istarkov:feat/rn-new-arch-only

Conversation

@istarkov

Copy link
Copy Markdown
Contributor

Summary

ref #139 (comment)

Drops all old-architecture (Paper/Bridge) support from ratex-react-native, aligning the package with the officially supported React Native versions (0.84 / 0.85 / 0.86). Only the New Architecture (Fabric / TurboModules / Codegen) — enabled by default in all supported versions — is supported from now on.

Breaking change: peer dependencies are now react-native >= 0.84.0 and react >= 19.2.0 (RN 0.84 requires React ^19.2.3).

Changes

JS

  • Removed the IS_FABRIC runtime detection and the old-arch JS self-sizing pass in RaTeXView (Fabric self-sizes via the shadow node; onContentSizeChange is now forwarded directly).
  • Removed the legacy require('react-native/Libraries/Text/TextAncestor') fallback — unstable_TextAncestorContext exists in all supported RN versions.

Android

  • Deleted src/oldarch/; merged src/newarch/ into src/main/ (the split had no purpose left).
  • build.gradle is Fabric-only and fails with a clear GradleException when newArchEnabled is not true.
  • RaTeXPackage hardcodes isTurboModule = true; the IS_NEW_ARCHITECTURE_ENABLED buildConfig flag is gone.

iOS

  • Removed all RCT_NEW_ARCH_ENABLED conditionals, the old-arch Bridge view managers (RCT_EXPORT_MODULE/RCT_EXPORT_VIEW_PROPERTY sections) and their headers.
  • Removed the KVC dictionary event blocks (onError / onContentSizeChange) that existed only for the old-arch bridge — Fabric callbacks (setErrorCallback / setContentSizeCallback) are the single event path now.
  • RaTeXColorUtils.h is now guarded with #ifdef __cplusplus (previously kept inert in the CocoaPods umbrella header by the RCT_NEW_ARCH_ENABLED guard).

Docs / demos

  • READMEs (en + zh): requirements table now RN ≥ 0.84 / React ≥ 19.2; the Architecture Support section states New Architecture only.
  • demo/react-native stays pinned to RN 0.81 + react-native-macos 0.81 (the newest react-native-macos release) and installs with legacy-peer-deps (.npmrc); the README documents the constraint and the upgrade path. It runs the New Architecture, so the library works there.

Verification

  • tsc build + typecheck against React 19.2 types.
  • Expo demo (RN 0.86, new arch): built from clean pods and run on the iOS simulator and the Android emulator — display math, inline $…$, baseline alignment, first-commit useLayoutEffect measure, and the detach-cancel repro all pass (rendered 32/32, 0 errors) on both platforms.
  • Flutter and all other platform bindings untouched.

…eact >= 19.2)

Drop all old-architecture (Paper/Bridge) code paths, aligning support with
the officially supported React Native versions (https://reactnative.dev/versions).

- JS: remove IS_FABRIC detection, the old-arch JS self-sizing pass, and the
  legacy TextAncestor require fallback
- Android: delete src/oldarch, merge src/newarch into src/main, Fabric-only
  build.gradle that fails clearly when newArchEnabled is not true, hardcode
  isTurboModule=true (BuildConfig flag removed)
- iOS: remove RCT_NEW_ARCH_ENABLED conditionals, old-arch Bridge view
  managers and their headers, and the KVC dictionary event blocks; guard
  RaTeXColorUtils.h with __cplusplus for the CocoaPods umbrella header
- package.json: peerDependencies react >= 19.2.0, react-native >= 0.84.0;
  dev deps bumped to RN 0.84 / React 19.2.3
- Docs: READMEs (en/zh) now state New Architecture only, RN >= 0.84
- demo/react-native stays on RN 0.81 (react-native-macos ceiling) via
  legacy-peer-deps, documented in its README

Verified: tsc build/typecheck; Expo demo (RN 0.86) built from clean pods and
run on iOS simulator and Android emulator — all repro cases render (32/32).

Claude-Session: https://claude.ai/code/session_0199VHXadcpUUKuayJWFyR1U
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.

1 participant