Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(splash): upstream Expo Router splash screen changes #24893

Merged
merged 6 commits into from
Oct 20, 2023

Conversation

EvanBacon
Copy link
Contributor

Why

Expo Router has the ability to delay dismissing the splash screen until additional async work has finished, this functionality could also be used for other features like font loading in the future. Regardless, the changes are pretty light and add some additional value to non-router users, so it makes sense to move them upstream.

How

  • Pull in native-only code for delaying the splash screen hiding (when the user hasn't already done this themselves) and attempting to hide when internal tasks have completed.
  • Memoize preventAutoHideAsync to prevent extraneous warnings.
  • Wrap the hideAsync warning to prevent extraneous warnings. We have no way of detecting if the splash has already been hidden so this is the only option.
  • Add additional error utils to hide the splash screen if an error was thrown, preventing the state where a splash screen hides error info.
  • Make expo-router SplashScreen just a re-export of expo-splash-screen.

Test Plan

Manually tested in apps/router-e2e.

This can also be used for any other async setup we want to add in the future.
@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Oct 17, 2023
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Oct 17, 2023
@EvanBacon EvanBacon marked this pull request as ready for review October 19, 2023 14:52
Copy link
Contributor

@Kudo Kudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. before merging the pr, please help to resolve the expo-router ci sdk failure.

@expo-bot
Copy link
Collaborator

Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines.

I've found some issues in your pull request that should be addressed (click on them for more details) 👇

⚠️ Suggestion: Missing changelog entries


Your changes should be noted in the changelog. Read Updating Changelogs guide and consider adding an appropriate entry to the following changelogs:


Generated by ExpoBot 🤖 against 131f178

@expo-bot expo-bot added bot: suggestions ExpoBot has some suggestions and removed bot: passed checks ExpoBot has nothing to complain about labels Oct 19, 2023
@EvanBacon EvanBacon merged commit 2366beb into main Oct 20, 2023
15 checks passed
@EvanBacon EvanBacon deleted the @evanbacon/splash-screen/pull-in-router-support branch October 20, 2023 17:44
marklawlor pushed a commit that referenced this pull request Oct 30, 2023
# Why

Expo Router has the ability to delay dismissing the splash screen until
additional async work has finished, this functionality could also be
used for other features like font loading in the future. Regardless, the
changes are pretty light and add some additional value to non-router
users, so it makes sense to move them upstream.

<!--
Please describe the motivation for this PR, and link to relevant GitHub
issues, forums posts, or feature requests.
-->

# How

- Pull in native-only code for delaying the splash screen hiding (when
the user hasn't already done this themselves) and attempting to hide
when internal tasks have completed.
- Memoize `preventAutoHideAsync` to prevent extraneous warnings.
- Wrap the `hideAsync` warning to prevent extraneous warnings. We have
no way of detecting if the splash has already been hidden so this is the
only option.
- Add additional error utils to hide the splash screen if an error was
thrown, preventing the state where a splash screen hides error info.
- Make `expo-router` SplashScreen just a re-export of
`expo-splash-screen`.

<!--
How did you build this feature or fix this bug and why?
-->

# Test Plan

Manually tested in `apps/router-e2e`.

---------

Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants