-
Notifications
You must be signed in to change notification settings - Fork 63
fix: make DEV_MODE optional
#410
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
luwes
left a comment
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.
Can we change the approach to what was intended by having esbuild not replace process.env.NODE_ENV? So the end user automatically gets the right mode when it has process.env.NODE_ENV set...
Added isDevMode method to get the environment avoiding esbuild to replace the value
|
@R-Delfino95 is attempting to deploy a commit to the Mux Team on Vercel. A member of the Team first needs to authorize it. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #410 +/- ##
==========================================
- Coverage 86.35% 86.32% -0.03%
==========================================
Files 37 37
Lines 3202 3211 +9
Branches 425 425
==========================================
+ Hits 2765 2772 +7
- Misses 435 437 +2
Partials 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Fixes #364 by ensuring
DEV_MODEcorrectly evaluatesNODE_ENVat runtime instead of being hardcoded during the build process.Previously,
esbuildwas replacingprocess.env.NODE_ENV === 'development'withtrueduring the NPM build, causing the "Upload in progress…" alert to be rendered in the DOM even in production environments. Although the alert was visually hidden, the text was still present in the markup, which could lead to SEO and accessibility issues.Changes
isDevMode()helper function insrc/components/utils.tsthat uses indirect access toprocess.env.NODE_ENVto prevent bundlers from replacing it at build timesrc/components/video.tsxto useisDevMode()instead of directly checkingprocess.env.NODE_ENVNODE_ENVvalue, only appearing in actual development environments