-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add HostPromiseRejectionTracker #76
Conversation
👏👏 Great to see this finally progress. |
b4ffb30
to
97a0dd5
Compare
This new feature uses a pair of events on global scopes, viz. unhandledrejection and rejectionhandled, to allow authors to track unhandled promise rejections. The specification was originally drafted at https://github.com/domenic/unhandled-rejections-browser-spec in collaboration with @jeisinger and @bzbarsky. This feature depends on tc39/ecma262#76.
I am bought off on the necessity of some affordance for Promise rejection tracking for dev tools. What I don't yet understand are the following:
These aside, this could be contentious so I think we should discuss this in November at the F2F before I pull it in. I want be careful not to compromise our consensus process by overzealously merging PRs. |
Sure, happy to help!
This was outlined in the original proposal, which maybe I should have included in the commit message. Essentially, the use case is the same as for
Yeah, exactly; it's origin-related. Actually, thank you for the reminder; I had not taken care of that properly in whatwg/html#224 yet. But yes, you should not be able to read error messages or stack traces from cross-origin scripts. This is taken care of by the "muted errors" flag, which you can click to see all the places it impacts.
Error reporting mechanisms vary greatly across hosts. Web browsers have multiple global scope types, each with their own type of event loop and resulting way of enqueuing tasks to notify as such. There you use Although in theory providing such machinery in 262 would be nice, in that it would allow writing portable code for this sort of thing, in practice doing so would be both difficult and have a low payoff. It would be difficult in that it would require creating new machinery for this type of event handling or live list or similar, and driving that to consensus. And it would require specifying the event loop at a much deeper level than ES currently does; as you can see from e.g. https://github.com/whatwg/html/pull/224/files or https://www.w3.org/Bugs/Public/show_bug.cgi?id=25981, the level of detail needed for a feature like this is pretty great, and that's not even trying to be compatible with environments outside browsers. Finally, it would not be that useful either, since error-reporting mechanisms are not really something you want portable code for. Reporting client-side errors in a browser-based web app is going to be done very differently than logging server errors in a Node.js server, or logging runtime errors in an embedded device. All of the telemetry uses are going to require some kind of I/O, so the code isn't going to be all that portable anyway.
Seems quite reasonable to me. Feel free to tag this with "pending f2f" or something. I'll put the topic on the agenda. |
Includes my agenda item, tc39/ecma262#76.
c1cf104
to
018cd75
Compare
018cd75
to
a078249
Compare
b3b0826
to
35036ac
Compare
Per Nov 18 TC39 meeting, this is good to go. Additionally, TC39 has empowered the editor to allow changes to improve the layering of ECMAScript with other relevant specifications when the semantics are unobservable. Only requirement is that they are called out explicitly in the release notes. 🎆 |
👏🏻 awesome |
This new feature uses a pair of events on global scopes, viz. unhandledrejection and rejectionhandled, to allow authors to track unhandled promise rejections. The specification was originally drafted at https://github.com/domenic/unhandled-rejections-browser-spec in collaboration with @jeisinger and @bzbarsky. This feature depends on tc39/ecma262#76.
@domenic can you rebase? |
[[PromiseIsHandled]] needs to be added to the list of internal slots in 25.4.3.1 Promise, step 3. |
35036ac
to
e8bb788
Compare
This is a non-observable change that will allow HTML to provide events for tracking promise rejections, as outlined in https://github.com/domenic/unhandled-rejections-browser-spec. For more information on the original proposal and use cases (mostly on the HTML side), see https://lists.w3.org/Archives/Public/public-whatwg-archive/2014Sep/0024.html. The corresponding HTML pull request is at whatwg/html#224.
This new feature uses a pair of events on global scopes, viz. unhandledrejection and rejectionhandled, to allow authors to track unhandled promise rejections. The specification was originally drafted at https://github.com/domenic/unhandled-rejections-browser-spec in collaboration with @jeisinger and @bzbarsky. This feature depends on tc39/ecma262#76.
This new feature uses a pair of events on global scopes, viz. unhandledrejection and rejectionhandled, to allow authors to track unhandled promise rejections. The specification was originally drafted at https://github.com/domenic/unhandled-rejections-browser-spec in collaboration with @jeisinger and @bzbarsky. This feature depends on tc39/ecma262#76.
Committed as |
Includes my agenda item, tc39/ecma262#76.
This is a non-observable change that will allow HTML to provide events for tracking promise rejections, as outlined in https://github.com/domenic/unhandled-rejections-browser-spec.
On top of #75 for convenience.