expo-dev-launcher 2.1.3 → 2.1.4

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 CHANGED
@@ -10,6 +10,13 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 2.1.4 — 2023-02-28
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Fixed dev client crash when server URL has no scheme. ([#21274](https://github.com/expo/expo/pull/21274) by [@gabrieldonadel](https://github.com/gabrieldonadel))
18
+ - Fixed dev client not showing logged user and initial data. ([#21425](https://github.com/expo/expo/pull/21425) by [@gabrieldonadel](https://github.com/gabrieldonadel))
19
+
13
20
  ## 2.1.3 — 2023-02-25
14
21
 
15
22
  _This version does not introduce any user-facing changes._
@@ -40,7 +40,7 @@ android {
40
40
  minSdkVersion safeExtGet('minSdkVersion', 21)
41
41
  targetSdkVersion safeExtGet("targetSdkVersion", 33)
42
42
  versionCode 9
43
- versionName "2.1.3"
43
+ versionName "2.1.4"
44
44
  }
45
45
 
46
46
  lintOptions {
package/bundle/App.tsx CHANGED
@@ -26,8 +26,8 @@ type LauncherAppProps = object;
26
26
 
27
27
  export function App(props: LauncherAppProps) {
28
28
  return (
29
- <LoadInitialData loader={<Splash />}>
30
- <View style={{ direction: 'ltr', flex: 1 }}>
29
+ <View style={{ direction: 'ltr', flex: 1 }}>
30
+ <LoadInitialData loader={<Splash />}>
31
31
  <AppProviders>
32
32
  <Stack.Navigator
33
33
  initialRouteName="Main"
@@ -44,8 +44,8 @@ export function App(props: LauncherAppProps) {
44
44
  <Stack.Screen name="Crash Report" component={CrashReportScreen} />
45
45
  </Stack.Navigator>
46
46
  </AppProviders>
47
- </View>
48
- </LoadInitialData>
47
+ </LoadInitialData>
48
+ </View>
49
49
  );
50
50
  }
51
51
 
@@ -65,11 +65,11 @@ public class EXDevLauncherURLHelper: NSObject {
65
65
 
66
66
  @objc
67
67
  public static func replaceEXPScheme(_ url: URL, to scheme: String) -> URL {
68
- var components = URLComponents.init(url: url, resolvingAgainstBaseURL: false)!
69
- if components.scheme == "exp" {
70
- components.scheme = scheme
68
+ var components = URLComponents(url: url, resolvingAgainstBaseURL: false)
69
+ if components?.scheme == "exp" {
70
+ components?.scheme = scheme
71
71
  }
72
- return components.url!
72
+ return components?.url ?? url
73
73
  }
74
74
 
75
75
  @objc
@@ -5,9 +5,9 @@ import XCTest
5
5
  @testable import EXDevLauncher
6
6
 
7
7
  class EXDevLauncherURLHelperTests: XCTestCase {
8
-
8
+
9
9
  let encodedUrlString = "http%3A%2F%2Flocalhost%3A8081"
10
-
10
+
11
11
  func testIsDevLauncherURL() {
12
12
  let defaultUrl = "scheme://expo-development-client"
13
13
  XCTAssertTrue(EXDevLauncherURLHelper.isDevLauncherURL(URL(string: defaultUrl)))
@@ -22,28 +22,32 @@ class EXDevLauncherURLHelperTests: XCTestCase {
22
22
 
23
23
  let actual2 = EXDevLauncherURLHelper.replaceEXPScheme(URL(string: "http://expo-development-client/?url=http%3A%2F%2Flocalhost%3A8081")!, to: "scheme")
24
24
  XCTAssertEqual(URL(string: "http://expo-development-client/?url=http%3A%2F%2Flocalhost%3A8081"), actual2)
25
+
26
+ // should not crash if provided URL does not include scheme
27
+ let actual3 = EXDevLauncherURLHelper.replaceEXPScheme(URL(string: "192.168.0.12:19000")!, to: "scheme")
28
+ XCTAssertEqual(URL(string: "192.168.0.12:19000"), actual3)
25
29
  }
26
-
30
+
27
31
  func testDevLauncherUrls() {
28
32
  // dev-client scheme with valid url param -> loadApp with specified url param
29
33
  expectDevLauncherUrlToEqual(input:"scheme://expo-development-client/?url=http%3A%2F%2Flocalhost%3A8081%2Findex.bundle%3Fplatform%3Dios%26dev%3Dtrue",
30
34
  expected:"http://localhost:8081/index.bundle?platform=ios&dev=true")
31
-
35
+
32
36
  // non-dev-client scheme with valid url param -> defer loading to loaded app
33
37
  expectDevLauncherUrlToEqual(input: "scheme://not-dev-client/?url=\(encodedUrlString)",
34
38
  expected: "scheme://not-dev-client/?url=\(encodedUrlString)")
35
39
 
36
40
  }
37
-
41
+
38
42
  func testDevLauncherUrlQueryParams() {
39
43
  let url = "scheme://expo-development-client/?url=http%3A%2F%2Flocalhost%3A8081&updateMessage=123"
40
44
  let devLauncherUrl = EXDevLauncherUrl(URL(string:url)!)
41
45
  let queryParams = devLauncherUrl.queryParams
42
-
46
+
43
47
  XCTAssertEqual(queryParams["updateMessage"], "123")
44
48
  XCTAssertEqual(queryParams["url"], "http://localhost:8081")
45
49
  }
46
-
50
+
47
51
  // HELPER
48
52
  func expectDevLauncherUrlToEqual(input: String, expected: String) {
49
53
  let devLauncherUrl = EXDevLauncherUrl(URL(string:input)!)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "expo-dev-launcher",
3
3
  "title": "Expo Development Launcher",
4
- "version": "2.1.3",
4
+ "version": "2.1.4",
5
5
  "description": "Pre-release version of the Expo development launcher package for testing.",
6
6
  "main": "build/DevLauncher.js",
7
7
  "types": "build/DevLauncher.d.ts",
@@ -63,5 +63,5 @@
63
63
  "./setupTests.ts"
64
64
  ]
65
65
  },
66
- "gitHead": "51a41f5a28ebb1c59a065d5f1e072e1e7d402552"
66
+ "gitHead": "8174f5855f6a2abe0cc7dc0063b559cf635774c2"
67
67
  }