Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions apps/native-component-list/src/screens/UI/ModifiersScreen.ios.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import {
allowsTightening,
truncationMode,
kerning,
monospacedDigit,
textCase,
underline,
strikethrough,
Expand Down Expand Up @@ -252,6 +253,19 @@ export default function ModifiersScreen() {
<Text modifiers={[font({ size: 14 }), kerning(kerningValue)]}>Kerning Text</Text>
<Slider min={0} max={10} onValueChange={setKerning} />

<HStack alignment="center" spacing={40}>
<VStack spacing={4}>
<Text modifiers={[font({ size: 12 })]}>Default</Text>
<Text modifiers={[font({ size: 20 })]}>1111111111</Text>
<Text modifiers={[font({ size: 20 })]}>0000000000</Text>
</VStack>
<VStack spacing={4}>
<Text modifiers={[font({ size: 12 })]}>monospacedDigit</Text>
<Text modifiers={[font({ size: 20 }), monospacedDigit()]}>1111111111</Text>
<Text modifiers={[font({ size: 20 }), monospacedDigit()]}>0000000000</Text>
</VStack>
</HStack>

<HStack spacing={20}>
<Text modifiers={[font({ size: 14 }), textCase('lowercase')]}>lowercase</Text>
<Text modifiers={[font({ size: 14 }), textCase('uppercase')]}>uppercase</Text>
Expand Down

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions packages/@expo/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### 🐛 Bug fixes

- Implement exponential retry for transient `devicectl` disconnects and fix null error logs. ([#43326](https://github.com/expo/expo/pull/43326) by [@balenamiaa](https://github.com/balenamiaa))

### 💡 Others

- Replace `minimatch` with `picomatch` and update ([#43323](https://github.com/expo/expo/pull/43323) by [@kitten](https://github.com/kitten))
Expand Down
42 changes: 37 additions & 5 deletions packages/@expo/cli/src/start/platforms/ios/devicectl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,34 @@ async function installAppWithDeviceCtlAsync(
uuid: string,
bundleIdOrAppPath: string,
onProgress: (event: { status: string; isComplete: boolean; progress: number }) => void
): Promise<void> {
const maxAttempts = 3;
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
try {
await installAppWithDeviceCtlInternalAsync(uuid, bundleIdOrAppPath, onProgress, attempt);
return;
} catch (error: any) {
if (error.code === 'detached') {
throw error;
}
const isTransientDisconnect =
error.message &&
(error.message.includes('CoreDeviceError') || error.message.includes('0xFA0'));

if (!isTransientDisconnect || attempt === maxAttempts) {
throw error;
}
const backoffDelay = 500 + Math.pow(2, attempt - 1) * 500;
await new Promise((resolve) => setTimeout(resolve, backoffDelay));
}
}
}

async function installAppWithDeviceCtlInternalAsync(
uuid: string,
bundleIdOrAppPath: string,
onProgress: (event: { status: string; isComplete: boolean; progress: number }) => void,
attempt: number
): Promise<void> {
// 𝝠 xcrun devicectl device install app --device 00001110-001111110110101A /Users/evanbacon/Library/Developer/Xcode/DerivedData/Router-hgbqaxzhrhkiftfweydvhgttadvn/Build/Products/Debug-iphoneos/Router.app --verbose
return new Promise((resolve, reject) => {
Expand All @@ -239,10 +267,11 @@ async function installAppWithDeviceCtlAsync(
return;
}
currentProgress = progress;
const statusPrefix = attempt > 1 ? `Installing (attempt ${attempt})` : 'Installing';
onProgress({
progress,
isComplete: progress === 100,
status: 'Installing',
status: statusPrefix,
});
}

Expand Down Expand Up @@ -271,13 +300,17 @@ async function installAppWithDeviceCtlAsync(
debug('[stdout]:', strings);
});

let stderrBuffer = '';
childProcess.stderr.on('data', (data: Buffer) => {
stderrBuffer += data.toString();
});

childProcess.on('close', (code) => {
debug('[close]: ' + code);
if (code === 0) {
resolve();
} else {
const stderr = childProcess.stderr.read();
const err = new Error(stderr);
const err = new Error(stderrBuffer || `Command failed with exit code ${code}`);
(err as any).code = code;
detach(err);
}
Expand All @@ -287,9 +320,8 @@ async function installAppWithDeviceCtlAsync(
off?.();
if (childProcess) {
return new Promise<void>((resolve) => {
childProcess?.on('close', resolve);
childProcess?.on('close', () => resolve());
childProcess?.kill();
// childProcess = null;
reject(err ?? new CommandError('detached'));
});
}
Expand Down
2 changes: 2 additions & 0 deletions packages/expo-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

### 🎉 New features

- [iOS] Added `monospacedDigit` modifier. ([#43328](https://github.com/expo/expo/pull/43328) by [@axeelz](https://github.com/axeelz))

### 🐛 Bug fixes

### 💡 Others
Expand Down
8 changes: 7 additions & 1 deletion packages/expo-ui/build/swift-ui/modifiers/index.d.ts

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

Loading
Loading