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

Es/mapbox token #1148

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open

Es/mapbox token #1148

wants to merge 6 commits into from

Conversation

ErikSin
Copy link
Contributor

@ErikSin ErikSin commented Mar 8, 2024

Created script to generate env variables (to be used by js front end).

updated bitrise.yml to run script in order to access secret key in bitrise

Copy link
Member

@achou11 achou11 left a comment

Choose a reason for hiding this comment

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

Think using something like https://github.com/goatandsheep/react-native-dotenv would notably simplify the implementation as it adheres to the Twelve Factor App approach and also allows usage of shell environment variables (useful for CI like Github + Bitrise).

https://www.npmjs.com/package/react-native-config could also work, but not sure if it allows usage of shell environment variables at build time. not familiar with how to set up an env file for Github Actions and Bitrise but I know both support defining secrets that get injected as shell variables that can be used.

@ErikSin
Copy link
Contributor Author

ErikSin commented Mar 11, 2024

@achou11 I actually have tried this library (and a few other config libraries). None of them work with our current archtecture. Dotenv, doesnt work with our version of babel, and upgrading babel, lead to a whole slew of other issues. I also tried react-native-config and that also didn't work.

After playing around with these libraries for several hours, I think the having a prebuild script is the path of least resistance

@achou11
Copy link
Member

achou11 commented Mar 11, 2024

@achou11 I actually have tried this library (and a few other config libraries). None of them work with our current archtecture. Dotenv, doesnt work with our version of babel, and upgrading babel, lead to a whole slew of other issues. I also tried react-native-config and that also didn't work.

After playing around with these libraries for several hours, I think the having a prebuild script is the path of least resistance

ah damn - unfortunate but yeah I guess our react native version is quite behind at this point :/

@achou11
Copy link
Member

achou11 commented Mar 11, 2024

not sure if more convenient but another idea: we already make use of transform-inline-environment-variables (added to support feature flags) so maybe that can be used for this purpose too? although thinking about the various changes needed to get that working, that may be even harder to maintain 😅

@achou11
Copy link
Member

achou11 commented Mar 11, 2024

@ErikSin was able to get react-native-config working - can push up a separate branch if you're interested in the changes

@ErikSin
Copy link
Contributor Author

ErikSin commented Mar 11, 2024

@ErikSin was able to get react-native-config working - can push up a separate branch if you're interested in the changes

yesss please!!

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

2 participants