Remove development debug code from production builds (#10521) #10522
+24
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix: Remove development debug code from production builds
Description
This PR removes development-only debugging code that was incorrectly executing in production builds, addressing security concerns and console pollution. The changes ensure that debug functionality is only available during development while maintaining clean, secure production builds.
Key Changes:
Debug
component'swindow.props
assignment in development-only conditionExamplesSelect
component in productionMotivation and Context
Fixes #10521
Problem: Development debugging code was running in production builds, causing:
window.props
Root Cause: Missing environment checks around debug code, allowing development-only functionality to execute in production builds.
Solution: Implement proper
process.env.NODE_ENV === "development"
guards around all debug code to ensure it only runs during development.How Has This Been Tested?
Development Environment Testing:
window.props
is accessible for debuggingProduction Environment Testing:
npm run build
npm run serve
window.props
is undefined in productionCross-Browser Testing:
Functional Testing:
Security Testing:
Testing Notes
Checklist
My PR contains...
src/
is unmodified: changes to documentation, CI, metadata, etc.)package.json
)My changes...
Documentation
Automated tests