.env
vars suck
#1195
mrnerdhair
started this conversation in
General
Replies: 2 comments 1 reply
-
how does this work with fleek and cloudflare? we want the ability to update environment variables in hosted environments without making application code changes, which this would prevent. this also goes against best practises of not baking environment variables into builds https://12factor.net/ |
Beta Was this translation helpful? Give feedback.
0 replies
-
My 2 cents:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Keeping
.env
vars in sync sucks, and since we don't need them for injecting secrets they're probably not the best setup.sample.env
with.env
.env
vars requires a non-trivial amount of support code..env
vars are all untyped strings, and have to be coerced into whatever's required byconfig.ts
. This works, but it's not exactly a standards-based approach.react-app-rewired.js
to turn them intoenv.json
at runtime, and dropping support would eliminate ~100 lines of some of our hardest-to-maintain code.I suggest we move to a new model based on JSON files; specifically,
env.prod.json
andenv.dev.json
, with contents matching the current set of parameters used by the Cloudflare Pages build. We can sort the keys into canonical form and use a JSON schema can validate the settings at compile-time. If we do need to maintain support for pipeline-specific env-var overrides of these default settings packages, that can be done as well... I figure there's probably a package for that.Beta Was this translation helpful? Give feedback.
All reactions