expo-modules-core 55.0.26 → 55.0.27
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/CHANGELOG.md +6 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/core/logging/PersistentFileLog.kt +14 -18
- package/android/src/main/java/expo/modules/core/logging/PersistentFileLogSerialDispatchQueue.kt +6 -18
- package/package.json +2 -2
- package/prebuilds/output/debug/xcframeworks/ExpoModulesCore.tar.gz +0 -0
- package/prebuilds/output/debug/xcframeworks/ExpoModulesWorklets.tar.gz +0 -0
- package/prebuilds/output/release/xcframeworks/ExpoModulesCore.tar.gz +0 -0
- package/prebuilds/output/release/xcframeworks/ExpoModulesWorklets.tar.gz +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 55.0.27 — 2026-10-21
|
|
14
|
+
|
|
15
|
+
### 💡 Others
|
|
16
|
+
|
|
17
|
+
- [Android] Improve performance of `PersistentFileLog`. ([#45058](https://github.com/expo/expo/pull/45058) by [@lukmccall](https://github.com/lukmccall))
|
|
18
|
+
|
|
13
19
|
## 55.0.26 — 2026-08-31
|
|
14
20
|
|
|
15
21
|
### 💡 Others
|
package/android/build.gradle
CHANGED
|
@@ -29,7 +29,7 @@ if (shouldIncludeCompose) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
group = 'host.exp.exponent'
|
|
32
|
-
version = '55.0.
|
|
32
|
+
version = '55.0.27'
|
|
33
33
|
|
|
34
34
|
def isExpoModulesCoreTests = {
|
|
35
35
|
Gradle gradle = getGradle()
|
|
@@ -96,7 +96,7 @@ android {
|
|
|
96
96
|
defaultConfig {
|
|
97
97
|
consumerProguardFiles 'proguard-rules.pro'
|
|
98
98
|
versionCode 1
|
|
99
|
-
versionName "55.0.
|
|
99
|
+
versionName "55.0.27"
|
|
100
100
|
buildConfigField "String", "EXPO_MODULES_CORE_VERSION", "\"${versionName}\""
|
|
101
101
|
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", "true"
|
|
102
102
|
|
|
@@ -2,6 +2,7 @@ package expo.modules.core.logging
|
|
|
2
2
|
|
|
3
3
|
import java.io.File
|
|
4
4
|
import java.io.IOException
|
|
5
|
+
import java.io.PrintWriter
|
|
5
6
|
import java.nio.charset.Charset
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -25,6 +26,11 @@ class PersistentFileLog(
|
|
|
25
26
|
category: String,
|
|
26
27
|
filesDirectory: File
|
|
27
28
|
) {
|
|
29
|
+
private val filePath = "${filesDirectory.path}/$FILE_NAME_PREFIX.$category"
|
|
30
|
+
|
|
31
|
+
init {
|
|
32
|
+
ensureFileExists()
|
|
33
|
+
}
|
|
28
34
|
|
|
29
35
|
/**
|
|
30
36
|
* Read entries from log file
|
|
@@ -43,7 +49,6 @@ class PersistentFileLog(
|
|
|
43
49
|
fun appendEntry(entry: String, completionHandler: ((_: Error?) -> Unit) = { }) {
|
|
44
50
|
queue.add {
|
|
45
51
|
try {
|
|
46
|
-
this.ensureFileExists()
|
|
47
52
|
val text = when (this.getFileSize()) {
|
|
48
53
|
0L -> entry
|
|
49
54
|
else -> {
|
|
@@ -66,7 +71,6 @@ class PersistentFileLog(
|
|
|
66
71
|
fun purgeEntriesNotMatchingFilter(filter: (_: String) -> Boolean, completionHandler: (_: Exception?) -> Unit) {
|
|
67
72
|
queue.add {
|
|
68
73
|
try {
|
|
69
|
-
this.ensureFileExists()
|
|
70
74
|
val contents = this.readFileLinesSync()
|
|
71
75
|
val reducedContents = contents.filter(filter)
|
|
72
76
|
this.writeFileLinesSync(reducedContents)
|
|
@@ -83,7 +87,10 @@ class PersistentFileLog(
|
|
|
83
87
|
fun clearEntries(completionHandler: (_: Error?) -> Unit) {
|
|
84
88
|
queue.add {
|
|
85
89
|
try {
|
|
86
|
-
|
|
90
|
+
// Clearing the file can be done by writing an empty string to it
|
|
91
|
+
PrintWriter(File(filePath)).use { writer ->
|
|
92
|
+
writer.print("")
|
|
93
|
+
}
|
|
87
94
|
completionHandler.invoke(null)
|
|
88
95
|
} catch (e: Error) {
|
|
89
96
|
completionHandler.invoke(e)
|
|
@@ -93,8 +100,6 @@ class PersistentFileLog(
|
|
|
93
100
|
|
|
94
101
|
// Private functions
|
|
95
102
|
|
|
96
|
-
private val filePath = "${filesDirectory.path}/$FILE_NAME_PREFIX.$category"
|
|
97
|
-
|
|
98
103
|
private fun ensureFileExists() {
|
|
99
104
|
val fd = File(filePath)
|
|
100
105
|
if (!fd.exists()) {
|
|
@@ -110,12 +115,10 @@ class PersistentFileLog(
|
|
|
110
115
|
if (!file.exists()) {
|
|
111
116
|
return 0L
|
|
112
117
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
0L
|
|
118
|
-
}
|
|
118
|
+
|
|
119
|
+
return runCatching {
|
|
120
|
+
file.length()
|
|
121
|
+
}.getOrDefault(0L)
|
|
119
122
|
}
|
|
120
123
|
|
|
121
124
|
private fun appendTextToFile(text: String) {
|
|
@@ -130,13 +133,6 @@ class PersistentFileLog(
|
|
|
130
133
|
File(filePath).writeText(entries.joinToString("\n"), Charset.defaultCharset())
|
|
131
134
|
}
|
|
132
135
|
|
|
133
|
-
private fun deleteFileSync() {
|
|
134
|
-
val fd = File(filePath)
|
|
135
|
-
if (fd.exists()) {
|
|
136
|
-
fd.delete()
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
136
|
companion object {
|
|
141
137
|
private val queue = PersistentFileLogSerialDispatchQueue()
|
|
142
138
|
private const val FILE_NAME_PREFIX = "dev.expo.modules.core.logging"
|
package/android/src/main/java/expo/modules/core/logging/PersistentFileLogSerialDispatchQueue.kt
CHANGED
|
@@ -1,27 +1,15 @@
|
|
|
1
1
|
package expo.modules.core.logging
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import kotlinx.coroutines.GlobalScope
|
|
5
|
-
import kotlinx.coroutines.channels.Channel
|
|
6
|
-
import kotlinx.coroutines.launch
|
|
7
|
-
import kotlinx.coroutines.runBlocking
|
|
3
|
+
import java.util.concurrent.Executors
|
|
8
4
|
|
|
9
5
|
internal typealias PersistentFileLogSerialDispatchQueueBlock = () -> Unit
|
|
10
6
|
|
|
11
7
|
internal class PersistentFileLogSerialDispatchQueue {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
fun add(block: PersistentFileLogSerialDispatchQueueBlock) = runBlocking { channel.send(block) }
|
|
16
|
-
|
|
17
|
-
fun stop() = queueRunner.cancel()
|
|
8
|
+
fun add(block: PersistentFileLogSerialDispatchQueueBlock) {
|
|
9
|
+
executor.execute(block)
|
|
10
|
+
}
|
|
18
11
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
@OptIn(DelicateCoroutinesApi::class)
|
|
22
|
-
private val queueRunner = GlobalScope.launch {
|
|
23
|
-
while (true) {
|
|
24
|
-
channel.receive()()
|
|
25
|
-
}
|
|
12
|
+
companion object {
|
|
13
|
+
private val executor = Executors.newSingleThreadExecutor()
|
|
26
14
|
}
|
|
27
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-modules-core",
|
|
3
|
-
"version": "55.0.
|
|
3
|
+
"version": "55.0.27",
|
|
4
4
|
"description": "The core of Expo Modules architecture",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"@testing-library/react-native": "^13.3.0",
|
|
73
73
|
"expo-module-scripts": "^55.0.2"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "0cf0c5a69371bf46b796226ab69a20a77a344e91"
|
|
76
76
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|