Live data from Hacker News

Debugging Asynchronous JavaScript with Chrome DevTools

html5rocks.com

21–30 of 50 posts

Re: Debugging Asynchronous JavaScript with Chrome DevTools

#21
Willing to take the rep hit...

Is HN really so focused on front end that this particular topic finds itself rapidly at the top of news feed and staying there for an extended amount of time?

Has there been a recent poll about topics active HN viewers deem as important? If it really is this JS heavy, that is intriguing.

Re: Debugging Asynchronous JavaScript with Chrome DevTools

#22
post #3

I'd like a real console object in worker (at least a variadic pretty-printing log() function and time()/timeEnd()) and a "break all threads" button too, please. Worker debugging is a pain.

I know it took a while, but take another look: Chrome now has full console support inside of workers: http://crbug.com/63383 Right now, we're doing a bunch of work (hah) on our worker support. We'll address pausing execution in workers as well. Expect good improvements and file a ticket at crbug.com for any other ideas, please!

I don't get it, 10h ago I still didn't have the fancy console.log() in workers (34.0.1847.116). Maybe there is a difference between the per worker debugger and the page global debugger, but my worker are transients (I do heavy computation without stopping the UI thread), so using the per worker debugger is not really practical.

Re: Debugging Asynchronous JavaScript with Chrome DevTools

#23

Willing to take the rep hit... Is HN really so focused on front end that this particular topic finds itself rapidly at the top of news feed and staying there for an extended amount of time? Has there been a recent poll about topics active HN viewers deem as important? If it really is this JS heavy, that is intriguing.

Well, HN itself is a poll.

Re: Debugging Asynchronous JavaScript with Chrome DevTools

#24
post #23

Willing to take the rep hit... Is HN really so focused on front end that this particular topic finds itself rapidly at the top of news feed and staying there for an extended amount of time? Has there been a recent poll about topics active HN viewers deem as important? If it really is this JS heavy, that is intriguing.

Well, HN itself is a poll.

True. The frontend/js focus is a tad disappointing considering how many other technologies are involved in ramping up/running most companies.

Re: Debugging Asynchronous JavaScript with Chrome DevTools

#27

Willing to take the rep hit... Is HN really so focused on front end that this particular topic finds itself rapidly at the top of news feed and staying there for an extended amount of time? Has there been a recent poll about topics active HN viewers deem as important? If it really is this JS heavy, that is intriguing.

I think the core idea here is beyond the javascript it's implemented in. I've never seen a debugger that can do this kind of async debugging before anywhere.

Don't you think it's more novel than being some trick only relevant to front end web development work?

Re: Debugging Asynchronous JavaScript with Chrome DevTools

#28
post #6

Very nicely produced article, i love the use of animated gifs that is becoming popular for tech demos.

I think it's odd, to be honest, given the existence of the html5 video tag. Of course, last time I checked, there wasn't a standardized video codec yet, which would make it tl;dr for authors.

Re: Debugging Asynchronous JavaScript with Chrome DevTools

#29
post #13

Wasn't this possible already? Put a breakpoint or 'breakpoint;' on the function body's first line and it will pause execution when the function is called synchronously or asynchronously. And browse the call stack on the right column. What's new here? I have been doing this for quite sometime.

This assumes you know the function that's being triggered. It's not always clear. And throw JQuery into the mix and things get murkier pretty quickly.

A means to group entries in a call stack together would be neat too; in most cases, something you're tracing won't be an issue in jquery or your library, so collapsing those would be neat.

Re: Debugging Asynchronous JavaScript with Chrome DevTools

#30
It would have been interesting to be able to setup your own stack links (e.g. by collecting Error().stack, and being able to update this at any other point - Error.setStack?). A heap of 3rd party promise/observer/animation/etc libraries could use such a feature to ease debugging. The current implementation does not allow for this [1].

[1] https://code.google.com/p/chromium/issues/detail?id=272416

Post reply on HN