In short
Podcast Summary: React Remix with Ryan Florence
Podcast Details
- Title: Software Engineering Daily
- Episode Title: React Remix with Ryan Florence
- Host: Josh Goldberg
- Guest: Ryan Florence
- Release Date: March 20, 2025
- Description: The episode explores Remix, a full-stack, open-source web framework built by the creators of React Router, focusing on features like server-side rendering and efficient data loading to enhance developer experience.
Episode Overview In this episode, Ryan Florence, co-creator of React Remix, discusses the framework's evolution, its relationship with React Router, and its acquisition by Shopify. The conversation delves into the technical details of Remix, its architecture, the impact of server-side rendering, and the future of web development.
Key Topics Discussed
- Background of Ryan Florence
- Experience: Ryan has been involved in web development since the mid-90s, starting with web projects for his father's ISP.
- Notable Works: Co-author of React Router and Remix, working alongside Michael Jackson.
- Remix Framework
- Definition: A full-stack framework emphasizing web standards and efficient data handling.
- Core Features:
- Server-side rendering
- Flexible data loading
- Enhanced developer experience
- Evolution: Initially server-rendered, Remix has adapted to support client-side applications without requiring a server.
- Acquisition by Shopify
- Business Model Transition: Initially sold licenses for Remix but transitioned to being acquired by Shopify, allowing for enhanced funding and resources for development.
- Integration with Hydrogen: Discussed the relationship between Remix and Shopify’s Hydrogen, aimed at building custom storefronts.
- Technical Developments
- Changes in Architecture: Transition from a server-requirement model to a more flexible structure that allows developers to create SPAs (Single Page Applications).
- React Router v7: All features from Remix have been integrated into React Router, allowing for greater use and flexibility.
- Type Safety Improvements: Enhanced TypeScript support, making it easier for developers to ensure their applications are robust and error-free.
- Future of Remix and React Router
- Web APIs as a Focus: The development team aims to leverage web APIs for building resilient applications.
- Community and Ecosystem Development: Emphasis on building tools and frameworks that can be used across different platforms, enhancing collaboration within the developer community.
- Personal Insights
- Optimism About Web Evolution: Ryan reflects on the rapid advancements in web technologies, expressing excitement about the future.
Key Takeaways
- Remix is evolving to become more flexible and developer-friendly, supporting both server-rendered and client-side applications.
- The integration of TypeScript and web APIs is crucial for enhancing the framework's capabilities.
- The future holds exciting possibilities for web development, focusing on collaboration and the use of emerging technologies.
Conclusion This episode provides an in-depth look at the development of Remix and React Router, along with their future directions under Shopify's guidance. Ryan Florence's insights emphasize the importance of adaptability in web frameworks and the ongoing evolution of web development practices.
For more information, check the [Software Engineering Daily episode page](https://softwareengineeringdaily.com/2025/03/20/react-remix-with-ryan-florence/).
Written by AI. May contain mistakes. Listen to the episode to check what was said.
Transcript
Automatic transcript. May contain errors.0:00Remix is a full-stack, open-source web framework that was developed by the creators of the popular React router library. It focuses on features such as server-side rendering and efficient data loading, and it emphasizes developer experience. Ryan Florence is a co-creator of React Remix, and in this episode, he speaks with Josh Goldberg about the Remix project. This episode is hosted by Josh Goldberg, an independent full-time open-source developer. Josh works on projects in the TypeScript ecosystem, most notably TypeScript ES Slint, the tooling that enables ESLint and Prettier to run on TypeScript code.
0:38Josh is also the author of the O 'Reilly Learning TypeScript book, a Microsoft MVP for developer technologies, and a live code streamer on Twitch. Find Josh on Blue Sky, Mastodon, Twitter, Twitch, YouTube, and.com as Joshua K. Goldberg.
1:07With me today, back to the podcast, is Ryan Florence. Ryan, welcome to Software Engineering Daily. Thanks for having me. Excited to be here again. Yeah, we've been looking back at your old interviews, and you've talked about a lot of really cool stuff on the show, and we're going to dive into a lot of cool stuff today. But before we get into the wonderful world of Remix, can you tell us a little bit about yourself and who you are? Sure. I'm Ryan Florence. I live in Utah and I've been doing web stuff since the beginning of the web really. My dad invested in an ISP when I was a teenager back in the mid 90s.
1:41Then I started doing websites for customers of theirs. One of them was a plastic surgery before and after photos thing. And as like a 16 year old, that was like, that was not something I wanted to work on. But anyway, yeah, I've been doing web stuff for a really long time. I remember when CSS was invented. I remember the Jscript versus JavaScript thing with Internet Explorer and Netscape and Mozilla before that. But anyway, and then more recently, what most people probably know me by is React Router and after that Remix. So I was a co-author of both of those along with my career partner, Michael Jackson.
2:20He and I have been doing stuff together for over a decade now. So yeah, love working with him. He's brilliant and just awesome person to work with. And so it's been fun working on all that stuff. That's what people might know me by. And I love playing guitar. Oh, you can't see it over there. And just music generally. Same with Michael. That's why the Remix brand has so much music stuff with it. And snowboarding and soccer and raising kids. I got three of them. So that's me. I just connected Remix as in River Remix. that's what the connection is? Yeah. Yeah. Remix. Amazing. Just curiosity. Do you ever look back at all the advances in the web and feel some sense of positivity or optimism about how far it's gone since you started?
3:05Oh man. That's sort of like looking at your teenagers and like, sometimes you feel like, wow, we nailed it. We did such a good job raising these kids. And there's other times you're like, where did I go wrong? What did we, what did we do to mess this child up so much. And the web definitely feels that way to me where it's like, sometimes it's just incredible. I mean, the fact like what we're doing right now in Riverside FM, we went to a website, right? We open up a browser. The first browser that I ever used, links was just in the terminal and it just sent you text. It was, it was hilarious to where now I punch in Riverside FM slash whatever this idea is.
3:46And now we're, we're streaming and uploading and communicating in real time with like, what, probably 20 milliseconds of lag between when I speak and when you hear it, that blows my mind. Yeah. So it's incredible what we've done with the internet and with browsers in particular, that web tech can do this. The financial models aren't there for a lot of the things. I think that's the thing that I lament the most is, you know, we got WebGL. We could have, you should be able to go to eldenring.com, and start playing Elden Ring. We have technology in the browser that should make that possible, but we don't have that, I think, primarily because of financial models where it's pretty much just ads.
4:27E-commerce is like the, what do they call it? That's the killer app of the web, right? E-commerce is the thing that I think the web is clearly the best at. You can just go and shop and buy stuff. and then uh but everything else it's kind of it's it's hard to just always do ads to make money so app stores and stuff you make a really coincidentally good segue you mentioned that you co-authored remix and react router y 'all were in some way acquired by shopify could you tell us what what the actual thing that happened was yeah we were we were acquired by them so how does that worked though for an open source project to now be owned or acquired by a company?
5:08I don't think it's different than others except for that we had no revenue. No, we actually did. We actually sold Remix at first. Our first model was selling licenses to use it. So it was open source, but you had to pay to use it. So we actually did have some revenue. Yeah, we had been building Remix. We raised some VC money. We're building the framework. And then always in the back of our head was like, well, then what's the business model? At first it was licenses, but we always knew that we were going to graduate past that and do something else. So do you build services on top of it? Do you do hosting like, you know, Next and Vercel?
5:44That's how most VCs thought of us. Like that's what they all wanted us to do was build a platform like Vercel on top of Remix. Anyway, so we had a bunch of ideas about what we were going to do. And then we saw that Shopify was building Hydrogen, which had a lot of overlap with what Remix was doing. And Kent C. Dodds at the time was working with us. And he reached out to them and was like, hey, we have no particular thing we want to pitch you on or anything. But we're both building similar things on top of React. Let's talk. And so we learned about Hydrogen. They learned about Remix. And from there, it just eventually ended up with them saying, hey, how about instead of having to come up with a business model, you know, we raised some VC money, but that'll run out.
6:25So instead of worrying about your business model, how about you come and just build Remix at Shopify? and essentially Shopify funds the development of Remix and we just build it under their roof. So it's really fun because of course, it's fun to build products and stuff, but our heads were just in Remix for the most part. And that's what we wanted to work on, or at least that's what I wanted to work on. Yeah, so you sign some papers and make a deal and then they send you a work laptop. And off you go. Yep, and off you go. How would you have described Remix, let's say two years ago? Just know that the follow-up question is going to be, how would you describe Remix in six months from now or a year from now?
7:03That's making me just think about what are the differences now, but I think I would still describe it the very same way that I worded it on our website. I don't have it memorized. I'm going to go look at it. Focused on web standards. Yeah, it says Remix is a full stack web framework that lets you focus on the user interface and work back through web standards to deliver a fast, slick, and resilient user experience. I think that's how I described it four years ago. That's why I would have described it two years ago. I would describe it now as I would just say, instead of Remix, I would say React Router.
7:35Yeah. Let's talk about that, actually. React Router, the router, or one of the big routers for React. Before we go there, I do want to talk about what changed after we got to Shopify with Remix. Remix was very much, I don't know if server first is the word, but server required. It always server rendered. You always had a server. you always had to deploy either a Node or a Cloudflare or a Dino or Bun server. So we had the whole full stack JavaScript thing going on. I always like to say center stack because some people, when you say full stack, think, where are your queues? Where's your database arm?
8:08Where's all this stuff? And it's like, okay, we're center stack. We cross the gap, but then you get to do whatever you want on those sides. Anyway, so it's very much started with a server. When we got to Shopify, there's a handful of things. They don't just build e-commerce with their framework, Hydrogen, on top of Remix, but they're using React Router everywhere. So React Router is like when you log into your store. If you are a merchant, that's a React Router app. If you are in that admin interface, you can add what we just call apps, third-party apps, where maybe someone can create a shipping tracker app that you can add to your Shopify store.
8:46and those are just like one-click installs for a merchant and those apps are hosted on you know they're built by whoever this app provider is but then they're integrated into the admin interface so that a merchant you know has a really nice cohesive it's sort of like an operating system for your your store everything's right there you don't have to go log into someone else's thing to like work with your shipping stuff you can just do it right there and so those third party apps, we had some templates for people to use React Router. So there's this kind of big push, like, hey, how can we adopt Remix in more places?
9:20And that actually pushed us to soften up the server requirement. And we brought a lot of the abstractions from Remix over into React Router directly so that you could do things like define your data for the page for your route, define the actions for a route. But instead of doing those things on the server the way that we did in Remix initially introduced these concepts of client loaders and client actions and they would just run in the browser and then we even got rid of the server requirement where it could just run as a full-blown spa with no server or server rendering at all and so that helped get a lot more remix adoption too where people like i don't actually want to run a javascript server but i do like the way that you organize code and remix with loaders and actions and getting access to all those pending states when those things are pending so you can build a nice user interface.
10:11That's the big difference that happened from before we got to Shopify and then now is we really beefed up the flexibility of how to deploy a Remix app. You don't have to have a server. Yeah, I remember when the static HTML feature started going into, I think it was beta or however you call it. That was very exciting. There's been a lot of back and forth on the web over traditionally it was called MPAs, multi-page apps versus single-page apps, SPAs. Not the most helpful delineation these days. It's all fuzzy, but I think we all generally now agree on what we mean by SPA. Yeah. Are there particular architectures that you think Remix is moving more towards or away from?
10:52Or do you see like a next set of steps in Remix React Router's future for that? Let's go back to the, what's happening with React Router? And then I think we can get to that question. Your questions I'm always going to keep putting at the end of the stack and then we'll pop them off. Yeah, so after all that work, we realized, the question you just asked me, though, is do I think that Remix has a specific architecture that it lends itself toward more than others? Is that kind of? Yeah, I'm just curious, your perspective on what are the right way or set of ways to work with Remix if there is such a set?
11:24Yeah, is that a cattail I see walking back and forth? It is, he's a very needy cat. I was like, what is that? And I was like, oh, that's a cat. Actually, I think I can speak to both things at the same time. So the short answer is no, I don't view Remix and React routers having a preferred architecture. React router is actually really old in web years. You know, like you think about CSS was created 22 years ago, I think. So it's like CSS. Like I think kids today probably just kind of assume that has existed forever, right? I remember when I realized that the beetles weren't like a thousand years ago.
12:03I was like, oh, wait, the beetle, there are beetles who are still alive. Like that, that just blew me away. Remember I was like a teenager. I think that's the way CSS is for some kids where it's like, oh, that's, it's not that old. It's only like 22 years old. React router is 11, 10, 11 years old. So it's half as old as CSS itself. So this project has been around for a long time, and React itself has always been super flexible, too. We've always been able to server render React from the beginning. Most people didn't, but it was always there. You could run it on mobile and React Native. It's always been a very flexible thing.
12:39And React Router has always tried to support the great flexibility of React. So when Remix added a bunch of server stuff, right afterward, React itself did too with React server components and server actions. And then they introduced a bunch of things like use action state and use optimistic and use transition. All of those concepts, all of the use cases for those things in React, we had like a cognate over in Remix already. So it's been kind of tricky for us to figure out like, do we deprecate our stuff? We just go straight to that stuff because there's like 90 % overlap. If you have like a task, which API are you going to use?
13:21With React getting more involved with the server and with transitions, being an old project, we want to support that and those new models of how to deploy a React app with the assumption of a server like React server components. But we also have to recognize that we've got a decade of highly successful apps still running React Router without servers like that. Like right now we're in Riverside FM. It uses React Router, but it doesn't use any of our server features and it doesn't use any of React server features either. And so we're not just going to bail on that paradigm. It's a successful paradigm.
14:00Linear, which is an app that everyone talks about all the time as being kind of like the pinnacle of web UX with local first and doing a data sync. They use React Router and not using any of our async stuff like loaders and actions. They're just using the components that match URLs and then the components and hooks that let you navigate around and read state from the URL. So we're not going to go like say, oh, we think you definitely need to have a server to run React Router, we would not be serving the user's needs that we've had for the last decade by doing that. So while I think that there are some new architectures that are novel and interesting with server components, there's just no need to bail on what's currently working.
14:47So we got linear on one end of the spectrum. ChatGPT.com is a remix app, but most of their data loading is done with react query instead of react routers loaders or remixes loaders and actions but what it does use is the root loader for like user information and other kind of other things like that and so that's really useful now you navigate around you don't have to worry about overfetching all that stuff again they get the bundle splitting that remix provides on their routes, but they aren't using the data loading pieces. And then you've got Bolt.new. I don't know if you've messed around with that AI.
15:26Oh my gosh, it's so cool. Go to Bolt.new and try it out. It's one of those AI things where it's like you just described the app or what you're trying to do. And then like it does everything. It makes files, it refactors them, it can write tests, it does tons of stuff. And that's a full-blown remix app using lots of our features. So I kind of like where we're at of not saying this is the blessed architecture because at shopify alone we have very different use cases and they're all using react router or remix and yeah there's i just you can like tacos and you can like burgers you don't have to say burgers are the only best fast food right and so like we can be a single team building a single project react router and it can support multiple paradigms and architectures and deployment strategies.
16:14And I'm happy with that. I'm happy to hear you say that. There's been somewhat of, I think, a misconception at large in the React community the last year or three that React was going all in on server, that server components were the one and only way. And that is an area of investment for sure. But there's nothing stopping you from, as you said, making a Riverside or ChatGipity style, you know, single page or somewhat single-ish page app. You've also brought up a lot of really interesting words like root that have meanings in the Remix React Router world and context. For those who haven't used Remix or React Router themselves, could you give us a brief overview of what some of the really important concepts are if you're writing an app with them?
16:52Yeah, so I'm just going to throw this in here really quick. We moved everything from Remix over into React Router, which really was just our bundling and a couple of server concepts. And so now you can really say Remix and React Router interchangeably. But moving forward, React Router v7 has everything that Remix had and more. We'll talk about this later in the show, I'm sure, what we're going to do with Remix after this. Now I'm just going to talk about React Router. Because everything that was in Remix and wasn't in React Router already is now in React Router v7. So yeah, I said root. And then there's the word route.
17:26And if you are from certain parts of the world speaking English, you say those words the same way. and so you can have a root route or a root root. So let's see, where should we start? First thing is URL, right? That's how websites start. Here's a URL. So we call that anything that's going to match that URL and then render something, we call that a route. And so you can nest these routes below other ones so they build on the path of their parents. They also build on the UI of their parents. There's this idea of an outlet where it will, I guess, yield the content of the child route inside of the parent route.
18:01so it makes layouts really easy. That was kind of like our bread and butter for the last 10 years. The root route, it has no URL. It just always matches. And you can put things like loaders on there that say, hey, here's all the data that I need for this route. And if it's the root, then that's kind of like the core data of the app, like who's the user, what are their preferences, what A-B test are they in, or whatever, right? But every one of those routes down the tree can have their own data as well. And it will go and fetch that data Or simply just call your loaders in the browser to get the data handed to the component and the component can render.
18:36So it's kind of an MVC model where, you know, you've got model view controller. We have no model. The view are React components. And the controller is these two functions called loader and action. In the case of a spa, it's client loader and client action. And those loaders decide what data to then give to the component. So instead of splitting a model view controller at like a flat layer at the top, you get like little nested MVCs for each route inside of there. And then if a form is submitted or you do it with code, it'll call the action on that route, which can run on the server or in the browser or whatever you want.
19:14And after that action gets called, instead of you having to then go find the new data and like set some state and react to then update the page, We just know automatically that if you did something that calls an action, then the framework will automatically go and say, well, I knew how to fetch the data originally. I'm just going to go and fetch the data again. And then the page will update automatically. So it gives you that old school PHP feel of, you know, here's a page, here's a form, mutate some data, forward to the right back to the page that you're at. And then your code just runs again and gets all that data.
19:48the behavior as a single page app, even though a bunch of your codes are running on the server, where it's just using React to update just those parts of the DOM. Did I go off on too many tangents or is that what you were looking for? That's very much what I was looking for. Thank you. Yeah, you bet. Are there other topics or parts of React Router you'd like to go into before we move on? I don't think so. No. All right. So we've talked a good bit about where things came from, the fact that you've been purchased by Shopify or acquired by Shopify. I would love to get your take before we talk more about the future of React Router.
20:22Where does React Router end and Hydrogen begin? Or I guess, really, what is Hydrogen and how does that fit into the React Router vision? Yeah, so if you're a merchant, you want to set up a store. If you have no technical ability, which is most of them, you don't care about React or React Router or Hydrogen or any of that stuff. you just pick a template from the Shopify interface and go from there. And then we have this thing called Liquid as well. So if you're technical, you can get in there and customize your store with Liquid templates. But there's this other version of e-commerce. Some people call it headless.
21:01So headless e-commerce. I think we just call them custom storefronts, where it's like, I'm not going to use your templates. I'm not going to use your Liquid stuff. I just want to use the API to my store. So Shopify has a very capable API for everything about your store, get all your products, get all your collections. So you still log into Shopify and manage your store through the Shopify admin interface. But you can then write code to talk to our APIs to build your store, the actual interface that people go and visit. And so Hydrogen is a way to build a custom storefront. So instead of just saying, all right, here's our API, knock yourself out, shopping carts are actually a little bit complicated and all the variants of a product and how can I render a 3D model of the product that I'm trying to sell you, where will I get a component for that or just the image components, all that kind of stuff.
21:59So there's a lot to think about and efficient sorting and queries and stuff like that. So Hydrogen is, I guess you can think of it as like a utility belt that works well with Remix. So they got their own CLI to scaffold a custom storefront. So you can just be like, I don't know the exact command, but like Hydrogen new. And then it scaffolds out a store for you. From there, you own all the code. You can go customize how it looks and everything else. And then there's a bunch of abstractions to render your cart. like you know when you go to the cart page and it's got all the line items and they got abstractions for buttons to increase the quantity and see it see it optimistically update instead of waiting for the network request yeah just just a lot of like it's like a utility belt of like well if you're going to build a custom storefront here's a bunch of stuff and you're probably going to want some of it and then a cli and things like that to make the the full development process nice specifically for building a store it makes sense then that shopify would be interested in being able to fit that together with the underlying meta framework for react so to speak that you have a vision of the architecture of your app that can be assumed or worked with nicely by the the stuff on top yeah yeah uh it was kind of fun when we went to shopify people like oh great now remix is just going to turn into an e-commerce thing it's like no no there's that's what hydrogen is remix is still independent of that shopify has just been incredible i've loved working here they told us before we came, they're like, hey, we're not going to like, we're not going to tell you what to do and stuff.
23:30We want you to just build the best React framework that you can. But we want you to listen to our teams, right? Like we want you to take their feedback and help that shape what you build. But by no means are we like, going to be held accountable for like, oh, the hydrogen team wants this. Why didn't you ship it? And now we pretty much have tried to do everything that they've ever asked for that would make their lives easier. But they've let us operate very independently. And it's been great. They definitely kept their word because you never know, right? I never worked at Shopify. I'd never talked to any of them.
24:03And they're like, yeah, come and work for us. Your company that you just built and you've put all your blood, sweat, and tears into. And so you kind of worry, how much autonomy am I still going to have with this thing? They've given us tons of autonomy. They're just awesome, awesome company. Yeah. I think one of the signs that a framework is being given the autonomy it needs is that is able to invest in areas that don't directly obviously contribute to whoever's controlling the money. And actually, I did want to bring up one area. If you go through the currently Remix docs, there are a lot of notes here and there about how something is not supported in the classic Remix compiler, but is now supported in the Remix Vite build engine.
24:42What is the difference? Or can you tell us about this move to Vite that Remix has done? Yeah, when Michael and I started Remix in the throes of 2020 lockdowns, Vite didn't exist. Webpack, Webpack's a great project. It was a little bit slow though for bigger projects and stuff. And ESBuild was in beta. And ESBuild was fascinating because it was so dang fast that it was like, we don't even need the concept of like a dev server. Save a file, just build the whole app again. And it was basically fast enough for that. I remember stress testing stuff when we were before we had released anything. And I made an app with like two and a half thousand routes.
25:30I worked on a Rails app. I worked at a company called Instructure. We built Canvas LMS that a lot of people might be familiar with. It was a Rails app. And he said rake routes. You had two and a half thousand routes in that app. So I kind of picked that is like, well, if I can't build Canvas LMS all in Remix, then with this compiler, then like, it's not going to work. So I did that. And it was too slow for my liking. And then after I profiled it, it was all my code that was too slow. But ESBuild was plenty fast. Classic. Yeah. So anyway, we made a bet on ESBuild. This is fast. And the thing that I liked the most about it is that with the classic Remix compiler, dev and production only had one difference.
26:18And that only difference was minification of your code. Other than that, it did all the exact same things. There's nothing that irritates me more in the JavaScript world than when it works in development, but it's broken in production or when it works in production, but it's broken in development. And so I've always really valued keeping that gap like as narrow as possible of what's my dev build and what's my production build. So that was the motivation behind picking ES build. We started to want to do HMR, hot module replacement, so that as you save a CSS file, you don't have to reload the whole page.
Read the full transcript
26:53We had live reload before, so you could save the file, and then the browser would automatically reload through a web socket that we built. And that's mostly fine, but then the way Remix works, you got your loaders up top that are pulling stuff from your database or some third party or something. So super annoying for editing CSS, and like changing styles, because every single time you'd like tweak a style and save, you got to go fetch the data again. And so it just kind of slowed down that part of UI development. And so we started working on HMR, teamwork on that Pedro and Mark put a lot of work in Jacob, Jacob's involved with everything everybody does.
27:31And Once they got it working, they had gotten to the point where they're like, VEAT's pretty mature now. We just did a whole bunch of stuff to try to support this. I don't want to put words in their mouth, but my memory of this is that they were like, it works, but it's a little bit messy. There's really no getting around it being that messy. We should probably just use VEAT because it's got all this stuff built in. We switched over to did some experience with VEAT. It took us like a year. We kind of goofed around with this idea for a year before it was like, yeah, let's go with VEAT. And that's been a big deal.
28:03It's been very useful for app developers. There's a lot of stuff that we don't have to do anymore as the Remix team. We don't have to build our own compiler anymore. We don't have to build our own HMR, CSS stuff, like all the things that bundlers do. You can now just bring in a V plugin if you want to get that kind of bundling behavior. and half of our team, I would say the founding half of our team, have had it with bundlers and we hate them. The other half of the team is like, this is amazing. Bundlers are fantastic because they give you a whole graph of everything in your app, right? From assets to JavaScript, to icons, to CSS, and now we can optimize it all.
28:39But I just get super irritated because I can't touch Vite without dev being different than production. Like every time I touch it, I end up with that. And everyone always says, oh no, you work those bugs out. And eventually, never matters, but I haven't gotten to that point yet. Personally, I always have a problem, but on the flip side, HMR is really, really nice with Vite. ReactRouter dev tools used to be like this weird thing to try to like add it in. It's built by another developer, not on our team. He's awesome, alum. And that now is just a Vite plugin. So there's lots of really cool things about us adopting VEAT, but it's not without its trade-offs.
29:22I really hate that dev and production are not the same thing. It goes through completely different code paths. Sorry, I'm going to start ranting about it all. I should stop. Sure. It's great. Let me say this. If someone from the VEAT team is listening to this, they're going to be like, oh my gosh, Ryan is being a jerk and throwing us under the bus with things. Adopting VEAT has been, I still think it's the right choice that we made and they have been incredible to work with. smart, talented team. And yeah, I still think it's a net positive. But personally, I still run into the inconsistencies.
29:57That's part of writing a framework is these trade-offs. I'm also excited to talk about, you've mentioned that it's freed you up to work on things. What are some of the things it's freed you up to work on? With React Router v7, it's been hard actually to push React Router forward. RSC kind of like threw a wrench in everything. It's hard to figure out, I already mentioned this a little bit. It's hard to figure out when your primary dependency, React, takes over a bunch of the use cases that you are handling. How do you incorporate that without looking like you're just changing the API arbitrarily, right?
30:32Why are you getting rid of loaders? Well, if you want to use RSC, you don't need a loader, but I like loaders. Why are you always changing React router? It's like, okay, well, then we can just not support RSC. And then you get the like, why don't you support all of React? You're a React framework. Why don't you support RSC? Literally, we had a hook called use transition. Like that's what our hook was called use transition to know when something asynchronous was happening in Remix, like calling loaders or actions or whatever. And React now has a thing called use transition that generally is active when an action, a server action or a form action is being called.
31:06We have our own form component and an action points to your route. And now React has a form action prop that takes a function that when that function is getting called, it triggers the pending states of the use transition hook. So it's like there's just this huge mess of overlap now where like 90 % of what made Remix unique in the browser, in the client part of things, not the service stuff, but the client parts, React now has a version of that. And so we've kind of been doing two things at once. Number one is just figuring out what the heck RSC is, what server actions are, how all their new transitions and actions and stuff work, how to get it in to React Router and to do it in a way that you can mix the concepts.
31:51Because you've got to be able to mix the concepts so that we don't blow away all the work that people put into their remix in React Router apps already. You got to be able to easily move from the loader action paradigm of React Router over into the RSC and form action paradigm of React. Like these things have to be able to work together. And otherwise, you got to rewrite your whole app. So balancing that along with balancing just the typical SPA use case of like Riverside and Linear and GitHub and everybody else who uses React Router, like how do you balance all of these APIs and make them all work together?
32:30So it feels like kind of a big thing that's slow and hard to move forward. But React Router v7 is what we generally worked on over the last year. I would say the first year at Shopify, we worked on making React or making Remix work without a server. So spa mode, client server, client actions, client loaders, all that kind of stuff. And the VEAT, the migration over to VEAT. And then second year has been RSC research and design and moving everything over into React Router so that we can have this multi-paradigm framework that lets you use as much of it or as little of it as you want. We're just about there.
33:13We're getting close on the RSC stuff with React Router V7. We've got loaders and actions that run on the server. We have client loaders and client actions that run in the browser or just keep on doing it the old way. You know, here's another thing that we've been able to work on a lot too is better type safety. I'm very interested in this, yeah. Yeah. As TypeScript ESLint guy yourself, this is a topic you're probably interested in. It's difficult. So there's two types of TypeScript, right? There's type safety, and then there's all caps type safety. So type safety is like you just naturally write your code.
33:49I take a string here. I take a number here. This thing should be a React node. This thing should be that. It's going to return a number. And that stuff's all fine and easy. But then all caps TypeScript is when it's like, how come my links don't give me a list of every possible route that I could go to? How come my loader data in my component doesn't tell me exactly what the loader returned? Nevermind it went over the network and it got serialized. I should still see exactly what that data is. And if I sent an integer of 42 and I said, as constant at the end of that, I want in my component to know that that is 42.
34:26Right? So that's not normal type safety. That's like telling TypeScript about how the framework operates, right? Because the type system itself doesn't know if the loader returns this, then an argument to this export in your module is going to get this value. Like you got to do tricks to know that kind of stuff. So Pedro on our team has done a lot of the work there to get type safety. So we've got really great type safety now. We have this routes TS file where you define your routes a lot like rails routes.rb. Then as part of the dev workflow, you get these, I think they're virtual modules that give you all the type inference for those routes.
35:07So we're actually looking at the route paths where you have like patterns with the colon, like colon user ID, and it can be optional too. or typegen there will parse out those dynamic segments of the of your route paths and now inside of your component in your loaders and actions when you say params dot you get a hint that like says hey i know that you have a user id on there because i went and read your routes ts file and so that's really nice because now you get you're not going to go try to load data for a param that doesn't actually exist on your on your route that also infers the loader data now to.
35:41So you return values from your loader, your component gets a prop called loader data. And that thing's fully typed as if you called the function yourself and comes back. Jacob has worked a lot on our transfer format over the wire for streaming thing called turbo stream. It does serialization and deserialization of a bunch of different types. So it's better than JSON stringify, you get numbers back out of there, you get dates back out of there. It's the basis that we're going to do for RSC so you can get components out of there. That couples with the type safety because if you pass a date, React Router sends it over the wire and it has to serialize it.
36:18It comes back to the browser as a string, but then React Router on the other side of that parses it and then gives you back a date. So all of your type safety is much simpler. You don't have to assume, oh, these are all serialized. They're actually the same values, even promises. You can even have nested promises and they come all through. Yeah. Yeah. It's a promise on the backend goes over the wire and then comes back as a promise in the browser. It's kind of cool. I like the way that you, you put it that the, there are the two levels or types of TypeScript. And I think it's kind of unfortunate that as, as people go more and more into frameworks, such as yourself, like folks who are actually writing their frameworks, they may, may not be the people who also want to write intense, deep TypeScript with words like key of and constant and mapped types.
37:03But if you have users using it, it's going to be an inevitable thing that they want that level of type safety, the all caps one. And as a humble JavaScript web developer who graduated with an economics degree and has never touched a computer science class, it took me a while to figure out that just to iterate over a list of an array or unions or over a union, it's recursive there's no like for each in typescript generics right it's like if you're writing typescript code everything is a recursive function and so it's like okay i know that this is this is a map and i need to do a map here and then we got to do a reduce so like i have all the words in javascript but then in in typescript it's like it's just it's it's just a different way to think about code.
37:54So it has been kind of fun. Yeah, one time Michael and I were working on, I don't even want to say it out loud, but working on a new router. Anyway, we're getting type safety there. It was like six hours straight of writing these recursive functions to try to get the thing that we wanted. And it felt like doing homework. Like, it's like, okay, here we go. What do we need? First, we need the loop code. And then we need this. Does this extend that? Okay. And does it extend an empty array? Okay. That means that the left side is one item and the right side is zero items. And so at this point we do this and then we recurse.
38:30And it was just like recursion after recursion after recursion. And I was like, this is, I feel like I'm in a computer science class doing a worksheet on recursion. I have a computer science degree and I felt absolutely unprepared for the TypeScript type system when I started using it. I did not think it was something that I got out of university or really wanted in my life at the time. Did you have the vocabulary though? Like when things started to click, you're like, oh, this is like that. You know, I think I did at one point in computer science class and I'm so sorry, Professor Varela, who I remember being a great programming languages professor and teacher.
39:04But no, it's one of the unfortunate things I think that it's just so different from everything else. By the way, I could talk about TypeScript for years, as I'm sure you know, but I do want to give you a chance to talk about more React Router stuff. And I have one final question on the subject of it. Let's say that we have this conversation again in two to three years. What would you predict to be the thing that you are most excited about having been accomplished in those two to three years? Oh, man. Remix V3. I want to call it Remix V45 for the RPMs on a record player, but I don't know that I'm going to get my wish.
39:39So we moved everything over to react router which 90 of remix was already in react router so it's like we moved the last 10 over so we moved everything over to there that gave us room to just do something really cool with remix we love the remix brand we get a lot of flack still on twitter we even got a little bit internally of people like what on earth are you doing why are you killing remix yeah yeah it's super fun. And we're like, we're not, we're not, we're not killing Remix. I said from the stage, Remix is going to take a nap. Generally, people don't die when they take a nap. They'll come back, they come back refreshed.
40:17They come back better than they were before. But we've been dedicated to smooth upgrade paths. And so the best way with the model that Remix was on, of everything being done at the route module level, that was best moved over to React Router and just continue with that paradigm. That's one timeline. And we want to make the best version of that that there is. The analogy that I always use is it's like Chrono Trigger. Did you ever play Chrono Trigger? I'd say that I did. Do you know what it is? It's a video game. It is a video game. Good job. Yes. Thank you. It was a Super Nintendo game built by Squaresoft or maybe it was Square Enix at that point.
40:57I think it might've been Square Enix. And in my opinion, it was pretty much the best Super Nintendo game ever. It was my favorite one. Actually, every couple of years, I'll play it again on an emulator just because I loved it so much. What's interesting about Chrono Trigger is that it came out after Nintendo 64 was released. So you got Nintendo 64, a whole new model, you got 64 bits, you can do 3D stuff. It was a completely different world over there. and obviously the future of video games was over there on the Nintendo 64, not on perfecting and optimizing Super Nintendo games. But Chrono Trigger was released after Nintendo 64 on this old model that it was just the best version of that ever and it is still good today.
41:46I still love playing that game. Games today could still learn stuff from Chrono Trigger. So for me personally, I'm not going to speak for the whole team here. Everybody on the team works on React Router and has an influence on it, But for me, that direction that we were going with Remix and then React Router is the Super Nintendo. Nothing wrong with it. And so React Router V7 and when we have a V8, like to me, that's Chrono Trigger. It's like this is the best thing that we can do with this model before server components, before web UIs were all over the place, before React could do things that it can do now, where we basically had this one tool, which was the route module.
42:23And we hung every API off of route modules. React has inspired what I think is a new generation of even more encapsulation across the stack for a server component, server actions, and client components inside of that. You can build a little box, right? And we've seen people making these kinds of demos with AI, especially, where you're in a chat and it's like the chat wants to show you a little map or it wants to show you a little product or it wants to show you a little to-do list. That's not a route anymore, right? That's just a component that has data and actions and stuff inside of it. you still are going to need a server on the backend to manage those actions and to get the data into that component.
43:00And so Remix for me is the Nintendo 64 now. There's this new world and our biggest bet is actually not on React. Our biggest bet is on the web APIs, fetch, request, response, web crypto. There's so many APIs that we're starting to see run on more and more JavaScript servers, including Node. And so in a couple of years, to answer your question, I can't wait to see what both our team builds and what our community and the ecosystem develops around what we're building. The stuff that we're building right now for the next version of Remix is super composable. It's going to be consumable as like a framework, but the way that it's built isn't.
43:43Like you could use little parts of it. Even today already, if you go to the React Router docs to look at a file upload, how to do file uploads in React Router, you're going to bring in one of our Remix packages in the future version of Remix for multi-part parsing. Astro sites will be able to use this stuff. Solid start sites will be able to use this stuff. And just plain old web servers that need to support whatever you need will be able to use everything in Remix. And then we're going to package it up really nicely as like a framework with some docs that are like cohesive. So it's not you don't have to go to like 12 different readmes to figure out how to put things together.
44:18So, yeah, that's that's what I'm excited about. It's a big bet on the web platform, anticipating more stuff like React server components, encapsulated widgets that can be easily like embedded anywhere into existing apps or even generated by AI on the fly. we want to build a back-end javascript infrastructure or architecture to support all that stuff in the future that's similar to the bet you've been making a lot of the time with remix right bet on the platform bet on the web apis see where things go that would be a fantastic way to close out this interview if you'll permit me can i ask you one completely unrelated to remix and react router question to actually close out though yep we uh for the listeners we did confirm this as a question ahead of time.
45:04How come there are so many JavaScript and React people in Utah? I'm legitimately interested in hearing your answer on this. I don't know. I don't know why. We're just the loudest for some reason. Yeah, there are a lot of us. Me and Kent and John from 8Head and Tanner from TanStack. I'm probably even out with some people. React Rally, Jameson and Matt Zabriskie ran React Rally for a while. Actually, they're still doing that. I don't know if they're doing one this year. But yeah, there's a lot of us. But no, Utah is, I love Utah. I absolutely love Utah. Economy's awesome. The weather sometimes can be terrible, but that also gives us all the ski resorts.
45:41Like I'm within an hour of like, I don't even know what it is, like 12 ski resorts. I only go to two or three of them. Just tons of stuff in the mountains. It's beautiful here. I love it. Super family oriented too. Everybody's, everything is designed for families. When I lived in Washington, we'd like show up to a restaurant and they'd like give us to look like, oh, crap, kids. But in Utah, it's all fast casual, and it's just 100 % designed for people with kids. So yeah, we really love it here. The outdoor stuff, all the family stuff, it's fantastic. That's really lovely. Well, cool. Ryan, thank you so much for coming on.
46:14I thought this was a phenomenally interesting set of topics. Remix, React Router, the merge, the React Router, and then the remix, and where you're all going with Shopify. Is there anything else you want to tell the listeners before we sign off? No, buckle up. I don't think any of us really even know what the heck is going to happen with the web. This has got to be the most exciting time. The only precedent is the web itself with what's going on right now. So yeah, I'm pretty excited to see where it goes. Strong agree. For Software Engineering Daily, this has been Josh Goldberg. Thanks for watching, everyone.
46:54Thank you.
From the publisher
Remix is a full-stack, open-source web framework that was developed by the creators of the popular React Router library. It focuses on features such as server-side rendering and efficient data loading, and it emphasizes developer experience. Ryan Florence is a co-creator of React Remix and in this episode he speaks with Josh Goldberg about the
The post React Remix with Ryan Florence appeared first on Software Engineering Daily.
