-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
chore(const): add IS_NOT_VERCEL_RUNTIME_ENV #7721
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Pull Request Overview
This PR introduces a new constant, IS_NOT_VERCEL_RUNTIME_ENV, to centralize the runtime environment check logic and eliminate duplicate condition evaluations across multiple files. Key changes include:
- Adding the new constant in apps/site/next.constants.mjs.
- Removing duplicate runtime environment checks in releaseData.ts, downloadSnippets.ts, and blogData.ts by importing the new constant.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/site/next.constants.mjs | Adds the IS_NOT_VERCEL_RUNTIME_ENV constant to centralize env checks. |
| apps/site/next-data/releaseData.ts | Removes local runtime env condition declaration in favor of the constant. |
| apps/site/next-data/downloadSnippets.ts | Removes local runtime env condition declaration in favor of the constant. |
| apps/site/next-data/blogData.ts | Removes local runtime env condition declaration in favor of the constant. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Aviv Keller <me@aviv.sh>
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #7721 +/- ##
==========================================
+ Coverage 74.82% 74.85% +0.02%
==========================================
Files 98 98
Lines 7878 7890 +12
Branches 199 200 +1
==========================================
+ Hits 5895 5906 +11
- Misses 1982 1983 +1
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Aviv Keller <me@aviv.sh>
|
Requesting fast track. if you approve, merge when ready |
|
Lighthouse Results
|
We use this in several places, so it should be a constant, no?
https://en.wikipedia.org/wiki/Don%27t_repeat_yourself