[expo-updates] Fix metro asset call in embedded manifest creation step #26307
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.
Why
The metro asset collection step in
@expo/cli
has evolved and diverged from the way that the expo-updates asset collection step was written. This causes nonstandard metro configs to not be respected by expo-updates, and assets to be missing.We didn't notice this for a while because until #25613 landed a lot of common assets were present in the CDN and would resolve and be downloaded instead of getting the embedded ones. (they'd still present on screen, just erroneously download).
Closes #26195.
Closes ENG-11025.
How
This fix is done in two commits. The first commit is sufficient to fix the issue (it copy/pastes the code from CLI into createManifest but still leaves the root issue open as it could diverge again in the future). The second commit tries to future-proof this by factoring out the functions into common functions used by both the CLI export and the expo-updates export.
Test Plan
copy-paste the built JS for
createManifest
andexportEmbedAsync
into a sample app that this repro's in. the repro is this comment: #26195 (comment)Inspect the output of createManifest and see the image in a release build.
Checklist
npx expo prebuild
& EAS Build (eg: updated a module plugin).