From 52c2e32ee3f5dd7336530f185baa0d2dd74bd5b7 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Sat, 25 Nov 2023 11:14:21 -0800 Subject: [PATCH] Fix React-Codegen dependencies on FabricImage (#41640) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: react-native-svg reported that the SVG library was not building on the latest RC of React Native because Codegen was not finding the proper files. By inspecting an example app with SVG, we realized that React-Codegen was not depending on `React-FabricImage`, while having access to their headers. We added the dependency, but them the build was failing due to a circular dependency because the `React-ImageManager` was dependeing on `React-RCTImage`. This dependency is conceptually wrong (a piece of Core should not depend on Library which depends on Core... 😑) and I verified that by removing that dependency the framework continue to build. ## Changelog: [Internal] - Fixed dependencies of Codegen on React-Image Reviewed By: cortinico Differential Revision: D51564037 --- .../imagemanager/platform/ios/React-ImageManager.podspec | 1 - .../scripts/cocoapods/__tests__/codegen_utils-test.rb | 2 ++ packages/react-native/scripts/cocoapods/codegen_utils.rb | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec b/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec index c85d5511f62df3..6feeafaf718f0d 100644 --- a/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +++ b/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec @@ -56,7 +56,6 @@ Pod::Spec.new do |s| s.dependency "RCT-Folly/Fabric" s.dependency "React-Core/Default" - s.dependency "React-RCTImage" s.dependency "glog" add_dependency(s, "React-Fabric") diff --git a/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb b/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb index e635db3f708efd..57dbafd8f04405 100644 --- a/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb +++ b/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb @@ -559,6 +559,7 @@ def get_podspec_fabric_and_script_phases(script_phases) specs[:dependencies].merge!({ 'React-graphics': [], 'React-Fabric': [], + 'React-FabricImage': [], 'React-utils': [], 'React-debug': [], 'React-rendererdebug': [], @@ -578,6 +579,7 @@ def get_podspec_when_use_frameworks specs[:dependencies].merge!({ 'React-graphics': [], 'React-Fabric': [], + 'React-FabricImage': [], 'React-utils': [], 'React-debug': [], 'React-rendererdebug': [], diff --git a/packages/react-native/scripts/cocoapods/codegen_utils.rb b/packages/react-native/scripts/cocoapods/codegen_utils.rb index 951adaaa2572cc..9875b2646a2bf3 100644 --- a/packages/react-native/scripts/cocoapods/codegen_utils.rb +++ b/packages/react-native/scripts/cocoapods/codegen_utils.rb @@ -138,6 +138,7 @@ def get_react_codegen_spec(package_json_file, folly_version: '2023.08.07.00', he 'React-graphics': [], 'React-rendererdebug': [], 'React-Fabric': [], + 'React-FabricImage': [], 'React-debug': [], 'React-utils': [], }