Skip to content

Commit

Permalink
Re-version SDK 49 on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
tsapeta committed Jul 23, 2023
1 parent 683e8eb commit bdf1985
Show file tree
Hide file tree
Showing 67 changed files with 510 additions and 1,833 deletions.
491 changes: 246 additions & 245 deletions ios/Podfile.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ header_search_paths = [
if ENV["USE_FRAMEWORKS"]
header_search_paths = header_search_paths.concat([
"\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\""
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers/build/generated/ios\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers/build/generated/ios\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers\""
])
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ header_search_paths = [
if ENV["USE_FRAMEWORKS"]
header_search_paths = header_search_paths.concat([
"\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\""
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers/build/generated/ios\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers/build/generated/ios\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers\"",

])
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ header_search_paths = [
if ENV["USE_FRAMEWORKS"]
header_search_paths = header_search_paths.concat([
"\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\""
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers/build/generated/ios\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers/build/generated/ios\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers\"",
])
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ - (BOOL)textView:(__unused UITextView *)textView shouldChangeTextInRange:(NSRang

- (void)textViewDidChange:(__unused UITextView *)textView
{
if (_ignoreNextTextInputCall) {
if (_ignoreNextTextInputCall && [_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) {
_ignoreNextTextInputCall = NO;
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ header_search_paths = [
if ENV["USE_FRAMEWORKS"]
header_search_paths = header_search_paths.concat([
"\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\""
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers/build/generated/ios\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers\""
])
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
__rnVersion = @{
ABI49_0_0RCTVersionMajor: @(0),
ABI49_0_0RCTVersionMinor: @(72),
ABI49_0_0RCTVersionPatch: @(1),
ABI49_0_0RCTVersionPatch: @(3),
ABI49_0_0RCTVersionPrerelease: [NSNull null],
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ - (instancetype)initWithCoordinator:(ABI49_0_0RCTLegacyViewManagerInteropCoordin

- (void)dealloc
{
[_coordinator removeViewFromRegistryWithTag:_tag];
[_paperView removeFromSuperview];
[_coordinator removeObserveForTag:_tag];
}
Expand All @@ -39,6 +40,7 @@ - (UIView *)paperView
weakSelf.eventInterceptor(eventName, event);
}
}];
[_coordinator addViewToRegistry:_paperView withTag:_tag];
}
return _paperView;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Pod::Spec.new do |s|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17" }

if ENV['USE_FRAMEWORKS']
s.header_mappings_dir = './'
s.header_mappings_dir = File.absolute_path('./')
s.module_name = 'ABI49_0_0React_Fabric'
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ react_native_dependency_path = ENV['REACT_NATIVE_PATH']
# Relative path to react native from current podspec
react_native_sources_path = '..'

header_search_paths = [
"\"$(PODS_TARGET_SRCROOT)\"",
"\"$(PODS_TARGET_SRCROOT)/ReactCommon\"",
]

if ENV["USE_FRAMEWORKS"]
header_search_paths = header_search_paths.concat([
"\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
])
end

Pod::Spec.new do |s|
s.name = "ABI49_0_0React-rncore"
s.version = version
Expand All @@ -31,6 +42,7 @@ Pod::Spec.new do |s|
s.source = { :path => "." }
s.source_files = "dummyFile.cpp"
s.pod_target_xcconfig = { "USE_HEADERMAP" => "YES",
"HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17" }

end
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Pod::Spec.new do |s|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
"GCC_WARN_PEDANTIC" => "YES" }
if ENV['USE_FRAMEWORKS']
s.header_mappings_dir = './'
s.header_mappings_dir = File.absolute_path("./")
end

# TODO (T48588859): Restructure this target to align with dir structure: "react/nativemodule/..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <ABI49_0_0cxxreact/ABI49_0_0JSIndexedRAMBundle.h>
#include <folly/MoveWrapper.h>
#include <folly/json.h>
#include <ABI49_0_0React/debug/ABI49_0_0React_native_assert.h>

#include <glog/logging.h>

Expand Down Expand Up @@ -212,26 +213,31 @@ std::shared_ptr<CallInvoker> Instance::getJSCallInvoker() {
}

RuntimeExecutor Instance::getRuntimeExecutor() {
std::weak_ptr<NativeToJsBridge> weakNativeToJsBridge = nativeToJsBridge_;
// HACK: RuntimeExecutor is not compatible with non-JSIExecutor, we return
// a null callback, which the caller should handle.
if (!getJavaScriptContext()) {
return nullptr;
}

auto runtimeExecutor =
[weakNativeToJsBridge](
std::function<void(jsi::Runtime & runtime)> &&callback) {
if (auto strongNativeToJsBridge = weakNativeToJsBridge.lock()) {
strongNativeToJsBridge->runOnExecutorQueue(
[callback = std::move(callback)](JSExecutor *executor) {
jsi::Runtime *runtime =
(jsi::Runtime *)executor->getJavaScriptContext();
try {
callback(*runtime);
executor->flush();
} catch (jsi::JSError &originalError) {
handleJSError(*runtime, originalError, true);
}
});
}
};
return runtimeExecutor;
std::weak_ptr<NativeToJsBridge> weakNativeToJsBridge = nativeToJsBridge_;
return [weakNativeToJsBridge](
std::function<void(jsi::Runtime & runtime)> &&callback) {
if (auto strongNativeToJsBridge = weakNativeToJsBridge.lock()) {
strongNativeToJsBridge->runOnExecutorQueue(
[callback = std::move(callback)](JSExecutor *executor) {
// Assumes the underlying executor is a JSIExecutor
jsi::Runtime *runtime =
(jsi::Runtime *)executor->getJavaScriptContext();
try {
ABI49_0_0React_native_assert(runtime != nullptr);
callback(*runtime);
executor->flush();
} catch (jsi::JSError &originalError) {
handleJSError(*runtime, originalError, true);
}
});
}
};
}

std::shared_ptr<CallInvoker> Instance::getDecoratedNativeCallInvoker(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Pod::Spec.new do |s|
s.source_files = "*.{cpp,h}"
s.exclude_files = "ABI49_0_0SampleCxxModule.*"
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimeexecutor/React_runtimeexecutor.framework/Headers\"",
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimeexecutor/React_runtimeexecutor.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\"",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17" }
s.header_dir = "ABI49_0_0cxxreact"

Expand All @@ -41,6 +41,7 @@ Pod::Spec.new do |s|
s.dependency "ABI49_0_0React-perflogger", version
s.dependency "ABI49_0_0React-jsi", version
s.dependency "ABI49_0_0React-logger", version
s.dependency "ABI49_0_0React-debug", version

if ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == "1"
s.dependency 'ABI49_0_0hermes-engine'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace ABI49_0_0facebook::ABI49_0_0React {
constexpr struct {
int32_t Major = 0;
int32_t Minor = 72;
int32_t Patch = 1;
int32_t Patch = 3;
std::string_view Prerelease = "";
} reactNativeVersion;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ target_link_libraries(reactnative
jsinspector
logger
reactperflogger
runtimeexecutor)
runtimeexecutor
react_debug)
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ target_compile_options(
-fexceptions
)

if(${CMAKE_BUILD_TYPE} MATCHES Debug)
target_compile_options(
hermes_inspector
PRIVATE
-DHERMES_ENABLE_DEBUGGER=1
)
endif()

target_include_directories(hermes_inspector PUBLIC ${REACT_COMMON_DIR})
target_link_libraries(hermes_inspector
jsinspector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ bool EmptyABI49_0_0ReactNativeConfig::getBool(const std::string &param) const {
if (param == "ABI49_0_0React_fabric:enabled_layout_animations_ios") {
return true;
}
if (param == "ABI49_0_0React_fabric:enable_nstextstorage_caching") {
return true;
}
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ Pod::Spec.new do |s|

if ENV['USE_FRAMEWORKS']
s.module_name = "ABI49_0_0React_debug"
s.header_mappings_dir = "../.."
s.header_mappings_dir = File.absolute_path("../..")
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Pod::Spec.new do |s|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
"GCC_WARN_PEDANTIC" => "YES" }
if ENV['USE_FRAMEWORKS']
s.header_mappings_dir = './'
s.header_mappings_dir = File.absolute_path('./')
end

s.source_files = "ReactCommon/**/*.{mm,cpp,h}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Pod::Spec.new do |s|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
"GCC_WARN_PEDANTIC" => "YES" }
if ENV['USE_FRAMEWORKS']
s.header_mappings_dir = './'
s.header_mappings_dir = File.absolute_path('./')
end


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ typedef void (^InterceptorBlock)(std::string eventName, folly::dynamic event);
ABI49_0_0ReactTag:(NSInteger)tag
paperView:(UIView *)paperView;

- (void)removeViewFromRegistryWithTag:(NSInteger)tag;

- (void)addViewToRegistry:(UIView *)view withTag:(NSInteger)tag;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,19 @@ - (void)handleCommand:(NSString *)commandName
NSArray *newArgs = [@[ [NSNumber numberWithInteger:tag] ] arrayByAddingObjectsFromArray:args];

if (_bridge) {
[self _addViewToRegistry:paperView withTag:tag];
[_bridge.batchedBridge
dispatchBlock:^{
[method invokeWithBridge:self->_bridge module:self->_componentData.manager arguments:newArgs];
[self->_bridge.uiManager setNeedsLayout];
}
queue:ABI49_0_0RCTGetUIManagerQueue()];
[self _removeViewFromRegistryWithTag:tag];
} else {
// TODO T86826778 - Figure out which queue this should be dispatched to.
[method invokeWithBridge:nil module:self->_componentData.manager arguments:newArgs];
}
}

#pragma mark - Private
- (void)_addViewToRegistry:(UIView *)view withTag:(NSInteger)tag
- (void)addViewToRegistry:(UIView *)view withTag:(NSInteger)tag
{
[self _addUIBlock:^(ABI49_0_0RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
if ([viewRegistry objectForKey:@(tag)] != NULL) {
Expand All @@ -158,7 +155,7 @@ - (void)_addViewToRegistry:(UIView *)view withTag:(NSInteger)tag
}];
}

- (void)_removeViewFromRegistryWithTag:(NSInteger)tag
- (void)removeViewFromRegistryWithTag:(NSInteger)tag
{
[self _addUIBlock:^(ABI49_0_0RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
if ([viewRegistry objectForKey:@(tag)] == NULL) {
Expand All @@ -171,6 +168,8 @@ - (void)_removeViewFromRegistryWithTag:(NSInteger)tag
}];
}

#pragma mark - Private

- (void)_addUIBlock:(ABI49_0_0RCTViewManagerUIBlock)block
{
__weak __typeof__(self) weakSelf = self;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +0,0 @@

/**
* This code was generated by [ABI49_0_0React-native-codegen](https://www.npmjs.com/package/ABI49_0_0React-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateComponentDescriptorH.js
*/

#pragma once

#include <ABI49_0_0React/ABI49_0_0renderer/components/rncore/ShadowNodes.h>
#include <ABI49_0_0React/renderer/core/ABI49_0_0ConcreteComponentDescriptor.h>

namespace ABI49_0_0facebook {
namespace ABI49_0_0React {

using AndroidHorizontalScrollContentViewComponentDescriptor = ConcreteComponentDescriptor<AndroidHorizontalScrollContentViewShadowNode>;
using AndroidSwipeRefreshLayoutComponentDescriptor = ConcreteComponentDescriptor<AndroidSwipeRefreshLayoutShadowNode>;
using PullToRefreshViewComponentDescriptor = ConcreteComponentDescriptor<PullToRefreshViewShadowNode>;
using AndroidDrawerLayoutComponentDescriptor = ConcreteComponentDescriptor<AndroidDrawerLayoutShadowNode>;
using ActivityIndicatorViewComponentDescriptor = ConcreteComponentDescriptor<ActivityIndicatorViewShadowNode>;
using UnimplementedNativeViewComponentDescriptor = ConcreteComponentDescriptor<UnimplementedNativeViewShadowNode>;
using SwitchComponentDescriptor = ConcreteComponentDescriptor<SwitchShadowNode>;
using TraceUpdateOverlayComponentDescriptor = ConcreteComponentDescriptor<TraceUpdateOverlayShadowNode>;

} // namespace ABI49_0_0React
} // namespace ABI49_0_0facebook
Loading

0 comments on commit bdf1985

Please sign in to comment.