And if we come back here before we save this, then there we go. And that's really, that's really it. We did all of that in a couple of minutes. I could, if I wasn't talking so much, I could have done that a lot faster even, but that's front to back, all the way on the React side, to the GraphQL, all the way to the backside, Prisma, to the database, the whole thing with just a few lines of code, a few generator commands, and that's really how easy Redwood tries to make everything that you do.
Now I mentioned before that we have Storybook integration as well, so I'd like to show that off real quick. In order to get the server, the storybook server running, I'm gonna run yarn Redwood storybook. And that'll take a few seconds to spin up. And when it's done, it's gonna launch this page, and you'll see here we have the storybook stories for the things that I've generated. We have the count page, which is generating, and check this out. It actually has some data for the count that's coming back, but that's interesting. 42, where did that come from? And why does it say ID there? That's a little bit weird.
Well, the reason that that's happening is that it's pulling it from here. So the count page is that whole page, is pulling from this count cell. And one of the things that we do for you, if you were paying attention over here when we created this, and I came into this directory, is you'll see this mock file. And this mock file is gonna make it really easy for you to see your cells in storybook, because mocking out your data fetching in storybook is one of the real challenges to getting storybook working really nicely with your application. Again, Redwood tries to make it really easy for you. And so, we have the concept of mocking your data fetching. And in this case, we've just said, we think that todos count is going to return an object with an ID. You might remember that that was what we guessed you were going to do. But it's very easy to come in here and just say, Oh, it's actually just returning a number. And save that. And now, you'll see that the success state of this updates. And indeed, the page itself will update. So, all of these components can use these mocks, the cells. And that means that when you have a page or you have a cell or component that has a cell in it, anytime you have one of those, if you use it in your storybook, it's cool. It's just going to pull this mock data and it's going to include that. So, it's still very easy to visualize your components and work with them without the hassle of trying to think about how you're going to get that data mocked out in there. And again, you can very easily now work on the loading states of these things. So, to dos count cell has these various states. I might want my loading state to just say, just wait. I can save that. And now, instead of trying to be in my app and clicking refresh and being like, oh, what did it, what, does it look right? Oh, I see it. It's there for like a, you know, a hundred milliseconds or something, even less. That's kind of a pain. And I can go to my inspector and I can make my page really slow. And that's annoying. But that's why we have storybook. Now, I can come in here and I can stare at it for as long as I want. And I can just, I can make it work. Or the empty state, what does that look like? What happens when I get an error? If I want to make an error happen in my application, I have to go into my implementation, probably, and add some kind of a syntax error so that it's going to throw some kind of error. Now don't screw around with that. That's why we have storybook and Redwood is all about making the entire thing, the entire application development process end to end as smooth as it can possibly be with as little amount of work, as little amount of boilerplate as we can possibly make it for you. We have spent so many hours reducing boilerplate and doing integrations of these products. Integrating Jest, integrating storybook, removing Webpack. You'll notice that in here, you really don't see Webpack at all. You don't see Babel at all. Of course, we have some config files for you in case you need to dig into them, but you never have to touch them, really. If you're just doing normal things, this is not a part of your job anymore. Let the framework do the heavy lifting for you so that you can focus on your business logic. Well, what else can Redwood do for you? Well, I'd like to show you something that we released recently.
Comments