react-native-worklets 0.7.0-nightly-20251023-c7ff5827d → 0.7.0-nightly-20251025-b84ce2052

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,3 +1,9 @@
1
1
  #include <worklets/WorkletRuntime/RuntimeData.h>
2
2
 
3
+ namespace worklets {
4
+ namespace RuntimeData {
5
+
3
6
  const std::string uiRuntimeName{"UI"};
7
+
8
+ } // namespace RuntimeData
9
+ } // namespace worklets
@@ -2,9 +2,15 @@
2
2
 
3
3
  #include <string>
4
4
 
5
+ namespace worklets {
6
+ namespace RuntimeData {
7
+
5
8
  /**
6
9
  * Unused, but kept for possible future use.
7
10
  */
8
11
  constexpr uint64_t rnRuntimeId{0};
9
12
  constexpr uint64_t uiRuntimeId{1};
10
13
  extern const std::string uiRuntimeName;
14
+
15
+ }; // namespace RuntimeData
16
+ } // namespace worklets
@@ -13,15 +13,6 @@ std::shared_ptr<WorkletRuntime> RuntimeManager::getRuntime(uint64_t runtimeId) {
13
13
  return nullptr;
14
14
  }
15
15
 
16
- std::shared_ptr<WorkletRuntime> RuntimeManager::getRuntime(
17
- const std::string &name) {
18
- std::shared_lock lock(weakRuntimesMutex_);
19
- if (nameToRuntimeId_.contains(name)) {
20
- return getRuntime(nameToRuntimeId_.at(name));
21
- }
22
- return nullptr;
23
- }
24
-
25
16
  #ifdef WORKLETS_BUNDLE_MODE
26
17
  std::shared_ptr<WorkletRuntime> RuntimeManager::getRuntime(
27
18
  jsi::Runtime *runtime) {
@@ -49,7 +40,7 @@ std::vector<std::shared_ptr<WorkletRuntime>> RuntimeManager::getAllRuntimes() {
49
40
  }
50
41
 
51
42
  std::shared_ptr<WorkletRuntime> RuntimeManager::getUIRuntime() {
52
- return getRuntime(uiRuntimeId);
43
+ return getRuntime(RuntimeData::uiRuntimeId);
53
44
  }
54
45
 
55
46
  std::shared_ptr<WorkletRuntime> RuntimeManager::createWorkletRuntime(
@@ -70,7 +61,7 @@ std::shared_ptr<WorkletRuntime> RuntimeManager::createWorkletRuntime(
70
61
  workletRuntime->runGuarded(initializer);
71
62
  }
72
63
 
73
- registerRuntime(runtimeId, name, workletRuntime);
64
+ registerRuntime(runtimeId, workletRuntime);
74
65
 
75
66
  return workletRuntime;
76
67
  }
@@ -79,9 +70,13 @@ std::shared_ptr<WorkletRuntime> RuntimeManager::createUninitializedUIRuntime(
79
70
  const std::shared_ptr<MessageQueueThread> &jsQueue,
80
71
  const std::shared_ptr<AsyncQueue> &uiAsyncQueue) {
81
72
  const auto uiRuntime = std::make_shared<WorkletRuntime>(
82
- uiRuntimeId, jsQueue, uiRuntimeName, uiAsyncQueue);
73
+ RuntimeData::uiRuntimeId,
74
+ jsQueue,
75
+ RuntimeData::uiRuntimeName,
76
+ uiAsyncQueue,
77
+ /*enableEventLoop*/ false);
83
78
 
84
- registerRuntime(uiRuntimeId, uiRuntimeName, uiRuntime);
79
+ registerRuntime(RuntimeData::uiRuntimeId, uiRuntime);
85
80
 
86
81
  return uiRuntime;
87
82
  }
@@ -92,11 +87,9 @@ uint64_t RuntimeManager::getNextRuntimeId() {
92
87
 
93
88
  void RuntimeManager::registerRuntime(
94
89
  const uint64_t runtimeId,
95
- const std::string &name,
96
90
  const std::shared_ptr<WorkletRuntime> &workletRuntime) {
97
91
  std::unique_lock lock(weakRuntimesMutex_);
98
92
  weakRuntimes_[runtimeId] = workletRuntime;
99
- nameToRuntimeId_[name] = runtimeId;
100
93
  #ifdef WORKLETS_BUNDLE_MODE
101
94
  runtimeAddressToRuntimeId_[&workletRuntime->getJSIRuntime()] = runtimeId;
102
95
  #endif // WORKLETS_BUNDLE_MODE
@@ -23,7 +23,6 @@ class JSIWorkletsModuleProxy;
23
23
  class RuntimeManager {
24
24
  public:
25
25
  std::shared_ptr<WorkletRuntime> getRuntime(uint64_t runtimeId);
26
- std::shared_ptr<WorkletRuntime> getRuntime(const std::string &name);
27
26
  #ifdef WORKLETS_BUNDLE_MODE
28
27
  std::shared_ptr<WorkletRuntime> getRuntime(jsi::Runtime *runtime);
29
28
  #endif // WORKLETS_BUNDLE_MODE
@@ -48,13 +47,11 @@ class RuntimeManager {
48
47
 
49
48
  void registerRuntime(
50
49
  const uint64_t runtimeId,
51
- const std::string &name,
52
50
  const std::shared_ptr<WorkletRuntime> &workletRuntime);
53
51
 
54
- std::atomic_uint64_t nextRuntimeId_{uiRuntimeId + 1};
52
+ std::atomic_uint64_t nextRuntimeId_{RuntimeData::uiRuntimeId + 1};
55
53
  std::map<uint64_t, std::weak_ptr<WorkletRuntime>> weakRuntimes_;
56
54
  std::shared_mutex weakRuntimesMutex_;
57
- std::map<std::string, uint64_t> nameToRuntimeId_;
58
55
  #ifdef WORKLETS_BUNDLE_MODE
59
56
  std::map<jsi::Runtime *, uint64_t> runtimeAddressToRuntimeId_;
60
57
  #endif // WORKLETS_BUNDLE_MODE
@@ -81,7 +81,7 @@ WorkletRuntime::WorkletRuntime(
81
81
  queue_(queue) {
82
82
  jsi::Runtime &rt = *runtime_;
83
83
  WorkletRuntimeCollector::install(rt);
84
- if (enableEventLoop && name != uiRuntimeName) {
84
+ if (enableEventLoop) {
85
85
  eventLoop_ = std::make_shared<EventLoop>(name_, runtime_, queue_);
86
86
  eventLoop_->run();
87
87
  }
@@ -5,5 +5,5 @@
5
5
  * version used to build the native part of the library in runtime. Remember to
6
6
  * keep this in sync with the version declared in `package.json`
7
7
  */
8
- export const jsVersion = '0.7.0-nightly-20251023-c7ff5827d';
8
+ export const jsVersion = '0.7.0-nightly-20251025-b84ce2052';
9
9
  //# sourceMappingURL=jsVersion.js.map
@@ -3,5 +3,5 @@
3
3
  * version used to build the native part of the library in runtime. Remember to
4
4
  * keep this in sync with the version declared in `package.json`
5
5
  */
6
- export declare const jsVersion = "0.7.0-nightly-20251023-c7ff5827d";
6
+ export declare const jsVersion = "0.7.0-nightly-20251025-b84ce2052";
7
7
  //# sourceMappingURL=jsVersion.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-worklets",
3
- "version": "0.7.0-nightly-20251023-c7ff5827d",
3
+ "version": "0.7.0-nightly-20251025-b84ce2052",
4
4
  "description": "The React Native multithreading library",
5
5
  "keywords": [
6
6
  "react-native",
@@ -4,4 +4,4 @@
4
4
  * version used to build the native part of the library in runtime. Remember to
5
5
  * keep this in sync with the version declared in `package.json`
6
6
  */
7
- export const jsVersion = '0.7.0-nightly-20251023-c7ff5827d';
7
+ export const jsVersion = '0.7.0-nightly-20251025-b84ce2052';