expo-dev-menu 4.2.0 → 4.2.1

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/.eslintignore ADDED
@@ -0,0 +1 @@
1
+ build
package/CHANGELOG.md CHANGED
@@ -10,6 +10,19 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 4.2.1 — 2023-09-18
14
+
15
+ ### 💡 Others
16
+
17
+ - Fix eslint and TypeScript warnings ([#24497](https://github.com/expo/expo/pull/24497) by [@kadikraman](https://github.com/kadikraman))
18
+
19
+ ## 3.2.0 — 2023-09-15
20
+
21
+ ### 🎉 New features
22
+
23
+ - Add `control+d` as a hotkey to open the menu. ([#24434](https://github.com/expo/expo/pull/24434) by [@alanjhughes](https://github.com/alanjhughes))
24
+ - Separate `refresh` button from the rest ([#24426](https://github.com/expo/expo/pull/24426) by [@kadikraman](https://github.com/kadikraman))
25
+
13
26
  ## 4.2.0 — 2023-09-15
14
27
 
15
28
  ### 🎉 New features
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '4.2.0'
6
+ version = '4.2.1'
7
7
 
8
8
  buildscript {
9
9
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
@@ -70,7 +70,7 @@ android {
70
70
  minSdkVersion safeExtGet("minSdkVersion", 21)
71
71
  targetSdkVersion safeExtGet("targetSdkVersion", 33)
72
72
  versionCode 10
73
- versionName '4.2.0'
73
+ versionName '4.2.1'
74
74
  }
75
75
  lintOptions {
76
76
  abortOnError false
package/app/App.tsx CHANGED
@@ -4,7 +4,6 @@ import { View } from 'react-native';
4
4
  import { AppProviders } from './components/AppProviders';
5
5
  import { LoadInitialData } from './components/LoadInitialData';
6
6
  import { Main } from './components/Main';
7
- import { Onboarding } from './components/Onboarding';
8
7
  import { Splash } from './components/Splash';
9
8
  import { AppInfo, DevSettings, MenuPreferences } from './native-modules/DevMenu';
10
9
 
@@ -1,8 +1,8 @@
1
1
  import { View } from 'expo-dev-client-components';
2
2
  import * as React from 'react';
3
3
 
4
- import { loadFontsAsync } from '../native-modules/DevMenu';
5
4
  import { Splash } from './Splash';
5
+ import { loadFontsAsync } from '../native-modules/DevMenu';
6
6
 
7
7
  type LoadInitialDataProps = {
8
8
  children: React.ReactElement<any> | React.ReactElement<any>[];
@@ -43,12 +43,13 @@ export function Main({ registeredCallbacks = [], isDevice }: MainProps) {
43
43
  const appInfoClipboard = useClipboard();
44
44
 
45
45
  function onCopyUrlPress() {
46
- const { hostUrl } = appInfo;
47
- urlClipboard.onCopyPress(hostUrl);
46
+ if (appInfo?.hostUrl) {
47
+ urlClipboard.onCopyPress(appInfo.hostUrl);
48
+ }
48
49
  }
49
50
 
50
51
  function onCopyAppInfoPress() {
51
- const { runtimeVersion, sdkVersion, appName, appVersion } = appInfo;
52
+ const { runtimeVersion, sdkVersion, appName, appVersion } = appInfo || {};
52
53
  appInfoClipboard.onCopyPress({ runtimeVersion, sdkVersion, appName, appVersion });
53
54
  }
54
55
 
@@ -76,9 +77,9 @@ export function Main({ registeredCallbacks = [], isDevice }: MainProps) {
76
77
  <Row align="center" shrink="1">
77
78
  <View>
78
79
  <View height="xl" width="xl" overflow="hidden" bg="secondary" rounded="medium">
79
- {Boolean(appInfo.appIcon) && (
80
+ {Boolean(appInfo?.appIcon) && (
80
81
  <Image
81
- source={{ uri: appInfo.appIcon }}
82
+ source={{ uri: appInfo?.appIcon }}
82
83
  style={{ flex: 1, resizeMode: 'contain' }}
83
84
  />
84
85
  )}
@@ -90,22 +91,22 @@ export function Main({ registeredCallbacks = [], isDevice }: MainProps) {
90
91
  <View shrink="1">
91
92
  <Row style={{ flexWrap: 'wrap' }}>
92
93
  <Heading weight="bold" numberOfLines={1}>
93
- {appInfo.appName}
94
+ {appInfo?.appName}
94
95
  </Heading>
95
96
  </Row>
96
97
 
97
- {Boolean(appInfo.runtimeVersion) && (
98
+ {Boolean(appInfo?.runtimeVersion) && (
98
99
  <>
99
100
  <Text size="small" color="secondary">
100
- {`Runtime version: ${appInfo.runtimeVersion}`}
101
+ {`Runtime version: ${appInfo?.runtimeVersion}`}
101
102
  </Text>
102
103
  </>
103
104
  )}
104
105
 
105
- {Boolean(appInfo.sdkVersion) && !appInfo.runtimeVersion && (
106
+ {Boolean(appInfo?.sdkVersion) && !appInfo?.runtimeVersion && (
106
107
  <>
107
108
  <Text size="small" color="secondary">
108
- {`SDK version: ${appInfo.sdkVersion}`}
109
+ {`SDK version: ${appInfo?.sdkVersion}`}
109
110
  </Text>
110
111
  </>
111
112
  )}
@@ -129,7 +130,7 @@ export function Main({ registeredCallbacks = [], isDevice }: MainProps) {
129
130
  <Divider />
130
131
  <View style={{ flex: 1 }}>
131
132
  <ScrollView nestedScrollEnabled>
132
- {Boolean(appInfo.hostUrl) && (
133
+ {Boolean(appInfo?.hostUrl) && (
133
134
  <>
134
135
  <View bg="default" padding="medium">
135
136
  <Text color="secondary">Connected to:</Text>
@@ -144,7 +145,7 @@ export function Main({ registeredCallbacks = [], isDevice }: MainProps) {
144
145
  <Spacer.Horizontal size="small" />
145
146
  <Row flex="1" justify="between">
146
147
  <Text type="mono" numberOfLines={2} size="small">
147
- {appInfo.hostUrl}
148
+ {appInfo?.hostUrl}
148
149
  </Text>
149
150
 
150
151
  <ClipboardIcon />
@@ -276,7 +277,7 @@ export function Main({ registeredCallbacks = [], isDevice }: MainProps) {
276
277
  </View>
277
278
  </View>
278
279
 
279
- {appInfo.engine === 'Hermes' && (
280
+ {appInfo?.engine === 'Hermes' && (
280
281
  <>
281
282
  <Spacer.Vertical size="large" />
282
283
 
@@ -316,18 +317,18 @@ export function Main({ registeredCallbacks = [], isDevice }: MainProps) {
316
317
  <Spacer.Vertical size="large" />
317
318
 
318
319
  <View mx="small" rounded="large" overflow="hidden">
319
- <AppInfoRow title="Version" value={appInfo.appVersion} />
320
+ <AppInfoRow title="Version" value={appInfo?.appVersion || 'Unknown'} />
320
321
  <Divider />
321
- {Boolean(appInfo.runtimeVersion) && (
322
+ {Boolean(appInfo?.runtimeVersion) && (
322
323
  <>
323
- <AppInfoRow title="Runtime version" value={appInfo.runtimeVersion} />
324
+ <AppInfoRow title="Runtime version" value={appInfo?.runtimeVersion || 'Unknown'} />
324
325
  <Divider />
325
326
  </>
326
327
  )}
327
328
 
328
- {Boolean(appInfo.sdkVersion) && !appInfo.runtimeVersion && (
329
+ {Boolean(appInfo?.sdkVersion) && !appInfo?.runtimeVersion && (
329
330
  <>
330
- <AppInfoRow title="SDK Version" value={appInfo.sdkVersion} />
331
+ <AppInfoRow title="SDK Version" value={appInfo?.sdkVersion || 'Unknown'} />
331
332
  <Divider />
332
333
  </>
333
334
  )}
@@ -370,7 +371,7 @@ export function Main({ registeredCallbacks = [], isDevice }: MainProps) {
370
371
  }
371
372
 
372
373
  type SettingsRowButtonProps = {
373
- icon: React.ReactElement<any>;
374
+ icon: React.ReactElement<any> | null;
374
375
  label: string;
375
376
  description?: string;
376
377
  onPress: () => void;
@@ -6,7 +6,7 @@ export function useClipboard(clearInMillis: number = 3000) {
6
6
  const [clipboardContent, setClipboardContent] = React.useState('');
7
7
  const [clipboardError, setClipboardError] = React.useState('');
8
8
 
9
- const timerRef = React.useRef(null);
9
+ const timerRef = React.useRef<ReturnType<typeof setTimeout>>();
10
10
 
11
11
  React.useEffect(() => {
12
12
  if (clipboardContent) {
@@ -17,7 +17,7 @@ const defaultDevSettings: DevMenu.DevSettings = {
17
17
  isJSInspectorAvailable: false,
18
18
  };
19
19
 
20
- const DevSettingsContext = React.createContext<DevMenu.DevSettings>(defaultDevSettings);
20
+ const DevSettingsContext = React.createContext<DevMenu.DevSettings | undefined>(defaultDevSettings);
21
21
 
22
22
  export type DevSettingsProviderProps = {
23
23
  children: React.ReactNode;