Suggest using babel to remove console.* calls#13651
Closed
Emilios1995 wants to merge 2 commits intofacebook:masterfrom
Closed
Suggest using babel to remove console.* calls#13651Emilios1995 wants to merge 2 commits intofacebook:masterfrom
console.* calls#13651Emilios1995 wants to merge 2 commits intofacebook:masterfrom
Conversation
Contributor
Author
|
cc @mkonicek |
hramos
reviewed
Apr 25, 2017
docs/Performance.md
Outdated
| When running a bundled app, these statements can cause a big bottleneck in the JavaScript thread. | ||
| This includes calls from debugging libraries such as [redux-logger](https://github.com/evgenyrodionov/redux-logger), | ||
| so make sure to remove them before bundling. | ||
| You can also use this [babel plugin](https://babeljs.io/docs/plugins/transform-remove-console/) that removes all the `console.*` calls. You need to install it first using `yarn add babel-plugin-transform-remove-console`, and then edit the `.babelrc` file under your project directory like this: |
Contributor
There was a problem hiding this comment.
Can you use npm instead? We're all big fans of Yarn but we haven't yet updated our docs with Yarn instructions, so it's best if we use npm for consistency.
People who've installed Yarn are more likely to be aware of what the equivalent Yarn command is.
Contributor
|
@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
|
How can I make sure that my production code does not have |
adambene
reviewed
May 16, 2017
| This includes calls from debugging libraries such as [redux-logger](https://github.com/evgenyrodionov/redux-logger), | ||
| so make sure to remove them before bundling. | ||
| You can also use this [babel plugin](https://babeljs.io/docs/plugins/transform-remove-console/) that removes all the `console.*` calls. You need to install it first using `yarn add babel-plugin-transform-remove-console`, and then edit the `.babelrc` file under your project directory like this: | ||
| You can also use this [babel plugin](https://babeljs.io/docs/plugins/transform-remove-console/) that removes all the `console.*` calls. You need to install it first with `npm i babel-plugin-transform-remove-console --save`, and then edit the `.babelrc` file under your project directory like this: |
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.
This PR adds a suggestion to the docs to use the
transform-remove-consolebabel plugin in production to removeconsole.*calls.This information was previously in the docs, but was removed because the babel plugin didn't work.
But now it's working well, as reported here, so it would be helpful to add the suggestion again.
Ideally, this would be done automatically, as I suggested in #8337