Skip to content

Commit

Permalink
Fix React-Codegen dependencies on FabricImage (facebook#41640)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#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
  • Loading branch information
cipolleschi authored and Othinn committed Jan 9, 2024
1 parent a5ab948 commit 94411f1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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': [],
Expand All @@ -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': [],
Expand Down
1 change: 1 addition & 0 deletions packages/react-native/scripts/cocoapods/codegen_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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': [],
}
Expand Down

0 comments on commit 94411f1

Please sign in to comment.