-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Framework: Allow debug everywhere #12841
Conversation
2456497
to
2776e47
Compare
client/lib/debug/index.js
Outdated
|
||
export default ( ...args ) => { | ||
if ( config( 'env_id' ) === 'production' ) { | ||
return () => {}; |
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.
maybe just use lodash/noop
or a single noop function to cut down on the number of functions we create?
The default cache key implementation for https://github.com/Automattic/wp-calypso/blob/b5b487b/client/lib/create-selector/index.js#L38-L61 |
@aduth, that only works for differentiating between docker vs. dev server. With these constraints, my current thought is that it could be best to use the regular |
I believe this PR would fix #12277 |
f64b680
to
45240b3
Compare
I just tested locally + in docker. both w4m |
I tested out the difference in bundle size. The vendor chunk grew from 672K --> 676K. |
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.
Seems fair to me. I would like some cake for this review.
this suggests to me that we made a poor replacement: we were almost certainly leaving in the strings which were the largest part of I wonder what would happen to the size if we not only removed |
@dmsnell: yep! That would make a much larger difference for build size Just did a quick check and it looks like we have something on the order of 1.5 thousand debug calls across calypso. When i grepped all the lines and zipped them it was ~ 25Kb. |
Thanks for the review @dmsnell! I'll merge this in tomorrow afternoon unless there are objections that come up. |
when I asked about the build size difference this is about what I expected to find. that could also easily cut down our build size. now I'm wondering why we ever disabled |
Stop replacing debug with debug-noop in in production.
Thinking:
To Test: