Repository navigation
feat: Replaced process.env vars with env-var - #3098
ryan-yu-ibm wants to merge 7 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📦 Next.js Bundle AnalysisThis analysis was generated by the next.js bundle analysis action 🤖
|
| Page | Size (compressed) |
|---|---|
global |
349.67 KB (🟡 +9.86 KB) |
Details
The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.
Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis
If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!
There was a problem hiding this comment.
Hey @ryan-yu-ibm good job on this so far! I agree with not replacing the use of process.env everywhere and found an edge case with env-var and next.js's webpack bundler that I detailed below.
At first I wasn't really sure if we really wanted to use env-var just because it adds another package to the project and it hasn't been updated in 2 years. However after looking into it, it is extremely lightweight and doesn't add any runtime dependencies so I don't mind it hanging around in that case
…f env var to only server files
…ix/adding-env-var
|
This PR is stale because it has been open 20 days with no activity. It will be closed in 5 days unless you remove the |
ec75212
|
|
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes 1 out of 2 committers have signed the CLA.
Have you signed the CLA already but the status is still pending? Recheck it. |
🔗 Relevant links
🗒️ What
This PR reinforces our conditional checks made throughout dev-portal when involving environment variables. An instance of this would be the string
'true'versus the booleantrue. It is very easy to switch between the two and could unintentionally change our dev environment.🤷 Why
Future proofing our configs and functions that does environmental variable comparisons.
Note
I chose to not replace every
process.envvariable out withenv-varsince I interpreted the task as patching the areas that could be potential points of failures (i.e. places with conditional checks). Though, if desired, I can revamp allprocess.envvariables to useenv-var.🛠️ How
process.var.VERCEL_ENVto the env-var equivalent withinnext.config.jsto test functionality📸 Design Screenshots
🧪 Testing
💭 Anything else?
PCI review checklist
I have documented a clear reason for, and description of, the change I am making.
If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
If applicable, I've documented the impact of any changes to security controls.
Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.