Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds Vega support. Vega is the React Native platform of the newer Amazon Fire TV devices (React Native for Vega, RN 0.83). Today
react-native-bootsplashcrashes there at import, becauseTurboModuleRegistry.getEnforcing("RNBootSplash")finds no native module. RN 0.83 for Vega has no splash screen library at all: Amazon listsexpo-splash-screenas not supported, and Vega apps write their own splash code.Vega already has a native splash screen. The system shows
assets/raw/SplashScreenImages.zipat launch and hides it on the first frame. ItsSplashScreenManagermodule can keep it until the app hides it. This PR uses that, so there is no native code:src/specs/NativeRNBootSplash.kepler.ts. Metro picks.keplerfiles on Vega, as it picks.webfiles on the web. It reads the root tag of the app withAppRegistry.setWrapperComponentProvider, callspreventAutoHideV2(rootTag)before the first render, andhide()callshideV2(rootTag). The logic lives insrc/specs/vegaSplash.tswith no React Native import, so Node can test it.vegaplatform for the CLI.--platforms=vegawritesassets/raw/SplashScreenImages.zip: one 1920x1080 frame (the background and the logo, 2 px per dp as on a Fire TV) and thedesc.txtthat Vega reads. A small zip writer (stored files, as the PNG is compressed already) avoids a new dependency.vegais not in the default platforms.Why the root tag: on RN 0.83,
SplashScreenManager.preventAutoHideAsync(moduleName)fails with "No registered splash screen for module". The documented hooks (usePreventHideSplashScreen) use the root tag. This PR uses it too, without a hook.Test Plan
yarn test, new, with the Node test runner and no new dependency: 14 tests.hide(). Also a LogBox start,hide()before the start, a missing native module, errors from the native module and dark mode.yarn typecheck,yarn lintandprettier --check .pass.BootSplash.hide({ fade: true })10 s after mount. The splash made by the CLI fromexample/svgs/light-logo.svgstays on screen after the first frame, and the app shows right afterhide(). The system log agrees. The splash service shows the splash at +0 s and the app mounts at +2.0 s.hide()resolves at +12.0 s, and the app comes to the foreground at +12.4 s.What's required for testing (prerequisites)?
A Fire TV with Vega OS in developer mode, and the Vega SDK. The Vega Virtual Device shows no splash screen. Use a release build: in debug builds Vega hides the splash on its own.
What are the steps to test it (after prerequisites)?
npx react-native-bootsplash generate logo.png --platforms=vega.BootSplash.hide()when the app is ready.npm run build:release, thenvega run-app <vpkg> -d <device>.Compatibility
Checklist
README.mdexample/App.tsx). The example has no Vega target. I can add one if you want it.