Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions apps/fabric-example/ios/FabricExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
};
1232BDDFC9DE5BCE2776187D /* [CP-User] Generate metadata for clangd */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
alwaysOutOfDate = true;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -573,7 +573,10 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
OTHER_LDFLAGS = "$(inherited) ";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
Expand Down Expand Up @@ -646,7 +649,10 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
OTHER_LDFLAGS = "$(inherited) ";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
Expand Down
2 changes: 1 addition & 1 deletion apps/fabric-example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2229,7 +2229,7 @@ SPEC CHECKSUMS:
RNScreens: d0854539b51a53e38b61bcc9fb402439a9c73b26
RNSVG: 7e38044415125a1d108294377de261d2fe2c54c9
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: dd05f79b1943c96893294ee5040576aa6e8a8d82
Yoga: 0c8754b0ea9edb13b6ce6b60f0f69eb5f164f16a

PODFILE CHECKSUM: 4a9e0af2552a3fcd2303b56ad75e373f8bae65b9

Expand Down
2 changes: 1 addition & 1 deletion apps/macos-example/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1868,7 +1868,7 @@ SPEC CHECKSUMS:
RNReanimated: ed490424d3b8b9f2acd104577c73b374fc79310b
RNSVG: 669ed128ab9005090c612a0d627dbecb6ab5c76f
SocketRocket: 9ee265c4b5ae2382d18e4ee1d2dd2d7af0ff1ab5
Yoga: 209f62622a01344dbb9fa8d348610eaeb7df2cca
Yoga: 446e6f351a519539ff00a1159fe41e589aab1b94

PODFILE CHECKSUM: 8d50cc2acc9f6a6b1a12bd9106b86385ad72266f

Expand Down
2 changes: 1 addition & 1 deletion apps/paper-example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2060,7 +2060,7 @@ SPEC CHECKSUMS:
RNScreens: 81237378a6d7921fb2dbb6a6c6c45c3d8cc696bb
RNSVG: 515a902fc18a375907eb4c3abec0b803fbfa37ef
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: dd05f79b1943c96893294ee5040576aa6e8a8d82
Yoga: 0c8754b0ea9edb13b6ce6b60f0f69eb5f164f16a

PODFILE CHECKSUM: f6c84e0ec8eddea6d3ee15329987727bd1e6ff08

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
};
EC2A315BF2310B4CCE81E020 /* [CP-User] Generate metadata for clangd */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
alwaysOutOfDate = true;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -579,7 +579,10 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
OTHER_LDFLAGS = "$(inherited) ";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
Expand Down Expand Up @@ -652,7 +655,10 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
OTHER_LDFLAGS = "$(inherited) ";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
Expand Down
2 changes: 1 addition & 1 deletion apps/tvos-example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1888,7 +1888,7 @@ SPEC CHECKSUMS:
ReactCommon: b927fd46115bd2acb146e24cf1a08f22abda8b3f
RNReanimated: 3a5e1e235c940894097b0734aad9ebce45431ddd
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: 2b0e5affb9ab46e4ebad33530df829c153c323d8
Yoga: 651e5fd560c7e408ab9d9ca44b8de1b622d7f0cc

PODFILE CHECKSUM: 79e1477a8eb76b717bdd7c1610f7f8e6772536a9

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jsi::Value AnimatedSensorModule::registerSensor(
return;
}

jsi::Runtime &uiRuntime = uiWorkletRuntime->getJSIRuntime();
jsi::Runtime &uiRuntime = *uiWorkletRuntime->getJSIRuntime();
jsi::Object value(uiRuntime);
if (sensorType == SensorType::ROTATION_VECTOR) {
// TODO: timestamp should be provided by the platform implementation
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#include <reanimated/NativeModules/DummyReanimatedModuleProxy.h>
#include <reanimated/RuntimeDecorators/UIRuntimeDecorator.h>
#include <reanimated/Tools/CollectionUtils.h>
#include <reanimated/Tools/FeaturesConfig.h>
#include <reanimated/Tools/ReanimatedSystraceSection.h>
#include <unordered_map>

#ifdef RCT_NEW_ARCH_ENABLED
#include <reanimated/Fabric/ReanimatedCommitShadowNode.h>
#include <reanimated/Fabric/ShadowTreeCloner.h>
#endif // RCT_NEW_ARCH_ENABLED

#include <worklets/Registries/EventHandlerRegistry.h>
#include <worklets/SharedItems/Shareables.h>
#include <worklets/Tools/AsyncQueue.h>
#include <worklets/Tools/WorkletEventHandler.h>

#ifdef __ANDROID__
#include <fbjni/fbjni.h>
#endif // __ANDROID__

#ifdef RCT_NEW_ARCH_ENABLED
#include <react/renderer/scheduler/Scheduler.h>
#include <react/renderer/uimanager/UIManagerBinding.h>
#include <react/renderer/uimanager/primitives.h>
#endif // RCT_NEW_ARCH_ENABLED

using namespace facebook;

namespace reanimated {

DummyReanimatedModuleProxy::DummyReanimatedModuleProxy(
jsi::Runtime &rnRuntime,
const std::shared_ptr<CallInvoker> &jsCallInvoker,
const bool isBridgeless,
const bool isReducedMotion)
: ReanimatedModuleProxySpec(jsCallInvoker),
isBridgeless_(isBridgeless),
isReducedMotion_(isReducedMotion) {}

jsi::Value DummyReanimatedModuleProxy::registerEventHandler(
jsi::Runtime &rt,
const jsi::Value &worklet,
const jsi::Value &eventName,
const jsi::Value &emitterReactTag) {
return jsi::Value(static_cast<double>(0));
}

void DummyReanimatedModuleProxy::unregisterEventHandler(
jsi::Runtime &rt,
const jsi::Value &registrationId) {}

jsi::Value DummyReanimatedModuleProxy::getViewProp(
jsi::Runtime &rnRuntime,
const jsi::Value &viewTag,
const jsi::Value &propName,
const jsi::Value &callback) {
return jsi::Value::undefined();
}

jsi::Value DummyReanimatedModuleProxy::enableLayoutAnimations(
jsi::Runtime &rt,
const jsi::Value &config) {
return jsi::Value::undefined();
}

jsi::Value DummyReanimatedModuleProxy::configureProps(
jsi::Runtime &rt,
const jsi::Value &uiProps,
const jsi::Value &nativeProps) {
return jsi::Value::undefined();
}

jsi::Value DummyReanimatedModuleProxy::configureLayoutAnimationBatch(
jsi::Runtime &rt,
const jsi::Value &layoutAnimationsBatch) {
return jsi::Value::undefined();
}

void DummyReanimatedModuleProxy::setShouldAnimateExiting(
jsi::Runtime &rt,
const jsi::Value &viewTag,
const jsi::Value &shouldAnimate) {}

jsi::Value DummyReanimatedModuleProxy::registerSensor(
jsi::Runtime &rt,
const jsi::Value &sensorType,
const jsi::Value &interval,
const jsi::Value &iosReferenceFrame,
const jsi::Value &sensorDataContainer) {
return jsi::Value(static_cast<double>(0));
}

void DummyReanimatedModuleProxy::unregisterSensor(
jsi::Runtime &rt,
const jsi::Value &sensorId) {}

jsi::Value DummyReanimatedModuleProxy::subscribeForKeyboardEvents(
jsi::Runtime &rt,
const jsi::Value &handlerWorklet,
const jsi::Value &isStatusBarTranslucent,
const jsi::Value &isNavigationBarTranslucent) {
return jsi::Value(static_cast<double>(0));
}

void DummyReanimatedModuleProxy::unsubscribeFromKeyboardEvents(
jsi::Runtime &rt,
const jsi::Value &listenerId) {}

} // namespace reanimated
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
#pragma once

#include <reanimated/AnimatedSensor/AnimatedSensorModule.h>
#include <reanimated/LayoutAnimations/LayoutAnimationsManager.h>
#include <reanimated/NativeModules/ReanimatedModuleProxySpec.h>
#include <reanimated/Tools/PlatformDepMethodsHolder.h>

#ifdef RCT_NEW_ARCH_ENABLED
#include <reanimated/Fabric/PropsRegistry.h>
#include <reanimated/Fabric/ReanimatedCommitHook.h>
#include <reanimated/Fabric/ReanimatedMountHook.h>
#include <reanimated/LayoutAnimations/LayoutAnimationsProxy.h>
#endif // RCT_NEW_ARCH_ENABLED

#include <worklets/NativeModules/WorkletsModuleProxy.h>
#include <worklets/Registries/EventHandlerRegistry.h>
#include <worklets/Tools/JSScheduler.h>
#include <worklets/Tools/SingleInstanceChecker.h>
#include <worklets/Tools/UIScheduler.h>

#ifdef RCT_NEW_ARCH_ENABLED
#include <react/renderer/uimanager/UIManager.h>
#endif // RCT_NEW_ARCH_ENABLED

#include <memory>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>

namespace reanimated {

class DummyReanimatedModuleProxy : public ReanimatedModuleProxySpec {
public:
DummyReanimatedModuleProxy(
jsi::Runtime &rnRuntime,
const std::shared_ptr<CallInvoker> &jsCallInvoker,
const bool isBridgeless,
const bool isReducedMotion);

jsi::Value registerEventHandler(
jsi::Runtime &rt,
const jsi::Value &worklet,
const jsi::Value &eventName,
const jsi::Value &emitterReactTag) override;
void unregisterEventHandler(
jsi::Runtime &rt,
const jsi::Value &registrationId) override;

jsi::Value getViewProp(
jsi::Runtime &rt,
#ifdef RCT_NEW_ARCH_ENABLED
const jsi::Value &shadowNodeWrapper,
#else
const jsi::Value &viewTag,
#endif
const jsi::Value &propName,
const jsi::Value &callback) override;

jsi::Value enableLayoutAnimations(jsi::Runtime &rt, const jsi::Value &config)
override;
jsi::Value configureProps(
jsi::Runtime &rt,
const jsi::Value &uiProps,
const jsi::Value &nativeProps) override;
jsi::Value configureLayoutAnimationBatch(
jsi::Runtime &rt,
const jsi::Value &layoutAnimationsBatch) override;
void setShouldAnimateExiting(
jsi::Runtime &rt,
const jsi::Value &viewTag,
const jsi::Value &shouldAnimate) override;

jsi::Value registerSensor(
jsi::Runtime &rt,
const jsi::Value &sensorType,
const jsi::Value &interval,
const jsi::Value &iosReferenceFrame,
const jsi::Value &sensorDataContainer) override;
void unregisterSensor(jsi::Runtime &rt, const jsi::Value &sensorId) override;

void cleanupSensors();

jsi::Value subscribeForKeyboardEvents(
jsi::Runtime &rt,
const jsi::Value &keyboardEventContainer,
const jsi::Value &isStatusBarTranslucent,
const jsi::Value &isNavigationBarTranslucent) override;
void unsubscribeFromKeyboardEvents(
jsi::Runtime &rt,
const jsi::Value &listenerId) override;

[[nodiscard]] inline bool isBridgeless() const {
return isBridgeless_;
}

[[nodiscard]] inline bool isReducedMotion() const {
return isReducedMotion_;
}

inline std::shared_ptr<JSLogger> getJSLogger() const {
return nullptr;
}

private:
const bool isBridgeless_;
const bool isReducedMotion_;

#ifndef NDEBUG
worklets::SingleInstanceChecker<DummyReanimatedModuleProxy>
singleInstanceChecker_;
#endif // NDEBUG
};

} // namespace reanimated
Loading
Loading