@react-native-ohos/react-native-reanimated 3.18.1-rc.5 → 3.18.2-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.OpenSource +10 -10
- package/README.md +10 -10
- package/harmony/reanimated/BuildProfile.ets +16 -16
- package/harmony/reanimated/build-profile.json5 +11 -11
- package/harmony/reanimated/oh-package.json5 +11 -11
- package/harmony/reanimated/src/main/cpp/CMakeLists.txt +1 -1
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.cpp +86 -86
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h +47 -47
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.cpp +68 -68
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.h +68 -68
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +101 -101
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +51 -51
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitShadowNode.h +49 -49
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp +96 -87
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h +33 -33
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.cpp +95 -95
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.h +29 -29
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationType.h +9 -9
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.cpp +232 -232
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h +90 -90
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.cpp +870 -870
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +147 -147
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.cpp +91 -91
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +176 -176
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +971 -971
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +252 -252
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.cpp +231 -231
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.h +109 -109
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.cpp +56 -56
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.h +20 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.cpp +70 -70
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.h +35 -35
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/CollectionUtils.h +14 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.cpp +5 -5
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.h +19 -19
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/PlatformDepMethodsHolder.h +98 -98
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedSystraceSection.h +135 -135
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +47 -47
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +59 -59
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.cpp +27 -27
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.h +25 -25
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.cpp +94 -94
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.h +49 -49
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.cpp +8 -8
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.h +39 -39
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.cpp +326 -326
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.h +345 -345
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.cpp +52 -52
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.h +35 -35
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/Defs.h +10 -10
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.cpp +342 -342
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.h +47 -47
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.cpp +16 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.h +20 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.cpp +20 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.h +29 -29
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/PlatformLogger.h +16 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.cpp +26 -26
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.h +199 -199
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedVersion.cpp +95 -95
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedVersion.h +19 -19
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/SingleInstanceChecker.h +72 -72
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ThreadSafeQueue.h +49 -49
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.cpp +20 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.h +22 -22
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.cpp +29 -29
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.h +41 -41
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +16 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h +19 -19
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp +112 -112
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.h +127 -127
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.cpp +53 -53
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.h +22 -22
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RuntimeInitialization.md +191 -191
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp +173 -155
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +90 -90
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeCollector.h +36 -36
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp +189 -182
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.h +22 -22
- package/harmony/reanimated/src/main/cpp/WorkletsModule.cpp +60 -60
- package/harmony/reanimated/src/main/cpp/patches/AnimatedSensor/AnimatedSensorModule.cpp +89 -89
- package/harmony/reanimated/src/main/ets/ReanimatedModule.ts +7 -0
- package/harmony/reanimated/src/main/module.json5 +12 -12
- package/harmony/reanimated/src/main/resources/base/element/color.json +7 -7
- package/harmony/reanimated/src/main/resources/base/element/string.json +15 -15
- package/harmony/reanimated/src/main/resources/base/profile/main_pages.json +5 -5
- package/harmony/reanimated/src/main/resources/en_US/element/string.json +15 -15
- package/harmony/reanimated/src/main/resources/zh_CN/element/string.json +15 -15
- package/harmony/reanimated/ts.ts +6 -6
- package/harmony/reanimated.har +0 -0
- package/package.json +50 -50
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
#include <worklets/Tools/AsyncQueue.h>
|
|
2
|
-
|
|
3
|
-
#include <utility>
|
|
4
|
-
|
|
5
|
-
namespace worklets {
|
|
6
|
-
|
|
7
|
-
AsyncQueue::AsyncQueue(std::string name)
|
|
8
|
-
: state_(std::make_shared<AsyncQueueState>()) {
|
|
9
|
-
auto thread = std::thread([name, state = state_] {
|
|
10
|
-
#if __APPLE__
|
|
11
|
-
pthread_setname_np(name.c_str());
|
|
12
|
-
#endif
|
|
13
|
-
while (state->running) {
|
|
14
|
-
std::unique_lock<std::mutex> lock(state->mutex);
|
|
15
|
-
state->cv.wait(
|
|
16
|
-
lock, [state] { return !state->queue.empty() || !state->running; });
|
|
17
|
-
if (!state->running) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
if (state->queue.empty()) {
|
|
21
|
-
continue;
|
|
22
|
-
}
|
|
23
|
-
auto job = std::move(state->queue.front());
|
|
24
|
-
state->queue.pop();
|
|
25
|
-
lock.unlock();
|
|
26
|
-
job();
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
#ifdef ANDROID
|
|
30
|
-
pthread_setname_np(thread.native_handle(), name.c_str());
|
|
31
|
-
#endif
|
|
32
|
-
thread.detach();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
AsyncQueue::~AsyncQueue() {
|
|
36
|
-
{
|
|
37
|
-
std::unique_lock<std::mutex> lock(state_->mutex);
|
|
38
|
-
state_->running = false;
|
|
39
|
-
state_->queue = {};
|
|
40
|
-
}
|
|
41
|
-
state_->cv.notify_all();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
void AsyncQueue::push(std::function<void()> &&job) {
|
|
45
|
-
{
|
|
46
|
-
std::unique_lock<std::mutex> lock(state_->mutex);
|
|
47
|
-
state_->queue.emplace(job);
|
|
48
|
-
}
|
|
49
|
-
state_->cv.notify_one();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
} // namespace worklets
|
|
1
|
+
#include <worklets/Tools/AsyncQueue.h>
|
|
2
|
+
|
|
3
|
+
#include <utility>
|
|
4
|
+
|
|
5
|
+
namespace worklets {
|
|
6
|
+
|
|
7
|
+
AsyncQueue::AsyncQueue(std::string name)
|
|
8
|
+
: state_(std::make_shared<AsyncQueueState>()) {
|
|
9
|
+
auto thread = std::thread([name, state = state_] {
|
|
10
|
+
#if __APPLE__
|
|
11
|
+
pthread_setname_np(name.c_str());
|
|
12
|
+
#endif
|
|
13
|
+
while (state->running) {
|
|
14
|
+
std::unique_lock<std::mutex> lock(state->mutex);
|
|
15
|
+
state->cv.wait(
|
|
16
|
+
lock, [state] { return !state->queue.empty() || !state->running; });
|
|
17
|
+
if (!state->running) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (state->queue.empty()) {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
auto job = std::move(state->queue.front());
|
|
24
|
+
state->queue.pop();
|
|
25
|
+
lock.unlock();
|
|
26
|
+
job();
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
#ifdef ANDROID
|
|
30
|
+
pthread_setname_np(thread.native_handle(), name.c_str());
|
|
31
|
+
#endif
|
|
32
|
+
thread.detach();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
AsyncQueue::~AsyncQueue() {
|
|
36
|
+
{
|
|
37
|
+
std::unique_lock<std::mutex> lock(state_->mutex);
|
|
38
|
+
state_->running = false;
|
|
39
|
+
state_->queue = {};
|
|
40
|
+
}
|
|
41
|
+
state_->cv.notify_all();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
void AsyncQueue::push(std::function<void()> &&job) {
|
|
45
|
+
{
|
|
46
|
+
std::unique_lock<std::mutex> lock(state_->mutex);
|
|
47
|
+
state_->queue.emplace(job);
|
|
48
|
+
}
|
|
49
|
+
state_->cv.notify_one();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
} // namespace worklets
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <jsi/jsi.h>
|
|
4
|
-
|
|
5
|
-
#include <atomic>
|
|
6
|
-
#include <condition_variable>
|
|
7
|
-
#include <memory>
|
|
8
|
-
#include <queue>
|
|
9
|
-
#include <string>
|
|
10
|
-
#include <thread>
|
|
11
|
-
#include <utility>
|
|
12
|
-
#include <vector>
|
|
13
|
-
|
|
14
|
-
namespace worklets {
|
|
15
|
-
|
|
16
|
-
struct AsyncQueueState {
|
|
17
|
-
std::atomic_bool running{true};
|
|
18
|
-
std::mutex mutex;
|
|
19
|
-
std::condition_variable cv;
|
|
20
|
-
std::queue<std::function<void()>> queue;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
class AsyncQueue {
|
|
24
|
-
public:
|
|
25
|
-
explicit AsyncQueue(std::string name);
|
|
26
|
-
|
|
27
|
-
~AsyncQueue();
|
|
28
|
-
|
|
29
|
-
void push(std::function<void()> &&job);
|
|
30
|
-
|
|
31
|
-
private:
|
|
32
|
-
const std::shared_ptr<AsyncQueueState> state_;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
} // namespace worklets
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <jsi/jsi.h>
|
|
4
|
+
|
|
5
|
+
#include <atomic>
|
|
6
|
+
#include <condition_variable>
|
|
7
|
+
#include <memory>
|
|
8
|
+
#include <queue>
|
|
9
|
+
#include <string>
|
|
10
|
+
#include <thread>
|
|
11
|
+
#include <utility>
|
|
12
|
+
#include <vector>
|
|
13
|
+
|
|
14
|
+
namespace worklets {
|
|
15
|
+
|
|
16
|
+
struct AsyncQueueState {
|
|
17
|
+
std::atomic_bool running{true};
|
|
18
|
+
std::mutex mutex;
|
|
19
|
+
std::condition_variable cv;
|
|
20
|
+
std::queue<std::function<void()>> queue;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
class AsyncQueue {
|
|
24
|
+
public:
|
|
25
|
+
explicit AsyncQueue(std::string name);
|
|
26
|
+
|
|
27
|
+
~AsyncQueue();
|
|
28
|
+
|
|
29
|
+
void push(std::function<void()> &&job);
|
|
30
|
+
|
|
31
|
+
private:
|
|
32
|
+
const std::shared_ptr<AsyncQueueState> state_;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
} // namespace worklets
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
On Android JS_RUNTIME_HERMES is set in CMakeList.txt,
|
|
5
|
-
but on iOS there is no simple way to defect if Hermes exists
|
|
6
|
-
so we have to check if headers are available.
|
|
7
|
-
*/
|
|
8
|
-
#if __APPLE__ && __has_include(<hermes/hermes.h>)
|
|
9
|
-
#define JS_RUNTIME_HERMES 1
|
|
10
|
-
#endif
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
On Android JS_RUNTIME_HERMES is set in CMakeList.txt,
|
|
5
|
+
but on iOS there is no simple way to defect if Hermes exists
|
|
6
|
+
so we have to check if headers are available.
|
|
7
|
+
*/
|
|
8
|
+
#if __APPLE__ && __has_include(<hermes/hermes.h>)
|
|
9
|
+
#define JS_RUNTIME_HERMES 1
|
|
10
|
+
#endif
|