react icon indicating copy to clipboard operation
react copied to clipboard

Add Async Stack Tagging API support

Open Jack-Works opened this issue 3 years ago • 6 comments

Chrome recently shipped Async Stack Tagging API that can significantly improve the debug stack.

Angular is already using it. See https://developer.chrome.com/blog/devtools-better-angular-debugging/#the-async-stack-tagging-api

image

Since React is using time slicing to split the task, it is not convenient to debug why the update is triggered. If React supports Async Stack Tagging API, it will be much easier to find out why an update is triggered.

Jack-Works avatar Nov 25 '22 12:11 Jack-Works

Working on it:

image

image

Jack-Works avatar Nov 26 '22 14:11 Jack-Works

@Jack-Works Curious if you ever made further progress on this? It would be super useful.

Further resources:

  • https://developer.chrome.com/docs/devtools/console/api/#createtask
    • console.createTask(name)

    This method is known as the Async Stack Tagging API. If you use a framework or abstraction for scheduling and async execution that already uses this API under the hood, you don't need to call this API directly.

  • https://developer.chrome.com/blog/devtools-modern-web-debugging/#linked-stack-traces

See also:

  • https://github.com/unjs/hookable/pull/69
  • https://github.com/unjs/hookable/pull/68

0xdevalias avatar Dec 01 '23 21:12 0xdevalias

@Jack-Works Curious if you ever made further progress on this? It would be super useful.

Sorry No, I'm working on other open-source projects these days. I'm still willing to implement them, but only when the React team says they accept the contribution of this feature otherwise I am afraid this will be rejected for some reasons.

Jack-Works avatar Dec 02 '23 04:12 Jack-Works

I'm still willing to implement them, but only when the React team says they accept the contribution of this feature otherwise I am afraid this will be rejected for some reasons.

@Jack-Works nods that's totally understandable.

Do you have your test branch where you started implementing the above pushed anywhere? It might be a useful resource for others if they wanted to take up this in future.

0xdevalias avatar Dec 02 '23 05:12 0xdevalias

Relying on Async Stack Tagging would be absolutely a blessing when debugging React :|

reaktivo avatar Feb 09 '24 15:02 reaktivo

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

github-actions[bot] avatar May 09 '24 16:05 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

github-actions[bot] avatar May 16 '24 16:05 github-actions[bot]