expo-updates 56.0.10 → 56.0.12
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 +10 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/updates/DisabledUpdatesController.kt +2 -0
- package/android/src/main/java/expo/modules/updates/EnabledUpdatesController.kt +2 -0
- package/android/src/main/java/expo/modules/updates/IUpdatesController.kt +7 -0
- package/android/src/main/java/expo/modules/updates/UpdatesDevLauncherController.kt +2 -0
- package/android/src/main/java/expo/modules/updates/UpdatesPackage.kt +5 -0
- package/android/src/main/java/expo/modules/updates/procedures/RecreateReactContextProcedure.kt +2 -3
- package/android/src/main/java/expo/modules/updates/procedures/RelaunchProcedure.kt +2 -3
- package/android/src/main/java/expo/modules/updates/procedures/RestartReactAppExtensions.kt +20 -7
- package/cli/src/resolveRuntimeVersion.ts +2 -3
- package/cli/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/utils/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 56.0.12 — 2026-05-15
|
|
14
|
+
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
16
|
+
|
|
17
|
+
## 56.0.11 — 2026-05-13
|
|
18
|
+
|
|
19
|
+
### 🐛 Bug fixes
|
|
20
|
+
|
|
21
|
+
- [Android] Fix app restart when not using `ReactApplication` ([#45660](https://github.com/expo/expo/pull/45660) by [@gabrieldonadel](https://github.com/gabrieldonadel))
|
|
22
|
+
|
|
13
23
|
## 56.0.10 — 2026-05-13
|
|
14
24
|
|
|
15
25
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -42,7 +42,7 @@ expoModule {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
group = 'host.exp.exponent'
|
|
45
|
-
version = '56.0.
|
|
45
|
+
version = '56.0.12'
|
|
46
46
|
|
|
47
47
|
// Utility method to derive boolean values from the environment or from Java properties,
|
|
48
48
|
// and return them as strings to be used in BuildConfig fields
|
|
@@ -89,7 +89,7 @@ android {
|
|
|
89
89
|
namespace "expo.modules.updates"
|
|
90
90
|
defaultConfig {
|
|
91
91
|
versionCode 31
|
|
92
|
-
versionName '56.0.
|
|
92
|
+
versionName '56.0.12'
|
|
93
93
|
consumerProguardFiles("proguard-rules.pro")
|
|
94
94
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
95
95
|
|
|
@@ -4,6 +4,7 @@ import android.app.Activity
|
|
|
4
4
|
import android.content.Context
|
|
5
5
|
import android.net.Uri
|
|
6
6
|
import android.os.Bundle
|
|
7
|
+
import com.facebook.react.ReactHost
|
|
7
8
|
import com.facebook.react.bridge.ReactContext
|
|
8
9
|
import com.facebook.react.devsupport.interfaces.DevSupportManager
|
|
9
10
|
import expo.modules.kotlin.exception.CodedException
|
|
@@ -88,6 +89,7 @@ class DisabledUpdatesController(
|
|
|
88
89
|
get() = launcher?.bundleAssetName
|
|
89
90
|
override val reloadScreenManager: ReloadScreenManager?
|
|
90
91
|
get() = null
|
|
92
|
+
override var reactHost: WeakReference<ReactHost> = WeakReference(null)
|
|
91
93
|
|
|
92
94
|
override fun onEventListenerStartObserving() {
|
|
93
95
|
stateMachine.sendContextToJS()
|
|
@@ -4,6 +4,7 @@ import android.app.Activity
|
|
|
4
4
|
import android.content.Context
|
|
5
5
|
import android.net.Uri
|
|
6
6
|
import android.os.Bundle
|
|
7
|
+
import com.facebook.react.ReactHost
|
|
7
8
|
import com.facebook.react.bridge.ReactContext
|
|
8
9
|
import com.facebook.react.devsupport.interfaces.DevSupportManager
|
|
9
10
|
import expo.modules.easclient.EASClientID
|
|
@@ -82,6 +83,7 @@ class EnabledUpdatesController(
|
|
|
82
83
|
private val startupFinishedDeferred = CompletableDeferred<Unit>()
|
|
83
84
|
private val startupFinishedMutex = Mutex()
|
|
84
85
|
override val reloadScreenManager = ReloadScreenManager()
|
|
86
|
+
override var reactHost: WeakReference<ReactHost> = WeakReference(null)
|
|
85
87
|
|
|
86
88
|
internal val stateChangeListenerMap: MutableMap<String, UpdatesStateChangeListener> = mutableMapOf()
|
|
87
89
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package expo.modules.updates
|
|
2
2
|
|
|
3
3
|
import android.os.Bundle
|
|
4
|
+
import com.facebook.react.ReactHost
|
|
4
5
|
import com.facebook.react.bridge.ReactContext
|
|
5
6
|
import com.facebook.react.devsupport.interfaces.DevSupportManager
|
|
6
7
|
import expo.modules.updates.db.entity.AssetEntity
|
|
@@ -11,6 +12,7 @@ import expo.modules.updates.manifest.Update
|
|
|
11
12
|
import expo.modules.updates.reloadscreen.ReloadScreenManager
|
|
12
13
|
import expo.modules.updates.statemachine.UpdatesStateContext
|
|
13
14
|
import java.io.File
|
|
15
|
+
import java.lang.ref.WeakReference
|
|
14
16
|
import java.util.Date
|
|
15
17
|
import kotlin.time.Duration
|
|
16
18
|
import kotlin.time.DurationUnit
|
|
@@ -35,6 +37,11 @@ interface IUpdatesController {
|
|
|
35
37
|
*/
|
|
36
38
|
val bundleAssetName: String?
|
|
37
39
|
|
|
40
|
+
/**
|
|
41
|
+
* The current [ReactHost], populated automatically by `ReactNativeHostHandler.onDidCreateReactHost`.
|
|
42
|
+
*/
|
|
43
|
+
var reactHost: WeakReference<ReactHost>
|
|
44
|
+
|
|
38
45
|
val reloadScreenManager: ReloadScreenManager?
|
|
39
46
|
|
|
40
47
|
/**
|
|
@@ -3,6 +3,7 @@ package expo.modules.updates
|
|
|
3
3
|
import android.content.Context
|
|
4
4
|
import android.net.Uri
|
|
5
5
|
import android.os.Bundle
|
|
6
|
+
import com.facebook.react.ReactHost
|
|
6
7
|
import com.facebook.react.bridge.ReactContext
|
|
7
8
|
import com.facebook.react.devsupport.interfaces.DevSupportManager
|
|
8
9
|
import expo.modules.easclient.EASClientID
|
|
@@ -106,6 +107,7 @@ class UpdatesDevLauncherController(
|
|
|
106
107
|
get() = throw Exception("IUpdatesController.bundleAssetName should not be called in dev client")
|
|
107
108
|
|
|
108
109
|
override val reloadScreenManager = ReloadScreenManager()
|
|
110
|
+
override var reactHost: WeakReference<ReactHost> = WeakReference(null)
|
|
109
111
|
|
|
110
112
|
override fun onEventListenerStartObserving() {
|
|
111
113
|
// no-op for UpdatesDevLauncherController
|
|
@@ -16,6 +16,7 @@ import kotlinx.coroutines.CoroutineScope
|
|
|
16
16
|
import kotlinx.coroutines.Dispatchers
|
|
17
17
|
import kotlinx.coroutines.launch
|
|
18
18
|
import kotlinx.coroutines.withContext
|
|
19
|
+
import java.lang.ref.WeakReference
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* Defines the internal and exported modules for expo-updates, as well as the auto-setup behavior in
|
|
@@ -38,6 +39,10 @@ class UpdatesPackage : Package {
|
|
|
38
39
|
UpdatesController.initialize(context, useDeveloperSupport)
|
|
39
40
|
}
|
|
40
41
|
|
|
42
|
+
override fun onDidCreateReactHost(context: Context, reactNativeHost: ReactHost) {
|
|
43
|
+
UpdatesController.instance.reactHost = WeakReference(reactNativeHost)
|
|
44
|
+
}
|
|
45
|
+
|
|
41
46
|
override fun onDidCreateDevSupportManager(devSupportManager: DevSupportManager) {
|
|
42
47
|
UpdatesController.instance.onDidCreateDevSupportManager(devSupportManager)
|
|
43
48
|
}
|
package/android/src/main/java/expo/modules/updates/procedures/RecreateReactContextProcedure.kt
CHANGED
|
@@ -2,7 +2,6 @@ package expo.modules.updates.procedures
|
|
|
2
2
|
|
|
3
3
|
import android.app.Activity
|
|
4
4
|
import android.content.Context
|
|
5
|
-
import com.facebook.react.ReactApplication
|
|
6
5
|
import expo.modules.updates.launcher.Launcher
|
|
7
6
|
import expo.modules.updates.statemachine.UpdatesStateEvent
|
|
8
7
|
import kotlinx.coroutines.CoroutineScope
|
|
@@ -20,7 +19,7 @@ class RecreateReactContextProcedure(
|
|
|
20
19
|
override val loggerTimerLabel = "timer-recreate-react-context"
|
|
21
20
|
|
|
22
21
|
override suspend fun run(procedureContext: ProcedureContext) {
|
|
23
|
-
val
|
|
22
|
+
val reactHost = resolveReactHostForRestart(context) ?: run inner@{
|
|
24
23
|
callback.onFailure(Exception("Could not reload application. Ensure you have passed the correct instance of ReactApplication into UpdatesController.initialize()."))
|
|
25
24
|
return
|
|
26
25
|
}
|
|
@@ -29,7 +28,7 @@ class RecreateReactContextProcedure(
|
|
|
29
28
|
callback.onSuccess()
|
|
30
29
|
procedureScope.launch {
|
|
31
30
|
withContext(Dispatchers.Main) {
|
|
32
|
-
|
|
31
|
+
reactHost.restart(weakActivity?.get(), "Restart from RecreateReactContextProcedure")
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
procedureContext.resetStateAfterRestart()
|
|
@@ -2,7 +2,6 @@ package expo.modules.updates.procedures
|
|
|
2
2
|
|
|
3
3
|
import android.app.Activity
|
|
4
4
|
import android.content.Context
|
|
5
|
-
import com.facebook.react.ReactApplication
|
|
6
5
|
import expo.modules.updates.UpdatesConfiguration
|
|
7
6
|
import expo.modules.updates.db.DatabaseHolder
|
|
8
7
|
import expo.modules.updates.db.Reaper
|
|
@@ -41,7 +40,7 @@ class RelaunchProcedure(
|
|
|
41
40
|
override val loggerTimerLabel = "timer-relaunch"
|
|
42
41
|
|
|
43
42
|
override suspend fun run(procedureContext: ProcedureContext) {
|
|
44
|
-
val
|
|
43
|
+
val reactHost = resolveReactHostForRestart(context) ?: run inner@{
|
|
45
44
|
callback.onFailure(Exception("Could not reload application. Ensure you have passed the correct instance of ReactApplication into UpdatesController.initialize()."))
|
|
46
45
|
return
|
|
47
46
|
}
|
|
@@ -74,7 +73,7 @@ class RelaunchProcedure(
|
|
|
74
73
|
procedureScope.launch {
|
|
75
74
|
withContext(Dispatchers.Main) {
|
|
76
75
|
reloadScreenManager?.show(weakActivity?.get())
|
|
77
|
-
|
|
76
|
+
reactHost.restart(weakActivity?.get(), "Restart from RelaunchProcedure")
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
79
|
|
|
@@ -1,20 +1,33 @@
|
|
|
1
1
|
package expo.modules.updates.procedures
|
|
2
2
|
|
|
3
3
|
import android.app.Activity
|
|
4
|
+
import android.content.Context
|
|
4
5
|
import com.facebook.react.ReactApplication
|
|
6
|
+
import com.facebook.react.ReactHost
|
|
5
7
|
import com.facebook.react.common.LifecycleState
|
|
8
|
+
import expo.modules.updates.UpdatesController
|
|
6
9
|
|
|
7
10
|
/**
|
|
8
|
-
*
|
|
11
|
+
* Resolve a [ReactHost] to reload, in order of preference:
|
|
12
|
+
* 1. `(context.applicationContext as? ReactApplication)?.reactHost`, works for every app
|
|
13
|
+
* whose host `Application` implements [ReactApplication].
|
|
14
|
+
* 2. [UpdatesController.instance].reactHost, populated by the expo-modules-core
|
|
15
|
+
* `onDidCreateReactHost` lifecycle callback for brownfield consumers whose `Application`
|
|
16
|
+
* does not implement [ReactApplication].
|
|
17
|
+
*/
|
|
18
|
+
internal fun resolveReactHostForRestart(context: Context): ReactHost? =
|
|
19
|
+
(context.applicationContext as? ReactApplication)?.reactHost
|
|
20
|
+
?: UpdatesController.instance.reactHost.get()
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* An extension for [ReactHost] to restart the app
|
|
9
24
|
*
|
|
10
25
|
* @param activity For bridgeless mode if the ReactHost is destroyed, we need an Activity to resume it.
|
|
11
26
|
* @param reason The restart reason. Only used on bridgeless mode.
|
|
12
27
|
*/
|
|
13
|
-
internal fun
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (reactHost.lifecycleState != LifecycleState.RESUMED && activity != null) {
|
|
17
|
-
reactHost.onHostResume(activity)
|
|
28
|
+
internal fun ReactHost.restart(activity: Activity?, reason: String) {
|
|
29
|
+
if (lifecycleState != LifecycleState.RESUMED && activity != null) {
|
|
30
|
+
onHostResume(activity)
|
|
18
31
|
}
|
|
19
|
-
|
|
32
|
+
reload(reason)
|
|
20
33
|
}
|
|
@@ -40,9 +40,8 @@ Resolve expo-updates runtime version
|
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
const { resolveRuntimeVersionAsync } =
|
|
44
|
-
'../../utils/build/resolveRuntimeVersionAsync.js'
|
|
45
|
-
);
|
|
43
|
+
const { resolveRuntimeVersionAsync } =
|
|
44
|
+
await import('../../utils/build/resolveRuntimeVersionAsync.js');
|
|
46
45
|
|
|
47
46
|
const platform = requireArg(args, '--platform');
|
|
48
47
|
if (!['ios', 'android'].includes(platform)) {
|
package/cli/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/assetsverify.ts","./src/assetsverifyasync.ts","./src/assetsverifytypes.ts","./src/cli.ts","./src/configurecodesigning.ts","./src/configurecodesigningasync.ts","./src/generatecodesigning.ts","./src/generatecodesigningasync.ts","./src/generatefingerprint.ts","./src/resolveruntimeversion.ts","./src/syncconfigurationtonative.ts","./src/syncconfigurationtonativeasync.ts","./src/utils/args.ts","./src/utils/dir.ts","./src/utils/errors.ts","./src/utils/log.ts","./src/utils/modifyconfigasync.ts","./src/utils/withconsoledisabledasync.ts"],"version":"5.9.
|
|
1
|
+
{"root":["./src/assetsverify.ts","./src/assetsverifyasync.ts","./src/assetsverifytypes.ts","./src/cli.ts","./src/configurecodesigning.ts","./src/configurecodesigningasync.ts","./src/generatecodesigning.ts","./src/generatecodesigningasync.ts","./src/generatefingerprint.ts","./src/resolveruntimeversion.ts","./src/syncconfigurationtonative.ts","./src/syncconfigurationtonativeasync.ts","./src/utils/args.ts","./src/utils/dir.ts","./src/utils/errors.ts","./src/utils/log.ts","./src/utils/modifyconfigasync.ts","./src/utils/withconsoledisabledasync.ts"],"version":"5.9.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-updates",
|
|
3
|
-
"version": "56.0.
|
|
3
|
+
"version": "56.0.12",
|
|
4
4
|
"description": "Fetches and manages remotely-hosted assets and updates to your app's JS bundle.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"picomatch": "^4.0.4",
|
|
61
61
|
"ts-node": "^10.9.2",
|
|
62
62
|
"xstate": "^4.37.2",
|
|
63
|
-
"
|
|
64
|
-
"expo-dev-client": "56.0.9",
|
|
63
|
+
"expo": "56.0.0-preview.12",
|
|
65
64
|
"expo-module-scripts": "56.0.2",
|
|
66
|
-
"expo": "56.0.
|
|
65
|
+
"@expo/metro-config": "56.0.9",
|
|
66
|
+
"expo-dev-client": "56.0.11"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"expo": "*",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"./scripts/with-node.sh"
|
|
83
83
|
]
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "f26be3dd9396bf7c399a1d607865d0fabdbc0d64",
|
|
86
86
|
"scripts": {
|
|
87
87
|
"build": "expo-module build",
|
|
88
88
|
"clean": "expo-module clean",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/withupdates.ts"],"version":"5.9.
|
|
1
|
+
{"root":["./src/index.ts","./src/withupdates.ts"],"version":"5.9.3"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/createfingerprintasync.ts","./src/createfingerprintforbuildasync.ts","./src/createmanifestforbuildasync.ts","./src/createupdatesresources.ts","./src/filterplatformassetscales.ts","./src/findupprojectroot.ts","./src/resolveruntimeversionasync.ts","./src/vcs.ts","./src/workflow.ts"],"version":"5.9.
|
|
1
|
+
{"root":["./src/createfingerprintasync.ts","./src/createfingerprintforbuildasync.ts","./src/createmanifestforbuildasync.ts","./src/createupdatesresources.ts","./src/filterplatformassetscales.ts","./src/findupprojectroot.ts","./src/resolveruntimeversionasync.ts","./src/vcs.ts","./src/workflow.ts"],"version":"5.9.3"}
|