react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

Building With RTTI

Open NickGerleman opened this issue 2 years ago • 3 comments
trafficstars

Right now react-native mostly tries to avoid RTTI. RN libraries for Android inside of Meta are built with -fno-rtti, but all other internal and OSS builds use -frtti.

Meta's Android build is now moving to globally use -frtti, and JSI was built with RTTI in mind. It is possible we will more broadly allow RTTI usage in RN in the future.

React Native Windows right now disables RTTI in release builds.

NickGerleman avatar Nov 09 '23 21:11 NickGerleman

Related: https://github.com/microsoft/react-native-windows/issues/2974 https://github.com/microsoft/react-native-windows/issues/7981

@NickGerleman Do you have a timeline for when you think it'll become a problem for RNW to not be building with RTTI? We'll want to measure the impact of including this again.

chrisglein avatar Nov 16 '23 19:11 chrisglein

The Android switch to RTTI on in Meta apps is already being tested. There aren't current plans to add explicit RTTI usage (beyond existing JSI APIs), but it will likely come sometime after.

NickGerleman avatar Nov 20 '23 17:11 NickGerleman

Heads up that the changes landed so that all of Meta's builds have RTTI enabled.

We haven't added more usage of it yet, but do explicitly want to replace e.g. traitCast with dynamic_cast.

NickGerleman avatar Jan 12 '24 22:01 NickGerleman