fix(core): remove debug code that runs in production builds#10834
Open
yogeshwaran-c wants to merge 1 commit intoswagger-api:masterfrom
Open
fix(core): remove debug code that runs in production builds#10834yogeshwaran-c wants to merge 1 commit intoswagger-api:masterfrom
yogeshwaran-c wants to merge 1 commit intoswagger-api:masterfrom
Conversation
- Wrap window.props assignment in debug.jsx with NODE_ENV check so it only executes in development builds - Remove debug console.log from ExamplesSelect default onSelect prop (marked with FIXME: remove before merging to master) - Remove debug console.log from ExamplesSelectValueRetainer default onSelect and updateValue props - Replace debug callbacks with no-op functions Fixes swagger-api#10521
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Removes development-only debug code that was executing in production builds:
debug.jsx:window.props = this.propswas exposing internal component props globally in all environments. Now wrapped inprocess.env.NODE_ENV === "development"check, which Webpack's DefinePlugin will dead-code eliminate in production builds.examples-select.jsx: DefaultonSelectprop contained aconsole.logcall with a FIXME comment ("remove before merging to master"). Replaced with a no-op function.examples-select-value-retainer.jsx: DefaultonSelectandupdateValueprops containedconsole.logcalls. Replaced with no-op functions.Motivation and Context
Fixes #10521
window.propsexposed internal application state to the browser console in productionHow Has This Been Tested?
window.propsassignment is now gated behind a development environment checkScreenshots (if appropriate):
N/A
Checklist
My PR contains...
src/is unmodified: changes to documentation, CI, metadata, etc.)package.json)My changes...
Documentation
Automated tests