iOS Prebuilds for React Native #912
Replies: 5 comments 7 replies
-
Does the benchmark table need editing? Currently the data is suggesting that builds take 40 seconds longer when using prebuilds. |
Beta Was this translation helpful? Give feedback.
-
It looks like the blog post link is broken. |
Beta Was this translation helpful? Give feedback.
-
When this experimental feature is enabled, integrating the nativewind library causes a build error during compilation. |
Beta Was this translation helpful? Give feedback.
-
The Podfile syntax to enable this feature looks inconsistent with incorrect quote types.
Whereas this post uses:
From other usages within the Podfile and empirical testing, it should be:
|
Beta Was this translation helpful? Give feedback.
-
It looks promising, until I get the following error when fetching the podspec for
Is this a React-Native issue, or should I raise an issue with AWS Amplify JS? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Starting from React Native 0.80, we are shipping part of React Native for iOS as a prebuild. This helps to reduce build times and build errors related to React Native.
We experimented and benchmarked how much time this initial prebuild for iOS is saving and, in our benchmarks, run on an M4 machine, iOS builds are roughly 12% faster with the prebuild rather than by building from source.
T-statistic: -3.1505; p-value: 0.00553
From our experience, we also observed that several bug reports from users are caused by build issues related with React Native’s 3rd party dependencies (example #39568).
Prebuilding the 3rd party dependencies allows us to build them for you, so that you won’t face these build issues anymore.
Note that we are not pre-building the whole React Native: we are only pre-building the libraries Meta does not directly control, such as Folly and GLog.
In a future release, we will also ship the rest of React Native core as a prebuild.
How to use them
This feature is still experimental, so it is not turned on by default.
If you want to use them, you can install your pods by adding the
RCT_USE_RN_DEP
env variable:Alternatively, if you want to enable it for all the developers working on that, you can modify your Podfile like this:
if linkage != nil Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green use_frameworks! :linkage => linkage.to_sym end +ENV[‘RCT_USE_RN_DEP’] = ‘1’ target 'HelloWorld' do config = use_native_modules!
The goal of this discussion is to track issues you might encounter when turning this feature on.
If you experience any problem with the prebuilds, please post a comment below this discussion.
Beta Was this translation helpful? Give feedback.
All reactions