Skip to content

Commit 9d0ecf9

Browse files
authored
Remove global worklet runtime mutex (#620)
1 parent 1bc5a8e commit 9d0ecf9

File tree

7 files changed

+66
-32
lines changed

7 files changed

+66
-32
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ npm install @expensify/react-native-live-markdown react-native-reanimated expens
2020
npx expo install @expensify/react-native-live-markdown react-native-reanimated expensify-common
2121
```
2222

23-
React Native Live Markdown requires [react-native-reanimated](https://github.com/software-mansion/react-native-reanimated) 3.16.4 or newer and [expensify-common](https://github.com/Expensify/expensify-common) 2.0.108 or newer.
23+
React Native Live Markdown requires [react-native-reanimated](https://github.com/software-mansion/react-native-reanimated) 3.17.0 or newer and [expensify-common](https://github.com/Expensify/expensify-common) 2.0.115 or newer.
2424

2525
Then, install the iOS dependencies with CocoaPods:
2626

android/src/main/cpp/MarkdownParser.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ namespace livemarkdown {
1111
jni::alias_ref<jhybridobject> jThis,
1212
jni::alias_ref<jni::JString> text,
1313
const int parserId) {
14-
static std::mutex workletRuntimeMutex; // this needs to be global since the worklet runtime is also global
15-
const auto lock = std::lock_guard<std::mutex>(workletRuntimeMutex);
16-
1714
const auto markdownRuntime = expensify::livemarkdown::getMarkdownRuntime();
1815
jsi::Runtime &rt = markdownRuntime->getJSIRuntime();
1916

apple/MarkdownParser.mm

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#import "MarkdownParser.h"
22
#import <RNLiveMarkdown/MarkdownGlobal.h>
33
#import <React/RCTLog.h>
4-
#import <mutex>
54

65
@implementation MarkdownParser {
76
NSString *_prevText;
@@ -17,9 +16,6 @@ @implementation MarkdownParser {
1716
return _prevMarkdownRanges;
1817
}
1918

20-
static std::mutex workletRuntimeMutex; // this needs to be global since the worklet runtime is also global
21-
const auto lock = std::lock_guard<std::mutex>(workletRuntimeMutex);
22-
2319
const auto &markdownRuntime = expensify::livemarkdown::getMarkdownRuntime();
2420
jsi::Runtime &rt = markdownRuntime->getJSIRuntime();
2521

example/ios/Podfile.lock

+45-13
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ PODS:
14991499
- React-logger (= 0.77.0)
15001500
- React-perflogger (= 0.77.0)
15011501
- React-utils (= 0.77.0)
1502-
- RNLiveMarkdown (0.1.231):
1502+
- RNLiveMarkdown (0.1.236):
15031503
- DoubleConversion
15041504
- glog
15051505
- hermes-engine
@@ -1519,10 +1519,10 @@ PODS:
15191519
- ReactCodegen
15201520
- ReactCommon/turbomodule/bridging
15211521
- ReactCommon/turbomodule/core
1522-
- RNLiveMarkdown/newarch (= 0.1.231)
1522+
- RNLiveMarkdown/newarch (= 0.1.236)
15231523
- RNReanimated/worklets
15241524
- Yoga
1525-
- RNLiveMarkdown/newarch (0.1.231):
1525+
- RNLiveMarkdown/newarch (0.1.236):
15261526
- DoubleConversion
15271527
- glog
15281528
- hermes-engine
@@ -1544,7 +1544,7 @@ PODS:
15441544
- ReactCommon/turbomodule/core
15451545
- RNReanimated/worklets
15461546
- Yoga
1547-
- RNReanimated (3.16.7):
1547+
- RNReanimated (3.17.0):
15481548
- DoubleConversion
15491549
- glog
15501550
- hermes-engine
@@ -1556,18 +1556,44 @@ PODS:
15561556
- React-Fabric
15571557
- React-featureflags
15581558
- React-graphics
1559+
- React-hermes
1560+
- React-ImageManager
1561+
- React-jsi
1562+
- React-NativeModulesApple
1563+
- React-RCTFabric
1564+
- React-rendererdebug
1565+
- React-utils
1566+
- ReactCodegen
1567+
- ReactCommon/turbomodule/bridging
1568+
- ReactCommon/turbomodule/core
1569+
- RNReanimated/reanimated (= 3.17.0)
1570+
- RNReanimated/worklets (= 3.17.0)
1571+
- Yoga
1572+
- RNReanimated/reanimated (3.17.0):
1573+
- DoubleConversion
1574+
- glog
1575+
- hermes-engine
1576+
- RCT-Folly (= 2024.11.18.00)
1577+
- RCTRequired
1578+
- RCTTypeSafety
1579+
- React-Core
1580+
- React-debug
1581+
- React-Fabric
1582+
- React-featureflags
1583+
- React-graphics
1584+
- React-hermes
15591585
- React-ImageManager
1586+
- React-jsi
15601587
- React-NativeModulesApple
15611588
- React-RCTFabric
15621589
- React-rendererdebug
15631590
- React-utils
15641591
- ReactCodegen
15651592
- ReactCommon/turbomodule/bridging
15661593
- ReactCommon/turbomodule/core
1567-
- RNReanimated/reanimated (= 3.16.7)
1568-
- RNReanimated/worklets (= 3.16.7)
1594+
- RNReanimated/reanimated/apple (= 3.17.0)
15691595
- Yoga
1570-
- RNReanimated/reanimated (3.16.7):
1596+
- RNReanimated/reanimated/apple (3.17.0):
15711597
- DoubleConversion
15721598
- glog
15731599
- hermes-engine
@@ -1579,17 +1605,18 @@ PODS:
15791605
- React-Fabric
15801606
- React-featureflags
15811607
- React-graphics
1608+
- React-hermes
15821609
- React-ImageManager
1610+
- React-jsi
15831611
- React-NativeModulesApple
15841612
- React-RCTFabric
15851613
- React-rendererdebug
15861614
- React-utils
15871615
- ReactCodegen
15881616
- ReactCommon/turbomodule/bridging
15891617
- ReactCommon/turbomodule/core
1590-
- RNReanimated/reanimated/apple (= 3.16.7)
15911618
- Yoga
1592-
- RNReanimated/reanimated/apple (3.16.7):
1619+
- RNReanimated/worklets (3.17.0):
15931620
- DoubleConversion
15941621
- glog
15951622
- hermes-engine
@@ -1601,16 +1628,19 @@ PODS:
16011628
- React-Fabric
16021629
- React-featureflags
16031630
- React-graphics
1631+
- React-hermes
16041632
- React-ImageManager
1633+
- React-jsi
16051634
- React-NativeModulesApple
16061635
- React-RCTFabric
16071636
- React-rendererdebug
16081637
- React-utils
16091638
- ReactCodegen
16101639
- ReactCommon/turbomodule/bridging
16111640
- ReactCommon/turbomodule/core
1641+
- RNReanimated/worklets/apple (= 3.17.0)
16121642
- Yoga
1613-
- RNReanimated/worklets (3.16.7):
1643+
- RNReanimated/worklets/apple (3.17.0):
16141644
- DoubleConversion
16151645
- glog
16161646
- hermes-engine
@@ -1622,7 +1652,9 @@ PODS:
16221652
- React-Fabric
16231653
- React-featureflags
16241654
- React-graphics
1655+
- React-hermes
16251656
- React-ImageManager
1657+
- React-jsi
16261658
- React-NativeModulesApple
16271659
- React-RCTFabric
16281660
- React-rendererdebug
@@ -1915,10 +1947,10 @@ SPEC CHECKSUMS:
19151947
ReactAppDependencyProvider: 6e8d68583f39dc31ee65235110287277eb8556ef
19161948
ReactCodegen: b793571cdd05c69db98095ccfca381d45f709d89
19171949
ReactCommon: 1bd2dc684d7992acbf0dfee887b89a57a1ead86d
1918-
RNLiveMarkdown: 80a65c7603179b9e3410818dab1a75bebda34983
1919-
RNReanimated: d58dc1eb94af41f2e378862c2b098d74a0cd862a
1950+
RNLiveMarkdown: c7289448869f369a05ad97102b62c89f8204f36d
1951+
RNReanimated: 087d081f33387098097765f5a845f52c4abe2a3f
19201952
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
1921-
Yoga: 78d74e245ed67bb94275a1316cdc170b9b7fe884
1953+
Yoga: c0d8564af14a858f962607cd7306539cb2ace926
19221954

19231955
PODFILE CHECKSUM: 3f53660915b3f926239de7f89ab29581306a2614
19241956

example/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"expensify-common": "2.0.118",
1313
"react": "18.3.1",
1414
"react-native": "0.77.0",
15-
"react-native-reanimated": "3.16.7"
15+
"react-native-reanimated": "3.17.0"
1616
},
1717
"devDependencies": {
1818
"@babel/core": "^7.25.2",

package-lock.json

+17-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"react": "18.3.1",
9797
"react-native": "0.77.0",
9898
"react-native-builder-bob": "^0.20.0",
99-
"react-native-reanimated": "3.16.7",
99+
"react-native-reanimated": "3.17.0",
100100
"react-native-web": "^0.19.10",
101101
"release-it": "^15.0.0",
102102
"turbo": "^1.10.7",
@@ -106,7 +106,7 @@
106106
"expensify-common": ">=2.0.115",
107107
"react": "*",
108108
"react-native": "*",
109-
"react-native-reanimated": ">=3.16.4"
109+
"react-native-reanimated": ">=3.17.0"
110110
},
111111
"workspaces": [
112112
"./example",

0 commit comments

Comments
 (0)