♪♪ Today I want to talk to you about rendering and whether we're going to sync or not sync. There was a funny typo when this first got shared on Twitter, where it was actually S-I-N-K, and I was thinking, oh no, is that what they're predicting my talk to be? But let's hope not. So, to sync or not to sync? Let's dive into this. It should be hopefully be an easy question to answer.
Which of these grids is better? So, on the left, we've got Agigrid running in version 17 of React, where you've got this nice, smooth scrolling, you can click the scroll bar, and the rows just appear in the right place. But then you upgrade to version 18. So, this isn't a live version of Agigrid, this is an older version which had this issue. You click the scroll bar and the rows flash, or you start scrolling up and down and the rows blank out. And it's like, as you can tell, this is not what we want the user experience to be. So, we're going to have to try and work out what is going on.
So, as you know, I'm Steve, and I do work at Agigrid, I'm on the core grid team. And so, Agigrid is what we're trying to do is create the best JavaScript data table, whether that's in React or any of the other frameworks. It's a free tier as well as the Enterprise, and if you want to find out more, do come speak to us at the booth. We'd love to talk to you about all of it. But enough about that, let's try and clarify what we're trying to fix and how React has changed, how we can try and work out what those changes are, and then how we can fix it.
The first bug we're gonna look at is clicking the scroll bar causes this flash. Let's see, can you see that? Yes. And then, the second issue we've got is when you're scrolling, they're completely wiping out. Okay, and so, this is the only line of code which is different between those two examples. So, we've upgraded to version 18, and then we switch to CreateRoot. So, when you're using render, it's the equivalent, basically, of the rendering from version 17, but now with version 18, switch to CreateRoot, and then you're gonna start enabling all these concurrent rendering features and automatic batching. And so, that's what we're gonna do. We're gonna go bug hunting.
The first thing to do is, well, let's look at the code which is causing the updates for the road, and there's nothing exciting here. It's just state. So, when the road's changing, you scroll and you need to look at new roads. We're gonna update which roads are displayed. So, there's nothing really, I mean, unusual there, or complicated, or anything that should be going wrong. But I think there's some prime suspects for this issue in version 18, concurrent rendering and also automated batching. And what we're gonna do is, and see if it's these two features which are now interacting negatively with Aggrid's row virtualization.
Comments