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

[expo-constants] use Updates.manifest if it exists and is non-empty #10668

Merged
merged 5 commits into from
Nov 14, 2020

Conversation

esamelson
Copy link
Contributor

@esamelson esamelson commented Oct 13, 2020

Why

One step in resolving #7721 . Longer term solution is to move away from depending on Constants.manifest in other libraries where possible. This PR will not solve the issue in all cases -- notably, for bare apps without expo-updates, and for bare apps with expo-updates running an embedded update for which no manifest exists -- but it will at least increase the number of cases where Constants.manifest is defined.

How

If expo-updates is installed and Updates.manifest exists and is nonempty, override the exported manifest object with the one from expo-updates.

Test Plan

Added jest tests to cover all cases I could think of, all tests pass.

@esamelson
Copy link
Contributor Author

looks like there are a couple libraries (expo-auth-session and expo-linking, namely) that use the presence of Constants.manifest to determine whether they are running in a bare or managed workflow environment, so we may not want to merge this until we have good solutions for those libraries, as well 🤔

@esamelson esamelson force-pushed the @eric/constants-updates-manifest branch from 3e437d0 to fea82b7 Compare November 10, 2020 02:25
@esamelson esamelson changed the title [expo-constants] if manifest is undefined, try to grab it from expo-updates [expo-constants] use Updates.manifest if it exists and is non-empty Nov 10, 2020
@github-actions
Copy link
Contributor

Native Component List for this branch is ready

packages/expo-constants/src/Constants.ts Outdated Show resolved Hide resolved
packages/expo-constants/CHANGELOG.md Outdated Show resolved Hide resolved
@esamelson esamelson force-pushed the @eric/constants-updates-manifest branch from e7c9baa to f4be2ae Compare November 14, 2020 01:30
@esamelson esamelson merged commit e514a35 into master Nov 14, 2020
@esamelson esamelson deleted the @eric/constants-updates-manifest branch November 14, 2020 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants