@react-native-ohos/react-native-reanimated 4.0.0-rc.1 → 4.0.1

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.
@@ -1,17 +1,17 @@
1
- /**
2
- * Use these variables when you tailor your ArkTS code. They must be of the const type.
3
- */
4
- export const HAR_VERSION = '4.3.0-rc.1';
5
- export const BUILD_MODE_NAME = 'debug';
6
- export const DEBUG = true;
7
- export const TARGET_NAME = 'default';
8
-
9
- /**
10
- * BuildProfile Class is used only for compatibility purposes.
11
- */
12
- export default class BuildProfile {
13
- static readonly HAR_VERSION = HAR_VERSION;
14
- static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
15
- static readonly DEBUG = DEBUG;
16
- static readonly TARGET_NAME = TARGET_NAME;
1
+ /**
2
+ * Use these variables when you tailor your ArkTS code. They must be of the const type.
3
+ */
4
+ export const HAR_VERSION = '4.0.1';
5
+ export const BUILD_MODE_NAME = 'debug';
6
+ export const DEBUG = true;
7
+ export const TARGET_NAME = 'default';
8
+
9
+ /**
10
+ * BuildProfile Class is used only for compatibility purposes.
11
+ */
12
+ export default class BuildProfile {
13
+ static readonly HAR_VERSION = HAR_VERSION;
14
+ static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
15
+ static readonly DEBUG = DEBUG;
16
+ static readonly TARGET_NAME = TARGET_NAME;
17
17
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  name: '@react-native-ohos/react-native-reanimated',
3
- version: '4.0.0-rc.1',
3
+ version: '4.0.1',
4
4
  description: "",
5
5
  type: 'module',
6
6
  main: 'index.ets',
@@ -1,5 +1,6 @@
1
1
  #include <reanimated/CSS/common/values/CSSAngle.h>
2
2
 
3
+ #include <sstream>
3
4
  #include <iomanip>
4
5
  #include <regex>
5
6
  #include <string>
@@ -2,6 +2,7 @@
2
2
 
3
3
  #include <reanimated/CSS/common/values/CSSKeyword.h>
4
4
 
5
+ #include <sstream>
5
6
  #include <string>
6
7
  #include <vector>
7
8
  #include <worklets/Tools/JSISerializer.h>
@@ -1,5 +1,6 @@
1
1
  #include <reanimated/CSS/svg/values/SVGStrokeDashArray.h>
2
2
 
3
+ #include <sstream>
3
4
  #include <string>
4
5
  #include <vector>
5
6
 
@@ -190,6 +190,10 @@ void ReanimatedModuleProxy::init(const PlatformDepMethodsHolder &platformDepMeth
190
190
  }
191
191
 
192
192
  ReanimatedModuleProxy::~ReanimatedModuleProxy() {
193
+ invalidate();
194
+ }
195
+
196
+ void ReanimatedModuleProxy::invalidate() {
193
197
  // event handler registry and frame callbacks store some JSI values from UI
194
198
  // runtime, so they have to go away before we tear down the runtime
195
199
  eventHandlerRegistry_.reset();
@@ -62,6 +62,8 @@ class ReanimatedModuleProxy : public ReanimatedModuleProxySpec,
62
62
 
63
63
  ~ReanimatedModuleProxy() override;
64
64
 
65
+ void invalidate();
66
+
65
67
  jsi::Value registerEventHandler(
66
68
  jsi::Runtime &rt,
67
69
  const jsi::Value &worklet,
@@ -44,6 +44,9 @@ ReanimatedModule::~ReanimatedModule() {
44
44
  if (keyboardEventDataUpdater_) {
45
45
  keyboardEventDataUpdater_ = nullptr;
46
46
  }
47
+ if (auto nativeReanimatedModule = weakNativeReanimatedModule_.lock()) {
48
+ nativeReanimatedModule->invalidate();
49
+ }
47
50
  }
48
51
 
49
52
  void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt) {
Binary file
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "alias": "react-native-reanimated",
5
5
  "redirectInternalImports": true
6
6
  },
7
- "version": "4.0.0-rc.1",
7
+ "version": "4.0.1",
8
8
  "description": "",
9
9
  "main": "lib/index.js",
10
10
  "scripts": {
@@ -24,7 +24,8 @@
24
24
  "license": "ISC",
25
25
  "dependencies": {
26
26
  "@types/node": "^24.0.14",
27
- "react-native-reanimated": "4.2.1"
27
+ "react-native-reanimated": "4.2.1",
28
+ "semver": "7.7.3"
28
29
  },
29
30
  "devDependencies": {
30
31
  "@babel/core": "7.28.4",
@@ -8,6 +8,7 @@ const compatibilityFile = require('../compatibility.json');
8
8
 
9
9
  const architecture = 'fabric';
10
10
 
11
+ const HARMONY_WORKLET_LIBNAME = "@react-native-ohos/react-native-worklets";
11
12
  /**
12
13
  * @param {string} reanimatedVersion
13
14
  * @returns {{ ok: boolean; message?: string }}
@@ -15,8 +16,12 @@ const architecture = 'fabric';
15
16
  function validateVersion(reanimatedVersion) {
16
17
  let workletsVersion;
17
18
  try {
18
- const { version } = require('react-native-worklets/package.json');
19
- workletsVersion = version;
19
+ const { version, name , dependencies } = require('react-native-worklets/package.json');
20
+ if (name === HARMONY_WORKLET_LIBNAME && dependencies) {
21
+ workletsVersion = dependencies['react-native-worklets'];
22
+ } else{
23
+ workletsVersion = version;
24
+ }
20
25
  } catch (_e) {
21
26
  return {
22
27
  ok: false,