From caae388912774dfa5f8e0e73bc63ce0ff9e4ed72 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Sat, 25 Nov 2023 11:39:15 -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: Pull Request resolved: https://github.com/facebook/react-native/pull/41640 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 fbshipit-source-id: 8e7108b83f878be1063df5562311d862d4998121 --- .../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 c85d5511f62..6feeafaf718 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 e635db3f708..57dbafd8f04 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 @@ class CodegenUtilsTests < Test::Unit::TestCase specs[:dependencies].merge!({ 'React-graphics': [], 'React-Fabric': [], + 'React-FabricImage': [], 'React-utils': [], 'React-debug': [], 'React-rendererdebug': [], @@ -578,6 +579,7 @@ class CodegenUtilsTests < Test::Unit::TestCase 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 951adaaa257..9875b2646a2 100644 --- a/packages/react-native/scripts/cocoapods/codegen_utils.rb +++ b/packages/react-native/scripts/cocoapods/codegen_utils.rb @@ -138,6 +138,7 @@ class CodegenUtils 'React-graphics': [], 'React-rendererdebug': [], 'React-Fabric': [], + 'React-FabricImage': [], 'React-debug': [], 'React-utils': [], }