Repository navigation
Added groupCollapsed polyfill - #21457
Eyesonly88 wants to merge 2 commits into
Conversation
analysis-bot
left a comment
There was a problem hiding this comment.
Code analysis results:
eslintfound some issues.
| groupStack.push(GROUP_PAD); | ||
| } | ||
|
|
||
|
|
| table: consoleTablePolyfill, | ||
| group: consoleGroupPolyfill, | ||
| groupEnd: consoleGroupEndPolyfill, | ||
| groupCollapsed: consoleGroupCollapsedPolyfill, |
There was a problem hiding this comment.
I think this should be the consoleGroupPolyfill. I believe console.groupCollapsed should behave the same as console.group in a non-debugger environment logging to the OS.
There was a problem hiding this comment.
Hey @newyankeecodeshop if I use consoleGroupPolyfill then the log won't be collapsed because of GROUP_OPEN inside consoleGroupPolyfill.
There was a problem hiding this comment.
@Eyesonly88 I don't understand how the GROUP_OPEN character vs. GROUP_CLOSE makes a difference about whether the group is shown collapsed. When you attach the Safari debugger to the JSContext, is it still using the console polyfill?
There was a problem hiding this comment.
@newyankeecodeshop Yes it is using the console polyfill. Without my code, there is no groupCollapsed. As you can see in the demo, using GROUP_CLOSE makes it collapsed.
There was a problem hiding this comment.
groupCollapsed isn't there because the console object in the JSC is not the original console object. The original one is called after using a polyfill method;
facebook-github-bot
left a comment
There was a problem hiding this comment.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
Thanks for the PR. Seems like it previously fell through the radar. Sorry about that! |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@Eyesonly88 merged commit 638d672 into |
groupCollapsedis used to group logs but collapsed which is very useful when the console has many logs (e.g. when usingredux-logger).For developers who prefer to debug iOS apps using Safari JSC, the
groupCollapsedwas not polyfilled.Fixes #21446
Test Plan:
I tested it in the Safari Developer console.
Input:
Output:
A single collapsed log containing the other logs as expected. See demo below.
Demo:
Release Notes:
[GENERAL] [ENHANCEMENT] [JSC] - Added
groupCollapsedto the console polyfill to enable log collapsing in consoles such as Safari