docstring_tokens
stringlengths
18
16.9k
code_tokens
stringlengths
75
1.81M
html_url
stringlengths
74
116
file_name
stringlengths
3
311
keep keep keep keep replace keep keep keep keep keep
<mask> ->stopMapper(rt, std::move(args[0])); <mask> return jsi::Value::undefined(); <mask> } <mask> <mask> static jsi::Value __hostFunction_NativeReanimatedModuleSpec_registerEventHandler( <mask> jsi::Runtime &rt, <mask> TurboModule &turboModule, <mask> const jsi::Value *args, <mask> size_t count) { <mask> return static_cast<NativeReanimatedModuleSpec *>(&turboModule) </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove ->makeShareable(rt, std::move(args[0])); </s> add ->makeShareable(rt, std::move(args[0])); </s> remove ->makeMutable(rt, std::move(args[0])); </s> add ->makeMutable(rt, std::move(args[0])); </s> remove ->makeRemote(rt, std::move(args[0])); </s> add ->makeRemote(rt, std::move(args[0])); </s> remove ->getViewProp(rt, std::move(args[0]), std::move(args[1]), std::move(args[2])); return jsi::Value::undefined(); </s> add ->getViewProp( rt, std::move(args[0]), std::move(args[1]), std::move(args[2])); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeReanimatedModuleSpec_enableLayoutAnimations( jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value *args, size_t count) { static_cast<NativeReanimatedModuleSpec *>(&turboModule) ->enableLayoutAnimations(rt, std::move(args[0])); return jsi::Value::undefined(); </s> remove ->installCoreFunctions(rt, std::move(args[0])); </s> add ->installCoreFunctions(rt, std::move(args[0])); </s> remove static jsi::Value __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler( </s> add static jsi::Value __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler(
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> return static_cast<NativeReanimatedModuleSpec *>(&turboModule) <mask> ->registerEventHandler(rt, std::move(args[0]), std::move(args[1])); <mask> } <mask> <mask> static jsi::Value __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler( <mask> jsi::Runtime &rt, <mask> TurboModule &turboModule, <mask> const jsi::Value *args, <mask> size_t count) { <mask> static_cast<NativeReanimatedModuleSpec *>(&turboModule) </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove ->getViewProp(rt, std::move(args[0]), std::move(args[1]), std::move(args[2])); return jsi::Value::undefined(); </s> add ->getViewProp( rt, std::move(args[0]), std::move(args[1]), std::move(args[2])); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeReanimatedModuleSpec_enableLayoutAnimations( jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value *args, size_t count) { static_cast<NativeReanimatedModuleSpec *>(&turboModule) ->enableLayoutAnimations(rt, std::move(args[0])); return jsi::Value::undefined(); </s> remove ->startMapper(rt, std::move(args[0]), std::move(args[1]), std::move(args[2])); </s> add ->startMapper( rt, std::move(args[0]), std::move(args[1]), std::move(args[2]), std::move(args[3]), std::move(args[4])); </s> remove ->makeShareable(rt, std::move(args[0])); </s> add ->makeShareable(rt, std::move(args[0])); </s> remove ->makeMutable(rt, std::move(args[0])); </s> add ->makeMutable(rt, std::move(args[0])); </s> remove ->makeRemote(rt, std::move(args[0])); </s> add ->makeRemote(rt, std::move(args[0])); </s> remove static jsi::Value __hostFunction_NativeReanimatedModuleSpec_registerEventHandler( </s> add static jsi::Value __hostFunction_NativeReanimatedModuleSpec_registerEventHandler(
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp
keep keep keep keep replace replace keep keep replace keep keep keep keep
<mask> TurboModule &turboModule, <mask> const jsi::Value *args, <mask> size_t count) { <mask> static_cast<NativeReanimatedModuleSpec *>(&turboModule) <mask> ->getViewProp(rt, std::move(args[0]), std::move(args[1]), std::move(args[2])); <mask> return jsi::Value::undefined(); <mask> } <mask> <mask> NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(std::shared_ptr<CallInvoker> jsInvoker) <mask> : TurboModule("NativeReanimated", jsInvoker) { <mask> methodMap_["installCoreFunctions"] = MethodMetadata{ <mask> 1, __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions}; <mask> </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove 1, __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions}; </s> add 1, __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions}; </s> remove ->startMapper(rt, std::move(args[0]), std::move(args[1]), std::move(args[2])); </s> add ->startMapper( rt, std::move(args[0]), std::move(args[1]), std::move(args[2]), std::move(args[3]), std::move(args[4])); </s> remove static jsi::Value __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler( </s> add static jsi::Value __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler( </s> remove ->installCoreFunctions(rt, std::move(args[0])); </s> add ->installCoreFunctions(rt, std::move(args[0])); </s> remove ->makeMutable(rt, std::move(args[0])); </s> add ->makeMutable(rt, std::move(args[0]));
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(std::shared_ptr<CallInvoker> jsInvoker) <mask> : TurboModule("NativeReanimated", jsInvoker) { <mask> methodMap_["installCoreFunctions"] = MethodMetadata{ <mask> 1, __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions}; <mask> <mask> <mask> methodMap_["makeShareable"] = MethodMetadata{ <mask> 1, __hostFunction_NativeReanimatedModuleSpec_makeShareable}; <mask> methodMap_["makeMutable"] = MethodMetadata{ <mask> 1, __hostFunction_NativeReanimatedModuleSpec_makeMutable}; </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(std::shared_ptr<CallInvoker> jsInvoker) </s> add NativeReanimatedModuleSpec::NativeReanimatedModuleSpec( std::shared_ptr<CallInvoker> jsInvoker) </s> remove methodMap_["makeMutable"] = MethodMetadata{ 1, __hostFunction_NativeReanimatedModuleSpec_makeMutable}; methodMap_["makeRemote"] = MethodMetadata{ 1, __hostFunction_NativeReanimatedModuleSpec_makeRemote}; </s> add methodMap_["makeMutable"] = MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_makeMutable}; methodMap_["makeRemote"] = MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_makeRemote}; </s> remove methodMap_["startMapper"] = MethodMetadata{ 3, __hostFunction_NativeReanimatedModuleSpec_startMapper}; methodMap_["stopMapper"] = MethodMetadata{ 1, __hostFunction_NativeReanimatedModuleSpec_stopMapper}; </s> add methodMap_["startMapper"] = MethodMetadata{5, __hostFunction_NativeReanimatedModuleSpec_startMapper}; methodMap_["stopMapper"] = MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_stopMapper}; </s> remove 2, __hostFunction_NativeReanimatedModuleSpec_registerEventHandler}; </s> add 2, __hostFunction_NativeReanimatedModuleSpec_registerEventHandler}; </s> remove 1, __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler}; methodMap_["getViewProp"] = MethodMetadata{ 3, __hostFunction_NativeReanimatedModuleSpec_getViewProp}; } </s> add 1, __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler}; </s> remove ->getViewProp(rt, std::move(args[0]), std::move(args[1]), std::move(args[2])); return jsi::Value::undefined(); </s> add ->getViewProp( rt, std::move(args[0]), std::move(args[1]), std::move(args[2])); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeReanimatedModuleSpec_enableLayoutAnimations( jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value *args, size_t count) { static_cast<NativeReanimatedModuleSpec *>(&turboModule) ->enableLayoutAnimations(rt, std::move(args[0])); return jsi::Value::undefined();
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp
keep keep keep keep replace replace replace replace replace keep replace replace replace replace keep keep keep keep
<mask> <mask> <mask> methodMap_["makeShareable"] = MethodMetadata{ <mask> 1, __hostFunction_NativeReanimatedModuleSpec_makeShareable}; <mask> methodMap_["makeMutable"] = MethodMetadata{ <mask> 1, __hostFunction_NativeReanimatedModuleSpec_makeMutable}; <mask> methodMap_["makeRemote"] = MethodMetadata{ <mask> 1, __hostFunction_NativeReanimatedModuleSpec_makeRemote}; <mask> <mask> <mask> methodMap_["startMapper"] = MethodMetadata{ <mask> 3, __hostFunction_NativeReanimatedModuleSpec_startMapper}; <mask> methodMap_["stopMapper"] = MethodMetadata{ <mask> 1, __hostFunction_NativeReanimatedModuleSpec_stopMapper}; <mask> <mask> methodMap_["registerEventHandler"] = MethodMetadata{ <mask> 2, __hostFunction_NativeReanimatedModuleSpec_registerEventHandler}; <mask> methodMap_["unregisterEventHandler"] = MethodMetadata{ </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove 2, __hostFunction_NativeReanimatedModuleSpec_registerEventHandler}; </s> add 2, __hostFunction_NativeReanimatedModuleSpec_registerEventHandler}; </s> remove 1, __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler}; methodMap_["getViewProp"] = MethodMetadata{ 3, __hostFunction_NativeReanimatedModuleSpec_getViewProp}; } </s> add 1, __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler}; </s> remove 1, __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions}; </s> add 1, __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions}; </s> add methodMap_["getViewProp"] = MethodMetadata{3, __hostFunction_NativeReanimatedModuleSpec_getViewProp}; methodMap_["enableLayoutAnimations"] = MethodMetadata{ 2, __hostFunction_NativeReanimatedModuleSpec_enableLayoutAnimations}; </s> remove NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(std::shared_ptr<CallInvoker> jsInvoker) </s> add NativeReanimatedModuleSpec::NativeReanimatedModuleSpec( std::shared_ptr<CallInvoker> jsInvoker)
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> methodMap_["stopMapper"] = MethodMetadata{ <mask> 1, __hostFunction_NativeReanimatedModuleSpec_stopMapper}; <mask> <mask> methodMap_["registerEventHandler"] = MethodMetadata{ <mask> 2, __hostFunction_NativeReanimatedModuleSpec_registerEventHandler}; <mask> methodMap_["unregisterEventHandler"] = MethodMetadata{ <mask> 1, __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler}; <mask> <mask> methodMap_["getViewProp"] = MethodMetadata{ <mask> 3, __hostFunction_NativeReanimatedModuleSpec_getViewProp}; </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove 1, __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler}; methodMap_["getViewProp"] = MethodMetadata{ 3, __hostFunction_NativeReanimatedModuleSpec_getViewProp}; } </s> add 1, __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler}; </s> remove methodMap_["startMapper"] = MethodMetadata{ 3, __hostFunction_NativeReanimatedModuleSpec_startMapper}; methodMap_["stopMapper"] = MethodMetadata{ 1, __hostFunction_NativeReanimatedModuleSpec_stopMapper}; </s> add methodMap_["startMapper"] = MethodMetadata{5, __hostFunction_NativeReanimatedModuleSpec_startMapper}; methodMap_["stopMapper"] = MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_stopMapper}; </s> add methodMap_["getViewProp"] = MethodMetadata{3, __hostFunction_NativeReanimatedModuleSpec_getViewProp}; methodMap_["enableLayoutAnimations"] = MethodMetadata{ 2, __hostFunction_NativeReanimatedModuleSpec_enableLayoutAnimations}; </s> remove methodMap_["makeMutable"] = MethodMetadata{ 1, __hostFunction_NativeReanimatedModuleSpec_makeMutable}; methodMap_["makeRemote"] = MethodMetadata{ 1, __hostFunction_NativeReanimatedModuleSpec_makeRemote}; </s> add methodMap_["makeMutable"] = MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_makeMutable}; methodMap_["makeRemote"] = MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_makeRemote}; </s> remove 1, __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions}; </s> add 1, __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions}; </s> remove NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(std::shared_ptr<CallInvoker> jsInvoker) </s> add NativeReanimatedModuleSpec::NativeReanimatedModuleSpec( std::shared_ptr<CallInvoker> jsInvoker)
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp
keep keep keep keep replace replace replace replace replace keep keep keep
<mask> <mask> methodMap_["registerEventHandler"] = MethodMetadata{ <mask> 2, __hostFunction_NativeReanimatedModuleSpec_registerEventHandler}; <mask> methodMap_["unregisterEventHandler"] = MethodMetadata{ <mask> 1, __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler}; <mask> <mask> methodMap_["getViewProp"] = MethodMetadata{ <mask> 3, __hostFunction_NativeReanimatedModuleSpec_getViewProp}; <mask> } <mask> <mask> } <mask> </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove 2, __hostFunction_NativeReanimatedModuleSpec_registerEventHandler}; </s> add 2, __hostFunction_NativeReanimatedModuleSpec_registerEventHandler}; </s> remove methodMap_["startMapper"] = MethodMetadata{ 3, __hostFunction_NativeReanimatedModuleSpec_startMapper}; methodMap_["stopMapper"] = MethodMetadata{ 1, __hostFunction_NativeReanimatedModuleSpec_stopMapper}; </s> add methodMap_["startMapper"] = MethodMetadata{5, __hostFunction_NativeReanimatedModuleSpec_startMapper}; methodMap_["stopMapper"] = MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_stopMapper}; </s> add methodMap_["getViewProp"] = MethodMetadata{3, __hostFunction_NativeReanimatedModuleSpec_getViewProp}; methodMap_["enableLayoutAnimations"] = MethodMetadata{ 2, __hostFunction_NativeReanimatedModuleSpec_enableLayoutAnimations}; </s> remove methodMap_["makeMutable"] = MethodMetadata{ 1, __hostFunction_NativeReanimatedModuleSpec_makeMutable}; methodMap_["makeRemote"] = MethodMetadata{ 1, __hostFunction_NativeReanimatedModuleSpec_makeRemote}; </s> add methodMap_["makeMutable"] = MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_makeMutable}; methodMap_["makeRemote"] = MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_makeRemote}; </s> remove 1, __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions}; </s> add 1, __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions}; </s> remove NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(std::shared_ptr<CallInvoker> jsInvoker) </s> add NativeReanimatedModuleSpec::NativeReanimatedModuleSpec( std::shared_ptr<CallInvoker> jsInvoker)
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp
keep keep add keep keep keep
<mask> methodMap_["unregisterEventHandler"] = MethodMetadata{ <mask> 1, __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler}; <mask> <mask> } <mask> <mask> } // namespace reanimated </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove 1, __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler}; methodMap_["getViewProp"] = MethodMetadata{ 3, __hostFunction_NativeReanimatedModuleSpec_getViewProp}; } </s> add 1, __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler}; </s> remove 2, __hostFunction_NativeReanimatedModuleSpec_registerEventHandler}; </s> add 2, __hostFunction_NativeReanimatedModuleSpec_registerEventHandler}; </s> remove methodMap_["startMapper"] = MethodMetadata{ 3, __hostFunction_NativeReanimatedModuleSpec_startMapper}; methodMap_["stopMapper"] = MethodMetadata{ 1, __hostFunction_NativeReanimatedModuleSpec_stopMapper}; </s> add methodMap_["startMapper"] = MethodMetadata{5, __hostFunction_NativeReanimatedModuleSpec_startMapper}; methodMap_["stopMapper"] = MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_stopMapper}; </s> remove methodMap_["makeMutable"] = MethodMetadata{ 1, __hostFunction_NativeReanimatedModuleSpec_makeMutable}; methodMap_["makeRemote"] = MethodMetadata{ 1, __hostFunction_NativeReanimatedModuleSpec_makeRemote}; </s> add methodMap_["makeMutable"] = MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_makeMutable}; methodMap_["makeRemote"] = MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_makeRemote}; </s> remove 1, __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions}; </s> add 1, __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions}; </s> remove NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(std::shared_ptr<CallInvoker> jsInvoker) </s> add NativeReanimatedModuleSpec::NativeReanimatedModuleSpec( std::shared_ptr<CallInvoker> jsInvoker)
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> #include "WorkletEventHandler.h" <mask> <mask> namespace reanimated { <mask> <mask> void EventHandlerRegistry::registerEventHandler(std::shared_ptr<WorkletEventHandler> eventHandler) { <mask> const std::lock_guard<std::mutex> lock(instanceMutex); <mask> eventMappings[eventHandler->eventName][eventHandler->id] = eventHandler; <mask> eventHandlers[eventHandler->id] = eventHandler; <mask> } <mask> </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove void EventHandlerRegistry::processEvent(jsi::Runtime &rt, std::string eventName, std::string eventPayload) { </s> add void EventHandlerRegistry::processEvent( jsi::Runtime &rt, std::string eventName, std::string eventPayload) { </s> remove return (it != eventMappings.end()) and (!(it->second).empty()); </s> add return (it != eventMappings.end()) && (!(it->second).empty()); </s> remove void WorkletEventHandler::process(jsi::Runtime &rt, jsi::Value &eventValue) { </s> add void WorkletEventHandler::process( jsi::Runtime &rt, const jsi::Value &eventValue) { </s> remove void WorkletEventHandler::process(jsi::Runtime &rt, jsi::Value &eventValue) { </s> add void WorkletEventHandler::process( jsi::Runtime &rt, const jsi::Value &eventValue) { </s> add #include "RuntimeManager.h" #include "ShareableValue.h" #include "SharedParent.h" </s> remove namespace reanimated { </s> add namespace reanimated {
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/EventHandlerRegistry.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> eventHandlers.erase(handlerIt); <mask> } <mask> } <mask> <mask> void EventHandlerRegistry::processEvent(jsi::Runtime &rt, std::string eventName, std::string eventPayload) { <mask> std::vector<std::shared_ptr<WorkletEventHandler>> handlersForEvent; <mask> { <mask> const std::lock_guard<std::mutex> lock(instanceMutex); <mask> auto handlersIt = eventMappings.find(eventName); <mask> if (handlersIt != eventMappings.end()) { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove return (it != eventMappings.end()) and (!(it->second).empty()); </s> add return (it != eventMappings.end()) && (!(it->second).empty()); </s> remove void NativeReanimatedModule::onEvent(std::string eventName, std::string eventAsString) { try { eventHandlerRegistry->processEvent(*runtime, eventName, eventAsString); mapperRegistry->execute(*runtime); if (mapperRegistry->needRunOnRender()) { maybeRequestRender(); } </s> add jsi::Value NativeReanimatedModule::enableLayoutAnimations( jsi::Runtime &rt, const jsi::Value &config) { FeaturesConfig::setLayoutAnimationEnabled(config.getBool()); return jsi::Value::undefined(); } void NativeReanimatedModule::onEvent( std::string eventName, std::string eventAsString) { try { eventHandlerRegistry->processEvent(*runtime, eventName, eventAsString); mapperRegistry->execute(*runtime); if (mapperRegistry->needRunOnRender()) { maybeRequestRender(); </s> remove } </s> add } // namespace reanimated </s> remove void EventHandlerRegistry::registerEventHandler(std::shared_ptr<WorkletEventHandler> eventHandler) { </s> add void EventHandlerRegistry::registerEventHandler( std::shared_ptr<WorkletEventHandler> eventHandler) { </s> add if (mAnimationManager != null) { mAnimationManager.onCatalystInstanceDestroy(); } </s> remove } catch(std::exception &e) { </s> add } catch (std::exception &e) {
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/EventHandlerRegistry.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> // So we need to extract only JSON part <mask> std::string delimimter = "NativeMap:"; <mask> auto positionToSplit = eventPayload.find(delimimter) + delimimter.size(); <mask> auto lastBracketCharactedPosition = eventPayload.size() - positionToSplit - 1; <mask> auto eventJSON = eventPayload.substr(positionToSplit, lastBracketCharactedPosition); <mask> <mask> if (eventJSON.compare(std::string("null")) == 0) { <mask> return; <mask> } <mask> </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove auto eventObject = jsi::Value::createFromJsonUtf8(rt, (uint8_t*)(&eventJSON[0]), eventJSON.size()); </s> add auto eventObject = jsi::Value::createFromJsonUtf8( rt, reinterpret_cast<uint8_t *>(&eventJSON[0]), eventJSON.size()); </s> remove view = findScrollView((ReactSwipeRefreshLayout)view); </s> add view = findScrollView((ReactSwipeRefreshLayout) view); </s> remove Log.w("REANIMATED", "NativeMethodsHelper: Unhandled scroll view type - allowed only {ReactScrollView, ReactHorizontalScrollView}"); </s> add Log.w( "REANIMATED", "NativeMethodsHelper: Unhandled scroll view type - allowed only {ReactScrollView, ReactHorizontalScrollView}"); </s> remove auto ref = getWeakRef(rt); remoteValue = ref; </s> add remoteValue = getWeakRef(rt); </s> remove auto ref = getWeakRef(rt); remoteValue = ref; </s> add remoteValue = getWeakRef(rt); </s> remove // TODO: maybe we can cache toJSValue results on a per-runtime basis, need to avoid ref loops if (RuntimeDecorator::isWorkletRuntime(rt)) { </s> add // TODO: maybe we can cache toJSValue results on a per-runtime basis, need to // avoid ref loops if (&rt == runtimeManager->runtime.get()) { // Getting value on the same runtime where it was created, prepare // remoteValue
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/EventHandlerRegistry.cpp
keep keep keep replace keep keep keep keep keep keep keep keep replace keep
<mask> return; <mask> } <mask> <mask> auto eventObject = jsi::Value::createFromJsonUtf8(rt, (uint8_t*)(&eventJSON[0]), eventJSON.size()); <mask> <mask> eventObject.asObject(rt).setProperty(rt, "eventName", jsi::String::createFromUtf8(rt, eventName)); <mask> for (auto handler : handlersForEvent) { <mask> handler->process(rt, eventObject); <mask> } <mask> <mask> auto eventObject = jsi::Value::createFromJsonUtf8(rt, (uint8_t*)(&eventJSON[0]), eventJSON.size()); <mask> <mask> eventObject.asObject(rt).setProperty(rt, "eventName", jsi::String::createFromUtf8(rt, eventName)); <mask> for (auto handler : handlersForEvent) { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove for (auto prop : map) { object.setProperty(rt, jsi::String::createFromUtf8(rt, prop.first), prop.second->getValue(rt)); </s> add for (auto propName : namesOrder) { auto value = map[propName]; object.setProperty( rt, jsi::String::createFromUtf8(rt, propName), value->getValue(rt)); </s> remove for (auto & entry : deg) { </s> add for (auto &entry : deg) { </s> remove if (deg.count(sharedValue) == 0) { </s> add if (deg.count(sharedValueID) == 0) { </s> remove for (auto & mapper : sortedMappers) { </s> add for (auto &mapper : sortedMappers) { </s> remove for (auto & entry : mappers) { </s> add for (auto &entry : mappers) {
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/EventHandlerRegistry.cpp
keep keep keep keep replace keep keep replace
<mask> <mask> bool EventHandlerRegistry::isAnyHandlerWaitingForEvent(std::string eventName) { <mask> const std::lock_guard<std::mutex> lock(instanceMutex); <mask> auto it = eventMappings.find(eventName); <mask> return (it != eventMappings.end()) and (!(it->second).empty()); <mask> } <mask> <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove void EventHandlerRegistry::processEvent(jsi::Runtime &rt, std::string eventName, std::string eventPayload) { </s> add void EventHandlerRegistry::processEvent( jsi::Runtime &rt, std::string eventName, std::string eventPayload) { </s> remove bool NativeReanimatedModule::isAnyHandlerWaitingForEvent(std::string eventName) { </s> add bool NativeReanimatedModule::isAnyHandlerWaitingForEvent( std::string eventName) { </s> remove void EventHandlerRegistry::registerEventHandler(std::shared_ptr<WorkletEventHandler> eventHandler) { </s> add void EventHandlerRegistry::registerEventHandler( std::shared_ptr<WorkletEventHandler> eventHandler) { </s> remove bool operator<(const NodeID& other) const { </s> add bool operator<(const NodeID &other) const { </s> remove catch(std::exception &e) { std::string str = e.what(); this->errorHandler->setError(str); this->errorHandler->raise(); } catch(...) { std::string str = "OnEvent error"; this->errorHandler->setError(str); this->errorHandler->raise(); </s> add } catch (std::exception &e) { std::string str = e.what(); this->errorHandler->setError(str); this->errorHandler->raise(); } catch (...) { std::string str = "OnEvent error"; this->errorHandler->setError(str); this->errorHandler->raise();
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/EventHandlerRegistry.cpp
keep replace replace keep keep keep keep keep
<mask> #include "MapperRegistry.h" <mask> #include "Mapper.h" <mask> #include <map> <mask> #include <array> <mask> #include <set> <mask> <mask> namespace reanimated { <mask> </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> add #include <map> </s> add #include "Mapper.h" </s> add #include "Mapper.h" #include "MapperRegistry.h" #include "ReanimatedHiddenHeaders.h" #include "RuntimeDecorator.h" #include "ShareableValue.h" #include "WorkletEventHandler.h" </s> remove #include <jsi/jsi.h> #include <mutex> </s> add #include <unordered_map> #include <vector> </s> remove #include <unordered_map> </s> add </s> add #include <memory> #include <mutex>
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/MapperRegistry.cpp
keep add keep keep keep keep keep keep
<mask> #include "MapperRegistry.h" <mask> #include <array> <mask> #include <set> <mask> #include "Mapper.h" <mask> <mask> namespace reanimated { <mask> <mask> void MapperRegistry::startMapper(std::shared_ptr<Mapper> mapper) { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> add #include "Mapper.h" </s> remove #include "Mapper.h" #include <map> </s> add </s> add #include "Mapper.h" #include "MapperRegistry.h" #include "ReanimatedHiddenHeaders.h" #include "RuntimeDecorator.h" #include "ShareableValue.h" #include "WorkletEventHandler.h" </s> remove #include "SharedParent.h" </s> add </s> remove #include <jsi/jsi.h> #include <mutex> </s> add #include <unordered_map> #include <vector> </s> add #include "SharedParent.h"
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/MapperRegistry.cpp
keep keep add keep keep keep keep
<mask> #include <array> <mask> #include <map> <mask> #include <set> <mask> <mask> namespace reanimated { <mask> <mask> void MapperRegistry::startMapper(std::shared_ptr<Mapper> mapper) { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> add #include <map> </s> remove #include "Mapper.h" #include <map> </s> add </s> remove #include <jsi/jsi.h> #include <mutex> </s> add #include <unordered_map> #include <vector> </s> remove #include <unordered_map> </s> add </s> add #include <memory> #include <mutex> </s> remove #include <vector> </s> add #include <jsi/jsi.h>
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/MapperRegistry.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> if (updatedSinceLastExecute) { <mask> updateOrder(); <mask> updatedSinceLastExecute = false; <mask> } <mask> for (auto & mapper : sortedMappers) { <mask> if (mapper->dirty) { <mask> mapper->execute(rt); <mask> } <mask> } <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove for (auto & entry : deg) { </s> add for (auto &entry : deg) { </s> remove for (auto & id : toUpdate) update(id); </s> add for (auto &id : toUpdate) update(id); </s> remove toUpdate.push_back(id); </s> add toUpdate.push_back(NodeID(id)); </s> remove if (deg.count(sharedValue) == 0) { </s> add if (deg.count(sharedValueID) == 0) { </s> remove for (auto & entry : mappers) { </s> add for (auto &entry : mappers) { </s> remove auto & mapper = entry.second; </s> add auto &mapper = entry.second;
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/MapperRegistry.cpp
keep keep replace keep replace keep
<mask> std::shared_ptr<MutableValue> mutableValue; <mask> <mask> NodeID(std::shared_ptr<Mapper> mapper) { <mask> if (mapper == nullptr) { <mask> throw std::runtime_error("Graph couldn't be sorted (Mapper cannot be nullptr)"); <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove throw std::runtime_error("Graph couldn't be sorted (Mutable cannot be nullptr)"); </s> add throw std::runtime_error( "Graph couldn't be sorted (Mutable cannot be nullptr)"); </s> remove NodeID(std::shared_ptr<MutableValue> mutableValue) { </s> add explicit NodeID(std::shared_ptr<MutableValue> mutableValue) { </s> remove throw new IllegalArgumentException("Requested node with id " + id + " of type " + type + " cannot be found"); </s> add throw new IllegalArgumentException( "Requested node with id " + id + " of type " + type + " cannot be found"); </s> remove if (propName == "value") { // you call `this.value` inside of value setter, we should throw } else if (propName == "_value") { </s> add if (propName == "_value") { </s> remove if (propName == "value") { // you call `this.value` inside of value setter, we should throw } else if (propName == "_value") { </s> add if (propName == "_value") {
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/MapperRegistry.cpp
keep replace keep keep keep keep keep keep keep keep replace keep keep keep keep
<mask> <mask> NodeID(std::shared_ptr<MutableValue> mutableValue) { <mask> if (mutableValue == nullptr) { <mask> throw std::runtime_error("Graph couldn't be sorted (Mutable cannot be nullptr)"); <mask> } <mask> this->mutableValue = mutableValue; <mask> } <mask> <mask> NodeID(std::shared_ptr<MutableValue> mutableValue) { <mask> if (mutableValue == nullptr) { <mask> throw std::runtime_error("Graph couldn't be sorted (Mutable cannot be nullptr)"); <mask> } <mask> this->mutableValue = mutableValue; <mask> } <mask> </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove throw std::runtime_error("Graph couldn't be sorted (Mapper cannot be nullptr)"); </s> add throw std::runtime_error( "Graph couldn't be sorted (Mapper cannot be nullptr)"); </s> remove NodeID(std::shared_ptr<Mapper> mapper) { </s> add explicit NodeID(std::shared_ptr<Mapper> mapper) { </s> remove throw new IllegalArgumentException("Requested node with id " + id + " of type " + type + " cannot be found"); </s> add throw new IllegalArgumentException( "Requested node with id " + id + " of type " + type + " cannot be found"); </s> remove if (propName == "value") { // you call `this.value` inside of value setter, we should throw } else if (propName == "_value") { </s> add if (propName == "_value") { </s> remove if (propName == "value") { // you call `this.value` inside of value setter, we should throw } else if (propName == "_value") { </s> add if (propName == "_value") {
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/MapperRegistry.cpp
keep keep keep keep replace replace keep keep keep keep keep
<mask> bool isMutable() const { <mask> return mutableValue != nullptr; <mask> } <mask> <mask> bool operator<(const NodeID& other) const <mask> { <mask> if (isMutable() != other.isMutable()) <mask> return isMutable() < other.isMutable(); <mask> <mask> if (isMutable()) { <mask> return mutableValue < other.mutableValue; </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove return (it != eventMappings.end()) and (!(it->second).empty()); </s> add return (it != eventMappings.end()) && (!(it->second).empty()); </s> remove throw std::runtime_error("Graph couldn't be sorted (Mutable cannot be nullptr)"); </s> add throw std::runtime_error( "Graph couldn't be sorted (Mutable cannot be nullptr)"); </s> add if (mAnimationManager != null) { mAnimationManager.onCatalystInstanceDestroy(); } </s> add public AnimationsManager getAnimationsManager() { return mAnimationManager; } </s> remove for(int i = 0; i < view.getChildCount(); i++) { if(view.getChildAt(i) instanceof ReactScrollView) { return (ReactScrollView)view.getChildAt(i); </s> add for (int i = 0; i < view.getChildCount(); i++) { if (view.getChildAt(i) instanceof ReactScrollView) { return (ReactScrollView) view.getChildAt(i); </s> add @DoNotStrip private void setGestureState(int handlerTag, int newState) { if (gestureHandlerStateManager != null) { gestureHandlerStateManager.setGestureHandlerState(handlerTag, newState); } }
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/MapperRegistry.cpp
keep keep replace keep keep keep replace keep keep
<mask> std::map<NodeID, int> deg; <mask> <mask> std::map<std::shared_ptr<MutableValue>, std::vector<std::shared_ptr<Mapper>>> mappersThatUseSharedValue; <mask> <mask> std::set<std::pair<int, NodeID>> nodes; <mask> <mask> std::function<void(NodeID)> update = [&] (NodeID id) { <mask> auto entry = std::make_pair(deg[id], id); <mask> if (nodes.find(entry) == nodes.end()) return; </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove if (nodes.find(entry) == nodes.end()) return; </s> add if (nodes.find(entry) == nodes.end()) return; </s> remove while (nodes.size() > 0 and nodes.begin()->first == 0) { </s> add while (nodes.size() > 0 && nodes.begin()->first == 0) { </s> remove auto eventObject = jsi::Value::createFromJsonUtf8(rt, (uint8_t*)(&eventJSON[0]), eventJSON.size()); </s> add auto eventObject = jsi::Value::createFromJsonUtf8( rt, reinterpret_cast<uint8_t *>(&eventJSON[0]), eventJSON.size()); </s> remove auto eventJSON = eventPayload.substr(positionToSplit, lastBracketCharactedPosition); </s> add auto eventJSON = eventPayload.substr(positionToSplit, lastBracketCharactedPosition); </s> remove auto & mapper = entry.second; </s> add auto &mapper = entry.second;
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/MapperRegistry.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> std::set<std::pair<int, NodeID>> nodes; <mask> <mask> std::function<void(NodeID)> update = [&] (NodeID id) { <mask> auto entry = std::make_pair(deg[id], id); <mask> if (nodes.find(entry) == nodes.end()) return; <mask> nodes.erase(entry); <mask> entry.first--; <mask> deg[id]--; <mask> nodes.insert(entry); <mask> }; </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove std::function<void(NodeID)> update = [&] (NodeID id) { </s> add std::function<void(NodeID)> update = [&](NodeID id) { </s> remove std::map<std::shared_ptr<MutableValue>, std::vector<std::shared_ptr<Mapper>>> mappersThatUseSharedValue; </s> add std::map<std::shared_ptr<MutableValue>, std::vector<std::shared_ptr<Mapper>>> mappersThatUseSharedValue; </s> remove for (auto & entry : mappers) { </s> add for (auto &entry : mappers) { </s> remove while (nodes.size() > 0 and nodes.begin()->first == 0) { </s> add while (nodes.size() > 0 && nodes.begin()->first == 0) { </s> remove auto & mapper = entry.second; </s> add auto &mapper = entry.second; </s> remove auto eventObject = jsi::Value::createFromJsonUtf8(rt, (uint8_t*)(&eventJSON[0]), eventJSON.size()); </s> add auto eventObject = jsi::Value::createFromJsonUtf8( rt, reinterpret_cast<uint8_t *>(&eventJSON[0]), eventJSON.size());
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/MapperRegistry.cpp
keep keep replace keep replace keep keep
<mask> }; <mask> <mask> for (auto & entry : mappers) { <mask> auto id = NodeID(entry.second); <mask> auto & mapper = entry.second; <mask> deg[id] = mapper->inputs.size(); <mask> nodes.insert(std::make_pair(deg[id], id)); </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove for (auto & entry : deg) { </s> add for (auto &entry : deg) { </s> remove for (auto & mapper : sortedMappers) { </s> add for (auto &mapper : sortedMappers) { </s> remove while (nodes.size() > 0 and nodes.begin()->first == 0) { </s> add while (nodes.size() > 0 && nodes.begin()->first == 0) { </s> remove for (auto & id : toUpdate) update(id); </s> add for (auto &id : toUpdate) update(id); </s> remove auto notifyListeners = [thiz] () { </s> add auto notifyListeners = [thiz]() {
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/MapperRegistry.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> for (auto sharedValue : mapper->inputs) { <mask> auto sharedValueID = NodeID(sharedValue); <mask> mappersThatUseSharedValue[sharedValue].push_back(mapper); <mask> if (deg.count(sharedValue) == 0) { <mask> deg[sharedValueID] = 0; <mask> } <mask> } <mask> <mask> for (auto sharedValue : mapper->outputs) { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove auto & mapper = entry.second; </s> add auto &mapper = entry.second; </s> remove toUpdate.push_back(id); </s> add toUpdate.push_back(NodeID(id)); </s> remove for (auto & entry : deg) { </s> add for (auto &entry : deg) { </s> remove for (auto & mapper : sortedMappers) { </s> add for (auto &mapper : sortedMappers) { </s> remove for (auto callback : callbacks) { </s> add for (auto &callback : callbacks) { </s> remove auto eventObject = jsi::Value::createFromJsonUtf8(rt, (uint8_t*)(&eventJSON[0]), eventJSON.size()); </s> add auto eventObject = jsi::Value::createFromJsonUtf8( rt, reinterpret_cast<uint8_t *>(&eventJSON[0]), eventJSON.size());
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/MapperRegistry.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> deg[NodeID(sharedValue)]++; <mask> } <mask> } <mask> <mask> for (auto & entry : deg) { <mask> auto id = entry.first; <mask> if (id.isMutable()) { <mask> nodes.insert(std::make_pair(entry.second, id)); <mask> } <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove for (auto & entry : mappers) { </s> add for (auto &entry : mappers) { </s> remove toUpdate.push_back(id); </s> add toUpdate.push_back(NodeID(id)); </s> remove auto & mapper = entry.second; </s> add auto &mapper = entry.second; </s> remove while (nodes.size() > 0 and nodes.begin()->first == 0) { </s> add while (nodes.size() > 0 && nodes.begin()->first == 0) { </s> remove for (auto & mapper : sortedMappers) { </s> add for (auto &mapper : sortedMappers) { </s> remove for (auto & id : toUpdate) update(id); </s> add for (auto &id : toUpdate) update(id);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/MapperRegistry.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> nodes.insert(std::make_pair(entry.second, id)); <mask> } <mask> } <mask> <mask> while (nodes.size() > 0 and nodes.begin()->first == 0) { <mask> auto entry = *nodes.begin(); <mask> nodes.erase(entry); <mask> <mask> auto id = entry.second; <mask> std::vector<NodeID> toUpdate; </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove for (auto & entry : deg) { </s> add for (auto &entry : deg) { </s> remove auto & mapper = entry.second; </s> add auto &mapper = entry.second; </s> remove for (auto & entry : mappers) { </s> add for (auto &entry : mappers) { </s> remove for (auto & id : toUpdate) update(id); </s> add for (auto &id : toUpdate) update(id); </s> remove strongScheduler->scheduleOnUI([id]() { const std::lock_guard<std::recursive_mutex> lock(storeMutex); if (StoreUser::store.count(id) > 0) { StoreUser::store.erase(id); </s> add std::shared_ptr<StaticStoreUser> sud = storeUserData; #ifdef ONANDROID jni::ThreadScope::WithClassLoader([&] { strongScheduler->scheduleOnUI([id, sud]() { const std::lock_guard<std::recursive_mutex> lock(sud->storeMutex); if (sud->store.count(id) > 0) { sud->store.erase(id); } }); }); #else strongScheduler->scheduleOnUI([id, sud]() { const std::lock_guard<std::recursive_mutex> lock(sud->storeMutex); if (sud->store.count(id) > 0) { sud->store.erase(id); </s> remove toUpdate.push_back(id); </s> add toUpdate.push_back(NodeID(id));
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/MapperRegistry.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> std::vector<NodeID> toUpdate; <mask> <mask> if (id.isMutable()) { <mask> for (auto id : mappersThatUseSharedValue[id.mutableValue]) { <mask> toUpdate.push_back(id); <mask> } <mask> } else { <mask> for (auto sharedValue : id.mapper->outputs) { <mask> toUpdate.push_back(NodeID(sharedValue)); <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove for (auto & entry : deg) { </s> add for (auto &entry : deg) { </s> remove if (deg.count(sharedValue) == 0) { </s> add if (deg.count(sharedValueID) == 0) { </s> remove for (auto & mapper : sortedMappers) { </s> add for (auto &mapper : sortedMappers) { </s> remove for (auto & id : toUpdate) update(id); </s> add for (auto &id : toUpdate) update(id); </s> remove for (auto callback : callbacks) { </s> add for (auto &callback : callbacks) { </s> remove auto & mapper = entry.second; </s> add auto &mapper = entry.second;
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/MapperRegistry.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> sortedMappers.push_back(id.mapper); <mask> } <mask> <mask> for (auto & id : toUpdate) update(id); <mask> } <mask> <mask> if (nodes.size() > 0) { <mask> throw std::runtime_error("Cycle in mappers graph!"); <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove } </s> add } // namespace reanimated </s> remove while (nodes.size() > 0 and nodes.begin()->first == 0) { </s> add while (nodes.size() > 0 && nodes.begin()->first == 0) { </s> remove for (auto & entry : deg) { </s> add for (auto &entry : deg) { </s> remove for (auto & mapper : sortedMappers) { </s> add for (auto &mapper : sortedMappers) { </s> remove toUpdate.push_back(id); </s> add toUpdate.push_back(NodeID(id)); </s> remove if (deg.count(sharedValue) == 0) { </s> add if (deg.count(sharedValueID) == 0) {
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/MapperRegistry.cpp
keep keep keep keep replace
<mask> throw std::runtime_error("Cycle in mappers graph!"); <mask> } <mask> } <mask> <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove for (auto & id : toUpdate) update(id); </s> add for (auto &id : toUpdate) update(id); </s> remove valueContainer = std::make_unique<StringValueWrapper>(value.asSymbol(rt).toString(rt)); </s> add valueContainer = std::make_unique<StringValueWrapper>(value.asSymbol(rt).toString(rt)); </s> remove valueContainer = std::make_unique<StringValueWrapper>(value.asSymbol(rt).toString(rt)); </s> add valueContainer = std::make_unique<StringValueWrapper>(value.asSymbol(rt).toString(rt)); </s> remove mOperations.add(new UIThreadOperation() { @Override public void execute(NodesManager nodesManager) { nodesManager.setValue(nodeID, newValue); } }); </s> add mOperations.add( new UIThreadOperation() { @Override public void execute(NodesManager nodesManager) { nodesManager.setValue(nodeID, newValue); } }); } @ReactMethod public void addListener(String eventName) { // Keep: Required for RN built in Event Emitter Calls. } @ReactMethod public void removeListeners(Integer count) { // Keep: Required for RN built in Event Emitter Calls. </s> remove throw std::runtime_error("Graph couldn't be sorted (Mutable cannot be nullptr)"); </s> add throw std::runtime_error( "Graph couldn't be sorted (Mutable cannot be nullptr)"); </s> remove propMap.putMap(key, (WritableMap)value); </s> add propMap.putMap(key, (WritableMap) value);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/MapperRegistry.cpp
keep replace keep keep keep keep keep
<mask> #include "WorkletsCache.h" <mask> #include "ShareableValue.h" <mask> #include "FrozenObject.h" <mask> <mask> using namespace facebook; <mask> <mask> namespace reanimated </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> add #include "ShareableValue.h" </s> remove #include <jsi/jsi.h> #include <memory> </s> add </s> add #include "ShareableValue.h" </s> add #include "Mapper.h" #include "MapperRegistry.h" #include "ReanimatedHiddenHeaders.h" #include "RuntimeDecorator.h" #include "ShareableValue.h" #include "WorkletEventHandler.h" </s> add #include "SharedParent.h" </s> remove #include "WorkletsCache.h" #include "SharedParent.h" #include "RuntimeManager.h" </s> add
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/WorkletsCache.cpp
keep add keep keep keep keep keep
<mask> #include "WorkletsCache.h" <mask> #include "FrozenObject.h" <mask> <mask> using namespace facebook; <mask> <mask> namespace reanimated { <mask> </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove #include "ShareableValue.h" </s> add </s> add #include "SharedParent.h" </s> remove #include "WorkletsCache.h" #include "SharedParent.h" #include "RuntimeManager.h" </s> add </s> add #include "ShareableValue.h" </s> remove #include <jsi/jsi.h> #include <memory> </s> add </s> add #include "Mapper.h" #include "MapperRegistry.h" #include "ReanimatedHiddenHeaders.h" #include "RuntimeDecorator.h" #include "ShareableValue.h" #include "WorkletEventHandler.h"
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/WorkletsCache.cpp
keep keep keep keep replace replace keep keep keep keep keep
<mask> #include "FrozenObject.h" <mask> <mask> using namespace facebook; <mask> <mask> namespace reanimated <mask> { <mask> <mask> jsi::Value eval(jsi::Runtime &rt, const char *code) { <mask> return rt.global().getPropertyAsFunction(rt, "eval").call(rt, code); <mask> } <mask> </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove jsi::Function function(jsi::Runtime &rt, const std::string& code) { </s> add jsi::Function function(jsi::Runtime &rt, const std::string &code) { </s> add #include "ShareableValue.h" </s> add #include "SharedParent.h" </s> add #include "Mapper.h" #include "MapperRegistry.h" #include "ReanimatedHiddenHeaders.h" #include "RuntimeDecorator.h" #include "ShareableValue.h" #include "WorkletEventHandler.h" </s> remove #include "FrozenObject.h" </s> add </s> remove #include "FrozenObject.h" </s> add
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/WorkletsCache.cpp
keep keep replace keep keep keep replace replace
<mask> } <mask> <mask> jsi::Function function(jsi::Runtime &rt, const std::string& code) { <mask> return eval(rt, ("(" + code + ")").c_str()).getObject(rt).getFunction(rt); <mask> } <mask> <mask> std::shared_ptr<jsi::Function> WorkletsCache::getFunction(jsi::Runtime &rt, std::shared_ptr<FrozenObject> frozenObj) { <mask> long long workletHash = ValueWrapper::asNumber(frozenObj->map["__workletHash"]->valueContainer); </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove jsi::Function fun = function( rt, ValueWrapper::asString(frozenObj->map["asString"]->valueContainer) ); std::shared_ptr<jsi::Function> funPtr = std::make_shared<jsi::Function>(std::move(fun)); worklets[workletHash] = funPtr; </s> add auto codeBuffer = std::make_shared<const jsi::StringBuffer>( "(" + ValueWrapper::asString(frozenObj->map["asString"]->valueContainer) + ")"); auto func = rt.evaluateJavaScript( codeBuffer, ValueWrapper::asString( frozenObj->map["__location"]->valueContainer)) .asObject(rt) .asFunction(rt); worklets[workletHash] = std::make_shared<jsi::Function>(std::move(func)); </s> remove MutableValue::MutableValue(jsi::Runtime &rt, const jsi::Value &initial, RuntimeManager *runtimeManager, std::shared_ptr<Scheduler> s): StoreUser(s), runtimeManager(runtimeManager), value(ShareableValue::adapt(rt, initial, runtimeManager)) { } unsigned long int MutableValue::addListener(unsigned long id, std::function<void ()> listener) { </s> add MutableValue::MutableValue( jsi::Runtime &rt, const jsi::Value &initial, RuntimeManager *runtimeManager, std::shared_ptr<Scheduler> s) : StoreUser(s, *runtimeManager), runtimeManager(runtimeManager), value(ShareableValue::adapt(rt, initial, runtimeManager)) {} unsigned long int MutableValue::addListener( unsigned long id, std::function<void()> listener) { </s> remove MutableValue::MutableValue(jsi::Runtime &rt, const jsi::Value &initial, RuntimeManager *runtimeManager, std::shared_ptr<Scheduler> s): StoreUser(s), runtimeManager(runtimeManager), value(ShareableValue::adapt(rt, initial, runtimeManager)) { } unsigned long int MutableValue::addListener(unsigned long id, std::function<void ()> listener) { </s> add MutableValue::MutableValue( jsi::Runtime &rt, const jsi::Value &initial, RuntimeManager *runtimeManager, std::shared_ptr<Scheduler> s) : StoreUser(s, *runtimeManager), runtimeManager(runtimeManager), value(ShareableValue::adapt(rt, initial, runtimeManager)) {} unsigned long int MutableValue::addListener( unsigned long id, std::function<void()> listener) { </s> remove void NativeReanimatedModule::unregisterEventHandler(jsi::Runtime &rt, const jsi::Value &registrationId) { </s> add void NativeReanimatedModule::unregisterEventHandler( jsi::Runtime &rt, const jsi::Value &registrationId) { </s> remove void NativeReanimatedModule::stopMapper(jsi::Runtime &rt, const jsi::Value &mapperId) { </s> add void NativeReanimatedModule::stopMapper( jsi::Runtime &rt, const jsi::Value &mapperId) {
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/WorkletsCache.cpp
keep keep keep keep replace replace replace replace replace replace keep keep keep keep replace
<mask> <mask> std::shared_ptr<jsi::Function> WorkletsCache::getFunction(jsi::Runtime &rt, std::shared_ptr<FrozenObject> frozenObj) { <mask> long long workletHash = ValueWrapper::asNumber(frozenObj->map["__workletHash"]->valueContainer); <mask> if (worklets.count(workletHash) == 0) { <mask> jsi::Function fun = function( <mask> rt, <mask> ValueWrapper::asString(frozenObj->map["asString"]->valueContainer) <mask> ); <mask> std::shared_ptr<jsi::Function> funPtr = std::make_shared<jsi::Function>(std::move(fun)); <mask> worklets[workletHash] = funPtr; <mask> } <mask> return worklets[workletHash]; <mask> } <mask> <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475)
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/Registries/WorkletsCache.cpp
keep replace replace keep keep keep keep keep
<mask> #include "FrozenObject.h" <mask> #include "SharedParent.h" <mask> #include "ShareableValue.h" <mask> #include "RuntimeManager.h" <mask> <mask> namespace reanimated { <mask> <mask> FrozenObject::FrozenObject(jsi::Runtime &rt, const jsi::Object &object, RuntimeManager *runtimeManager) { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> add #include "ShareableValue.h" #include "SharedParent.h" </s> remove FrozenObject::FrozenObject(jsi::Runtime &rt, const jsi::Object &object, RuntimeManager *runtimeManager) { </s> add FrozenObject::FrozenObject( jsi::Runtime &rt, const jsi::Object &object, RuntimeManager *runtimeManager) { </s> remove #include "SharedParent.h" #include "ShareableValue.h" #include "RuntimeManager.h" </s> add </s> add #include "RuntimeManager.h" #include "ShareableValue.h" #include "SharedParent.h" </s> remove #include "ShareableValue.h" #include "SharedParent.h" #include "RuntimeManager.h" </s> add #include <cxxabi.h> #include "FrozenObject.h" </s> remove #include "ShareableValue.h" #include "SharedParent.h" #include "RuntimeManager.h" </s> add #include <cxxabi.h> #include "FrozenObject.h"
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/FrozenObject.cpp
keep add keep keep keep keep keep keep
<mask> #include "FrozenObject.h" <mask> #include "RuntimeManager.h" <mask> <mask> namespace reanimated { <mask> <mask> FrozenObject::FrozenObject( <mask> jsi::Runtime &rt, <mask> const jsi::Object &object, </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove #include "SharedParent.h" #include "ShareableValue.h" </s> add </s> remove FrozenObject::FrozenObject(jsi::Runtime &rt, const jsi::Object &object, RuntimeManager *runtimeManager) { </s> add FrozenObject::FrozenObject( jsi::Runtime &rt, const jsi::Object &object, RuntimeManager *runtimeManager) { </s> remove #include "FrozenObject.h" </s> add </s> remove #include "FrozenObject.h" </s> add </s> remove #include "SharedParent.h" #include "ShareableValue.h" #include "RuntimeManager.h" </s> add </s> add #include "RuntimeManager.h" #include "ShareableValue.h" #include "SharedParent.h"
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/FrozenObject.cpp
keep keep replace keep replace keep keep keep keep
<mask> namespace reanimated { <mask> <mask> FrozenObject::FrozenObject(jsi::Runtime &rt, const jsi::Object &object, RuntimeManager *runtimeManager) { <mask> auto propertyNames = object.getPropertyNames(rt); <mask> for (size_t i = 0, count = propertyNames.size(rt); i < count; i++) { <mask> auto propertyName = propertyNames.getValueAtIndex(rt, i).asString(rt); <mask> std::string nameStr = propertyName.utf8(rt); <mask> map[nameStr] = ShareableValue::adapt(rt, object.getProperty(rt, propertyName), runtimeManager); <mask> this->containsHostFunction |= map[nameStr]->containsHostFunction; </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove map[nameStr] = ShareableValue::adapt(rt, object.getProperty(rt, propertyName), runtimeManager); </s> add map[nameStr] = ShareableValue::adapt( rt, object.getProperty(rt, propertyName), runtimeManager); </s> add namesOrder.push_back(propertyName.utf8(rt)); </s> remove res.push_back(jsi::PropNameID::forString(rt, propertyNames.getValueAtIndex(rt, i).asString(rt))); </s> add res.push_back(jsi::PropNameID::forString( rt, propertyNames.getValueAtIndex(rt, i).asString(rt))); </s> remove res.push_back(jsi::PropNameID::forString(rt, propertyNames.getValueAtIndex(rt, i).asString(rt))); </s> add res.push_back(jsi::PropNameID::forString( rt, propertyNames.getValueAtIndex(rt, i).asString(rt))); </s> remove for (size_t i = 0, size = array.size(rt); i < size; i++) { auto shareable = ShareableValue::adapt(rt, array.getValueAtIndex(rt, i), module); </s> add for (size_t i = 0, size = array.size(rt); i < size; i++) { auto shareable = ShareableValue::adapt(rt, array.getValueAtIndex(rt, i), module);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/FrozenObject.cpp
keep add keep keep keep keep keep
<mask> for (size_t i = 0; i < count; i++) { <mask> auto propertyName = propertyNames.getValueAtIndex(rt, i).asString(rt); <mask> std::string nameStr = propertyName.utf8(rt); <mask> map[nameStr] = ShareableValue::adapt( <mask> rt, object.getProperty(rt, propertyName), runtimeManager); <mask> this->containsHostFunction |= map[nameStr]->containsHostFunction; <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove map[nameStr] = ShareableValue::adapt(rt, object.getProperty(rt, propertyName), runtimeManager); </s> add map[nameStr] = ShareableValue::adapt( rt, object.getProperty(rt, propertyName), runtimeManager); </s> remove for (size_t i = 0, count = propertyNames.size(rt); i < count; i++) { </s> add const size_t count = propertyNames.size(rt); namesOrder.reserve(count); for (size_t i = 0; i < count; i++) { </s> remove FrozenObject::FrozenObject(jsi::Runtime &rt, const jsi::Object &object, RuntimeManager *runtimeManager) { </s> add FrozenObject::FrozenObject( jsi::Runtime &rt, const jsi::Object &object, RuntimeManager *runtimeManager) { </s> remove res.push_back(jsi::PropNameID::forString(rt, propertyNames.getValueAtIndex(rt, i).asString(rt))); </s> add res.push_back(jsi::PropNameID::forString( rt, propertyNames.getValueAtIndex(rt, i).asString(rt))); </s> remove res.push_back(jsi::PropNameID::forString(rt, propertyNames.getValueAtIndex(rt, i).asString(rt))); </s> add res.push_back(jsi::PropNameID::forString( rt, propertyNames.getValueAtIndex(rt, i).asString(rt))); </s> remove auto& frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> add auto &frozenArray = ValueWrapper::asFrozenArray(valueContainer);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/FrozenObject.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> auto propertyNames = object.getPropertyNames(rt); <mask> for (size_t i = 0, count = propertyNames.size(rt); i < count; i++) { <mask> auto propertyName = propertyNames.getValueAtIndex(rt, i).asString(rt); <mask> std::string nameStr = propertyName.utf8(rt); <mask> map[nameStr] = ShareableValue::adapt(rt, object.getProperty(rt, propertyName), runtimeManager); <mask> this->containsHostFunction |= map[nameStr]->containsHostFunction; <mask> } <mask> } <mask> <mask> jsi::Object FrozenObject::shallowClone(jsi::Runtime &rt) { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove for (size_t i = 0, count = propertyNames.size(rt); i < count; i++) { </s> add const size_t count = propertyNames.size(rt); namesOrder.reserve(count); for (size_t i = 0; i < count; i++) { </s> add namesOrder.push_back(propertyName.utf8(rt)); </s> remove FrozenObject::FrozenObject(jsi::Runtime &rt, const jsi::Object &object, RuntimeManager *runtimeManager) { </s> add FrozenObject::FrozenObject( jsi::Runtime &rt, const jsi::Object &object, RuntimeManager *runtimeManager) { </s> remove res.push_back(jsi::PropNameID::forString(rt, propertyNames.getValueAtIndex(rt, i).asString(rt))); </s> add res.push_back(jsi::PropNameID::forString( rt, propertyNames.getValueAtIndex(rt, i).asString(rt))); </s> remove res.push_back(jsi::PropNameID::forString(rt, propertyNames.getValueAtIndex(rt, i).asString(rt))); </s> add res.push_back(jsi::PropNameID::forString( rt, propertyNames.getValueAtIndex(rt, i).asString(rt))); </s> remove for (size_t i = 0, size = array.size(rt); i < size; i++) { auto shareable = ShareableValue::adapt(rt, array.getValueAtIndex(rt, i), module); </s> add for (size_t i = 0, size = array.size(rt); i < size; i++) { auto shareable = ShareableValue::adapt(rt, array.getValueAtIndex(rt, i), module);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/FrozenObject.cpp
keep keep keep keep replace replace keep keep keep keep replace
<mask> } <mask> <mask> jsi::Object FrozenObject::shallowClone(jsi::Runtime &rt) { <mask> jsi::Object object(rt); <mask> for (auto prop : map) { <mask> object.setProperty(rt, jsi::String::createFromUtf8(rt, prop.first), prop.second->getValue(rt)); <mask> } <mask> return object; <mask> } <mask> <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475)
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/FrozenObject.cpp
keep replace replace replace keep keep keep keep keep
<mask> #include "MutableValue.h" <mask> #include "SharedParent.h" <mask> #include "ShareableValue.h" <mask> #include "RuntimeManager.h" <mask> #include "RuntimeDecorator.h" <mask> <mask> namespace reanimated { <mask> <mask> void MutableValue::setValue(jsi::Runtime &rt, const jsi::Value &newValue) { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> add #include "RuntimeManager.h" #include "ShareableValue.h" #include "SharedParent.h" </s> add #include "RuntimeManager.h" #include "SharedParent.h" </s> remove #include "ShareableValue.h" #include "SharedParent.h" #include "RuntimeManager.h" </s> add #include <cxxabi.h> #include "FrozenObject.h" </s> remove #include "ShareableValue.h" #include "SharedParent.h" #include "RuntimeManager.h" </s> add #include <cxxabi.h> #include "FrozenObject.h" </s> remove #include "SharedParent.h" #include "ShareableValue.h" </s> add </s> add #include "ShareableValue.h" #include "SharedParent.h"
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/MutableValue.cpp
keep add keep keep keep keep keep
<mask> #include "MutableValue.h" <mask> #include "RuntimeDecorator.h" <mask> <mask> namespace reanimated { <mask> <mask> void MutableValue::setValue(jsi::Runtime &rt, const jsi::Value &newValue) { <mask> std::lock_guard<std::mutex> lock(readWriteMutex); </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove #include "SharedParent.h" #include "ShareableValue.h" #include "RuntimeManager.h" </s> add </s> remove void MutableValue::set(jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { </s> add void MutableValue::set( jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { </s> remove #include "FrozenObject.h" </s> add </s> remove #include "FrozenObject.h" </s> add </s> add #include "RuntimeManager.h" #include "SharedParent.h" </s> add #include <unordered_map> #include "LayoutAnimationsProxy.h" #include "MutableValue.h" #include "ReanimatedHiddenHeaders.h"
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/MutableValue.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> std::lock_guard<std::mutex> lock(readWriteMutex); <mask> value = ShareableValue::adapt(rt, newValue, runtimeManager); <mask> <mask> std::shared_ptr<MutableValue> thiz = shared_from_this(); <mask> auto notifyListeners = [thiz] () { <mask> for (auto listener : thiz->listeners) { <mask> listener.second(); <mask> } <mask> }; <mask> if (RuntimeDecorator::isUIRuntime(rt)) { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> add } else if (propName == "_value") { auto setter = std::make_shared<MutableValueSetterProxy>(shared_from_this()); setter->set(rt, jsi::PropNameID::forAscii(rt, "_value"), newValue); </s> remove runtimeManager->scheduler->scheduleOnUI([notifyListeners] { notifyListeners(); }); </s> add runtimeManager->scheduler->scheduleOnUI( [notifyListeners] { notifyListeners(); }); </s> add } else if (propName == "_value") { auto setter = std::make_shared<MutableValueSetterProxy>(shared_from_this()); setter->set(rt, jsi::PropNameID::forAscii(rt, "_value"), newValue); </s> remove if (deg.count(sharedValue) == 0) { </s> add if (deg.count(sharedValueID) == 0) { </s> remove for (auto & entry : deg) { </s> add for (auto &entry : deg) { </s> remove for (auto prop : map) { object.setProperty(rt, jsi::String::createFromUtf8(rt, prop.first), prop.second->getValue(rt)); </s> add for (auto propName : namesOrder) { auto value = map[propName]; object.setProperty( rt, jsi::String::createFromUtf8(rt, propName), value->getValue(rt));
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/MutableValue.cpp
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> }; <mask> if (RuntimeDecorator::isUIRuntime(rt)) { <mask> notifyListeners(); <mask> } else { <mask> runtimeManager->scheduler->scheduleOnUI([notifyListeners] { <mask> notifyListeners(); <mask> }); <mask> } <mask> } <mask> <mask> jsi::Value MutableValue::getValue(jsi::Runtime &rt) { <mask> std::lock_guard<std::mutex> lock(readWriteMutex); </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove auto notifyListeners = [thiz] () { </s> add auto notifyListeners = [thiz]() { </s> remove }); </s> add } if (queueWasEmpty) { mUIImplementation.dispatchViewUpdates(-1); // no associated batchId } if (shouldDispatchUpdates) { semaphore.release(); } } }); </s> remove void MutableValue::set(jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { </s> add void MutableValue::set( jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { </s> remove ((ReactScrollView)view).smoothScrollTo((int)x, (int)y); </s> add ((ReactScrollView) view).smoothScrollTo((int) x, (int) y); </s> remove ((ReactHorizontalScrollView)view).smoothScrollTo((int)x, (int)y); </s> add ((ReactHorizontalScrollView) view).smoothScrollTo((int) x, (int) y); </s> remove ((ReactScrollView)view).scrollTo((int)x, (int)y); </s> add ((ReactScrollView) view).scrollTo((int) x, (int) y);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/MutableValue.cpp
keep keep replace keep keep keep keep keep keep keep keep replace keep keep keep keep
<mask> } <mask> <mask> void MutableValue::set(jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { <mask> auto propName = name.utf8(rt); <mask> if (!runtimeManager->valueSetter) { <mask> throw jsi::JSError(rt, "Value-Setter is not yet configured! Make sure the core-functions are installed."); <mask> } <mask> <mask> void MutableValue::set(jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { <mask> auto propName = name.utf8(rt); <mask> if (!runtimeManager->valueSetter) { <mask> throw jsi::JSError(rt, "Value-Setter is not yet configured! Make sure the core-functions are installed."); <mask> } <mask> <mask> if (RuntimeDecorator::isUIRuntime(rt)) { <mask> // UI thread </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove throw jsi::JSError(rt, "Value-Setter is not yet configured! Make sure the core-functions are installed."); </s> add throw jsi::JSError( rt, "Value-Setter is not yet configured! Make sure the core-functions are installed."); </s> remove void MutableValueSetterProxy::set(jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { </s> add void MutableValueSetterProxy::set( jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { </s> remove void MutableValueSetterProxy::set(jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { </s> add void MutableValueSetterProxy::set( jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { </s> remove if (propName == "value") { // you call `this.value` inside of value setter, we should throw } else if (propName == "_value") { </s> add if (propName == "_value") { </s> remove if (propName == "value") { // you call `this.value` inside of value setter, we should throw } else if (propName == "_value") { </s> add if (propName == "_value") {
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/MutableValue.cpp
keep keep replace keep replace replace replace keep
<mask> // UI thread <mask> if (propName == "value") { <mask> auto setterProxy = jsi::Object::createFromHostObject(rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); <mask> runtimeManager->valueSetter->getValue(rt) <mask> .asObject(rt) <mask> .asFunction(rt) <mask> .callWithThis(rt, setterProxy, newValue); <mask> } else if (propName == "_animation") { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove auto setterProxy = jsi::Object::createFromHostObject(rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); </s> add auto setterProxy = jsi::Object::createFromHostObject( rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); </s> remove .asObject(rt) .asFunction(rt) .callWithThis(rt, setterProxy, newValue); </s> add .asObject(rt) .asFunction(rt) .callWithThis(rt, setterProxy, newValue); </s> remove auto setterProxy = jsi::Object::createFromHostObject(rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); </s> add auto setterProxy = jsi::Object::createFromHostObject( rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); </s> remove auto setterProxy = jsi::Object::createFromHostObject(rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); </s> add auto setterProxy = jsi::Object::createFromHostObject( rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); </s> remove .asObject(rt) .asFunction(rt) .callWithThis(rt, setterProxy, newValue); </s> add .asObject(rt) .asFunction(rt) .callWithThis(rt, setterProxy, newValue);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/MutableValue.cpp
keep add keep keep keep keep keep keep
<mask> } <mask> *animation.lock() = jsi::Value(rt, newValue); <mask> } <mask> } else { <mask> // React-JS Thread or another threaded Runtime. <mask> if (propName == "value") { <mask> auto shareable = ShareableValue::adapt(rt, newValue, runtimeManager); <mask> runtimeManager->scheduler->scheduleOnUI([this, shareable] { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> add } else if (propName == "_value") { auto setter = std::make_shared<MutableValueSetterProxy>(shared_from_this()); setter->set(rt, jsi::PropNameID::forAscii(rt, "_value"), newValue); </s> remove auto setterProxy = jsi::Object::createFromHostObject(rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); </s> add auto setterProxy = jsi::Object::createFromHostObject( rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); </s> remove auto setterProxy = jsi::Object::createFromHostObject(rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); </s> add auto setterProxy = jsi::Object::createFromHostObject( rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); </s> remove jsi::Value MutableValueSetterProxy::get(jsi::Runtime &rt, const jsi::PropNameID &name) { </s> add jsi::Value MutableValueSetterProxy::get( jsi::Runtime &rt, const jsi::PropNameID &name) { </s> remove jsi::Value MutableValueSetterProxy::get(jsi::Runtime &rt, const jsi::PropNameID &name) { </s> add jsi::Value MutableValueSetterProxy::get( jsi::Runtime &rt, const jsi::PropNameID &name) { </s> add } else if (propName == "value") { // you call `this.value` inside of value setter, we should throw
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/MutableValue.cpp
keep keep keep replace keep keep replace replace replace keep keep keep keep
<mask> auto shareable = ShareableValue::adapt(rt, newValue, runtimeManager); <mask> runtimeManager->scheduler->scheduleOnUI([this, shareable] { <mask> jsi::Runtime &rt = *this->runtimeManager->runtime.get(); <mask> auto setterProxy = jsi::Object::createFromHostObject(rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); <mask> jsi::Value newValue = shareable->getValue(rt); <mask> runtimeManager->valueSetter->getValue(rt) <mask> .asObject(rt) <mask> .asFunction(rt) <mask> .callWithThis(rt, setterProxy, newValue); <mask> }); <mask> } <mask> } <mask> </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove auto setterProxy = jsi::Object::createFromHostObject(rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); </s> add auto setterProxy = jsi::Object::createFromHostObject( rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); </s> remove .asObject(rt) .asFunction(rt) .callWithThis(rt, setterProxy, newValue); </s> add .asObject(rt) .asFunction(rt) .callWithThis(rt, setterProxy, newValue); </s> remove auto setterProxy = jsi::Object::createFromHostObject(rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); </s> add auto setterProxy = jsi::Object::createFromHostObject( rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); </s> remove auto setterProxy = jsi::Object::createFromHostObject(rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); </s> add auto setterProxy = jsi::Object::createFromHostObject( rt, std::make_shared<MutableValueSetterProxy>(shared_from_this())); </s> remove .asObject(rt) .asFunction(rt) .callWithThis(rt, setterProxy, newValue); </s> add .asObject(rt) .asFunction(rt) .callWithThis(rt, setterProxy, newValue);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/MutableValue.cpp
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
<mask> result.push_back(jsi::PropNameID::forUtf8(rt, std::string("value"))); <mask> return result; <mask> } <mask> <mask> MutableValue::MutableValue(jsi::Runtime &rt, const jsi::Value &initial, RuntimeManager *runtimeManager, std::shared_ptr<Scheduler> s): <mask> StoreUser(s), runtimeManager(runtimeManager), value(ShareableValue::adapt(rt, initial, runtimeManager)) { <mask> } <mask> <mask> unsigned long int MutableValue::addListener(unsigned long id, std::function<void ()> listener) { <mask> listeners[id] = listener; <mask> return id; <mask> } <mask> <mask> void MutableValue::removeListener(unsigned long listenerId) { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove MutableValue::MutableValue(jsi::Runtime &rt, const jsi::Value &initial, RuntimeManager *runtimeManager, std::shared_ptr<Scheduler> s): StoreUser(s), runtimeManager(runtimeManager), value(ShareableValue::adapt(rt, initial, runtimeManager)) { } unsigned long int MutableValue::addListener(unsigned long id, std::function<void ()> listener) { </s> add MutableValue::MutableValue( jsi::Runtime &rt, const jsi::Value &initial, RuntimeManager *runtimeManager, std::shared_ptr<Scheduler> s) : StoreUser(s, *runtimeManager), runtimeManager(runtimeManager), value(ShareableValue::adapt(rt, initial, runtimeManager)) {} unsigned long int MutableValue::addListener( unsigned long id, std::function<void()> listener) { </s> remove void NativeReanimatedModule::unregisterEventHandler(jsi::Runtime &rt, const jsi::Value &registrationId) { </s> add void NativeReanimatedModule::unregisterEventHandler( jsi::Runtime &rt, const jsi::Value &registrationId) { </s> remove public: void set(jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &value); </s> add public: void set(jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &value); </s> remove public: void set(jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &value); </s> add public: void set(jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &value); </s> remove return jsi::Value((double)newMapperId); </s> add return jsi::Value(static_cast<double>(newMapperId)); </s> remove void NativeReanimatedModule::stopMapper(jsi::Runtime &rt, const jsi::Value &mapperId) { </s> add void NativeReanimatedModule::stopMapper( jsi::Runtime &rt, const jsi::Value &mapperId) {
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/MutableValue.cpp
keep keep keep keep replace replace
<mask> listeners.erase(listenerId); <mask> } <mask> } <mask> <mask> <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove } </s> add } // namespace reanimated </s> remove //noop </s> add // noop </s> remove } </s> add } // namespace reanimated </s> remove } </s> add } // namespace reanimated </s> remove } </s> add } // namespace reanimated </s> remove } </s> add } // namespace reanimated
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/MutableValue.cpp
keep replace replace keep keep keep keep keep
<mask> #include "MutableValueSetterProxy.h" <mask> #include "SharedParent.h" <mask> #include "MutableValue.h" <mask> #include <jsi/jsi.h> <mask> <mask> using namespace facebook; <mask> <mask> namespace reanimated { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> add #include "MutableValue.h" #include "SharedParent.h" </s> remove #include "SharedParent.h" #include "MutableValue.h" </s> add </s> add #include "MutableValue.h" #include "SharedParent.h" </s> add #include "SharedParent.h" </s> add #include "RuntimeDecorator.h" #include "SharedParent.h" </s> add #include "RuntimeDecorator.h" #include "SharedParent.h"
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/MutableValueSetterProxy.cpp
keep add keep keep keep keep
<mask> #include "MutableValueSetterProxy.h" <mask> #include <jsi/jsi.h> <mask> <mask> using namespace facebook; <mask> <mask> namespace reanimated { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove #include "SharedParent.h" #include "MutableValue.h" </s> add </s> remove #include "SharedParent.h" #include "MutableValue.h" </s> add </s> add #include "MutableValue.h" #include "SharedParent.h" </s> add #include "SharedParent.h" </s> remove namespace reanimated { </s> add namespace reanimated { </s> remove #include "SharedParent.h" #include "RuntimeDecorator.h" </s> add
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/MutableValueSetterProxy.cpp
keep keep keep replace keep replace replace replace keep keep keep keep
<mask> <mask> namespace reanimated { <mask> <mask> void MutableValueSetterProxy::set(jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { <mask> auto propName = name.utf8(rt); <mask> if (propName == "value") { <mask> // you call `this.value` inside of value setter, we should throw <mask> } else if (propName == "_value") { <mask> mutableValue->setValue(rt, newValue); <mask> } else if (propName == "_animation") { <mask> // TODO: assert to allow animation to be set from UI only <mask> if (mutableValue->animation.expired()) { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove if (propName == "value") { // you call `this.value` inside of value setter, we should throw } else if (propName == "_value") { </s> add if (propName == "_value") { </s> remove void MutableValueSetterProxy::set(jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { </s> add void MutableValueSetterProxy::set( jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { </s> remove .asObject(rt) .asFunction(rt) .callWithThis(rt, setterProxy, newValue); </s> add .asObject(rt) .asFunction(rt) .callWithThis(rt, setterProxy, newValue); </s> remove .asObject(rt) .asFunction(rt) .callWithThis(rt, setterProxy, newValue); </s> add .asObject(rt) .asFunction(rt) .callWithThis(rt, setterProxy, newValue); </s> add } else if (propName == "value") { // you call `this.value` inside of value setter, we should throw
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/MutableValueSetterProxy.cpp
keep keep add keep keep keep keep keep
<mask> mutableValue->animation = mutableValue->getWeakRef(rt); <mask> } <mask> *mutableValue->animation.lock() = jsi::Value(rt, newValue); <mask> } <mask> } <mask> <mask> jsi::Value MutableValueSetterProxy::get( <mask> jsi::Runtime &rt, </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> add } else if (propName == "value") { // you call `this.value` inside of value setter, we should throw </s> remove jsi::Value MutableValueSetterProxy::get(jsi::Runtime &rt, const jsi::PropNameID &name) { </s> add jsi::Value MutableValueSetterProxy::get( jsi::Runtime &rt, const jsi::PropNameID &name) { </s> remove jsi::Value MutableValueSetterProxy::get(jsi::Runtime &rt, const jsi::PropNameID &name) { </s> add jsi::Value MutableValueSetterProxy::get( jsi::Runtime &rt, const jsi::PropNameID &name) { </s> remove .asObject(rt) .asFunction(rt) .callWithThis(rt, setterProxy, newValue); </s> add .asObject(rt) .asFunction(rt) .callWithThis(rt, setterProxy, newValue); </s> remove .asObject(rt) .asFunction(rt) .callWithThis(rt, setterProxy, newValue); </s> add .asObject(rt) .asFunction(rt) .callWithThis(rt, setterProxy, newValue); </s> add } else if (propName == "_value") { auto setter = std::make_shared<MutableValueSetterProxy>(shared_from_this()); setter->set(rt, jsi::PropNameID::forAscii(rt, "_value"), newValue);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/MutableValueSetterProxy.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> *mutableValue->animation.lock() = jsi::Value(rt, newValue); <mask> } <mask> } <mask> <mask> jsi::Value MutableValueSetterProxy::get(jsi::Runtime &rt, const jsi::PropNameID &name) { <mask> auto propName = name.utf8(rt); <mask> <mask> if (propName == "value") { <mask> return mutableValue->getValue(rt); <mask> } else if (propName == "_value") { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove jsi::Value MutableValueSetterProxy::get(jsi::Runtime &rt, const jsi::PropNameID &name) { </s> add jsi::Value MutableValueSetterProxy::get( jsi::Runtime &rt, const jsi::PropNameID &name) { </s> remove if (propName == "value") { // you call `this.value` inside of value setter, we should throw } else if (propName == "_value") { </s> add if (propName == "_value") { </s> remove if (propName == "value") { // you call `this.value` inside of value setter, we should throw } else if (propName == "_value") { </s> add if (propName == "_value") { </s> remove void MutableValueSetterProxy::set(jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { </s> add void MutableValueSetterProxy::set( jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { </s> remove void MutableValueSetterProxy::set(jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { </s> add void MutableValueSetterProxy::set( jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { </s> add } else if (propName == "_value") { auto setter = std::make_shared<MutableValueSetterProxy>(shared_from_this()); setter->set(rt, jsi::PropNameID::forAscii(rt, "_value"), newValue);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/MutableValueSetterProxy.cpp
keep keep keep keep replace replace
<mask> <mask> return jsi::Value::undefined(); <mask> } <mask> <mask> } <mask> </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove } </s> add } // namespace reanimated </s> remove ->getViewProp(rt, std::move(args[0]), std::move(args[1]), std::move(args[2])); return jsi::Value::undefined(); </s> add ->getViewProp( rt, std::move(args[0]), std::move(args[1]), std::move(args[2])); return jsi::Value::undefined(); } static jsi::Value __hostFunction_NativeReanimatedModuleSpec_enableLayoutAnimations( jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value *args, size_t count) { static_cast<NativeReanimatedModuleSpec *>(&turboModule) ->enableLayoutAnimations(rt, std::move(args[0])); return jsi::Value::undefined(); </s> remove void NativeReanimatedModule::onEvent(std::string eventName, std::string eventAsString) { try { eventHandlerRegistry->processEvent(*runtime, eventName, eventAsString); mapperRegistry->execute(*runtime); if (mapperRegistry->needRunOnRender()) { maybeRequestRender(); } </s> add jsi::Value NativeReanimatedModule::enableLayoutAnimations( jsi::Runtime &rt, const jsi::Value &config) { FeaturesConfig::setLayoutAnimationEnabled(config.getBool()); return jsi::Value::undefined(); } void NativeReanimatedModule::onEvent( std::string eventName, std::string eventAsString) { try { eventHandlerRegistry->processEvent(*runtime, eventName, eventAsString); mapperRegistry->execute(*runtime); if (mapperRegistry->needRunOnRender()) { maybeRequestRender(); </s> remove return jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, "_workletFunction"), 0, clb); </s> add return jsi::Function::createFromHostFunction( rt, jsi::PropNameID::forAscii(rt, "_workletFunction"), 0, clb); </s> remove rt.global().setProperty(rt, "jsThis", oldJSThis); //clean jsThis </s> add global.setProperty(rt, jsThisName, oldJSThis); // clean jsThis </s> remove bool RuntimeDecorator::isUIRuntime(jsi::Runtime& rt) { auto isUi = rt.global().getProperty(rt, "_UI"); return isUi.isBool() && isUi.getBool(); } bool RuntimeDecorator::isWorkletRuntime(jsi::Runtime& rt) { auto isWorklet = rt.global().getProperty(rt, "_WORKLET"); return isWorklet.isBool() && isWorklet.getBool(); } bool RuntimeDecorator::isReactRuntime(jsi::Runtime& rt) { return !isWorkletRuntime(rt); </s> add // layout animation std::weak_ptr<LayoutAnimationsProxy> layoutProxy = layoutAnimationsProxy; auto clb7 = [layoutProxy]( jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) -> jsi::Value { std::shared_ptr<LayoutAnimationsProxy> proxy = layoutProxy.lock(); if (layoutProxy.expired()) { return jsi::Value::undefined(); } proxy->startObserving( args[0].asNumber(), args[1].asObject(rt).getHostObject<MutableValue>(rt), rt); return jsi::Value::undefined(); }; jsi::Value _startObservingProgress = jsi::Function::createFromHostFunction( rt, jsi::PropNameID::forAscii(rt, "_startObservingProgress"), 0, clb7); rt.global().setProperty( rt, "_startObservingProgress", _startObservingProgress); auto clb8 = [layoutProxy]( jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) -> jsi::Value { std::shared_ptr<LayoutAnimationsProxy> proxy = layoutProxy.lock(); if (layoutProxy.expired()) { return jsi::Value::undefined(); } proxy->stopObserving(args[0].asNumber(), args[1].getBool()); return jsi::Value::undefined(); }; jsi::Value _stopObservingProgress = jsi::Function::createFromHostFunction( rt, jsi::PropNameID::forAscii(rt, "_stopObservingProgress"), 0, clb8); rt.global().setProperty(rt, "_stopObservingProgress", _stopObservingProgress); auto clb9 = [setGestureState]( jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) -> jsi::Value { int handlerTag = static_cast<int>(args[0].asNumber()); int newState = static_cast<int>(args[1].asNumber()); setGestureState(handlerTag, newState); return jsi::Value::undefined(); }; jsi::Value setGestureStateFunction = jsi::Function::createFromHostFunction( rt, jsi::PropNameID::forAscii(rt, "_setGestureState"), 2, clb9); rt.global().setProperty(rt, "_setGestureState", setGestureStateFunction);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/MutableValueSetterProxy.cpp
keep replace replace keep keep keep keep keep
<mask> #include "RemoteObject.h" <mask> #include "SharedParent.h" <mask> #include "RuntimeDecorator.h" <mask> #include <jsi/jsi.h> <mask> <mask> using namespace facebook; <mask> <mask> namespace reanimated { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> add #include "RuntimeDecorator.h" #include "SharedParent.h" </s> remove #include "SharedParent.h" #include "RuntimeDecorator.h" </s> add </s> add #include "RuntimeDecorator.h" #include "SharedParent.h" </s> add #include "MutableValue.h" #include "SharedParent.h" </s> remove #include "SharedParent.h" #include "MutableValue.h" </s> add </s> add #include "MutableValue.h" #include "SharedParent.h"
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/RemoteObject.cpp
keep add keep keep keep keep
<mask> #include "RemoteObject.h" <mask> #include <jsi/jsi.h> <mask> <mask> using namespace facebook; <mask> <mask> namespace reanimated { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove #include "SharedParent.h" #include "RuntimeDecorator.h" </s> add </s> remove #include "SharedParent.h" #include "RuntimeDecorator.h" </s> add </s> add #include "RuntimeDecorator.h" #include "SharedParent.h" </s> remove namespace reanimated { </s> add namespace reanimated { </s> remove #include "SharedParent.h" #include "MutableValue.h" </s> add </s> remove #include "SharedParent.h" #include "MutableValue.h" </s> add
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/RemoteObject.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> return jsi::Value::undefined(); <mask> } <mask> <mask> void RemoteObject::set(jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &value) { <mask> if (RuntimeDecorator::isWorkletRuntime(rt)) { <mask> backing.lock()->getObject(rt).setProperty(rt, name, value); <mask> } <mask> // TODO: we should throw if trying to update remote from host runtime <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove void RemoteObject::set(jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &value) { </s> add void RemoteObject::set( jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &value) { </s> remove if (propName == "value") { // you call `this.value` inside of value setter, we should throw } else if (propName == "_value") { </s> add if (propName == "_value") { </s> remove if (propName == "value") { // you call `this.value` inside of value setter, we should throw } else if (propName == "_value") { </s> add if (propName == "_value") { </s> remove // when adapting from host object we can assign cached value immediately such that we avoid // running `toJSValue` in the future when given object is accessed </s> add // when adapting from host object we can assign cached value immediately such // that we avoid running `toJSValue` in the future when given object is // accessed </s> remove // when adapting from host object we can assign cached value immediately such that we avoid // running `toJSValue` in the future when given object is accessed </s> add // when adapting from host object we can assign cached value immediately such // that we avoid running `toJSValue` in the future when given object is // accessed </s> remove void MutableValueSetterProxy::set(jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) { </s> add void MutableValueSetterProxy::set( jsi::Runtime &rt, const jsi::PropNameID &name, const jsi::Value &newValue) {
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/RemoteObject.cpp
keep keep keep keep replace keep keep keep keep replace
<mask> std::vector<jsi::PropNameID> RemoteObject::getPropertyNames(jsi::Runtime &rt) { <mask> std::vector<jsi::PropNameID> res; <mask> auto propertyNames = backing.lock()->getObject(rt).getPropertyNames(rt); <mask> for (size_t i = 0, size = propertyNames.size(rt); i < size; i++) { <mask> res.push_back(jsi::PropNameID::forString(rt, propertyNames.getValueAtIndex(rt, i).asString(rt))); <mask> } <mask> return res; <mask> } <mask> <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475)
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/RemoteObject.cpp
replace replace replace keep keep keep replace keep keep keep keep keep
<mask> #include "ShareableValue.h" <mask> #include "SharedParent.h" <mask> #include "RuntimeManager.h" <mask> #include "MutableValue.h" <mask> #include "MutableValueSetterProxy.h" <mask> #include "RemoteObject.h" <mask> #include "FrozenObject.h" <mask> #include "RuntimeDecorator.h" <mask> <mask> namespace reanimated { <mask> <mask> const char *HIDDEN_HOST_OBJECT_PROP = "__reanimatedHostObjectRef"; </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove #include "FrozenObject.h" </s> add </s> add #include "RuntimeManager.h" #include "SharedParent.h" </s> add #include "RuntimeManager.h" #include "SharedParent.h" </s> remove #include "ShareableValue.h" #include "SharedParent.h" #include "RuntimeManager.h" </s> add #include <cxxabi.h> #include "FrozenObject.h" </s> remove #include "SharedParent.h" #include "ShareableValue.h" #include "RuntimeManager.h" </s> add
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep add keep keep keep keep keep keep
<mask> #include "MutableValueSetterProxy.h" <mask> #include "RemoteObject.h" <mask> #include "RuntimeDecorator.h" <mask> <mask> namespace reanimated { <mask> class ShareableValue; <mask> const char *HIDDEN_HOST_OBJECT_PROP = "__reanimatedHostObjectRef"; <mask> const char *ALREADY_CONVERTED = "__alreadyConverted"; <mask> const char *CALL_ASYNC = "__callAsync"; </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove </s> add class ShareableValue; </s> remove </s> add class ShareableValue; </s> remove const char *ALREADY_CONVERTED= "__alreadyConverted"; </s> add const char *ALREADY_CONVERTED = "__alreadyConverted"; </s> remove const char *ALREADY_CONVERTED= "__alreadyConverted"; </s> add const char *ALREADY_CONVERTED = "__alreadyConverted"; </s> add #include "RuntimeManager.h" #include "SharedParent.h" </s> remove #include "FrozenObject.h" </s> add
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> #include "FrozenObject.h" <mask> #include "RuntimeDecorator.h" <mask> <mask> namespace reanimated { <mask> <mask> const char *HIDDEN_HOST_OBJECT_PROP = "__reanimatedHostObjectRef"; <mask> const char *ALREADY_CONVERTED= "__alreadyConverted"; <mask> const char *CALL_ASYNC = "__callAsync"; <mask> const char *PRIMAL_FUNCTION = "__primalFunction"; <mask> std::string CALLBACK_ERROR_SUFFIX = R"( </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove </s> add class ShareableValue; </s> remove const char *ALREADY_CONVERTED= "__alreadyConverted"; </s> add const char *ALREADY_CONVERTED = "__alreadyConverted"; </s> remove const char *ALREADY_CONVERTED= "__alreadyConverted"; </s> add const char *ALREADY_CONVERTED = "__alreadyConverted"; </s> add #include "RuntimeManager.h" #include "SharedParent.h" </s> remove #include "FrozenObject.h" </s> add </s> remove #include "FrozenObject.h" </s> add
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep replace keep keep replace replace replace replace replace replace replace replace replace replace keep keep
<mask> <mask> const char *HIDDEN_HOST_OBJECT_PROP = "__reanimatedHostObjectRef"; <mask> const char *ALREADY_CONVERTED= "__alreadyConverted"; <mask> const char *CALL_ASYNC = "__callAsync"; <mask> const char *PRIMAL_FUNCTION = "__primalFunction"; <mask> std::string CALLBACK_ERROR_SUFFIX = R"( <mask> <mask> Possible solutions are: <mask> a) If you want to synchronously execute this method, mark it as a Worklet <mask> b) If you want to execute this method on the JS thread, wrap it using runOnJS )"; <mask> <mask> void addHiddenProperty(jsi::Runtime &rt, <mask> jsi::Value &&value, <mask> jsi::Object &obj, <mask> const char *name) { <mask> jsi::Object globalObject = rt.global().getPropertyAsObject(rt, "Object"); <mask> jsi::Function defineProperty = globalObject.getPropertyAsFunction(rt, "defineProperty"); </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove std::string CALLBACK_ERROR_SUFFIX = R"( Possible solutions are: a) If you want to synchronously execute this method, mark it as a Worklet b) If you want to execute this method on the JS thread, wrap it using runOnJS )"; void addHiddenProperty(jsi::Runtime &rt, jsi::Value &&value, jsi::Object &obj, const char *name) { </s> add const char *CALLBACK_ERROR_SUFFIX = "\n\nPossible solutions are:\n" "a) If you want to synchronously execute this method, mark it as a Worklet\n" "b) If you want to execute this method on the JS thread, wrap it using runOnJS"; void addHiddenProperty( jsi::Runtime &rt, jsi::Value &&value, const jsi::Object &obj, const char *name) { </s> remove const char *ALREADY_CONVERTED= "__alreadyConverted"; </s> add const char *ALREADY_CONVERTED = "__alreadyConverted"; </s> remove </s> add class ShareableValue; </s> remove </s> add class ShareableValue; </s> remove jsi::Function defineProperty = globalObject.getPropertyAsFunction(rt, "defineProperty"); </s> add jsi::Function defineProperty = globalObject.getPropertyAsFunction(rt, "defineProperty");
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> jsi::Value &&value, <mask> jsi::Object &obj, <mask> const char *name) { <mask> jsi::Object globalObject = rt.global().getPropertyAsObject(rt, "Object"); <mask> jsi::Function defineProperty = globalObject.getPropertyAsFunction(rt, "defineProperty"); <mask> jsi::String internalPropName = jsi::String::createFromUtf8(rt, name); <mask> jsi::Object paramForDefineProperty(rt); <mask> paramForDefineProperty.setProperty(rt, "enumerable", false); <mask> paramForDefineProperty.setProperty(rt, "value", value); <mask> defineProperty.call(rt, obj, internalPropName, paramForDefineProperty); </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove jsi::Function defineProperty = globalObject.getPropertyAsFunction(rt, "defineProperty"); </s> add jsi::Function defineProperty = globalObject.getPropertyAsFunction(rt, "defineProperty"); </s> remove void freeze(jsi::Runtime &rt, jsi::Object &obj) { </s> add void freeze(jsi::Runtime &rt, const jsi::Object &obj) { </s> remove void freeze(jsi::Runtime &rt, jsi::Object &obj) { </s> add void freeze(jsi::Runtime &rt, const jsi::Object &obj) { </s> remove std::string CALLBACK_ERROR_SUFFIX = R"( Possible solutions are: a) If you want to synchronously execute this method, mark it as a Worklet b) If you want to execute this method on the JS thread, wrap it using runOnJS )"; void addHiddenProperty(jsi::Runtime &rt, jsi::Value &&value, jsi::Object &obj, const char *name) { </s> add const char *CALLBACK_ERROR_SUFFIX = "\n\nPossible solutions are:\n" "a) If you want to synchronously execute this method, mark it as a Worklet\n" "b) If you want to execute this method on the JS thread, wrap it using runOnJS"; void addHiddenProperty( jsi::Runtime &rt, jsi::Value &&value, const jsi::Object &obj, const char *name) { </s> remove std::string CALLBACK_ERROR_SUFFIX = R"( Possible solutions are: a) If you want to synchronously execute this method, mark it as a Worklet b) If you want to execute this method on the JS thread, wrap it using runOnJS )"; void addHiddenProperty(jsi::Runtime &rt, jsi::Value &&value, jsi::Object &obj, const char *name) { </s> add const char *CALLBACK_ERROR_SUFFIX = "\n\nPossible solutions are:\n" "a) If you want to synchronously execute this method, mark it as a Worklet\n" "b) If you want to execute this method on the JS thread, wrap it using runOnJS"; void addHiddenProperty( jsi::Runtime &rt, jsi::Value &&value, const jsi::Object &obj, const char *name) { </s> remove addHiddenProperty(rt, std::move(__reanimatedHiddenHost), obj, HIDDEN_HOST_OBJECT_PROP); </s> add addHiddenProperty( rt, std::move(__reanimatedHiddenHost), obj, HIDDEN_HOST_OBJECT_PROP);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> paramForDefineProperty.setProperty(rt, "value", value); <mask> defineProperty.call(rt, obj, internalPropName, paramForDefineProperty); <mask> } <mask> <mask> void freeze(jsi::Runtime &rt, jsi::Object &obj) { <mask> jsi::Object globalObject = rt.global().getPropertyAsObject(rt, "Object"); <mask> jsi::Function freeze = globalObject.getPropertyAsFunction(rt, "freeze"); <mask> freeze.call(rt, obj); <mask> } <mask> </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove void freeze(jsi::Runtime &rt, jsi::Object &obj) { </s> add void freeze(jsi::Runtime &rt, const jsi::Object &obj) { </s> remove jsi::Function defineProperty = globalObject.getPropertyAsFunction(rt, "defineProperty"); </s> add jsi::Function defineProperty = globalObject.getPropertyAsFunction(rt, "defineProperty"); </s> remove jsi::Function defineProperty = globalObject.getPropertyAsFunction(rt, "defineProperty"); </s> add jsi::Function defineProperty = globalObject.getPropertyAsFunction(rt, "defineProperty"); </s> remove addHiddenProperty(rt, std::move(__reanimatedHiddenHost), obj, HIDDEN_HOST_OBJECT_PROP); </s> add addHiddenProperty( rt, std::move(__reanimatedHiddenHost), obj, HIDDEN_HOST_OBJECT_PROP); </s> remove addHiddenProperty(rt, std::move(__reanimatedHiddenHost), obj, HIDDEN_HOST_OBJECT_PROP); </s> add addHiddenProperty( rt, std::move(__reanimatedHiddenHost), obj, HIDDEN_HOST_OBJECT_PROP); </s> remove jsi::Value createFrozenWrapper(jsi::Runtime &rt, std::shared_ptr<FrozenObject> frozenObject) { jsi::Object __reanimatedHiddenHost = jsi::Object::createFromHostObject(rt, frozenObject); </s> add jsi::Value createFrozenWrapper( jsi::Runtime &rt, std::shared_ptr<FrozenObject> frozenObject) { jsi::Object __reanimatedHiddenHost = jsi::Object::createFromHostObject(rt, frozenObject);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace replace keep keep keep keep keep
<mask> freeze.call(rt, obj); <mask> } <mask> <mask> void ShareableValue::adaptCache(jsi::Runtime &rt, const jsi::Value &value) { <mask> // when adapting from host object we can assign cached value immediately such that we avoid <mask> // running `toJSValue` in the future when given object is accessed <mask> if (RuntimeDecorator::isWorkletRuntime(rt)) { <mask> if (remoteValue.expired()) { <mask> remoteValue = getWeakRef(rt); <mask> } <mask> (*remoteValue.lock()) = jsi::Value(rt, value); </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove // when adapting from host object we can assign cached value immediately such that we avoid // running `toJSValue` in the future when given object is accessed </s> add // when adapting from host object we can assign cached value immediately such // that we avoid running `toJSValue` in the future when given object is // accessed </s> remove auto ref = getWeakRef(rt); remoteValue = ref; </s> add remoteValue = getWeakRef(rt); </s> remove auto ref = getWeakRef(rt); remoteValue = ref; </s> add remoteValue = getWeakRef(rt); </s> remove // TODO: maybe we can cache toJSValue results on a per-runtime basis, need to avoid ref loops if (RuntimeDecorator::isWorkletRuntime(rt)) { </s> add // TODO: maybe we can cache toJSValue results on a per-runtime basis, need to // avoid ref loops if (&rt == runtimeManager->runtime.get()) { // Getting value on the same runtime where it was created, prepare // remoteValue </s> remove // TODO: maybe we can cache toJSValue results on a per-runtime basis, need to avoid ref loops if (RuntimeDecorator::isWorkletRuntime(rt)) { </s> add // TODO: maybe we can cache toJSValue results on a per-runtime basis, need to // avoid ref loops if (&rt == runtimeManager->runtime.get()) { // Getting value on the same runtime where it was created, prepare // remoteValue </s> remove // function is accessed from a different runtime, we wrap function in host func that'd enqueue // call on an appropriate thread </s> add // function is accessed from a different runtime, we wrap function in // host func that'd enqueue call on an appropriate thread
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace replace keep keep keep keep keep
<mask> hostValue = std::make_unique<jsi::Value>(rt, value); <mask> } <mask> } <mask> <mask> void ShareableValue::adapt(jsi::Runtime &rt, const jsi::Value &value, ValueType objectType) { <mask> bool isRNRuntime = RuntimeDecorator::isReactRuntime(rt); <mask> if (value.isObject()) { <mask> jsi::Object object = value.asObject(rt); <mask> jsi::Value hiddenValue = object.getProperty(rt, HIDDEN_HOST_OBJECT_PROP); <mask> if (!(hiddenValue.isUndefined())) { <mask> jsi::Object hiddenProperty = hiddenValue.asObject(rt); </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove void ShareableValue::adapt(jsi::Runtime &rt, const jsi::Value &value, ValueType objectType) { bool isRNRuntime = RuntimeDecorator::isReactRuntime(rt); </s> add void ShareableValue::adapt( jsi::Runtime &rt, const jsi::Value &value, ValueType objectType) { </s> remove std::shared_ptr<ShareableValue> ShareableValue::adapt(jsi::Runtime &rt, const jsi::Value &value, RuntimeManager *runtimeManager, ValueType valueType) { auto sv = std::shared_ptr<ShareableValue>(new ShareableValue(runtimeManager, runtimeManager->scheduler)); </s> add std::shared_ptr<ShareableValue> ShareableValue::adapt( jsi::Runtime &rt, const jsi::Value &value, RuntimeManager *runtimeManager, ValueType valueType) { auto sv = std::shared_ptr<ShareableValue>( new ShareableValue(runtimeManager, runtimeManager->scheduler)); </s> remove std::shared_ptr<ShareableValue> ShareableValue::adapt(jsi::Runtime &rt, const jsi::Value &value, RuntimeManager *runtimeManager, ValueType valueType) { auto sv = std::shared_ptr<ShareableValue>(new ShareableValue(runtimeManager, runtimeManager->scheduler)); </s> add std::shared_ptr<ShareableValue> ShareableValue::adapt( jsi::Runtime &rt, const jsi::Value &value, RuntimeManager *runtimeManager, ValueType valueType) { auto sv = std::shared_ptr<ShareableValue>( new ShareableValue(runtimeManager, runtimeManager->scheduler)); </s> remove valueContainer = std::make_unique<StringValueWrapper>(value.asString(rt).utf8(rt)); </s> add valueContainer = std::make_unique<StringValueWrapper>(value.asString(rt).utf8(rt)); </s> remove valueContainer = std::make_unique<StringValueWrapper>(value.asString(rt).utf8(rt)); </s> add valueContainer = std::make_unique<StringValueWrapper>(value.asString(rt).utf8(rt)); </s> remove jsi::Value createFrozenWrapper(jsi::Runtime &rt, std::shared_ptr<FrozenObject> frozenObject) { jsi::Object __reanimatedHiddenHost = jsi::Object::createFromHostObject(rt, frozenObject); </s> add jsi::Value createFrozenWrapper( jsi::Runtime &rt, std::shared_ptr<FrozenObject> frozenObject) { jsi::Object __reanimatedHiddenHost = jsi::Object::createFromHostObject(rt, frozenObject);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace replace keep keep keep keep keep
<mask> if (object.hasProperty(rt, "__worklet") && object.isFunction(rt)) { <mask> type = ValueType::WorkletFunctionType; <mask> } <mask> valueContainer = std::make_unique<FrozenObjectWrapper>( <mask> hiddenProperty.getHostObject<FrozenObject>(rt) <mask> ); <mask> if (object.hasProperty(rt, ALREADY_CONVERTED)) { <mask> adaptCache(rt, value); <mask> } <mask> return; <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove hiddenProperty.getHostObject<FrozenObject>(rt) ); </s> add hiddenProperty.getHostObject<FrozenObject>(rt)); </s> remove object.getHostObject<RemoteObject>(rt) ); </s> add object.getHostObject<RemoteObject>(rt)); </s> remove object.getHostObject<RemoteObject>(rt) ); </s> add object.getHostObject<RemoteObject>(rt)); </s> remove valueContainer = std::make_unique<RemoteObjectWrapper>( std::make_shared<RemoteObject>(rt, object, runtimeManager, runtimeManager->scheduler) ); </s> add valueContainer = std::make_unique<RemoteObjectWrapper>(std::make_shared<RemoteObject>( rt, object, runtimeManager, runtimeManager->scheduler)); </s> remove valueContainer = std::make_unique<RemoteObjectWrapper>( std::make_shared<RemoteObject>(rt, object, runtimeManager, runtimeManager->scheduler) ); </s> add valueContainer = std::make_unique<RemoteObjectWrapper>(std::make_shared<RemoteObject>( rt, object, runtimeManager, runtimeManager->scheduler)); </s> remove valueContainer = std::make_unique<MutableValueWrapper>(object.getHostObject<MutableValue>(rt)); </s> add valueContainer = std::make_unique<MutableValueWrapper>( object.getHostObject<MutableValue>(rt));
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> } <mask> <mask> if (objectType == ValueType::MutableValueType) { <mask> type = ValueType::MutableValueType; <mask> valueContainer = std::make_unique<MutableValueWrapper>( <mask> std::make_shared<MutableValue>(rt, value, runtimeManager, runtimeManager->scheduler) <mask> ); <mask> } else if (value.isUndefined()) { <mask> type = ValueType::UndefinedType; <mask> } else if (value.isNull()) { <mask> type = ValueType::NullType; <mask> } else if (value.isBool()) { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove valueContainer = std::make_unique<MutableValueWrapper>( std::make_shared<MutableValue>(rt, value, runtimeManager, runtimeManager->scheduler) ); </s> add valueContainer = std::make_unique<MutableValueWrapper>(std::make_shared<MutableValue>( rt, value, runtimeManager, runtimeManager->scheduler)); </s> remove object.getHostObject<RemoteObject>(rt) ); </s> add object.getHostObject<RemoteObject>(rt)); </s> remove object.getHostObject<RemoteObject>(rt) ); </s> add object.getHostObject<RemoteObject>(rt)); </s> remove valueContainer = std::make_unique<MutableValueWrapper>(object.getHostObject<MutableValue>(rt)); </s> add valueContainer = std::make_unique<MutableValueWrapper>( object.getHostObject<MutableValue>(rt)); </s> remove valueContainer = std::make_unique<MutableValueWrapper>(object.getHostObject<MutableValue>(rt)); </s> add valueContainer = std::make_unique<MutableValueWrapper>( object.getHostObject<MutableValue>(rt)); </s> remove valueContainer = std::make_unique<RemoteObjectWrapper>( std::make_shared<RemoteObject>(rt, object, runtimeManager, runtimeManager->scheduler) ); </s> add valueContainer = std::make_unique<RemoteObjectWrapper>(std::make_shared<RemoteObject>( rt, object, runtimeManager, runtimeManager->scheduler));
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> type = ValueType::NumberType; <mask> valueContainer = std::make_unique<NumberValueWrapper>(value.asNumber()); <mask> } else if (value.isString()) { <mask> type = ValueType::StringType; <mask> valueContainer = std::make_unique<StringValueWrapper>(value.asString(rt).utf8(rt)); <mask> } else if (value.isObject()) { <mask> auto object = value.asObject(rt); <mask> if (object.isFunction(rt)) { <mask> if (object.getProperty(rt, "__worklet").isUndefined()) { <mask> // not a worklet, we treat this as a host function </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove valueContainer = std::make_unique<StringValueWrapper>(value.asString(rt).utf8(rt)); </s> add valueContainer = std::make_unique<StringValueWrapper>(value.asString(rt).utf8(rt)); </s> remove //Check if it's a hostFunction wrapper </s> add // Check if it's a hostFunction wrapper </s> remove //Check if it's a hostFunction wrapper </s> add // Check if it's a hostFunction wrapper </s> remove valueContainer = std::make_unique<RemoteObjectWrapper>( std::make_shared<RemoteObject>(rt, object, runtimeManager, runtimeManager->scheduler) ); </s> add valueContainer = std::make_unique<RemoteObjectWrapper>(std::make_shared<RemoteObject>( rt, object, runtimeManager, runtimeManager->scheduler)); </s> remove valueContainer = std::make_unique<RemoteObjectWrapper>( std::make_shared<RemoteObject>(rt, object, runtimeManager, runtimeManager->scheduler) ); </s> add valueContainer = std::make_unique<RemoteObjectWrapper>(std::make_shared<RemoteObject>( rt, object, runtimeManager, runtimeManager->scheduler)); </s> remove valueContainer = std::make_unique<StringValueWrapper>(value.asSymbol(rt).toString(rt)); </s> add valueContainer = std::make_unique<StringValueWrapper>(value.asSymbol(rt).toString(rt));
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep replace keep keep replace replace replace keep keep keep keep
<mask> type = ValueType::HostFunctionType; <mask> containsHostFunction = true; <mask> <mask> //Check if it's a hostFunction wrapper <mask> jsi::Value primalFunction = object.getProperty(rt, PRIMAL_FUNCTION); <mask> if (!primalFunction.isUndefined()) { <mask> jsi::Object handlerAsObject = primalFunction.asObject(rt); <mask> std::shared_ptr<HostFunctionHandler> handler = handlerAsObject.getHostObject<HostFunctionHandler>(rt); <mask> valueContainer = std::make_unique<HostFunctionWrapper>(handler); <mask> } else { <mask> valueContainer = std::make_unique<HostFunctionWrapper>( <mask> std::make_shared<HostFunctionHandler>(std::make_shared<jsi::Function>(object.asFunction(rt)), rt)); <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove jsi::Object handlerAsObject = primalFunction.asObject(rt); std::shared_ptr<HostFunctionHandler> handler = handlerAsObject.getHostObject<HostFunctionHandler>(rt); valueContainer = std::make_unique<HostFunctionWrapper>(handler); </s> add jsi::Object handlerAsObject = primalFunction.asObject(rt); std::shared_ptr<HostFunctionHandler> handler = handlerAsObject.getHostObject<HostFunctionHandler>(rt); valueContainer = std::make_unique<HostFunctionWrapper>(handler); </s> remove //Check if it's a hostFunction wrapper </s> add // Check if it's a hostFunction wrapper </s> remove valueContainer = std::make_unique<HostFunctionWrapper>( std::make_shared<HostFunctionHandler>(std::make_shared<jsi::Function>(object.asFunction(rt)), rt)); </s> add valueContainer = std::make_unique<HostFunctionWrapper>( std::make_shared<HostFunctionHandler>( std::make_shared<jsi::Function>(object.asFunction(rt)), rt)); </s> remove valueContainer = std::make_unique<HostFunctionWrapper>( std::make_shared<HostFunctionHandler>(std::make_shared<jsi::Function>(object.asFunction(rt)), rt)); </s> add valueContainer = std::make_unique<HostFunctionWrapper>( std::make_shared<HostFunctionHandler>( std::make_shared<jsi::Function>(object.asFunction(rt)), rt)); </s> remove valueContainer = std::make_unique<StringValueWrapper>(value.asString(rt).utf8(rt)); </s> add valueContainer = std::make_unique<StringValueWrapper>(value.asString(rt).utf8(rt));
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace replace keep keep keep keep keep
<mask> jsi::Object handlerAsObject = primalFunction.asObject(rt); <mask> std::shared_ptr<HostFunctionHandler> handler = handlerAsObject.getHostObject<HostFunctionHandler>(rt); <mask> valueContainer = std::make_unique<HostFunctionWrapper>(handler); <mask> } else { <mask> valueContainer = std::make_unique<HostFunctionWrapper>( <mask> std::make_shared<HostFunctionHandler>(std::make_shared<jsi::Function>(object.asFunction(rt)), rt)); <mask> } <mask> <mask> } else { <mask> // a worklet <mask> type = ValueType::WorkletFunctionType; </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove valueContainer = std::make_unique<HostFunctionWrapper>( std::make_shared<HostFunctionHandler>(std::make_shared<jsi::Function>(object.asFunction(rt)), rt)); </s> add valueContainer = std::make_unique<HostFunctionWrapper>( std::make_shared<HostFunctionHandler>( std::make_shared<jsi::Function>(object.asFunction(rt)), rt)); </s> remove jsi::Object handlerAsObject = primalFunction.asObject(rt); std::shared_ptr<HostFunctionHandler> handler = handlerAsObject.getHostObject<HostFunctionHandler>(rt); valueContainer = std::make_unique<HostFunctionWrapper>(handler); </s> add jsi::Object handlerAsObject = primalFunction.asObject(rt); std::shared_ptr<HostFunctionHandler> handler = handlerAsObject.getHostObject<HostFunctionHandler>(rt); valueContainer = std::make_unique<HostFunctionWrapper>(handler); </s> remove jsi::Object handlerAsObject = primalFunction.asObject(rt); std::shared_ptr<HostFunctionHandler> handler = handlerAsObject.getHostObject<HostFunctionHandler>(rt); valueContainer = std::make_unique<HostFunctionWrapper>(handler); </s> add jsi::Object handlerAsObject = primalFunction.asObject(rt); std::shared_ptr<HostFunctionHandler> handler = handlerAsObject.getHostObject<HostFunctionHandler>(rt); valueContainer = std::make_unique<HostFunctionWrapper>(handler); </s> remove //Check if it's a hostFunction wrapper </s> add // Check if it's a hostFunction wrapper </s> remove //Check if it's a hostFunction wrapper </s> add // Check if it's a hostFunction wrapper </s> remove valueContainer = std::make_unique<FrozenObjectWrapper>(std::make_shared<FrozenObject>(rt, object, runtimeManager)); auto& frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> add valueContainer = std::make_unique<FrozenObjectWrapper>( std::make_shared<FrozenObject>(rt, object, runtimeManager)); auto &frozenObject = ValueWrapper::asFrozenObject(valueContainer);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep replace replace keep replace replace keep keep keep
<mask> } else { <mask> // a worklet <mask> type = ValueType::WorkletFunctionType; <mask> valueContainer = std::make_unique<FrozenObjectWrapper>(std::make_shared<FrozenObject>(rt, object, runtimeManager)); <mask> auto& frozenObject = ValueWrapper::asFrozenObject(valueContainer); <mask> containsHostFunction |= frozenObject->containsHostFunction; <mask> if (isRNRuntime && !containsHostFunction) { <mask> addHiddenProperty(rt, createHost(rt, frozenObject), object, HIDDEN_HOST_OBJECT_PROP); <mask> } <mask> } <mask> } else if (object.isArray(rt)) { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove valueContainer = std::make_unique<FrozenObjectWrapper>(std::make_shared<FrozenObject>(rt, object, runtimeManager)); auto& frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> add valueContainer = std::make_unique<FrozenObjectWrapper>( std::make_shared<FrozenObject>(rt, object, runtimeManager)); auto &frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> remove if (isRNRuntime && !containsHostFunction) { addHiddenProperty(rt, createHost(rt, frozenObject), object, HIDDEN_HOST_OBJECT_PROP); </s> add if (RuntimeDecorator::isReactRuntime(rt) && !containsHostFunction) { addHiddenProperty( rt, createHost(rt, frozenObject), object, HIDDEN_HOST_OBJECT_PROP); </s> remove std::make_shared<FrozenObject>(rt, object, runtimeManager) ); auto& frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> add std::make_shared<FrozenObject>(rt, object, runtimeManager)); auto &frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> remove std::make_shared<FrozenObject>(rt, object, runtimeManager) ); auto& frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> add std::make_shared<FrozenObject>(rt, object, runtimeManager)); auto &frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> remove addHiddenProperty(rt, createHost(rt, frozenObject), object, HIDDEN_HOST_OBJECT_PROP); </s> add addHiddenProperty( rt, createHost(rt, frozenObject), object, HIDDEN_HOST_OBJECT_PROP);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> } else if (object.isArray(rt)) { <mask> type = ValueType::FrozenArrayType; <mask> auto array = object.asArray(rt); <mask> valueContainer = std::make_unique<FrozenArrayWrapper>(); <mask> auto& frozenArray = ValueWrapper::asFrozenArray(valueContainer); <mask> for (size_t i = 0, size = array.size(rt); i < size; i++) { <mask> auto sv = adapt(rt, array.getValueAtIndex(rt, i), runtimeManager); <mask> containsHostFunction |= sv->containsHostFunction; <mask> frozenArray.push_back(sv); <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove auto& frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> add auto &frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> remove for (size_t i = 0, size = array.size(rt); i < size; i++) { auto shareable = ShareableValue::adapt(rt, array.getValueAtIndex(rt, i), module); </s> add for (size_t i = 0, size = array.size(rt); i < size; i++) { auto shareable = ShareableValue::adapt(rt, array.getValueAtIndex(rt, i), module); </s> remove std::vector<std::shared_ptr<MutableValue>> extractMutablesFromArray(jsi::Runtime &rt, const jsi::Array &array, NativeReanimatedModule *module) { </s> add std::vector<std::shared_ptr<MutableValue>> extractMutablesFromArray( jsi::Runtime &rt, const jsi::Array &array, NativeReanimatedModule *module) { </s> remove auto& frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> add auto &frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> remove auto& frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> add auto &frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> remove if (isRNRuntime && !containsHostFunction) { addHiddenProperty(rt, createHost(rt, frozenObject), object, HIDDEN_HOST_OBJECT_PROP); </s> add if (RuntimeDecorator::isReactRuntime(rt) && !containsHostFunction) { addHiddenProperty( rt, createHost(rt, frozenObject), object, HIDDEN_HOST_OBJECT_PROP);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep replace keep keep keep keep replace replace keep keep keep
<mask> } else if (object.isHostObject<MutableValue>(rt)) { <mask> type = ValueType::MutableValueType; <mask> valueContainer = std::make_unique<MutableValueWrapper>(object.getHostObject<MutableValue>(rt)); <mask> adaptCache(rt, value); <mask> } else if (object.isHostObject<RemoteObject>(rt)) { <mask> type = ValueType::RemoteObjectType; <mask> valueContainer = std::make_unique<RemoteObjectWrapper>( <mask> object.getHostObject<RemoteObject>(rt) <mask> ); <mask> adaptCache(rt, value); <mask> } else if (objectType == ValueType::RemoteObjectType) { <mask> type = ValueType::RemoteObjectType; </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove object.getHostObject<RemoteObject>(rt) ); </s> add object.getHostObject<RemoteObject>(rt)); </s> remove valueContainer = std::make_unique<MutableValueWrapper>(object.getHostObject<MutableValue>(rt)); </s> add valueContainer = std::make_unique<MutableValueWrapper>( object.getHostObject<MutableValue>(rt)); </s> remove valueContainer = std::make_unique<RemoteObjectWrapper>( std::make_shared<RemoteObject>(rt, object, runtimeManager, runtimeManager->scheduler) ); </s> add valueContainer = std::make_unique<RemoteObjectWrapper>(std::make_shared<RemoteObject>( rt, object, runtimeManager, runtimeManager->scheduler)); </s> remove valueContainer = std::make_unique<RemoteObjectWrapper>( std::make_shared<RemoteObject>(rt, object, runtimeManager, runtimeManager->scheduler) ); </s> add valueContainer = std::make_unique<RemoteObjectWrapper>(std::make_shared<RemoteObject>( rt, object, runtimeManager, runtimeManager->scheduler)); </s> remove valueContainer = std::make_unique<MutableValueWrapper>( std::make_shared<MutableValue>(rt, value, runtimeManager, runtimeManager->scheduler) ); </s> add valueContainer = std::make_unique<MutableValueWrapper>(std::make_shared<MutableValue>( rt, value, runtimeManager, runtimeManager->scheduler));
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep replace replace replace keep keep keep keep replace replace replace keep keep
<mask> adaptCache(rt, value); <mask> } else if (objectType == ValueType::RemoteObjectType) { <mask> type = ValueType::RemoteObjectType; <mask> valueContainer = std::make_unique<RemoteObjectWrapper>( <mask> std::make_shared<RemoteObject>(rt, object, runtimeManager, runtimeManager->scheduler) <mask> ); <mask> } else { <mask> // create frozen object based on a copy of a given object <mask> type = ValueType::FrozenObjectType; <mask> valueContainer = std::make_unique<FrozenObjectWrapper>( <mask> std::make_shared<FrozenObject>(rt, object, runtimeManager) <mask> ); <mask> auto& frozenObject = ValueWrapper::asFrozenObject(valueContainer); <mask> containsHostFunction |= frozenObject->containsHostFunction; <mask> if (isRNRuntime) { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove valueContainer = std::make_unique<RemoteObjectWrapper>( std::make_shared<RemoteObject>(rt, object, runtimeManager, runtimeManager->scheduler) ); </s> add valueContainer = std::make_unique<RemoteObjectWrapper>(std::make_shared<RemoteObject>( rt, object, runtimeManager, runtimeManager->scheduler)); </s> remove std::make_shared<FrozenObject>(rt, object, runtimeManager) ); auto& frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> add std::make_shared<FrozenObject>(rt, object, runtimeManager)); auto &frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> remove object.getHostObject<RemoteObject>(rt) ); </s> add object.getHostObject<RemoteObject>(rt)); </s> remove object.getHostObject<RemoteObject>(rt) ); </s> add object.getHostObject<RemoteObject>(rt)); </s> remove valueContainer = std::make_unique<FrozenObjectWrapper>(std::make_shared<FrozenObject>(rt, object, runtimeManager)); auto& frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> add valueContainer = std::make_unique<FrozenObjectWrapper>( std::make_shared<FrozenObject>(rt, object, runtimeManager)); auto &frozenObject = ValueWrapper::asFrozenObject(valueContainer);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep replace keep replace keep keep
<mask> containsHostFunction |= frozenObject->containsHostFunction; <mask> if (isRNRuntime) { <mask> if (!containsHostFunction) { <mask> addHiddenProperty(rt, createHost(rt, frozenObject), object, HIDDEN_HOST_OBJECT_PROP); <mask> } <mask> freeze(rt, object); </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove addHiddenProperty(rt, createHost(rt, frozenObject), object, HIDDEN_HOST_OBJECT_PROP); </s> add addHiddenProperty( rt, createHost(rt, frozenObject), object, HIDDEN_HOST_OBJECT_PROP); </s> remove if (isRNRuntime) { </s> add if (RuntimeDecorator::isReactRuntime(rt)) { </s> remove std::make_shared<FrozenObject>(rt, object, runtimeManager) ); auto& frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> add std::make_shared<FrozenObject>(rt, object, runtimeManager)); auto &frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> remove std::make_shared<FrozenObject>(rt, object, runtimeManager) ); auto& frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> add std::make_shared<FrozenObject>(rt, object, runtimeManager)); auto &frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> remove if (isRNRuntime && !containsHostFunction) { addHiddenProperty(rt, createHost(rt, frozenObject), object, HIDDEN_HOST_OBJECT_PROP); </s> add if (RuntimeDecorator::isReactRuntime(rt) && !containsHostFunction) { addHiddenProperty( rt, createHost(rt, frozenObject), object, HIDDEN_HOST_OBJECT_PROP);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> } <mask> } else if (value.isSymbol()) { <mask> type = ValueType::StringType; <mask> valueContainer = std::make_unique<StringValueWrapper>(value.asSymbol(rt).toString(rt)); <mask> } else { <mask> throw "Invalid value type"; <mask> } <mask> } <mask> </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove valueContainer = std::make_unique<StringValueWrapper>(value.asSymbol(rt).toString(rt)); </s> add valueContainer = std::make_unique<StringValueWrapper>(value.asSymbol(rt).toString(rt)); </s> remove valueContainer = std::make_unique<StringValueWrapper>(value.asString(rt).utf8(rt)); </s> add valueContainer = std::make_unique<StringValueWrapper>(value.asString(rt).utf8(rt)); </s> remove valueContainer = std::make_unique<StringValueWrapper>(value.asString(rt).utf8(rt)); </s> add valueContainer = std::make_unique<StringValueWrapper>(value.asString(rt).utf8(rt)); </s> remove valueContainer = std::make_unique<MutableValueWrapper>(object.getHostObject<MutableValue>(rt)); </s> add valueContainer = std::make_unique<MutableValueWrapper>( object.getHostObject<MutableValue>(rt)); </s> remove valueContainer = std::make_unique<MutableValueWrapper>(object.getHostObject<MutableValue>(rt)); </s> add valueContainer = std::make_unique<MutableValueWrapper>( object.getHostObject<MutableValue>(rt)); </s> remove valueContainer = std::make_unique<MutableValueWrapper>( std::make_shared<MutableValue>(rt, value, runtimeManager, runtimeManager->scheduler) ); </s> add valueContainer = std::make_unique<MutableValueWrapper>(std::make_shared<MutableValue>( rt, value, runtimeManager, runtimeManager->scheduler));
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace replace keep keep keep keep keep
<mask> throw "Invalid value type"; <mask> } <mask> } <mask> <mask> std::shared_ptr<ShareableValue> ShareableValue::adapt(jsi::Runtime &rt, const jsi::Value &value, RuntimeManager *runtimeManager, ValueType valueType) { <mask> auto sv = std::shared_ptr<ShareableValue>(new ShareableValue(runtimeManager, runtimeManager->scheduler)); <mask> sv->adapt(rt, value, valueType); <mask> return sv; <mask> } <mask> <mask> jsi::Value ShareableValue::getValue(jsi::Runtime &rt) { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove std::shared_ptr<ShareableValue> ShareableValue::adapt(jsi::Runtime &rt, const jsi::Value &value, RuntimeManager *runtimeManager, ValueType valueType) { auto sv = std::shared_ptr<ShareableValue>(new ShareableValue(runtimeManager, runtimeManager->scheduler)); </s> add std::shared_ptr<ShareableValue> ShareableValue::adapt( jsi::Runtime &rt, const jsi::Value &value, RuntimeManager *runtimeManager, ValueType valueType) { auto sv = std::shared_ptr<ShareableValue>( new ShareableValue(runtimeManager, runtimeManager->scheduler)); </s> remove jsi::Runtime &rt, const jsi::Value &value, RuntimeManager *runtimeManager, ValueType objectType = ValueType::UndefinedType ); </s> add jsi::Runtime &rt, const jsi::Value &value, RuntimeManager *runtimeManager, ValueType objectType = ValueType::UndefinedType); </s> remove void ShareableValue::adapt(jsi::Runtime &rt, const jsi::Value &value, ValueType objectType) { bool isRNRuntime = RuntimeDecorator::isReactRuntime(rt); </s> add void ShareableValue::adapt( jsi::Runtime &rt, const jsi::Value &value, ValueType objectType) { </s> remove void ShareableValue::adapt(jsi::Runtime &rt, const jsi::Value &value, ValueType objectType) { bool isRNRuntime = RuntimeDecorator::isReactRuntime(rt); </s> add void ShareableValue::adapt( jsi::Runtime &rt, const jsi::Value &value, ValueType objectType) { </s> remove valueContainer = std::make_unique<StringValueWrapper>(value.asSymbol(rt).toString(rt)); </s> add valueContainer = std::make_unique<StringValueWrapper>(value.asSymbol(rt).toString(rt)); </s> remove valueContainer = std::make_unique<StringValueWrapper>(value.asSymbol(rt).toString(rt)); </s> add valueContainer = std::make_unique<StringValueWrapper>(value.asSymbol(rt).toString(rt));
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep replace replace keep replace replace keep keep keep keep
<mask> jsi::Value ShareableValue::getValue(jsi::Runtime &rt) { <mask> // TODO: maybe we can cache toJSValue results on a per-runtime basis, need to avoid ref loops <mask> if (RuntimeDecorator::isWorkletRuntime(rt)) { <mask> if (remoteValue.expired()) { <mask> auto ref = getWeakRef(rt); <mask> remoteValue = ref; <mask> } <mask> <mask> if (remoteValue.lock()->isUndefined()) { <mask> (*remoteValue.lock()) = jsi::Value(rt, toJSValue(rt)); </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove auto ref = getWeakRef(rt); remoteValue = ref; </s> add remoteValue = getWeakRef(rt); </s> remove // TODO: maybe we can cache toJSValue results on a per-runtime basis, need to avoid ref loops if (RuntimeDecorator::isWorkletRuntime(rt)) { </s> add // TODO: maybe we can cache toJSValue results on a per-runtime basis, need to // avoid ref loops if (&rt == runtimeManager->runtime.get()) { // Getting value on the same runtime where it was created, prepare // remoteValue </s> remove (*remoteValue.lock()) = jsi::Value(rt, toJSValue(rt)); </s> add (*remoteValue.lock()) = toJSValue(rt); </s> remove (*remoteValue.lock()) = jsi::Value(rt, toJSValue(rt)); </s> add (*remoteValue.lock()) = toJSValue(rt); </s> remove // when adapting from host object we can assign cached value immediately such that we avoid // running `toJSValue` in the future when given object is accessed </s> add // when adapting from host object we can assign cached value immediately such // that we avoid running `toJSValue` in the future when given object is // accessed
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> remoteValue = ref; <mask> } <mask> <mask> if (remoteValue.lock()->isUndefined()) { <mask> (*remoteValue.lock()) = jsi::Value(rt, toJSValue(rt)); <mask> } <mask> return jsi::Value(rt, *remoteValue.lock()); <mask> } else { <mask> if (hostValue.get() == nullptr) { <mask> hostValue = std::make_unique<jsi::Value>(rt, toJSValue(rt)); </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove (*remoteValue.lock()) = jsi::Value(rt, toJSValue(rt)); </s> add (*remoteValue.lock()) = toJSValue(rt); </s> remove hostValue = std::make_unique<jsi::Value>(rt, toJSValue(rt)); </s> add hostValue = std::make_unique<jsi::Value>(toJSValue(rt)); </s> remove hostValue = std::make_unique<jsi::Value>(rt, toJSValue(rt)); </s> add hostValue = std::make_unique<jsi::Value>(toJSValue(rt)); </s> add // Getting value on a different runtime than where it was created from, // prepare hostValue </s> remove auto ref = getWeakRef(rt); remoteValue = ref; </s> add remoteValue = getWeakRef(rt); </s> remove auto ref = getWeakRef(rt); remoteValue = ref; </s> add remoteValue = getWeakRef(rt);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep add keep keep keep keep keep keep
<mask> } <mask> return jsi::Value(rt, *remoteValue.lock()); <mask> } else { <mask> if (hostValue.get() == nullptr) { <mask> hostValue = std::make_unique<jsi::Value>(toJSValue(rt)); <mask> } <mask> return jsi::Value(rt, *hostValue); <mask> } <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove hostValue = std::make_unique<jsi::Value>(rt, toJSValue(rt)); </s> add hostValue = std::make_unique<jsi::Value>(toJSValue(rt)); </s> remove hostValue = std::make_unique<jsi::Value>(rt, toJSValue(rt)); </s> add hostValue = std::make_unique<jsi::Value>(toJSValue(rt)); </s> add // Getting value on a different runtime than where it was created from, // prepare hostValue </s> remove (*remoteValue.lock()) = jsi::Value(rt, toJSValue(rt)); </s> add (*remoteValue.lock()) = toJSValue(rt); </s> remove (*remoteValue.lock()) = jsi::Value(rt, toJSValue(rt)); </s> add (*remoteValue.lock()) = toJSValue(rt); </s> remove jsi::Value MutableValueSetterProxy::get(jsi::Runtime &rt, const jsi::PropNameID &name) { </s> add jsi::Value MutableValueSetterProxy::get( jsi::Runtime &rt, const jsi::PropNameID &name) {
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> return jsi::Value(rt, *remoteValue.lock()); <mask> } else { <mask> if (hostValue.get() == nullptr) { <mask> hostValue = std::make_unique<jsi::Value>(rt, toJSValue(rt)); <mask> } <mask> return jsi::Value(rt, *hostValue); <mask> } <mask> } <mask> </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove hostValue = std::make_unique<jsi::Value>(rt, toJSValue(rt)); </s> add hostValue = std::make_unique<jsi::Value>(toJSValue(rt)); </s> remove (*remoteValue.lock()) = jsi::Value(rt, toJSValue(rt)); </s> add (*remoteValue.lock()) = toJSValue(rt); </s> remove (*remoteValue.lock()) = jsi::Value(rt, toJSValue(rt)); </s> add (*remoteValue.lock()) = toJSValue(rt); </s> add // Getting value on a different runtime than where it was created from, // prepare hostValue </s> add // Getting value on a different runtime than where it was created from, // prepare hostValue </s> remove jsi::Value MutableValueSetterProxy::get(jsi::Runtime &rt, const jsi::PropNameID &name) { </s> add jsi::Value MutableValueSetterProxy::get( jsi::Runtime &rt, const jsi::PropNameID &name) {
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep replace keep keep keep replace replace keep keep keep keep
<mask> } <mask> } <mask> <mask> jsi::Object ShareableValue::createHost(jsi::Runtime &rt, std::shared_ptr<jsi::HostObject> host) { <mask> return jsi::Object::createFromHostObject(rt, host); <mask> } <mask> <mask> jsi::Value createFrozenWrapper(jsi::Runtime &rt, std::shared_ptr<FrozenObject> frozenObject) { <mask> jsi::Object __reanimatedHiddenHost = jsi::Object::createFromHostObject(rt, frozenObject); <mask> jsi::Object obj = frozenObject->shallowClone(rt); <mask> jsi::Object globalObject = rt.global().getPropertyAsObject(rt, "Object"); <mask> jsi::Function freeze = globalObject.getPropertyAsFunction(rt, "freeze"); <mask> if (!frozenObject->containsHostFunction) { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove jsi::Value createFrozenWrapper(jsi::Runtime &rt, std::shared_ptr<FrozenObject> frozenObject) { jsi::Object __reanimatedHiddenHost = jsi::Object::createFromHostObject(rt, frozenObject); </s> add jsi::Value createFrozenWrapper( jsi::Runtime &rt, std::shared_ptr<FrozenObject> frozenObject) { jsi::Object __reanimatedHiddenHost = jsi::Object::createFromHostObject(rt, frozenObject); </s> remove jsi::Object ShareableValue::createHost(jsi::Runtime &rt, std::shared_ptr<jsi::HostObject> host) { </s> add jsi::Object ShareableValue::createHost( jsi::Runtime &rt, std::shared_ptr<jsi::HostObject> host) { </s> remove addHiddenProperty(rt, std::move(__reanimatedHiddenHost), obj, HIDDEN_HOST_OBJECT_PROP); </s> add addHiddenProperty( rt, std::move(__reanimatedHiddenHost), obj, HIDDEN_HOST_OBJECT_PROP); </s> remove addHiddenProperty(rt, std::move(__reanimatedHiddenHost), obj, HIDDEN_HOST_OBJECT_PROP); </s> add addHiddenProperty( rt, std::move(__reanimatedHiddenHost), obj, HIDDEN_HOST_OBJECT_PROP); </s> remove void freeze(jsi::Runtime &rt, jsi::Object &obj) { </s> add void freeze(jsi::Runtime &rt, const jsi::Object &obj) {
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> jsi::Object obj = frozenObject->shallowClone(rt); <mask> jsi::Object globalObject = rt.global().getPropertyAsObject(rt, "Object"); <mask> jsi::Function freeze = globalObject.getPropertyAsFunction(rt, "freeze"); <mask> if (!frozenObject->containsHostFunction) { <mask> addHiddenProperty(rt, std::move(__reanimatedHiddenHost), obj, HIDDEN_HOST_OBJECT_PROP); <mask> addHiddenProperty(rt, true, obj, ALREADY_CONVERTED); <mask> } <mask> return freeze.call(rt, obj); <mask> } <mask> </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove addHiddenProperty(rt, std::move(__reanimatedHiddenHost), obj, HIDDEN_HOST_OBJECT_PROP); </s> add addHiddenProperty( rt, std::move(__reanimatedHiddenHost), obj, HIDDEN_HOST_OBJECT_PROP); </s> remove jsi::Value createFrozenWrapper(jsi::Runtime &rt, std::shared_ptr<FrozenObject> frozenObject) { jsi::Object __reanimatedHiddenHost = jsi::Object::createFromHostObject(rt, frozenObject); </s> add jsi::Value createFrozenWrapper( jsi::Runtime &rt, std::shared_ptr<FrozenObject> frozenObject) { jsi::Object __reanimatedHiddenHost = jsi::Object::createFromHostObject(rt, frozenObject); </s> remove jsi::Value createFrozenWrapper(jsi::Runtime &rt, std::shared_ptr<FrozenObject> frozenObject) { jsi::Object __reanimatedHiddenHost = jsi::Object::createFromHostObject(rt, frozenObject); </s> add jsi::Value createFrozenWrapper( jsi::Runtime &rt, std::shared_ptr<FrozenObject> frozenObject) { jsi::Object __reanimatedHiddenHost = jsi::Object::createFromHostObject(rt, frozenObject); </s> remove void freeze(jsi::Runtime &rt, jsi::Object &obj) { </s> add void freeze(jsi::Runtime &rt, const jsi::Object &obj) { </s> remove void freeze(jsi::Runtime &rt, jsi::Object &obj) { </s> add void freeze(jsi::Runtime &rt, const jsi::Object &obj) { </s> remove jsi::Function defineProperty = globalObject.getPropertyAsFunction(rt, "defineProperty"); </s> add jsi::Function defineProperty = globalObject.getPropertyAsFunction(rt, "defineProperty");
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep replace keep keep keep replace keep keep keep
<mask> return jsi::Value(ValueWrapper::asNumber(valueContainer)); <mask> case ValueType::StringType: { <mask> auto& stringValue = ValueWrapper::asString(valueContainer); <mask> return jsi::Value(rt, jsi::String::createFromUtf8(rt, stringValue)); <mask> } <mask> case ValueType::FrozenObjectType: { <mask> auto& frozenObject = ValueWrapper::asFrozenObject(valueContainer); <mask> return createFrozenWrapper(rt, frozenObject); <mask> } <mask> case ValueType::FrozenArrayType: { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove auto& stringValue = ValueWrapper::asString(valueContainer); </s> add auto &stringValue = ValueWrapper::asString(valueContainer); </s> remove auto& frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> add auto &frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> remove auto& frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> add auto &frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> remove auto& frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> add auto &frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> remove auto& mutableObject = ValueWrapper::asMutableValue(valueContainer); </s> add auto &mutableObject = ValueWrapper::asMutableValue(valueContainer);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> auto& frozenObject = ValueWrapper::asFrozenObject(valueContainer); <mask> return createFrozenWrapper(rt, frozenObject); <mask> } <mask> case ValueType::FrozenArrayType: { <mask> auto& frozenArray = ValueWrapper::asFrozenArray(valueContainer); <mask> jsi::Array array(rt, frozenArray.size()); <mask> for (size_t i = 0; i < frozenArray.size(); i++) { <mask> array.setValueAtIndex(rt, i, frozenArray[i]->toJSValue(rt)); <mask> } <mask> return array; </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove auto& frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> add auto &frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> remove auto& frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> add auto &frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> remove auto& frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> add auto &frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> remove auto& frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> add auto &frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> remove auto& frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> add auto &frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> remove auto& stringValue = ValueWrapper::asString(valueContainer); </s> add auto &stringValue = ValueWrapper::asString(valueContainer);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> return array; <mask> } <mask> case ValueType::RemoteObjectType: { <mask> auto& remoteObject = ValueWrapper::asRemoteObject(valueContainer); <mask> if (RuntimeDecorator::isWorkletRuntime(rt)) { <mask> remoteObject->maybeInitializeOnWorkletRuntime(rt); <mask> } <mask> return createHost(rt, remoteObject); <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove auto& remoteObject = ValueWrapper::asRemoteObject(valueContainer); </s> add auto &remoteObject = ValueWrapper::asRemoteObject(valueContainer); </s> remove auto& mutableObject = ValueWrapper::asMutableValue(valueContainer); </s> add auto &mutableObject = ValueWrapper::asMutableValue(valueContainer); </s> remove auto& mutableObject = ValueWrapper::asMutableValue(valueContainer); </s> add auto &mutableObject = ValueWrapper::asMutableValue(valueContainer); </s> remove auto& frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> add auto &frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> remove auto& frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> add auto &frozenArray = ValueWrapper::asFrozenArray(valueContainer); </s> remove auto& frozenObject = ValueWrapper::asFrozenObject(valueContainer); </s> add auto &frozenObject = ValueWrapper::asFrozenObject(valueContainer);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep replace keep keep keep replace replace keep keep
<mask> case ValueType::MutableValueType: { <mask> auto& mutableObject = ValueWrapper::asMutableValue(valueContainer); <mask> return createHost(rt, mutableObject); <mask> } <mask> case ValueType::HostFunctionType: { <mask> auto hostFunctionWrapper = ValueWrapper::asHostFunctionWrapper(valueContainer); <mask> auto& hostRuntime = hostFunctionWrapper->value->hostRuntime; <mask> if (hostRuntime == &rt) { <mask> // function is accessed from the same runtime it was crated, we just return same function obj </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove auto hostFunctionWrapper = ValueWrapper::asHostFunctionWrapper(valueContainer); auto& hostRuntime = hostFunctionWrapper->value->hostRuntime; </s> add auto hostFunctionWrapper = ValueWrapper::asHostFunctionWrapper(valueContainer); auto &hostRuntime = hostFunctionWrapper->value->hostRuntime; </s> remove // function is accessed from the same runtime it was crated, we just return same function obj return jsi::Value(rt, *hostFunctionWrapper->value->getPureFunction().get()); </s> add // function is accessed from the same runtime it was crated, we just // return same function obj return jsi::Value( rt, *hostFunctionWrapper->value->getPureFunction().get()); </s> remove // function is accessed from the same runtime it was crated, we just return same function obj return jsi::Value(rt, *hostFunctionWrapper->value->getPureFunction().get()); </s> add // function is accessed from the same runtime it was crated, we just // return same function obj return jsi::Value( rt, *hostFunctionWrapper->value->getPureFunction().get()); </s> remove auto& mutableObject = ValueWrapper::asMutableValue(valueContainer); </s> add auto &mutableObject = ValueWrapper::asMutableValue(valueContainer); </s> remove // function is accessed from a different runtime, we wrap function in host func that'd enqueue // call on an appropriate thread </s> add // function is accessed from a different runtime, we wrap function in // host func that'd enqueue call on an appropriate thread
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep replace replace keep replace replace keep
<mask> auto& hostRuntime = hostFunctionWrapper->value->hostRuntime; <mask> if (hostRuntime == &rt) { <mask> // function is accessed from the same runtime it was crated, we just return same function obj <mask> return jsi::Value(rt, *hostFunctionWrapper->value->getPureFunction().get()); <mask> } else { <mask> // function is accessed from a different runtime, we wrap function in host func that'd enqueue <mask> // call on an appropriate thread <mask> </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove // function is accessed from the same runtime it was crated, we just return same function obj return jsi::Value(rt, *hostFunctionWrapper->value->getPureFunction().get()); </s> add // function is accessed from the same runtime it was crated, we just // return same function obj return jsi::Value( rt, *hostFunctionWrapper->value->getPureFunction().get()); </s> remove // function is accessed from a different runtime, we wrap function in host func that'd enqueue // call on an appropriate thread </s> add // function is accessed from a different runtime, we wrap function in // host func that'd enqueue call on an appropriate thread </s> remove auto hostFunctionWrapper = ValueWrapper::asHostFunctionWrapper(valueContainer); auto& hostRuntime = hostFunctionWrapper->value->hostRuntime; </s> add auto hostFunctionWrapper = ValueWrapper::asHostFunctionWrapper(valueContainer); auto &hostRuntime = hostFunctionWrapper->value->hostRuntime; </s> remove auto hostFunctionWrapper = ValueWrapper::asHostFunctionWrapper(valueContainer); auto& hostRuntime = hostFunctionWrapper->value->hostRuntime; </s> add auto hostFunctionWrapper = ValueWrapper::asHostFunctionWrapper(valueContainer); auto &hostRuntime = hostFunctionWrapper->value->hostRuntime; </s> remove // when adapting from host object we can assign cached value immediately such that we avoid // running `toJSValue` in the future when given object is accessed </s> add // when adapting from host object we can assign cached value immediately such // that we avoid running `toJSValue` in the future when given object is // accessed
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep replace replace replace replace replace replace keep replace keep keep keep keep
<mask> <mask> auto warnFunction = [runtimeManager, hostFunction]( <mask> jsi::Runtime &rt, <mask> const jsi::Value &thisValue, <mask> const jsi::Value *args, <mask> size_t count <mask> ) -> jsi::Value { <mask> <mask> jsi::Value jsThis = rt.global().getProperty(rt, "jsThis"); <mask> std::string workletLocation = jsThis.asObject(rt).getProperty(rt, "__location").toString(rt).utf8(rt); <mask> std::string exceptionMessage = "Tried to synchronously call "; <mask> if(hostFunction->functionName.empty()) { <mask> exceptionMessage += "anonymous function"; <mask> } else { </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count ) -> jsi::Value { </s> add jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) -> jsi::Value { </s> remove std::string workletLocation = jsThis.asObject(rt).getProperty(rt, "__location").toString(rt).utf8(rt); </s> add std::string workletLocation = jsThis.asObject(rt) .getProperty(rt, "__location") .toString(rt) .utf8(rt); </s> remove if(hostFunction->functionName.empty()) { </s> add if (hostFunction->functionName.empty()) { </s> remove if(hostFunction->functionName.empty()) { </s> add if (hostFunction->functionName.empty()) { </s> remove size_t count ) -> jsi::Value { </s> add size_t count) -> jsi::Value {
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep replace keep keep keep keep replace keep keep keep keep
<mask> std::string workletLocation = jsThis.asObject(rt).getProperty(rt, "__location").toString(rt).utf8(rt); <mask> std::string exceptionMessage = "Tried to synchronously call "; <mask> if(hostFunction->functionName.empty()) { <mask> exceptionMessage += "anonymous function"; <mask> } else { <mask> exceptionMessage += "function {" + hostFunction->functionName + "}"; <mask> } <mask> exceptionMessage += " from a different thread.\n\nOccurred in worklet location: "; <mask> exceptionMessage += workletLocation; <mask> exceptionMessage += CALLBACK_ERROR_SUFFIX; <mask> runtimeManager->errorHandler->setError(exceptionMessage); <mask> runtimeManager->errorHandler->raise(); </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove exceptionMessage += " from a different thread.\n\nOccurred in worklet location: "; </s> add exceptionMessage += " from a different thread.\n\nOccurred in worklet location: "; </s> remove if(hostFunction->functionName.empty()) { </s> add if (hostFunction->functionName.empty()) { </s> remove std::string workletLocation = jsThis.asObject(rt).getProperty(rt, "__location").toString(rt).utf8(rt); </s> add std::string workletLocation = jsThis.asObject(rt) .getProperty(rt, "__location") .toString(rt) .utf8(rt); </s> remove std::string workletLocation = jsThis.asObject(rt).getProperty(rt, "__location").toString(rt).utf8(rt); </s> add std::string workletLocation = jsThis.asObject(rt) .getProperty(rt, "__location") .toString(rt) .utf8(rt); </s> remove jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count ) -> jsi::Value { </s> add jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) -> jsi::Value {
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace replace replace replace replace replace replace keep keep keep replace keep
<mask> return jsi::Value::undefined(); <mask> }; <mask> <mask> auto clb = [runtimeManager, hostFunction, hostRuntime]( <mask> jsi::Runtime &rt, <mask> const jsi::Value &thisValue, <mask> const jsi::Value *args, <mask> size_t count <mask> ) -> jsi::Value { <mask> // TODO: we should find thread based on runtime such that we could also call UI methods <mask> // from RN and not only RN methods from UI <mask> <mask> std::vector<std::shared_ptr<ShareableValue>> params; <mask> for (int i = 0; i < count; ++i) { <mask> params.push_back(ShareableValue::adapt(rt, args[i], runtimeManager)); <mask> } </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count ) -> jsi::Value { // TODO: we should find thread based on runtime such that we could also call UI methods // from RN and not only RN methods from UI </s> add jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) -> jsi::Value { // TODO: we should find thread based on runtime such that we could // also call UI methods from RN and not only RN methods from UI </s> remove auto clb = [=]( jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count ) -> jsi::Value { // TODO: we should find thread based on runtime such that we could also call UI methods // from RN and not only RN methods from UI </s> add auto clb = [=](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) -> jsi::Value { // TODO: we should find thread based on runtime such that we could // also call UI methods from RN and not only RN methods from UI </s> remove params.push_back(ShareableValue::adapt(rt, args[i], runtimeManager)); </s> add params.push_back( ShareableValue::adapt(rt, args[i], runtimeManager)); </s> remove params.push_back(ShareableValue::adapt(rt, args[i], runtimeManager)); </s> add params.push_back( ShareableValue::adapt(rt, args[i], runtimeManager)); </s> remove jsi::Value * args = new jsi::Value[params.size()]; </s> add jsi::Value *args = new jsi::Value[params.size()];
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep replace keep keep keep replace replace replace
<mask> } <mask> <mask> std::function<void()> job = [hostFunction, hostRuntime, params] { <mask> jsi::Value * args = new jsi::Value[params.size()]; <mask> for (int i = 0; i < params.size(); ++i) { <mask> args[i] = params[i]->getValue(*hostRuntime); <mask> } <mask> jsi::Value returnedValue = hostFunction->getPureFunction().get()->call(*hostRuntime, <mask> static_cast<const jsi::Value*>(args), <mask> (size_t)params.size()); </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove jsi::Value * args = new jsi::Value[params.size()]; </s> add jsi::Value *args = new jsi::Value[params.size()]; </s> remove jsi::Value returnedValue = hostFunction->getPureFunction().get()->call(*hostRuntime, static_cast<const jsi::Value*>(args), (size_t)params.size()); </s> add jsi::Value returnedValue = hostFunction->getPureFunction().get()->call( *hostRuntime, static_cast<const jsi::Value *>(args), static_cast<size_t>(params.size())); </s> remove params.push_back(ShareableValue::adapt(rt, args[i], runtimeManager)); </s> add params.push_back( ShareableValue::adapt(rt, args[i], runtimeManager)); </s> remove params.push_back(ShareableValue::adapt(rt, args[i], runtimeManager)); </s> add params.push_back( ShareableValue::adapt(rt, args[i], runtimeManager)); </s> remove jsi::Value * args = new jsi::Value[params.size()]; </s> add jsi::Value *args = new jsi::Value[params.size()];
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> jsi::Value returnedValue = hostFunction->getPureFunction().get()->call(*hostRuntime, <mask> static_cast<const jsi::Value*>(args), <mask> (size_t)params.size()); <mask> <mask> delete [] args; <mask> // ToDo use returned value to return promise <mask> }; <mask> <mask> runtimeManager->scheduler->scheduleOnJS(job); <mask> return jsi::Value::undefined(); </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove delete [] args; </s> add delete[] args; </s> remove jsi::Value returnedValue = hostFunction->getPureFunction().get()->call(*hostRuntime, static_cast<const jsi::Value*>(args), (size_t)params.size()); </s> add jsi::Value returnedValue = hostFunction->getPureFunction().get()->call( *hostRuntime, static_cast<const jsi::Value *>(args), static_cast<size_t>(params.size())); </s> remove jsi::Value returnedValue = hostFunction->getPureFunction().get()->call(*hostRuntime, static_cast<const jsi::Value*>(args), (size_t)params.size()); </s> add jsi::Value returnedValue = hostFunction->getPureFunction().get()->call( *hostRuntime, static_cast<const jsi::Value *>(args), static_cast<size_t>(params.size())); </s> remove delete [] args; </s> add delete[] args; </s> remove rt.global().setProperty(rt, "jsThis", oldJSThis); //clean jsThis </s> add global.setProperty(rt, jsThisName, oldJSThis); // clean jsThis </s> remove return jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, "_workletFunction"), 0, clb); </s> add return jsi::Function::createFromHostFunction( rt, jsi::PropNameID::forAscii(rt, "_workletFunction"), 0, clb);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep replace replace keep replace replace
<mask> return jsi::Value::undefined(); <mask> }; <mask> jsi::Function wrapperFunction = jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, "hostFunction"), 0, warnFunction); <mask> jsi::Function res = jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, "hostFunction"), 0, clb); <mask> addHiddenProperty(rt, std::move(res), wrapperFunction, CALL_ASYNC); <mask> jsi::Object functionHandler = createHost(rt, hostFunctionWrapper->value); <mask> addHiddenProperty(rt, std::move(functionHandler), wrapperFunction, PRIMAL_FUNCTION); </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove jsi::Function wrapperFunction = jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, "hostFunction"), 0, warnFunction); jsi::Function res = jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, "hostFunction"), 0, clb); </s> add jsi::Function wrapperFunction = jsi::Function::createFromHostFunction( rt, jsi::PropNameID::forAscii(rt, "hostFunction"), 0, warnFunction); jsi::Function res = jsi::Function::createFromHostFunction( rt, jsi::PropNameID::forAscii(rt, "hostFunction"), 0, clb); </s> remove jsi::Object functionHandler = createHost(rt, hostFunctionWrapper->value); addHiddenProperty(rt, std::move(functionHandler), wrapperFunction, PRIMAL_FUNCTION); </s> add jsi::Object functionHandler = createHost(rt, hostFunctionWrapper->value); addHiddenProperty( rt, std::move(functionHandler), wrapperFunction, PRIMAL_FUNCTION); </s> remove return jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, "_workletFunction"), 0, clb); </s> add return jsi::Function::createFromHostFunction( rt, jsi::PropNameID::forAscii(rt, "_workletFunction"), 0, clb); </s> remove jsi::Function __reanimatedWorkletInit = jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, "__reanimatedWorkletInit"), 1, dummyFunction); dummyGlobal.setProperty(rt, "__reanimatedWorkletInit", __reanimatedWorkletInit); </s> add jsi::Function __reanimatedWorkletInit = jsi::Function::createFromHostFunction( rt, jsi::PropNameID::forAscii(rt, "__reanimatedWorkletInit"), 1, dummyFunction); dummyGlobal.setProperty( rt, "__reanimatedWorkletInit", __reanimatedWorkletInit); </s> remove return jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, name.c_str()), 0, clb); </s> add return jsi::Function::createFromHostFunction( rt, jsi::PropNameID::forAscii(rt, name.c_str()), 0, clb);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep keep replace keep keep keep replace replace keep keep keep keep
<mask> } <mask> } <mask> case ValueType::WorkletFunctionType: { <mask> auto runtimeManager = this->runtimeManager; <mask> auto& frozenObject = ValueWrapper::asFrozenObject(this->valueContainer); <mask> if (RuntimeDecorator::isWorkletRuntime(rt)) { <mask> // when running on worklet thread we prep a function <mask> <mask> auto jsThis = std::make_shared<jsi::Object>(frozenObject->shallowClone(*runtimeManager->runtime)); <mask> std::shared_ptr<jsi::Function> funPtr(runtimeManager->workletsCache->getFunction(rt, frozenObject)); <mask> auto name = funPtr->getProperty(rt, "name").asString(rt).utf8(rt); <mask> <mask> auto clb = [=]( <mask> jsi::Runtime &rt, </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove auto& frozenObject = ValueWrapper::asFrozenObject(this->valueContainer); </s> add auto &frozenObject = ValueWrapper::asFrozenObject(this->valueContainer); </s> remove auto jsThis = std::make_shared<jsi::Object>(frozenObject->shallowClone(*runtimeManager->runtime)); std::shared_ptr<jsi::Function> funPtr(runtimeManager->workletsCache->getFunction(rt, frozenObject)); </s> add auto jsThis = std::make_shared<jsi::Object>( frozenObject->shallowClone(*runtimeManager->runtime)); std::shared_ptr<jsi::Function> funPtr( runtimeManager->workletsCache->getFunction(rt, frozenObject)); </s> remove auto clb = [=]( jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count ) mutable -> jsi::Value { jsi::Value oldJSThis = rt.global().getProperty(rt, "jsThis"); rt.global().setProperty(rt, "jsThis", *jsThis); //set jsThis jsi::Value res = jsi::Value::undefined(); try { if (thisValue.isObject()) { res = funPtr->callWithThis(rt, thisValue.asObject(rt), args, count); } else { res = funPtr->call(rt, args, count); } } catch(jsi::JSError &e) { throw e; } catch(...) { // TODO find out a way to get the error's message on hermes jsi::Value location = jsThis->getProperty(rt, "__location"); std::string str = "Javascript worklet error"; if (location.isString()) { str += "\nIn file: " + location.asString(rt).utf8(rt); } runtimeManager->errorHandler->setError(str); runtimeManager->errorHandler->raise(); </s> add auto clb = [=](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) mutable -> jsi::Value { const jsi::String jsThisName = jsi::String::createFromAscii(rt, "jsThis"); jsi::Object global = rt.global(); jsi::Value oldJSThis = global.getProperty(rt, jsThisName); global.setProperty(rt, jsThisName, *jsThis); // set jsThis jsi::Value res = jsi::Value::undefined(); try { if (thisValue.isObject()) { res = funPtr->callWithThis(rt, thisValue.asObject(rt), args, count); } else { res = funPtr->call(rt, args, count); </s> remove auto clb = [=]( jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count ) mutable -> jsi::Value { jsi::Value oldJSThis = rt.global().getProperty(rt, "jsThis"); rt.global().setProperty(rt, "jsThis", *jsThis); //set jsThis jsi::Value res = jsi::Value::undefined(); try { if (thisValue.isObject()) { res = funPtr->callWithThis(rt, thisValue.asObject(rt), args, count); } else { res = funPtr->call(rt, args, count); } } catch(jsi::JSError &e) { throw e; } catch(...) { // TODO find out a way to get the error's message on hermes jsi::Value location = jsThis->getProperty(rt, "__location"); std::string str = "Javascript worklet error"; if (location.isString()) { str += "\nIn file: " + location.asString(rt).utf8(rt); } runtimeManager->errorHandler->setError(str); runtimeManager->errorHandler->raise(); </s> add auto clb = [=](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) mutable -> jsi::Value { const jsi::String jsThisName = jsi::String::createFromAscii(rt, "jsThis"); jsi::Object global = rt.global(); jsi::Value oldJSThis = global.getProperty(rt, jsThisName); global.setProperty(rt, jsThisName, *jsThis); // set jsThis jsi::Value res = jsi::Value::undefined(); try { if (thisValue.isObject()) { res = funPtr->callWithThis(rt, thisValue.asObject(rt), args, count); } else { res = funPtr->call(rt, args, count); </s> remove // function is accessed from a different runtime, we wrap function in host func that'd enqueue // call on an appropriate thread </s> add // function is accessed from a different runtime, we wrap function in // host func that'd enqueue call on an appropriate thread
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep replace replace replace keep keep keep keep
<mask> std::shared_ptr<jsi::Function> funPtr(runtimeManager->workletsCache->getFunction(rt, frozenObject)); <mask> auto name = funPtr->getProperty(rt, "name").asString(rt).utf8(rt); <mask> <mask> auto clb = [=]( <mask> jsi::Runtime &rt, <mask> const jsi::Value &thisValue, <mask> const jsi::Value *args, <mask> size_t count <mask> ) mutable -> jsi::Value { <mask> jsi::Value oldJSThis = rt.global().getProperty(rt, "jsThis"); <mask> rt.global().setProperty(rt, "jsThis", *jsThis); //set jsThis <mask> <mask> jsi::Value res = jsi::Value::undefined(); <mask> try { <mask> if (thisValue.isObject()) { <mask> res = funPtr->callWithThis(rt, thisValue.asObject(rt), args, count); <mask> } else { <mask> res = funPtr->call(rt, args, count); <mask> } <mask> } catch(jsi::JSError &e) { <mask> throw e; <mask> } catch(...) { <mask> // TODO find out a way to get the error's message on hermes <mask> jsi::Value location = jsThis->getProperty(rt, "__location"); <mask> std::string str = "Javascript worklet error"; <mask> if (location.isString()) { <mask> str += "\nIn file: " + location.asString(rt).utf8(rt); <mask> } <mask> runtimeManager->errorHandler->setError(str); <mask> runtimeManager->errorHandler->raise(); <mask> } <mask> <mask> rt.global().setProperty(rt, "jsThis", oldJSThis); //clean jsThis <mask> return res; <mask> }; <mask> return jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, name.c_str()), 0, clb); <mask> } else { <mask> // when run outside of UI thread we enqueue a call on the UI thread </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove auto clb = [=]( jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count ) mutable -> jsi::Value { jsi::Value oldJSThis = rt.global().getProperty(rt, "jsThis"); rt.global().setProperty(rt, "jsThis", *jsThis); //set jsThis jsi::Value res = jsi::Value::undefined(); try { if (thisValue.isObject()) { res = funPtr->callWithThis(rt, thisValue.asObject(rt), args, count); } else { res = funPtr->call(rt, args, count); } } catch(jsi::JSError &e) { throw e; } catch(...) { // TODO find out a way to get the error's message on hermes jsi::Value location = jsThis->getProperty(rt, "__location"); std::string str = "Javascript worklet error"; if (location.isString()) { str += "\nIn file: " + location.asString(rt).utf8(rt); } runtimeManager->errorHandler->setError(str); runtimeManager->errorHandler->raise(); </s> add auto clb = [=](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) mutable -> jsi::Value { const jsi::String jsThisName = jsi::String::createFromAscii(rt, "jsThis"); jsi::Object global = rt.global(); jsi::Value oldJSThis = global.getProperty(rt, jsThisName); global.setProperty(rt, jsThisName, *jsThis); // set jsThis jsi::Value res = jsi::Value::undefined(); try { if (thisValue.isObject()) { res = funPtr->callWithThis(rt, thisValue.asObject(rt), args, count); } else { res = funPtr->call(rt, args, count); </s> remove rt.global().setProperty(rt, "jsThis", oldJSThis); //clean jsThis return res; </s> add } catch (jsi::JSError &e) { throw e; } catch (...) { if (demangleExceptionName( abi::__cxa_current_exception_type()->name()) == "facebook::jsi::JSError") { throw jsi::JSError(rt, "Javascript worklet error"); } // TODO find out a way to get the error's message on hermes jsi::Value location = jsThis->getProperty(rt, "__location"); std::string str = "Javascript worklet error"; if (location.isString()) { str += "\nIn file: " + location.asString(rt).utf8(rt); } runtimeManager->errorHandler->setError(str); runtimeManager->errorHandler->raise(); } global.setProperty(rt, jsThisName, oldJSThis); // clean jsThis return res; </s> remove } catch(...) { </s> add } catch (...) { if (demangleExceptionName( abi::__cxa_current_exception_type()->name()) == "facebook::jsi::JSError") { throw jsi::JSError(rt, "Javascript worklet error"); } </s> remove returnedValue = funPtr->call(rt, static_cast<const jsi::Value*>(args), (size_t)params.size()); } catch(std::exception &e) { </s> add returnedValue = funPtr->call( rt, static_cast<const jsi::Value *>(args), static_cast<size_t>(params.size())); } catch (std::exception &e) { </s> remove return jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, name.c_str()), 0, clb); </s> add return jsi::Function::createFromHostFunction( rt, jsi::PropNameID::forAscii(rt, name.c_str()), 0, clb);
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp
keep keep replace keep keep replace replace replace replace replace replace replace replace keep
<mask> return res; <mask> }; <mask> return jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, name.c_str()), 0, clb); <mask> } else { <mask> // when run outside of UI thread we enqueue a call on the UI thread <mask> auto clb = [=]( <mask> jsi::Runtime &rt, <mask> const jsi::Value &thisValue, <mask> const jsi::Value *args, <mask> size_t count <mask> ) -> jsi::Value { <mask> // TODO: we should find thread based on runtime such that we could also call UI methods <mask> // from RN and not only RN methods from UI <mask> </s> [android][ios] Upgrade react-native-reanimated to 2.3.0 (#15475) </s> remove jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count ) -> jsi::Value { // TODO: we should find thread based on runtime such that we could also call UI methods // from RN and not only RN methods from UI </s> add jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) -> jsi::Value { // TODO: we should find thread based on runtime such that we could // also call UI methods from RN and not only RN methods from UI </s> remove jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count ) -> jsi::Value { // TODO: we should find thread based on runtime such that we could also call UI methods // from RN and not only RN methods from UI </s> add jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) -> jsi::Value { // TODO: we should find thread based on runtime such that we could // also call UI methods from RN and not only RN methods from UI </s> remove return jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, name.c_str()), 0, clb); </s> add return jsi::Function::createFromHostFunction( rt, jsi::PropNameID::forAscii(rt, name.c_str()), 0, clb); </s> remove rt.global().setProperty(rt, "jsThis", oldJSThis); //clean jsThis return res; </s> add } catch (jsi::JSError &e) { throw e; } catch (...) { if (demangleExceptionName( abi::__cxa_current_exception_type()->name()) == "facebook::jsi::JSError") { throw jsi::JSError(rt, "Javascript worklet error"); } // TODO find out a way to get the error's message on hermes jsi::Value location = jsThis->getProperty(rt, "__location"); std::string str = "Javascript worklet error"; if (location.isString()) { str += "\nIn file: " + location.asString(rt).utf8(rt); } runtimeManager->errorHandler->setError(str); runtimeManager->errorHandler->raise(); } global.setProperty(rt, jsThisName, oldJSThis); // clean jsThis return res; </s> remove rt.global().setProperty(rt, "jsThis", oldJSThis); //clean jsThis return res; </s> add } catch (jsi::JSError &e) { throw e; } catch (...) { if (demangleExceptionName( abi::__cxa_current_exception_type()->name()) == "facebook::jsi::JSError") { throw jsi::JSError(rt, "Javascript worklet error"); } // TODO find out a way to get the error's message on hermes jsi::Value location = jsThis->getProperty(rt, "__location"); std::string str = "Javascript worklet error"; if (location.isString()) { str += "\nIn file: " + location.asString(rt).utf8(rt); } runtimeManager->errorHandler->setError(str); runtimeManager->errorHandler->raise(); } global.setProperty(rt, jsThisName, oldJSThis); // clean jsThis return res;
https://github.com/expo/expo/commit/c7e4709da8f56cdd1d001e7557a61255a15e62ef
android/expoview/src/main/Common/cpp/SharedItems/ShareableValue.cpp