diff --git a/.gitignore b/.gitignore index 382e8aec6fa49f..dafe03a53835c7 100644 --- a/.gitignore +++ b/.gitignore @@ -101,7 +101,7 @@ package-lock.json # react-native-codegen /packages/react-native-codegen/lib -/ReactCommon/fabric/components/rncore/ +/ReactCommon/react/renderer/components/rncore/ /schema-native-modules.json /schema-rncore.json diff --git a/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm index 7b5a56999ed8be..f5c0a1e421deb8 100644 --- a/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm @@ -13,7 +13,7 @@ #import #import -#import "FBRCTFabricComponentsPlugins.h" +#import "RCTFabricComponentsPlugins.h" using namespace facebook::react; diff --git a/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h b/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h index 4f6ea0e815679c..78e52b5e3f5eb0 100644 --- a/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h +++ b/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h @@ -40,6 +40,7 @@ Class RCTParagraphCls(void) __attribute__((used)); Class RCTTextInputCls(void) __attribute__((used)); Class RCTInputAccessoryCls(void) __attribute__((used)); Class RCTViewCls(void) __attribute__((used)); +Class RCTImageCls(void) __attribute__((used)); #ifdef __cplusplus } diff --git a/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm b/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm index a52c8c06e366da..bfccee6ca0942f 100644 --- a/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm +++ b/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm @@ -29,6 +29,7 @@ {"TextInput", RCTTextInputCls}, {"InputAccessoryView", RCTInputAccessoryCls}, {"View", RCTViewCls}, + {"Image",RCTImageCls}, }; auto p = sFabricComponentsClassMap.find(name); diff --git a/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm index 7623c1099f93b0..6ea248c98584e0 100644 --- a/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm @@ -10,7 +10,7 @@ #import #import #import -#import "FBRCTFabricComponentsPlugins.h" +#import "RCTFabricComponentsPlugins.h" #import "RCTConversions.h" #import "RCTFabricComponentsPlugins.h" diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm index afcec45afa68cc..6d89e699307df8 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm @@ -16,7 +16,7 @@ #import #import -#import "FBRCTFabricComponentsPlugins.h" +#import "RCTFabricComponentsPlugins.h" using namespace facebook::react; diff --git a/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm b/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm index af62366caa3be3..f9c4d89f9b10d9 100644 --- a/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm @@ -15,7 +15,7 @@ #import #import -#import "FBRCTFabricComponentsPlugins.h" +#import "RCTFabricComponentsPlugins.h" using namespace facebook::react; diff --git a/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm b/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm index e680a25ba2827f..970414806e1cd9 100644 --- a/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm @@ -14,7 +14,7 @@ #import #import -#import "FBRCTFabricComponentsPlugins.h" +#import "RCTFabricComponentsPlugins.h" using namespace facebook::react; diff --git a/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm index d7eaa6c62a54fc..04e426d7ab9e5b 100644 --- a/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm @@ -16,7 +16,7 @@ #import -#import "FBRCTFabricComponentsPlugins.h" +#import "RCTFabricComponentsPlugins.h" using namespace facebook::react; diff --git a/React/Fabric/Mounting/RCTComponentViewFactory.mm b/React/Fabric/Mounting/RCTComponentViewFactory.mm index 1c857b440c9d95..9855392d2ad6ff 100644 --- a/React/Fabric/Mounting/RCTComponentViewFactory.mm +++ b/React/Fabric/Mounting/RCTComponentViewFactory.mm @@ -57,8 +57,7 @@ + (RCTComponentViewFactory *)standardComponentViewFactory [componentViewFactory registerComponentViewClass:[RCTParagraphComponentView class]]; [componentViewFactory registerComponentViewClass:[RCTTextInputComponentView class]]; - Class imageClass = RCTComponentViewClassWithName("Image"); - [componentViewFactory registerComponentViewClass:imageClass]; + [componentViewFactory registerComponentViewClass:[RCTImageComponentView class]]; auto providerRegistry = &componentViewFactory->_providerRegistry; diff --git a/React/React-RCTFabric.podspec b/React/React-RCTFabric.podspec index bca122846f75b0..7cbe0c8d275fb6 100644 --- a/React/React-RCTFabric.podspec +++ b/React/React-RCTFabric.podspec @@ -30,8 +30,7 @@ Pod::Spec.new do |s| s.author = "Facebook, Inc. and its affiliates" s.platforms = { :ios => "10.0" } s.source = source - s.source_files = "Fabric/**/*.{c,h,m,mm,S,cpp}", - "Tests/**/*.{mm}" + s.source_files = "Fabric/**/*.{c,h,m,mm,S,cpp}" s.exclude_files = "**/tests/*", "**/android/*", s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags @@ -45,5 +44,11 @@ Pod::Spec.new do |s| s.dependency "React-Core", version s.dependency "React-Fabric", version s.dependency "React-RCTImage", version - s.dependency "Folly/Fabric", folly_version + s.dependency "RCT-Folly/Fabric", folly_version + + s.test_spec 'Tests' do |test_spec| + test_spec.source_files = "Tests/**/*.{mm}" + test_spec.framework = "XCTest" + end + end diff --git a/ReactCommon/React-Fabric.podspec b/ReactCommon/React-Fabric.podspec index 0bf38ed0c2f62a..8f8603aa45d786 100644 --- a/ReactCommon/React-Fabric.podspec +++ b/ReactCommon/React-Fabric.podspec @@ -18,7 +18,7 @@ end folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32' folly_version = '2020.01.13.00' -folly_dep_name = 'Folly/Fabric' +folly_dep_name = 'RCT-Folly/Fabric' boost_compiler_flags = '-Wno-documentation' Pod::Spec.new do |s| @@ -30,7 +30,7 @@ Pod::Spec.new do |s| s.author = "Facebook, Inc. and its affiliates" s.platforms = { :ios => "10.0" } s.source = source - s.prepare_command = File.read("../scripts/generate-rncore.sh") + s.prepare_command = "node #{File.join(__dir__, "..", "scripts", "generate-rncore.js")}" s.source_files = "dummyFile.cpp" s.library = "stdc++" s.pod_target_xcconfig = { "USE_HEADERMAP" => "YES", @@ -44,12 +44,21 @@ Pod::Spec.new do |s| s.dependency "ReactCommon/turbomodule/core", version s.dependency "React-jsi", version + s.subspec "animations" do |ss| + ss.dependency folly_dep_name, folly_version + ss.compiler_flags = folly_compiler_flags + ss.source_files = "react/renderer/animations/**/*.{m,mm,cpp,h}" + ss.exclude_files = "**/tests/*" + ss.header_dir = "react/renderer/animations" + ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } + end + s.subspec "attributedstring" do |ss| ss.dependency folly_dep_name, folly_version ss.compiler_flags = folly_compiler_flags - ss.source_files = "fabric/attributedstring/**/*.{m,mm,cpp,h}" + ss.source_files = "react/renderer/attributedstring/**/*.{m,mm,cpp,h}" ss.exclude_files = "**/tests/*" - ss.header_dir = "react/attributedstring" + ss.header_dir = "react/renderer/attributedstring" ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end @@ -63,7 +72,7 @@ Pod::Spec.new do |s| end s.subspec "config" do |ss| - ss.source_files = "config/*.{m,mm,cpp,h}" + ss.source_files = "react/config/*.{m,mm,cpp,h}" ss.header_dir = "react/config" ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\"" } end @@ -71,121 +80,138 @@ Pod::Spec.new do |s| s.subspec "core" do |ss| ss.dependency folly_dep_name, folly_version ss.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags - ss.source_files = "fabric/core/**/*.{m,mm,cpp,h}" + ss.source_files = "react/renderer/core/**/*.{m,mm,cpp,h}" ss.exclude_files = "**/tests/**/*" - ss.header_dir = "react/core" + ss.header_dir = "react/renderer/core" ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end + s.subspec "componentregistry" do |ss| + ss.dependency folly_dep_name, folly_version + ss.compiler_flags = folly_compiler_flags + ss.source_files = "react/renderer/componentregistry/**/*.{m,mm,cpp,h}" + ss.header_dir = "react/renderer/componentregistry" + ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } + end + s.subspec "components" do |ss| ss.subspec "activityindicator" do |sss| sss.dependency folly_dep_name, folly_version sss.compiler_flags = folly_compiler_flags - sss.source_files = "fabric/components/activityindicator/**/*.{m,mm,cpp,h}" + sss.source_files = "react/renderer/components/activityindicator/**/*.{m,mm,cpp,h}" sss.exclude_files = "**/tests/*" - sss.header_dir = "react/components/activityindicator" + sss.header_dir = "react/renderer/components/activityindicator" sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end ss.subspec "image" do |sss| sss.dependency folly_dep_name, folly_version sss.compiler_flags = folly_compiler_flags - sss.source_files = "fabric/components/image/**/*.{m,mm,cpp,h}" + sss.source_files = "react/renderer/components/image/**/*.{m,mm,cpp,h}" + sss.exclude_files = "**/tests/*" + sss.header_dir = "react/renderer/components/image" + sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } + end + + ss.subspec "inputaccessory" do |sss| + sss.dependency folly_dep_name, folly_version + sss.compiler_flags = folly_compiler_flags + sss.source_files = "react/renderer/components/inputaccessory/**/*.{m,mm,cpp,h}" sss.exclude_files = "**/tests/*" - sss.header_dir = "react/components/image" + sss.header_dir = "react/renderer/components/inputaccessory" sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end ss.subspec "legacyviewmanagerinterop" do |sss| sss.dependency folly_dep_name, folly_version sss.compiler_flags = folly_compiler_flags - sss.source_files = "fabric/components/legacyviewmanagerinterop/**/*.{m,mm,cpp,h}" + sss.source_files = "react/renderer/components/legacyviewmanagerinterop/**/*.{m,mm,cpp,h}" sss.exclude_files = "**/tests/*" - sss.header_dir = "react/components/legacyviewmanagerinterop" + sss.header_dir = "react/renderer/components/legacyviewmanagerinterop" sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Private/React-Core\"" } end ss.subspec "modal" do |sss| sss.dependency folly_dep_name, folly_version sss.compiler_flags = folly_compiler_flags - sss.source_files = "fabric/components/modal/**/*.{m,mm,cpp,h}" + sss.source_files = "react/renderer/components/modal/**/*.{m,mm,cpp,h}" sss.exclude_files = "**/tests/*" - sss.header_dir = "react/components/modal" + sss.header_dir = "react/renderer/components/modal" sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end ss.subspec "rncore" do |sss| sss.dependency folly_dep_name, folly_version sss.compiler_flags = folly_compiler_flags - sss.source_files = "fabric/components/rncore/*.{m,mm,cpp,h}" - sss.exclude_files = "**/tests/*", "fabric/components/rncore/*Tests.{h,cpp}", + sss.source_files = "react/renderer/components/rncore/*.{m,mm,cpp,h}" + sss.exclude_files = "**/tests/*", "react/renderer/components/rncore/*Tests.{h,cpp}", # TODO: These should be re-enabled later when Codegen Native Module support is needed. - "fabric/components/rncore/rncore-generated.mm", "fabric/components/rncore/NativeModules.{h,cpp}" - sss.header_dir = "react/components/rncore" + "react/renderer/components/rncore/rncore-generated.mm", "react/renderer/components/rncore/NativeModules.{h,cpp}" + sss.header_dir = "react/renderer/components/rncore" sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end ss.subspec "root" do |sss| sss.dependency folly_dep_name, folly_version sss.compiler_flags = folly_compiler_flags - sss.source_files = "fabric/components/root/**/*.{m,mm,cpp,h}" + sss.source_files = "react/renderer/components/root/**/*.{m,mm,cpp,h}" sss.exclude_files = "**/tests/*" - sss.header_dir = "react/components/root" + sss.header_dir = "react/renderer/components/root" sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end ss.subspec "safeareaview" do |sss| sss.dependency folly_dep_name, folly_version sss.compiler_flags = folly_compiler_flags - sss.source_files = "fabric/components/safeareaview/**/*.{m,mm,cpp,h}" + sss.source_files = "react/renderer/components/safeareaview/**/*.{m,mm,cpp,h}" sss.exclude_files = "**/tests/*" - sss.header_dir = "react/components/safeareaview" + sss.header_dir = "react/renderer/components/safeareaview" sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end ss.subspec "scrollview" do |sss| sss.dependency folly_dep_name, folly_version sss.compiler_flags = folly_compiler_flags - sss.source_files = "fabric/components/scrollview/**/*.{m,mm,cpp,h}" + sss.source_files = "react/renderer/components/scrollview/**/*.{m,mm,cpp,h}" sss.exclude_files = "**/tests/*" - sss.header_dir = "react/components/scrollview" + sss.header_dir = "react/renderer/components/scrollview" sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end ss.subspec "slider" do |sss| sss.dependency folly_dep_name, folly_version sss.compiler_flags = folly_compiler_flags - sss.source_files = "fabric/components/slider/**/*.{m,mm,cpp,h}" + sss.source_files = "react/renderer/components/slider/**/*.{m,mm,cpp,h}" sss.exclude_files = "**/tests/*", "**/android/*" - sss.header_dir = "react/components/slider" + sss.header_dir = "react/renderer/components/slider" sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end ss.subspec "text" do |sss| sss.dependency folly_dep_name, folly_version sss.compiler_flags = folly_compiler_flags - sss.source_files = "fabric/components/text/**/*.{m,mm,cpp,h}" + sss.source_files = "react/renderer/components/text/**/*.{m,mm,cpp,h}" sss.exclude_files = "**/tests/*" - sss.header_dir = "react/components/text" + sss.header_dir = "react/renderer/components/text" sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end ss.subspec "textinput" do |sss| sss.dependency folly_dep_name, folly_version sss.compiler_flags = folly_compiler_flags - sss.source_files = "fabric/components/textinput/iostextinput/**/*.{m,mm,cpp,h}" + sss.source_files = "react/renderer/components/textinput/iostextinput/**/*.{m,mm,cpp,h}" sss.exclude_files = "**/tests/*" - sss.header_dir = "react/components/iostextinput" + sss.header_dir = "react/renderer/components/iostextinput" sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end ss.subspec "unimplementedview" do |sss| sss.dependency folly_dep_name, folly_version sss.compiler_flags = folly_compiler_flags - sss.source_files = "fabric/components/unimplementedview/**/*.{m,mm,cpp,h}" + sss.source_files = "react/renderer/components/unimplementedview/**/*.{m,mm,cpp,h}" sss.exclude_files = "**/tests/*" - sss.header_dir = "react/components/unimplementedview" + sss.header_dir = "react/renderer/components/unimplementedview" sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end @@ -193,9 +219,9 @@ Pod::Spec.new do |s| sss.dependency folly_dep_name, folly_version sss.dependency "Yoga" sss.compiler_flags = folly_compiler_flags - sss.source_files = "fabric/components/view/**/*.{m,mm,cpp,h}" + sss.source_files = "react/renderer/components/view/**/*.{m,mm,cpp,h}" sss.exclude_files = "**/tests/*" - sss.header_dir = "react/components/view" + sss.header_dir = "react/renderer/components/view" sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end end @@ -203,9 +229,9 @@ Pod::Spec.new do |s| s.subspec "debug" do |ss| ss.dependency folly_dep_name, folly_version ss.compiler_flags = folly_compiler_flags - ss.source_files = "fabric/debug/**/*.{m,mm,cpp,h}" + ss.source_files = "react/renderer/debug/**/*.{m,mm,cpp,h}" ss.exclude_files = "**/tests/*" - ss.header_dir = "react/debug" + ss.header_dir = "react/renderer/debug" ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end @@ -213,45 +239,64 @@ Pod::Spec.new do |s| ss.dependency "React-RCTImage", version ss.dependency folly_dep_name, folly_version ss.compiler_flags = folly_compiler_flags - ss.source_files = "fabric/imagemanager/**/*.{m,mm,cpp,h}" + ss.source_files = "react/renderer/imagemanager/**/*.{m,mm,cpp,h}" ss.exclude_files = "**/tests/*", "**/android/*", "**/cxx/*" - ss.header_dir = "react/imagemanager" + ss.header_dir = "react/renderer/imagemanager" ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end s.subspec "mounting" do |ss| ss.dependency folly_dep_name, folly_version ss.compiler_flags = folly_compiler_flags - ss.source_files = "fabric/mounting/**/*.{m,mm,cpp,h}" + ss.source_files = "react/renderer/mounting/**/*.{m,mm,cpp,h}" ss.exclude_files = "**/tests/*" - ss.header_dir = "react/mounting" + ss.header_dir = "react/renderer/mounting" + ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } + end + + s.subspec "scheduler" do |ss| + ss.dependency folly_dep_name, folly_version + ss.compiler_flags = folly_compiler_flags + ss.source_files = "react/renderer/scheduler/**/*.{m,mm,cpp,h}" + ss.header_dir = "react/renderer/scheduler" + ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } + end + + s.subspec "templateprocessor" do |ss| + ss.dependency folly_dep_name, folly_version + ss.compiler_flags = folly_compiler_flags + ss.source_files = "react/renderer/templateprocessor/**/*.{m,mm,cpp,h}" + ss.exclude_files = "**/tests/*" + ss.header_dir = "react/renderer/templateprocessor" ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end s.subspec "textlayoutmanager" do |ss| ss.dependency folly_dep_name, folly_version + ss.dependency "React-Fabric/uimanager" ss.compiler_flags = folly_compiler_flags - ss.source_files = "fabric/textlayoutmanager/**/*.{m,mm,cpp,h}" + ss.source_files = "react/renderer/textlayoutmanager/platform/{ios,cxx}/**/*.{m,mm,cpp,h}", + "react/renderer/textlayoutmanager/*.{m,mm,cpp,h}" ss.exclude_files = "**/tests/*", "**/android/*", "**/cxx/*" - ss.header_dir = "react/textlayoutmanager" + ss.header_dir = "react/renderer/textlayoutmanager" ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end s.subspec "uimanager" do |ss| ss.dependency folly_dep_name, folly_version ss.compiler_flags = folly_compiler_flags - ss.source_files = "fabric/uimanager/**/*.{m,mm,cpp,h}" - ss.exclude_files = "**/tests/*", - ss.header_dir = "react/uimanager" + ss.source_files = "react/renderer/uimanager/**/*.{m,mm,cpp,h}" + ss.exclude_files = "**/tests/*" + ss.header_dir = "react/renderer/uimanager" ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end s.subspec "utils" do |ss| - ss.source_files = "utils/*.{m,mm,cpp,h}" + ss.source_files = "react/utils/*.{m,mm,cpp,h}" ss.header_dir = "react/utils" ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } end diff --git a/ReactCommon/react/renderer/graphics/React-graphics.podspec b/ReactCommon/react/renderer/graphics/React-graphics.podspec index 30bffb22f09d7b..2620e9bb3c985f 100644 --- a/ReactCommon/react/renderer/graphics/React-graphics.podspec +++ b/ReactCommon/react/renderer/graphics/React-graphics.podspec @@ -5,7 +5,7 @@ require "json" -package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json"))) +package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json"))) version = package['version'] source = { :git => 'https://github.com/facebook/react-native.git' } @@ -35,8 +35,8 @@ Pod::Spec.new do |s| s.exclude_files = "**/tests/*", "**/android/*", "**/cxx/*" - s.header_dir = "react/graphics" - s.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" } + s.header_dir = "react/renderer/graphics" + s.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_TARGET_SRCROOT)/../../../\" \"$(PODS_ROOT)/RCT-Folly\"" } - s.dependency "Folly/Fabric", folly_version + s.dependency "RCT-Folly/Fabric", folly_version end diff --git a/ReactCommon/yoga/Yoga.podspec b/ReactCommon/yoga/Yoga.podspec index 500dfee8e47ac5..b723a3410018da 100644 --- a/ReactCommon/yoga/Yoga.podspec +++ b/ReactCommon/yoga/Yoga.podspec @@ -51,7 +51,7 @@ Pod::Spec.new do |spec| source_files = File.join('ReactCommon/yoga', source_files) if ENV['INSTALL_YOGA_WITHOUT_PATH_OPTION'] spec.source_files = source_files - header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGValue}.h' + header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGNode,YGStyle,YGValue}.h' header_files = File.join('ReactCommon/yoga', header_files) if ENV['INSTALL_YOGA_WITHOUT_PATH_OPTION'] spec.public_header_files = header_files end diff --git a/packages/rn-tester/Podfile b/packages/rn-tester/Podfile index 9331c0b35c2b31..f45e93d1bc14ee 100644 --- a/packages/rn-tester/Podfile +++ b/packages/rn-tester/Podfile @@ -13,16 +13,25 @@ def pods() # Enable TurboModule prefix_path = "../.." - use_react_native!(path:prefix_path) + fabric_enabled = false + + # To use fabric: set the environment variable `USE_FABRIC` to 1, like below + # $ USE_FABRIC=1 bundle exec pod install + # or + # $ export USE_FABRIC=1 + # $ bundle exec pod install + if ENV['USE_FABRIC'] == '1' + puts "Building RNTester with Fabric enabled." + fabric_enabled = true + end + + use_react_native!(path:prefix_path, fabric_enabled: fabric_enabled) pod 'ReactCommon/turbomodule/samples', :path => "#{prefix_path}/ReactCommon" # Additional Pods which aren't included in the default Podfile pod 'React-RCTPushNotification', :path => "#{prefix_path}/Libraries/PushNotificationIOS" pod 'Yoga',:path => "#{prefix_path}/ReactCommon/yoga", :modular_headers => true # Additional Pods which are classed as unstable - # - # To use fabric: add `fabric_enabled` option to the use_react_native method above, like below - # use_react_native!(path: "..", fabric_enabled: true) end target 'RNTester' do diff --git a/scripts/generate-rncore.js b/scripts/generate-rncore.js new file mode 100644 index 00000000000000..1097d95bf69a9f --- /dev/null +++ b/scripts/generate-rncore.js @@ -0,0 +1,53 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +'use strict'; + +const path = require('path'); +const fs = require('fs'); +const glob = require('glob'); +const RNCodegen = require('react-native-codegen/lib/generators/RNCodegen'); +const combine = require('react-native-codegen/lib/cli/combine/combine-js-to-schema'); + +function generate(schema, outputDirectory) { + fs.mkdirSync(outputDirectory, {recursive: true}); + + RNCodegen.generate( + { + libraryName: 'rncore', + schema, + outputDirectory, + }, + {generators: ['descriptors', 'events', 'props', 'shadow-nodes']}, + ); +} + +function main() { + const rnDir = path.resolve(__dirname, '..'); + const outputDirectory = path.resolve( + rnDir, + 'ReactCommon', + 'react', + 'renderer', + 'components', + 'rncore', + ); + + const files = glob.sync('Libraries/**/*NativeComponent.js', { + cwd: path.resolve(__dirname, '..'), + }); + + const schema = combine( + files.map(file => path.resolve(__dirname, '..', file)), + ); + + generate(schema, outputDirectory); +} + +main(); diff --git a/scripts/generate-rncore.sh b/scripts/generate-rncore.sh deleted file mode 100755 index 5e67d91c812302..00000000000000 --- a/scripts/generate-rncore.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# Copyright (c) Facebook, Inc. and its affiliates. -# -# This source code is licensed under the MIT license found in the -# LICENSE file in the root directory of this source tree. - -# This script collects the "core" component schemas used by fabric -# then uses react-native-codegen to generate the component headers -# to a location that the podspecs expect. - -# shellcheck disable=SC2038 - -find "$PWD/../Libraries" -name "*NativeComponent.js" -print | xargs yarn flow-node packages/react-native-codegen/src/cli/combine/combine-js-to-schema-cli.js schema-rncore.json -yarn flow-node packages/react-native-codegen/buck_tests/generate-tests.js schema-rncore.json rncore ReactCommon/fabric/components/rncore rncore diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 213f8543398c21..dc6606b4bef2e1 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -56,7 +56,7 @@ def use_react_native! (options={}) if fabric_enabled pod 'React-Fabric', :path => "#{prefix}/ReactCommon" - pod 'React-graphics', :path => "#{prefix}/ReactCommon/fabric/graphics" + pod 'React-graphics', :path => "#{prefix}/ReactCommon/react/renderer/graphics" pod 'React-jsi/Fabric', :path => "#{prefix}/ReactCommon/jsi" pod 'React-RCTFabric', :path => "#{prefix}/React" pod 'RCT-Folly/Fabric', :podspec => "#{prefix}/third-party-podspecs/RCT-Folly.podspec"