Skip to content

Commit

Permalink
Fix React-Codegen dependencies on FabricImage (#41640)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Riccardo Cipolleschi authored and facebook-github-bot committed Nov 25, 2023
1 parent c464b21 commit 52c2e32
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 52c2e32

Please sign in to comment.