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
feat(cli, metro-config): environment variable support #21983
Merged
Merged
Conversation
This file contains 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
expo-bot
added
bot: suggestions
ExpoBot has some suggestions
bot: passed checks
ExpoBot has nothing to complain about
and removed
bot: suggestions
ExpoBot has some suggestions
labels
Apr 4, 2023
EvanBacon
force-pushed
the
@evanbacon/cli/custom-serializer
branch
from
April 6, 2023 01:43
160f537
to
3149b18
Compare
EvanBacon
requested review from
Simek,
amandeepmittal,
kbrandwijk,
lukmccall and
douglowder
as code owners
April 6, 2023 01:58
EvanBacon
commented
Apr 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some suggestions.
|
||
Envrionment variables prefixed with `EXPO_PUBLIC_` will be exposed to the app at build-time. For example, `EXPO_PUBLIC_API_KEY` will be available as `process.env.EXPO_PUBLIC_API_KEY`. | ||
|
||
Envrionmnet variables will not be inlined in Node Modules. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "inlined in Node Modules" mean here?
expo-bot
added
bot: suggestions
ExpoBot has some suggestions
bot: passed checks
ExpoBot has nothing to complain about
and removed
bot: passed checks
ExpoBot has nothing to complain about
bot: suggestions
ExpoBot has some suggestions
labels
Apr 6, 2023
EvanBacon
force-pushed
the
@evanbacon/cli/custom-serializer
branch
from
April 6, 2023 17:27
8c5868f
to
ec290ac
Compare
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.
Why
EXPO_PUBLIC_
will be inlined in the bundle when bundling normally (e.g. not for Node.js)..env
files are loaded into memory and applied to the process during a run. This also means that they're available inapp.config.js
.process.env
object (non-enumerable) to ensure they're available between fast refresh updates.How
@expo/env
which is used to hydrate env variables in a unified way. I plan to open another PR ineas-cli
which uses this package to fill in environment variables before uploading. NOTE: environment variables that are defined in eas.json are not available in Expo CLI when building locally, but are available in the cloud since they'll be on the process, this means they effectively emulate.env.production
.Test Plan
Checklist
expo prebuild
& EAS Build (eg: updated a module plugin).