History log of /expo/packages/expo-updates/build/UseUpdatesUtils.d.ts.map (Results 1 – 5 of 5)
Revision Date Author Comments
# 9410ce0e 24-Aug-2023 Douglas Lowder <[email protected]>

[expo-updates] Add rollback support to useUpdates() (#24071)

- New UpdateInfoType for rollbacks
- Support for rollbacks in state machine

# Test Plan

- Unit tests and E2E test coverage added

[expo-updates] Add rollback support to useUpdates() (#24071)

- New UpdateInfoType for rollbacks
- Support for rollbacks in state machine

# Test Plan

- Unit tests and E2E test coverage added

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [x] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [x] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [x] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

---------

Co-authored-by: Will Schurman <[email protected]>

show more ...


# b51b5139 23-Aug-2023 Will Schurman <[email protected]>

[expo-manifests] Remove classic manifest types (#24053)


# 5b993e8e 24-Jul-2023 Douglas Lowder <[email protected]>

[expo-updates] Receive last check for update time from native (#23692)

# Why

The `lastCheckForUpdateTimeSinceRestart` returned by the `useUpdates()`
hook should be generated and stored in the na

[expo-updates] Receive last check for update time from native (#23692)

# Why

The `lastCheckForUpdateTimeSinceRestart` returned by the `useUpdates()`
hook should be generated and stored in the native context, so that the
result is accurate regardless of when the hook is initiated.

# How

- Extend the native context to include the time as an additional
property
- Update the time on `checkComplete` and `checkError` events

# Test Plan

- Modified unit tests to test the JS logic
- E2E tests should continue to pass
-
# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [x] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [x] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [x] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

---------

Co-authored-by: Will Schurman <[email protected]>

show more ...


# d80e7547 21-Jul-2023 Douglas Lowder <[email protected]>

[expo-updates] Catch error in initial native context read (#23640)


# 39b67c84 17-Jul-2023 Douglas Lowder <[email protected]>

[expo-updates] New JS API useUpdates() (#23532)

`useUpdates()`, a simpler JavaScript API for `expo-updates`.

- Wraps information on the currently running app bundle, and any
available or downloa

[expo-updates] New JS API useUpdates() (#23532)

`useUpdates()`, a simpler JavaScript API for `expo-updates`.

- Wraps information on the currently running app bundle, and any
available or downloaded new updates
- Reads from and receives change events from the native state machine,
so it always reflects the current state of the native code
- Can be called from any component in the application
- Tracks the last time the device checked the update server for an
available update
- Existing async methods (`checkForUpdateAsync()`, `fetchUpdateAsync()`)
can be called without waiting for results -- the hook will automatically
refresh when the methods complete

## Example Usage

```tsx UpdatesDemo.tsx
import { StatusBar } from 'expo-status-bar';
import * as Updates from 'expo-updates';
import React from 'react';
import { Pressable, Text, View } from 'react-native';

export default function UpdatesDemo() {
const { currentlyRunning, availableUpdate, isUpdateAvailable, isUpdatePending } = Updates.useUpdates();

// If true, we show the button to download and run the update
const showDownloadButton = isUpdateAvailable;

React.useEffect(() => {
if (isUpdatePending) {
// Update has been successfully downloaded, so reload with the new update bundle
Updates.reloadAsync();
}
}, [isUpdatePending]);

// Show whether or not we are running embedded code or an update
const runTypeMessage = currentlyRunning.isEmbeddedLaunch
? 'This app is running from built-in code'
: 'This app is running an update';

return (
<View style={styles.container}>
<Text style={styles.headerText}>Updates Demo</Text>
<Text>{runTypeMessage}</Text>
<Button pressHandler={() => Updates.checkForUpdateAsync()} text="Check manually for updates" />
{showDownloadButton ? (
<Button pressHandler={() => Updates.fetchUpdateAsync()} text="Download and run update" />
) : null}
<StatusBar style="auto" />
</View>
);
}

function Button(props: { text: string; pressHandler: () => void }) {
const { text, pressHandler } = props;
return (
<Pressable
style={({ pressed }) => {
return pressed ? [styles.button, styles.buttonPressed] : styles.button;
}}
onPress={pressHandler}>
<Text style={styles.buttonText}>{text}</Text>
</Pressable>
);
}
```

# How

- New method `useUpdates()`
- New supporting TS types

# Test Plan

- Unit tests included
- E2E tests included
- Manual testing

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [x] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [x] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [x] This diff will work correctly for `expo prebuild` & EAS Build (eg:
updated a module plugin).

show more ...