在 iOS 库中启用
这个文档仍然是实验性的,随着 我们的迭代,细节会有变化。欢迎在工作小组内的讨论中分享你的反馈。
此外,它还包含几个手动步骤。请注意新架构尚未稳定下来,最终的开发者体验会继续迭代改善。我们正在努力开发工具、模板和库,以帮助你在新架构上快速入门,而不需要经历整个设置过程。
You have defined the JavaScript specs for your native modules as part of the prerequisites, and you are now ready to migrate your library to the New Architecture. Here are the steps you can follow to accomplish this.
1. Updating your Podspec for the New Architecture
The New Architecture makes use of CocoaPods.
Add Folly and Other Dependencies
The New Architecture requires some specific dependencies to work properly. You can set up your podspec to automatically install the required dependencies by modifying the .podspec
file. In your Pod::Spec.new
block, add the following line:
Pod::Spec.new do |s|
# ...
+ install_modules_dependencies(s)
# ...
end
At this link, you can find the documentation of the install_modules_dependencies
function.
If you need to explicitly know which folly_flags
React Native is using, you can query them using the folly_flag
function.