Like this is not a right image or hello or whatever. This way they cannot tell you they are not able to reproduce it. Because you have that recording, you have the proof, and you actually have the code inside here.
So what that means is that if you look over here, the jump to code has taken me into the component that was actually triggered when I was clicking on that plus button. Now here on the left, there's this gutter, and this number 10 that you see over here is actually telling me how many times this line of code was actually hit. So that's already useful information. It sort of works like code coverage, where you can see which lines of code were hit and which ones were not.
And what you can do is you can click on this plus symbol, and on the console you can now see all of the instances where that line of code was called. So there's this default text quantity control and line number nine. But what I can do to get some insight is to print out some variable. For example, this quantity over here. And now I can see the quantity variable that has been passed into this setQuantity function, and I can see how that's changed over time. And I can rewind back or go forward.
Now there are some people that are using debugger. Well, you can use debugger in here, not only print statements. So I added a breakpoint by clicking on this number nine, and now I can go back and debug this, right? So let's go to the timeline. Let's look at this Scopes panel over here. Wait, actually, let's jump into the breakpoint. We got the quantity two, so we can move forward, or we can move backward. Wait, let me wait for this to load. Now we got quantity three. Let's move on backwards to quantity two. So if you have used breakpoints and debugger, you might have accidentally clicked one more time that was needed. I guess everyone has felt that. So if you have that recording and you're debugging the recording, you can move back and forth.
Now usually when you debug, the way you do that is that you sort of modify your code. You add a console log somewhere or add that debugger statement in your code, and then you run that and try to replicate that and hope that you could get to that issue. And you need to do that several times. With replay, if you have that recording, you can actually just record, cache the bug once, and then add those print statements and whatever, anytime you need. Also, if you want to share that, you can click on share button and send it to whoever needs to fix that.
Comments