@react-native-ohos/react-native-reanimated 3.18.1-rc.2 → 3.18.1-rc.4
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.
|
@@ -28,6 +28,9 @@ jsi::Value installTurboModule(facebook::jsi::Runtime &rt, react::TurboModule &tu
|
|
|
28
28
|
const facebook::jsi::Value *args, size_t count)
|
|
29
29
|
{
|
|
30
30
|
auto self = static_cast<ReanimatedModule *>(&turboModule);
|
|
31
|
+
if (self == nullptr) {
|
|
32
|
+
return facebook::jsi::Value::undefined();
|
|
33
|
+
}
|
|
31
34
|
self->installTurboModule(rt);
|
|
32
35
|
return facebook::jsi::Value(true);
|
|
33
36
|
}
|
|
@@ -162,7 +165,25 @@ void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt)
|
|
|
162
165
|
}
|
|
163
166
|
return instance->getTurboModule<WorkletsModule>("WorkletsModule");
|
|
164
167
|
};
|
|
165
|
-
auto
|
|
168
|
+
auto workletsModulePtr = workletsModule();
|
|
169
|
+
if (!workletsModulePtr) {
|
|
170
|
+
LOG(ERROR) << "ReanimatedModule: Failed to get WorkletsModule";
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
auto workletsModuleProxy = workletsModulePtr->getWorkletsModuleProxy();
|
|
174
|
+
if (!workletsModuleProxy) {
|
|
175
|
+
LOG(ERROR) << "ReanimatedModule: WorkletsModuleProxy is null, WorkletsModule may not be initialized yet";
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (!jsInvoker_) {
|
|
179
|
+
LOG(ERROR) << "ReanimatedModule: jsInvoker_ is null";
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (!m_ctx.scheduler) {
|
|
183
|
+
LOG(ERROR) << "ReanimatedModule: m_ctx.scheduler is null";
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
auto nativeReanimatedModule = std::make_shared<ReanimatedModuleProxy>(workletsModuleProxy,
|
|
166
187
|
rt, jsInvoker_, platformDepMethodsHolder, isBridgeless, isReducedMotion);
|
|
167
188
|
weakNativeReanimatedModule_ = nativeReanimatedModule;
|
|
168
189
|
nativeReanimatedModule->init(platformDepMethodsHolder);
|
|
@@ -203,11 +224,24 @@ void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt)
|
|
|
203
224
|
}
|
|
204
225
|
return nativeReanimatedModule->handleRawEvent(rawEvent, frameTime);
|
|
205
226
|
});
|
|
206
|
-
m_ctx.scheduler
|
|
227
|
+
if (m_ctx.scheduler) {
|
|
228
|
+
m_ctx.scheduler->addEventListener(eventListener);
|
|
229
|
+
} else {
|
|
230
|
+
LOG(ERROR) << "ReanimatedModule: Cannot add event listener, scheduler is null";
|
|
231
|
+
}
|
|
207
232
|
}
|
|
233
|
+
|
|
208
234
|
void ReanimatedModule::injectDependencies(facebook::jsi::Runtime & /* rt */)
|
|
209
235
|
{
|
|
236
|
+
if (!m_ctx.scheduler) {
|
|
237
|
+
LOG(ERROR) << "ReanimatedModule::injectDependencies: scheduler is null";
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
210
240
|
const auto uiManager = m_ctx.scheduler->getUIManager();
|
|
241
|
+
if (!uiManager) {
|
|
242
|
+
LOG(WARNING) << "ReanimatedModule::injectDependencies: uiManager is null";
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
211
245
|
if (auto nativeReanimatedModule = weakNativeReanimatedModule_.lock()) {
|
|
212
246
|
nativeReanimatedModule->initializeFabric(uiManager);
|
|
213
247
|
}
|
|
@@ -24,6 +24,9 @@ jsi::Value installTurboModule(facebook::jsi::Runtime &rt, react::TurboModule &tu
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
std::string valueUnpackerCode = args[0].getString(rt).utf8(rt);
|
|
27
|
+
if (self == nullptr) {
|
|
28
|
+
return facebook::jsi::Value::undefined();
|
|
29
|
+
}
|
|
27
30
|
self->installTurboModule(rt, valueUnpackerCode);
|
|
28
31
|
return facebook::jsi::Value(true);
|
|
29
32
|
}
|
package/harmony/reanimated.har
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -4,14 +4,15 @@
|
|
|
4
4
|
"alias": "react-native-reanimated",
|
|
5
5
|
"redirectInternalImports": true
|
|
6
6
|
},
|
|
7
|
-
"
|
|
7
|
+
"react-native-harmony": { "oh-package-name": "react_native_ohos_reanimated" },
|
|
8
|
+
"version": "3.18.1-rc.4",
|
|
8
9
|
"description": "",
|
|
9
10
|
"main": "lib/index.js",
|
|
10
11
|
"scripts": {
|
|
11
12
|
"build": "tsc",
|
|
12
13
|
"pack:prod": "npm pack",
|
|
13
14
|
"prepack": "npm run build",
|
|
14
|
-
"prepublishOnly": "npm run prepack ",
|
|
15
|
+
"prepublishOnly": "npm run prepack && react-native verify-package-harmony --package-path . --skip-checks oh_package_name_is_derived_from_npm_package_name",
|
|
15
16
|
"update_version": "node ./scripts/update-version.js",
|
|
16
17
|
"deploy": "node ./scripts/deploy.js"
|
|
17
18
|
},
|