Closed Bug 1224751 Opened 8 years ago Closed 7 years ago

Make React's perf tools use the right console


(DevTools :: General, defect)

Not set


(firefox46 fixed)

Firefox 46
Tracking Status
firefox46 --- fixed


(Reporter: fitzgen, Assigned: jryans)



(1 file)

I'm not really sure how to do this, but it would be _super_ helpful for me right now.
React's perf tools are already included in the dev version. I got it working with the memory tool last week but never found time to show you (not sure how much it helps at a glance anyway, probably takes some time to go through and parse the data).

There was one snag, the oh-so-common console problem. It looks like the `console` that React references is not the normal window console, so `console.table` is not available, which the perf code uses to dump data. I hacked my local build to reference `window.console` and it worked.

We could probably make the browser loader use `window.console` by default (just override that global), but that whole situation seems like a mess and I don't know the implications of that (no stdout I guess).
I've confirmed that the perf tools are included in the dev version. The problem is that it doesn't get the web `console` instance, so it doesn't have functions like `console.table`. We've ran into this in several other places, and we should just fix it.

Not sure if we should fix it just for this bug (maybe forcing the global `console` to reference the right one by way of BrowserLoader) or resolve this as a duplicate of another bug which is about fixing console references generally (which I'm hoping exists)
Summary: Include react's perf tools in our react build → Make React's perf tools use the right console
I have seen this issue with other modules as well.  I think it's fine to change the global in BrowserLoader.  Will send my patch.
Assignee: nobody → jryans
Attachment #8710053 - Flags: review?(jlong) → review+
Comment on attachment 8710053 [details]
MozReview Request: Bug 1224751 - Use the window's console in BrowserLoader. r=jlongster

Seems sensible to me. I'm a little sad we have to hack it, but it makes sense.
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 46


STR: Not clear.
Developer specific testing

Name 			Firefox
Version 		46.0b9
Build ID 		20160322075646
Update Channel 	        beta
User Agent 		Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
OS                      Windows 7 SP1 x86_64

Expected Results: 
Developer specific testing

Actual Results: 
As expected
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.