Skip to content

(New) Architecture

LeoTM edited this page Jul 31, 2024 · 54 revisions

medium.com/@Kelset/the-react-native-re-architecture-ab7219850d4f

2022 is going to be was the year of the New Architecture in open source

Processes (single-threaded)

  • UI (main): mount host (native) views
  • JS: logic -> render: React Elements (tree) -> React Shadow Nodes (C++) tree
  • Bg: calc (yoga) React Shadow Tree -> promote/mount to UI

C++ State update skip (React) renders

https://github.com/facebook/react-native/tree/main/ReactCommon/jsi

https://github.com/facebook/react-native/tree/main/packages/react-native/ReactCommon/jsi/jsi

https://github.com/facebook/hermes/tree/main/API/jsi/jsi

Old πŸŒ‰

Processes (single-threaded)

  • UI (main) ... JS ... Bg ...
  • RN modules: platform API (via πŸŒ‰)
  • [RN render (Android L 5.0 to draw UI w OpenGL)]

JS (browser) ➰

JS (browser)


Building for iOS Intel x86_64 Architecture

Rosetta 2: for running on Apple Silicon machines, while emulating Intel behaviour

rm -rf /Users/<user>/Library/Developer/Xcode/DerivedData
cd ios
arch -x86_64 pod install
..
arch -x86_64 yarn ios

Or patching ndk-build pre-CMake

Excluding arm64

# project.pbxproj
# ...
- "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
+ "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
# ...
- "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
+ "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
# ...

Open Xcode 13 using Rosetta or iTerm

Details


React Native > Feature requests

Clone this wiki locally