Skip to content

Commit

Permalink
[expo-updates][6/n] Remove classic updates (expo#26065)
Browse files Browse the repository at this point in the history
  • Loading branch information
wschurman authored Jan 3, 2024
1 parent c085fac commit 8ed7ed4
Show file tree
Hide file tree
Showing 44 changed files with 8 additions and 199 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class ExpoGoUpdatesModule(experienceProperties: Map<String, Any?>) : Module() {
constants["isEmbeddedLaunch"] = false
constants["isMissingRuntimeVersion"] = false
constants["isEnabled"] = true
constants["releaseChannel"] = configuration.releaseChannel
constants["isUsingEmbeddedAssets"] = false
constants["runtimeVersion"] = configuration.runtimeVersionRaw ?: ""
constants["checkAutomatically"] = configuration.checkOnLaunch.toJSString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,14 +335,9 @@ - (void)_startLoaderTask

NSURL *httpManifestUrl = [[self class] _httpUrlFromManifestUrl:_manifestUrl];

// in Expo Go, the release channel can change at runtime depending on the URL we load
NSURLComponents *manifestUrlComponents = [NSURLComponents componentsWithURL:httpManifestUrl resolvingAgainstBaseURL:YES];
NSString *releaseChannel = releaseChannel = [EXKernelLinkingManager releaseChannelWithUrlComponents:manifestUrlComponents];

NSMutableDictionary *updatesConfig = [[NSMutableDictionary alloc] initWithDictionary:@{
EXUpdatesConfig.EXUpdatesConfigUpdateUrlKey: httpManifestUrl.absoluteString,
EXUpdatesConfig.EXUpdatesConfigScopeKeyKey: httpManifestUrl.absoluteString,
EXUpdatesConfig.EXUpdatesConfigReleaseChannelKey: releaseChannel,
EXUpdatesConfig.EXUpdatesConfigHasEmbeddedUpdateKey: @NO,
EXUpdatesConfig.EXUpdatesConfigEnabledKey: @YES,
EXUpdatesConfig.EXUpdatesConfigLaunchWaitMsKey: launchWaitMs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ final class ExpoGoExpoUpdatesModule: Module {
Constants {
let config = updatesKernelService.configForScopeKey(scopeKey)

let releaseChannel = config?.releaseChannel
let channel = config?.requestHeaders["expo-channel-name"] ?? ""
let runtimeVersion = config?.runtimeVersion ?? ""
let checkAutomatically = config?.checkOnLaunch.asString ?? CheckAutomaticallyConfig.Always.asString
Expand All @@ -48,7 +47,6 @@ final class ExpoGoExpoUpdatesModule: Module {
"isEnabled": false,
"isEmbeddedLaunch": false,
"isMissingRuntimeVersion": isMissingRuntimeVersion,
"releaseChannel": releaseChannel,
"runtimeVersion": runtimeVersion,
"checkAutomatically": checkAutomatically,
"channel": channel,
Expand All @@ -67,7 +65,6 @@ final class ExpoGoExpoUpdatesModule: Module {
"localAssets": updatesKernelService.assetFilesMapForScopeKey(scopeKey) ?? [:],
"isEmergencyLaunch": updatesKernelService.isEmergencyLaunchForScopeKey(scopeKey),
"isMissingRuntimeVersion": isMissingRuntimeVersion,
"releaseChannel": releaseChannel,
"runtimeVersion": runtimeVersion,
"checkAutomatically": checkAutomatically,
"channel": channel,
Expand Down
1 change: 0 additions & 1 deletion docs/pages/versions/unversioned/sdk/updates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ On iOS, these properties are set as keys in **Expo.plist** file. You can also se
| `EXUpdatesURL` | `updateUrl` | `expo.modules.updates.EXPO_UPDATE_URL` | (none) | <YesIcon /> |
| `EXUpdatesRequestHeaders` | `requestHeaders` | `expo.modules.updates.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY` | (none) | <NoIcon /> |
| `EXUpdatesRuntimeVersion` | `runtimeVersion` | `expo.modules.updates.EXPO_RUNTIME_VERSION` | (none) | <YesIcon /> |
| `EXUpdatesReleaseChannel` | `releaseChannel` | `expo.modules.updates.EXPO_RELEASE_CHANNEL` | `default` | <NoIcon /> |
| `EXUpdatesCheckOnLaunch` | `checkOnLaunch` | `expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH` | `ALWAYS` (`ALWAYS`, `NEVER`, `WIFI_ONLY`, `ERROR_RECOVERY_ONLY`) | <NoIcon /> |
| `EXUpdatesLaunchWaitMs` | `launchWaitMs` | `expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS` | `0` | <NoIcon /> |
| `EXUpdatesCodeSigningCertificate` | `codeSigningCertificate` | `expo.modules.updates.CODE_SIGNING_CERTIFICATE` | (none) | <NoIcon /> |
Expand Down
2 changes: 1 addition & 1 deletion packages/@expo/config-plugins/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

### 💡 Others

- Remove classic updates SDK version. ([#26061](https://github.com/expo/expo/pull/26061) by [@wschurman](https://github.com/wschurman))
- Remove classic updates SDK version and release channel. ([#26061](https://github.com/expo/expo/pull/26061), [#26065](https://github.com/expo/expo/pull/26065) by [@wschurman](https://github.com/wschurman))

## 7.8.2 - 2023-12-19

Expand Down
1 change: 0 additions & 1 deletion packages/@expo/config-plugins/build/android/Updates.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/@expo/config-plugins/build/android/Updates.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/@expo/config-plugins/build/android/Updates.js.map

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/@expo/config-plugins/build/ios/Updates.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/@expo/config-plugins/build/ios/Updates.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/@expo/config-plugins/build/ios/Updates.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion packages/@expo/config-plugins/src/android/Updates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export enum Config {
LAUNCH_WAIT_MS = 'expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS',
RUNTIME_VERSION = 'expo.modules.updates.EXPO_RUNTIME_VERSION',
UPDATE_URL = 'expo.modules.updates.EXPO_UPDATE_URL',
RELEASE_CHANNEL = 'expo.modules.updates.EXPO_RELEASE_CHANNEL',
UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY = 'expo.modules.updates.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY',
CODE_SIGNING_CERTIFICATE = 'expo.modules.updates.CODE_SIGNING_CERTIFICATE',
CODE_SIGNING_METADATA = 'expo.modules.updates.CODE_SIGNING_METADATA',
Expand Down
1 change: 0 additions & 1 deletion packages/@expo/config-plugins/src/ios/IosConfig.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export type ExpoPlist = {
EXUpdatesCheckOnLaunch?: string;
EXUpdatesEnabled?: boolean;
EXUpdatesLaunchWaitMs?: number;
EXUpdatesReleaseChannel?: string;
EXUpdatesRuntimeVersion?: string;
EXUpdatesRequestHeaders?: Record<string, string>;
EXUpdatesSDKVersion?: string; // removed, but kept in types so that it can be mutated (deleted) from existing plists
Expand Down
1 change: 0 additions & 1 deletion packages/@expo/config-plugins/src/ios/Updates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export enum Config {
LAUNCH_WAIT_MS = 'EXUpdatesLaunchWaitMs',
RUNTIME_VERSION = 'EXUpdatesRuntimeVersion',
UPDATE_URL = 'EXUpdatesURL',
RELEASE_CHANNEL = 'EXUpdatesReleaseChannel',
UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY = 'EXUpdatesRequestHeaders',
CODE_SIGNING_CERTIFICATE = 'EXUpdatesCodeSigningCertificate',
CODE_SIGNING_METADATA = 'EXUpdatesCodeSigningMetadata',
Expand Down
2 changes: 1 addition & 1 deletion packages/expo-updates/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

- [ios] Remove unnecessary delegate from FileDownloader. ([#25783](https://github.com/expo/expo/pull/25783) by [@wschurman](https://github.com/wschurman))
- Migrate to requireNativeModule/requireOptionalNativeModule. ([#25648](https://github.com/expo/expo/pull/25648) by [@wschurman](https://github.com/wschurman))
- Remove classic updates. ([#26036](https://github.com/expo/expo/pull/26036), [#26037](https://github.com/expo/expo/pull/26037), [#26048](https://github.com/expo/expo/pull/26048), [#26059](https://github.com/expo/expo/pull/26059), [#26061](https://github.com/expo/expo/pull/26061) by [@wschurman](https://github.com/wschurman))
- Remove classic updates. ([#26036](https://github.com/expo/expo/pull/26036), [#26037](https://github.com/expo/expo/pull/26037), [#26048](https://github.com/expo/expo/pull/26048), [#26059](https://github.com/expo/expo/pull/26059), [#26061](https://github.com/expo/expo/pull/26061), [#26065](https://github.com/expo/expo/pull/26065) by [@wschurman](https://github.com/wschurman))

## 0.24.5 - 2023-12-21

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ class UpdatesConfigurationInstrumentationTest {

val config = UpdatesConfiguration(context, null)
Assert.assertEquals(false, config.expectsSignedManifest)
Assert.assertEquals("default", config.releaseChannel)
Assert.assertEquals(0, config.launchWaitMs)
Assert.assertEquals(UpdatesConfiguration.CheckAutomaticallyConfiguration.ALWAYS, config.checkOnLaunch)
Assert.assertEquals(true, config.hasEmbeddedUpdate)
Expand Down Expand Up @@ -127,7 +126,6 @@ class UpdatesConfigurationInstrumentationTest {
putString("expo.modules.updates.EXPO_SCOPE_KEY", "invalid")
putString("expo.modules.updates.EXPO_UPDATE_URL", "http://invalid.com")
putString("expo.modules.updates.EXPO_RUNTIME_VERSION", "invalid")
putString("expo.modules.updates.EXPO_RELEASE_CHANNEL", "invalid")
putInt("expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS", 9000)
putString("expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH", "ALWAYS")
putBoolean("expo.modules.updates.HAS_EMBEDDED_UPDATE", true)
Expand All @@ -146,7 +144,6 @@ class UpdatesConfigurationInstrumentationTest {
UpdatesConfiguration.UPDATES_CONFIGURATION_SCOPE_KEY_KEY to "override",
UpdatesConfiguration.UPDATES_CONFIGURATION_UPDATE_URL_KEY to Uri.parse("http://override.com"),
UpdatesConfiguration.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY to mapOf("test" to "override"),
UpdatesConfiguration.UPDATES_CONFIGURATION_RELEASE_CHANNEL_KEY to "override",
UpdatesConfiguration.UPDATES_CONFIGURATION_RUNTIME_VERSION_KEY to "override",
UpdatesConfiguration.UPDATES_CONFIGURATION_CHECK_ON_LAUNCH_KEY to "NEVER",
UpdatesConfiguration.UPDATES_CONFIGURATION_LAUNCH_WAIT_MS_KEY to 1000,
Expand All @@ -161,7 +158,6 @@ class UpdatesConfigurationInstrumentationTest {
Assert.assertEquals("override", config.scopeKey)
Assert.assertEquals(Uri.parse("http://override.com"), config.updateUrl)
Assert.assertEquals("override", config.runtimeVersionRaw)
Assert.assertEquals("override", config.releaseChannel)
Assert.assertEquals(1000, config.launchWaitMs)
Assert.assertEquals(UpdatesConfiguration.CheckAutomaticallyConfiguration.NEVER, config.checkOnLaunch)
Assert.assertEquals(false, config.hasEmbeddedUpdate)
Expand Down
Loading

0 comments on commit 8ed7ed4

Please sign in to comment.