## OpenAI Just Fired Their CEO - 20231118 the CEO of open a just got fired this is breaking news it just happened I don't think anybody was expecting this I know I certainly wasn't there are so many rumors floating around and a lot of people trying to figure out what exactly is going on so I want to do my best to break down what we know what we don't push back on some of those rumors and add the context I know as a Founder why combinator Alum and person who's generally in this space so let's start with the blog post then go into the rumors then go into what I think is actually happening here as well as what's going to change as a result make sure you stick to the end that's where the interesting bits about what's going to change are well without further Ado let's take a look at this blog post and see what the board has to say this is a post doesn't really say the author it's just open AI so it's an anonymous is post from the board which are the people who own enough of open AI to make these types of decisions openai announces leadership transition Chief technology officer mea mutari is appointed as interim CEO to lead openai Sam Alman departs the company again this is out of nowhere the CTO being moved up temporarily a CEO is a pretty common thing to do when you're in a scenario like this but the sudden departure of your CEO is incredibly rare even in Crazy cases like what was going on with Activision with Bobby kodic being investigated by the government of California he still managed to stay on for a full year and have a really nice Exit Plan anyways let's take a look at what they have to say the board of directors of open AI Incorporated the 501c3 that acts as the overall governing body for all open a activities today announced that Sam Alman will depart as CEO and leave the board of directors Meera is taking over this part is just explaining why mea is going to do really well and it seems like in all regards she will as they look for a new permanent CEO this is where things start to get spicy though Mr alman's departure follows a deliberative review process by the board which concluded that he was not consistently candid in his Communications with the board hindering its ability to exercise its responsibilities the board no longer has confidence in his ability to continue leading open AI this is a little spicier than what you would normally see in a corporate post like this so it seems like they're really really done with Altman it doesn't say what it could be this could be anything from misconduct internally to being bad at managing the books to not properly disclosing things between the Microsoft and open AI board because he was the Lea zone between all of these parts there's a lot of reasons this could happen we'll go into why the board might act like this in a bit the statement the board of director said open AI was deliberately structured to advance our mission to ensure that our artificial general intelligence benefits all Humanity the border means fully committed to serving that mission we are grateful for Sam's many contributions to the founding and growth of open AI at the same time we believe new leadership is necessary as we move forward it's the leadership of the company's research product and safety function Meera is exceptionally qualified to step into the role of interim CEO we have the utmost confidence in her ability to lead open AI during this transition period they talk about how open was founded as a nonprofit this is where things start to get interesting where we're going to dive into what I think's going on open ey originally started as a nonprofit it was a charity and it's transitioning into a for-profit business and those types of transitions tend to be really really messy before we can talk about that we have to talk about the conspiracies and all the rumors going on because I think this sentence here is tripping a lot of people up ensure that artificial general intelligence benefits all Humanity I've seen a lot of people speculating that this is happening because Ai doomers and people who think AI is going to ruin the world have taken over the board and are trying to slow it down at all costs that just makes no sense especially since the board more and more has a financial incentive for the company to succeed I just I don't buy those rumors it doesn't make any sense at all I could be wrong it just doesn't seem likely and people are reading too much into this one part of their statement I think this was more to Pander to fun enough people who are speculating making it clear that they want to make AI as good and useful as possible not that they want to hold it back back as development moves really quickly so now we've read the blog post we know roughly what's going on but how could they just fire their founder so fast like Altman brought this company from worth almost nothing to over 90 billion pioneered Partnerships with businesses like Microsoft and really made open Ai and chat GPT the names that they are today well there's one important detail about Sam that makes him unique as a CEO in any space much less the technical one he owned no stock in open AI this is incredibly rare I own over half of the businesses that I run this is the expectation in a lot of situations where you found a company when I started paying I owned 80% and I reserved 20% for stock in the future and as we continued to take investment those numbers shifted over time but I went out of my way to make sure I owned a significant portion so I could be the one in charge of making these types of decisions when Tim Sweeney of Epic started bringing in investors and expanding epic to have additional shareholders he went out of his way to make sure he owned exactly 51% of the the company so no one could ever override his decisions this is something that we all strive for as Founders to limit how much our table gets diluted and maximize how much of the company the core team and the original Founders and any new employees who join end up getting long term because they're the ones who built it so Sam choosing to not take Equity was absolutely fascinating to me I I did not expect it especially coming from my combinator where they push so hard they should do everything you can to keep your dilution low and not let other people take too much ownership of your company because then you lose control of it and then it slowly spirals out there's a pretty firm belief amongst the investor World especially in Tech that the original team tends to be the best team for a very very long time and anything that makes it harder for them to run the company is probably going to be a problem and that's why it's so surprising to me that Sam took no equity because again that puts him in a weird position where anyone who owns any amount of the company has more control than he does beyond his title obviously he's on the board he's the CEO he can do a lot but at any point it doesn't take much to get rid of him because he doesn't own much of the company whereas with Bobby kodic when he was kind of fired from Activision during the acquisition by Microsoft that was a weird one because he owned so much of Activision he bought them for $2 million and turned them into a multi-billion dollar company getting rid of him meant paying him a ton of money to go away and that's not what would happen in a situation like this because Sam owns nothing here he has no right so to speak to the state of the company because he didn't own any stock and that's incredibly unusual we're starting to like touch on my conspiracies here so before we get there I want to talk about what we know will change and what theoretically could change according to Microsoft their relationship is no different and they're still fully committed to open AI that's good to hear because their stocks already taken a hit as a result of this news previously Microsoft worked primarily with Sam as their point of contact for all work regarding open Ai and obviously that's over now so they're going to have to build the whole new reporting structure and method of communication between the company and Microsoft but they're confident they can do that they're still really excited about open AI they've made many public statements already and this news is only a few hours old so it's clear nothing is going to change there meaningfully what could change is the general landscape everyone wants to be the new open a everybody wants to challenge this company and how they got where they got and take a similar size of that giant AIP piie I'm exciting to see a lot of companies and even new Founders jumping to take the opportunity that they see here I don't know how real the opportunity is I don't know where open AI is going to be next month much less next year but others are going to see this chance and they're going to take it and one of those people could very well be Sam because he lives in California and California has very strict rules about non-compete in the sense that if you leave a company and do something similar it's really hard to get sued for it here like incredibly so that one detail might end up being really important if Sam decides to go off and do his own new AI model generation or try to pursue AI in a different way potentially not even using llms there are still individual patent disputes and things he could be copying from his previous job but the very idea of competing in the same space being restricted in the traditional non-compete sense that's not a thing here and Sam very well could end up running a new AI company in the next couple days even and there's nothing open AI could do about it unless he signed some really fancy exit deal in this process I don't want to talk anymore but what's changing I want to talk about why I think this happened as I hinted at a bit earlier open AI we company going from nonprofit charity into a traditional C Corp profitable business is a weird transition these things tend to involve a lot of weird legal work and bookkeeping and things you have to do to get stuff just right especially since the charity fund that invested a lot of the money into openai initially was something that Sam Alman owned and Elon Musk was even trying to get his hands and offering to spend as much as 100 million in order to take control of open a himself way back in like 2018 2019 this is a company with a lot of lot of weird history and importantly a lot of opportunities to get things wrong since Sam had no ownership of these things and was the point of contact for most of these deals he's kind of an easy scapegoat I'm not saying something more screwed up didn't happen here or even trying to downplay the likelihood of these issues being really severe but it's important to recognize that in a situation like this anything could have happened and more often than not this ends up being some weird legal bookkeeping case where he screwed something up during these transitions or he didn't disclose properly things he learned from Microsoft when talking to his own board he's almost certainly one of those types of mistakes or a handful of them piling up over time and I can absolutely see a board getting frustrated if they're telling Sam hey we need you to tell us about these things more often we need you to fix these things right now and his response is to largely ignore them and go do his own thing which is very much the same way of doing things I don't necessarily think that's a bad thing especially for a company that's innovating in the ways open AI is but now that they're at this size and they have a board of people who are this invested in what they're doing and they have giant companies like Microsoft committing billions upon billions of dollars to partner with them to do incredible stuff the need to do everything very transparently and buy the books is higher than ever and my guess again speculative my guess is that something in this process was not done to the expectations of traditional big business and Sam didn't feel like figuring that out and prioritized pushing open AI as far as he could this part's just speculation I can't know anything here for sure but it just seems a little easy to get rid of Sam because he has no ownership so they can just kind of a him like any other employee and nothing really changes Beyond who's running the company the only cost they have to deal with here is the brand risk of Sam Altman leaving and the potential risk of him competing with them now in the future they don't have to worry about any Equity loss any Company ownership loss anything in those regards which makes it an easier decision to make in these weird scenarios that's my thoughts on the situation again it's still developing it only happened a few hours ago appreciate youall a ton if you want to hear more about me talking about AI Doris I'll pin a video in the corner all about that and if you've already seen or you're not interested there's one below you might like instead appreciate you all a ton thank you guys as always peace nerds ## OpenAI is TERRIFIED (this is absurd) - 20250316 it's no secret that open AI is pretty scared of deep seek right now you can look at their pricing of 03 their commitment to do more open source stuff or the thing that just dropped now their request to the US government to ban deep seek from the United States ah this is going to be quite a dive I have so many thoughts here from the meaning of open in AI to the weird things Sam does to hold the strangle hold he has on the space to the surprisingly good faith operation of the team over at Deep seek there's a lot to dive into here and uh if I'm going to lose my deep seek models and I have to spend a whole lot more money someone's going to have to pay for it rather make it you guys I'm going to let the sponsors handle that we'll be right back if you hang out here you probably build fast but does your code build fast very different question If You're Building enough code chances are the code itself is starting to build pretty slow today's sponsor is here to help us out blacksmith made my builds way faster and chances are they'll do the same for you their secret is that they're using cuttingedge gaming CPUs in order to build your code faster and cheaper and they're doing everything else they can do to make it fast as well they give you 25 gigs of cash when getto only gives you 10 they' made their Docker bills way way faster like hilariously so companies like post hog had their builds go down from around 9 minutes to a minute and 27 seconds just for the docker portion and then when it comes to the GI up actions they're seeing even crazier wins like node goes from 180 minutes yes 3 hours to build down to under two and it also costs a third as much money if your company spending a lot of money or a lot of time waiting on GitHub this is a thing you should do and it's not like it's hard to set up either it's literally a on line of code change and you might be worried about the custom actions and things you have not only do they support pretty much every action that already exists on GitHub they've made their own custom ones like cash layers for every language from go to rust to Ruby to even Zig and if you don't believe me go try it out you get 3,000 minutes per month for free you don't even need a credit card to sign up thanks again to blacksmith for sponsoring check them out today at so. l/ blacksmith Sam why are you doing this to us in a new policy proposal open AI describes Chinese AI lab deep seek as a state subsidized and state controlled operation and they recommend that the US government consider Banning models from the outfit in similar People's Republic of China supported operations if this proposal was them suggesting they ban access to their platform and Services I could theoretically see it but that is not the recommendation in here I want to read this to be 100% sure here are some fun numbers in here actually their phrasing is that we need to ensure people have the freedom of elligence by which we mean the freedom to access and benefit from AGI protected by both autocratic powers that would take people's freedoms away and also from layers of Law and bureaucracy that would prevent our realizing of these things this is the crazy thing more than 400,000 people around the world are using chat gbt to ideate discover and break through beyond what we're currently capable of doing on our own in advancing Democratic AI America is competing with a Chinese Communist Party determined to become the global Leader by 2030 that's why recent releases like deep seek r1's model are so not worthy not because of their capabilities r1's reason the capability albe it impressive are at best on par with several US models uh only because you put out of3 mini Because deep seek is simultaneously State subsidized State controlled and freely available the cost to its users is their privacy and security okay this is what I was looking for absolute when I'm running a model on my machines and on my infrastructure my privacy and security are not being compromised unlike they are with open AI because when I use open AI stuff it has to run on their infrastructure unless you happen to have a partnership with aure so you can run on their stuff you cannot run open aai stuff in a way that doesn't inherently put your privacy and security at risk this is absolute this is why I wanted to read it I wanted to see if they were actually saying what it seemed like they were and they are they are saying that open models are inherently less private and secure because they think that China bad and on one hand if we had to send all of our prompt data to China and to the actual business of deep seek in order for us to use the model then yeah that would be bad but I don't even know if deep seeks apis are the majority method used for deep seek usage I would guess that it's a high percentage but I don't think it's going to be over 50% the magic of what deep seek did is they were more open than almost any prior models they put out 12 papers last year 12 about the different things that they invented the different training methods and technologies that they figured out in order to improve the way that they train in particular around the restrictions for imports that existed in China one of the big things that Chinese AI companies don't have access to it's not the gpus we're not just keeping them from getting A1 100s the bigger problem is we're not letting them have the Technologies to connect those gpus with really high bandwidth between them Technologies like EnV link allow you to take tons of these giant gpus and have really fast transfers between them they have no access to that in China right now so instead they have to build new novel ways to Minify and minimize the amount of data being transferred between the gpus and they've done some genuinely incredible groundbreaking research and Innovation there that doesn't just make it possible for them to work it also benefits the people making models in other places without those restrictions and to ignore all of this to say China bad because you want your competition to go away and you look bad because there's a more open alternative now I hate it I'm tired of open ey and more importantly I'm tired of meil posturing as though they are an open option when they're not thankfully open AI doesn't pretend they're open anymore just their name but mol loves to brag about how open they are while you can't use their models outside of their infra unless you pay them massive licensing fees and they don't open source any of the interesting stuff going on there's no way to host mol as fast as they do on their own info right now that's not open deep seek showed us how they trained they showed us what technologies and Innovations they made they open- sourced a ton of things from the file systems that they invented to make it faster to do these trainings to the novel ways they found to compress the context size as they're generating new tokens there is so much cool that those guys have done this video by Welsh Labs is so cool if you're curious about these types of things and you want to see the actual Innovative work deep seek is doing and giving out check out this video I'll make sure this is linked in the description cuz Welch Labs killed it with this this made me feel like I'm actually somewhat qualified to talk about the stuff now I had to rewatch this video like four times to actually understand it because it was so absurdly detailed but it's actually incredible what deep seek is doing and how much information they are sharing I'm not saying you should use their infrastructure I would push against that sending all of your data to a state actor not a thing you should do I totally agree in that regard but we don't have to do that to use deep seek we can all learn from it and there's a reason that meta hasn't said a word about llama for months now rebuilding everything internally because they realized how much they were doing wrong based on the success deeps had the claim that they make in this proposal is specifically that deep seek has requirements under Chinese law to comply with demands for user data therefore this model should be banned no maybe maybe ban their platforms maybe put different restrictions on hitting the apis for these things but Banning the use of these models is insane there was a proposal file back that was just so absur I didn't even cover it the proposal was that we should find people for downloading these models that's insane it's unclear whether open ai's references to models are meant to refer to the Deep seek API the lab's open models or both I think it's pretty clear right here the potential that deep seek could be compelled by the CCP to manipulate its models to cause harm you're specifically saying the models should be banned and the call out here that deep seek is freely available it's assumed what they're talking about out there isn't the apis because the apis cost money what they're talking about here is the model maybe the mobile app but they didn't say that anywhere in here at all I love this call out saying that CCP views violations of American IP rights as a feature not a flaw because I can't violate copyright with your models right open AI are you going to start saying the reason you're not open source anymore is because people would be able to do things like that because that would be really funny if you said that there is one last good call out here that's worth acknowledging there isn't any clear link between the Chinese government and deep seek there are a lot of big companies that the Chinese government is very directly clearly involved in there's a bunch of them like you could make an argument like this for something like Alibaba where there is much more Chinese government involvement you can't for deep seek you can argue that their apis might be risky because of Chinese law but this is a hedge fund project a lot of the deepsea guys used to be Crypt Bros and we're just looking for things to do with their gpus this isn't some government plant this isn't some crazy effort by China no one expected deep seek to be as good as it is or to have found the success that they found certainly not China certainly not us possibly not even them the work deeps did is incredible and the fact that they open source did is unbelievable deep seek is almost without question the most open AI company ever made deep seek published more open work and research last year arguably than the rest of the AI world combined it's insane how much they did and to see them talked on like this because open AI will do anything to win it hurts I hate that I saw a quote from Paul Graham here that I want to bring up you could parachute Sam Altman into an Island full of cannibals come back in 5 years and he'd be the king starting to see what they mean by that cuz this is not great I'm a big fan of Open Source if you've been here for a while you probably understand that about me it's a decent chance you are too and I hate the fact that a company call open AI is trying to destroy the most open AI company that ever existed deep seeks work should not be talked on it certainly should not be banned from the US and it's sad to see a company like open AI doing what they're doing here I am disappointed I hope they reconsider the absurdity of this request and maybe in the future we'll see them look at Deep seek not as a thing to destroy but as an opportunity to improve their own work and maybe just maybe be a little bit more open themselves and I'm sad Open ey has been growing on me again recently 03 mini is an incredible model it's my favorite model right now it's what I use for the solving of so many hard problems 4.5 is a great step in the right direction I've been working with them more and they've been great to work with but this is an unnecessary destructive path and I'm disappointed that they're going down it this reminds me of like Apple's weird legal cases where they start suing people for importing motherboards to replace broken ones on phones because they had an Apple logo on it this feels like that like an absolute circumvention of the law and people's understanding of certain behaviors and things in the world in order to make it slightly more likely that you win and I hate it let me know what you guys think at the very least you should go download your favorite deep seek models so that we can still have them in the future until next time keep prompting ## OpenAI is back on top - 20250613 openai just finally dropped 03 Pro And as excited as I am about that it's my second favorite thing they did today because they also cut the price of 03 the standard one not 03 Mini by 80% making it cheaper than GPT40 Claude all of the Claude models really and even Gemini 2.5 Pro Considering how smart 03 is that's insane But 03 Pro goes even further It's not anywhere near as cheap but it is 87% cheaper than the previous 01 Pro model which is just absurd And the quality of the responses you get from it is insane too As smart as 03 Pro is it tends to take a lot of time reasoning like almost 4 minutes on a simple high prompt That's all tokens that we have to eat in our testing and someone's got to foot the bill So we're going to do a quick word from today's sponsor and then we'll dive right in AI is really good at parsing data from structured formats like YAML and JSON It's a lot less good at getting data out of web pages especially if they're client rendered Turning complex HTML into something that your AI can use is not an easy task unless you use today's sponsor Firecrawl These guys make it way too easy You give them a URL and you get back JSON or whatever other format you might want to It is hilariously easy to get started They even built a nice TypeScript friendly SDK And when I say TypeScript friendly I mean it You might be questioning wait how does it know what format the data is going to be when you get it back that is one of the coolest parts When you use it in JSON mode you can pass it a Zod schema And now when you call the scrape function with that schema you get back data in the format that you ask for That's so cool And the use cases I'm coming up with just looking at it are absurd I love the isyc cuz we might actually start using this to figure out things that we want to invest in It's smart enough to wait until content is loaded and rendered So if you're waiting for the JavaScript to run they got you And it's not even that expensive When I saw it I immediately assumed it was going to be massively overpriced But for 16 bucks you get 3,000 scrapes And the free plan includes 500 credits Each one is good for a full page That's crazy I just keep coming up with use cases where this is valuable and I'm sure you will as well Check them out today at soyb.link/firecrawl I hope you'll never complain about ad breaks when they are shorter than the reasoning time for some of these models But the reason it takes so long is it's thinking a lot even when it's possible it shouldn't be like it did here Let's dive into the release notes of 03 Pro and then go into 03 cuz I'm really excited about the price change It kind of changes the whole landscape But first 03 Pro It's now available for pro users in chat GPT as well as in their API They have plus for 20 bucks a month and pro for 200 bucks a month Fine But uh quick reminder eight bucks a month for T3 chat and you now get access to 03 as part of the core plan for that eight bucks a month If you want to try it out for cheaper use code 03 please 03-PLS at checkout for just $1 a month It'll only work if you're not already a subscriber Anyways let's talk about these models because things are really really cool Like 01 Pro 03 Pro is a version of our most intelligent model 03 designed to think longer and provide the most reliable responses It's been a bit since we saw the the best in class so to speak from OpenAI Their reasoning models are obviously their best models but they're broken into three tiers effectively Right now when a new base is made for their reasoning models they usually ship it under the mini tier Initially they have mini they have main which is just the term I'm going to use for the one in between and they have pro These are the three different tiers The difference is effectively the size of the model itself the amount of tokens that it's referencing when it generates It's a lot of different things go into it It's also how much time it's going to be spent reasoning how much GPU time and GPU energy it costs to actually run the model cuz it's traversing a larger set of data But think of this like with Llama 4 how they have the Maverick and Scout versions or how with other models they have the small like the 24 billion parameters and the 200 billion parameter version They split this into three sizes which means they have different characteristics Since the mini versions are smaller they tend to be much faster and also much cheaper to run The main ones tend to be a solid balance and then the pro ones tend to be a good bit smarter but way slower and more expensive to get things done with I found so many bugs in the chat GBT site using 01 Pro because it was so slow It would regularly get the site into a bad state and I would regularly have problems where it just failed to finish the generation step because I went to a different tab or started a second chat while that one was still going It was not a pleasant experience and thankfully they've made a lot of improvements Shout out Nan But yeah the pro models are funny enough bad user experience The intuition for most people is "Oh I just want to go use the smartest one I'm going to go down the chain and use whatever I can for my problems." The further you go down this the worse experience users have which is kind of crazy if you think about it The smarter models are worse UX but if you have a problem that they can solve and the other ones can't it can benefit you a lot What doesn't make as much sense to me is why 40 is still on top before the rest of these because 40 is a lot dumber than these other models But it also because it doesn't have reasoning it starts to generate a response faster and they've put a lot of effort into fine-tuning how personal it feels 40 since it's not reasoning it's just immediately responding feels better to have a back and forth conversation with and it's not overthinking your responses I find all of the reasoning models from OpenAI to be much more clinical which I personally massively prefer I don't want my AI to sound really human personally speaking but I'm not using it as like a friend I talk to I have too many people I already owe a text But for most general people like my mom would probably like 40 a lot more than the other models and she's not asking anything that you need a smarter model for And for things like voice chat having that immediate response without reasoning is really really nice That said the mini models have gotten so good and so fast that it's hard for me to to not default to 03 and 04 mini nowadays So this gives us a picture of where things are at But there's also the horizontal spectrum of like 01 they skipped O2 because they didn't want to get sued by a particular phone carrier and they did 03 and they did 04 What's interesting is for various reasons they tend to put out the mini model first now which means for a little bit we had 01 pro and just like oh you know what I'll find the real numbers from their benchmarks why not so here are benchmarks across the different versions of 03 01 I also left in Gemini 25 and cloud for sonnet here and you'll see for the basic like math benchmarks and aime the consistent improvement 01 mini was slightly worse than 01 03 mini was slightly worse than 04 mini and 03 beats out most of these in the more general artificial analysis index you'll see it's a pretty steady improvement The thing that's interesting is that 03 came out for like general use after 04 Mini and 03 Pro just came out today even though we've had O04 Mini for a while And they're pretty close in capabilities The thing that makes this feel weird is that these higher tiers take so much longer to come out that by the time 03 Bass or Pro comes out O4 Mini already exists and the level up on this axis sometimes matches or even cancels out the level up on this axis It just kind of feels weird that 03 Pro happens today when 04 Mini already exists and is such a good model 04 Mini has been my default in T3 chat for a bit It used to be 2.5 Flash I still use it here and there but more and more 04 Mini is fast enough and so consistently good that I find myself reaching for it by default I'm also using 4.1 in my editor I'll talk about that some other time I have some fun tips there But for now we're focusing on these reasoning models And 03 Pro seems to be groundbreakingly smart for specific things but it does just feel weird to have 04 Mini that is so much cheaper than 03 Pro and feels just as smart for general usage and also is way faster That said seems like OpenAI is kind of thinking of these as entirely different use cases Rather than seeing this as small medium large OpenAI sees this as general more deep dive deep research type things and literally writes reports for you 03 Pro has a 64% win rate versus 03 on human testers That doesn't mean it is 64% better That means it beats 03 64% of the time which means for most people most of the time it's close For the win rate to only be a 14 points higher is kind of crazy but it shows how good all these models have gotten It'd be really interesting to see O4 Mini in comparison there OpenAI has been really good about showing how to think about prompting with these new models because it is quite different Even stuff like your system prompt They officially recommend that you add as little system prompt as possible in order to let the context be focused on the actual problem that you're trying to solve So here is a good example of the anatomy You start with a goal You get specific about return format You give any warnings or details you think are important You dump all the context that it needs And then you give it capabilities like MCPs tool calls and whatever else it might need to do And when you do things right the benchmarks are pretty crazy as we see here scores a decent bit higher with human testers versus 03 but also the traditional benchmarks like competitive math and whatnot It's beating out these other very very smart models 01 Pro just kind of feels like a a weird moment in time now because it was so expensive and there are so many things that are better than it now It's kind of crazy Oh this is funny Temporary chats are disabled for 03 Pro as they resolve a technical issue I know what that is Since the temp chats aren't persisted it relies entirely on streaming to the client when it's done but the state of streaming to the client on these really slow generations is probably entirely broken So it can't do that That's really funny It shows how hard it is to build these types of things This is one of the things I'm thinking about for our temp chat solution too So sympathy to the engineers who are stuck solving that problem It's not going to be fun to do It does also seem to be significantly better at code which is exciting I am very curious to see how it feels to use 03 Pro versus 03 solving problems inside of Cursor Should be fun I personally like to wait to get more thorough benchmarks from folks like Artificial Analysis but as previously mentioned the reasoning times are insane So yeah this isn't going to be cheap to run and it's not going to be very fast either All of this said Gemini 25 Pro still beats it on some of these benchmarks some of the math ones in particular but they are neck andneck It's interesting Also 04 Mini performed really well and I'm not surprised they didn't put it in the benchmarks they're sharing here cuz 04 Mini probably wins in a handful of these things O4 Pro is going to be a very interesting release when they get there This was a fun interaction that happened at the beginning of the year from the late in space guys where the author Ben was not sure about 01 and the O models from OpenAI initially got ratioed by Sam Alman and quote tweeted by GDB about it and the lesson that Ben learned is that you should not use these models as a chat You should treat it like a report generator Give it context give it a goal and let it rip That's exactly how I use 03 today But there in lies the problem with evaluating 03 Pro It's smarter Much smarter In order to see that you need to give it a lot more context And I'm running out of context There was no simple tester question I could ask it that blew me away We're well past the days of my favorite ball bouncing test There's a reason I didn't open the video with that It's just not really relevant anymore It barely was then and isn't now Uh yeah the co-founder Alexis and I took the time to assemble a history of all our past planning meetings all of our goals and even recorded voice memos and asked 03 Pro to come up with a plan We were blown away It spit out the exact kind of concrete plan and analysis that I've always wanted an LLM to create complete with target metrics timelines what to prioritize and strict instructions on what to absolutely cut The plan that 03 gave us was plausible and reasonable but the plan 03 Pro gave us was specific and rooted enough that it actually changed how we're thinking about our future This is hard to capture in an eval I agree I feel like the capabilities of these things are no longer truly traditionally benchmarkable There's a reason that the people deep in that space like my stupid safety bench so much Snitch bench as silly as it is is a weird practical edge case deep dive on like what behaviors these models do and don't have And I feel like benches are going to move away from how smart is this model and towards how does this behave in different scenarios because that's what's going to matter more and more And 03 Pro might be way smarter That doesn't mean you should use it as your default model because it isn't good to chat with Trying out 03 Pro made me realize that models today are so good in isolation that we're running out of simple tests The real challenge is integrating them into society It's almost like a really high IQ 12-year-old going to college They might be smart but they're not a useful employee if they can't integrate That's a hilarious way of putting it And as the author then says this integration comes down primarily to tool calls And historically OpenAI's models have not been great at tools that has since changed to the point where now when you go to chat GPT they have a little button here that is literally choose tool and you can pick which tools you want to give access to on their website which means we need to start adding more tool call options for T3 chat More coming soon It's interesting that deep research isn't considered a tool It's just here separate but I have 250 available during my time with my $200 subscription So that's about a dollar per report Fascinating You can also link it to external sources I've seen them leaning more and more into this It feels like the the tool calling stuff and the large context stuff went from out of OpenAI's interests to the thing they are most focused on and they're going ham on it It's still so crazy that there's a tool call button inside of the chat GPT site I never thought I would see the day but it really highlights how they're thinking differently about things Speaking of which look at all of the model options that we have now RIP 4.5 it's getting sunset soon Apparently 03 Pro is better at discerning its environment as in what it has access to and what it's supposed to be doing as a result It can more meaningfully communicate what tools it has access to This actually one of the biggest problems I have with Gemini models especially the recent ones They love to describe what they think they're going to do with the tools and then just not do it And this got way worse when they added reasoning summaries because when they added that it seems like they deprecated the deeper reasoning and cursor So now it doesn't get to do as much as it used to It's quite annoying It also seems better about when to ask questions about the outside world instead of hallucinating information That said as these models have gotten smarter they actually seem to hallucinate a bit more which is scary And I more and more think the solution to hallucinations is giving these models access to tools and the ability to stop and ask a question to collect additional context There are problems with this though and they kind of come down to that pricing model I did see Edwins like 03 is now cheaper than 40 It's also 04 Pro is significantly cheaper than 01 Pro Even though it is like hilariously cheaper than it used to be it's still quite a bit of money for those input and output tokens That's 20 bucks per million input and 80 bucks per million out So imagine you have 150,000 tokens of context Let's model this out we have this 150k token context It starts with like the instructions So this is what to do and the rest is tons of context So we give all of this to a model like 03 03 reads through the context It looks at what we want it to do and then it responds with a very short response very short costs almost nothing asking what about X where it wants to know more info about this particular thing that it couldn't find in the context window So you tell it I'll use colors for this Green is from them and yellow is from us So yellow is build at 20 per mill and green is build at 80 per mill for 03 pro Just inputting this message is $3 of API costs if you have enough context This response is nothing It's literally going to round to like zero like not even a fifth of a cent because it's so little like information the response it barely matters But if you now respond saying "Oh X is whatever." Even if this is really low context we'll say this is like 1,000 tokens that you've added here Oh that means it's going to be really cheap right sadly wrong because the next request has to have the whole history for all of the context So instead of this being very simple where this was like 400 tokens reply and then you give it a thousand tokens and then it generates a new response it effectively has to reingest the whole thing So as the history gets longer this $3 gets rebuild on every further message So it kind of sucks when a model stops and asks because now it has to reingest all the context in order to add more stuff This is part of what makes tool calls cool because if instead of this reprompting you it halts itself it goes out during this ex execution gets some more data and then adds that back in as additional context It doesn't have to lose and then rebuild the context that it had before So tool calls are cool but human in the loop has historically kind of sucked because it forces this context to die and then be remade This is also why caching is so important because one of the solutions that's implemented in stuff like as of recent they got this with uh Gemini models This will automatically be cached in the cache reads cost less but it's only cached for a certain amount of time So if I wait 31 minutes before responding here now I have to eat this ingest cost again But if I do it in 29 minutes it'll hit the cache and cost significantly less But now you have to be very intelligent about when and how you cash You have to think a lot about these things and it just it disincentivizes you from doing human in the loop on these smarter models because every time you stop you're risking eating this bill again for the whole context This should make you sympathize with people like the cursor guys because when you ask the model to do something slightly different or make a small change it still has to reingest everything So if you ask a model generate this whole codebase for me and then you ask it make this one change the input cost is still going to be the same for both Obviously when you're generating that much the output token cost starts to go up a ton but from my experience the input tokens have been very expensive and for something like cursor I would imagine those input tokens are the vast majority of your expenses Yeah finding the right way to manage your context is becoming more and more a problem as the use cases for these models become more powerful but also need you to confirm things more often That said as the prices race down these problems matter less and less It's been kind of crazy watching the like what I call the race to the bottom in the pricing wars Here we hop over to the cost to performance here Intelligence versus price Suddenly Claude 4 opus looks really bad because it's so expensive and it's not much smarter It's actually quite a bit dumber than some of these other options I had to turn off Claw 4 opus to make this chart even like readable This actually makes this very funny now cuz the Sonnet thinking model and sonnet in general from Anthropic is their second most expensive model and it's still the most expensive thing on this chart now which is kind of crazy I never thought I would see the day where everyone would undercut them Okay I kind of did but I didn't think it would come so fast and so aggressively Got to turn off more useless things in here When you open this chart this way 03's new price starts to make a lot more sense They're really neck andneck with the most recent Gemini 25 Pro refresh And I think the new pricing is meant to to undercut them a bit I do trust what they say which is that they found ways to make the inference steps way cheaper and faster on their end 03 is running faster I saw some people speculating that they actually swapped out the model and there's a new dumber model that you're running instead Otherwise it wouldn't be so much faster No if they made changes that make it faster to run those same changes also make it cheaper to run Faster models tend to be cheaper overall because they're doing less inference They're spending less time on that compute step which is why these models cost so much money to run That's also why 2.5 and 2.0 Flash from Gemini are so fast because it runs absurdly quickly Same with Gro 3 Mini These models are cheap for a bunch of reasons but the biggest one is that they're spending less time and less energy doing compute This chart has gotten so interesting so quickly though O4 Mini still stands out as absurdly intelligent and reasonably priced That said the costs here are not accurate to real world use because the amount of reasoning it does will greatly inflate the price Some of these models might solve in a thousand reasoning tokens what others do in 10,000 reasoning tokens which makes the costs go up a ton accordingly This chart's the one that really tells the story This is how expensive it is to run the artificial analysis benchmark which is how they measure these models Running for Gemini 25 Pro ended up being the most expensive even more so than Cloud4 opus because it just generated so many more tokens The reasoning cost was $852 where with Cloud 4 Opus they don't split up the reasoning and non-reasoning cost so it's a bit harder to split but it ended up being half as expensive almost overall So even though Opus is more expensive per token Gemini 25 Pro does more reasoning So it's generating more output tokens which makes it worse So the traditional cost per token is no longer the only number you have to look at You have to look at a lot of other things Like if we compare running 2.5 flash reasoning to 2.0 flash on the same benchmark Remember 20 flash costs $3 2.5 flash reasoning cost $319 Massive gap massive gap That said once again 03 Mini is coming in clutch being a solid in between The fact that 03 Mini is cheaper than 25 Flash Reasoning to run this benchmark is kind of hilarious considering how much more expensive it is per token But the per token numbers are starting to matter less and less which is kind of weird I'm also excited to see what this looks like when they rerun the 03 bench with the new pricing cuz I bet this will get pretty cheap This actually might be the rerun As they show in the official artificial analysis charts 03 has shifted really far left in the price per million tokens but this was the fresh run with the new pricing It is hilariously cheaper I also love seeing Quen 3 so high up here because the actual token costs for Quen 3 are really cheap But as we've established with my favorite weight index the amount of times it gaslights itself solving any given problem results in Quen 3 just generating endless tokens So you end up eating a bunch of cost and waiting a bunch of time for the model to generate an answer This is the most fun chart though is intelligence relative to cost to run the benchmark And funny enough the only thing in this top left quadrant of good score relative to its cost to run is Gro 3 Mini Again I hate that Gro 3 Mini continues to like be a weirdly good value solution but it really does O3 and Gemini 25 Pro are the top performing overall but 03 is now quite a bit cheaper than the 2.5 Pro option And funny enough 03 and 04 mini cost very similar amounts to run this benchmark on now which I I never thought I would see the day that it's like neck andneck costwise to run something like this against a mini model and a best-in-class like flagship model It's very interesting Things are changing fast Also of note is that 03 still has a 128k context window maximum I thought they bumped it with 04 and I was wrong Okay they bumped it a little It bumped it to 200K but GBT4.1 has 1 million as do all of the Google models All important things to think about as you reason about which of these models to use and what to use them for More and more it feels like you have to kind of be a power user to get the benefits of these things Like once again there's a reason that 40 is the default whenever you go to the chat GPT site Most people should probably never change this but us enthusiasts can benefit a lot from using these other tools the right way These reasoning models will always have enough context The problem is if you don't give them enough context they will generate it themselves So if you don't give it enough info to get to the right answer it will just hallucinate a bunch of stuff and reason forever That's why we saw this YouTube post where it reasoned for 4 minutes when he said "Hi I'm Sam Alman." That's insane That's hilarious That's absurd But that's because the model likes to parse through a bunch of information And that's what it's for Which again makes it weird that it has such a small context window 200k token window input 100k output which is pretty absurdly large But again 200k in is small relative to a lot of these other models So more than ever there's this balance you have to strike of giving it the right information giving it a lot of information but also giving it the tools so it can access the additional information that it needs to be able to go get It's an interesting balance And once again to emphasize the fact that this model came out kind of late May 31st 2024 knowledge cutoff The knowledge the model has because of the data it was trained on is over a year old Then again so is 04 many It seems like they're just training it all on the same knowledge Interesting actually As latent space says it's a really good model for using tools to do things and analyzing large amounts of data but it's not so good at doing things directly itself You ask it to just generate some code probably not the best thing you ask it what's wrong with a large amount of code it'll probably do quite a bit better They also call out that smart models like 03 Pro really need to be able to explore their environment using tools This is an interesting point 03 Pro feels very different from Opus and Gemini 2.5 Pro Where Claude Opus feels big but never showed me true clear signs of its bigness 03 Pro's takes are just better It feels like a completely different playing field This is very interesting and I'm excited to try it out in stuff like cursor because again I have not seen much of a benefit from the bigger models there I'm pretty sure I'm just rocking Sonnet 4 right now as my default Yeah Cloud 4 set is the model that I reach for at the moment Not even in max mode I just use standard Cloud 4 Sonnet Works pretty well for me I was on 25 Pro but I got more and more annoyed about it not doing the thing it was supposed to So I've used it less recently I tried 03 a bit and it was really smart but it just took too long to do the things I wanted it to and it was more expensive It no longer is So I'll give it another go But if we look at what I actually use day-to-day like in line for my uh command K is GPT4.1 cuz I don't want a reasoning model to like help me as I'm just quickly making a change So if I highlight something and tell it like change how this looks or fix the layout shift or whatever it's so nice having a non-reasoning model that just guns it out immediately and 4.1's been great for that So that's where I'm at right now But if 03 Pro is better at like overhaul this portion of the codebase I could see it being really useful I'm going to give it some honest shots tonight and if I get enough interesting info I'll leave a pinned comment telling you how I feel It seems like once again for these new reasoning models system prompts should be minimized context should be maximized use cases should be longunning big tasks that they benefit from their intelligence for Apparently system prompts wildly shape behavior now more than ever Leaps and bounds different from anthropic and Gemini where cloud is feels big but doesn't really show it Yep And it seems like OpenAI is really going down this vertical reinforced learning path Stuff like deep research and codeex trying to make it so they can do smarter things with the tools And I totally agree In a lot of ways OpenAI was kind of late to this tool calling world but OpenAI is rarely late to things And now it feels like they are leaping ahead And it it really does I think we'll be in a position very soon where Claude's advantage on tool calls is fully closed and the gap is now just how we feel about them as developers And more than ever it does feel like OpenAI is taking their competition seriously and going out of their way to never be number two With Gemini it got close for a brief moment And honestly if the Google stuff was more stable I would have said they were at the number one position It was very very close But with 03 getting cheaper 03 Pro finally shipping and 04 Mini being as insanely cheap and effective as it is and all of these being on APIs that are consistent having tool call protocols that work reliably the embrace of MCP and all these other things I still feel like OpenAI models are the ones that I can just use and get what I'm looking for Are they as good at coding in my editor maybe I haven't used them as much recently but I'll let you know in a bit But overall OpenAI has managed to maintain their lead and once again these ships put them in first place I'm curious how you guys feel Is this AI race getting less interesting or are these leaps still exciting to you i'm still hyped especially when the price gets cheaper so I can give you guys better stuff on T3 Chat but I want to know how y'all feel Let me know in the comments And until next time keep prompting ## OpenAI is suing Elon - 20250411 elon's non-stop actions against us are just bad faith tactics to slow down open AI and seize control of the leading AI innovations for his personal benefit Today we counters sued to stop him I can't believe this is a real tweet Kind of nuts to have this coming out of the official OpenAI newsroom but the beef between OpenAI and Elon has always been absurd I've covered it a bit in the past We're about to go a lot deeper though because this one is kind of crazy Also of note Gro 3's API just came out like an hour ago and it almost certainly seems like a retaliatory back and forth going on between them There's a lot here I'm going to do my best to cover the history where we're at and predict what is next But since neither OpenAI nor Elon are paying me in fact both are probably going to start costing me a hell of a lot of money once I implement their models someone has to pay the bill for this video So a quick word from today's sponsor and then we'll dive right in Before we get to the blog post I want to finish reading these tweets cuz they're insane He's been spreading false information about us We're actually getting ready to build the best equipped nonprofit the world has ever seen We're not converting it away Elon's never been about the mission He's always had his own agenda He's tried to seize control over Open AI and merge it with Tesla as a for-profit His own emails prove it When he didn't get his way he stormed off Elon is undoubtedly one of the greatest entrepreneurs of our time But these antics are just history on repeat Elon being all about Elon See his emails here This is the email history they published back in December By the way this includes back in 2015 OpenAI starting as a nonprofit and Elon questioning it Probably better to have a standard CC corp with a parallel nonprofit We felt that a nonprofit was the right path at the time but later came to realize that our structure would have to evolve to attract the capital necessary for our mission This was the original plan back in November of 2015 Sam emailing to Elon Plan is to have you me and Ilia on the board of directors for YCAI which will be a Delaware nonprofit We will also state that we plan to elect two other outsiders by a majority vote of the board We will write into the bylaws that any technology that potentially compromises the safety of humanity has to get consent of the board to be released And we will reference this in the researchers employment contracts At a high level does this work for you and he said no Was cool with the YC support but doesn't like it being part of YC and the YC AI name was weird If you're not familiar YC is Y Combinator It is a startup accelerator that I am part of My company T3 Tools mostly known for ping and T3 chat is part of Y Combinator We went through it back in 2022 And YC also helped kickstart OpenAI because Sam Alman used to run YC and is really involved with them And they wanted an open AI company that then became Open AI itself Open Artificial Intelligence Technologies Inc This was 9:15 2017 when they actually incorporated in Delaware which by the way everyone incorporates in Delaware because of them being less annoying about taxes and things Don't read into it We're just like I'm incorporated in Delaware You can't sue your way to AGI We have great respect for Elon's accomplishments and gratitude for his early contributions to OpenAI but he should be competing in the marketplace rather than the courtroom It's critical for the US to remain the global leader in AI Our mission is to ensure AGI benefits all of humanity and we have been and will remain a missiondriven organization We hope Elon shares that goal and we uphold the values of innovation and free market competition that have driven our success Here was the first email again Open A gets announced officially as OpenAI in December of 2015 We skip a bit of time get to early 2017 Our research progress led us to realize we need billions of dollars for the compute to build AGI In 2017 we made progress on building an AI for the competitive video game Dota We discovered we would need far more compute than we initially imagined In June of 2017 Elon replied to an email saying "Okay let's figure out the least expensive way to ensure compute power is not a constraint." Ilia reiterated in July that each year we'll need to exponentially increase our hardware spend We have reason to believe AGI can ultimately be built with less than $10 billion of hardware That did not end up being true at all Follow-up thoughts from Elon Surprises me is that the AI community is taking this long to figure out concepts Doesn't sound super hard Highle thinking of a large number of deep nets sounds like the right approach or at least a key part of the right approach Probability of deep mind creating a deep mind increases every year Maybe it doesn't get past 50% in 2 to 3 years but it likely moves past 10% Doesn't sound crazy to me given their resources In any event I found that it is far better to overestimate than underestimate competitors Doesn't mean we should rush out and hire weak talent I agree that nothing good would be achieved by that What we do need to do is redouble our efforts to seek the best people in the world do whatever it takes to bring them on board and imbue the company with a high sense of urgency It will be important for OpenAI to achieve something significant in the next 6 to9 months to show that we are for real Doesn't need to be a whopper breakthrough but it should be enough for key talent around the world to sit up and take notice It's crazy seeing Dota 2 characteristics brought into emails that are this expensive and this important It's just funny in retrospect seeing Dota 2 as a bullet point in here We're at a point now where a single experiment consumes thousands of cores and we're adding more distributed comput increases performance And here is summer of 2017 We and Elon agreed that a forprofit was the next step for OpenAI to advance the mission Greg sent Siobhan Zillis who was operating as a liaison between Elon and OpenAI and they recaped notes from a meeting with Elon that day where we proposed an idea to merge with a hardware startup saying it quote turned into talking about the structure He said nonprofit was deaf the right one early on may not be the right one now and I agree with this for a number of reasons Oh agree on announcing the international he suggested playing against the best players winning team seemed cool to me This is all about Dota 2 still by the way And then Cerebrris coming up all the way back in 2017 They're still around That's kind of crazy This is one of the companies that is doing the like chips for cloud in cloud hosting that can spit out insanely fast answers with all these models Cerebrus Grock with a Q and Sombova are the three companies really doing this right now I like that they made a fake iMessage embed here with HTML for that Kind of cute Shows how hard they're taking this all though Then Elon forwarded an article about China's plan to match the US and AI by 2020 become the world leader in AI by 2030 This is all still 2017 which is kind of crazy In August of 2017 our AI beat the world's best players at Dota in a 1v one That night Elon told us "Time to make the next steps for OpenAI This is the triggering event." And immediately after Elon demands majority equity absolute control and to be the CEO of the new for-profit Over the next 6 weeks we negotiated terms for this for-profit Elon demanded the majority of the equity On September 4th of 2017 Siobhan wrote in a message to Greg and he sounded fairly non-negotiable on his equity being between 50 and 60% so moot point on having majority On one call Elon told us he didn't care about equity personally but just needed to accumulate 80 billion in order to build a city on Mars The most Elon thing possible Oh god I can't get over that And I I want to make sure it's clear on the uh winning with Dota piece 1v1 is not a real mode in Dota Defense of the Ancients Dota 2 specifically is a 5v5 competitive game with a huge professional scene It is not the main mode So even though it beat professionals at Dota it was beating them in 1v one The equivalent of this would be like taking 10 of the best competitive programmers in the world and having an AI beat them at building an app Competitive programmers will be way better than the average person at building an app but they're different skill sets They did not win at 5v5 Those saying they did 5v5 as well you're wrong They did not win at that if they did And I don't even think they did it Anyways Elon wanted to make his city on Mars using this money which is very funny These aren't texts between Elon and OpenAI This is OpenAI in the liaison zone that was talking to Elon I'm still slightly confused on the proposed detail around the share percent in board control Given it sounds like the proposal is that Elon always gets max three seats 25% of seats and all the power rests with the board Yes though I'm guessing he intended your overrule provision for first bit but I'm not sure So what power does having a certain percent of shares have sounds like the intention is static board members or at least board members coming statically from certain pools But yeah would be curious to hear the specifics Also I guess for even board size a 50% means no action Think the board would grow to seven people pretty quick The question isn't that but when does it transition to traditional board if in fact it does transition sounds fairly non-negotiable on his equity being between 50 and 60% So point to having majority Yep between Greg and Siobhan who was the liaison Elon laid out a board structure where he would unequivocally have initial control of the company Reminder Elon is just on the board He's not actually actively running the company Even talking to him is done through somebody He's not involved dayto-day He wants to come in and take over And he has those before like he did with Tesla The three common stock seats you Greg and Sam should be elected by common shareholders they will de facto be yours but not in the unlikely event that you lose the faith of a huge percentage of common stockholders over time or step away from the company by choice I think that the preferred a investment round supermajority me should have the right to appoint four not three seats I would not expect to appoint them immediately but like I said I would unequivocally have initial control of the company but that would change quickly The rough target would be to get 12 people on the board probably more like 16 if the board really ends up deciding the fate of the world where each board member has a deep understanding of technology at least a basic understanding of AI and strong and sensible morals Apart from the series A four and common three there would likely be a board member with each new lead investor and ally However specific individual board members can only be added if all but one existing board member agrees Same for removing board members There will also be independent board members that we want to add who aren't associated with an investor Same rules apply here Requires all but one of existing directors to add or remove I'm super tired and don't want to over complicate things Yeah sure But this seems approximately right At the 16 person board level we would have 716 votes and I'd have 25% of the influence which is my minimum comfort level This sounds all about right to me If everybody else we ask to join on the board is truly against us we probably should lose As mentioned my experience with boards assuming they consist of good smart people is that they are rational and reasonable Very funny when you know the drama with the board at OpenAI that we went through a year and a half ago now Insane timeline's fast There's basically never a real hardcore battle where an individual board vote is pivotal So this is almost certainly sure hope so going to be a moot point As a closing note I've been really impressed with the quality of discussion with you guys on the equity and board stuff Have a good feeling about this Let me know if the above seems reasonable Elon also told us that he would need to be CEO Very interesting Elon then after this has a new company formed called the Open Artificial Intelligent Technologies Inc similar to SpaceX's official name which is Space Exploration Technologies Corporation This was registered in September And then soon after Sam and Greg reject Elon's terms because they don't want to give him unilateral control of OpenAI We came close to accepting Elon's terms as we told them "We really want to work with you We believe that if we join forces our chance for success in this mission is the greatest." Saying "The current structure provides you with a path where you end up with unilateral absolute control over the AGI You stated that you didn't want to control the final AGI but during this negotiation you've shown to us that absolute control is extremely important to you." As we told Elon the goal of OpenAI is to make the future good and to avoid an AGI dictatorship We concluded "Thus we are concerned that as the company makes genuine progress towards AGI you will choose to retain your absolute control of the company despite current intent to the contrary." And this is from Ilia Pro has been the highest stakes conversation that Greg and I have ever participated in And if this project succeeds it'll turn out to be one of the highest stakes conversations the world has ever seen It's also been a deeply personal conversation for all of us Yesterday while we were considering making our final commitment even the non-solicited agreement we realized that we made a mistake We have several important concerns that we haven't raised with either of you We didn't raise them because we were afraid to We were afraid of harming the relationship having you think less of us or losing you as partners There is some chance that our concerns will prove to be unreasonable We really hope it's not the case but we know we will fail for sure if we don't all discuss them now We have hope that we can work through them all and continue working together This is the part where they say they really want to work with Elon and that it will increase the chances of success Here's the part where they say that if we succeed with this you would have full control and no one would want to give that up We have a few smaller concerns but we think it's useful to mention them here In the event that we decide to buy Cerebrris my strong sense is that it'll be done through Tesla But why do it this way if we could also do it from within Open AI specifically the concern is that Tesla has a duty to shareholders to maximize shareholder return which is not aligned with OpenAI's mission The overall result may not end up being optimal for OpenAI We believe that OpenAI the nonprofit was successful because both you and Sam were in it Sam active is a genuine counterbalance to you which has been extremely fruitful Greg and I at least so far are much worse at being counterbalances to you We feel this is evidenced even by this negotiation where we were ready to sweep the long-term AGI control questions under the rug while Sam stood his ground And to Sam when Greg and I are stuck you've always had an answer that turned out to be deep and correct You've been thinking about the ways forward on this problem extremely deeply and thoroughly Greg and I understand technical execution but we don't know how structured decisions will play out over the next months years or 5 years We haven't been able to fully trust your judgments throughout this process because we don't understand your cost function We don't understand why the CEO title is so important to you Your state of reasons have changed and it's hard to really understand what's driving it And the second point is AGI truly your primary motivation How does it connect to your political goals how has your thought process changed over time this is the Greg and Elliot section We've had a fair share of our own failings during this negotiation and we'll list some of them here Elon and Sam I'm sure you'll have plenty to add During negotiation we realized that we've allowed the idea of financial return 2 to 3 years down the line to drive our decisions This is why we didn't push on the control We thought that our equity is good enough so why worry that attitude is wrong Just like the attitude of AI experts who don't think that AI safety is an issue because they don't really believe that they'll build AGI We did not speak our full truth during the negotiation We have our excuses but it was damaging to the process and we may lose both Sam and Elon as a result That's enough baggage here but I think it's very important for us to meet and talk it out Our collaboration will not succeed if we don't Can all four of us meet today if all of us say the truth and resolve this issue the company that we'll create will be much more likely to withstand the very strong forces it's going to experience This email came first at 2:08 p.m Elon replied less than 10 minutes later saying that he's had enough We're not doing it And then said that to be clear it's on an ultimatum Then Sam replied that he remains enthusiastic January comes after negotiations broke down Elon proposed that we spin into Tesla We would have had a billion dollar budget right away and it would increase exponentially from there But our team did not want to work at Tesla We spent the next month trying to find another way to raise the capital required to achieve the mission This is a funny quote in retrospect that Elon told OpenAI in 2018 that they were on a path of certain failure relative to Google There obviously needs to be immediate and dramatic action or everyone except Google will be consigned to irrelevance My view is that the best future will come from major expansion of open AI Our goal and mission is fundamentally correct and that will increasingly be a superpower as AGI grows nearer And then February comes and Elon resigns as co-chair This is the point where he is officially left End of the year 11 months later they send Elon an update about their progress and told them about a deal to move our computing from Google to Microsoft in addition to our own data sensors We also offered to talk about longerterm fundraising plans He responds "Sounds good." Are all their plans december 26th Elon sends an email right after Christmas saying "Even raising several hundred million won't be enough This needs billions per year immediately or forget it." My probability assessment of Open AI being relevant to Deep Minding Google without a dramatic change in execution and resources is 0% Not 1% I wish it were otherwise He really didn't think anyone could win other than Google I'm almost positive Redacted here is going to be a Google employee Opening eye reminds me of Bezos and Blue Origin They're hopelessly behind SpaceX and getting worse But the ego of Bezos has him insanely thinking that they are not I really hope I'm wrong I think this is the point where Elon had made his decision about how he felt about these things Public announcement of the capped profit OpenAI LP in March 2019 happened Elon's only feedback was "Please be explicit I have no financial interest in the for-profit arm of OpenAI." We offered him equity in the OpenAI LP which he declined Mind you he helped fund a lot of OpenAI stuff and this would have been a way to convert his funding into actual stock so we could get a profit from it and he declined Offered him and he was declined at the time I don't recall what the actual path was We offered you equity when we established the cap profit which you didn't want at the time but are still very happy to do if you'd like We saw no alternative to a structure change given the amount of capital we needed and still to preserve a way to give the AGI to humanity other than the cap profit thing which also lets the board cancel all equity if needed for safety For what it's worth I personally have no equity and never have I'm trying to navigate tricky tight ropes the best I can and I would love to talk about how it can be done better anytime that you're free This was between Sam Alman and Siobhan More proof that Sam doesn't have equity in the company He doesn't want his ownership and money to dictate the future of AGI Generally good And this was in 2019 Nothing happens until 2023 where Elon starts his OpenAI competitor XAI And then right after he signed an open letter calling for a pause in training systems more powerful than GPT4 Since only OpenAI had a GPT4 level system it was a call for OpenAI to stop development so everyone else could catch up And now Grock 3 is terrible as I think it is in a lot of things is roughly as good as 40 better in some ways So he fully broke that letter he signed Very interesting history And I think it's important to understand the depth of this disagreement between the two Open AAI's goal was historically to make sure AGI wasn't owned by one company Elon liked that idea but then once he decided he wanted to have the money for the whole Mars thing it seems like his mental model for all of this started to fall apart and he started throwing tons of pot shots cuz he has a to be fair like a bunch of inside info and in some ways was wronged And he wasn't wrong because OpenAI screwed up He was wrong because the board didn't do the things he wanted even though he was part of it And that disagreement between him and the rest of the board led to him exiting And again he thought there was a 0% chance of OpenAI succeeding I think this is why he bailed and now he feels regret and is instead of just catching up is fighting them optically cuz personally like like imagine dropping this bag Imagine being this certain Open AI would fail in being as wrong as he was It makes sense he went kind of insane after I get it I will say personally reading this bit here about the OpenAI new best equipped nonprofit it doesn't seem to be about AGI for all rather donating a lot of money to use AI for good I don't even think AGI appears on this page Just imagine and encouraging Yeah AGI doesn't appear on this page at all which was always the point of the OpenAI like nonprofit to make sure AGI isn't owned by one company or business or person This isn't that That's not what this nonprofit is That's the only part here I don't really side with OpenAI as hard with This is interesting Yeah this is wild The whole history is nuts The crazy shaking up of the board throughout is nuts Elon's behavior and weird comments non-stop about OpenAI have been kind of nuts Here's a funny one This is when OpenAI announced the Stargate project with the US government to do the massive infrastructure in the US Elon replies "They don't actually have the money." To which Sam replies "I genuinely respect your accomplishments and think you are the most inspiring entrepreneur of our time." I I I like the angle Sam has with a lot of this that he's trying to to good faith respect Elon for what he has done while he is tweeting OpenAI is evil Soft Bank has under 10 billion secured I have that on good authority This is interesting Yeah he thinks that a soft bank can't actually fund OpenAI Sam says this is wrong Want to come visit the first site already underway this is great for the country I realize what is great for the country isn't always what's optimal for your companies But in your new role I hope you'll mostly put America first What a banger reply on Sam's part In most of the things Elan has talked about with most of these types of people in the past he could just be wrong so to speak like this and it was fine Now he can't because the stakes are so much higher and we're seeing some questionable things being said as a result I understand why the lawsuit is happening It's basically the only way to to force him to shut his mouth when he's refusing to talk As you saw in those tweets there with Sam he just never replied to Sam He replies to the announcement to the news spreads some gets destroyed in the replies and then doesn't say anything at all about it from there It's sad It's kind of crazy that he is so willing to just lie and then not acknowledge the reality I'm not a big fan of suing somebody for their speech But yeah when you're lying this profusely and using a platform that you purchased to elevate your competing product and just getting away with it I think this is overdue Elon obviously helped with the starting of Open AI but his failure to take control early on is something he has now flipped as a reason to punish the company It makes sense they're fighting back especially now that they have significantly more money Yeah good luck to OpenAI in this lawsuit I am almost certainly on your side with this one It sucks that we can't talk about the things that I don't agree with that you're doing because we're so focused on these things that aren't real I still largely believe that OpenAI is trying to execute on their mission and I still think there aren't many companies that would be better to have this far along so to speak in development of AI tech This is a weird one I am very curious how you guys feel about this video Let me know in the comments ## OpenAI just had the craziest fundraise ever - 20250402 open AAI just achieved AGI well not quite but they got the next best thing $40 billion of money raised against a $300 billion valuation while it's not AGI they claim it's going to help them significantly with getting there and there's a lot to talk about here from the history of how OpenAI got where they are to what it means to raise money like this what does this $300 billion even mean and what's the long-term impact of a company like OpenAI having the largest private tech deal in known history there's a lot to think about here and a couple pieces that I haven't seen anyone else cover and I'm really excited to break down what this means for the future of AI startups and how the whole fundraising thing works for those who don't know it but since I didn't just raise $40 billion someone's got to pay my bills so quick word from today's sponsor and I'll get right back to it i still remember the days when O was easy you just added an email and a password field to your database and moved on but nowadays that's not the case from SSO to SAML to all the weird compliance stuff you're going to have to handle when you start working with other companies and other teams it is not fun to set up Oth nowadays unless you use today's sponsor Clerk these guys have made O so much easier for me and many many other companies clerk's the O provider I use for most of my products from upload thing to pick thing to marker thing and it has made all of those way simpler to build not just because it can plug the O in for you but the combination of separating your user table from everything else is a thing I actually have learned to love but also all the UI stuff they handle for you too you just get components in React that you can go mount in your app to have all the pieces of the O UI handled without any additional effort and this is important because there's a lot of weird compliance things around how you have to put the Google logo and show it in certain ways or you might get banned by Google it's insane what if you didn't have to deal with any of that yeah it's a good deal they integrate into almost every major framework really really well obviously it's the best solution for Nex.js and it's not even close and one more small thing I just I love this and I think it really shows how much Clerk cares they give you 10,000 users per month for free but that's not just someone hits sign in and bailed they actually have a catch one that benefits you greatly if a user doesn't come back for over 24 hours they don't count towards that cut number this means you don't have to worry about a huge surge of traffic causing your bill to spike because the those users aren't real it won't count towards it this is a huge change that's actually saved a bunch of our products a ton of money like upload things use your sign in set it up and then don't go back to the dashboard so unlike other off providers that charge more aggressively per user not a problem here clerk's been my off platform of choice for over 3 years go figure out why at soy.link/clerk so before we dive too deep let's read their post about this and then I will dive in today we're announcing new funding 40 billion at a 300 billion post money valuation which enables us to push the frontiers of AI research even further scale our compute infrastructure and deliver increasingly powerful tools for the 500 million people who use chat GPT every week we're excited to be working in partnership with SoftBank Group few companies understand how to scale transformative technology like they do their support will help us continue building AI systems that drive scientific discovery enable personalized education enhance human creativity and pave the way towards AGI that benefits all of humanity very interesting soft Bank tends to come in super super late and as always they're coming in late as hell on this one $40 billion is a ton of money 30 billion of it was from SoftBank and 10 bill was a syndicate of additional investors other people companies firms etc all investing in in order to understand what these numbers all mean we need to better understand a bit about how fundraising works for early stage private companies first we need to understand is that $300 billion number the valuation is effectively made up the reason that number is made up is it's value that doesn't exist if there's a company that has stock on the stock market then any person can buy and sell that stock when a company is private you can't just sell it i'm going to break this down using rather than open AAI something a little more personal which is the way that Ping which is the owner of T3 Chat my company is split up this is T3 Tools Inc t3 Tools Incorporated has a valuation that is a number we'll give it a nice round one we'll say it's worth $10 million the company itself is split in half half is Theos and half is my CTO MarkX technically speaking there's a bit more on the end here that is for stock grants for some of our other employees many of which aren't working with us anymore sadly but for the most part it's like 4848 split between Mark and me but we did raise money we went through Y Combinator we raised a bit of money afterwards so there's a chunk at the end here that technically speaking will belong to our investors there's a catch though we didn't raise using traditional stock we use a thing called the safe the safe stands for secured against future equity that means that effectively our investors wrote us an IOU let's say our investors came in as a group we'll call it Z Combinator and Z combinator gave us 1 million on a safe against a $10 million post money valuation most of these terms probably mean nothing to you other than the money so let's break down what it means if we split this so it's not just Mark and me but it's instead the box that is the company when we raise money at this $10 million post money valuation it means we take a split here we'll say this part is the 1 mil and what's left is 9 mil what this means is this 1 mil that was bought by the investors that was invested in the company this is owed to them which means they have this 10% of the company because they get the 10% based on what the valuation is here and this 9 mil is a number we made up as agreement saying this is theoretically worth up to $10 million but it's theoretical so now Mark and I are split across that 9 mil where instead of us both owning 50% of a 10 mil We both own 50% of a 9 mil company and the investors own 10% of this last bit here the important thing to know here is that this all is made up at this point our company isn't worth $10 million or whatever our last valuation was because you can't come and buy it a value means nothing if you can't execute it if somebody came up to me and wanted to buy 10% of my company for a million dollars I would tell them to off because we're worth a hell of a lot more than that right now and if we weren't in the middle of raising a round then doesn't really matter what offer you come with i'm just going to say no considering the amount of money that T3 is making and the size of our growth our valuation is a hell of a lot higher than 10 20 50 probably even 100 mil just cuz our growth is insane right now our numbers are unbelievable it's making money that disgusts me so what happens when we do our next round let's say we go straight to the stock market and we're actually worth 100 mil now this chunk is worth 90 mil and Mark and I are going to have a great day splitting that 90 mil between us this chunk is now worth 10 mil awesome a+ they just 10x their money they're happy we made a whole bunch of money from nothing we're happy but someone has to pay this 100 mil it has to come from somewhere it could be that we go on the stock market and sell a bunch of stock it could be that we get bought out by a company and they trade us money and stock from their company for hours something has to make this number real because right now it is a theoretical founders of these really big successful companies don't actually have a lot of money unless they sell some of their chunk early or more common take 100k from the bank and I'll back it against this valuation of my company so now if I don't pay you back you can just take this chunk of my company instead very common for venturebacked loans to exist for founders that want more money i'm lucky i make money on YouTube i'll never need to do things like this but what happens if it goes the other way what happens if instead of being bought out for 100 mil we get bought out for 1 mil that investor from earlier invested 1 mil so does their 1 mil now become $100,000 no this is a valuation cap that they invested on i should add that here this investment for 1 million on a 10 mil cap means that if we're worth more than 10 mil it converts as though we were worth 10 mil so this $1 million becomes 10% if we're worth 10 mil 100 mil a bill 10 bill 100 bill whatever this will be a win for the investors if we end up being worth more but if we're worth less this word cap matters a lot let's say we'll be a little bit more generous let's say we're worth 2 mil their investment now becomes 50% of the company instead because they are investing based on a valuation that doesn't exist so if the valuation is being less they end up with half and now Mark and I are split between the 1 mil remaining and if it turns out we're only worth 1 mil then the investors just get the whole thing and despite the years we put in if our companies bought for less than we had invested in it we make nothing so let's change all these numbers from M's to B's if my company raised a billion dollars against a $10 billion valuation you might feel great you have a billion in the bank but if you get sold for anything less than that you get zero you could spend years running a billion-dollar company and if you don't come out on top of that if you don't come out worth more than you raised you get literally zero for that one more important detail to note about all of this is that OpenAI is transitioning from a nonprofit entity to a for-profit entity because again of that weird cap on the investment and all of that they historically been run very weird and they are in the chaotic process of transitioning into a traditional business in order for this $40 billion investment to go through they have to complete that transition by the end of the year apparently if they don't do this transition Soft Bank might go back all the way to 20 billion instead of 40 oh no this gives them an accelerated deadline for OpenAI to pull off its complicated transition if it was under a 2-year deadline from its last round of financing with investors startup said a transition to a for-profit entity is required to secure the capital and need to develop the best AI models they did not respond to Reuters for a comment all makes sense the realistically speaking as insanely complex as this transition is going to be for them $20 billion can pay for a lot of lawyers so they're probably going to pull it off and the fact that they so confidently announced this fund raise means they think they are good but what does this mean for everyone else good question well the first piece I want to focus on is this post money bit the way I describe this is technically we were worth 9 mil then we raised a mill so if we have a $9 million company with a million in the bank we end up with $10 million total that's what post money means pre money means it's a $10 million company you invested a mill now we're an 11 million company so instead of getting 10% you get slightly less pre- money is proof founder terms because it means raising more money gets you less so if you invest in my company thinking I'm only going to raise a million but then I raise 5 million instead you get a smaller percentage as a result and that sucks as such for the most part we like post money valuations as investors and as an industry we lean towards post money because it makes the math easier it means you can raise more money without hurting previous investors and everything is hunky dory happier overall the post money valuation is what OpenAI just raised so technically speaking they're not a $300 billion company they are a $260 billion company with $40 billion that they just added to their bank account so that's the first piece I want to make sure we understand is OpenAI's value isn't 300 billion it's 260 billion but they also have 40 bill in the bank and chances are they have more in the bank which means that all counts against their value but as money in the bank it's even better apple has trillions in the bank literally so their valuation is weird because they could buy back half their stock right now and it's fine the first thing we need to understand 260 bill is OpenAI 40 bill is what was just effectively claimed by that investment but that's not the only investment that has happened there's also 13 bill here that came from Microsoft there's also other smaller investments that came from others many of those are capped in a different way that's very very unique to OpenAI which is up until recently returns for investors were capped this is a very unique thing to how OpenAI raised money that I've never seen before it's part of the whole like they're technically a charity thing if we took my example from here bump this back to the 10 uh mil the investors get their 1 mil at 10% if we then ended up being worth a,000 mil which is a bill we 100x our valuation that means they get 100x their investment they get 100 mil for the 1 mil they put in because we're worth 100 times more than when they invested the thing that makes OpenAI's stuff unique is once the investor has made enough back they get hard capped and essentially have stops staying still it goes down so when we hit 100 mil they go from 1 to 10 uh actually I want to break this down like in the different states it'll be in i'm going to remove the theo mark let's color this so the point here is that the green is what you own and the red is what the investors own so the investment happens at this 1 mil val company's worth 10 mil the founders and whoever else there has 9 mil technically they can't execute on this this is all theoretical value here as I said before if we end up being worth 2 mil this ends up being split accordingly hopefully that's a 50-50 split it's close enough you get the idea also of note this would shrink horizontally because it's less money but I'm just going to leave it the same scale cuz it makes my life easier cool if it was 2 mil they still have their million dollar stake at 50% we end up with less of the company here we own 90% of the company here we now only own 50% because we didn't come out successful enough where things get more fun is what if we did what if we were actually worth 100 mil now the percentages are going to be the same i'm just going to copy paste this to show that it's going to be the exact same split as we had at the start but these numbers are all going to have a zero added very nice and handy and if we ended up being worth more than that if we ended up being worth a bill then Mark and I have a really good time ahead of us the thing that makes OpenAI weird is what happens here since they have these special terms they want to be a nonprofit by the books at least if they had done the exact same investment stuff but with that 10x thing then that 1 mil can only go up to 10 mil which means at this point their investment gets significantly smaller as a percentage of the company their percentage of the ownership goes down as we raise more money because they have maxed out how much they can make from their investment and this is a very very strange mechanic that hasn't existed as far as I know in any other startup in history it's very very strange where this does actually happen a lot is in game investment i recently started investing in games so I know a lot more about this now usually when you invest in a game the terms will look something like this they give 100k towards dev investor gets 70% of rev a new until investment 3x's investor gets 10% of revenue indefinitely so when I invest in a game I might hand them $100,000 they then rush to get the game out once the game is out I'll take 70% of what it makes until I've 3x my money then from that point forward I get a much smaller percentage these numbers are all exaggerated but rough idea it's something like this that's a good way to put it from chat i don't watch Shark Tanglish so I don't know how to like reference that it's a capp royalty capp royalties are very very unusual in early stage companies they mostly happen in like media and services things like a game being released and even then it's weird very uncommon it's part of why Mr wonderful is such a meme because any real investor looks at his way of doing things is like "What the are you doing that's so weird and difficult for no goddamn reason." The problem with these investment strategies is that they prescribe a specific way the business has to run and let's say a third of the way through the development of the game they decide it'd be better to make an engine instead how does that work for me it's very strange very strange and unusual as such this only works with very fixed straightforward wellplanned businesses so we don't see it a lot in the venture capital world usually what we do is similar to what I just described with the safe investment also of note at the safe this equity doesn't exist if you invested in a safe for my company which is what Y Combinator did and what all of our early investors did technically right now they own zero of the company they have an IOU for a future event the future event is usually something like a series A raise where we have companies coming in and like buying stock in the business at that point their IUS get converted into real stock that hasn't happened yet open AAI has had that happen there are people who own real stock in OpenAI at this point they can't do anything with it but they do technically have shares that are allocated to their names they can go to a table somewhere where it's vested and says this is owned by Microsoft thus far we've mostly been talking as though you only raise money once let's grab this chunk again and describe how things change over time so we have the 10 mil value 9 mil is ours still the 1 mil is someone else's and let's say we're going to do another raise this time we're doing really well the world perceives us as being worth $100 million theoretically that means it's 90 mil 10 mil right not that simple cuz the point is we're doing another raise so this is the default split but we want to raise more money let's say we want to raise another 8 million this 10 mil gets shifted down we need to raise a bit more we need that 8 mil so that gets appended here to the end we have this 8 mil from this new investment previously we had sold 10% of the company that 10% is still here it's just worth more now but now we have this additional 8% we sold which means we don't have 90 mil we're worth 82 mil and another raise happens we go down the chart now we're worth or we're raising against a billion by default again we just add zeros to all these numbers i'm going to have to make them smaller so it all fits first investment is now worth 100 mil second investment is now worth 80 mil we're raising more money we're raising another $50 million let's say well time to start cutting move this down move all of these down at this smaller block at the end here oh no that 820 mill is not 820 anymore no that is 770 now is it terrible and awful that I went from a theoretical 9 million to a theoretical 770 no but my percentage of the company has gone down a ton i went from owning 90% of it to owning just barely like 70% and this will keep happening over and over until you end up owning way less of the company i also intentionally use much smaller numbers here usually the number ends up being over 10% not less than 10% during like sequential rounds so OpenAI here was 40 bill on 300 bill what this means is SoftBank putting in their 30 now owns 10% of OpenAI so 10% of OpenAI is now owned by SoftBank the other 10 bill was split AC across a bunch of other people but that's 40 bill which is a little over 10% is closer to like 12.5% of Open AI was just sold effectively there is one other catch here though what happens if I need more money what happens if I spent all of this because remember I didn't get $230 million i got $1 million then I got 8 million then I got 50 million so I only technically raised $59 million and chances are as I got to each of these stages the reason I raised again is I was running low on money early stage companies shocker lose money most of the time it's very rare that early stage companies are actually profitable like incredibly so and if they are that usually means they have an opportunity to spend more money in order to grow faster in order to become bigger because generally speaking the things that are in this VC world are winner takes all being the seventh biggest social media site doesn't matter because one through three have 90% of the traffic being the 15th biggest AI company probably doesn't matter because one through three are going to be the models that everyone is using so even though my company is theoretically worth a billion dollars we've only total raised 59 million we've probably been spending money throughout and importantly we might be running low on that money especially at this point where we only raised 8 mil at this valuation now we're probably going pretty close to broke depending on how we're spending and allocating our funds so we raise 50 million oh my god we have so much money we've only ever seen a seven-digit number all of a sudden we have a big eight-digit number in the bank we should spend it we should do more marketing we should double the team size we should finally hire designers we should buy a billboard we should do all these things and all of a sudden that 59 million goes to 02 so now we are back to having no money in the bank we need to raise again what happens if no investors agree to a $10 billion valuation what if instead those investors agree to I don't know 800 mil this is called a down round down rounds suck because these percentages aren't going to go down once these are locked in they're locked in that gets converted every step along the way so they're keeping their percentage so just from this we haven't even added the extra money yet just from here the one building that means you just lost $200 million flat out just by that alone just by taking the down you haven't even inked the new deal yet but we need another 50 million that 50 million is going against 800 which should be able to do that math quickly it's like 6.25% cool we can go with that but that also means shorter shifted all these percentages need to go up now because 100 over 800 is 1/8 which is 12.5 what my mental math would have said 12.5 80 is now 10% and the 50 so this one's now worth 6.25 and the new investment we just did is two that sucks we got $50 million but we lost $200 million that's kind of insane if you think about it that we just raised $50 million so we added $50 million to our bank but we somehow evaporated $200 million in that process this is why you never ever ever ever ever want to take a down round once you have hit a certain valuation if you ever raise on a lower one good chance your company's going out of business because you just took a huge hit to the percentage of the company you own because you are that desperate for money and the investors know this too when they see that you're that desperate that you're willing to take a down round they're going to play hard ball they're going to squeeze every little bit of a percentage they can get out of you and even worse a lot of these investors are going to start looking for their outs they're going to start bugging you saying "Hey can we sell can we sell can we get rid of this we have buyers we want to get rid of it help." You do not want to be in that position you do not want to be in a position where your company is worth less than it was prior and all of the people who currently own parts of it want to liquidate them suddenly you're no longer running a company you're running a liquidity event that you're trying to keep people holding on to this is when you go from building a real business to feeling like you're running a crypto scam and it's not a fun position to be in i've talked to a lot of founders who are in these places usually what they end up doing is going until they're out of money and shutting down and then everyone goes to zero which sucks even harder so what does this $300 billion that OpenAI just raised against actually mean as CNBC mentioned this is the largest private tech deal on record so what this actually means is OpenAI can't really raise money anymore it is incredibly rare for a company to be worth that much money and not be on the stock market basically unheard of for reference a company like Ford the carb makers are worth about 40 billion and that's a stock you can go to the stock market and buy this is a realized value openai is worth almost 10 times more but we don't know if that stock is real or not we don't know if this went public would whatever is not owned by the investors be purchased by people or not where these investors all immediately sell and cause the price to go down because right now this valuation is effectively locked in because no one can do anything about it when somebody invests in OpenAI they're effectively making a bet that OpenAI will sell become profitable or go to the stock market and this 40 billion portion they own can then be sold to somebody else maybe partially maybe fully maybe whatever this stock doesn't exist properly though which makes this number kind of insane the biggest deal with this number is that they can never really raise money again no investor in their right mind is going to go in on a valuation higher than this even this one's kind of insane and it makes sense that SoftBank were the ones to jump on it i cannot imagine any other fund being willing to pour that absurd an amount of money into something not knowing what the next step is the harsh reality of this investment is that effectively OpenAI has to succeed with the money they have now they can't really keep fundraising they can't really keep playing these games for Obese's investors who don't want to literally murder them bring them to court and ruin their lives they effectively now have to hit their goal and as they stated in their announcement new funding to build towards AGI this investment needs to be the one that gets them to that goal they need to hit AGI with the 40 million they just put in the bank because if they don't pull it off they're screwed there is one more important piece here I think is worth talking about this investment didn't just happen it just got announced we don't actually know when this investment happened this investment could have happened this week it could have happened 3 months ago it could have happened years ago chad is coming up with something pretty important here it could have happened before Deepseek exactly we don't know we have no way of knowing when this investment happened there's only a few reasons you announce how much money you've raised remember this is a private company you're under no obligation to publicly announce your fundraises your investors need to know but no one else does your employees probably need to know i don't know the rules there obviously i think you should tell them so why would you announce reason one you want investors to know you raised money why would you want investors to know you raised money because now they know you're going to need to raise more eventually but if OpenAI just announced a raise they can't really top i think it's very unlikely they're going to raise again reason two you want potential employees to know if you're struggling to hire employees because they don't want to be at this early stage company that could go out of business in a month they'll be much more willing to come into the company if they know you have a ton of money in the bank at the beginning of this year we had enough money in the bank for T3 Tools that we would last for about 2 years with our current spend if we hired more people that number would go down because we're paying more people if we make more money it goes up right now our runway is literally infinite because we're making more money than we're spending and as long as we keep it that way we don't have to worry anymore openai is not at that point openai's bank account is lower every day than it was the day prior on average obviously individual days it goes up and then payroll comes and it plummets gpu allocations occur and it plummets even more but overall if you look at the amount of money in the OpenAI bank account every month it is slightly lower than the one before until they fund raise and it goes up a whole bunch and then it goes down slowly over time until it goes up a bunch again if people are looking for job opportunities and they see you're on your last 3 months of runway any logical person especially the really good ones you want to hire at these companies is going to say "No you." But if you just raised $40 billion they don't have as much to worry about there that also means that the stock they get is more real feeling because you just raised money that valuation despite being fake feels a lot more real when somebody puts that much money in so generally speaking employees want to know about these things and new potential employees will be more likely to join up if they see that this also means you're going to get spammed with recruiters and all these other people who saw that you're making that much money and you have that in the bank it also means you're going to get spammed by people like me saying "Hey you should sponsor my channel you have all that money you want more developers to use your stuff i can get you those developers but there's a third point here this is the most important one here by far you want to intimidate your enemies i think this announcement was almost certainly that guy open AAI can hire anyone in the world they want open AAI can't raise more money open AAI they don't want people to think DeepS and Anthropic have a chance they certainly don't want employees of Deep Seek and Anthropic to think they have a chance announcing this is an intimidation tactic it is a method of making the enemies of making the competition scared as this happened because Anthropic announced their fund raise at the beginning of the month it's a series E which means that this is their fifth fund raise so if we go back to my diagram each letter is an additional chunk of money added they raised their series E at a 61.5 billion valuation 3.5 bill on 61.5 so obviously OpenAI saw this laughed themselves a bit saying "Oh 3.5 bill that's cute microsoft gave us 13." 61.5 billion valuation is really big when you compare to Ford anthropic is worth about 50% more than Ford according to this pretty unbelievable but it's still only a bit over a fifth of what OpenAI is theoretically worth now it seems very much like this announcement was meant to counter this one and also to be very clear Anthropic probably knew about OpenAI's raise already because they talked to all the other investors openai almost certainly knew that this happened too the key here and the reason these investment numbers are so big and so different from each other is that Anthropic is an anti-bet you are betting against OpenAI you are saying we don't think OpenAI will be the only winner here we think a company like Anthropic has a very good chance of being as if not more successful or absolute worst case making billions upon billions of dollars anyways you are betting on Anthropic because you think someone else can win too or can beat out OpenAI in the first place openai's announcement here is to remind everyone who invested in Anthropic and all of the people working at Anthropic and all the people who care about Anthropic that they can raise more money than they're worth openai raised $40 billion anthropic is worth $60 billion openai has twothirds of Anthropic's entire valuation in their bank right now that's why they did it they reminding the world that they have all of the resources all of the scientists all of the people all of the investors and all of the everything they need to succeed and pairing this right after the launch of their groundbreaking image gen tools that nobody else comes close to it's a very intentional play all of this is an attempt to remind the rest of the industry that OpenAI is not going to give up their lead they're going to hold strong they're going to do all of this crazy in order to make sure they can win and everybody who stands in their way in the process should feel scared and when I think about what my valuation for T3 chat is and I see that $40 billion number and I see the 300 billion underneath it it's intimidating it is openai could justify spending 10x my company's valuation smearing me publicly with comms because it would be a drop in the bucket for them it's very intimidating to compete with them right now knowing the resources that they have but it also makes it more exciting because these big numbers mean the pie is massive and there's theoretically a lot of room for others to come in and take chunks of that pie or they could acquire me always an option sam my phone number is in Bookface we've been over this before i think this is the clip I'm thinking of if it is I'm going to be very happy hopefully we don't get copyright struck for playing a clip from uh Silicon Valley in this i love this clip so much so much and truth is I'm actually doing okay good that's great yeah i mean I can run the scenarios what happened all I want but I finally just realized there's just nothing I can do you know yeah so I'm at peace with it all i was thinking actually um what if you had asked for less what well what if you could have gone to someone and asked for less than what they offered that first rent like you mean negotiating them down can Can you even do that well yeah i mean why not yeah but uh I mean I guess technically I could have huh yeah i suppose you could argue that uh yeah it might have been easier to uh hit more realistic benchmarks and reach cash flow break even yeah that's what I'm saying and then we wouldn't have faced that down round and we wouldn't have had to settle for acquisition all that money me wow i mean I don't know about maybe look look no no no you know we could have done a legit series B right i'd still be CEO i'd have my job you you get the idea he then has a meltdown the point of this clip is that he raised too much early on so if we go back to my diagram if instead of doing the 10 mil with a 1 mil raise then the 100 mil with a 10 mil raise then the 100 mil with a 1 mil raise if you started here then the expectations are more reasonable you can make better things happen in this time relative doesn't matter how much money your company's theoretically worth your income is still the same like if I raised on a $10 million valuation when I'm making a million a year or I raised at 100 mil when I'm making a million a year I'm still making a million a year the only difference is the expectations investors have and the amount of investment runway you have too if I raise here and then my company goes like that awesome then I can use our growth to justify another raise but if we started here if we raise at a valuation that was arguably too high for where we were or we pivot or do other things that cause our growth to not be great and then we end up needing more money we're but generally speaking you should raise as little money as possible on a reasonable valuation that you know you can meaningfully beat out in the future so you can raise more money on a higher valuation over time you have to think of runway not just as how much money is in your bank account you have to think about runway more importantly is when can you raise money again and if you can't get your $10 million company to a point where it looks like it could be a hund00 million company before you run out of money then you end up having to do stupid like take a down round or sell or give up a bunch of your own equity or fire a bunch of people in order to make the runway go longer you end up in these rough positions specifically because you can't raise more and you're not profitable yet so obviously if you can hit profitability who cares but if you can't and as I said before most companies can't you end up in the position I showed before where you give up a huge chunk of your ownership to raise a tiny amount of money that you're going to burn through really fast because your company is chewing through cash and then you need to be bailed out often by an acquisition so what ends up happening here most of the time is if you had to take that down out of 800 mil then you burn through the 50 again no one's going to invest again that's not going to work out for you but you get an offer to sell the company for 500 mil well the company is only worth $500 million 100 mil has to go here 8050 280 million is already accounted for all these percentages are no longer valid you end up with 220 left this might still sound great like yeah you just made $220 million but you might have taken out a bunch of loans on the 570 mil theoretical or even worse the 770 mil theoretical and this piece here isn't just you as the owner this gets split across your employees and the equity they have this gets split across your co-founders if they came in as well gets split across a lot of other things the the term for this by the way is your value goes less and less and you have a smaller and smaller percentage even here you went from 90% to 82% the term for that is dilution your percentage becomes a smaller percent the number of shares is the same but the percentage of the company goes down and I I should have mentioned this before the reason is we have here 10 million shares of those 10 million shares I have 9 mil the investors technically get 1 mil here we probably have 10,800,000 shares i still have my 9 mil shares but those are worth more money now but they're a smaller percentage because there's more shares so the amount of stock the company has goes up but as the amount of stock goes up your stock doesn't go up that's dilution when you have 9 million shares of stock at 10 million shares you have 90% at 11 million shares you have less at 12 million shares you have even less so at this point all of those shares are being bought and those shares are being bought for 500 mil even though you priced them out as though they were worth a bill you end up with a whole lot less left over and the worst part is that realistically this isn't what's going to end up happening realistically speaking what ends up happening is you don't go for 500 mil you go for 300 mil or worse 200 mil now your money doesn't exist anymore and now these guys all have to fight it out often in court over who gets what based on things like the pro rata rules which are I get first dibs on money that is occurring in a liquidation event all these investors now have to fight over who gets their split of this 200 mil and you get jack you get nothing so if you ever raise more money than you possibly could be worth and you give up a high enough percentage that you then have to sell or you're ever in one of these positions where you're kind of cornered you just kind of get and it's very very easy alarmingly so to go from owning 70% of a billion dollar company to owning 0% of a $200 million company so for OpenAI to do all of this they have to have confidence in a few things they have to have confidence that they don't need any more money than what they just raised they need to have confidence that they can actually achieve their crazy ambitions of making AGI happen they have to believe they can hit the stock market and sell the stock at the valuation or higher than they raise his money at and most importantly the founders who make these decisions in this case Sam Alman needs to be okay with the fact that their value their stock their everything might go to zero i think that's the most important detail here actually Sam Alman doesn't have much equity in OpenAI i think he technically has none he might have gotten some as a grant when he rejoined OpenAI but prior to him leaving and coming back he had zero equity in OpenAI because it was still set up as a nonprofit which means he doesn't necessarily care if his own piece goes to zero he is just doing this for the hell of it in a lot of ways and I respect that but also yeah it's going to be an interesting one i think the unique combination of OpenAI wanting to intimidate enemies of Sam Alman not caring if his valuation personally goes to zero and investors being hungry to get in has allowed for something crazy like this to happen this is not the first time SoftBank has done something interesting softbank invested 16 billion total into Weiwork including a 9.5 billion bailout after a failed IPO but we work slowly collapsed and was worth absolutely nothing and it is currently understood that they have lost at least $13 billion in their investments into Weiwork soft Bank is weirdly willing to put giant amounts of money into these interesting potentially huge American companies and it's interesting to see where it'll all go oh apparently they have 4.9% of Nvidia as of 2017 that's not a bad thing to have it makes a lot of sense they have money to piss away so hopefully this helps you guys understand what the hell is going on here how all this fundraising stuff works why these companies operate these ways and why that $300 billion number doesn't really mean anything but also in the future could mean everything to the people who poured in on that 40 bill openai's way of managing their fundraising has always been fascinating and I know this was probably a chaotic explanation because I had to explain how these things traditionally work to then contrast them with it and explain where they are at yeah it's chaos it's interesting it's also probably over and I'm very excited to see longterm what the impact of this all ends up being i got nothing else i certainly don't got $40 billion so until next time peace nerds ## OpenAI might have just killed Claude - 20250416 i'm really not allowed on vacation am i i'm out here in miami trying to enjoy the react miami conference and obviously within an hour of me getting on the plane immediately openai announces that there will be another stream and in that stream they dropped some very fun things 03 and04 mini but this isn't just about those models they are interesting models the benchmarks are cool o4 mini is probably my new favorite model ever but we have a lot more to talk about than that because what this release represents is a huge fundamental attack on a certain company you guys are familiar with anthropic it is clear that openai does not like that anthropic is currently seen as the developer friendly company which is why they're doing a bunch of chaotic things here from creating their own open- source alternative to cloud code to potentially buying windsurf to focusing almost entirely on tool calls and code integration it's there's a lot here for developers in particular and i can't wait to dive into all of it i don't have the time to find a sponsor because i'm trying to enjoy this conference so i guess just here's a discount code for t3 chat only valid for people who haven't signed up before i think we'll do a free month and once those have gone i'll let 300 people do it maybe i'll put another code in the comments we'll we'll figure it out on the fly okay just we're flying by the seat of our pants with this one i this is a lot first and foremost we should talk about the models themselves as you guys can guess we already snuck them into t3 chat you got 04 mini here haven't put up 03 yet cuz it's expensive we might put it up as an api only thing if you want to bring in your own api keys we did that for 4.5 but 4.5 is about to die we'll figure it out just let me know if you really want to use 03 in t3 chat and we'll figure something out but for now we're assuming you don't been playing with it already with 04 mini it's been pretty good we'll do our favorite test solve of code 2021 day three in rust sure takes a sec to start responding it's reasoning and they still don't expose the reasoning data over the api which is sad i was actually thinking they would because there was a bunch of breaking api changes with this release things like passing temperature and tokens have different keys in the actual api which is weird they haven't changed these things in very long time and none of the changes are necessary so it seems like they were considering changing what the api gives i'm sad we still get reasoning data because it makes it feel slower than it should i want people to see that this is doing work immediately but at the very least here it spit out code it's working as expected the couple tests i ran it spits out code that is as good if not better than 03 mini and as you guys know 03 mini has been my favorite model for a while now so i am super hyped to have a bump on my favorite thing 03 still kind of feels like 01 in the the problems that i have with it where it's like super slow really verbose and probably good at solving super complex problems but i am still not using ai for like deep complex things even when i'm doing an advent of code challenge that's a little too far for what normally ai can do i'll break it down into small parts and have it double check my work but i'm not going to try and oneshot a complex problem with it and the the failures i had with o1 especially 01 pro were frustrating enough that i've not been using those models as much personally and then when i saw the price yeah it is kind of crazy that the three models you should use with openai right now are all brand new like a week ago the openai models i recommended are entirely different than the ones i recommend right now because it's these all just dropped and like these are the three i still think there are very few cases for something like 03 now that 04 mini exists i'm almost surprised they put out both at the same time because it it really shows that the smartest models aren't that much better than some of the cheap really smart models and o04 mini is still an insane insane value $110 per million input tokens $4.40 40 cents per million out i haven't updated my tracker site for keeping track of all the prices but it's the exact same as 03 mini so as just a quick reminder i'll uncheck these super expensive things to make this a little easier to process 03 mini is less than half the price of gemini 2.5 pro for output and roughly the same price for input it's also cheaper than 4.1 which is kind of crazy because it's a lot smarter than 4.1 and all of these things are cheaper than 40 40 is more and more confusing every day especially now that there's 04 404 naming is hard i sympathize with them but also self-inflicted it's exactly double the price of deepcar1 which is absolutely intentional anybody who says otherwise is lying 03 different ballgame $10 per million in $40 per million out for that we're gonna have to up some of these because the price is a lot closer to an 01 or a 4.5 it's a little cheaper than 01 which is nice it dropped the price like 25 to 50% across the board it's nice to see these changes i'm happy that openai is actually fighting the price war a bit more now it's been we see the difference and they're fighting a lot more than that war right now it's very clear i want to go into how they're positioning themselves but first we need to talk about the benchmarks i skipped through the live stream to find benchmarks because for once they didn't post any in the announcement which is weird there are some cool things in the announcement but no benchmarks so here's where we find them and from here you can see why i'm not that impressed with 03 here we see 03 with python only versus no tools for this math competition thing where it could write code to solve the problem with python it could get a 98 with 03 and it can score higher with 04 mini it's kind of crazy that they are putting these out at the same time but i really think they want to make sure people aren't going to overspend for the non- mini model if it isn't necessary for their work for the vast majority of tasks i would expect o4 mini to perform as well if not better than 03 but when you get to a certain level of depth on things 03 definitely probably at least makes a lot of sense if you know what those things are show me because i've yet to see much that 03 can do really well that something like 04 mini cannot and it's so nice that the mini models are continuing to be groundbreaking it's wild that for the last however many months since 03 mini came out that's been the best ai model and now 04 mini has taken that crown again just crazy that many models are that this good now here is the swe lancer which is a benchmark they made a while back for freelancing software dev tasks 03 high smokes it here this benchmark was weird when they put it out because it actually made them look really bad compared to claude now it isn't because 03 mini and 01 high were roughly the same range as claude 3.5 was now that they're double that it's that's very good look for them and 03 and 04 mini are both way higher on the sw bench which is a more common benchmark for how accurately can an ai model handle certain issues on github in the polygot code i'm not as familiar with this one the interesting thing that they were testing here is having the model spit out the whole code file when a change is made versus just a diff the models historically have not been great at diffing it's one of the things 4.1 did really well but here we see 04 mini is not performing that much better than 03 mini did and 03 seems to be a big gap there so the polyglot seems to indicate that there is a good gap with 03 i am confused why you would use 03 anything other than high though that seems not like something that would be worthwhile to me both are way better at math too historically openai models have not been great at math cool to see this change starting to happen they focused a lot on price though and this is something i really like i did a video a while back called the race to the bottom that was all focused on how much cheaper models are getting right after openai dropped their two most expensive models so it seemed like it was aging very poorly seems like they're flipping the other way they really want to focus on reducing cost per intelligence unit whatever you want to call it and the results are great like it's so much cheaper especially using the o4 mini model prices are insane i really want to talk about codeex which is their claude code killer but first we need to talk about the crazy thinking with images stuff that they shipped with this reasoning models normally just spit out text during reasoning this is the first time i've seen a reasoning model that thinks with images so it's a multimodal model that can do things other than just text and it will actually do those other things while it's reasoning it can even search during reasoning now which is nuts 03 and 04 many are trained to think for longer before answering and they use a long internal chain of thought before responding to the user they still don't expose that long internal chain of thought i get why they don't that said they are putting out an open model in the near future it will be a reasoning model and they're not going to hide this with the open weights they really they're excited about the open model thing from everything i've been hearing and somebody i saw somebody speculating that the open model was going to be 4.1 nano i don't think that's the case i think the open model is going to be something much closer to 03 mini 03 and 04 mini further extend the capability by thinking with images in their chain of thought which is achieved by transforming user uploaded images with tools allowing them to crop zoom in and rotate in addition to other simple image processing techniques more importantly these capabilities come natively without relying on separate specialized models remember that video i did talking about how the 40 image gen worked the second one i did talking about all that looks like i was spot on this is all about tools openai is more and more focused on tool improvements and getting ai to be better at using these tools that they're building be it image transformation search running and writing python code in order to solve math problems all these things that the ai now can do it's making it more useful not necessarily smarter in the traditional sense but at the same time if you give an ai chatbot access to python in a full python environment it's able to do math better because it can have the python code do the math so there's a lot of value to this stuff it's still crazy they're doing all the image stuff through tooling though i thought that's what they were doing and it's cool to see it more and more confirmed because their focus has been almost entirely on these tools and agentic workflows recently another cool thing that they talked about is that the tools are no longer tied to specific models where image gen used to only be a thing you could do in 40 some people notice you could do it with 4.5 they disabled it now you can again i was even playing with this earlier sadly the image gen tools still aren't public like for us to use via the api but i was able to pass my existential ai comic uh prompt over to 03 and it generated an image it used 03 to generate the text do all the normal chatbot things and then it called tools to do the rest and it worked it's pretty good not as good as some of the other ones that i put a lot more work into the other generations to be fair it's not bad i also have this cursed image i made a while back that i have not shared yet so uh yeah sorry i made you look at this what do we get out of this image reasoning though well let's see what they have to say chbt's enhanced visual intelligence helps you solve tougher problems by analyzing images more thoroughly accurately and reliably than ever before it can seamlessly combine advanced reasoning with tools like web search and image manipulation automatically zooming cropping flipping or enhancing your images to extract insights even from imperfect photos this isn't a thing people who have spent a lot of time in photoshop necessarily get but the amount of times i've like had a photo that had something in it i couldn't quite read or wanted more info on and i threw it in photoshop and transform the photo till i could actually get the info i wanted very real if you're trying to do ocr reading text off of something being able to transform it if it's rotated expand it dn noiseise it and then read the text will make it much more likely to get a clean read this is a very cool thing for them to include oh god i hadn't even thought of this for students the example they have here is uploading a photo of an economics problem set to receive step-by-step explanations or share a screenshot of a build error to quickly get a root cause analysis the the school thing is very real people are going to use this to cheat on their homework so bad i can't even imagine here's an example see how awful it is to read that text because it's just at a terrible angle here is where it's going to try and zoom in crop and transform it so it can read it here's where it flipped it and now i can see that it's 4th february very good example here is it being told to solve a problem terrible terrible photo analyze the image still thinking it through there it got close enough to actually see the diagram now it's starting to solve it crazy also they finally got latte rendering working properly it god i don't even want to talk about how hard it is to get latte and math rendering working in these chat apps it's obnoxious what's written on the sign oh god how's it going to get that one that's actually really cool good stuff oh that's kind of nuts the t being able to work in tandem with tools like python data analysis and image genen things to solve a maze so here is the a maze image with a transparent background passed in it gives it a white background loads it writes a python script to parse the image runs it on the image keeps reasoning to figure it out and then the python code is able to paint on the image it can save it output it and give you the answer that's actually nuts i hadn't seen this until now i i i am seeing what they're cooking this is crazy these benchmarks are all for multimodal testing so visual things and it's a huge jump from what they were seeing before yeah this is a big jump for parsing images i didn't really think there was that much more to do with images and i was wrong pretty nuts i'm happy they're calling out the excessively long reasoning chains bit here because i heard an example that they gave of 03 doing like 600 tool calls to figure something out these models are very willing to call a ton of tools to verify their work because they just want to be right but yeah that's going to be a real problem especially if these tools get more and more expensive i don't know if you guys have tried the cloud 3.7 thinking max mode in something like cursor i did not think a single simple prompt was going to cost me $8 but yeah these models in the tools that they use are more and more expensive i guess they were until now i god if i was anthropic i'd be scared just from all this but again this isn't even where the war starts the war starts here with codeex codex is a lightweight coding agent that runs in your terminal sound familiar codeex is a lot like claude code you might notice a difference in these repos though and it's not the star count as different as that is the difference here is that claude code isn't actually open source there's no code in here this is just a place to track issues there is a license the license is making it very clear this is a commercial project and there is no code here for you to touch it's just a place to give feedback not only is codeex by openai properly open source it's apache licensed yeah what i did not think i would see the day that openai is publishing apache licensed cli tools that in such a way that i can use them with any other model yeah they're literally committing as i'm filming this by the way they just shipped another commit other fun fact uh fu here the developer who helped lead a lot of the effort he's an old friend he was actually previously co-founder of a company indent that one of my good friends dan gillespie founded and i just saw him randomly in the video announcing this i was like "wait what?" yeah as you can see looking at it it's familiar it's a very prettyl looking ui for what is effectively a cli that makes diffs to your code i'm happy these tools are getting better and that there's now finally a good open source one i saw a couple people working on their own separate ones but one blessed by openai that is truly properly apache licensed like this is going to be a big deal i have a feeling i haven't tried it yet but i don't know how much i would get just quickly [ __ ] around with it in my hotel room i have a feeling this is quickly going to become a very very popular thing similar to claude code in the open source nature means a lot of very smart people will be contributing especially since it's in typescript especially since the ui is actually in react believe it or not after digging through that's not the right part here package json inkjs ink if you're not familiar is a react renderer for the terminal similar to how react native lets you render on ios or android or react 3 fiber lets you render in 3js and canvas inkjs lets you render in the terminal very cool stuff means that you can use all the react patterns you're used to that said i've seen a couple people move off of ink because it gets rough at scale just maintaining it well with the performance can be a real challenge the wrangler cli by cloudflare used to be using ink then they move to go then they move back to typescript but no more ink.js so it' be more performant and maintainable so yeah i've seen a lot of back and forth with this and i have a bad feeling if they have performance issues they're just going to leave js then realize they were wrong and go back to it so uh to the openai people watching this to fluid in particular don't move off js if you have problems talk to me we'll get you guys off ink if it isn't the right thing for what you're doing but if it does work great keep using it it's a really cool piece of technology so why are they doing this why would they put this out i'm going to share one more interesting piece of info before i drop my conspiracy theories openai is in talks to pay about $3 billion to acquire the ai coding startup windsurf hey uh openai you know that i'm a lot cheaper than $3 billion right and i can fix your website sorry had had a self plug anyways windsurf's a popular alternative to cursor that's starting to get some serious traction i noticed how involved they were in some of the recent announcements more so than i ever would have guessed they would be they were being like brought in to talk about the new model as part of the reveal seems like they are very close now why would they be doing this what's openai's mission i want to open a scaladra but i have to hold the mic so it's not going to be very fun if i do so i'm just going to explain what i'm thinking here my suspicion is that openai sees anthropics one remaining advantage which is developers like them and they decided they want to take that away usually when a company is liked by developers there's a bunch of different reasons like they ship a lot of open- source stuff they release products that are useful to developers the only reason i think developers like anthropic so much is because cloud has been a better than average model for code stuff and in particular it's been good at tool calls open has taken this as a challenge they saw the excitement around cloud code and decided to make something better by making it open source they saw the excitement around all the tool call stuff and they know that's a real advantage that anthropic has so they went all in on tools for the last three releases they've done with new models and obviously the ide wars are a thing that anthropic's been deep in for a bit now they work super closely with curs in order to get the latest models in with all the fancy new features openai won't have to compete there if they have their own ide all of these moves including the upcoming open source model they're going to do because anthropics never really released an open source model by the way all of this together it seems to be positioning openai to be loved by devs again ideally more so than anthropic all of this is an attempt to take the one advantage anthropic has which is the positive sentiment with devs both because of the tool calls and the quality of the output for code stuff and just smother it super quick it seems like they're spending their money right now to destroy the one real piece of competition they have and it's not like anthropics is good for science or math or all the other things that openai has historically been the winner in but developers prefer claude that might finally change here gemini 2.5 pro showed the cracks in the armor it showed that there are developers who are willing to move off and i think what openai is doing is trying to sneak in the same way and totally destroy the one advantage that enthropic has very curious to see how this goes in my opinion right now they've done a very good job openai is lowering prices which anthropic isn't doing 03 mini and now o4 mini are as good as pretty much everything anthropic has for less than a third the price it's actually hilarious how much cheaper it is they're putting out real open source tools to improve the quality of experience we have using openai models and theoretically other models as well they built the api that we're all copying and using like every single ai inference provider is just doing their own version of open ais and we're probably going to get a super powerful open source model in the near future too oh and the tool call stuff but that's catching up the rest of this isn't openai catching up to anthropic it's openai doing the things anthropic probably should have in order to maintain their sentiment with devs i am very hopeful this is the shift that makes anthropic start fighting for dev approval again because right now it feels like they're coasting on the fact that devs like them and they're not doing the things they should be like open source and lowering prices i am thankful that we have a competitive market where these companies are actually pushing each other to improve in these ways i am very very thankful openai is taking developers more seriously right now i honestly feel a bit pampered at the moment because they didn't put 4.1 in their app which meant a lot of people came to t3 chat to use it by the way 4.1 and o4 mini both in t3 chat and they're making the prices better too so our margins are not as bad as i thought they would have been it's as a person who is shipping building tools that consume both of these models and both of these apis personally i feel like openai is working more in my interest than anthropic is that can change at any moment but it's been a huge notable shift that i have felt meaningfully right now more than ever the only way i feel wrong by openai is they only do this stuff when i am traveling seriously the the running joke now is all we need if we want agi to happen is for me to take a one-mon vacation because the speed all this stuff comes out as soon as i try to take a break is hilarious speaking of which i'm going to go try and enjoy this conference i've been sitting in the hotel room since i got here in order to make this video shout out to my editor for pulling this all together and until next time peace nerds ## OpenAI spends $6.5 billion to hire one guy - 20250524 I don't know about you guys, but I miss the good old days of Apple when they would drop a new device and it truly felt magical. There's a little bit of the sparkle in some things, but it hasn't quite felt the same for a while. Many attribute this to Steve Jobs passing, but I attribute it to something a little different. I think the loss of Joanie IVive was a huge hit for Apple and there's a lot of people who agree, including Sam Alman, the CEO of OpenAI, who just posted a kind of weird video of him with Joanie, who if you don't know, which apparently uh a lot of my audience doesn't know who Joanie IV is, which is kind of wild to me. He was the lead of all things product and design at Apple. Famous for doing crazy things like carving the Apple Watch prototype out of wood. He just weird dude. He invented the app grid with the little squirles with the corners and all that. He like invented the way Apple did design which kind of brought us into this new post skumorphic world. He's undisputed one of the greatest like product designers in history. But he also has had a weird history since leaving Apple. from his weird design collective love from to his work at Humane building an AI pin nobody liked to his new consulting company IO that just got acquired for $6 billion by OpenAI despite not having any product. This is a weird one. I wasn't going to cover it but then I got more and more interesting details. Then Miyo leaked what the device would look like which by the way if you're curious probably going to look something like this based on the leaks. There's a lot to talk about here. Where this fits into OpenAI strategy, in particular, how it contrasts with something like the Windsurf purchase, what this means for the nonprofit status, what the hell is going on with Joanie Iive, there's a lot to talk about here. While you can't use any of what they're building for a while, do you know what you can use right now? Today's sponsor. Be right back. Today's sponsor is a product that I'll admit I was really skeptical about for almost 4 years. I only recently took the plunge and I'm so happy I did. That sponsor is Convex. I could tell you all about their fancy AI codegen stuff with Chef that they built because of me, but I'd rather just show you how cool it is to use. They really are the best backend for your AI apps and certainly the best backend for your React apps. Here's my actual T3 Chat dev environment. It's running locally on my machine, but this will behave exactly the same in the cloud. I have this thread that I made, T3 Chat homepage redesign. I'm going to open this in the Convex dashboard. Let's hop over to data. Let's hop over to threads and see the thread named E3 chat homepage. I'm gonna hop in here and change this to say something else. Something else. I just pressed enter to save it. I went back to my UI and it's already renamed. I must have done some crazy complex stuff for that to work, right? Nope. I literally just called the query the way you would with React Query and TRPC where you pass it API whatever you defined. Everything, and I mean everything, lives inside of the convex directory. So getting threads is super simple. I call context db query threads with index user ID and updated at so we can sort it order to sending take 200. Oh no, I need to get the pinned threads too. So I grab those separately. I ddup them and then I return them. No SQL necessary. It still runs super fast because it transactionalizes all of this. And then calling it on the client is just as easy. Here's how you do it. Threads from convex equals use session query because I want to use their session stuff. API.threads.get. It's so good. There's nothing special that I had to do in order to make this automatically update. That's all just part of the platform. The amount that Convex was able to simplify our code and actually make our app faster and less buggy is still kind of unreal to me. If you use the D3 chat beta, you know the difference. It's insane. And if you want to feel that difference yourself, you don't even need to add it to your app. Go try out Chef. You can generate a full stack app from scratch with everything from O to file upload to sync handled in literally just one prompt. Thank you for bullying me into trying you out, Convex. I'm so happy I did and all our T3 chat users are too. Don't wait like I did. Try them today at soyv.link/convex. Let's break down Joanie Ives history. The famous story with Iivev when he was at Apple is that he was in an elevator with Steve Jobs and Steve Jobs was just talking about some design thing and IV said something he thought was clever. So, at some point when the elevator stopped and it was Jony's floor, he started getting off the elevator and Steve said, "No, you're staying with me." And brought him to some crazy exec meeting as a random designer at the company. And he very quickly took over all of design and product at Apple. He's also the calm voice you probably remember hearing in the Apple ads for everything with the white background and the calm, slightly British voice talking about how cool the metal was on the device. That was Joanie, legend. He kind of invented the modern world of Apple. But after like what three decades probably of working there, he decided it was time to leave and he started a new company, Love From. Love from was a consulting firm that's focusing businesses build really good designs and he even committed to continuing work with Apple through the Love From brand, which he then proceeded to not do. As far as I know, IV has had zero impact on Apple since he left. Yeah, hard to know, but as far as I could guess, that is definitely the case. Since then, he helped a lot at what was his role at Humane. Humane wasn't IV. Humane was another exapp. My bad on that, but I am sure I've paid close attention because it was another person from Apple. If you don't remember, Humane made the stupid AI pin, spent an absurd amount of money. Like Humane raised $230 million to make a pin that sucked in their series C stage and they ended up selling to HP. Not necessarily the company you want to work at or be acquired by, especially because the acquisition was 116 million which meant that the people who invested got back at best half the money they had invested and the founders got zero. So Humane was a failure as seems to be the Rabbit R1. The rabbit was an interesting device because they paid a design firm to do it too. Teenage Engineering, who is somewhat well regarded despite being kind of weird and doing things I don't love with creators, including like DMCA and creators for using their footage in reviews of their products. Their teenage engineering I have weird vibes with, but they're generally well regarded in the art and music worlds, which is why it was strange seeing them partner with an early stage AI device like R1 that got roasted hard cuz it sucked. As MKBHD put it, it's barely reviewable. I'm pretty sure they announced that they're like hard shutting it down. Not positive, but relatively sure. It's been over a year and no one's touched it since. So, those AI assistant hardware devices have just kind of been failing. I was interviewed by Bloomberg recently about this and said that he considered those other things to be very poor products, which honestly is true. They're just not good. But rather than see that as a failure in the market, it seems like he's taking the opportunity to make something better. And that's what they were building at his new company, IO, which was focused on doing something with modern IO, input, output, a new way of thinking about compute and hardware. IV can actually do this, but I don't know if this is the right path. The idea of an AI like dedicated device still feels strange. In some ways, this is similar to the Blackberry thing where there was a lot of people with Blackberries, but it was still like less than 1 in400 phone users at the time. The iPhone was betting not only that they could kill BlackBerry, but they could make the market itself comically bigger if the phone that was smart was accessible enough and useful enough to the average person. And that bet paid off in spades. It felt so different using a BlackBerry versus an iPhone at the time because one was built for everyone and one was built to have a huge feature list that you could show off in advertising. And guess which one the iPhone was? The last time I felt this with Apple was actually the Vision Pro. I know it gets crap. I understand, but I've been a VR dieard for a very long time. I own way too many headsets. The Vision Pro made all of my other headsets feel like Blackberries. The improvement in user experience is it's impossible to put into words how big the gap is. It felt like VR that my mom would be able to use. And it had so many little magical interactions. Like I remember the first time I opened up a bunch of windows in it when I was sitting on the couch and I got up to go get a drink. And when I got up, the windows just stayed there. They didn't follow my vision as I looked around. They just stayed exactly where I put them. And when I was walking back to the living room from my kitchen, I saw the three screens over the table right where I left them. Incredible user experience. Not just like the hardware engineering to be able to position things in the real world correctly like that. Shut up, Siri. And speaking of which, Siri going off my watch randomly. The the quality control at Apple's in a wild spot right now, and it's not great. The point being, I was so impressed with what the Vision Pro's UX did that I'm bringing it up here for a weird reason. If the Vision Pro wasn't enough to make VR successful, I don't know if it's a quality gap. Even I don't find myself using it that often, even though I love the thing. It turns out that VR itself might be a bad product category. It could have turned out that smartphones were similar, where most people just want their phone to have a simple keypad and the ability to text. That wasn't the case. We thought it was and it wasn't and now everyone has a smartphone. VR seemed similar where if we had easier to use, higher quality VR experiences, more people will jump on it. Did not happen. I really thought it would. And now the only hope, and my editor's even calling it out, is that augmented reality and virtual reality will do better in a smaller form factor. I don't think that's the case. I think we have now exhausted the limits of what should prove the success of VR and AR and the investment in to the return out like ratio is just not there. Meta has lost so much money on Quest it is unfathomable and software published for Quest just cannot make its investment back. It's the only reason there's anything to do on Quest is because Meta pissed so much money into it. And the Meta Ray-B bands in particular don't do much augmented reality stuff at all. They don't have a display. They don't augment your reality. They just talk to you about stuff sometimes. I know that we're not close to the peak of what mixed reality could be. I don't think it matters. That's the point I'm trying to make. Apple raised the bar so much. We went from 2 out of 10 to like, I don't know, 7 out of 10. And the adoption didn't go up meaningfully. That's the thing I'm concerned about. And this is the the hard test. Like before Apple made the iPad, tablets existed and people used them, but not really. The iPad almost immediately started to kill all of the netbook market and start encroaching on the general computer market within like three years of its first release. Vision Pro has had nothing resembling that splash whatsoever. There's nothing really worth disrupting on the VR side and it's struggling to disrupt anywhere else. It's good enough that if the market was good, it would be doing better. And that's why I find IO and what IV is doing here to be interesting. We do not know if dedicated AI devices are a real market yet. The only way you can know for sure is if you make something really good and it flops. So now we have an interesting question. How much money is it worth to get an answer to that question? How much money would a business like OpenAI be willing to spend to know whether or not hardware focused on AI interactions is a worthwhile expenditure or worthwhile industry? Is this a thing consumers are going to want or is this a thing consumers are going to be annoyed by, make fun of, make funny YouTube videos about, and then move on? Because that's kind of what's happening in VR right now. We don't know yet. But it would really suck if we made something that was just slightly not good enough. So, it can't go over that threshold. It would have really sucked if Apple was just slightly off on their investment on the iPhone and they made it too cheap by using a bad screen and then nobody liked it as a result and it never caught on. It's important to invest enough to make sure that first attempt that the company makes is good enough to get over the threshold. That doesn't guarantee it will be successful, but it guarantees that you get an answer. That's what I think OpenAI is doing here. They are spending an egregious amount of money, $6.5 billion on a company that's founder only had like I think it was 500 mil was his understood valuation and like worth at the time. just 12xed his net worth in order to see if the best of the best is enough to make one of these devices successful. And if it is, you now have the benefit of being the one with that device. And if it isn't, you spent $6 billion on an important lesson. That's a lot of money for the lesson, but that's the reason that I think this is happening. I also admittedly think a little bit of this is Sam trying to cosplay as Steve Jobs. Like, come on. Come on. This is an extraordinary moment. Computers are now seeing, thinking, and understanding. Despite this unprecedented capability, our experience remains shaped by traditional products and interfaces. Two years ago, Joanie IV and the creative collective love from quietly began collaborating with Sam Alman and the team at OpenAI. Collaboration built upon friendship, curiosity, and shared values quickly grew in ambition. Tenative ideas and explorations evolved into tangible designs. The ideas seemed important and useful. They were optimistic and hopeful. They were inspiring. They made everyone smile. They reminded us of a time when we celebrated human achievement, grateful for new tools that helped us learn, explore, and create. Yeah, this is them cosplaying as Steve Jobs and Apple to an extent. And I I want to be clear about that. You have to remember that OpenAI was started as a nonprofit research company looking into what AGI could possibly be. But at the same time, I do believe Sam Alman has formed a genuine friendship with IV. Any attempt for executives at a multiundred billion dollar company doing a multi-billion dollar deal will feel cringe. And they did not do enough to reduce the cringe. I'm not going to pretend otherwise. But I did get a sense that they have a real friendship and that will lead to making irrational decisions. Just imagine now that you're Sam Alman. You went on this crazy journey to research AI and now just 10 years later, 3 years after your big break with chat GPT, you have a $400 billion valuation. You just raised what was it like $36 billion. No, it's the numbers are backwards. It's a $300 billion valuation. He just raised $40 billion. These are numbers you could not have fathomed this all being worth. And there's one other note. Sam has zero. But Sam does control the business. He has nothing here. He wants to figure out if this hardware thing is worth it. He wants to make sure if they do this that they can get a definitive answer of yes or no. And if the answer is yes, that they win. He has no equity, but he has full control over all of this. He wants to know for a fact what AI's role in the world is. this company exists to figure that out. He also likes to support his friends and work with his friends, these people that he cares about. And most importantly, he wants to build real products. Even though OpenAI was originally founded to do research, and it did a really good job at that, ChatGBT was kind of this transition into OpenAI now being a product company where they're hiring as many engineers to build the mobile app, the website, all the crazy things they're doing with codecs. All of that is product, not research. There are research parts of it, but it's separate from product. Is this question of the success of AI product worth 2% of OpenAI? This is what Sam asked himself knowing that more and more OpenAI's product and userfacing experiences are important if hardware ends up being the next frontier. How do we win? And how do we know if it is going to be? Is that worth 2% of OpenAI's current value? That's a tough question. And it seems like Sam Alman when he considered all of the biases, all of the options, all of the things going on, and also that wind surf was worth around 1%. In comparison, this is a company that has built something developers are actually using that has good penetration in the enterprise world. Their valuation is around 3 billion. Spending more than double spending more than double on a company with no product and no users is terrifying. But they also said they've been collabing for a while. They see the potential. And if the thing we talked about before is true, that IV and Sam are friends, remember that Sam owns 0% of OpenAI, that is a pretty bad thing as they move out of the nonprofit because the nonprofit still has majority control over the company. They still own the majority of it. As percentages get taken out and given to people like Iive, that 2% is no longer part of the nonprofit. That's 2% of the company now in control of somebody that Sam is friends with. That part makes it make even more sense. If Sam's trying to build a team of executives that can make good decisions for OpenAI, as far as he is concerned, having his friends come in that have lots of experience in the industry to run more and more of the business helps a lot. And when I read this on an HN comment, I don't feel like finding it started to click for me how Sam is really trying to play chess here. So when you recognize that existing products are so bad that they haven't really taught us anything, that the structure of ownership at OpenAI is weird, that Sam's desire to build product is real, it's super real, and that Iv and Sam are friends, all of this starts to make a lot more sense. So let's take a look at the leak. What are they actually building? This leak comes from Minci Quo, who's one of the most legendary leakers in the history of Apple leaks and news. Very trustworthy source. Mass production of this new device is expected to start in 2027. Assembly and shipping will occur outside of China due to the tariffs and all of that chaos. It'll be in Vietnam. The current prototype is slightly larger than the AI pen with a form factor as compact and elegant as an iPod Shuffle. That can say a lot of different things. There's a lot of different iPod shuffles. The design and specifications may change before mass production. One of the intended use cases is wearing it around the neck. It will have cameras and microphones for environmental detection with no display functionality. So, it will not have a display. It is expected to connect to smartphones and PCs utilizing their computing and display capabilities instead. In my view, one of OpenAI's motives for announcing its collaboration with IV right now is to shift market focus from the recent Google IO. Google's ecosystem and AI integration showcased in the IO keynotes pose a challenge that OpenAI currently struggles to address. The challenge being Google has vertical integration between product inference, model generation, APIs for people to access and actual hardware design both on like the Android in Pixel side where they can make their own glasses, make their own platforms, make their own OS, but also on the TPU side where the chips doing the inference are owned by Google. Google's vertical integration here from the thing that the user wears on their face to the CPU that's actually running the inference is insane. Google is very very very well positioned right now. Open AAI is less. So they need to win the vertical integration if they want to keep competing in the current market. This was obviously a play to do that not necessarily to compete directly with Google but to have more product under their umbrella. And announcing it now also makes a lot of sense if they want to really compete with Google. AI integrated into real world applications often termed physical AI is widely recognized as the next critical trend. I'm not necessarily sure about this one. I would like to see where it goes. I think that's why this investment is happening, but we can't know for a while. This partnership also recalls Alan K's well-known adage, people who are really serious about software should make their own hardware. I don't know, man. I'm pretty serious about software, yet here I am. Really though, makes a lot of sense. And while this leak looks really Apple, and I would be surprised if they went with such a blatantly Apple adjacent design, it does show that OpenAI is taking product almost too seriously. To spend that much money on effectively a pile of talent, not even on a product, is nuts. But OpenAI's always been a kind of nutty bet. So, for better or worse, I think I see why Sam did this. It's a chaotic move to answer a chaotic question. Will dedicated AI devices be a real market? And if so, can OpenAI win it? I'm excited to see where this goes, but I have no idea how useful these things will be. I'm curious what you guys think, though. Is this all going to blow over and be forgotten, or are AI pins and AI devices the future of how we interface with the world? I have literally no idea where any of this is going, and I doubt they do either, but we all want to figure it out, right? Let me know what you think. Until next time, peace nerds. ## OpenAI vs Elon Breaking Down The Details - 20240307 Elon is suing open Ai and the chaos that has ensued since has been genuinely hilarious from telling them on Twitter to change their name to closed Ai and he'll drop the suit to a very fun Sam reply to an ancient tweet where Sam was defending Tesla Elon thanked him and he replied there is some petty crap going on between these guys and I wanted to do my best to cover it and give my thoughts usually open a eyes blog posts are pretty informative on that so let's take the opportunity to read it open Ai and Elon Musk we are dedicated to the open AI Mission and pursued it every step of the way if you're not familiar with the drama here the issue is that open AI has in elon's eyes gotten too big especially for being a closed Source company the original goal of open AI was to make Fair free and open AI tools and technologies that weren't owned by big companies like Google and Microsoft so anyone could use them and AI wouldn't be in the power of the few that's why elen funded it that's why the charity happened obviously the direction of open AI has changed significantly since Elon didn't fully agree with it and has decided to sue as a result this article's interesting cuz they went back to citing specific authors and they cited all of them IIA is back for this Greg's been helping with this and Sam himself is cited too this is going to be a fun ride I haven't actually read this yet so let's dive straight in the mission of open AI is to ensure AGI benefits all of humanity which means both building safe and beneficial AGI and helping create broadly distributed benefits we are now sharing what we've learned about achieving our mission and some facts about a relationship with Elon we intend to move to dismiss all of elon's claims we realize building AGI will require far more resources than we'd initially imagined it's an important piece Elon said we should announce an initial $1 billion funding commitment to open AI in total the non-profit has raised less than 45 million from Elon and more than 90 million from other donors when we started open AI in late 2015 Greg and Sam had initially planned to raise $1 million Elon replied in an email saying we need to go with a much bigger number than 100 million to avoid sounding hopeless I think we should say that we're starting with $1 billion funding commitment I will cover whatever anyone else doesn't provide that's a big statement we spent a lot of time trying to Envision a plausible path to AGI in early 2017 we came to the realization that building AGI would require vast quantities of compute we began calculating how much compute an AGI might plausibly require we understood we were going to need a lot more Capital to succeed at our mission billions of dollars per year which was far more than any of us especially Elon thought we'd be able to raise as a nonprofit this is particularly important a nonprofit will struggle a lot to raise money a huge part of why the company shifted to a profitable model is so they could raise more money investors aren't going to just row billions of dollars at something with no chance of a return which is why they introduced the model where they would give up to a 10x return on investment they cap the potential return a company could make from the investment but with a likelyhood of that return happening many companies were fighting to be part of the round especially once their Tech got to a pretty good point that's why Microsoft's poured in as much as they have they're not expecting to 1,000x their money like you would from a traditional startup investment but they have a pretty decent confidence they'll for to 10 exit and they'll have a really important business partner going forward for their goals of creating really good AI to be a achievable an absurd amount of money and absurd amount of compute was needed and it makes sense they went the route they did given that so thus far I like the framing open I has we and Elon recognized a for-profit entity would be necessary to acquire those resources as we discussed a for-profit structure in order to further the mission Elon wanted us to merge with Tesla or he wanted full control Elon left open AI saying there needed to be a relevant competitor to Google and deep mind and that he was going to do it himself he said he'd be supportive of us finding our own path in late 2017 we and Elon decided the next step for the mission was to create a for-profit entity Elon wanted majority Equity initial board control and to be CEO in the middle of these discussions he withheld funding Reed Hoffman bridged the Gap to cover salaries and operations if the withholding of funding was enough that people weren't getting paid that's terrifying they were relying a lot on his funds we couldn't agree to terms on a for-profit with Elon because we felt it was against the mission for any individual to have absolute control over open AI I will say the alternative had its own consequences that we saw near the end of last year that kept me up for like a week straight covering it he then suggested instead merging open a into Tesla in early February 2018 Elon forwarded us an email suggesting that open AI should quote attach to Tesla as its Cash Cow commenting that it was exactly right Tesla is the only path that could even hope to hold a candle to Google even then the probability of being a counterweight to Google is small it just isn't zero sh El all you want he's really good at framing I like this framing a lot right now the chance of open AI succeeding is zero but if you're attached to something like Tesla the chance stops being zero I'm not saying joining Tesla means you're guaranteed success but at least you're not guaranteed to fail salmon found other paths but this is a strong framing on elon's part Elon soon chose to leave open AI saying that our probability of success was zero and that he planned to build an AGI competitor within Tesla when he left in late February of 2018 he told our team he was supportive of us finding our own path to raise billions of dollars in December of 2018 Elan sent us an email saying even raising several hundred million won't be enough this needs to be billions per year immediately or forget it and again a big bold important quote from Elon we Advanced our mission by building widely available beneficial tools we're making our technology broadly used us able in ways that Empower people and improve their daily lives including via open source contributions we provide broad access to today's most powerful AI including a free version that hundreds of millions of people use every single day for example Albania is using open AI tools to accelerate its EU accession by as much as 5 and a half years digital green is helping boost Farmers incomes in Kenya and India by drop you don't need to convince people are using AI for good it it's not open source Elon understood the mission did not imply open sourcing AGI as Ilia told Elon as we get closer to to building AI it will make sense to start being less open the open in open AI means that everyone should benefit from the fruits of AI after it's built but it's totally okay to not share the science to which Elon replied yep the open and open AI means that everyone should benefit yada yada and Elon replied literally just yep that's pretty damning we're sad has come to this with someone who we've deeply admired someone who's inspired us to aim higher then told us we would fail started a competitor and then sued us when we started making meaningful progress towards open ai's Mission without him we are focused on advancing our mission and have a long way to go we continue continue to make our tools better and better we are excited to deploy these systems so they Empower every individual this is from Elon to Greg cing Sam blog sounds good assuming all adjustments for neutrality versus being YC Centric I favor positioning the blog to appeal a bit more to the general public there's a lot of value to having the public root for us to succeed and then having a larger more detailed and inside baseball version for recruiting with a link to it at the end of the general public version we need to go with a much bigger number than 100 million Yep this is real I'll cover whatever anyone else doesn't provide template seems fine apart from shifting to a vesting cash bonus as default which can optionally be turned into YC or potentially SpaceX stock so if you're somehow not familiar with YC combinator YC combinator is the site that Hacker News is hosted on but it's also the place for early stage startups to get started I'm a y combinator founder this is how we started ping how we're building upload thing they're an incredible group that funds companies and helps them learn to expand and go Venture scale but they also have a charity program specify a nonprofit program we work with a small number of nonprofit startups in every YC batch usually between two to four companies we started working with nonprofits in 2013 and have worked with more than 30 companies so far here's a list of the nonprofits that have gone through YC this is a bunch of nonprofit companies that have been through YC open AI was kind of a bet in this direction it wasn't a traditional nonprofit going through the batch but almost all the people who were part of the original starting of open AI especially Sam have deep why combinator ties Sam still speaks at y combinator events and he used to be a group partner and very very deeply involved Not only was Sam involved with YC he was actually briefly the president in February of 2014 eventually started getting more and more involved with the open AI stuff until eventually becoming the CEO of it but the ties between Y combinator and open AI have been strong for a long time but if it was just another YC company it wouldn't have the chance to go as big as it has which is why they wanted to make sure with all the marketing that it wasn't just going to be seen as YC surprised they're hiding a name here I'm very curious blank is exactly right we may wish it otherwise but in my and blank's opinion Tesla is the only path that could even hope to hold the candle to Google this is Elon so they're censoring someone else that they're talking with here for example whole blackedout sample interesting in addition to Deep Mind Google also has Google brain research and cloud in tensor flow tpus and they own about a third of all research this is particularly funny when you realize in retrospect admittedly 6 years later how bad Google is at AI but is good information it's interesting to see how scared they were of Google I also strongly suspect that compute horsepower will be necessary and possibly even sufficient to reach AGI if historical Trends are any indication progress in AI is primarily driven by systems compute data and infrastructure and Nvidia stock the core algorithms we use today have remained largely unchanged from the '90s not only that but any algorithmic advances published in a paper somewhere can be almost immediately reimplemented and Incorporated conversely algorithmic advances alone are inert without the scale to also make them scary Fair it seems to me that open AI today is burning cash and that the funding model cannot reach the scale to seriously compete with Google which is an 800 billion company you can't seriously compete but continue to do research in the open you might in fact be making things worse and helping them out for free because any advances are fairly easy for them to copy and immediately incorporate at scale interesting that this is from Elon specifically saying that they shouldn't open source and do too much of their work out in the open because if they do that'll help the people that he's concerned about getting too good at AI stuff and it seems like his biggest concern with the for-profit is that building out a product from scratch would steal Focus From the AI research yet they're still super far ahead it would take a long time and it's unclear if a company could catch up to Google scale and the investors might exert too much pressure in the wrong directions are they doing this though it seems like they're still focused on the goal of AGI the most promising option I can think of as I mentioned earlier would be for open a here's where he's pushing for the merger important Direction I was wrong this is from a censored individual so I don't actually know who wrote this but at the very least although El didn't write it he did say that they are exactly right so it's possible he didn't agree with the details of this but this this is a damning email this is very clear seeming alignment between open AI Elon and their mission unfortunately Humanity's future is in the hands of blank I wonder if this is the same blank another little sentence here and they're doing a lot more than this I really hope I'm wrong Elon wish we could see behind this censored text it's so important as long as the name of all these people is the same I wish they could at least say that much again from the censored individual I've seen you and Sam and other open AI people doing a lot of interviews recently extoling the virtues of Open Source AI but I presume you realize this is not some sort of Panacea that will somehow magically solve safety there are many good arguments as to why this approach you're taking is actually very dangerous and in fact may increase the risk to the world some of the more obvious points are well articulated in this blog post that I'm sure you've seen that's this post should AI be open really interesting angle of maybe open source AI is not good this is an email that's being forwarded from Elon to Sam Ilia and Greg as though he agrees with it some amount Ilia replied this article is concerned with a hard takeoff scenario if a hard takeoff occurs and a safe AI is harder to build than an unsafe one and by open sourcing everything we make it easy for someone unscrupulous with access to overwhelming amounts of Hardware to build an unsafe AI which will experience a hard takeoff we get closer to building AI it'll make sense to start being less open and again Elon agrees there is so much juice here ah that was a ride I hope that was a good overview cuz this is a chaotic and developing situation if more happens you can bet your butt I'll be reporting on it so make sure you subscribed because I put way too much time into covering these types of breaking news things that's all I got until next time peace nards ## OpenAI’s new API is 200x more expensive than competition - 20250321 as a person who covers a lot of things in technology it's important for me to recognize when I'm wrong and I make mistakes i found myself in this position a bit more recently because of the craziness in the AI world openai has become incredibly capable of proving me wrong about things i talked earlier about how we'd kind of hit a wall with the capabilities of AI models and we blew through it really fast with 01 and eventually 03 and 03 Mini i also just recently made a video about how we're racing to the bottom the price for AI generation models inference and all of this it's been going down i made a business kind of betting on this where I made a cheaper AI app focused on really good fast experiences with a lot of models and once again OpenAI has proven me wrong 01 Pros API just went live and it's $150 per million input tokens and 600 out that is hundreds if not thousands of times more expensive than other options and I have a whole lot to say about it but if I'm going to even consider trying this for content someone has to pay the bill and I'm not going to make you guys do it so we'll have a quick word from today's sponsor before we dive in to why this model is so expensive deploying servers is super easy and fun until it's not what happens when you want to have pull requests automatically create preview builds or you want to put a CDN in front for your static assets or you want to put a DOS wall in front of everything because you're getting spammed or getting way too many users even tasks like adding a database are harder than they should be unless you're using today's sponsor Savala these guys made it so easy to deploy that even I can spin up a Rails app with them and I am really bad at Rails it's honestly pretty easy to pitch these guys because look you can see everything the product is doing and it's not fun to set it up yourself but if you use them it is i have a GitHub repo automatically linked whenever I push something to Main it gets deployed instantaneously and we have infra provisioned here across different providers which if I were to do multi-provider provisioning not fun we have a real server running with a real CPU and RAM sitting there with the domain assigned to it we also have Cloudflare in front with DOS protection if I wanted to spin up the CDN to store some assets I can do that all too just click settings no need to set up Cloudflare yourself it's all just built in where this gets way cooler is when you realize this is part of a pipeline so I have automatic preview builds whenever a poll request is filed and I can hit one button to create a preview out from it here or set it up to happen automatically i can also change which deployment is pointing where the same way you can on serverless providers but without the serverless part this works with any tech stack dedicated servers included which is so nice they also handle the other persistent things that you might need like object storage databases and more and it's not like they're particularly expensive either i have this real server running and we've so far cost ourselves 92 in the current billing period and if you want to see how good it is for yourself you get $50 of credit for free if you sign up now check them out today at soyv.link/savala i've been maintaining this CSV just logging the different prices of things for these different models to give context also if you don't yet know what a token is it is the pieces like the chunks that are used to process data in AI models so when you stream down a message from OpenAI one of these APIs any of these things your message gets split up into these chunks these four to eight character tokens and those tokens are used to determine what the most likely next token is for the most part the easiest way to understand how LLM work is that they're effectively really really good autocomplete where based on the text before it is going through the weights of what tokens lead to the next tokens most effectively and predicting based on the thing you just sent it what the most likely next word is over and over again until an answer comes out at the end so tokens are how we measure the cost for a lot of these models because more tokens means more work being done on the GPU means more work to go through this giant model of data and matching things up to generate the right response problem here is certain models are much much cheaper than others i've already done a few videos about claude here and how it almost bankrupt us when we added it to D3 chat 3.5 and 3.7 cost the same 3.7 or 3.7 thinking is the same pricing but it does generate more tokens because when the model reasons which means it's thinking and generating more before sending you the response those extra tokens get created and do cost money to generate on the infra side so you are paying for way more output tokens when you turn on the thinking and reasoning for the models that support it you might not get all those tokens in the case of something like 01 or 03 openai doesn't show you the thinking tokens they just show you the result but they do exist and you are build on them so as reasoning becomes more and more common the cost on the left gets larger even if the number isn't bigger the number of tokens is thankfully we've been racing down this chart for a while now drops like Gemini 2.0 Flash shook the very ground we stand on because the quality of the model is comparable to something like 40 which is significantly more expensive more than 20x the price which is kind of insane because the quality of the responses is very similar between those two and Gemini is also way faster which is super nice the reason Google could get Gemini so cheap is they're very profitable company doing a lot of things which helps but they also built their own processors and architecture in order to make it more efficient for them to run which puts them in a really good position because they have the data they need to train the scientists they need to do that training the API and infra that they need to host it all and the chip design and architecture to do it efficiently there's no other company that has all of that covered and Google's able to drive the price really low but at the same time outside forces like DeepSeek could come in when V3 dropped which isn't their reasoning model is that R1 the one that blew everything up but it was the one that got me excited when V3 dropped its original pricing was very close to Gemini's pricing but it was also 6 monthsish earlier and the quality of this model was comparable to Vad 3.5 for a lot of code stuff and I was having a ton of fun with it i largely built T3 chat because DeepS v3 was so fun and I hated the UI for it even more than the UI I already hated between Claude and ChatGpt that said they planned on increasing the price they kept it here when they dropped it cuz that was the V2 price but they bumped it up quite a bit roughly 2xing input cost and roughly 3xing output costs closer to 4x actually damn but at the same time they then dropped R1 which was an incredibly powerful model one of the first open models that did reasoning well and hit crazy numbers on benchmarks and was relatively cheap to run too all of this resulted in a very obvious trend of these models getting cheaper and cheaper i even went as far as saying that Claude needs to ship a cheaper solution sooner they're going to get chewed out and I was very wrong on that 3.7 is just as expensive they are getting chewed out though just not for the cost more for the fact that 3.7 tries to do more than it should it ends up as a result making worse answers for code stuff and also generating more output tokens than it probably should the number of tokens being generated when I bump from 3.5 to 3.7 went up a ton and the quality of the responses if anything for me at least went slightly down it is what it is but right after I posted the video actually I think it happened the day before the video was posted but a week after I recorded it Cash GBT 4.5 dropped this model is massive doesn't have reasoning or any of the other cool features is it doesn't score great on benchmarks for code and stuff like that it's actually been very hard for them to measure 4.5 but it has significantly more data in its training and it has significantly more parameters in its model which means that going from one token to the next is way harder for it because it has to go through way more data to figure out what's next the claim is that the result is much more human and much more pleasant to talk to because it has way more reference of how humans communicate and it does feel a decent bit better i'll be honest not 7 to 20x better but it is better and people will look at this price and be like "Oh yeah they're charging that cuz they want to make a whole bunch of money off it obviously the margins there must be nuts." They're not the margins for a lot of these things being provided especially by OpenAI aren't great when they put 01 Pro on that new $200 month tier for ChatGpt like the website they lost money on those the average pro subscriber cost them money because they would use 01 Pro so heavily that it would run a shitload of info and cost them a ton that's why the price is as high as it is here because 01 Pro is a very expensive model to run it can solve problems that almost nothing else of used can solve they're very difficult esoteric programming challenges like weird one-offs in Advent of Code but it's also a shitty model to use for weird ergonomic reasons i think they might have fixed this bug but I'll I'll test it i have an account we make a new message here 01 pro mode solve this advent of code problem use typescript input lives in input.txt so I handed it the problem going to take its goddamn time to solve it watch what happens i This might not be a bug anymore first off it doesn't generate the title yet which is obnoxious we generate the title while also generating the rest in parallel it's stupid that it doesn't we'll go ask the same thing to go back here there a way I can copy this right now there isn't that is hilarious i have no way to copy the thing I just sent other than that also selects a bunch of random UI elements so all that is going for as well both are new chat which is annoying no good way of knowing which one is which and it just took away my sidebar very annoying oh it appears it's not that problem anymore that's good previously if you started another chat while you had 01 Pro going it would cause the 01 Pro request to fail we got a little notification the other one's done nice the answer's wrong i know that for a fact cuz no LLMs could solve this problem also what the happened here theo you overreact chat GBT's UI isn't that bad see if I refresh it though oh it it popped in as I was refreshing that's hilarious actually but is this one still going something went wrong finished reasoning 01 Pro is a bad experience the this is $200 a month not a nothing failure and now I have to go rerun it and be that much closer to hitting my rate limit there all for 200 bucks a month and I have to leave this tab open by the way this is even better on mobile if you ask 01 Pro a question on mobile and you switch apps and go back 50 plus% chance the request just failed it's insane you have to not refresh if you're on the web you have to be careful switching tabs if you're on the web you can't do it on mobile unless you leave it open while it's going it's such a bad experience it's actually unbelievable the query didn't even fail they just had no way of getting it to the UI i'll admit we have this problem too if you refresh while generation is happening it fails and it keeps me up at night and I am working with a lot of different places a lot of different companies and products and open source stuff to find a lasting solution to the losing connection mid-generation problem i'm also not charging 200 bucks a month yeah Grock is the only service that handles the resumability well right now if you refresh mid generation Grock does it well nothing else does durable objects could theoretically actually be a solution for this if implemented properly but implementing durable objects properly is a difficult enough task that somebody quit Cloudflare to go do it and did it no one understood it still and Cloudflare just acquired him to try and bring it in there instead the only people I know actually getting durable objects working are either Cloudflare employees or excloudflare employees that end up back at Cloudflare so it is what it is oh look it actually answered took two minutes i I promise you guys this answer doesn't work if you really want me to go run it if your input matches the exact example list you can hardcode the length map and solve it by just multiplying these numbers even for the example this is wrong this is embarrassing yeah yeah 03 mini high is a much much better experience but do you know what else is D3 chat if I hop back here uh where's the edit button isn't there supposed to be an edit button the not rendering because of something why do I have no not for the first button in chat you can only edit follow-ups what but Theo T3 Chat's just a crappy rapper open AI's website's totally fine why do you think anyone can I can't use it it doesn't work it's so bad i like this isn't meant to be a video where I roast the ChatgBT UI but when I try it to demo something I still just get angry that it's this level of quality or lack of i I can't even select the text cuz the scroll bar is in the way i I'm not making this up i just want to copy this message and paste it on a better service maybe this is an attempt at locking me in but all it's doing is pissing me off i can't do it let's give it a re a shot here 03 mini it's already on high cool see how it does the one thing we don't get is we don't get the reasoning information over the API so if I did this on the chatbt site I could see what it claims it is doing each step but it's the exact same model and the end speed is exactly the same on T3 chat as well i know because I tested it recently it can't get this problem right but at least we'll get an answer in a reasonable amount of time theoretically and no I don't have a copy button i'm here there is no copy button anywhere nothing maybe some old ones will have it nope there's an edit button no copy button though meanwhile copy yeah 03 Mini is trying really hard to solve this one right now while we wait I want to go check out artificial analysis they still have 01 Pro on the site and it's going to break all the pricing charts which will be really funny god 03 Mini is really putting the effort in on this one for what it's worth when it takes a longer time it's both more likely to answer but also more likely to hallucinate utter nonsense i'm not interested in the LG X01 model because the licensing on it is absolute garbage so I just can't pretend to care yeah it would be really cool if they gave me the reasoning info just so I could show the user something at this point and not have them think the request hung that'd be great but they don't give me anything we'll have to update the UI to let you know like don't worry it's still happening just just give us a sec chatgpt is slow what's funny is when you use 03 mini on lower thinking tiers with problems that aren't this terrible it does really really well so like solve advent of code 2021 day four day four in Rust also see my name the title came in immediately we don't have to wait for the generation to finish why does everyone else get that wrong i don't get it but here like it came up with an answer really quick and I would be very surprised if that didn't work 03 Mini is a phenomenal model it's quickly become like my actual favorite and the one I use for most things hey we'll get to the pricing of it in just a moment great it might have hung yeah happens trying to make a point here guys well thankfully at the very least I can copy the message and go throw it in to the chat GPT site switch to 03 mini high paste send what what is that animation i hate that i I'm not crazy right that That is the most cringe you've ever seen right i And it restarts whenever the text changes too and people say my UI is goddy what the what the the formatting it's Maybe this is why they don't give us the thinking data cuz it's all formatted wrong and duh somebody asked "If we had thinking in T3 chat how would we render it?" I'll show you by switching to a model that shows the thinking that's uh I don't know the R1 on Quen sure here you go you can unfold it and see each step of the thinking as it's all generated you don't want to you can just keep it closed we don't come up with summaries of each step during the thinking we just give you the thinking it'd be nice if we had some better UI summarizing it i like the way that Brock does it with the scrolling thing could see us doing that in the future but for now it's just under a fold did Nope mo3 Mini High is still chugging along did it finish on here yet nope still chugging along on OpenAI's site as well i don't want to think about how expensive that's going to be with the output tokens that it's generating so I'm going to choose not to and instead we're going to talk about the cost of these different models so this is a chart that used to be much more useful before GPT 4.5 dropped because previously you would actually see a gap between these options 4.5 and 01 are both so expensive that they up the chart a thing I used to do a lot was going to this chart which by the way it doesn't even have 4.5 on for it oh it is it just don't have intelligence versus price for it that's fun but if I turn off 01 watch what happens to this chart suddenly it is much more readable and useful and you can see that 03 mini is actually quite a value here going back to my CSV 03 Mini is exactly double the price of Deepseek R1 that was clearly by design they clearly saw that R1 was going to screw them over and went out of their way to make 03 Mini as cheap as possible and they did they succeeded this is an insane price for the quality of model you get i cannot imagine using 40 for anything unless you like you need that first token immediately cuz you're like a phone system and even then I don't know if I would use 40 for it the only benefit of 40 is that there's no thinking which means you start getting a real answer immediately 03 mini is a so much better model so much better value so much better speeds overall like time to answer is faster on 03 mini a really really good model but when you use 03 mini high the cost isn't necessarily represented just by this number because when you use it on high it's generating way more tokens because that's what the the low medium high is it's how much time can it spend and how much how many tokens can it generate in the step before it starts answering so it's almost like the ratio between the answer to the reasoning thinking stage both cost just as much money per token but the reasoning steps aren't useful to you they are only useful to the AI which means that even if you got the same length of answer from 03 mini and 40 03 mini will have more tokens used because it had to reason and generate more tokens before the actual answer came out so low medium high the difference isn't it costs more based on the output length it costs more based on the time spent generating the things that then are used to generate the correct output people are still asking like is a token just a word i'll show you what a token is see how brutal that is for the input tokens there the plus different token the dashes are next pluses the way tokens are split with data and code is always very interesting also yet another high quality UI from our friends over at chat GPT here loved that for us did we finally get an answer we did we got an answer it finished it just took forever and if you didn't notice let's compare just the length of this answer to the answer that we got from chat GPT where's the tab this is the 03 mini high this is the equivalent it's still generating but if we go to the 01 Pro also what the hell happened there i switched to this one it changed to 03 mini for a sec then to 01 pro how does anyone say this UI is fine ah the first answer they gave us here this is like 20 lines of code and there is literally a 0% chance this works like I know this problem the answer is like 500 lines of code not 20 at the very least 03 Mini the model that is an order of magnitude plus cheaper was able to generate something a hell of a lot closer to the right answer first try that's a massive gap i have personally had a better experience with 03 Mini than I have with 01 Pro and not just the ergonomics because 01 Pro has all the weird quirks where it just fails randomly you can't have it running in the background it's super expensive 03 Mini is actually just giving you better answers too which is kind of unbelievable but it's the reality I live in it's an expensive one but it is the reality I live in and the price gap here is just unfathomable it's 136 times more expensive for input tokens this isn't comparing an open- source model or a bad model this is comparing the best model right now which is 03 mini high 150 divided by 1.1 136 if we compare the output numbers here 600 divided by 440 still almost exactly 136 times more expensive how how the does this exist now like this model isn't new what's the point of even releasing this is it almost like it's silly but it feels like it's a response to my video that we're racing to the bottom to just put something like this out their margins aren't great they're not going to make much money on this it feels like it's a parody thing where they don't want to have any models that aren't released externally that aren't available via API but this model came far too late and it's far not good enough for this it's weird and I don't get it because I've had so much better an experience with 03 Mini High so yeah for those asking when are you going to add 01 Pro to T3 chat maybe we'll add it with the bring your own key thing like we did for 4.5 if there's demand for it but I think we've had like 30 messages generated total on 4.5 since we added it with the bring your own key nobody actually wants this nobody actually cares it's 10x more expensive than 01 which is in both 01 and 01 Pro are worse than 03 Mini and 03 Mini is way faster way cheaper way better if you compare to other reasoning models like R1 which is even cheaper you end up realizing that 01 Pro is roughly 200 times more expensive than it should be i don't know how we got here but I am thankful that despite OpenAI's insistence on breaking new ground in pricing the rest of the industry is focused on lowering the price the same week that 01 Pro's API came out Beastro 3.1 came out just barely undercutting Gemini 2.0 Flash at a similar quality of model the focus on better value for our models is great and I'm very excited for a future where the best options are also some of the best priced options 03 Mini seemed like a step in that direction which is part of why I was so excited but it seems like it was a side quest not a direction change either that or the things that Chhat GBT and OpenAI were working on already were too far along for them to change the direction of but there's no way they put these numbers out and they put these products out because they think they're going to make a lot of money off it they've been very it's very obvious they won't i think they were just scared of not shipping the things they'd spent years on doing and there is a future where these tools are foundational for other things they want to build like 4.5 will be the core of what powers 04 05 06 0 whatever okay somebody in chat's really confused about 03 mini high i I'm going to clarify this one last time before we wrap up the way the different 03 mini tiers work isn't that there are different models that are 03 mini versus 03 mini high all the low medium high distinction means is you are choosing how much token generation and how much time the model's allowed to spend on the things that happen before the answer comes out if you look at something like when I just ran this with DeepSeek the answer got truncated because it was too long but the content that comes before the answer that's the reasoning and when you say hi what you're saying is okay I give you permission to spend more time and generate more stuff on this it will cost you more money but it will generate more stuff and it will be more likely to get a good answer all the high button does and all 03 mini high is is a level of effort you're allowing the model to spend on that so yes we will support 03 mini high because we have always supported 03 mini high it is a toggle here but since chat GPT was too lazy to update their UI accordingly there is no way to choose how much reasoning the model can do so they had to put in 03 mini high as a different model and honestly at this point I'm considering doing the same thing on our end to get users to shut up about it and also to be frank because 03 mini high usage is expensive enough because people are just asking it questions that generate endless tokens and they use it when they shouldn't we might have to move through mini high to the premium model tier that Claude is on right now so yeah we might do the the wrong thing that Open AAI is doing because this is not how the model actually works but they present it this way because people are stupid and I'm increasingly realizing that the very least OpenAI is right about that i just can't actually fathom the fact that they put out a model that is worse than their best models twice now they've two times in a row put out a model that is worse than 03 Mini High after 03 Mini while being more expensive it's just it it's so confusing to me that 03 Mini High and 03 Mini in general can drop and be this groundbreaking and the next two things they ship are more expensive and worse if it was more expensive or worse that'd be one thing more expensive and worse makes me feel like I'm going mad i think that's all I have on this one i am confused about this drop i'm pretty sure it's just a feature parody thing but when you look at the cut off date you realize this should have probably shipped a while ago this model's over a year old i don't know what's going on let me know what you guys think until next time keep prompting ## OpenELM Apple's New Open Source LLM (OpenAI Competitor_) - 20240428 Apple's been on a bit of an open- Source tear lately I already covered pickle and seems like a lot of y'all love that the idea of an apple based Json alternative now they're challenging something a little bit bigger they're challenging all of the open source machine learning models that we've seen published from everybody from open source companies like mol to Facebook and meta themselves with llama there's a bunch of things here I just never expected to see be it a hugging face account from Apple or an open source GitHub Revo actually acknowledging AIML stuff historically Apple has had AI in their tools and technology and their operating system certainly their Hardware they went out of their way to never say AI in any of their conversations yet here we are with apple making two unexpected drops just sharing a bunch of cornet training deep neural network stuff yeah this is this is not what I expected at all but here we are we have a lot to talk about and man dropping other important links ml explor is apple as well this is crazy the speed at which Apple went from like quietly being a Powerhouse in AI stuff to loudly being is very unexpected this was end of last year okay I didn't know that they were doing all of this already good to know this already existed this video is a llama one version 1 7 billion model implemented in mlx in running on an M2 Ultra okay I knew about most of this that you could run llama on Apple silicon I didn't know that it was through things Apple had actually open sourced that's cool but that's not what we're here to talk about today we're here to talk about the fact that Apple has a hugging face account for those of you all who aren't deep enough in AI to know what hugging face is kind of like code sandbox for AI stuff where you can play with AI models and training stuff in the browser obviously they're running a bunch of Hardware behind the scenes you have to like spend money renting a GPU to try it all but this gives you a single place like a Sandbox to actually play with all sorts of different models for all sorts of different things I've even generated assets for YouTube thumbnails using hugging face in the past so it's cool to see them not going and inventing all their stuff in a corner but actually throwing the stuff to they're building in the place we're already hanging out which in this case is hugging face we have their open Elm pre-trained models which if I click these should actually let me go to GitHub for them too the Apple sample code license let's read this license I'm actually curious I love that Apple refuses to use MIT or some if they wrote their own this Apple software is supplied to you by Apple Incorporated in consideration of your agreement to the following terms yada yada if you do not agreee with these terms don't modify Apple grants you a personal non-exclusive license under Apple's copyright to use reproduce modify and redistribute the Apple software with or without modification in Source Andro binary forms provided that if you redistribute the Apple software in its entirety and without modifications you must retain this notice and the following text and disclaimers actually a pretty generous license this is like an apple flavored MIT I'm into it open Elm is the new open source model that they're giving out as Apple how crazy is it that Apple released a product starting with open that's a language model thing this is I did not expect this at all we introduce open Elm a family of Open Source efficient language models another thing I have to call out it's very rare for Apple to directly site the individuals who did a thing at Apple I have the example of forever ago where um Apple filed a poll request to OBS under this weird uh developer experience GitHub the developer ecosystem engineering yeah this really weird like almost spooky account coming from Apple that was used to anonymously contribute to things like OBS not Anonymous in the sense that we didn't know was Apple but Anonymous in the sense we didn't know who at Apple did it because this was done by Apple as an org this account was weird the pro profile picture before was this this weird black super low pixel lowquality Apple black background thing they've since changed to be an M3 Max logo which is weird but this is Apple's vague Anonymous GitHub account that they've used for contributions in the past so going from that to just straight up naming the individuals who did the thing is a huge shift for how Apple Works yep so open Elm uses a layerwise scaling strategy to efficiently allocate parameters within each layer of the Transformer model leading to enhanced accuracy we pre-trained open Elm models using the Cornet Library we released both pre-trained models and instructions tuned models with 270 million 450 million 1.1 billion and 3 billion parameters this is a weird variety compared to like llama 3 yeah so it's 8 billion 70 billion parameters are the two models that meta put out with llama 3 versus 270 mil 450 mil 1.1 Bill 3 Bill very strange spread of options here for those who aren't familiar with this concept parameters are pieces of information that are used by the ML and like training process to create the the model of what data goes where in the end an llm is effectively just autocomplete where you put in a word and based on the statistics of an infinite amount of information that they have access to what's the next word most likely to be and it does that over and over again to generate results so what's crazy here is the inputs that they're using to generate these models to to make these mappings vary from 270 million inputs to 3 billion versus what meta is doing with a 70 billion parameter model interesting to see the variety here that said these smaller models tend to be much smaller outputs where like a 70 billion model might be hundreds of gigs a 270 million parameter model might be like a gig or less so llama 3's 8 billion parameters they somehow got that down to 4.7 gigs for 8 billion parameters versus 70 billion parameters is 40 gigs so obviously this takes much more time to run is way more data you can't even fit that all in memory for most people versus the 4.7 gigs you can throw that in memory so these as simple as the difference might seem behave entirely different and the 8 billion parameter model is going to run much faster than the 70 billion parameter model so depending on what you're doing make sense to use these differently I am curious to see how long it's going to take for Apple to sneak their stuff in here because it seems like they want to be part of these communities judging by what they've posted here our pre-training data set contains refined web D duplicated pile a subset of red pajama I don't know what any of those things are I'm not that deep totaling approximately 1.8 trillion tokens in saying that they have that much data that they're using for things nuts we provided an example function to generate output from open Elm models loaded via hugging faces Hub in a generate open el.pie the release of open Elm models aim to empower and enrich the open research Community by providing access to stateof the art language models trained on publicly available data sets these models are made available without any safety guarantees consequently there exists the possibility of these models producing outputs that are inaccurate harmful biased or objectional thus it's imperative for users and developers to undertake thorough safety testing and Implement appropriate filtering mechanisms tailored to their requirement yep the usual disclosure there's an important piece here that I want to talk more about though that this is trained on publicly available data sets one of the interesting things about Facebook versus a company like apple is that Facebook has a shitload of data that they arguably probably shouldn't Facebook knows so much about you Apple doesn't they've leaned really heavily into privacy so much so that it's why Siri sucks if you've used an Android phone and an iPhone it's pretty apparent how much better Google assistant is than Siri and a lot of why is the amount of data they have access to about how users use the phone how these responses go over what things the user's done recently that might be relevant to the thing that you're asking for there's just so much more data that Google has access to in order to make better recommendations whereas Apple just doesn't have that information they're relying entirely on their ml as such they've leaned heavily into really powerful ml chips on device because they don't want to have this data on their server because they don't have the data on the server that comes at the cost of the quality of the data they have and the amount of data they have just aren't there so as such they have to train on public data because they don't really have much else which is interesting that uh they're working so hard to lean into the open side but also Mak sense cuz they kind of have to do the way they position themselves it also means things are going to be more private and trusted because you can go look and use all of these things yourself let's take a look at the GitHub for coret though this is one of the most interesting pieces it's a library for training deep neural networks also has 1.1 th000 Stars already even though it came out a little bit earlier today cornet a library for training deep neural networks up until this point most of the open source models have an open source model not the actual training things so the way the model was created is an open source the data might not even be open but the model that they result in is it's almost like imagine that a bakery gives away their cake for free but they don't tell anyone how they made the cake Apple's now showing you exactly how they made the cake very interesting cornet's a deep neural network toolkit that allows researchers and Engineers to train standard and novel small and large scale models for a variety of tasks including Foundation models like clip and llm object classification object detection and semantic segmentation below is the list of Publications from Apple that use cornet that's a lot of things that Apple has published about this stuff that I never would have guessed pseudo supervision for the visual enhancement a fast hybrid Vision Transformer using structural reparameterization they're all in on this holy I I knew Apple was like a closeted AI Powerhouse but seeing it laid out in front of me like this is kind of insane I I did not expect this how's their stock doing ah yeah suddenly this makes much more sense apple does not want to be left behind Apple always was positioned and such that like just simply due to the nature of Apple silicon they've had a huge competitive advantage in AI stuff but they've kept that really quiet normally they don't do these things so publicly but due to the fact that there is so much Buzz around AI the like concept and idea rather than the actual functional uses it seems like they've chosen to just let the world know hey by the way we're good at AI too in fact we're one of the best cuz this is nuts how recently did all of these things come out so like none of this is super new Apple's always quietly had these types of crazy research and things going on like another fun industry kept secret that's not that secret is that Apple helped design the USBC standard they're one of the biggest contributors to it they probably contributed the port itself apple is not scared to contribute things to the greater ecosystem they just don't do it without reason so for them to make this GitHub repo and make all of these reasons it's clear they're trying to signal to the world hey by the way we know what we're doing here here's what we've done if you want to join along and try it out too I just did not expect this to be as absurdly large as it is they're even using get lfs because the repo is so massive and of course good old Jupiter notebook I never expected to see a Jupiter notebook instructions set in an apple repository more fun points being made by chat Apple's also heavily involved with matter in the Internet of Things stuff as well as qi2 being magsafe they also the chi Qi whatever you want to call it charging standard they were very involved in and they pushed it really hard they easily could have made up their own when they added wireless charging but instead they used the chi standard and then they pushed the chi standard they've been forced to use RCS the SMS alternative in the EU but their hesitation is that RCS has no encryption standard rather than paying Google to use theirs and let them have access to all that data they've actually proposed an open standard for encryption for RCS and they're trying to get that in before they have to comply Apple's generally pretty good about these types of things I've just never seen them go from zero to 100 quite this fast it's weird also yes I know USB type c is an inverted lightning cable it's the design of USBC is fascinating you cut consensus expense just making it a torrent yep yeah the fact that so many of models can be just torrented is insane I did a video about mol dropping this before nobody cared the mol Twitter is such a wild ride they did their original announcement in June last year they didn't say anything for a while then in September they just dropped a magnet link if you don't know what a magnet link is you're not into piracy enough this is how you torrent things you drop this in your torrent tracker solution and you just get the file this is how they've released all their models they just tweet the magnet link and this one they forgot to give the uh confirmation so they went and added it after but like yeah Al LOL at the end and they like Banner image is word art it's something else it's surreal so like this has been the state of Open Source AI stuff for a while is this company meil showing up and just Ming their way to the top and now we have the furthest opposite which is Apple cornet with their actual Apple GitHub they're not throwing this on the developer experience or whatever they're putting this on the actual Apple GitHub and really partaking in this ecosystem I never would have thought I genuinely could not have imagined that Apple would come out this hard guns blazing to be a meaningful player in the AI open source space this just made the next WWDC significantly more interesting what do you guys think though should I spend more time covering this stuff I know I don't normally talk about AI on the channel but I have been playing with it a lot more so let me know in the comments if I should make more content about this stuff or maybe even play with these models in the future until next time peace nerds ## Panda CSS First Impressions _ Theo Reacts - 20240222 my first impressions of panda CSS this is an article written by Baptist that I'm actually pretty excited to check out I've been meaning to take a deeper look at Panda have been hearing really good things Panda's from the Shakra team and I'm personally not the biggest fan of Shakra didn't love Shakra cuz it was really component library is Panda seems to be focused on being a more minimal building block so I'm excited to see how it works and what people do with it so let's take a look at this comparison of tailand and Panda comparison of styling solutions for the web covering type safety merging Styles and component VAR interesting because these are all things T doesn't really do good opening hey there it's the first issue of my newsletter for 2024 once again shout out to the author we'll be sure to embed his Twitter and stuff somewhere I've been using Panda CSS for a few weeks now to build the website and the demos of xstate by example and I've got a lot of feelings I want to share with my fellow web devs Tailwind CSS brought a lot to the table for a bit of History Tailwind was my go-to styling solution for nearly 5 years and no styling solution has seduced me until recently tailin is excellent for a few reasons first styles are edited within the mark markup instead of being separated second final styles are predictable and it's easy to prototype third it comes with an excellent quality default theme un let developers focus on what matters instead of choosing between a font size of 14 or 15 it's not really a theme I have a whole video about that it's Primitives you build with not like when I think of a theme I think of a way a button looks not a set of Border sizes to each their own not really themed but I get it point three managing a website built with Tailwind is more manageable because many problems are discarded such as finding a good name for this CSS class or dealing with specificity in cascading problems absolutely agree maintaining Styles was a thing I used to spend a lot of time on that I spend almost none with Tailwind it's way quicker to fix things find things change things build things just Tailwind makes CSS get out of your way and then point five Tailwind generates Atomic classes keeping the bundle size tiny it generates the same class once no matter how often it's used again I don't think we will appreciate this point enough it's very very hard to make a styling solution that is more performant and efficient than Tailwind because you're reusing these class names all across your code base and you're generating that one CSS file for your entire website you load one pretty small CSS file and then all of your CSS is handled and since there's repetitive Parts in your markup you can Gip that really well too the performance of tailwind and its impact on both the size of your markup in HTML as well as the size of your CSS is actually really really good anyways of course Nan's here for those who don't know Nan is the creator of Styx panda is a maximalist stylex it has some good ideas and yes is me maintainer of Styx figured as much in the mind good to see you interesting that you have positive things to say I'm extra curious now he also called out that once you use Tailwind merge a lot of the performance wins from Tailwind start to crumble yeah fair you have a point anyways I bought Tailwind UI the paid templates built by the T and CSS team and I use it for my clients and my side projects without exaggerating it's one of the best purchases I've made the return on estimate is high for the price at costs I agree I am going to confess something here's the upload thing homepage there you go look familiar hope made my point tail and DUI was a very very good purchase for us it has got us really far most of our designs been complimented more than anything and did some customization I will say the code for this was awful and the placing of these blobs expected the homepage to always be perfectly vertical so I did actually change a lot of the code but the design thank you Tailwind I appreciate y'all you make a good deal anyways I learned much about CSS in designing user interfaces thanks to Tailwind also hard hard agree I had plateaued in my CSS knowledge pretty hard and just tried to to get out of CSS whenever I could and focus on the things I was more excited about Tailwind made CSS so much easier as the wrong word fun to engage with by by trimming out all the annoying parts and focusing on The Styling part it made CSS so much more fun for me and that that feeling of what I call like the Zen where you're just typing the specific class names that you know are needed for the thing you hit save they sort themselves correctly and it works so good the reason is that the default preset gives excellent tools to non-designer people yep again we don't have a designer at ping right now and we're getting away with it the sole job of finding colors that look good together is difficult also one My Favorite Things even when I'm not using Tailwind I'll pull up the color dock because their color palette is so good the ease of prototyping and the Fantastic documentation quality can explain that as well so here's where we get into type safety type safe csjs with build time generated styles that sounds familiar that sounds quite a bit like a few things we talked about on the Stream started hearing about panda on Twitter less than a year ago let's see they actually follow me good you've earned a follow back Alexander is one of the core contributors to Panda he was advocating for it on Twitter I only dug deeper recently when I asked myself what would I use to style my new project xate by example you know if it already has an X why not style X Panda CSS is a CSS njs solution that extracts the Styles at build time instead of runtime resulting in better performance it looks like this oh oh I'm not going to like this I'm not going to like this at all one of my least favorite things anyone ever did to Tailwind was this awful thing called attribut Toy Mode it was usually a config for Tailwind Alternatives that were usually CSS and JS things like windy or I believe there's a mode for this for um Uno also has an attribute to fight mode if I recall I hate this it it entirely destroys the thing I was just describing with Tailwind about the Zen mode because now I have to press enter now I have to remember which key is which now when I'm like reading through I remember which part I'm on like is this BG or is this border you don't have any guarantee of order because it could be top bottom left right anything I hate this I agree that having a better context when you're reading through your classes is nice and knowing where things are is important but that's why the Tailwind prettier plugin that auto sorts the classes is so good because they're always the same order so you don't have to worry about it I think the problem this is trying to solve is solved way better with the automatic ordering and this is just causing more problems not solving them like just the number two in a string ah okay anyways back to this because I I don't want to let my previous hatred of these Solutions cloud my ability to judge Panda fairly so Panda extracts things at build time instead of runtime similar to vanilla similar to stylex and it generates markup that is literally just Tailwind this is really funny it it writes the Tailwind for you by making you press the enter keymore okay I'll stop I promise I'm sorry the fact that you have to press 15 symbols for everything you want want to do I I can't stop I have to keep going I'm sorry the we all agree that pressing underscore pressing colon pressing quote pressing comma pressing enter pressing all these things is worse than pressing any of the keys near the middle of your keyboard or spacebar right like we all agree with that because the amount I have to maneuver around the keyboard to apply a background color a border and a font size is absurd that it's just the amount of typing I have to do is so much worse that it drives me insane okay I saw an actually really good question if it compiles why not make it a single unique class name because doing that is incredibly inefficient this is why most of the compiled Solutions suck because most of the compiled Solutions make a very specific assumption that everything needs to be unique because these are compiled as individual things for each field You' filled out now if you have let's say I don't know 14 places that use font size 2 XEL you don't have to include one additional line in 14 unique classes instead you have all 14 of those things have the font size 2 XEL class it lets your CSS be way smaller because you have a much much smaller number of classes and you will eventually hit performance issues just by having a certain number of classes that your browser has to deal with and on top of that your markup will be better too I know that sounds unintuitive because it's like wait aren't you just putting a bunch of small class names in the markup well yeah theoretically the markup could be a little better more often than not those class names get long tedious and are very unique whereas when you have a set of classes that are reused cross your code base that are always in the same order those can be gzipped to be really small so as much as that unique class might sound better actually makes compression worse in a lot of cases yeah this is going to drive me insane let's let's keep going I I I want to approach this as chill as I can I want to try and appreciate what they're doing here I just don't like the amount of work I see when I look at this anyways you can group styles by conditions large for large breakpoint or by property wait or you're winning me over looking back at this I think we got a little blinded by my by my hatred of ATT tribut toy because large here makes us very different I will say it is Panda's fault for me falling for that because one of these is a sub group of targets so in this case we want the background color to be base 50 Gray on Hover to get darker this is a subsection of different style things I would want to apply if you are a Tailwind user this is the thing you'd put for the first two two characters at the start of your Tailwind call this is a viewport selector these are two very different things and having them next to each other like this makes it very easy to skim over and not realize that this is an entirely different Behavior than what this is that's a bit scary to me I was actually thinking the code review here might be better what I'm seeing here feels worse I'm stealing your quote Angelo without crediting you cuz I can't get the words right these are properties these are media queries they shouldn't be the same index level you can convince me in tail that media query selectors aren't great especially the idea of doing things in groups like that the auto sort helps a ton here because if you have multiple things prefixed with large they all get bumped to be in a group together but you could also convince me something like Tailwind helper equals this where I have LG colon BG gray 200 Flex Flex column and different behaviors where you have this helper this giving me part of tailin merge where you have the media queries out as the keys and then the value is the properties but having the the keys intermixing properties and media queries makes it so I can't really rely on that the other scary part here is that the order can be changed and you can do really nasty stuff that makes the code riew here miserable like you can put this there that's cursed this just got this went from perceivably easier to review to significantly harder to review with that one small thing and to go back to the type safety point which we haven't even gotten to really the reason I like type safety is because it makes small errors less likely and often makes code reviews and consuming other people's code easier and more reliable I feel like I'm throwing that away with this even though it is type safe in the sense that this wall autocomplete it's also less reliable in the sense that the order when I read this is less consistent so yeah I'm losing as much as I'm gaining as I read again I just I can't agree that this helps with readability I just totally misunderstood what this was because of said readability theoretically a prier plugin could force that these are at the top or the bottom which is where I'd probably want them at the top so they're clearly called out there but if you're using these I would want it to have to be under some other key like here's what I would do have default have this always apply or even bass might make more sense for this but this being at the same level I hate this I hate this so much this stresses me out just looking at it anyways let's get to the cool Parts because the Coden is actually dope Panda CSS relies on Coden to generate only the styles used in the project this is another one of those things that like Panda stylex and Tailwind do that other Solutions don't I don't even want to think about how many unused classes there are shipping in the CSS for the twitch website I personally have left at least a dozen of those that will be there probably forever or until they rewrite the entire site duh yeah this solves that at any solution that solves that I'm default pretty good with so we'll see how they're doing this exactly another thing pointed out here is that stev loves that the styles are typ safe you define styles by calling the CSS function whose types only accept the Styles existing in your project the Coden also generates the the type definition of the function so it reflects Panda's configuration in the project that's also really cool this is something that kind of been hacked into Tailwind with the prettier extension but not much so honestly this kind of feels like Prisma where uses the schema you've defined to generate type definitions when you use it having a config that defines all the things you allow or enforce in your Panda setup for your project generate a type safe output it's actually really nice had have thought about that that's cool the code genen generates its output in a styled system directory at the Project's route yeah it's cool and that's actually code that becomes part of the project rather than getting stuffed as an override in your node modules again similar to Prisma really interesting to me type safety is Panda's most significant advantage over Tailwind with Tailwind developers must use a vs code extension to check the validity of the classes they wrote in a string tailin DX is deteriorated because styles are written in a string without any native type checking possibility who's going to tell this Dev about view I've never seen view catch so many Strays and I've seen view catch a lot of Strays that's hilarious that said honestly I would have largely agreed with this before the prettier plugin I love type checking I love type safety that's how my whole Channel and brand and T3 and all of this started was because I care so much about type safety and I care about it for a lot of the same reasons here the developer experience the autocomplete the reliability of doing this inside of VSS code those are all things I really cared about thankfully the Tailwind vs code extension helps a ton I can just hover over this and you see the exact class exact CSS being applied here so if I add some things here like large p8 mid P4 now when I save it auto sorts itself to be in the right places there is an annoyance here of when I save it moves the thing I was just typing somewhere else sometimes but that's the biggest annoyance I have using tailent the important piece here is about the type safety what if I totally typo something like BG red 800 instead of BG d red and I save it something really interesting happens it gets bumped all the way to the front and depending on you have your config set up that might actually give give you an error which is really nice it's not type safety in the sense that typescript isn't doing it but it's wrong class safety in the sense that preder still can check and guarantee these things for you there are also eslint rules that do the same thing it's somewhat trivial to keep yourself from entering things that aren't real Tailwind classes so if we break down the benefit of type safety to less errors in the output code because they're being type checked with some form of linter or enforcer and autocomplete SL error semantics behaving better overall this solves both this is fine and I'm saying this as the typescript nerd I don't love relying on linting when I could rely on typescript but we're checking if a string has valid Keys it's not a big deal it's not the worst thing I've also just been informed by Gabriel of a pretty cool vs code plugin well it's not really vs code it's eslint and it streamlines your Tailwind code apparently interesting so if it notices you have multiple class names that could be replaced with a single one that applies the same stuff that's really nice so if you're writing two verbos of things that could be simplified it will do it for you personally I don't know if I would use this because I might have a reason I had three things in there cuz I want to change one of them sometimes and not other times was a cool idea I actually like this overall I can see why many would want to use this and it would again make the consistency of the readability of your Tailwind code base pretty pretty good not my thing I'll leave a link in the description regardless because it is interesting okay I think this is where we're going to start agreeing a lot because uh merging Styles in Tailwind isn't great this example here is something that you probably expect me to make fun of but no I've done this so many times with tailwind and it has a lot of catches like if you define the class names you're passing somewhere that isn't another TSX file or isn't being checked by your Tailwind config you're just not going to have these classes show up or if you're generating them dynamically like a thing you just cannot do in Tailwind is a function that like const get background that takes in number which can be 400 or 500 or 600 and this returns BG red plus num you'd think this code would work and I could just just use this the problem here is that the way Tailwind works is it reads all your code it looks for all the strings it finds all of the strings that exist within its understanding of potential Tailwind stuff and once it has done that it generates a CSS file with all of the exact strings you have used that's why something like this works because again the Tailwind compiler is reading all your code files and it sees this value what wouldn't work again would be something like this where you pass num like this intuitively this should work but with the way the tail comp works it doesn't function and I've seen this bite lots of developers even my CTO just got bit by this like a few days ago when we were demoing some stuff this is this is scary and the only way you'll ever get this to work is if you're running some JavaScript to detect these classes I think that's cool I think it's a fair compromise and I'm already seeing people in chat saying and I love that it doesn't work static definition of styles is extremely critical to my workflow and he said he loves that this doesn't work I agree static definition of styles is almost necessary for things to scale inline styles are similar but they get none of the benefits and the markups way worse and not ordered and no yeah static Styles scale significantly better absolutely there are things for this but the easiest thing to do is honestly to just have a random file that includes one string with all the classes you need and then it gets hit by the compiler and you don't have to worry about it yeah The The J in time compiler is a good thing and we should embrace it anyways back to this so this was an example with merging Styles this is actually a really fun example because this button has a py1 so that's padding vertical one but we've now appended class names here and we're passing py4 so we want to override the default padding with this new one the problem is that it's hard to determine if the vertical padding will be overridden this might seem trivial like obviously py4 is at the end that's going to work right so we have these two elements this div has classes A and B and this div has classes b and a let's do something fun we'll Define a with background color red that all makes sense so far we're going to add something we're going to add B and this is going to have a different background color I want y'all to predict what happens when I add this background color I'm going to make it blue do you think I'll I'll pull checks I'm curious the options would be AB turns blue ba stays red AB stays Red ba turns blue actually I'm going to change this to be labeled one and two so it's a little easier the first option would be one changes blue two stays red option two is one stays red two goes blue option three is they both change I will run the poll quick so the first one has a then B second one has B than a here I have a then I'm about to define B I should have had both stay red yeah cover all options most people got it but a lot of people fell for a pretty common thing which is that you assume the order the classes appear here is the order they're applied sadly that is not the case because CSS kind of sucks the issue is that the order classes are applied to elements has nothing to do with the order you wrote them in the element it is purely based on the order they are in the CSS file this gets even more fun if your CSS loads out of order and then you could have different behaviors depending on which order the CSS loads in because it's not determined deted by what order you put the classes on it's determined by what order the CSS is given to the browser it is terrible so why am I bringing this up I'm bringing this up because let's say instead of we flip these so py4 is here and py1 is here if both of those classes are applied to this element the one you passed here isn't necessarily going to override the one that was defaulted here unless the one passed here occurs later in the CSS file we have effectively created a race condition which is not good and this will have really rough edge cases to debug I know that I've had them I had them a lot very early when I used Tailwind as the author specifies Tailwind will both generate the py1 and four classes and put them in a CSS file with the same specificity which makes the class defined last take precedence over the other one but which one I can't tell you there are many solutions to circumvent this like using the important keyword on the overriding class or sing the react component to receive a property like vertical padding letting the component choose which class to apply this is what I lean into honestly but I get why that's annoying especially for smaller teams but what you'll end up doing including us is we use tail and merge finds the classes defining the same property and it keeps the last one so if you use tail and merge with the originals and then this new class it will replace the py1 with the py4 but here is where Panda comes in because out of the box it just does that you can pass multiple objects to the CSS Helper and it will flatten that for you that's actually really nice and I like that that's built in rather than being a third party thing because it means you can optimize this with compilers much better than with Tailwind merge and you'll get the weird manic a quirks where this no longer can be GED anywhere near as clean one more quick thing on the sort order of classes this is one of the biggest reasons to use the prettier plugin when you're using Tailwind because if you're not you might accidentally put the classes in the wrong order and then the behavior is really unintuitive if you use the Tailwind prettier plugin the order that they're sorted in your code will be the same as the order it's sorted in your CSS so likelihood you hit one of those cases is significantly lower anyways component variance I've often written code like this to create a badge with variants how many places do we have like this exact same code in our code base mark I'm getting flashbacks we have a lot of things we would have used type instead of interface but otherwise we've we've written this too many times way too many times curious how they handle this variant the code becomes even more complex with more variants like the badge size the issue with merging Styles is also relevant here yeah if you also want to add badge size here now you're combining a bunch of different sets of strings to try and architect that into a good to apply class this is probably where I'm going to get swung much more Pro Panda the issue with merging Styles is also relevant here and this is why things like class variance Authority and Tailwind variance both exist CVA is really dope it's created by Jo bell used to work it for cell really talented Dev focusing on making Tailwind scale way better for Design Systems it's inspired by things like stitches and vanilla extract but it lets you use Tailwind still instead it's really nice as it's becoming a theme Panda Sports is out of the box this is okay I was so scared this was still the CSS thing and it's be like oh no that's awful but no it's a separate import CVA which is nice also I'm seeing again that they're importing these from the local styled systems folder rather than from the package because it generates that it's pretty nice to see this is nice that there's this level of like deep variant behaviors built in where you can still use these chunks my question would be how much composability exists here like how easy is it for me to define the color in BG as a like a value that is type safe and then use that in multiple CVA variant sets in different places I would assume it's a pretty good story but I haven't seen it it would really come down to can I put a CSS helper here instead of just the object which as long as you can I'm sure this is great and you just grab this by using their styled helper wait does this just create a component with styled no is this styled components no you don't have to do that just make me apply this as CSS don't no I hate this so close so close they had me until you have a weird Syntax for for defining jsx H we were so close guys the variants are strongly typed automatically you must pass the status variant when using the app badge Styles or the app badge component and provide one of the defined options as long as you can call this with the specific variant key that you want to use that'd be nice but I don't love that this will result in a code base with a lot of different weirdly nested ways to Define UI like imagine that three components in this code base use the app badge helper span wrapper and then three of them couldn't use span so instead of overriding this they use this independently in three different places now you'll misleadingly make a change here thinking that it'll only affect this and then three other people's things break I see a lot of potential fragility in enabling and allowing both I would throw away this entirely if I adopted Panda this part's dope though also that it's very directly like class variance Authority like they're borrowing that pattern directly it's nice it's a good pattern it's pretty good I like how the library has been carefully thought out as uh don't know if I agree with the wording there but I agree that the flexibility is really nice there is much more to discover panda is a recent library and with many exciting and well-made features amongst all its features I especially like the following slot recipes some UI elements need to be separated into several parts for dialog component there might be a trigger content title description and Clos trigger Parts you would want to Define these Styles as part of the same group of component variants slot recipes offer this and park UI uses them to Define component Styles I once again have feelings this feels like it would get really nasty in the nesting really quickly and again I don't think everything needs to be done in an object when it could be done in markup like this yeah this is what's kind of confusing to me like how often would you reuse this recipe I feel like if I wrote this it would be for one component and all these things would be applied in that one component at which point I would be just as happy with three of these one for root one for control one for label that are way less deeply nested and way more readable I would personally much rather scroll up and down to these different element types to see how they're defined in the different conditions than to blend portions of them so deeply together like this this is actually I think the root of what where my uncertainty is coming from here is one of my favorite parts of Tailwind is how consistent it is when you read it it's always going to be the same it almost feels like prettier in that way where once you've made this thing always look the same it is way easier to review make changes to and have confidence in I'd even say it's like go in that way where there aren't many ways to do things and they're pretty straightforward and easy to lint this gives you too much flexibility and I can't believe I'm saying that because my whole thing is modular tools let you do what you want this one lets you do too much and I have weird feelings what are the other examples here config recipes by default Panda generates the styles for all of the class variants Authority variants even those never used at runtime using config recipes Panda can generate the CSS only for the actually used variants config recipes are extracted and generated just in time regardless of the number of recipes only the recipe variants you use will exist the recipe needs to take the class name an array of all the components that use it and a description like the description is optional but oh no you have to put it as a string this is my issue here there are just so many layers it's not necessarily bad I just personally would want like one four of this if it was easier to take a subset of all the things they offer here and enforce that I'd be cool but as soon as we're passing jsx string literal hints to generate the minimal subset of CSS being used we've lost the plot I feel like we're way too out in the woods here I feel very similar to how I feel when I was reading through Uno where there's just so many things so many things and this is why I why I loved Tailwind I feel like we escaped all of this am I about to become like the old HTM X person the get off my lawn guy because we we made it simpler I don't want to make it more complex and this this gives too many options I have to shout out n man who just pointed out that we feel very similarly here as I mentioned before Nan made Styx and if I find some random examples in here with Styx you'll see it's got options but not many it exports like two things they're pretty consistent and you call them as classes you just apply sorry not even as classes you just dump their props and it's not very deeply nested it's not super annoying to config it doesn't have a lot of weird quirks it just kind of does its thing you add the roll up plugin so it can compile up the Styles and you're mostly done it doesn't have the same level of configurability because it doesn't have a config that defines what you can and can't do the same way but you can also just write it and it works this feels much more like an in between and if I was personally to start working on a style system for a big company I would be leaning in the Styx direction for sure again Nan points out he's anti fig and I for what he is doing I dig that and this is my this is my feeling one of my older videos I did a really really good diagram that I should find so I can cite it more where I compare all these different solutions and I phrase them as Behavior libraries CSS Plus+ like things that are meant to focus on improving CSS overall and style systems a style system would be something like bootstrap or Tailwind where it defines a bunch of specific styles that you would want to apply like a button style Behavior libraries are things that handle like when the menu opens and closes accessibility tag stuff like that CSS Plus+ is things that make the actual writing of CSS a bit less painful and the weird thing about panda is it feels like it's kind of Dipping its toes in all of these when its focus is being CSS Plus+ I also would say something like Styx is really interesting because it is CSS Plus+ but it's CSS ++ with the goal of making it easy for you to build your design and style system so I would use stylex to build my own thing here and then bring in a behavior Library where with panda I would def Define the style system in their config and then use their syntax to Define my style system in my code and that back forward back where I have to switch mental contexts from config to CSS to JavaScript to potential output kind of destroys the Simplicity that I got from tailwind and yeah it feels like more steps to the same compiled output with a lot of weird edges and I'm not that into it that said this article was great and I am genuinely hyped that this was written huge shout out to baptist yeah I'll give you a sub thank you PTI for writing an awesome article I hope you take the opportunity to make some content response because I will certainly throw my audience your way as a Tailwind Dev that was a really good dive in to start to understand Panda and what its goals are and why someone would use it it's definitely not for me but I'm starting to see the value curious about you guys though were you as Jarred by the attribu toy patterns as I was or do those look exciting to you let me know in the comments super curious thank you guys as always see you in the next one peace NS ## Partial Prerender - The Next.js Feature I've Wanted For Years - 20231113 it's no secret that I'm really hyped on partial pre-rendering it's a feature I've been asking for for for I think 2 years now a bit over a year and a half ago I did a Twitter space that Dan abof showed up for and spent a lot of it explaining why this feature is important the best I can teal di is that you should never have to block on a server for a user to see something from your app if you go to a website you don't have to wait for a server to spin up just to send that first response that first response if at all possible should come from a CDN and the rest of the content should come in from a server when it's done preparing with the new app router model around server components there was kind of this implicit expectation that react has to process and respond with the first bite and the result was a better overall experience when it came to the first load in navigation type behaviors it actually felt a bit slower especially if you were blocking on a cold start from a Lambda it would take 3 seconds before you saw anything other than your browser's white loading page that was unacceptable and I pushed really hard for the react team the next team and versel to address this because I thought it was important I shouldn't have to block until the react server picked picks up for users to see something and all I wanted was the ability to take that first response the server sends and cash that on a CDN and let the rest come in later and that's exactly what they built with partial pre-rendering I can sit here and talk all day about how hyped I am but I'm going to let Lee talk a bit about what it is and how it works and let you guys see my genuine reaction as I see him break it down we're working on something in nextjs I want to show you an early look at and it's called partial pre-rendering and allows you to have the best parts of both static and dynamic rendering in the same page with no new apis I'm really happy they did this people keep complaining about how much is changing in next versions I'm annoyed with that on two sides one is that everything from the old next versions works it's been a while since they deprecated something same deal with react you can use page router an x13 and you can use page router an x14 but also the new apis are a lot and are scary to a lot of people so I understand the frustration that said there's no new API there's nothing new to learn with next1 14 and I think it's important that we get excited about that cuz it's a nice change let's take a look if we go to partial pre-rendering if I reload the page you'll notice it's really fast and that's because we have fast Global ISR so we have a fast initial static shell and then the dynamic part is streamed in after the fact so the recommended products the information about when you can get this product the customer reviews all highlighted by this pink dot and the best part is this is all programmatically defined how you want so you get to control what the user experience is like so in one request to the browser you're able to immediately get back that fast static shell and then basically concatenate on the dynamic parts or stream in the dynamic Parts after the fact without having to do any additional work do I want to yeah I'm going to stop here because there's some really cool stuff I want to highlight Ricky from the react team highlighted the difference here showing an example of a pretty Common App Behavior you have your front end this probably shouldn't say front end probably say like top nav here you have an image you have product name description all these things all of this content is static but the number of things in your cart that's Dynamic and unique to the user delivery time is dynamic and unique to the user recommendations are Dynamic and unique to the user so being able to make all of these static Parts static so they come back from a CDN instantly and streaming the rest after that is incredibly powerful that makes your apps feel so much faster that said it also means you're now experiencing poppen and I think Kent has some very reasonable push back here around the importance of making sure we handle layout shifts like what if the cart once the content comes in is slightly taller than this was before it's going to cause the whole page to shift and that's a really bad experience so there's two ways to solve this one of the ways is going really deep on the suspense boundaries and fallbacks making sure they're guaranteed to always be the right size I think for something like the zero items thing it's going to be annoying ideally all of the content that streams in is beneath or separate from the content that's static so you don't have to worry about containers changing in size when content comes in you can do it with good suspense fallbacks but it's not a guarantee one of the points that gearmo tries to make here is that you control how much goes into the pre-render so this is a primitive you can say hey I want the whole page to pre-render I want most of the page to pre-render or what I do a lot of the time and I specify here I have almost none of the page pre-render I don't think actually I said that specifically here oh yeah the even if your loading state is a blank page it means speeding up the load of resources like CSS and JS and fonts so if you have a static shell and you wrap your whole page in a single suspense so none of the content comes in maybe you have a background color that you changed otherwise the content's not there but if you have a static HTML shell with empty content that has your CSS tag your JS tag and your font tags the browser can start loading all of those while the server spins up and starts sending its response you're still having a massive benefit here in terms of performance and also in terms of the perceived user experience even if you're barely using the feature That's The Power of this feature you have much more control over how these patterns work you have this primitive where you can choose do you want nothing to load in ahead of time do you want just a static shell to load in ahead of time or do you want everything to load in ahead of time and you have that Dynamic control Now by using suspense as the boundary where things become Dynamic and while I agree that content flashing in sucks and I call that out a few times here I think we end up agreeing maybe not in this thread but in a couple other places we ended up agreeing a lot where all of your content flashing in sucks like the number of websites that are going to have a a sign-in button that becomes a user icon is going to go up from this change down and I don't like that but it's reality this little if you think of that as like the user signin button and that's now being flashed in because it comes in 30 to 100 milliseconds later that's not a great experience and you as the developer have to make these decisions in order to have things feel good but that's also why I like this feature it's not telling you how to do this it's giving you the pieces so you can do it the way you want to in the way that feels best for your application and your users enough about the thread I want to watch the video actually demonstrating the feature let's look at this demo and see how we're able to do this with no new apis defined by your suspense boundaries so I have the code running on the left in my editor on the right I'm just looking at a blank page right now and what I'm going to do is I'm going to navigate to Local Host 3000 and we're going to see the browser loading spinner Spin and spin for a couple seconds we're waiting for the slowest data fetch on the page to finish before we render all of the content so it's kind of all or nothing and I have these times defined by some in my application so the reviews for example Take 2 seconds now the great thing about partial pre-rendering is that I have the flexibility of how I want to Define this loading experience in my application so for example let's say that these reviews the slowest part of our application maybe instead of directly fetching these here with some delay maybe we want to wrap these into spits and we want to have a fallback for the loading skeleton to show so let's take a look going back to our blank page and then navigating to Local Host 3000 it's a little bit faster so we aren't waiting for that slowest data fetch in the tree now which is the two second delay and if I reload the page it's even you know it's pretty decent it's a little bit better but what if we could go even further there's other places in our application where we had some asynchronous components that were fetching data like in this header where we're fetching the cart count from the cookies one thing he doesn't mention here that I think is important is that in this example the fastest content is near the top and the slowest is near the bottom so things pop in top to bottom and as silly as this sounds that is a much better user experience than top Pops in Middle Pops in top right Pops in bottom Pops in cart gets updated like like things changing up down left and right in your app feels much worse than a linear top to bottom more content gets loaded in and as silly as that sounds that you do feel the difference and I think this example is both good because of that but it's also important to call that behavior out back to it you know what let's put a suspense boundary on that and then also over for looking at pricing we also had the ability to add to your cart which is reading from cookies so we should put a suspense boundary around that and then also some of these user specific details as well too so I'm programmatically defining where I want the suspense boundaries using my code defining fallbacks and then the next GS compiler can automatically create the static optimization here based on your code so if I go back to about blank now with all these changes and I navigate forward to this new updated version it's really fast the first version that we get has the majority of the static shell because we've made as much of this page static as possible and then subsequent reloads as you can see by the pink pulsating dots those are the parts that are streamed in after the fact now to go a little bit more in depth on this I'm going to walk through the blog post that Sebastian and Malta wrote which is fantastic so we'll step through here and I'll just provide some commentary on some of the love you Lee that's my job let's go grab that blog post building towards a new default rendering model for web applications look at partial pre-rendering with next1 14 unal and this year nexcom we discuss the developers and user experience challenges of globally delivering Dynamic web applications how can we fetch data without expensive waterfalls and also deliver content directly from the edge the answer to all of these current challenges is partial pre-rendering partial pre-rendering combin Ultra quick static Edge delivery with full Dynamic capabilities and we believe it has the potential to become the default rendering model for web applications bringing together the best of static site generation and dynamic delivery yes I've been asking for this for so long let the static Parts be static let static be static is almost what I want to title this video because that's that's my goal here today you can try an experimental preview of partial pre-rendering with next1 14 on versell or visit our demo site for a first impression on partial pre-rendering I'm happy this is working now for the most part because it did not work at all at nexc and if you don't want proof that I'm not just here to sit and chill every single detail of what forell does I think they kind of bodged this launch they talked about it a bunch at the conference and it just didn't work at all it was even like a joke amongst the versel employees I was talking with and I get it that's fine it's just a little weird feeling to see a bunch of hype around a feature and then go home and open my laptop and it doesn't work that said it's mostly working now there are still things that aren't and they call it out that actually been pretty public in their poll requests and in their GitHub issues about how many things aren't working including client navigation which hopefully by the time this videos live will be fixed but this feature took a lot of effort both on the next side and the versel side and funny enough it was working in nextjs and it was not working on versel at conference time so yeah love you guys make sure your things work before you announce them on a conference it makes my life harder happy it's working now happy we can finally talk about this cuz the win here is massive I really like this diagram I don't know if I would use Edge delivery because there is a performance win from a CDN versus an edge render and I feel like it's not calling out enough on that here it does a little bit with the does not block time to First Bite on cold start but me it's it's not a big enough call out but yeah traditional SSR does solve that but then when we compare to ISR which for those who aren't familiar is incremental static regeneration the concept is the first time somebody goes to a page it makes a cash of that and then the next user hits that cast version of that page that concept is great ISR is why ping feels fast when you navigate the Ping site it flies because we incrementally statically generate the pages as you go to them the first time and now that page is Cash on the CDN is a very empty shell it's usually just the loading spinner like if I go to Ping cool so now when I load the page you'll see it's just this empty loading state with the little loading spinner that page is coming from a cache from a CDN cache so when I refresh I'll show you I am pressing command shift R right now you get something back instantaneously because that empty minimal page with the JavaScript bundle with the CSS with the fonts with all of that is coming from a CDN and you can get it instantly and the result is that navigating ping feels lightning quick sure you can have access to my camera really proud of the result with ping but in order to do that we have to do a lot of work on clients so when I open up the network tab on this page and I refresh you'll see a lot of things have to happen before we start getting the rest of the content so we load the dashboard HTML this comes back in 56 milliseconds 19 milliseconds sometimes that's insane so we get back page with content in 19 milliseconds then we have to load all of this JavaScript and then that JavaScript can now start rendering and realize it needs data it needs to know the rooms that this user has access to this takes another 268 milliseconds and that's after all the JavaScript has already been downloaded and run this is with ISR and the result is that a lot more stuff has to be done before you can actually get the content so you get that cached CDN initial piece then the client has to do a bunch of work and then the rest of the content can come in and that's what partial pre-rendering is designed to fix the new model with PPR it's not BL blocking the rest of stuff until after the client has run the JavaScript without PPR using ISR or even traditional static site generation once the dynamic behaviors need to come in you need the client to do it itself with this model the server can send that cash response and then it can fill the rest in after if we compare that to the network tab on this page we're going to see a huge difference here where yes we're still loading in all of this JavaScript but most of the content comes from this here we get that first response set 77 milliseconds later and then the rest all comes in as part of this response because it's streamed in from that first request that is the magic of this new model you don't have to wait for the JavaScript to all run parse and then make an additional fetch request that then spins up the server again let's say it takes 1 second to get the recommended products that 1 second starts with this model right when you start loading the page with ISR that 1 second starts after you load the page the client parses its JavaScript the client authenticates and then the client makes a request that adds a 300 100 millisecond to often sometimes in certain internet conditions seconds long delay and one of our favorite Chatters mentioned in chat earlier African scam call mentioned that his Internet is slow where he is but partial pre rendering.jpg when the server can start working things are slower there's no argument that your first server request should start comp uting the hard Parts but with partial pre-rendering that now works alongside the CDN cache previously there was kind of a an either or here where you could cash the first response but now to fill the rest of the page out the client has to parse JavaScript figure out what it needs and then request it from the server with traditional SSR you couldn't send anything from the CDN but you could do all of this data fetching on the first request the result was you had to block the user until that response was generated by the server this is a Best of Both where you can get the dynamic content as fast as the user requested it but you can also give them something else earlier I saw chat message I I think I just clarified this point but is this similar to just loading the data on the client no it's not because for the data to load on the client you have to request it from the client in order to request it from the client you have to load a bunch of JavaScript make other requests parse the JavaScript render the page and then realize what data you need and that whole time your server could be spinning up and generating the response with this model you don't have two round trips the CDN is part of their Edge Network so that same first call starts the server filling in the rest and that one network call has everything coming in at once with the old model you had to wait until the client figured out what it needed before it could start requesting that stuff it's so much better it's not one request wait for the client then the real request it's one request give the client something and then fill the rest in when it's done of course and thank you for the question it makes it easier for me to explain this to people who will be commenting on the video saying they don't get it anyway so hopefully these additional details and pieces help people understand it better yeah let's go through all these points so fast Edge delivery I think cdns a little faster and calling that out it's important but they kind of call it out with the cold start because even an edge has to spin up and start running JavaScript to get a response to the user if you can give them the response before that happens you're no longer blocking on that also the dynamic delivery is really cool being able to stream in content that takes longer no extra round trips fast access to core region databases and apis this is an interesting one because are we going to go into the edge location versus Edge infrastructure thing again we're using Edge for a lot of stuff at upload thing right now because we want our pages to feel fast while using App router but since our databases are in one region we have chosen to limit which Edge locations our code runs into just that one region in US West because of that we have very low cold starts we have Edge SSR but we also have really fast data the catch is now when you're going to our homepage if you're in a different region you're not going to hit a CDN cache in your region you're going to be fetching from this cold started Edge code from us West that's a huge change that now we can Edge route the CDN part that doesn't need to talk to a server but our server part can still be close to our database and Stream in when it's ready this is such a cool Dynamic that gives us a ton of power the other thing they call out here is that they didn't add a new API here this is one battle tested programming model rendering happens in a single react render tree static optimization is on by default and covers all components until the app accesses incoming request information like headers or cookies so if you have a component that checks your cookies before it renders and that component's not under a susp ense that route won't be static it will be dynamic but if you have all of the things that check headers and cookies and all of that underneath suspense boundaries they can static render the outside of it so if you don't want to change anything about how you're building you just want some of the slightly better performance characteristics wrap your whole app in a suspense now you'll get the static shell you'll get all of the CSS JS and embeds and fonts and in that shell a blank page while it's all coming in and all your content will stream in really really powerful you may be thinking we did this in the '90s with server side includes that's true but in the world static and dynamic were separated into completely different technology worlds and we didn't have incremental updates of static content consider the following e-commerce page main head my store shopping cart Banner suspense recommendations new products with PPR enabled this page generates a static shell based on your suspense boundaries the fallback provided to react suspense is pre-rendered suspense fallbacks in the Shell are then replaced with Dynamic content like reading cookies to determine the cart or showing a banner based on the user that type of thing was not possible with older models that would just to be client side code that ran after the static page was served under the hood of partial pre-rendering when you build your application nextjs will pre-render a static shell for each page of your application leaving holes for the dynamic content when a user visits a page fast static shell is served from the end user's nearest Edge region allowing the user to start consuming the page immediately and the client in the server to work in parallel the client can start parsing scripts and stylesheets fonts and all of that while the server is doing its work to render the dynamic content this is basically exactly what I just described I think this is the really cool change here is everything now can happen in parallel Server doesn't block client and client doesn't block server and static doesn't block both you can have a static piece the client gets immediately so the client can start its work the server gets kicked off at the same time starts doing its work and they all come together in the end really really powerful and because partial pre-rendering takes advantage of react suspense boundary you decide whether the boundary is static or dynamic this is a really important piece that I feel like is getting missed you choose where this breakdown happens by using suspense the static shell retains the ability to be updated via is are and if you use features that require Dynamic rendering such as accessing cookies next will automatically switch Dynamic rendering up to the closest suspense boundary this isn't just for app shelves as they said such as in their product detail page almost all the content is part of the static pre-render so things like the Navar the image that's being rendered the product all of that still has to await so it still blocks the first time but since that content doesn't change per user or per request it can be cached and now you can manually invalidate it like let's say you rename the product you're going to have a revalidate call that Updates this URL so it regenerates so the next person to hit it gets the correct page but the goal here was to make it so you get that response as quickly as possible and don't have to worry about it from there and another cool call out here is that this is open to all Frameworks yes NEX supported it before versell did but now that versell does it's part of the build output API so any framework can adopt this and as Ryan carniato said earlier it would be a two line of code change to add this to solid supposedly would like to see that and now he has a place to put it really really cool it's only on the canary version now and you have to turn it on as an experimental feature which means it's going to break turbo on a bunch of other stuff that's call it it's an experimental technology and it's not yet recommended for production use because that's going to stop me sorry verell I can't read regardless this is a really cool major step and as this stabilizes I'm going to be really really hyped and we're certainly going to be using it I also want to show one last example which is my own blog and talk about how partial pre-rendering is hopefully going to make this a lot easier for me so on a blog post the majority of this page is static and in the top top right I have the view count now the way that I am totally covering right now I'll un full screen so you can see right there there's a view count cool way that I've been able to make this page entirely static and use ISR so similar to the pages router model where you would Define a revalidation time for the page is inside of the page so inside of this um Dynamic route here I have a suspense boundary that's wrapping the views component this views component is an async component that goes to my database it fetches the views back and then it renders this view counter now this works but unless over here on the right unless I use this unstable cache function this whole page would run dynamically so not just this component but this entire page would run dynamically and like I said there's just that one component in the top right that's the only thing that requ requires me to run compute so this works but I want to make it easier and be able to have fresh data on every single request I don't even need to use the stal while revalidate pattern here so I just flipped over to a new Branch where I've been experimenting with partial pre-rendering and you'll notice not a lot really changes so on the right rather than wrapping this function with a cache and defining the revalidation time that I want I can just go directly to the database and then on the right again I already set up a suspense boundary so I was already prepared for this change I flipped on the feature flag and then the only difference here is that I'm using no store to opt in nextjs into Dynamic rendering now there's a bunch of different ways you can opt into Dynamic rendering if you're using cookies if you're reading headers if you're setting no store on a fetch directly since I'm going directly to the database using uh an RM I can just use this no store function directly and that's really all it takes now the rest so I like this a lot because I'm I'm sure we've all heard and seen the confusion around caching in the new next Model A lot of the time the solution is to not cash if you don't have to let the CDN cach the page and that's what's been done here since the majority of the page is static content it's coming from a markdown file none of that needs to change and you shouldn't have to think in the context of the rest of the page when you're trying to add this one feature let the page be static let this one isolated component have Dynamic behaviors and even manually call out to the compiler hey don't store the result of this I want this to be dynamic every time of this page is is able to be partially pre-rendered the static shells able to be created and then just the views are able to be streamed in uh when you hit the page so that's all it takes all right so that was a fast run through of all things partial pre-rendering again this is experimental you can upgrade to caner you get the idea I'm hyped on this I'm so hyped on this that I'm starting to move things off of edge because the main reason I used Edge was to make sure we had quick response times from our server without having to eat a lamb to cold star but I don't care if it takes 2 seconds for the page content to come in if the user has something immediately because as I showed with the Ping site it still feels super super fast and when I go to a page it shows up immediately even if the content is under a loading spinner we have one loading spinner and everything Flows In really nice and that's a great experience even if it takes a bit for that cold start to hit so yeah this solved a lot of the problems I had with Lambda and with cold starts my old why I use Edge video is a little out of date now because the main reason I was using Edge is no longer as valid that said I still think it's a great video and if you haven't already watched it I'll pin it in the corner right there for you and if you have or you want to watch something else YouTube thinks you like the video underneath it appreciate you all a ton thank you guys as always peace NS ## Passkeys The Future Of Authentication - 20240718 authentication is hard and passwords are not the best solution we've seen this for decades now the amount of cost and issues that come alongside using passwords as your main authentication solution is just it's just not viable at all thankfully we're starting to see the industry change this we saw the revolution with UB keys we're starting to see biometric off but most importantly we're starting to see a really nice new standard called pass Keys what are pass Keys that's a great question and I'll be honest I don't have a great answer just yet thankfully Channel sponsor clerk wrote an awesome article and decided that it would be a good idea to pay me to all of us about it so yeah this is a sponsored video from clerk that does not mean that the things we say about pasis are false in any way simply that they wrote this information and they want me to share it with youall so let's do it anyways pasis aren't just some new thing that nobody supports yet there's a bunch of places that support and we got Adobe Amazon iCloud bitw and coinbase discourse GitHub Google and a ton more and I'm sure even more will be supporting it over time it's not some weird new thing this is a real option what are P keys and how do they work let's Dive In pass keys are a big step towards a passwordless future allowing users the ability to sign in with their device or biometric data pass Keys provide a streamlined and convenient way of logging into supported services and while convenient they're also very secure thanks to the underlying Tech that makes it possible public key cryptography interested in learning more yes so what are pass keys I have a vague idea I'm assuming it's something similar to like how Tua works with the like Tua codes where it generates something based on the current time stamp plus the key that's saved I'm guessing it's just that but automatic but I could be wrong let's figure out how wrong I am Pas keys are a method of signing into sites and services using cryptographically generated Keys which are often stored on physical devices like a hardware token or a modern Smartphone when a pass key is created for a user account the device that is being registered for the pass key will generate two keys a public key and a private key okay so this is going to be more like ssh in case people aren't familiar I'm going to quickly sketch out how this works we have this box and this box does something specific if you take a shape and you put it through this box out comes a different shape so if we put in the circle then out comes this rhombus every time now imagine you can't see what's on the other side we actually have a big block preventing you from seeing the other side you can still see the box and how it does the transformation but you can only see what came out this is actually a really useful thing because it means I can prove that I'm me by generating a rhombus because I'm the only one that know what's on the other side of the circle and if you put through different shapes through this translator offy skater whatever you want to call this part usually this is doing some crazy math stuff in order to make it so the data gets transformed in a way where you can only go One Direction reasonably so if you have a public key that's the thing that's on the outside here the thing anyone can see but nobody can create because nobody has the other side and then the private key so to speak is the thing that is hidden back here where things get much more interesting is what you can do with these things since we have this key that is some data that has been shared publicly but you can only get this key if you have the private key too or if you've shared it you can't go from here to there so I can't put a rhombus in on one side and put it through and expect to have a circle come out the other side because these Transformations are one way usually the way they do it is some crazy like exponential math where they multiply the numeric value of this by an insane amount and then just take like the first 10 digits or so and now you can't really do anything with that like you can't go backwards unless as people are saying in chat already unless you have a quantum computer now prime numbers yeah shout out Prime I don't fully understand the actual cryptographic means of doing these creations but I generally understand the concept and I don't think it's super important you guys understand the specific methods in the math either just the idea that when you have some algorithm like this you have a private key that's a randomly generated thing through that you can transform it into this piece of data that is to share anyone can have this key and it doesn't matter you're good to go but what you can do with this that's really cool is you can use this to take a piece of data and encrypt it such that only the person on the other side can read it so if I take something like I take the string hello world and you multiply this string by the rhombus or whatever you have as your like symbol so hello world times rhombus and this equals some crazy thing that is useless to you if you were to encrypt this the result would be some crazy string like bunch of stuff that is meaningless to you and if you have this public key you can't divide by it CU again it's not actually multiplying it's doing some crazy factori realization stuff so you can't divide and get this back it's using the prime factors that you need the original numbers for in order to translate this back so now once you've done this transformation when you take some data that you want to protect and then you want to lock it in a way only someone else can unlock pocket you would combine the data you want to protect with that person's public key and now the only way they can prove that it's them and read the stuff that you sent like this is to use their private key to unfurl it so in this case when we're trying to authenticate let's say we have a service for the sake of the sponsorship we'll call this clerk so I want to go into clerk so I'm a user so I will go to Clark and say hey let me in I'm Theo and Clark says oh huh that's Theo I already have this rhombus for Theo I already know this public key but I want to make sure this is actually Theo so I'm going to respond with something what we're going to respond with is some unique string like this is a test to see if it's actually you obviously this text would have to be unique every time you send it back so here we're going to send this back but remember it's been transformed by the rhombus or whatever your public key in this case is so we're not actually sending back this text we're sending back a whole bunch of gibberish again and then use the private key to decrypt it and then send it back to let clerk know hey by the way I am actually me here's proof I was able to unfurl the message that you walked if you want a simpler way of thinking of this and you don't want to care about any of these details which you honestly I understand I kind of fall in that boat public key equals only locks a public key can lock something but it can't unlock the thing private key can unlock so that's the core concept here a public key is something that can only be used to lock some data and the private key is something that you securely store yourself either by remembering it with a password or ideally saving it is a big encrypted thing if you use SSH with Git you already have a private key that is used locally to verify things in a public key that is used on the other side so that they know they're actually you I like the analogy that Angelo just dropped in chat generally speaking public key is username private key is password that's a good enough way to understand this another great way to summarize this is the mixing paint metaphor first Alice and Bob agree on a common color to use as their base then they each choose a secret color paint to mix into it the mixtures can be shared without revealing the colors or the quantity added to anyone who may obtain a sample so Alice and Bob mix the same proportion of their secret color with the received color to both end up with the same color yep so the only way you can take this original color and then get to the color that you want to have is if you know the missing part hopefully that helps summarize what the public and private key are and why they are important back to it so how's this related to pass keys well they're using public and private Keys the pass key itself is a private key on your machine and you give a public key to whatever service that you want to be able to sign into let's see how it actually works from there though these keys are then used to securely sign into the service where the pass key is registered when the user tries to sign in using a pass key the client will request a challenge from the server this is similar to what I was showing in the diagram before where they will send something that you can only use if you have the private key to go to the color analogy CU I actually do like that even though it's a bit harder to wrap your head around initially let's say I have the color yellow and the service has the color red when we combine them it becomes orange the thing the server saves isn't the yellow or the red the red is what clerk has the yellow is what I have orange is what the server saves because the server knows when I combine my color with the server's color the result is orange so now whenever I want to verify that I'm me they send me red and then I combine it with yellow and then I can send them back orange to prove hey look see this has to be me I'm the only one who knows what color should come when you send me this red so that's roughly how it works obviously the encryption lets you do more to make sure people can't fake it and they don't know what color the other one has just from the result but the mixing of the colors makes it harder to know what exact proportions go in kind of works like that but on a much higher mathematical level yeah so as I said here the client then signs this challenge with its private key and then sends it to the server once received the server checks that the signature is valid using the public key okay so it's actually a little bit different instead of trying to decrypt the message that the server sends it's the opposite one other thing you can do when you have a private key is you can verify that you are somebody so if I was to take this message and I was to multiply that by my private key it's not going to lock it and I saw people asking earlier can you lock a message with a private key kind of but what you actually end up doing usually is very different let's say I want to prove it's me and it's me right now hey I'm Theo and it's July 5th 2024 if I want to prove that this is a message I actually wrote I can go through my private key and multiply it and it's almost like stamping the message to say hey here's a stamp attached that proves it is me and you can verify that because it has the signature from my public key and you can look at the public key that I've distributed already you can look at the message and see a signature that only could exist if those two pieces of data are lined up this is how a lot of RSA and basic public key encryption stuff works I can do an example I was going to run locally but I'm lazy and I don't want to do anything SSH locally when I'm streaming because that might leak a key I don't feel like dealing with that so the way this would actually work usually is you take some message like hello this is a test and then you generate a hash like a check sum of that message so that will be a short string that is generated by using that specific function on this specific message then when you have that hash you can sign it using your SSH key and the results going to be something that looks like this this is the unique combination of the private key and the message and it is linked to the actual message you sent because it matches the hash of that message so now you can use SSH to verify that this signature is actually coming from the person who owns that private key and then when you run the SSH verification it will tell you that the key lines up with the public key that you had already saved so that's the the basics it's mathematically complex I'm not pretending it's not but the core concept is you can use a private key to verify who you are either by unlock locking something that was locked with a public key or by signing something with a signature that can only be verified if you have that private key and then externally people can confirm it's actually you by using the public key so those are the two concepts again it's like the public Keys the username the private Keys the password the only way I could make a post on my account is if I have the password but others can confirm it was me on my account because they see the username that made the post it's effectively that but signed mathematically so the way that this is working here is the client is then sending the server something that we signed with one of those signatures that says hey confirming this is us and then they can make sure that that signature matches based on the public key that they've already gotten saved provided the signature is valid the user is then signed into the service without having to enter any information manually so here's the back and forth actually looks quite similar to what I was drawing here so the user hits the server the server sends something back to you which your computer sees and then it creates a signature for it it sends that signed message back to the server the server then verifies it against the key that it has saved and then once once it's confirmed all that goes back to the user you're now let in the use of pass Keys creates a passwordless experience that is both convenient and secure for the user signing into the service I do want to emphasize how bad passwords are there's a great story where Microsoft talked about how much they lose money from passwords finally found the source on this that was annoying to find from estimates from these various studies that were done 25 to 40% of all help desk calls are due to password problems in resets and there was a single month in 2017 where Microsoft had to said 686,000 passwords for employees which cost them $12 million in support that's insane the amount of money it costs to deal with passwords as a business especially considering how insecure they are is kind of insane like holy passwords suck it's it's not like oh passwords are silly it's like oh passwords are very dangerous and there's like a trillion dollar industry like straight up trillions of dollars are spent on people hacking accounts with passwords there are constant breaches like all of the time even when I was researching this I found even more the war on passwords enters a chaotic new phase from wired yeah the transition from traditional logins is getting messy and a lot of this is just because of the level of breaches that are going on like there are so many attacks on passwords there are so many lists of passwords that are just public now like have I been pwned which everyone should have checked ideally a few times by now you put in your email address and it tells you how many breaches they know of that your email and possibly even password have been included in 10 years of breaches and this was in 2021 so it's gotten even worse since yeah the just sheer number of breaches like over 164 million breached accounts on LinkedIn just just so much stuff gets hacked and a lot of that is passwords so because passwords are a fundamentally insecure technology we have to worry about these things constantly anyways hopefully that makes the case why you shouldn't be using passwords for your things if you can avoid it I tend to lean towards just doing oop where you can and then using TFO where you can't also don't use SMS Tua I don't even want to start that rant today but SMS is not a good way to authenticate anything so how does the public crypto work to understand the magic behind P keys is worth understanding how public key cryptography Works public key cryptography works by using a pair of keys in order to securely store sign or transmit data private key can be used to encrypt or decrypt data as well as generate a signature based on that data private key should always be stored securely since anyone who has the private key can also sign in decrypt data again very important that private key you do not want anyone to have access to but yourself as long as it's just you that has access everything's good but the moment that changes things can fall apart usually the best strategy is to actually encrypt your private key with something else as funny as it sounds that we have like these 15 layers of encryption and ausc now it is actually really important to have your SSH key encrypted in a way that you can only access it with something like a password and it sounds terrifying but the value here is that you have that one password that is only ever entered offline on your system and then the thing that is sent out the thing that leaves your computer isn't the password that you used for that SSH key it's not the SSH key either it's the things that you're signing with it so people know that you are actually you that's why this pattern is so powerful also as Angelo points out here you can also protect a security key with a physical security key so if you want to make sure your private key like here s key can only be accessed by you you can actually sign it with a UB key so you can only open it if you have a physical UB key attached to your computer anyways the public key can only be used to encrypt data or to validate a signature from the private key again private key can only lock and verify they can't unlock things the public key can be distributed without risk as its primary utility is to secure Data before sending it to a destination that has the private key because the system uses two different Keys it's also referred to as asymmetric cryptography Yep this is the standard for almost all crypto nowadays a practical use of public key crypto while past keys are relatively new public key crypto has been around since the 1970s and it has a wide number of applications as well as use cases one such application that demonstrates these Concepts well is endtoend encrypted messaging let's say Ava and Brent use a secure chat app to communicate regularly they each have a set of public and private Keys when they first connected Ava would have sent her public key to Brent and Brent would have sent his to Ava when Ava sends a message to Brent her device encrypts the message using Brent's public key and the encrypted data is transmitted over the internet to Brent and this is the important bit because that message is encrypted it can only be opened if you have that private key so it doesn't matter if your connection is encrypted if you're on a VPN if you're on a h or not because anyone could stiff that message and see what you sent and they can't do anything with it cuz it's just that nonsense string until you use the private key to decrypt it when Brent receives the message his device would use his private key to decrypt it before displaying it now let's say Charlotte tries to intercept the messages that Ava is sending to Brent because the messages are encrypted and Charlotte does not have Brent's private key the data being received is unreadable yep so if somebody else tries to steal that message along the way without the key they can't read it nice and simple even though this example uses a chat application to demonstrate how public and private Keys work together the same can be applied to the login process for pass keys so if I send the did they screw that up where it should have been I send in the public key and I keep the private key right I think they just screwed up what is what there get that fixed jaob I see you in chat so how are pass Keys more secure than a username and a password well there's a couple reasons why I already started touching on those let's see what the article has to say first one is convenience which might sound crazy cuz it's like well I have to keep track to that private key that sounds way worse well usually it's not cuz we have good ux around it especially something like the new Pass key standard that we're here to talk about there's often an indirect relationship between how secure something is and how convenient it is pass Keys however have the benefit of being convenient for users to take advantage of by providing a very streamlined experience to signing into a service people tend to gravitate towards solutions that are easier to use combining the high security of public key crypto with the Simplicity of just signing in by tapping a button users of pass Keys get the best of both worlds this also helps solve the ReUse problem which is massive again if your password is being used in four different places and one of them gets breached all of your things are compromised now and this is hilariously common the amount of accounts I used to get when I was a kid just trying to get a cheap Minecraft account that I got because something else was breached and they use the same email and password on multiple Services it's insane let's see some ones in chat if you use the same password for more than one thing be honest y'all ones in chat if you reuse passwords two if you actually don't I'm be honest y'all I'm expecting a lot of ones even lowlevel is reusing passwords in here I need you all to understand how screwed we are as a society there's way too few twos and way too many ones not anymore damn right Gabriel none of my staff are reusing passwords not allowed bait don't disclose good point you have a password that you've used for 15 years that hurts me so deeply that hurts me so deeply oh God ow you trust Google with auto completing oh no oh no oh no it's got the Google Chrome's passwords are a little less scary now but before they weren't even like encrypted they were just a text file that anything could sniff so it's better than it was but please use a password manager like key pass is fine I'm a one password guy but you got plenty of options nowadays please use a password manager then you have one password but it also has a private key that is used to encrypt your vault which has all of your text which has all your passwords in it so without your password plus the key you can't access any of your data so this is the right way to do things because of being set up properly and it has Pass Key support so you can store the pass key in one pass instead of on your computer and now it will auto sign in for you with the Chrome extension it's so nice please use something like that if you can don't reuse passwords as I said here with pass Keys every service automatically gets a unique key pair this means that if one service does lose control of its Secrets any other accounts you have that use pass keys are still secure eliminating the work needed to cycle your passwords in the event of a breach on top of that the thing that the server has Isn't data that's useful anyways when a server has a public key it can't you can't do anything with it already public it's like if a service got exploited and now they have everyone's usernames who cares they're just usernames the fact that you're not giving them a password solves a lot of these problems by itself credential strength one strategy for hacking an account is repeatedly guessing a password until the correct one is discovered this is known as brute forcing and password length is often the biggest determining Factor on how realistic it is to brute force a password the longer the password the less chance it can be guessed it's not just longer by the way a lot of these brute forcing attempts aren't just trying random characters they're usually dictionary attacks and as unintuitive as it might sound you can work around that too one of the things I highly recommend I think there's an XKCD about this people like to think that these really randomized passwords are good but when you have common substitutions and punctuation and all these types of things you're just making it harder to memorize but if you're brute forcing that it's going to be guessed relatively quickly still and then you're going to struggle to remember it too who whose passwords in chat look look like this let's see some ones in chat if your password looks like this type of nonsense where you're replacing letters with numbers and ones in chat for you numbers instead of letters people I feel better that there's a lot fewer of y'all doing that that that gives me some hope that gives me a bit of Hope absolutely never okay cool past phras is greater than complex password spoiling it you don't know your passwords good answer I don't know my passwords either okay I know one of them but only one of them so the best way if you're actually writing a password this is a good thing to use for your one password if you're using a service like that random words you put like an underscore or a dash between one or two of these now that you have four random common words the amount of time it's going to take to Guess that if you're guessing without using a dictionary you're just guessing letters is insane this is why dictionary attacks are now the norm because it's really hard to to beat this out but even then like four unique words without the knowledge that those four unique words are being used cuz the only way you could reasonably brot forces if you know if the person's only using dictionary words and you have the same dictionary they used but if you could use a word that's not a dictionary like a name or a brand or a proper noun or something that you can memorize like I found this by Google searching correct horse battery staple because it's very memorable and if you something that's memorable that is also unique like a true proper unique sentence type thing you're going to be very safe and as crazy as it seems correct horse battery Staples actually a much better password word then whatever the hell that is yeah as long as you separate people are saying separate by random characters I agree if you separate that by random characters you're very very safe hey don't don't share my password don't share my password in chat anyways a 16 character or bite password is good but a pass key a 100 to 1400 bytes which is significantly better also built-in multiactor authentication MFA if you don't know is checking in multiple ways that somebody is actually them the most common one is I sign in with my username and password and then Google or someone says hey are you actually you we're going to text you something to confirm that you're actually you and you get the text you get a little code and then you enter the code and now they know it's you it's multiactor because the password was one factor and that code you entered is another Factor two factor means there are at least two things needed to verify that you are you I do a thing that many consider controversial I store my TWA codes as in like the application twoof Factor stuff that will generate a code for you on the Fly I store those inside of one password which might sound terrible cuz now oh you only need the one password and then it's going to fill all the data in for you you've just ruined TAA no you haven't because you can only get in my one password if you have the key for my one password and the password for it without those two things you can't get into my one password so it's still twoof factor I just cashed one of those factors on my machine that said it's super important to have something like that so just one string leaking isn't enough to ruin your life especially if it's a short string especially now that we're getting in the days where like supposedly there's AI that that can figure out what you typed based on the sound that shit's terrifying so having just one thing be enough to exploit you that don't work anymore you need at least two things locking your accounts if you want those things to be secure and things like pass Keys make that much easier as they say some common factors used are things that you know something you have or something that you specifically are so Biometrics would be a twofa method or a multiactor authentication method if I can scan my eyes and enter a password there's two things that makes it exponentially harder to get into my account for instance if you sign into a service with a username and password those are considered a single Factor since you know both of those pieces of data and one of them is also often public adding an authenticator app or a hardware token as an additional Factor since it utilizes something that you have with pass Keys MFA is built in the device along with the public or private key pair that it's generating is one factor and since Biometrics data is often used to unlock the device that's a second Factor yep since the pass key on my machine you can only get to it via something like biometric off that's now locked away and then that's used other places I I will say it's a little sketchy because once you've done the biometric off you're now in the machine you have access to everything in the machine but that falls under the same thing the one password example I gave earlier did so we're going to justify it eliminate fishing attempts oh boy this is a really fun one too since there's a public key often there will even be a unique public key to that specific service if another service pretends to be that first service they can't really fake that the same way if you go to a site with https and then you have your like DNS sniffed and somebody's trying to redirect you somewhere else the um open SSL key that you save when you go to the site will confirm hey you're going to a site that isn't the one you think it is by the way just so you know oh apparently biometric or pasis ask for Biometrics every time they're used that makes sense especially on Mac because they have the secure Enclave which is a special chip that you can only get into with Biometrics so that makes more sense but again fishing means sending somebody a page that looks like another service but isn't so if I have my public key in Google and then I go to fake Google and I sign in they're not getting any of the dat that they would need to sign into my Google account they're just getting the signature response to whatever request they made to me there so it's effectively impossible for me to sign in with some data to Google and have them get into another account it's significantly better yeah the armed trust zone is insane absolutely that's the fact that there are now things in your processor that are secured so you have data that's only accessible under specific conditions makes these types of things significantly safer most Arm based processors have this now which is dope it's the thing that Windows is still catching up on because x86 despite having far too much support for far too much didn't do this and yes shout out Apple for normalizing these things you can absolutely beat Google I'm you know what I'm going to take a minute to about Google because I'm actually quite annoyed I have a very good twofa setup going with one password I have a lot of Google accounts because I run multiple companies and I have different Google accounts for each one Google's multiactor authentication requires that it notifies the app by default even though I have a tua code app thing set up so even though I have all the data I need to sign in when I try to sign into to Google it will then send to my phone a confirmation even though I might not even have my phone in the same room I just want to use the key that I have in my one password but it won't let me until I manually click like three additional buttons and there's no way to change the default on Google they do not let you do it I have been complaining about this for forever they do not let you do it it's obnoxious anyways if you have multiple options for your authentication methods let the user pick which one I'm okay with mandating two Factor authentication but let them pick which factors they want to use and if they can use multiple let them pick which one's the default because that's what Google got really wrong here Google has everything right except for that I can't remove the phone off because it breaks other things like the verification of my YouTube channel so I can't just do that the trust me I am more experienced in Saving a Google account than anybody in this chat there is no way to change the default without putting my account at risk in multiple people's livelihoods please I I rarely appeal to just trust me bro just trust me bro Google does not make it viable to pick a better default they do not let you do it period so is the article says if you are being fished with a password thing you can get for example a user might receive an email that appears to be from Amazon stating that they're going to place an order that was never approved and tell them they can manage it using the link embedded below you see that big fake check orders button on this fake email you click it the domain might be something that looks like amazon.com like anazon.com you don't even notice and now you're signing into something and you're just handing them credentials that you don't intend to give them really sketchy really problematic got to be careful about these things since that domain looks close you end up blindly giving them the credentials yep you don't click on email links almost ever type them out yourself since the pass key generated on a device in that pass key specific to The Domain for which that it was created this removes fishing as an attack Vector entirely again they can't possibly get you to sign a request for Google they can only get you to sign a request for their fake domain like everyone's favorite Googy any ltic so you're safe the password only works on that site that's the way to think about it instead of you have a password that can be used multiple places every site has its own generated password saved on your computer because of that things can't get compromised the same way these attack vectors are just gone it's a really really nice win yeah this also includes domain names that include non-standard characters that appear to look the same important detail Google and googi are different so if you go to both and you even sign in properly on both those are now two different passwords that are autogenerated through the pass key system which is really nice and of course clerk supports pass Keys that's why they wrote this article that's why they're sponsoring me to talk about it because this is not an easy thing to set up yourself and clerk just makes it work automatically passies are officially supported authentication method for services secured with clerk you can enable them just like you would any other login method for your users you just go to your settings and now you can enable pass Keys super nice once enabled your users can add pass Keys through their user profile yep and then once you signed in they presented with that option when they're doing the signin super super easy and I cannot think about how I would be setting this up otherwise because these types of things aren't fun to do I love pasis I'm going to start using them much more now that I understand the core of it that it's just basic public key signing and saving it in your secure Enclave that'll make sense to me I'm feeling great about this we got a handy demo from Gabriel we got to try this quick so what is a pass key it's a new way to sign in yep cool let's try it sign in with a pass key oh no anyone can see this right now can scan the QR code with the device that has the pass key that I want to use for the site or I can use as a USB security key instead what I'm going to do register Pass Key here we go see that the pass key is now using the standard browser API and it will save that in my one password in this case my ping one password so now that is saved in one pass pass and now I can use this Pass key on any of my devices because it's not the device saving it it's one pass this is a different place to securely store it but you have options because it's a standard and that's what's really cool about this this isn't just like oh Apple's trying to take over authentication this is a new standard for doing off well and safely let me know what you guys think and please please stop reusing your passwords peace ## Passwords Are Bad #shorts - 20220825 we need to talk about passwords i find that we reach the passwords as a default when they're actually more of a curse everybody from like microsoft to the medical world are realizing that passwords are an incredibly insecure and convenient way to do things so super quick passwords suck because of people more than anything people forget their passwords people steal passwords people lose passwords people pick bad passwords passwords they reuse passwords and then another service gets compromised and you're screwed on your side too people make passwords bad because of that you should not be using them if you can avoid them your application's only as secure as your weakest link try to not make that link your users and certainly don't let it be their memory that's not going to work well ## Perfect code is BAD - 20220613 perfect code is bad as a company and as a ceo and a boss perfect code is bad and kind of scares me because it means you spent too much time on the thing it's your job to deliver to users not to engineers and as such delivering perfect code all the time is actually at business cost more often than not because all code kind of sucks it's better to write code in a way where you can replace it fast if it doesn't work then so it's perfect the first time and then you realize that the thing you were building it for was wrong in the first place like code is cheap perfect code is insanely expensive it should be our goal to get as close as possible without incurring the cost ## Phoenix LiveView Is Making Me Reconsider React... - 20240513 Jesus Christ that is a server deployment Hut swapping the serers side code and automatically updating the HTML the user has on their existing page oh boy this is going to be a fun one the main reason we're here isn't actually Elixir or even live view something different it's Json specifically it's how much we hate Json it's not the right way for servers to tell clients what they should do or most importantly what they should look like like and we've realized this with everything from HTM X to react server components that the server should do a little bit more to tell the client how the UI should look and also how to change that appearance over time we realized this as well in The Elixir World which if you're not already familiar was very similar to the Ruby world with Ruby and rails we had elixir in Phoenix which very similar in design but with Phoenix we needed a way to not just send an HTML template but update it as the user interacted for a while the solution was just embedding react and sending Json back and forth but that wasn't great as a result we went through some chaos inventing new Solutions one that I used for a while was plug which is still part of Phoenix to this day and had the ability to upgrade to a websocket connection so you could send updates via websocket to change the contents of the page really cool stuff but what we're here to talk about today is a lot further and also took a lot of time I was shipping the plug stuff that I just mentioned in 2017 but I had been hearing Rumblings of some new developments at the time live view had just started in early 2018 and the progress I've made since in the last 6 years is not resulting in a final after so long 1.0 release what the hell is live view why do we want this what are we even talking about don't worry we'll break it all down I will say though this this marketing speak is something I wholeheartedly believe with Elixir you start shipping features that other platforms can't even conceive as possible the power of beam yall are going to hopefully get something good out of this even if you're not already an Elixir user or nerdy about it I'll do my best to distill the cool lessons here such that we can all benefit from them live view 1.0 rc0 is out this 1.0 Milestone comes almost 6 years after the first live view commit make it so October 18th 2018 okay not early 2018 but I swear I remember this being referenced a lot earlier on regardless why live view I started live view to scratch and itch I wanted to create Dynamic server rendered apps without writing JavaScript I was tired of the inevitable ballooning complexity that it always brings yeah client JS isn't the worst but I understand wanting to avoid it most other Solutions were saying oh we'll just use WM and we'll throw rust in the browser to do all the updates and we've seen how that works nobody's using it to this day live you went a different approach it was trying to transport data in a different way to and from the client think real-time form validations updating the quantity in a shopping cart or real-time streaming updates why does this require Moving Mountains to solve in a traditional stack this is something a lot of the Old Guard doesn't acknowledge all of the people who love to shout that rails is totally fine pretend that these problems either aren't real or aren't worth solving and I see this so much like one of the email clients that I won't say the name of that is written in rails might seem great if you live near the servers it's hosting but as soon as you go somewhere else your experience sucks and it doesn't do any of these types of things it doesn't do validation of any meaningful form but we expect this now for modern web applications if everything's on the server it's not easy to do that properly and I'm thankful that the Phoenix Community unlike those other communities doesn't just acknowledge this but works hard to solve it so this is how the solution used to work is what I'm assuming right talk about we would write the HTTP glue or graphql schemas and resolvers then we figure out which validation logic needs to be shared or duplicated it goes on and on from there how do we get localization info to the client what data serializers do we need how do we wire up websockets and IPC back to our code is our JS bundle going to get too large I guess it's time to start turning the webpacker parcel knobs wait vza thing now oh I guess bun configuration is what we want we've all felt this pain I like this part I like the fact that we're making a lot of progress in the web world I get it though if you're just trying to ship and you don't want to look for new Solutions you just want to get something out I can totally understand why this is frustrating the idea was what if we remove these problems entirely HTTP can go away and the server can handle all of the rendering and dynamic update concerns it feels like a heavy approach but I knew Elixir and Phoenix were perfectly suited for it bold but exciting 6 years later this programming model still feels like cheating everything is super fast payloads are tiny latency is Best in Class not only do you write less code there's simply less to think about when writing features this sound familiar if you're not already familiar with intercooler it's it's the original version of HTM X same project same people this is an article from their old website I've already done a video about this but I wanted to highlight this part cuz it's very similar to the mindset that we're seeing with live view in an ideal world you would give your UI devs everything they could possibly need to build their UI efficiently and open an expressive query layer that would let them tune their structure and return the data of a query just so for those hot complicated queries that always end up dominating performance what if I told you that the place exists already where you can do this such a place does exist it's called the server side the whole point with this article is to point out that if you just do everything on the server and send the result to the client instead of building an API so the client can turn the data into UI itself makes everything much more secure much simpler to work with and more trusted it's just it solves so many problems if you can move more logic to the server everything gets easier and it's not just like your clients can be Dumber apps or performance is better for low-end phones and it's certainly not the other side people love to complain about of isn't it so expensive to render that react on the server instead of the client no n that is the thing that matters here it's the Simplicity of the model by moving so much State and problem space out of the client which you don't own you might have built it but they could be on an old version they could have a bad internet connection there could be so many things that keep you from really controlling that by moving this logic to the server life gets better and if you can do this you almost always should anyways let's hear more about how Phoenix and live you are doing this realtime foundations unlock superpowers interesting things happen when you give every user and UI a realtime bidirectional Foundation as a matter of of course you suddenly have superpowers you almost don't notice it being freed from all the mundane concerns of typical full stack Dev lets you focus on just shipping features and with Elixir you start shipping features much faster than any other platforms could even conceive as possible yeah as the typescript guy that hasn't shipped much elixir for the last 6 years I still long for this it has some magical stuff want to ship real-time server logs to the JS console in Dev no problem look at that we're getting all of that what about supporting production hot code upgrades when browsers can Auto rerender anytime CSS stylesheets images or templates change without losing state or dropping connections here's the terminal we're deploying this on fly we have this page already open and it changes the CSS and changes the title on the page just deploying the new release is enough to send a websocket update to the page with the new content that's insane that's actually insane like like for context to see how versell solved this they went the other direction versel solution is skew protection where when you deploy a new back end they keep the old one around so that people who are on the old client can hit the old backend which is insane I think this is a great solution for the problem that exists with the modern server client relationship but what Elixir is doing is so much cooler because you can swap the code running while it's running because Elixir is running in a virtual machine so rather than taking down the server and deploying a new one or rerouting traffic to a new server you just change the code that's running in the existing instance guaranteeing nothing falls out of sync skew reduction guarantees it the other way by making sure the client always has a server version that's accurate this allows you to update the server's code without updating the server itself and then push any changes to the client as needed Insanity so cool or maybe you have an app deployed Planet wide where you do work across the cluster and aggregate the results in real time back to the UI would you believe the entire live view including the template markup and RPC calls is 350 lines of code oh cool there sound here let's let's give this a quick play don't do it starting browser awesome so what's happening here like we're provisioning a machine we're running your whole app there we're starting the app loading page loading page loading page it booted headless Chrome it's running the web page we're sending messages back as this is happening and this just did this across the world like what like really like yeah so so this is what flame enables for us right super super cool stuff let's take a look at the code quick so we can emphasize just how absurdly dope this is here's the page speed live test code so we have this template this is their Syntax for HTML templating in your editor this looks a lot better I promise probably the biggest negative with something like using Elixir is that your experience deep in like GitHub and such isn't going to have as good of like syntax highlighting and things just because it's not as popular it's a very small thing but notable when you're doing a lot of code reviews also you might have noticed the Elixir Community big fans of Tailwind some of the heaviest Tailwind users I know come from The Elixir world so this part will at least look familiar for us Tailwind devs this is really cool where if if there is no ref then we use padding 36 and uh padding top 48 cuz this is for if we're putting like the empty state I'm assuming otherwise it's py6 XL py2 in here we have a world page speed test title you get all of this all this code is just HTML markup none of that's the interesting part this is where things get interesting Mount we have the default URL and we have the socket so we take the socket we assign the URI for this and we bind it to a specific spe form we stream the results down and we do it with the specific IDs because we're updating these specific IDs timing Das specific region and we stream the timings over and then this is the Syntax for for a response being okay that makes it easier to handle errors in this language then we have the simulate result code where we create the timings array which has all of the browser. timing uh statuses within it we assign this list to the form again and then we stream the results handle event this is also if you're not familiar with Elixir and pattern matching part of the magic of Elixir is you can Define the same function with the same number of arguments multiple times but you match it in the argument based on condition so this handle event gets called when the first argument is the string reset this one gets called if the first argument is validate this one gets called if the first argument is go and this one gets called if the first argument is the constant of timing and then this one is the generic if we still have a loading constant in the next object and we have almost certainly a catch all of some form and if we don't then we're expecting everything to go through and fall into this handle info which is the error case but this is part of the magic of Elixir is you just write the same function and Define the specific patterns you want to match with that function instantiation these overloading patterns are so cool and I've yet to experience a day where I don't miss these some amount so cool we can see if we have the loading State then we stream an insert for the timings for that this syntax I'm not necessarily sure what it's supposed to be so I will skip that for now I think this is just sending the different results depending on the different loading States and we ensure the URL has a protocol and a default to http if we forgot to put one in cool then this actually does all of the timing and validates the URL here is where we actually load in flame which lets you spin up separate instances it's a cool thing they're doing over at fly and now these are going to go spin out do timings send the requests load the page and then if it succeeds we're going to send back up to where we are right now which is this instance the timing from that result so this lets us run all of our tests and all of our checks to get the page load times on a separate server entirely without blocking this one and then send the results back all possible because Elixir virtual machine handles networking insanely well here we have the status text which is just the different cases isn't this so cool status tax is a function that this is effectively like a big switch statement that says if the status is loading we show loading page if status is a waiting or session we do starting browser if it's Error fail to load or then we get the stat then we can print out that stat and say complete this is such a cool syntax it's I love it yeah the results all make a lot of sense you can also see in here that we have little conditionals like if timing transfer bytes is greater than zero then we render this and if we don't have this if pass it doesn't get rendered there's a lot of these little syntactical things in here that don't take too long to learn but are important to know if you're looking stuff like this super cool stuff I love that they shared this code I think it's a really compelling example there was a lot to solve to make this programming model truly great as someone who consumed it very early I agree how it started CU actually what I really wanted is something like what we do in react change some State our template R renders automatically in the UI updates but instead of a bit of UI running on the client what if we ran it on the server the live view could look like this here we have div ID thermostat temperature is bound to the thermostat temperature variable mode is bound to thermostat mode then we have the increment and decrement buttons now on Mount thermostat is thermocontrol doget thermostat okay thermocontrol do subscribe and if it's not okay we would throw here and then okay assign socket thermostat thermostat dope def handle info this is when new thermostat information comes in because this is on Mount getting this Thermo control to bind to this instance and we want this to send updates when things change so the handle info is where those updates go and we can do what we want here in this case we're going to assign the socket to the new thermostat information so this gets sent down to the socket and we have the handle event where we can increment in this case because we bound the uh PHX click to Ink which means that when you click this it's going to call handle event with Inc as the first key with thermostats thermocontrol do increment socket assigns thermostat super simple and you can immediately see how quickly decrement would make a lot of sense here too like react we have a render function and something that sets our initial State when the live view mounts when State changes we call render with the new state in the UI is updated interactions like PHX click on the plus or minus button can be sent as rpcs from client to server and the server can respond with a fresh page of HTML these client server messages use Phoenix channels which scale to millions of connections per server can confirm Phoenix channels scale insanely well likewise if the server wants to send an update to the client such as another user changing the thermostat the client can listen for it and replace the page HTML in the same fashion my naive first pass on the Phoenix live .js client looked something like this we have the document query selector we have the channel that we're getting a socket for from the server channel. join and then when we receive okay we just update the HTML channel.on update HTML main. HTML HTML then we add an event listener when we click on something that has a PHX click attribute we push this event up to the server and eventually we'll get a response and we use that response to update the HTML super super simple this is a super minimal implementation that I can fully understand how it works really cool that they publish that in here this is how live view started we went to the server for interactions rendered the entire template on state change and sent the entire page down to the client client then swapped out the inner HTML it worked but it was not great partial State changes required re-executing the entire template and sending down gobs of HTML for otherwise tiny updates no way other modern Frameworks do that still right right I'm in pain still the basic programming model was exactly what I wanted as HTTP fell away from my concerns entire layers of full stock considerations disappeared HTTP is such a St I don't know why it's used for everything next the challenge is we're making something that is truly great little did we know we'd accident our way to outperforming many Spa use cases along the way yeah how we optimized the programming model live Ed diffing engine solved two problems with a single mechanism the first problem was only executing those Dynamic parts of a template that actually change from a previous render the second was only sending the minimal data necessary to update the client it solves both by splitting the template into static and dynamic Parts consider the following live view template okay I have to jump on this it seems like we're all realizing this that having one HTML file is not the right solution to a lot of the problems we have on the web a page like this might have this top nav be static but the content of the blog might be dynamic maybe the blog is static but the how recently it was posted is dynamic or the comment section is dynamic how do we have a partial template where we have HTML that represents everything that is always true but then have pieces within it that aren't and what if we have a dynamic piece that has a static piece inside of it how do we structure all of this with react the new model is server components and client components where the server components the static templ part and the client components are the dynamic changing at runtime part in Elixir they're doing this a little differently consider the following live view template P class is at mode temperature format unit Etc cool at compile time we convert the template into a struct as follows we have the static part which is the P class temperature colon Etc we have the dynamic part which if changed assign mode do assigns mode if changed assigns temperature do format unit assigns temperature interesting we know the static part never change so they are split from the dynamic Elixir Expressions next we compile each expression with change tracking based on the variables accessed within each expression on render We compare the previous template values with the new and only execute the template expression if the value has changed this is like quick but good and it's solving real problems instead of setting the entire template down on change we can send the client all of the static and dynamic Parts on Mount after Mount we only send the partial diff of dynamic values for each update to see how it works we can imagine the following payload being sent on Mount for the template above we have S which is static P class is the temperature p and we have Dynamic value of cooling and 68° fhe and the reason these are replaced where they are is because the separations of the array are where these go so you insert between index 0 and one Dynamic value 0o and you insert between one and two Dynamic value one where this gets iffy is if you have nested Dynamic values I'm sure they have a good solution though the client receives a map of static values in the S key and dynamic values keyed by their index in the Statics for the client to render the full template string it only needs to zip the static list with the dynamic values yeah you get the idea you just zip it in between the spots with a client holding a static and dynamic cache optimizing Network updates is no work at all any server render following the mount simply Returns the dynamic values at their known index unchanged Dynamic values and static values are ignored entirely if a live view runs a sign like here with socket temperature 70 the render function is invoked and the following payload gets sent down to the wire that's so nice somebody said in chat and I love that this is the world's best zip case so far totally agree to update the UI the client simply merges this object with a static and dynamic cache cool so this gets thrown in here and updates the UI accordingly then the data is zipped together on the client to produce the full HTML of the UI of course inter HTML updates Blow Away UI State and are expensive to perform so like any client side framework we compute minimal Dom diffs to efficiently update the Dom in fact we've had vks migrate from react to Phoenix live view because live view client rendering was faster than what their react app could offer very interesting I might have to listen to that podcast in a bit regard it's kind of crazy but also cool they had to implement their own virtual Dom in order to trigger the right updates in the right places optimizations continued from there including fingerprinting for comprehensions tree shaking and more you can read all about this optimizations on the dash bit blog good we apply these optimizations automatically and for free thanks to our stateful client and Server Connection most other server rer HTML Solutions send the whole fragment on every update or they require users to fine-tune updates by hand this is even more true in the Ruby world where their solution to client side navigation experience was a thing called turbo and turbo just loads the whole HTML page when you make changes and then client side swaps out the HTML breaking a ton of almost every time it's why navigating GitHub still feels like to this day this is not a real solution and I'm pumped that they ackn not only acknowledge that but went out of their way to work Beyond it best-in-class latency we've seen how live view payloads are smaller than the best handwritten Json apis or graphql queries but it's even better than that I I want to double down this part before we go further though everyone seems to think sending HTML is somehow less efficient than sending Json or graphql calls I promise you almost every Json call or graphql call is both fetching way more data than it needs and is not structured in a way that's optimal for what the UI actually wants in the end I don't need all of the info about a user in order to render a username I just want the username and if the API endpoint gives me all this additional data it's useless to me well it's useful cuz I have the data I need but it's going to take way more bandwidth and way more time and resources to actually get that to my client what if you could send just the name not even the key like username colon name just the name just the thing that's being updated often just sending the HTML ends up being significantly more efficient than building these apis and it's not surprising that they discovered this as well apparently it goes further though which I'm excited to hear about every live view holds a connection to the server so page navigation happens via live navigation TLS handshakes current user off Etc happen a single time for the lifetime of the users visit this a really good point I mentioned earlier that people complaining about server components because of the server costs made no sense one of the main reasons why is authentication let's say I have a web page that has a few parts we have a topnav this topnav has like your user icon if you're signed in we have a sidebar and the sidebar is generated content based on your user profile or it's generic content if you're not signed in and then we have a feed and in this feed we have some content and this content is specific to the person who wrote it username so we'll put this under here in order for you to load this page you would need to get the data for this topn thing you need to get the data for the sidebar you need to get the data for this content section if I did all of this on client side I'd be making multiple API requests so we'll say that this one is sluser slet profile or something so this one we have to get the profile to render this we have the side naav which we'll say is SL user SLG get recommendations we'll say and then we have the request here which is SL user SLG get we even say get permissions we'll say that this content might not be renderable unless you're authenticated and we would want to load something else if you're not all of these are different requests that we would need the ability to make independently because if I navigate I don't need to fetch the profile again in order to fetch the snav a lot of people are going to look at this and be like oh yeah just make one API endpoint that returns everything but now when I navigate I have to fetch everything but when I'm loading this page I just want these pieces of data so what most places do is they use something like graphql to make all of these calls for them the issue here I made this example very specifically to Showcase this is each of these endpoints needs to authenticate the user so loading this page requires authenticating the user three separate times so your off service good luck that off service is going to be getting a ton of traffic just to load the page if loading one page requires three to n requests to your off server you're and you can't just skip that either because if you skip the O check then you might be exposing a data that you don't mean to so every single endpoint you expose has to authenticate which means every single one of these being hit per render has to reauthenticate with server components a lot of this goes away because you stream the content in so you can do one oth call stream the initial response and then stream the rest in over time which makes things significantly less painful which often also results in the server cost being way lower because the io on top of all of these pieces as well not just the oth but the dealing with the request generating a response handling the parallel nature of all of these things connecting to your database if you have to do database connections parsing and validating the input making sure it's from a region that you're actually like willing to return traffic from the amount of you have to do on every single request that your page makes is absurd so if you can lower the number of requests your page is making things get a lot better and one of the best ways to do that is serve everything through one request either by giving it to you immediately when you load the page or streaming it over time and the way server components does this is you get the First Response as quick as possible and the rest streams down as you get more and more responses as more and more of the content is generated The Way Phoenix handles this is just keeping you in a websocket connection where they've already authenticated your instance really cool stuff this allows page navigation to happen via a single websocket frame in fewer database queries for any client action yes it's so nice having a community that isn't the react World explaining why this matters because I feel like when I talk to most backend developers about this my brain's about to fall out because they don't seem to understand the fact that your service is getting 10 times the requests it needs if we just slightly adjust the relationship between the client in the server this should be the default and the fact that it isn't is a thing that shouldn't be contentious we we should feel slightly ashamed that this isn't how we're doing all of these things the result is fewer round trips from the client and simply less work done by the server this whole paragraph by the way could just be about Surfer components it's great the only difference is that this is for the lifetime of a user's visit versus is the the page load because the next navigation we're going to have this problem again in elixir in in the Phoenix live view world is just one instance in matter how much navigation you do you're good so cool holding a stateful connection comes at the cost of server memory but it's far cheaper than folks expect again Fair Point since we're maintaining a connection between the server and the client now we have to worry about the fact that the server and the client are scaling in this way where the server if the client is left open the server now has to me manage that in memory it's a realistic concern let's hear why we don't have to worry at a baseline given a channel connection consumes about 40 kiloby of memory that gives a 1 gig server a theoretical ceiling of 25,000 concurrent live views of course the more state that you store the more memory you consume but you only hold on to the state that you need we also have stream Primitives for handling large collections without impacting memory Elixir and the earling VM were designed for this scaling a stateful system to millions of concurrent users isn't theoretical we do it all the time see WhatsApp Discord our own benchmarks as well as examples this is very true I will say 25,000 users per gig of server memory isn't great but is a fine starting point if this was in any other language I would be much more concerned but Elixir and the power of the beam VM is insane it's like it's a dumb simple example but you can share a name space across servers in Elixir and llang because the llang VM is so powerful on the networking side that I can just call a process from another server it's RPC but it's RPC that's so deeply baked into the virtual layer that you don't think about it you just do it it's like the opposite of serverless but it comes with a lot of the same benefits like I would never want to scale A system that wasn't either written via entirely serverless patterns like Lambda or was written on top of the earling OTP in the beam VM another language that's similar to this if you want if for some reason the functional patterns that you're seeing here aren't your thing gleam is another language built on top of the earling OTP so you get all of these same benefits just in a slightly different syntax super cool stuff it is similar to Elixir for sure very inspired but they are different languages pump that it exists check out my video on that if you're curious with the programming model optimized on both client and server we expanded into higher level building blocks to take advantage of our unique diffing engine oh boy reusable components with aex this was such a paino when I was using this components were not really a thing in uh The Elixir HTML syntax change tracking in minimal diffs were groundbreaking features but our HTML templates still lacked composability the self-awareness why can't imagine a world where more of the like backend devs building these types of tools actually understood the way that developers worked now this is the first time I've seen a backend heavy thing that isn't written in JavaScript acknowledge the value of composability inside of react components they love to pretend it doesn't matter they really love to pretend it doesn't matter or just ignore it and here we are with like real server Focus developers building a real server side framework not just acknowledging but desperately seeking to replicate the benefits that we experience in the react World every day this is so cool I know I've been saying this and hinting at it throughout but I I have so much respect for The Elixir team for not like not pretending that their doesn't stink for looking across the world seeing how these problems are being solved in other places and using those solutions to better themselves rather than pretending that they're not actually good there there is this is whatever the opposite of old man yells at Cloud is and it's so nice to see it's such a I just feel a sense of relief as I'm reading this the best we could offer is partial like template rendering where a function could encapsulate some partial template content the number of people who have pretended that this is the same thing as components thank you for calling out the difference this works but it composes poorly and is mismatched in the way that we actually write markup fortunately Marlo or Sarina SAA fortunately marus from the surface project spearheaded development of an HTML aware component system and contributed it back to the live view project with h eex components we have a declarative component system HTML validation and compile time checking of component rutes and Slots heex components are just annotated functions they look like the following the def button H button type is at type class rounded yep again well the Tailwind Tailwind works really well with composable component systems and we have the render slot which is what we're rendering inside of it we Define all of these attributes ahead to type string default nil rest Global include disabled form name values slot inner block require true so this means you have to pass it in inner block value and if you don't then it doesn't render good stuff button send button PHX cool I think they're using the dot here as their Syntax for calling a component instead an invalid call to a component like button click equals bad produces a compil Time warning warning undefined attribute click for component app web core components button really nice also generally the errors in Elixir are really good to the point where I didn't feel a strong need for type systems at the time obviously would benefit a lot since but uh yeah slots allow the component to accept arbitrary content from a caller this allows components to be much more extensible by the caller without creating a bunch of bespoke partial templates to handle every scenario yeah really nice don't want to go too deep into this next part but if you're interested definitely check it out they let you spit inside of your actual code here like your HTML comments that tell you which files in your code base this was generated by to make debugging much easier I just filmed a video where I complained a lot about next not having good enough Dev tools for debugging the server client relationship this is a really beautiful hack just dump in the HTML where it came from when you have the debug flag set this is super handy I would use the out of this that's really cool that they're thinking to throw that in here if you find the above hard to navigate you can use the new phoenix. live reloader features that have your editor jumped to an element's nearest collar or definition file line when clicked with a special key sequence of your choosing let's take a look quick cool that's really cool you can just click the button and it will bring you where in the code base it was rendered these things are so hard to set up properly the fact that did is nuts also cuz he's using Vim here if I recall Chris is a big Vim guy so having that work there that's nuts then again is a Vim user really going to use their Mouse interactive uploads okay are we competing now s we should chat I would love to get upload things support in live view and just in the Phoenix Elixir ecosystem as a whole a few years ago live VI tackled the file upload problem something that should be easy has historically been unnecessarily difficult woo why is this just like this feels like I wrote it 5 years in the future it's very strange this is like an alternative timeline for me and I'm we wanted a single abstraction for interactive uploads both for direct to cloud and direct to server use cases with a few lines of server code you can have file uploads with drag and drop file progress selection pruning file previews and more more recently we defined an upload writer Behavior this gives you access to the raw upload stream as it's being chunked by the client this let you do things like stream uploads to a different server or transcode a video as it's being uploaded wo since the uploads happen over the existing live view connection reflecting the upload progress or Advanced file operations becomes trivial to implement that's hilarious to me because making file progress has been it's been walking us from react native for a while because the existing bindings for react native and put don't give us the loading states that we need they're just broken it's hilarious how hard these things were to do pre-sign Post has helped a lot as Josh just mentioned in chat before presign post uploading to the server was so ass yeah it was the worst it still sucks but it was even worse before somehow super cool to see them making this that easy streams in async following uploads we ship to streams primitive for efficiently handling large collections without needing to hold those collections in server memory so you have an expensive operation that calls out to an external service the result can be latent or spotty or both your live view can use assign async to offload this operation to a new process and async result to render the result with each loading success or failure State that's really cool this is like suspense and react for those who are familiar with the new model in this case we have the async result when it's loading we render that when it fails we render this and then we have the catch all or not the catch all but the final correct case where we just dump the org name once it comes in now instead of worrying about an async task crashing the UI or carefully monitoring async Ops while updating the template with a bunch of conditionals you have a single abstraction for performing the work and rendering the result as soon as the live view disconnects the async processes are all cleaned up ensuring no wasted resources go to uis that are no longer around that's another cool benefit of the websocket that I had really thought of is you know once they disconnect that you can kill whatever was going on based on their process and the way Elixir and uh orl specifically isolate processes that makes a ton of sense for so cool it feels so reacy live view goes mainstream did not think I would see the word net in here let's see why they put it live view and net Blazer both started about the same time I like to think both projects help spearhead the adoption of this programming model since getting started the model has been embraced in various ways in the go Russ Java PHP JavaScript Ruby and hascal communities are there hascal communities for web stuff interesting most don't offer Live use declarative model instead developers are required to annotate how individual elements are updated and removed leading to fragile applications akin to client side apps before the introduction of react and other declarative Frameworks again the acknowledgement of react's value is so nice so many devs like to pretend these things aren't good Elixir and Phoenix aren't pretending that react is behind them they're working hard to catch up it introduced new groundbreaking benefits on top most also lack the optimizations that live view developers get for free large payloads are sent on every event unless developers manually fine-tune them react to s like the idea of putting react on the server so much they ship their own server components to tackle a cross-section of similar goals with live view in the case of RSC pushing realtime events are still left to external means yeah yeah once you need to bring in something that is live updates like websockets react is not trying to help you at that point that's you plint it yourself I would make the argument that for the majority of the web serving everything through websockets probably not ideal because most sites don't update during your experience using them but if I was building something like Twitter or twitch the benefits of this model are obvious and insane and there's a lot of reasons you should consider Phoenix and live view instead of the react server component model but if you're making a blog or even traditional social media honestly the benefits of the server component model are really really powerful too I feel like these are the two options and obviously there's hmx which is a cool like getting started Point as well this is the furthest I've seen a framework get really pursuing these ideas without just becoming a heavy client side thing let's see what he has to say about react before we wrap up react like most chose different tradeoffs because they had no choice the majority skipped the stateful bidirectional communication layer because most platforms are poorly suited for it yep most places most backends most Services most companies as well as most Technologies are not well suited for a scalable bir directional layer where the server has reserved some compute and some RAM and all these things for a specific user during their specific instance that's a thing that just most stuff doesn't do well but obviously we have a good solution here Elixir and the earling VM are truly what make this programming model shine nothing else can do this I fully agree here and we have only barely discussed our built-in globally distributed clustering in pubsub these are truly extraordinary features built into the platform that are right at your fingertips what's next we encourage folks to try out the 1.0 RC in their application and Report any issues or bugs check the change log for breaking changes and to bring existing apps up to speed following the RC phase we'll be continuing efforts around collocated JavaScript hooks web component integration navigation guards and more you get the idea special thanks to all the people who helped make this possible the Phoenix team especially Stefan dou who has tackled countless live view issues for the last several months this blog post is a master class in understanding the ecosystem and meaningfully iterating on it I will be sharing this blog post with a lot of the companies that I work with in order to help them better understand how to communicate the state of the market that they're competing within that is awesome I'm genuinely really excited about what I just read and I'm going to probably go play with some stuff here after stream let me know what you guys think am I crazy or is this stuff as dope as it seems and until next time peace NS ## Picking The Right Stack In 2024 - 20240115 almost every day I get questions about what framework I should use what Tex stack should I be building with what database provider should I go with and obviously I have a lot of opinions cuz I have a lot of favorites in the space that said I don't think it matters that much it's way more important that you pick something than it is that you pick the right thing the reason for that is no matter what you pick you will eventually run into problems and it's much more important to build the muscles to go through those problems than it is to pick correctly when you get started I have a video where I talk about a lot of the details here but I really want to push this mindset these specific Technologies you pick are not what determines if you succeed or fail I find that earlier developers in particular struggle with this a lot I regularly get questions like hey I want to build a Google Drive clone which framework should I use or hey I want to make Instagram for cats what backend provider should I go with or hey I want to build a Twitter clone what database should I go with it doesn't matter and if you think that those are the decisions that matter you're going to get lost so much faster because you're going to be way more committed to that technology than you should be and you're not going to process the the problems you run into anywhere near as well the way you learn these things isn't by asking someone smarter to make the right recommendations it's by making a choice hitting the ground running building a bunch of stuff running into problems figuring out how people who use those Technologies solve those problems comparing that to how people who use different technology solve those problems figuring out which Solutions make the most sense to you and give you the most confidence going forward and then going with those the reason Technologies matter is the confidence you get from them not the individual implementation details of what they do and if you want to build confidence you can't borrow mine your confidence has to come from you and that confidence comes from making good decisions making bad decisions combining the two in shipping some software you got to just sit down and get the Reps in you got to build things incorrectly you have to pick the wrong technology for the job dozens if not hundreds of times before you know what the right technology is and sure I could help you skip a few steps by giving you a handful of technologies that might help a bit but now you're not building those muscles that you really need to have you're not figuring out how to to work around a problem you're not figuring out why those Technologies were even the right choice knowing how to pick a technology and how to drop a technology is way more important than starting with the right tools so yeah the solution isn't to show up here and ask me which you should start with over and over again until I cave even give an answer just pick one if you have friends that use a specific one and you can ask them questions take advantage of that use that if you don't have friends that are using other Technologies maybe scroll through the docs of three maybe build a quick hello world or clicker demo app with three or four different Frameworks and see which makes the most sense to you then pick it realize a year or two later you picked wrong and learn your lesson from it but Theo I need to get a job I need to pick the most hirable technology sure you can go pick whatever has the most jobs available but I promise you cold applying doesn't work anymore you don't get jobs from which Technologies are on your resume you get them from demonstrating your ability to solve problems and impressing enough people who have decision-making power to actually get the offer in the first place when I was hiring for the mod view team the two best devs I hired were an ember Dev and an angular Dev neither had any react experience when I brought them on and both became Wizards in almost no time that's because I didn't screen them for how good are they at react I screen them for how well do they solve problems because the individual framework or tools that you use are things you can learn relatively quickly obviously if the team needs a senior react Dev to help dig you out of some weird performance issues that's the thing you need to hire for specifically when it comes to just Building Product and improving experience for users the technology you start with does not matter at all don't be scared of rewrites don't be scared of picking wrong and don't be scared of asking questions once you've made your decisions but please please stop asking me which Technologies you should use just pick something it really doesn't matter that much you will find success if you get the Reps in just sit there build break things learn and what comes out on the other side will surprise you if you haven't already watched my goals video I'll be sure to pin that in the corner here it's one of the best I've ever done so please watch that if you haven't already and if you already have the video below it should be good too appreciate youall as always see you in the next one peace nerds ## PirateSoftware is right, this needs to stop - 20241220 if you're a prolific enough gamer you might have noticed that hiio was down a few days ago the reason is utter chaos throughout my years I've seen a lot of different ways that a website can go down I've never seen one quite as weird dumb and just worth talking about as this one quickly from their words hiio has been taken down by original Funko because they Ed some trash AI powered brand protection software that created some bogus fishing report to our registar who ignored our responses and just disabled the domain this isn't that simp Le this is hilarious they even called his mom yes the hi founder and owner's mom got called because they were so upset about the social media that this is chaos and we have a lot to talk about and I promise you we'll get there right after a quick word from today's sponsor saala the best place to deploy anything and I mean anything they're not joking when they say this they came from the WordPress world if you've heard of kinsta this is them theyve built a platform to host everything else and I mean it from here I can click one button and deploy a larl app D Jango app V app next app any of these and it's not just the app code it's the database too it's the CDN with cloudflare all the craziness you need to set up a web app correctly it takes multiple infer providers to do it right now it doesn't it's basically like you set up your AWS perfectly and you're using cloudflare for the CDN because their cdns are the best in the world but it actually does all of it for you I just click the deploy button it's deploying right now cool it's deployed if we go to the overview we can see all the parts we can see that cloud flare is in front with DOs protection we could even set it up with CDN and Edge caching with any of the different deployments that we do do after be nextjs you can use the cool next features we're used to from versell anywhere now with all the fun Integrations everything from automatic Builds on poll requests all the fun GitHub automatic deployment and CI stuff everything you would need or expect built in if even I can spin up a full stack LEL app that effortlessly you're going to have no trouble a fantastic platform for hosting pretty much anything and I've had a lot of fun with it myself thank you s for sponsoring check them out today at soy. l/ Savala thankfully by the time you're watching this video itched iio is again back online which is very good the indie game scene needs itch if it fails a lot of Indie Game Dev goes along with it we need iio to survive these types of things are to be frank pathetic also credit to Pirate software for putting this on my radar absolute chaos we need to break this down layer by layer OB viously the immediate effect hiio was taken down the take down happened because of I want my name which is a DNS provider I have to excal draw this because there's a lot of layers and I want to make sure that we get it right so if you know anything about software you know it is built on layers if you have something like a DNS provider this has to be built on something this is built on registar and I can standards so on top of the registers we have a DNS provider the DNS provider is something that you now use as the like service owner so when you are the owner of something like ping. g hio whatever you have built on top of the DNS Provider by buying the domain through them they are buying things through the registar in this case the service is a shop for buying games so this service has a layer on top which is users Distributing software so now if you're a Game Dev you're shipping things on iio so I should label these all H iio is this layer you have a Game Dev that is this layer we have I want my name is the DNS layer and then you have a whole different layer which is users buying the software this is the layer I don't want to talk about the gamer what's interesting when you're in scenarios like this is how the liability chain Works let's say you're a separate party in this case Funko and you have identified that somebody is Distributing software that violates your trademark you are Funko and you've identified that at this layer a Game Dev is doing something that is illegal in an Ideal World Funko would go straight to that Game Dev doing that and tell them hey if you don't stop we're going to go after you because because this isn't hio violating anything this certainly isn't I want my name violating anything this is a Game Dev supposedly using Funko stuff in an unlicensed way that Funko is now going after them for but Funko didn't do that you'd think okay the next best thing they're going to go to itch nope because Funko is not the one doing it funny enough what happened here is there's a middleman Funko contracts to Brand shield to protect their brand and brand Shield has their special way of doing this brand Shield decided that it's easier to not go to the Game Dev who's causing the problem certainly not to go to the service owner but instead shortcutting all the way the DNS provider and also in that process threatening them saying hey by the way if you don't comply with our demands we're going to go to the registrars that you work with and tell them by the way you should work with this company they're Distributing things that are illegal and this is where the problem happens the thing that sucks here is a user on this layer somebody who is Distributing things on your service is capable of causing something much lower in your chain in this case your DNS without you being involved at all it's possible for somebody Distributing software on your service to cause the things you're building on top of to get to give an example for us because I dealt with this recently with up upload thing by the way if you're not familiar we built the best way to manage file uploads in your fullsack applications upload thing allows users to upload files we had a similar problem instead of registrars I will call I'll put isps on the bottom so internet service providers then we have our hosting providers in this case it's cloudflare then we have service owner that's us upload thing service customers which in this case would be a full stack Dev and you have web app users I'll say this is users of service or users of I don't even what to call this actual end user cool so it's fun here now let's say somebody builds a clone of Google Drive using upload thing you built an upload thing clone for Google Drive now you have users let's say one of those users upload Lo s spyware now we have hosted on utfs slf spyware some end user uploads this file now this file exists on cloud flares infrastructure this is key and this is really dangerous not because like this domain is associated with cloudflare but because this file is being served from one of their IP addresses so because a user all the way up the stack here has uploaded some spyware this isn't the full stack dev's problem this isn't even our problem with upload thing this becomes Cloud Flare's problem because in ISP now will hit up Cloud flare and say hey we're going to block your IP addresses because they're being used to serve malware and then we get a scary letter from cloudflare saying hey upload thing Builders there is spyware being served from your service you need to get rid of this ASAP ASAP because if we don't then Cloud Flair's IP addresses get blocked by isps now we have to go up the chain yet again so Cloud Flair goes to us and says hey what the fix this now we have to go up the chain once more and say hey we just deleted this file you our options now are we can ban this user if we think they are aware of the malicious actions and not doing anything or they themselves are the malicious actor or they now have to go up and they come back to us say no that wasn't us we had a malicious user we're sorry we'll do better filtering for it and they have to go ban their individual user so somebody all the way up the chain is a bad actor here can result in an ISP Banning Cloud fl's IP addresses that's why these chains suck and why they have to be addressed as aggressively as they do but ideally this would have happened much higher up the chain which is something we're now working on we're going to be restricting your ability to host files that are runnable and executable you won't be able to host bash scripts or CMD files or EXs on free tiers ever again that's over now we've learned our lesson in the future we'll be doing more scanning and things like that as well working on introducing all of that that the fact that these things affect us in these hierarchies sucks because now a user of a customer of our service can cause cloud flare problems thankfully this was a notification system where we were told this was happening where in this case Brans Shield didn't give anyone any opportunity here they went to I want my name and said if you don't ban this DNS and ban this domain right now we are no longer going to allow you to work with isps we will force legal action we will go to these isps you're screwed get rid of this domain out of panic and also I would argue incompetence I want my name caved and removed one of the most popular domains on the internet one of the most popular IO domains for sure because they suck at their jobs but so does brand Shield because Brans Shield should have had any system to notice oh hi is a service for Distributing other people's software they are the ones we should be hitting up but they didn't do that they went straight to I want my name and got hi banned from the internet for like over 24 hours and here's what brand Shield had to say you might notice they have replies off and also a lot of community notes on this we want to address recent reports surrounding a website takedown brand Shield serves a trusted partner to many Brands our Aid driven platform detects potential threats and provides analysis and in this case an abuse is identified from an hio subdomain we identified and reported the infringement and requested a takedown of the URL in question not of the entire hi domain temporary takedown of the website was a decision made by the service providers not brand Shield because you didn't report it to the right provider you reported it to the DNS provider not to hio Brand Shield remains committed to supporting our clients by identifying potential digital threats and infringements we encourage platforms to implement stronger self-regulation systems that prevent such issues from escalating nonsense brand showed these to realize that a subdomain is probably owned by the original domain and they should probably go to the service provider of the original domain to figure out what is wrong there and calling hi's Mom like like that is horrifying like I get that you want to get some press stuff and you want to like cool it down and the hiio guy probably wasn't responding to your Funko Pop requests but going after his mom is just insane I would have loved to just blame Brans shield and say Funko Pop's not the problem but this alone means all of these companies suck and should be mocked relentlessly for what they've done they also moved off of I want my name after this because what the here's what pirate had to say instead of filing a dmca claim to hiio you sent a takedown request to their registar are you incompetent or are you just lying about your intentions for those that don't understand why this was sent me off the company brand Shield is a brand protection company that files infringement claims on behalf of their customers and in this case they filed an infringement request with itch's registar for a user generated page that contained Funko Pop branding this led to a complete takedown of the website for the better half of this morning sorry I thought it was a whole day it was only half a day I guess this is the equivalent to Twitch being taken down because a single user was streaming a copyrighted movie yep exactly and a good link from funny enough twitch staff hi's terms of service look at that they have a whole section here for the dmca if you believe one of our Publishers has violated your copyright please let us know about your complaint with the requ information so we can address the complaint if you think a complaint was filed an error you can also contact us to address your concerns there you go technically speaking since neither Brans Shield nor Funko are customers of hio they're not expected to comply with hi's terms but you should check them quick to figure out what the right method is for reporting but since this isn't a human doing a correct method of reporting this is a crappy Rogue AI tool sending threatening emails around disgusting this is what Happ when you let ai go without a human in the middle absolute fundamental failure and Brans Shield should at the very least check how popular a domain is before sending one of these accusations ideally they would shut down this is but like yeah God as pirate said it has a very easy process for handling dmca claims and these processes were ignored it's clear that brand Shield didn't do any research before firing the gun and they shouldn't be taking actions as such brand protection companies should know better the regist should know better and Funko Pop should know better to follow this up brand Shield has tried to blame the victim here yes they are continuing to try and blame people for doing things right effectively it's kind of insane it's like like this should be the end of their business and I would be genuinely somewhat disappointed if people continue to sign up for their service after this so I'd hope when you Google search them this comes up first at Funko we hold a deep respect and appreciation for Indie Games Indie Gamers and Indie devs we're fans of fans and we love the creativity and passion that Define The Gaming Community recently one of our brand protection Partners identified a page on itch imitating the Funko Fusion development website a takedown request was issued to address a specific page Fungo did not request a takedown of the itch platform and we're happy to see the sites back up this morning you reached out to them to engage with them on this issue and we deeply appreciate the understanding of The Gaming Community as the details are determined yeah as the top reply says it's a lot of words to not say that they're sorry and on top of that not admitting that their brand partner BR Shield didn't contact itch they skipped multiple steps and went all the way down the chain I would argue there could be a lawsuit here for irresponsible like behavior on a brand with intention to damage it's pretty absurd yeah this also should have been a dmca request if it was actually fishing like they were trying to look like Funko Fusion when they weren't a fraud of fishing report might make sense but again that should go to hi not to their registar and I can't give any benefit of the doubt to Funko over any of these steps because of how they've behaved that's all I got on this one don't break copyright laws and if you do or you see someone doing it report it the right way please until next time peace nerds ## Pkl Apple's New JSONYAML Killer (I actually want to use this...) - 20240211 Json is not the best thing in the world it works but it doesn't work great what if I told you there's yet another alternative and no it's not yaml what if I told you that alternative was by Apple and they open sourced it for some reason all of that by itself sounds really interesting but what if I told you on top of all that it's actually really cool so much so that I kind of want to start using it as soon as I can I did not expect this release to be as interesting as it was so I can't wait to show you what I've learned as I dug in so let's take a look at pickle Apple's new configuration focused programming language I like how they open with a configuration that is programmable scalable and safe configuration is the key here this is focused on being good for configuring things the first example here bird. pickle we have a name and a job which is a nested thing so this is a pickle file the interesting thing about pickle is you're not actually expected to like use this exactly as is you're expected to run this and Export out the different things you might want like Json or a yaml file or a pist or a do properties which I didn't even know was still a thing but if you need one of these specific formats now you have a standard that will export all the different formats gets weirder though because as I mentioned can do a bit of programming in here first off they have integrated application config so that you can embed pickle into other programming languages like Java cotland Swift and even go you can see what the resulting output looks like when you run pickle to configure these types of things absolutely fascinating that they are generating code for these different languages based on a pickle module and if we keep going you'll see they've built IDE integration including Visual Studio code which is crazy to think that apple is building plugins for vs code as far as I know that's unprecedented I never would have expected Apple to be building things for Microsoft's open source code editors apple and open source generally aren't things I associate much but here we are and as someone just pointed out in chat they don't even support xcode what that's hilarious they support all these other things and not their own cursed Madness I I hate xcode so much that I've consider making a video about it for a while cuz it is such a show but we'll talk about that another time because I want to show off more of the cool things go going on here like in this example where you can actually do logic you can enforce that this int has to be greater than a th and then when you assign it you'll get an error yes this is a config language that lets you encode logic to guard things that's like Zod just built in to the config language very very interesting it's clear Apple had like specific problems they were trying to solve here introducing pickle a programming language for configuration we are delighted to announce the open source first release of pickle a programming language for producing configuration when thinking about configuration it's common to think of static languages like Json yaml or property lists while these languages have their own merits they tend to fall short when configuration grows in complexity for example their lack of expressivity means that the code often gets repeated additionally it can be easy to make configuration errors because these formats do not provide any validation of their own someone who's been working a bit more in terraform lately yes absolutely the case to address these shortcomings sometimes formats get enhanced by in ciliary tools that add specific Logic for example perhaps there's a need to make code more dry so a special property introduced that understands how to resolve references and merge objects together alternatively there's a need to guard against validation errors so some new way is created to validate these configuration values against an expected type before long these formats almost become programming languages but ones that are hard to understand and hard to write on the other end of the spectrum a general purpose language might be used instead languages like cotlin Ruby or JavaScript become the basis for dsls that generate configuration data while these languages are tremendously powerful they can be awkward to use for describing configuration because they are not oriented around defining and validating data additionally these dsls tend to be tied to their own ecosystems it's a hard cell to use a cotlin DSL is the configuration layer for an application written in go it's a very fair point because you don't want to use cotlin to define your configs in go we should invent a new standard obviously if you don't want to write your go configs and cotlin clearly what we need is yet another standard this XKCD gets more and more relevant every day I swear anyways we create a pickle because we think that configuration is best expressed as a blend between a static Lang language and a general purpose programming language this is a bold statement to make to say a blend of static languages and general purpose programming languages is the right thing for a config and honestly the more I think about it I'm starting to agree we want to take the Best of Both Worlds providing a language that is declarative and simple to read and write but enhanced with the capabilities borrowed from general purpose languages when writing pickle you're able to use the language features you'd expect like classes functions conditionals and Loops you can build abstraction layers and share code by creating packages and Publishing them more most importantly you can use pickle to meet many different types of configuration needs it can be used to produce static configuration files in any format or be embedded as a library into another application runtime we designed pickle with three overarching goals one to provide safety by catching validation errors before deployment two to scale from simple to complex use cases and three to be a joy to write with our best-in-class ID Integrations this is actually an interesting set of goals very very interesting more and more I like this idea of validating in the config that just saves so much trouble so let's do their quick quick tour of pickle we create a pickle to have a familiar Syntax for depths and to be easy to learn that's why we've included features like classes functions loops and type annotations for example here's a pickle file a module that defines the configuration schema for an imaginary web app they want us to know that this file defines types not data which is a common pattern in pickle interesting to have the concept of a template in something meant to compete with Json application dep pickle it's a module named application it's a host name that's a string Port which is an INT 16bit environment which is an environment so this has to be coming from something else would be my guess data a database also probably coming from something else oh look at that they Define them right below database is a class that has all of these properties the environment is a type Alias for one of these values this is so interesting it's a blend of a bunch of different things but the results actually really simple I'm liking where this is going let's keep digging someone asked isn't this kind of the same idea like T3 environment yes and no T3 and V is very much tied to typescript environments and is only for validating environment variables this is for validating things inside of outside of and around the idea of config like this would go much better with something like terraform than T3 environment would and here's how the configuration data might be defined now we have local host. pickle it amends the application file and then it sets all of these things really nice and there's built-in read expressions for reading external resour actually that's really nice too that you can read from the environment like that huh really interesting it's easy to create variations of the same Base by amending for example let's imagine we want to run four databases locally as sidecars this uses a four generator to produce four variations Each of which amends the base DB and specifies a different port so here is the for Loop example that I was looking for import application. pickle hidden DB application. database is a new database with these properties and we create the side cars which uses a for Loop where we select all of the values in this list a lazy way to do a for Loop where you guarantee it's just these values but we have 0 1 2 and three so for each of these it's going to create a config for a database that is 6,000 plus the offset so you'll have Port 6,000 61 2 and 3 all is valid configs if you want to understand this code we can take a look at the Json that gets exported so if we export database password Center this is setting the password for the environment then we run the pickle evaluation code tell it that we want Json out and now here's the Json that we get it's actually really nice as a a language that does this and only this like this code is solid this makes sense to me and having this be a thing that can spit out whatever different format you need inv validate in whatever language that you use I'm digging it I want to learn more about this validation it's one of the most interesting Parts configuration is about data and data needs to be valid in pickle validation is achieved by using type annotations and type annotations can optionally have constraints defined on them here's an example that defines the following constraints age must be between 0 and 130 name must not be empty and zip code must be a string with five digits hey somebody will be older than 130 someday you don't want this you don't want your code to break because Brian Johnson was right let's be real so let's take a look at the person pickle module name String not is empty is this a helper that they have built in interesting age is an INT which is between 0 and 130 seems like this is syntax is there like core validation stuff I'm sure there's a doc somewhere that lists all of these so age is an INT that is between these values and zip code is a string that matches this Rex of course Rex is involved I was wondering when we'd see the word Rex the only way you could possibly make yam more curse is adding Rex to it and they managed to do that anyways a failing constraint causes an evaluation error so if we make this Alexandra file where age is negative we'll get an error when we try to evaluate it that says that there's a type constraint failing is between 030 violated by this value and it calls up a specific line it happened on nice good stuff constraints are arbitrary Expressions this allows you to author types that can express any type of check that can be expressed in pickle here's a sample type that must be a string with an odd length and whose first letter matches the last letter interesting at least they got equals right sharing packages pickle provides the ability to publish packages and to import them as dependencies in a project so this going to be PPM pickle package manager this is nuts this provides an easy way to share pickle code that can be used in other projects it's easy to create your own package and publish them as GitHub releases or to upload them anywhere you wish they could be imported from the absolute URL look at that they're learning all the right lessons from the things we got wrong in JavaScript and node this is actually really cool this is like I feel like they watched that one talk that Ryan D did about the regrets he had from node and they applied all of those lessons really well here I'm impressed this is cool alternatively they could be managed as dependencies of a project using a project allows pickle to resolve version conflicts between different versions of the same dependency within a dependency graph it also means that you can import packages by a simpler name huh you can Define dependencies like that H well it is a Json replacement so they have to replace package Json seems like they found a way to do that version conflicts in my config files is a a meme I'm seeing in chat now that yeah funny enough not a lot of people know this the package system for iOS is a thing called pods that were created by the community not by Apple and the creator of PODS orta actually kind of moved on from IOS and became one of the lead contributors for typescript at Microsoft which was very interesting to see somebody who made packages possible in the iOS world ha it so much he moved over to JavaScript and typescript they don't call the pickle package manager the pickle jar they're doing it wrong that's fair looks like they even have their own set of packages that they're managing which is interesting because this means Apple's probably using these Technologies in order to justify the time they're putting in which means Apple's officially almost certainly using kubernetes because they built the kubernetes binding very interesting they also called the monor repo for publishing many of them the pantry the pickle Pantry I'll give that a star it's 28 stars for those wondering and the actual pickle language it's a 3K and give that a start too this is fascinating it's also just crazy the rare times you see apple popping up in the open source world one of my favorite examples of this there's this weird Apple account and we've confirmed this is officially Apple the developer ecosystem engineering account on GitHub previously it had a really ominous profile picture tell me that's not one of the most ominous profile pictures you've seen on a GitHub account that turned out to actually be Apple's GitHub account it seems like apple doesn't want the engineers who are contributing these things to be like using their usernames on their own accounts it's very Apple to do this from like the Shadows so to speak it's Eerie almost also it wasn't originally this poorly Alias this is just the very lowquality backup that uh archive.org has huge shout out to them for keeping most of the internet alive so I remember when I first saw this account file a poll request on OBS rewriting the layer for window capture on Mac this was really cool the reason they did this seemed to be that they were testing their new capture Solutions and they used OBS as like a standard for capture so having Apple out of nowhere show up and contribute really nice changes to OBS was really unexpected and cool and they did a huge breakdown cuz it's Apple here's where they call out the language bindings which is really interesting because they want it to be embeddable in other languages Apple generally doesn't like JavaScript and I am certain they don't like typescript much so I'm not surprised we don't see those here but of course they had to support Swift because it's Apple but it's interesting they also support go Java and cotlin especially cotlin when I think about it Apple does have quite a few Android apps now like the Android Apple music apps one of the best apps on Android makes sense they have to think about cin a bit more especially if they're already using Java for their stuff it that makes sense using Code generation is just one of the ways to embed pickle within an application our language bindings also provide evaluator apis to control pickle evaluation at low level and users are free to interact with pickle at the abstraction level that makes the most sense for their application now the last big piece is the editor support we believe that a programming language is only as good as the experience of writing it that's why we aim to provide best-in-class editor support when writing pickle and an editor users are guided through the process of filling in configuration data from a given template additionally the editors provide instant feedback if any values are in valid documentation is immediately available when called upon we're also releasing the intell plugin which provides Rich support for jet brains editors including intell webstorm goand and pycharm these plugins are able to analyze a pickle program and provide features like autocomplete go to definition and refactoring support that's really cool that they're doing language servers properly that's nuts to have like a config file like imagine if your Json autocom completed and gave you errors when you were editing it this is actually one of my favorite Parts okay when are we replacing package Json with package pickle because I need this type of safety in everything I do this is great seriously though imagine like an alternative to something like next where the next config Json wasn't a Json it was a pickle file and when you went to your editor and started typing out the config it would error if you got things wrong that sounds awesome this seems genuinely really cool right now when we want to do stuff like this we end up doing crazy hacks like putting our config files in the language we're using like typescript so that we can get type errors and now we have to compile that in order to use it this skirts so much of that it's actually really cool Sly the vs Cod C PL doesn't seem to have the erroring yet just the syntax highlighting and cold folding but they are planning on doing that in the future really nice to see they have examples here for a bunch of different things from kubernetes to Swift to the jvm and go really good stuff this is both further along and better than I would have expected I did not expect this to be this cool honestly and I'm genuinely really hyped I certainly didn't expect Apple to make something like this much less open source it so I'm really hyped to see the results what about you are you excited too let me know in the comments anyways thank you again for watching peace NS ## PlanetScale CEO Sam Lambert on Web Dev Wednesday w Theo - 20220303 howdy howdy y'all super excited for today's show for those that don't know i have with me sam here from planetscale wanna quickly introduce yourself sam hi everyone i'm sam uh like theo said i'm from planetscale i'm lucky enough to be here as the ceo uh i live in san francisco and i'm super excited to meet you omb and be here super awesome to have you here man i yeah as you know and as many of the people who are here know i've been a loyal planet scale user for wanna say four maybe five months now yeah when i was early at ping labs previously as a the product round we were running into issues with connection limits on heroku i moved us over to rds which was annoying but totally doable because sequel is sequel and it was like a heroku postgres over to postgres on rds and not quickly but slowly started reaching connection limits over there i sat down and thought okay i could learn how all this stuff works and build my own solution to this problem but that can't be the best answer i'm gonna do a little bit of searching and luckily enough stumbled into planet scale was a little scared moving over to my sequel but i took the bite and here we are five months later talking with the ceo shilling it immensely and happier than ever to be paying 17 cents a month for the best database team i can imagine so yeah it's awesome you're very kind thank you uh and you've been yeah like we love seeing your tweets in chat like so we get these twitter these tweets come through um and it gives everyone kind of a buzz so we're very grateful and thank you for that 17 cents so we we really appreciate that by the way this is the first stream i've ever been on so i'm a little nervous but i'm very excited i'm nervous because we have uh james and taylor and cammy who uh do streaming and very various different stuff for us here at planned scale and they are phenomenal at it so i feel like i've got um some pretty big shoes to fill but i'm really happy to be here i they're fantastic content creators it's one of my favorite things about planetskill was the focus on hiring content people early i will say though you're doing the fun part right now all the behind-the-scenes work to stitch a stream together is painful but it's also what we specialize in so it's awesome to be able to give you like the formal intro on the platform that we're so proud that we've built yeah and speaking of content it's pretty amazing actually um how much content does now um i love seeing it i think it's when i was a you know software engineer or developer engineer whatever a long time ago you know you would never go to youtube to like learn about um software engineering and the fact that there's now such rich medium and media and tick-tock and all of these various places to kind of learn in these new communities it's really awesome to see like it's it's such a fascinating world to be um shipping software and then marketing it this way and i love it i enjoy every second of consuming the content and learning about other products and and what people do and shows like these make it so cool couldn't agree more it's one of the reasons that i got in as early as i did like i was into content before i was ever into engineering personally i've always been like deep in the gaming side i got into code to host minecraft servers honestly and it's been so surreal seeing the developer world kind of meet me where i was if that makes sense like even earlier today i was talking to some people at netlify and having people who work for netlify come to us excited as soon as they see the product at its core features just like getting it is surreal to me still it's like these are the people i looked up to even like two years ago as i was trying to make like our success in the developer space and like really prove myself there and now the same people who i looked up to are coming to me for help on the stream side of things and it's really crazy to see yeah and i yeah i know that feeling it's a really funny feeling when you build something you put it out there and people start using it and you're like it's kind of wild so you know even even like you know we're getting to the stage now where kind of you'll see someone sign up and they're using it or you'll look at the kind of the market uh the um end of uh end of month billing going out and you look at all the different names of companies that like upgrade and ran up a bill um and you see like real brands there like name like companies you've bought from like e-commerce websites that you've been on or or whatever and you're gonna get it's like really straight it's a really surreal feeling knowing that like there's this you're going and we obviously got that i got that from being a github that was another kind of a different level of it um but it's different right you know the brand is using the software but then actually knowing their products are completely power put under the hood by the database uh product your you and your your team have built is a a really great feeling so i know exactly how you feel yeah we just had a few of those moments with some of like my favorite content creators be it like the youtuber world the political world gaming having them all come and start using our product and like i think my favorite moment was one of one of my friends reached out because they were watching a live show for like a political person that they were really into it's like wow the quality got a lot better any idea what happened it's like yeah they hit us up and they started using our product and it's just such a cool like aha moment to have that like even with my personal friends as they noticed the difference i completely agree by the way the team turned the image you made to sort of advertise this into um a slack reaction immediately so now i see my head with laser eyes coming out on a lot of messages today so thank you for that as well i love that no credit to me though my editor was all over that he's on top of the everything that isn't me being in front of my camera effectively credit to adam he's been killing it and also is available for hire if anybody needs like content editing graphics video etc give him a shout out i can link you up to him later on twitter or wherever else yeah he has a very bold design style i like it yeah i quickly want to do a check since people are starting to roll in if there are any audio or video issues please let me know asap so i can get those addressed at all seems good on my end like surprisingly so so yeah i just had yet another windows update and series of driver issues and crashes so fingers crossed things are stable for this show well yeah to kick things off a bit more you hinted at the github stuff from my knowledge you made quite the set of career moves starting at youtube going to github and then finding your way as the ceo at planet scale i'd love to hear a bit more about your history and how you ended up where you're at so i wasn't actually at youtube the founders of plant scale were were at youtube and the technology that came but before that yeah i was a i was at github so i'll tell you like so uh very quick like i'm the boring part so i'll just yes i i was at github for um eight years i think by the time i left very fortunate to have joined uh them in the fairly early days uh and watched the kind of the journey in the growth of a very very unique and special product uh and then yeah i was at facebook for a little while and then i i really wanted to be back in a startup again like i really wanted to be back in the early days and when we were at github we'd used plantscale's core technology the tess and you know it was incredible and you know it was so we have a head of infrastructure sam um he you know i was talking to him about it and he was like yeah i mean it's a bit of software that pretty much does exactly what it promises to do and does it very well and it's kind of a you know that was our experience and it was very great for us because we were trying to scale you know github was i think the 40th most visited site on the internet at the time and so there's a lot of traffic right and trying to scale the database for that is um it's really tough and for tess was amazing for us and and i was advising the company anyway and i thought you know i'd love to i think there's an opportunity here to build a product that takes this technology and puts in the hand of everyone because right now so like the test is the backing for a lot a lot of very like large websites if you go to our like our plantscale.com you'll see like this incredible list of logos for example like slack is that you know whenever you send a slack message it's for tess on the other end that listens and acknowledges it and then it's sent out to the clients right vitesse is this core piece of infrastructure and i thought you know it can stay as this piece of tech for the really large hyperscalers of the world or we can go on a mission to put it in the hands of every single developer from the beginning from the moment they start their company and that's been the plan the journey of of the company for the last kind of year and a half now and it's going it's it's it's really exciting and you were talking just about like limits on postgres hop to aws like companies go through two three four maybe five different changes in the database stack until they get to scale and they settle on something and and when they get to real scale they have five or six engineers that are babysitting it they build their own sharding scheme they go through these like hellish things and the thing about the thing that's most egregious about that problem is that it's undifferentiated like no matter what your product does you need a database and you need to solve database problems and it takes away from what you should be doing for your users and the thing i love and i think is truly magical about planets goes that folks like yourself choose to to use it because it's the like most easy to use um simple uh joy sort of joyful data ad basic experience that's out there but under the hood we've provisioned you technology that runs some of the largest sites in the world and so the thing i can't wait to track over the years is company founding all the way up to ipo without ever having to go through that hell of of database scaling and they just use planner scale and we haven't seen tech like that um especially in the back end before and that makes me super excited that's a really awesome way of framing it i will say like i hope to be one of those big companies someday i know that ping isn't on your home page yet but eventually we'll get there i definitely feel the thrash of the database change in particular even early for us like i i personally changed our data infra one to three times a month for our first three months existing trying to keep up with our needs as developers and our like infrastructure needs for our users like we started on worker kv and that that was a mistake i'll admit it we moved over to uh the planets or the as i mentioned before we did postgres on heroku outright mistake even more so moved over to rds and then eventually here what was really surprising for me though was that the planet scale move felt the smoothest even though it was from postgres to my sequel it felt like the least ask on me as a developer in the sense that i dumped my data i ran it through some script that converted a pg dub to a mysql dump removed the parts that were table definitions matched by schema using prisma and then ran the script and it worked and that was still like baffling to me i even switched in production like i had a next.js push that switched the db environment variable name over to the planetscale environment variable not realizing i had two of my biggest clients in calls when i made the switch and it was seamless nobody noticed the transition that this is fantastic to hear it's funny actually some of the bigger customers that are migrating over right now are coming from postgres and well like there's definite work like when you have very complicated applications um to work around but it's kind of like if you're having serious scaling problems it doesn't matter right you have to get through it's better than kind of trying to do like i don't know sharding on postgres or something like that like trying to like going with like an established tech that you know can at least scale through p it gives people the motivation to do it but i was really surprised to actually see we did one recently this proof of concept um with a postgres customer and they wanted to get to like a large scale uh hundreds and hundreds of thousands of queries per second is what they're looking for they're very you know they're growing immensely um and they wanted to know that we would scale to like crazy limits and it was a great proof of concept to watch and they were coming from postcards and they very it was i was really surprised how quickly they were able to adapt the application to run on planet scale and then push those kind of numbers it was great and so i don't think you're right i think it's not as scary as one would seem i think if you're using some of the really deep postgres features it would be tough but i i think it's i think it's well worth the switch but i'm obviously heavily biased as well yeah the only thing that i had to like re-architect was we were using string arrays and postgres for like one or two stupid things and right yeah that was a bad decision that we probably shouldn't have been using anyways but since i replaced them with json blobs i don't know if it's much better well i think if we find you're with us we've got you we'll sort you out yeah i am not too sorry it's for a very small feature and for like tracking a little bit of data it's not a big deal overall the move was very smooth for us i am curious though i feel like a lot of that smoothness came from prisma as like not just an orm but as like a middleware api almost between my database and my like application that also serves as a really strong source of truth for like the type safety on the client but also the like like consistency of my data model on the back end and i'm curious i've definitely seen like the investment in focus on prisma at planet scale especially with projects like beam taking advantage of it i'm really curious where you think the relationship between like a prisma and planet scale is and how you view that as the ceo in terms of investment and time and focus so if anyone any company out there that wants to make the lives of developers better uh we're aligned right like we want that too um and especially when it's around databases we love the prisma team we have a shared slack channel with the prisma team and it often feels like the same company are talking back and forth which is which is really great and i think their goals and their values for what they produce for the world is very very similar and uh you know sauron the ceo prisoner whenever he comes into town we always grab lunch or go for a walk or something so there's definitely a bond between uh our companies and i think it's um it's really nice to see a piece of technology that's kind of getting a lot of traction um and is unified and bringing the kind of orm magic expressly to the javascript community um i think rails provides similar um kind of magic with active with active record um and orms certainly kind of we we get that you see this a lot in comments when people are like well if you're using an orm it's very simple to move to planet scale right like that you know you just you just change the adapter and that makes it real really interesting but prisma has grown and built a phenomenal community very large community very quickly by being very good at developer experience their taste is unrivaled um and so yeah really awesome company to work with and there's definitely a lot of kind of shared goals and alignment between the two companies i couldn't agree more they feel like such a good match the i could go on a rant about referential integrity stuff but i'll save that for the second half of this i i'm more interested in the show how we put this one i this is the super bass question i am very interested in how focused planet scale is on solving specific problems really well and then integrating with solutions for the problems that you don't solve versus a superbase where like they are solving databases and all the problems around them as a single player whereas you solve databases and partner with the solutions around to make sure you're compatible with the best players in the space it almost reminds us of me of what we're doing with ping where we're not trying to solve the entire ecosystem problem of video production we want to make having guests on your show as easy as possible i'm curious how you feel about that difference and how it positions you against other companies in the space yeah so i also super base is another company that i feel we're aligned with right that you know they are delighting users when i see people like very often it's people kind of tweet and it's like plant scale or super bass and you know i'm happy with some people to enjoy whatever tools speak to them and i know people want more of a kind of an all-in-one solution we have very deep debt we have very deep database expertise this planet scale is made up of people that have taken databases to the absolute largest scale like we we have you know um a num like a quite a decent chunk of our employees have worked at not tens of millions to use a scale but billions of views of scale right and that that takes things to a complete other level um and so our expertise is very deep so rather than kind of going uh you know a mile an inch deep in a mile why we like to focus really deeply on what we're doing in terms of in terms of databases because it's a hard enough problem and i think you could spend well so whining back we we we go a lot further than database then most database vendors um when it come it comes to how simple we want to make the product like we make it ridiculous you didn't have to specify how much ram for a cluster or you don't see the word you won't find the word cluster in our ui um or ram or vcpus or like nodes or whatever they started showing connections recently yeah right exactly and so we we keep it behind um an interface and an interface that we talk about and that we work on very deliberately and it's beautifully designed shout out to our product uh design team jason and derek um we agonize over how simple it is to present this database and when the product is extremely deep and powerful that gets harder um we want to we want to not just spend our time building something amazing but something that's refined to be usable and simple and other database vendors i think they think okay we've solved like a very hard problem databases are very hard here's a load of pain in return like we're gonna we're not gonna go all the way like you know you have to do stuff yourself we don't we don't agree we want to take it all away we want to take it so that that single single person uh companies or teams or you know small groups of people are leveraging immense power and that takes a lot of work and we have got years ahead of us to get it right we we what we've produced so far is is just the very very beginning um we are very unsatisfied with the state of the world in that in in in the right way we want to see a a much better world when it comes to databases and so we've got years of work ahead of us and i don't want to distract us we're shipping you know towards the end of the month and people you know we'll we'll start tweeting around the we're launching a new new feature um no one has ever done it it literally hasn't been done so it's just like branching which was again another feat like we we brought up branching to the database world last year this one has never been shipped by any database vendor it's a completely brand uh new piece of functionality i'd rather focus on those things there's things that you know there's really incredible experiences and and pieces of technology we can deliver and it's going to be like deep deep refinement and thinking over the same problems year and year and year out is that the stuff that i'll be playtesting on monday yes it is actually you're getting a you're getting an early look of it and um yeah that is decades of experience from a number of database engineers working very hard to produce technologies like that so come out safe and robust and usable at scale yeah i couldn't be more excited for that i have a history of play testing the things i use and love the most early and it's cool to get to jump in on that here and for you to be bringing up the same thing that i'm getting to play with soon is super exciting i you touched on a lot of like ideas that i'm really interested in i'm gonna dig in on what it's it's it's a contradiction i don't think it has to be i'm really curious what your thoughts are on it the idea of like people reaching for a supa base or something like it for the all-in-one nature it provides of how much easier it is to go from 0 to 10 if that makes sense like out of 100 like you can get something working that has all the parts you want i know a handful of developers especially some like early developers that are learning software for other or for reasons outside of wanting a career in it like i have a good friend who is the ceo of a charity for mental health in gaming and like online spaces he taught himself how to code because squarespace wasn't working as a platform for them he's one of my favorite developers ever huge shout out jason docton love you man he is the one who convinced me that superbase had a lot of value not because i personally would use it but because of how much it let him not worry about the problem of getting started and on top of that as i described earlier i feel like planet skull is a uniquely strong experience in moving my infra over to it like i was able to move to planet scale faster than anything else with all that said i know that you're pushing the idea of planet scale being the the thing you init with and the thing you ipo with i'm curious when for people who start somewhere else the transition makes sense and if your goal is to while obviously complimenting superbase and things like it how do you see this relationship between starting with the simplest thing and moving to the simple enough but scalable thing when it makes the most sense yeah that's a great question and so whatever gets you moving and closer to your idea is the important thing internally we talk about that people don't come to us for a database they come for a backing for their ideas and and the re so uh lee rob uh he did uh a fantastic youtube video um that timed sign up to getting a database of like 20 different database vendors do you know the video it's i have not seen that without you okay watch that though so lee rob on youtube he he he basically does his bake off of all of the um all of the different database products that you can care to name he signs up and sees how quickly it takes to get a database we came first and we came first because we came first because we obsess over things like speed and productivity of our users and the reason we wanted the database creation to be like so when i was joining when i was thinking about joining plansk i was looking at the competitors i wanted to you know how crowded is this market how tough is this going to be and i i signed into like one of the hottest ones and they made me wait 24 minutes for a database and i was like okay well we can beat that and so we decided we would get as close to instant and i think it takes about 11 seconds in that video to create a database because we want people to get past the database creation and get back to creating their idea the more time they spend looking at npm errors database problems messing around with deciding cpu and cluster sizes and all that crap they're not they're not working on their idea right they're not we're not getting out the way and enabling them and so we've been very obsessive about productivity and building things and this is where branching comes in right like we believe data branching and branching your schema is the um [Music] the absolute like best way to get into a flow of developing quickly schema changes are tough right and annoying um and you want to get past them so we don't just like sell on scalability right like coming to planet scale for scalability alone you're going to be coming a lot later right unless you're a big company there's so much we do and especially this year's road map that's not just about scale like in fact the product scales right we don't have a lot of scalability work to do or as much as the others because this ran at youtube um across 20 data centers on tens of thousands of servers right we're actually scaling down like we've got we've had the biggest use case right like it'd be nice to host youtube on plant scale cloud i don't know if we're going to get there every one of our competitors is scaling up they get the next biggest customer they're going to go through all the back end problems and all of that those issues we're scaling down from the largest like second third largest website on on earth we're not now it's about human experiences on top of that scalable platform and so i would say the best the right time is now to come and get all the goodness of what's coming for that platform however if superbase gets you most excited and gets you past um past the setup problem and um and and and building quickly you should do it and it all in all in one solutions are great i mean truthfully great for getting getting moving but like you know like happened with you and heroku the database fails first and there is so many people that are deployed on heroku and the first service they they go to outside of heroku is amazon rds because the database breaks first time and that's going to happen sooner and sooner in companies journeys as they get more complex and and and just the scale of the tech industry grows and we believe that we're going with the best-in-class solutions always going to be better obviously compounded by amazon not updating their free tier for like a decade but totally agree yeah it's shockingly low actually isn't it yeah uh somebody in chat adit actually mentioned that uh this particular thought and like the way things are breaking down is uh very much a problem that they're dealing with right now and it is hitting the nail on the head for the complexity that he's dealing with on his team so it's really cool that like just people who are like idle watching this are immediately resonating with what you're saying that's how you know you're on to something when when people in chat like can bring that into the lived experience they're having right now so absolutely i mean we're all having database problems and like you may just not know it like as that's the other fun thing about when you talk to people is you see you don't say do you have database problems you say tell me your database problems because of course you won't have a database your business really isn't up to much unless you have it like you know if you're building on a tech platform and you um don't have a database i mean you're not really up to much so one that's an amazing opportunity for us because databases are everywhere and two we know that they're a problem right and so we uh always get to ask what are your database problems and they're always very similar and we we obsess over those problems to solve them for people yeah it absolutely shows uh one of the interesting ideas you touched on there that was kind of one of my questions i want to push a bit harder the idea of moving down the scale in a way where planet scale scales i've referred to planet scale as as close to infinite scale as you're going to get and gotten pushed back from random people i'm thankful i've been proven right consistently with that thank you for making my bold statements look good but the interesting idea you touched on is like pushing down from the biggest scale to the lack of it and that like initial commit and something i've definitely noticed it didn't feel so much like moving down so much as switching to the bottom where planet skills focus used to be the scale part and it almost feels like there was a conscious decision to switch from that to the experience part i'd love to hear a bit more about that and how planet scales focus has shifted from scale to experience yeah and and i would say when the we obviously super scale is very important to us it's more about that experience scaling is i think the way we think about it right it's like what is the best developer experience around a database and how do we continue because because if you you know and i will i promise i'll get to but the market's fragmented when we had a slide originally when we were pitching the original idea which was you have companies down at the like the best to use on day one really cool like devs experience fanciful features that don't work at scale whatever and then you have the like the databases that do scale that are just ugly and incredibly bad to use and whatever and we wanted to just cover all spectrums and deliver that experience all the way to the scale of the others so we do we think about it as the experience scaling i think it was i don't know it was you know we we were kind of selling to them you know i had a customer base of these massively large installations and and and we thought that it's about it you know more people can leverage this technology why do folks have to go through loops of pain to get to scale problems before they realize they need to use for tests and also the test is really hard to use i mean that's that's that's kind of the point of the way for tesla's architect is it's extremely powerful but you're not going to download it and immediately get up and running in 10 minutes if you don't know how databases work right they've optimized and by the way it is an outstanding piece of technology and the team behind it are incredible engineers absolutely incredible in terms of what it does it's such a well-maintained open source project it's also people may not realize it's one of the absolute oldest go projects in existence it was built it's the the test started on go 0.1 um the the actually the founders of the project accredited in the in the go documentation uh because they gave feed the earliest language feedback so it's one of the oldest applications built in go it was built in bo on borg which is the predecessor kubernetes and we kind of joked that that means we were ready for kubernetes before kubernetes was so it was built in this very very unique environment and it's a huge code base it's very complicated and the team did an amazing job with it and we knew to get it into people's hands we had to kind of hide that right we had to give them all of the best parts with none of the harder to use pieces and and that's why we went on the mission we're on and we took it all away with a serverless platform which adds a whole other level of complexity and um but we really wanted to take that challenge a framing i used once before was vitesse is kubernetes for sql and planet scale is lambda yeah that is absolutely a way of thinking about it um it does make things significantly simpler uh but it's very very hard i want it hard it's hard solving hard problems and it takes a lot to get up and running yeah couldn't agree more one more point on like where planet scale is positioned it like we touched on it here with the test at how good of a technology it is but i i've seen uh i don't want to say a trend but a definite interest in sql alternatives if that makes sense like superbase isn't one but they provide their own sdk that you can like install and then never have to think about sql again there are platforms like fauna d graph i just saw another one that's like pseudo sql it was a like edge uh database or something that isn't it was a graph db there was something that had like a new graph sql syntax that was still sql based under the hood but it feels like there's a lot of focus on providing alternatives to sql both on top and below and i'm curious what your thoughts are on that trend and how confident you are in planet scale's decision to kind of ignore it if that makes sense without revealing how old i am i've been in databases for a very long time and every single year i see someone pop their head up and claim they're going to build a proper alternative to sql and there is a graveyard full of companies that have tried to do this they they pop up constantly sql has been around what 50 years 60 years something like a long time um it provides great developer experiences it has downsides um uh but it's the interface that we've kind of chosen um and has worked and you look at the success of postgres and mysql i mean it just it works right i think sql is actually in the middle of a reinvigoration and a revolution i mean i see more and more tools continually using sql people are putting sql in their projects to sift through audit logs or um just other types of interface and you know bi tools whatever right i think you have to be long on sql and i think there's certain things in tech and that come down to elegance and it's a very elegant um language and yeah i just i'm i i question why if you're taking on building a database from scratch something incredibly difficult to do it takes a decade at least to get a database to any level of maturity where it can be run at any like major scale my sequel is 25 years old and that's not a bad thing right when it's a data store you're building on layers and layers of of generational knowledge and running at scale right like you use my sql yeah you'll use patches from oracle google facebook the thing like fixes for things they experience running at large scale if you're building a database from scratch you've got a 10-year journey ahead before you you can even like before you can even claim um any level of sophistication and then to actually add the complexity of building your own query language and trying to explain to the world you're just fighting on too many fronts i wouldn't bother it would be my advice there i just don't see it i just like maybe something will come up i'll be very excited if there's someone builds uh a much much better alternative that gets mass adoption but i mean there's been a long line of people trying to do it yeah i i'll admit my bias i couldn't agree more i had a funny instance i think it was a couple months ago now where somebody was really pushing one of these new like innovative databases as this seems really cool like you're you use a lot of bleeding edge technology theo why don't you use this and my response was because sequels existed for 50 years and this has existed for 15 months at most and it's just that's i i will take crazy bets on things that i can change but my database is the source of truth for my business that's the one thing we can't screw around with like that has to be stable and then the week after he made that recommendation the entire core team for that database team left [Laughter] oh that's really unfortunate um yeah i mean you don't why screw around with the data stack right like if you mess this up you are in like business sometimes business sending pain right like it can be terrible to get into that situation where you're stuck on a database that doesn't work you've got a great story you moved from postgres a very established fantastic data store that uses sql to planet scale a my sequel back data store that uses sql the interoperability is incredible absolutely incredible i mean why would you throw that away it'd be like i don't know showing up and claiming you're going to just completely overturn a linux you've got a much better salute like solution you're going to just dominate like you just look silly i mean it's just standards there's there's elegance there's things that we're the great thing about tech is we can build upon sedimentary layers of progress right you like people to get their business started had to buy a server and rack it now they just have to go to a service platform don't even see the word server in the interface that's progress let's keep going like let's keep layering this progress so that because we move forward humanity gets going when we do more and technology comes to more people i just don't have much tolerance for let's throw things away or constantly and you know it's it's not it's not what i believe in really interesting and i can definitely say from my experience the move off of worker kv was much harder than the move on to planet scale because there was a standard on both sides that i could like make small changes around and have a working experience hell moving off of vite and on to next js and rebuilding our entire style system was less painful than moving from worker kv to a standard and that's like changing your data stack should not be scary and if it is then you probably bet on something very scary and yeah the scarier it is to move off your current data the more important it is that you do i agree with you i agree with you i wish you were coming from my sequel on um on rds though that experience is even better uh with the the the proxying we do it's like three clicks we we basically do the connection swap and everything it's that is the give like oh you know if you are using rds mysql and you want to try plant scanner you can be we we had a customer they bought the product they went through the flow and they were up and running in like two days um and and and the flow part like our like our part of that was um hours like just while the data copied like that the there's some great videos of of the um of that that like kind of connect we connect to your ids we move the data over online you then switch your connections to plant scale we proxy it back to rds and then when you tell us to cut we actually reverse the roles and street it's awesome and so i'd recommend everyone giving that a go because i think the team that put that together the developer experience i've never seen developer experience like that for for a migrating database usually you have to dump the database this is a fully online operation i love it it's brilliant yeah that is so cool i had no idea that the mysql integration was that good i want to make sure you don't out or undersell the smoothness i had moving off with postgres though because again i wasn't confident in my sequel to be honest like the scarier bet for us wasn't planet scale it was moving to my sequel due to the lack of experience we had where a postgres house i come from twitch which is a postgres house like every experience i've had has been pc equal and moving to the the scary oracle thing was definitely a a hurdle we had to jump how do you think people feel about a question for you how do you think people feel that about my sequel and and and maybe oracle's ownership of my sequel very bearish it's probably it's i would say the biggest pushback i get when chilling my sequel or showing planet skill honestly people are very scared of that i've heard a lot of interest in alternatives to planet scale specifically because it's like planet scale but for postgres is something i've heard a few times now yeah so it's interesting so our goal is to so we we we use my sequel because it's very good at what it does right it's very proven postgres has huge like huge user base lots of companies are founded on postgres and i'm i think i don't want to upset anyone i do think postgres is fantastic but it is a story as all of time as we hit scale we move to p to my ski it's my sequel it it it it happens right and i will just say when you you know a bit of inside knowledge when you run or work on uh at some of the largest scale of all deployments on earth now and then you try other databases in case you can do better on cost on anything and the fact my sequel still survives says something right like uh and and is supporting billions and billions of users um my you know if you look at the top 100 sites on the internet i would imagine that probably 80 of them are using using my sql or um it works at scale it's very robust operationally and i think where most my sql falls down though is the developer experience postgres ships features for developers that developers love um and they do a fantastic job of that operators love my sequel uh it the the the the tenor like operating my sql scale is a lot easier the tooling is fantastic replication is extremely good like that it's it's very good at that and considering we're operating it for you and we're providing you a developer experience on top it's absolutely the best choice like my goal and i know this is true because i know that um you know i've spoken to people and they didn't even realize plans guys my secret doesn't matter to them it's and i think as time goes along and we ship more and more features that no one else has ever shipped in the world of databases people are just going to forget it's planner scale right like hopefully it just becomes oh it's planet scale versus my sequel post cross cross i don't see of postgres for you my sequel world i think it has a very depressing conversation to have in 2022 because i'm more annoyed about what databases don't do and should be doing um and we're working on that instead i saw a couple comments to chat about graphql so i'm gonna go on a quick rant you don't have to jump in unless you have takes but uh i'm a big graphql advocate i love it i used to be a much bigger graphql advocate and i will admit to have over or to having overprescribed it in a lot of places if your frontend and your back end have a one-to-one relationship where those things are consuming from each other directly you don't need a wall in between them to talk about what that relationship looks like there are plenty of solutions like trpc swagger that make it way easier to define that relationship without having to like define a giant schema for that consumption that said for apps that have a shared like back end for different connection clients like mobile web whatever graphql is a phenomenal solution and it's one of the best ways to like define a relationship between your front-end and back-end teams as the scheme as a way to communicate the graphql query language is phenomenal but it is very important that you respect the intent of the graphql creators and the schema and the like what graphql is it is not a database it is graph query language it is not meant to replace sql it's actually the same complaint i have with trpc where it sounds enough like grpc that people think they compete or are in some way related no graphql is a great way to build an api on top of your sql database or on top of any other database but anytime somebody says what if graphql was my database i get really really scared of what's going to come next i think you just yeah and i think people have started there are people who are working on databases that natively just do graphql and i think that's a really bad idea abstractions are good they you know we so at github we were a very early adopter of graphql um and we had issues like okay so i'm not an expert here i and i don't have a very rich set of stories about the problems of graphql i'm told it didn't go great but i don't think that's anything to do with the language i think maybe our implementation or whatever but if we'd also bundled that like attachment to the database instead of it's just the thing that listened for the request and then sent sql is different i mean swapping out with that layer is much easier than um oh now the database is what doesn't work as well it's like what more can we do to ourselves to cause problems i i mean it's it's you that's the great thing about abstraction right is people can talk to the database and sql and look graphql came from facebook facebook runs my sql um you know you can have these great layers of abstraction and it and it works fine and plumbing all this together is a seems wild to me yeah couldn't agree more i yeah graphql is a big thing to bite on as a full stack like solution because you're now changing how your client queries data and you're changing how your database how your like backend presents that data and models it but you don't have to also change your database in the process that that is very scary to me and also like importantly is not the intention of the creators as you said with like facebook like graphql was built to make it easier to work with your back end not to replace it and i think it's important to to recognize the difference there as i've seen more and more people doing like graphql versus sql takes and on top of that a renewed interest in platforms that generate or graphql apis or even swagger apis on top of your sql model that's a relationship that i want my developers to define i do not want a computer to generate my database as a service my database is not a service my database is a database and my service is my service and i want to define that relationship even prisma made the moves themselves where prisma originally started as a graphql like platform to generate a graphql api against your db as originally named graphcool they transitioned to the prisma that we now know and love as one of the best ways to interface with your database in typescript so that you can define the layer instead because they noticed more than anyone else in the space oh [ __ ] automatically generating these things is not the best thing for our developers long term correct yet um i believe graphql also was there to solve some org problems too and a lot of tech is done to do that i mean we're gonna you know architecting properly with your technology to help your organization move faster is also really important it's not just down to raw kind of technical arguments and it's very good at doing that um and i agree it's just in a prisoner gets to work with a bunch of other um databases because of that right they provide the extraction they do the grunt work and that makes it great for for everyone else absolutely i've even credited graphql and how well it helps with the org problem is being a big part of how i i started as a full stack in quotes developer that did back-end and would complain about the javascript whenever he had to touch it i did a bunch of video infra and like safety tooling at twitch with that stack i moved from elixir to golang and then twitch started investing heavily in a react type script rewrite off of an old ember [ __ ] show to be frank and during that rewrite we adopted graphql really heavily we actually had tony guida awesome dude one of like the original contributors for graphql gophers and i think he was actually the initial commit for it built like the first big goaling graphql client aerographical server for uh go and we shipped that super early and what was cool for it is the first time i had the experience of sitting down in a meeting with a doc that was here is the relationship between the front end and the back end once we agree on this schema we can all [ __ ] off not talk to each other for three months and come back together plug it in and if it doesn't work somebody didn't honor the contract and i never had that experience as a developer and funny enough it gave me the confidence to the first time in my life move all the way in on front end because i didn't feel like i had to be solving the back end problems for it to work i could trust the schema and if the schema wasn't honored that was the back-end developer's job not my issue to go solve and i will always love graphql for frankly letting me move to front-end more heavily and turning me into a real full stack developer as a result that's awesome that's really awesome yeah software engineering is so funny actually we obsess over how we work as much as what we do like i think most of the working world goes to work and work right they know what their job is and they work we we have this additional kind of layer and it's really amazing um we actually really introspect and think about how we work in the process of our own work and we build our own tools to do the work and and i love that about our industry i think it's fantastic i think it keeps us on our toes it keeps us moving forward and applied correctly with a nice sprinkle of pragmatism something that's extremely important um yeah we're building something awesome i love it i i really you know it's such an amazing industry to be a part of yeah we're engineers we're builders it's our job to solve problems with technology and have people deal with them less to me it makes a ton of sense that engineers are really on top of that if anything i almost think it's too much like a fun real realization for me was coming from the creator and like audio video like media world seeing how much innovation goes on in a given week in the software dev world in wishing desperately what if i could like steal these things and bring them back to creator land where they don't see innovation ever like right now i'm streaming using an open source piece of software called obs that has been the gold standard for doing live streams for at least eight years now and over 90 of the top 1000 streamers on twitch are using obs or a fork of it because of how essential that is as like it is the creator world sequel and we're not seeing any of the we don't have a planet scale for obs yet we don't have these innovations on top of the platform because everybody is kind of in fauna land trying to reinvent it rather than acknowledge the strengths right the platform has and it's cool being i like to call us the first unix philosophy company in the creator world where we're building a really powerful input and output that is standardized enough to work with most of other people's setups yeah yeah uh that pragmatism and that kind of approach yeah i think that's the thing i used to write i've railed about this for years i didn't i did talks about pragmatism throwing things away not being pragmatic using the newest crazy fancy tool or whatever i mean you then get you get too far in the weeds and now you're all you're doing is working on what you build and like um what you're building uh instead of the product and and all of these pro and it just doesn't help i think you know so okay you've just to create a company and create a product and i was surprised by this but how you know how easy do you feel it was to just get going as a company like like do you feel there's big missing things that you can't get from a sas provider now there the things that were frustrating were frustrating for stupid reasons like here's a fun one we couldn't sign up for rippling when i first set up like hr and payroll because i was the only american employee at the time and you have to have a minimum of two american employees for rippling to take you in so we had to use a different hr and payroll provider that's been less consistent for us and the move off of it to rippling now that we have more employees is more painful than like right not but that's the weird thing is i i feel like a i feel like i'm architecting an aws cluster trying to keep together our like business in terms of how i yeah my job i don't have too much experience for before the sas revolution of starting companies and every yc company that had a bad idea being forced to build the hardest part for them to like incorporate around and that trend alone like half of the companies that we use to handle all these things are yc companies that pivoted to a problem that was hard for them so that's all helped but my job has moved away from managing like 40 connections to like different teams and whatever to try and architect all that to managing 40 accounts in like our notion like 40 plus for all of these different things and making sure all of the inputs and outputs are linked to the right places and then i forget to have or give fondo access to our deal account and now they can't run the right tax for a specific state and yeah it's way better but we still need our firebase moment in starting companies if that makes sense yeah i wonder where that's going to go it still surprises me that you know so i haven't you know i haven't been i've you know purchased lots of software in the world of tech before but never been involved in purchasing hr software or payroll software before or and it's just amazing how much is out there yeah rit team is fantastic and we have this beautiful octa login that just has every tool that we possibly need and it all works and it's wonderful and it's just to me it's really cool how you can leverage all of this stuff and that's why i love infrastructure infrastructure is all about leverage right it's how much can you just how much lift can you give in return for little action and that's why i love doing what we do here at plan scale but it's amazing how much leverage can be gained starting a company and using all these kinds of tools and us being part of that is really really awesome and and similar with other providers that provide parts of the stack you can just go and build it's awesome i'd say one of my favorite parts has been the accessibility of the smaller options like going with a smaller hr provider instead of a big one where i can personally email or text the ceo what's up going with planet scale instead of rds and knowing i can hit you all up to fix things like as i mentioned before it feels like i have one of the best in class developer like database or database development teams in the world working with us just like another member of the team but i'm paying them exponentially less and that feeling is really cool and it's definitely part of like given the decision or the choice between like a a large company has existed for a while that might be a little more work a medium company that i'm confident can solve the problem but i'm not confident i can get good support from and a smaller company that's 80 percent there but i know i can push them through that last 20 percent i'm always going to pick the small company for us to bet on absolutely absolutely and um i want to make sure that our support and the way we interact with people scales our support team are phenomenal but you'll see as well like our engineers are just they're incredible and they love our users and they want to hear from our users and support our users and i spoke to someone a while back and they're like oh yeah every time i tweet that i'm having like a little issue or a question about plan scale three engineers of yours reply and i could jump on a zoom with them and that's just amazing like it's because they like truly care about about like that we really are building the the tool we would want to use right like we jake truthfully we're all scratching an itch of you know we've we've got all of this like kind of scar tissue um from years of scaling databases and and and we just want to build the product that everyone like we would all want to use at any point in our career and that comes down to support and that interaction with users and it goes right up to the top end like companies that are rocket shipping and growth and um adding terabytes of data a month going wild they come to us because they know we've also seen the things that happen around the database and quite often we end up you know with our customer engineering team that again just i know the customer engineering team support loads of those companies you see on our homepage they they there's nothing they haven't seen just like nothing any like so we end up explaining to people like the downsides of the database or like they now they bought the product they want to move from this old data store or whatever we end up like working on rollout strategies and how they would move and deploy their applications in that sequence and it all comes down to just having that very human connection with the product and the people building the product and something i'll be keenly focusing on as we grow over the years is making sure every customer that comes to us gets that awesome experience of oh i'm buying from someone that understands me that that really care about my success that's something that i will always try and focus on this is yeah it's a really good point something i've felt and trying for this one one of the cool things about the developer world it like all these new developer tools and experiences is every single one of them has to be built by a developer so someone down the line understands our problems as developers it's a matter of how empowered are they to be the one to speak up and like communicate back and how good are the processes to do that where i felt the most pain here is the things that are just outside of engineering like i would argue av tech is surprisingly close to software engineering in terms of the amount of engineering involvement that should be expected and is necessary but it's so different in terms of the likelihood that the engineer on the other side understands a [ __ ] thing about the problem you're dealing with like i one of the most frustrating realities i've experienced was realizing that the the vast majority of people building like mobile applications at a media company did not use that like platform at all and they were there to show off their like progress in swift and the new apple apis and prove that kotlin's super cool not to help the users and the creators on the platform they were built before right you don't ship your back end you know you have to build that experience that's why the word developer is i'm actually gonna i use it a lot but i'm gonna stop i think because it's getting ruined now it's becoming the new like every company now says they focus on developer experience and it's like okay what do you do and they're like oh we have an api it's like brilliant you caught up with 2013. um like they just they don't get it right you can tell the best products uh built for developers are built by highly empowered and trusted engineering teams like they are the folks if they are producing something and they are trusted to shape it into the thing they you know they would love and if you hire people with great taste you produce amazing results no product manager shuffling around kanban boards is ever going to produce that magic you just have to let people run and you have to trust them and everyone at plan scale but especially the engineers that design the things that we all interact with as humans they have so much trust to and and to go and like iterate and evolve and consume and use and and that's why we produce these results and i feel there's a lot of companies trying to catch up and you see these like companies trying to do the serverless database thing now right and you can tell that they're they're mimicking the movements they're like it's cargo culting right they're kind of like doing the actions saying the words and then you use their products like you fundamentally don't understand what you're building you've just latched on to the next thing yep i i've experienced this so much that i am skeptical to try any product that i can't like talk to the like decision makers of if i can't see you talking about this thing and understand why you built it i am significantly less interested in using that thing period and if i like especially in this space one of the reasons i was so interested in planet scale was knowing your history at github and the company's history building with and on top of the task and building for all the different like customers and like users you guys have had forever tests and planet scale forever now that was a huge decision maker for us and it's crazy how often i don't see that uh to shut up jason once more one of the more like mind-blowing thing i've talked to jason a lot about how the hell he became one of the best best developers i know in under three months from first line of code because to this day he's one of my favorite people to talk about new complex engineering problems with and i just wanted to figure out how he learned and he shared this idea of applied wisdom where all of this information exists on the internet all of this benefits us or it benefited somebody in some way that's why it's there nobody's writing a blog post or sharing advice where that didn't apply to them or they didn't believe it applied to someone in some way but it is our responsibility as the consumer of that information to distill who wrote it why they wrote it and tunic said their bias in the advice like why does this person think tailwind makes a lot of sense how did they use tailwind to solve their problems and the way jason approached this issue was okay i know i want a better system for my styles i know that my fonts look bad and i want to be able to solve these problems more easily i'm going to look into different solutions he heard about tailwind he went to their website and rather than going through the docs and reading it obsessively he went to the er adams who's the original creator of ceo of uh taiwan's portfolio and he read the source code for the website to see how they use it and what it's doing and from there he distilled this makes a lot of sense for me this this wisdom applies to what i want to do i should use this that's a really awesome way of doing it and it's all within it's setting it within context and putting it within context uh and i think you can fail any technology by your use of it and we don't people don't think about that enough right it's like uh this thing sucks well you know okay like someone could say postgres sucks whatever they and then you find out they're using it as a message queue or doing some crazy you know what i mean it's just like some silly thing they shouldn't be doing uh with the database we have to be deliberate and intentional about how we choose these things and do the and uh and do these things yep i i think the problem i see the most is a failure to build context on both sides both the the presenter of the thing they're excited about being too excited to to do the part where they built the context i direct call out the remix community is incredibly guilty of this they think they solved every web problem they solved a few problems really well but they failed to contextualize the problems they solved well enough and as a result lots of people assume this is targeting my solution space this doesn't work for me now i am mad but that's a failure to communicate the context in which that technology is strong as a result i at this point just assume every person sharing advice and giving tips is bad at building that context and as a result i recommend us as developers get used to building it ourselves when you see any tip any piece of advice and this goes for me too when y'all are here listening to be show the things i love i expect all of you to take the time to go through why i love these things and what i'm building with them to get an idea of if it is the right thing for you right and we should like i think technology should express its opinions very clearly and like interfaces are so powerful and and standards um that's one thing reason i you know i think the rails community does so well as well as it expresses a very strong opinion of how things should be built and hands back a ton of freedom there um and obviously we saw rails do very well at github being one of the largest in in the world um and but rails comes with an opinion right it comes with its style and i think that helps people learn and get up to speed much much easier and they express it very deliberately i'm so i'm with you i'm completely with you interesting to contrast that i'm curious what your thoughts are on things like beam and other examples of how the pieces assemble because i find those to be some of the most useful projects to put out and i'm surprised at how few companies i'm seeing taking advantage of the opportunity like beam's interesting because in terms of the tech there's only one piece of that that is built with planet scale technology and i could argue it's the easiest part to replace in beam would be planet scale putting that on a different database would be much easier than changing almost any other part of the project but i think it's such a good example of being where the developers are and being able to like have those communicate those conversations share examples and have a great place to start the learning from i always like going back to source and having a simple focused source example to work with is one of my personal favorite things and i'm curious how you feel when you look at something like rails that has all these opinions and solves all these problems and where you're at where to some extent you can't have opinions you have sql sql has no opinions and you have to build on top of that where do you guys think you fall there what's interesting is that we have a very interesting challenge right like you know we have users using java we have you yeah we have to stay interoperable but i try and keep up with the community and the folks building the newest of the new because we learn like we learn that tech is generational and someone is always working on something new and exciting and i don't want to miss it i want to learn and see why people take our tech and hold it differently and understand and learn from from their use so i try and understand these technologies and why people do these things and it was obvious and natural to us to put beam out with the stack that we did because it's where a lot of our audience are we obviously have a very large enterprise audience but we also have this extremely large and very and growing very quickly um like audience of developers that are building this new stack beam has got beams there's many reasons beam is out there in the world so first of all beam started as a on us needing a communication tool that was like team at github like so t so a lot of us a bunch of this company is from github but there's an immense amount that aren't but we're all remote and we all want to represent ourselves in one place and so we you know we created beam and you know it's beautiful and we thought you know we should open source this to the world the world should see and get some value from a tool that you could just use internally at your company and if they use plan scale with it that's really great that's nice but we love open source first we believe in open source um and so it really came from wanting to give back but also provide a tool that's a good reference right you can take it now and like say you wanted to just like do a video that's a demo of of an app you need a application an application and you have to always make one up right and it's always really awkward and annoying to try and make up so we just thought well it's a real app has real use inside a company people can use it for demo apps we can use it for whatever super easy to build on tutorials tutorials on top of so we went we went that way that i have to have a bit more interest i think it's so interesting i am curious in terms of like staffing hiring and the like the team obviously you have tons of database experts but it also seems like you've been hiring really awesome like user experience people too i'm curious how much things like beam are them looking for more user problems to solve versus how much it's relating with your customers by building things like them versus how much is the desperate need for that communication tool like like what's the split between those things and do you have like a good gut feel of how the like more user experience focused engineers feel about their day-to-day work yeah actually okay so first of all we would have built it regardless like you know yesterday it was one two three four five six seven uh seven beam posts and a company of 90 people right like it's got high use for us we needed it like when i uh uh you know and one of the most experienced database engineers we have just a plan scale but also in the industry is a guy called shlomi um he was he he was at github but he came to planetscale before i did when i showed up my first meeting was like right what can i do for you because i missed team i was like okay let's get going so we built an early version and it was not the beam that you're seeing now we we went for a new kind of approach made it really nice so it's it's all utility um our front end engineers um and our and our design team as well like we have we have um product designers and then we have brand designers um and we they all work in unison they like for example when we're picking colors that go into the product we work with the brand designers to make sure they're unified with all of our marketing and so i'm going to speak for all of those phenomenally talented people when i say um they all i think they love their work because they they take on this challenge that most companies would not in the sense of taking very very deep tech and delivering it in a unrelentingly simple way our user for interface is incredibly simple and our marketing is incredibly beautiful because we really respect the craft of what we're trying to do and um put it out there and scully's in chat and i can see she's one of our immensely talented designers and and i spend my time i mean scully can tell i think she i spend my a lot of time with the design team a lot of time and and um it's because i really care about how things look um and and so do they and we have this healthy tension in the middle of back end folks solving really deep problems and front-end folks that don't understand don't know don't like don't wouldn't even begin to and we don't want to resolve that like we want their user journey of i want to be able to give it do this this this to be possible with the back end tech and that's what data most database companies don't do that they're like here's the thing here's a here's a docs page with 25 commands to run to get what you want we say well it should be one step right so like that import tool we had jason long who is our one of our product designers and was one of the earliest product designers of github one of the earliest employees of all of github so if you wonder why get plant scale looks familiar it's because it's the same person um that spent a lot of time designing both products um and and making it beautiful and he knows the rules of developer experience knows the rules of explaining these like hard concepts and then we just work so it's it's a hard job they do an amazing amount of work because we just refuse to put cli commands that and all piping this and shove this variable there and do this thing i can't believe i go and look at the instructions to do the same operation on plant scale and another thing and it's like five pages long and if you go to our documentation shout out to holly it's phenomenal it's like it's really good but it's instructive and it's it's there to give you a sense of what we're doing for you and explaining it to you and how to get you through the user journey it's not just a list of commands blurted out of you so we spend as much time on design as we do back end that's a really interesting way of putting it uh an idea that was being like hinted at throughout there is the idea of almost letting your fronted developers be as close to your like ideal hard-to-get customer as possible so that you can have them as like an internal like testing ground but more importantly intimately familiar with the pain points like if your front end developers got too familiar with databases they might not notice the difference between a one step and a 20-step setup because they're so familiar with the 20 step that it feels like one step to them 100 we talk about ourselves being optimistically unreasonable like the reason and the other reason i spend my time with like the javascript community is the you know i do you know i took to guillermo or something and he'll say well database should just do this and it's the big should right okay we can all say should but he's right they should it should be this simple we should say should a lot about our product it should should be better we should do better so i love working with optimistic and unreasonable people and we're deeply unreasonable like we hold stuff back we redo things when they're not to our standard because we want to and i'm not even going to justify why i don't know why because i want we want to [ __ ] it i'm i don't know if i'm whatever i swear all you want no this is cursed all the [ __ ] time go nuts yeah like [ __ ] it we really [ __ ] want to do it i mean like true but truthfully truthfully it's just our standard i don't want to put ugly [ __ ] in the world anybody software is gross like we and we we could just have really boring solutions pages that talk about like all of the enterprise goodness and all of the stuff that our database is wholly capable of but why i mean this to me the iphone is one of the most inspiringly wonderful devices they had to work on the lidar standard to be able to do face id on unlock right but it's all hidden behind a single pane of glass in this tiny you know that's what we want to bring a similar level of pot i mean we'll never get close to the iphone as a work of art but we we just we just want to produce something so powerful so simply and that's why we're not cluttering up our ui with all of the other unactionable crap that every other database provider wants to shove in your face i really love that framing i talk about the right way to put this question one of like the interesting ideas and this gets pushed on me just as like a recent founder is the understanding and working for your customer an experience i had a lot working at a place like twitch was the average person's customer wasn't twitch's customer in the sense that a back-end developer's customer was the front-end developer the front-end developers customer to some extent was their pm and their designer but it also was closer to the user the pm and designers customer is definitely the user i found it was important to have everyone top to bottom despite their immediate customer not being the twitch user i found it benefited everyone top to bottom if they had a better understanding of the user so an interesting thought i have with where planet scale is it almost feels like by both like the need of the product and by the sheer way things happened everybody at planetscale's customer is the planet scale user in the sense that the database team they're providing the thing the users are using the user interface team is providing the experience those users are having and all of these people also are the customer of planetscale's products you've like blurred these lines so far that it's like a big blob of everyone kind of getting it and i really enjoy it that seems surreal to me yeah and and that's why i'm really nervous to apply much process we don't have product managers like cloud scale by the way not a single one and that's deliberate because if you spend your time very deliberately thinking about the user the customer you listen and you you discuss and work with that tension and use your own product um you can build something really really amazing and product managers i'm sure will will will be somewhere in our journey maybe they're not that i i will actually say no i i the a large part of pm's jobs is incredibly important to companies um and we will hire people to do their very essential things of talking to cus like we do talk to customers we do use a research we do interviews we do all of it like you know you'll get you're you're gonna experience this next week right like you're gonna go and experience the product early get your feedback and then we'll we'll do the same with someone that's running a majorly large massive website and get their feedback too and synthesize and rethink about it we'll do all of those things like we're not hostile to that way of working but the people that decide the roadmap it's a discussion between myself uh nick who runs engineering and our our engineers that care right like a planet scale an engineer uh or a designer or someone in market they're all perspectives and they they speak at the highest levels about our product we are highly cross-functional and you can have someone from any part of the org shepherding delivery of something because if they have the most context it's not about title or rank or whatever we're open to learning and listening from everybody that has a perspective and we discuss it and it's it's a really awesome thing about our culture and a large amount of art in our culture is designed is defined by those engineering philosophies yeah this is very this is a relief for me because this is very much how i'm trying to build what we're building and it's awesome to hear that at planet scale scale it's still working like like knowing that my my disdain for process getting in the way of solutions can get up to 90 people that's a huge relief you can go a lot further and go to 120 000 people there's less than 20 people at all of apple that decide what product delivery looks like that's the human interface team the the human um interfaces team app will pretty much decide um and again they have no pms in that org either they work on everything and it's that you know layering of hardware and software together to create something incredibly beautiful it can be done at massive scale it's how the most beautiful products are built they are not built by committee they are built by small teams of people with massive amounts of context and a love and dedicated for user to get dedicated to their users that hone their craft they're obsessed with their craft and we are going to scale that those if we lose that we lose our soul that's really exciting to see and i hope that i can stay close enough to continue learning from all of the lessons that planet scale has been learning throughout speaking of one last lesson that i've taken from planet scale it's a bit of a a topic shift but it's also one of the more exciting things you all have done holy [ __ ] the pricing how much cost are you guys eating on that reeds change because that is absurd our free tip our free tier is spendy luckily again our fantastic infrastructure team have worked to heavily optimize it like it's very well optimized it's not flabby um but it cost us a lot of money and you know what like our larger customers make sure it's paid for right like that's that's one thing um and uh we want to be there with you when you're starting your business right like again we don't want to um have have people um uh kind of forking over their credit card on day one to get something done we want them to just build build build um and so we made an extremely generous free tier so we we analyzed our own usage as a startup and we were kind of like okay so we've got this many users um we have this much going on like should we be paying for this now that's honestly that's how we thought about it we didn't we weren't like how much the service cost underneath we were like when is it like kind of like oh we're doing something serious with this thing and like 29 bucks is not unreasonable for what we're doing that's kind of how we felt it out um again that's user-friendly that's user-centric uh in how we do it and then we worked out we could make it even cheaper with the resources we could we give you a test cluster on the hood we worked out that with the resources that were available we could give you more so we did and now i think you could run a pretty media app in the free tier and we have a channel when people upgrade and p uh and we see it uh like we just see here like whoa someone's upgraded to the scalar plan um and that happens nicely frequently and that and and that's great and we have our very large enterprise customers that we serve through our sales and in the meantime while you're building your business or you're running your blog it's on us and we love and we and we make it that way the sales alert channel is an essential and i cannot wait till it gets noisy enough that i feel like i have to mute it but we're not quite there yet we're getting there i know you want to take a quick break i want to make sure everybody in chat has opportunities to ask questions quick so if you want to run i can field some questions take your time well yeah any of y'all got some questions for us i this has been super cool so far and i hope that y'all are enjoying this as much as i am this has been one of my favorite interviews so far anybody got questions for our friend sam when he gets back no questions blame someone's got to have something i saw somebody mentioned that my sequel was the way to like learn and get started and postgres was production that was one of the the things that i was scared to say out loud because that could become the entire conversation but that was an interesting point that i i couldn't disagree with [ __ ] sequel light is how you start everything else is how you go to production and scale but uh that aside the chat's been awesome you guys have definitely gotten it overall switch the scene back over for our friend sam w back no questions so far uh cat's drunk in a cav on the way home our our legendary creator of trpc always likes these yeah it seems like everybody's been loving the conversation so far uh mohammed mentioned that the pricing was suspiciously cheap i would definitely love to talk more specifically about the change in reads like that was strange to me because i already felt like the pricing was so cheap and it went from cheap enough to be ignorable to cheap enough to be invisible at the same time i know that there have been users who have had problems around the things like the lack of foreign key constraints causing them to just do way more reads than they intended because they're going through every single row in a table to find one field i'm curious how much of this was to make the cost invisible versus how much of this was to make like developer mistakes like digestible if that makes sense interesting i think it's the first but has a nice like second order effect on the second um so first of all we had people make mistakes in the early days they got bitten that's the that's the big downside of serverless pricing right i think we both know the article that inspired this question and you know we comped the month the whole month and we have currently there is nobody who has ever settled a bill after making a major mistake we have we've sorted them out we understand um there is a few things in our road map coming that will mean that making mistakes like that are just not an issue um there's some great stuff coming that will and many actually like there'll be three or four things that are coming that will mean that that's not even much of a problem but the main is we looked at what people were paying and what their bills were and we were we we wanted to get make our friend our pricing really friendly really intuitive because again like you can't claim to do the things we want to do uh and to love your users then have hostile user pricing it when you see people that are like oh yeah i started i did a i did some tutorial on aws and now i have a 400 400 bill i know and i didn't want anyone to ever experience that and we felt really bad when someone actually ran up a big bill but immediately we were in seconds we were out there settling sorting out making it happen um so yeah we just wanted pricing that was extremely fair and and friendly to developers who are our core audience you know we are developers we love developers and so we just kept refining it we spent a bunch a bunch of time on it looked at a lot of data to understand where people like it's also the the first pricing you saw from us was just like us just taking a shot in the dark i mean like let's do this we're going to market whatever and then now we've got loads of data on usage data and got some really interesting proportions between writes and reads and understanding that people are doing a lot more reads than we thought reads are kind of when your applications sub optimal that's when they really creep in people's like get m plus one problems or they're doing some really unscalable things with reading they're reading they're not caching properly so reads are where people get heavy when their application but we also don't want to force users to have to optimize to stay within a budget we want them to move fast so that's why we kind of got super generous on reads want to guess how many reads my stupid pokemon app got to it was over 90 mil for a little bit oh wow see yeah i mean through the stakes there i redid the cache layer and that helped a ton just taking advantage of next like intelligently caching pages and like invalidating them like not on every request and there was definitely some users who uh took advantage of how forgiving the api was and sent like 20 000 calls to try and force dialogue to be the roundest pokemon so yeah that was a fun one but it's back in the free tier so thank you for that that's good i'm glad and that those you know so many funny stories from the github days of developers doing things that seem kind of innocent and normal against the github api and causing just unbelievable amounts of problems and traffic and what it took to fix those and uh yeah it's a never-ending issue yeah i've definitely felt that a bit at ping in terms of like we built a primitive to make it easy as hell to take somebody's video feed and put it somewhere else and could not have guessed the crazy things that some users are doing one of our early customers used the tech that we built here to have a guest or so he runs a organization for vtubers which are virtual avatars where you have like face tracking software animating you as an animated character usually live on stream so to allow these animated like avatars to go out in person they used our tech they took an embed which is like the technology i used to get you into my stream full screen that on an ipad strapped at somebody's face and had them walk around tokyo as the v tuber in the real world using our tech we could never have imagined this use case yeah that that's actually another fun thing is you learn about the companies that use your stuff and get really excited about it i love looking up the companies that upgrade and you see so many things like we had a really great one as um we were like oh there's a customer that's growing really quickly on the platform um and we looked who it was it was solana they're they're powering their community and they're and they're citing everything off planet scale and it was like that's cool that's really awesome we're a web 3 database without even without even realizing it without me fully understanding web 3 yet so you know that again you get excited by proxy right and so we had another customer um playboy they launched a new platform um and when they were going live like i was getting all excited i was like watching the press i was like they're on planet you know you just get super hyped about what they're doing and so we're in slack with them helping them launch all of that you know it's just really cool to be part of it yeah scully's list and pokemon that one that i don't know so i'm gonna have to look up that pokemon i used to play perfect i played but in the old old game boy days that was when i was uh i haven't played it in years i i am definitely a pokemon millennial in the sense i got in gen 3 which is probably right when you left like ruby sapphire emerald and i'm a firm believer in the stance that the older pokemon specifically gen 1 and 2 were weaker in design and the reason people continue reaching back for them is nostalgia not design quality and specifically from like generation 4 and 5 upwards the quality of pokemon design improved a bunch but was frustrating to like players because it wasn't nostalgic enough oh yeah i am a huge pokemon fan my only non-tech videos on this channel are pokemon reviews and skateboard videos because everything else is engineering it's a huge uh like passion of mine and i've always loved the pokemon scene nostalgia is incredibly important actually it's very funny scully who's doing some design right now for our new feature has some very nostalgic design um as part of the feature ship so you'll get to see that in um not that i'm aware of uh the they maybe that's why they moved to plasca they were previously having database outages interesting i don't know too much i have stayed out of web3 for a while now personally but it's really cool to know that groups like that are on it's also nice to know that you're with us in the the pool of people who didn't know that their platforms were going to be used for like risk a and sfw and like sex work stuff that ended up being cool as hell like that's it's cool to see like when your technology is good people all over the world you would never have guessed start using it for yeah crazy things i know i love it i just whatever helps them like help their users one question i saw come up earlier and this is always going to be the one we touched on it a bit earlier but the idea of like how is my sequel better and different from postgres there's also a question earlier about how it was a question it was like a a mention of how a person had heard that my sequel was the place you start and postgres was the place you go for or to for production which is really strange to me especially when i know stories like planet scales and there was an uber article you shared a while back about how uber moved back to my sequel primarily due to like the separation if you're down want to hear a front-end focused full stack developer do their best to describe why my sequel is different and better and then you could come in and correct all of my mistakes yeah awesome go ahead so postgres is a phenomenal open source technology for like strong data system management with like direct access to that data when you make a query in postgres you are calling that exact data structure and getting the exact representation of that out my sql is different in that the query client and like the resolver layer and the actual data system that back it are separated and that separation allows you to do some crazy [ __ ] as far as i understand so the story the api that serves queries in the back end storage engines are completely separate and that's actually that's why in came to existence so innodb is an absolute marvel of engineering um truth truly is an incredible piece of technology um and that is the primary back end storage engine for my sequel now and it was actually built by oracle and they built it as an open source contribution um before they owned my sequel it's a really funny story they they and it is incredible technology and so it's got this pl the plugable back end um and that makes it really powerful to there's been a lot of storage engine like iteration which is it's pretty incredible i don't want to say there's that my sequel's better than postgres i think it's different with a different set of trade-offs but the thing you're saying about how a lot of my major websites move to my series is true i mean there's just i mean there's so many stories of this so many um and span and and it really has surprised me how much of our very large customers that are coming on board are coming from postgres right they they hit scale limits and and i want to do a post on this one day because we don't have all the data yet but based on what people the data size and traffic volume that people come to us anecdotally they come to my sequel customers when they come to plant scale with scale problems have a lot more traffic than the postgres customers that come to us having scale problems like i know like a a lot of the in postgres installations that people are coming to us from um would be totally fine on vanilla my sequel so it's a very interesting thing to see with postgres but but i don't want to say bad things about postgres it's powering so many websites um and so many cool products and it's a great piece of database technology i just think they haven't made their focus um you know very large scale and that's what we're here to do and ultimately we're here to make it a non an irrelevant thing right um you should just know you're using pound scale and feel great about it hopefully i'm definitely getting pretty close to there funny enough the frustrations that i have are not things that are like i'm used to from postgres that my sequel had it doesn't have it's the i don't see yeah the compromises that exist in moving to a fully sharded data system such as uh the vitesse and planet scale and i'd love to talk a bit more about what your stance is on things like foreign key constraints strains cascading deletes and some of the things that you don't have how much of that do you feel should impact developers how much do you think it does and how much do you think you like planet scale stance on these things is the right call not just because it lets you use planet scale but because those things do hurt scaling and like potential like data consistency long term yeah so if it was not to trade off like there's no philosophical like we have no philosophical disagreement with foreign keys um at all and we obviously people can use phone keys we just don't support the constraints and you can do cascading deletes if it's supported in the orm like if the rm isn't relying on foreign key constraints so we didn't run with foreign keys at github and we used active record and you could use you know um uh dependency delete i believe as the call and you can do cascading deletes to go down through all the dependency tree and delete those objects so it's doable it's um but yeah we don't support it right and and there's a reason for that um they don't fundamentally work with the way we do online schema changes they're very difficult to do in a shouted system and the idea there is we're making a trade-off for you more developers tell me they're terrified of making schema changes when they have traffic on their site um then they do tell me that they desperately rely on foreign keys and i know some do but we've made that trade-off so that people can scale more seamlessly and not rely on fundamental patterns that just disappear over the long term right like if you can like i think about this like when someone uses and builds against any platform that you build you're making a cookie mold and their applications get baked into that mold so it's your responsibility to choose a cookie mod that shaped them now the analogy falls down i mean i don't know why i started with cookies but the point is um it's your responsibility to set the defaults that are sensible that work will work for the future won't betray them when they're like oh i loved this at the low end you talked about some low-end databases earlier that like developer experience like this was amazing oh my favorite version of this is the distributed sql crowd that all their marketing is like oh you write to tokyo and it shows up in new york magically instantly with no trade-offs it's like bull utter [ __ ] if you've built any system with latency in it you know that's a complete nonsense and it's lying to the users and then when you look there's a million caveats on their um documentation page that explain why we know that's impossible and whatever serialization doesn't work and everything right so this just falls into that category of like we're not going to try and fake it for users we genuinely believe that the trade-off we've made to allow seamless massive at-scale schema changes happen and not be able to support um foreign keys is the right one and if we could magically and it worked we could but it doesn't so we're there unfortunately same as less we're not going to pretend when when like you know as we allow more and more easy ways to scale your data around the globe we're not going to do it the irresponsible way that pretends that multi-master global distribution just works out the box we're going to do in a way that accurately kind of shows the trade-offs of building systems that are distributed very interesting and i'm so much more excited for the conversation on monday knowing like this framing of things it's yeah it's a really hard spot to be in where in the standard there are standard practices that make the standard way harder to scale and i just like a dumb example from the web dev world that i saw was the create react app is having a bit of a crisis right now or they moved over to web pack five and one of the cool things webpack five does is it stops bundling your node.js built-ins into your build if you call them so if you call fs or crypto inside of your react app that shouldn't have built and it finally doesn't anymore but as a result there's a ton of people freaking out about how their create react apps broke with the latest version right and i'm curious like phil i i know the 400 key constraint thing isn't a philosophy but at what point do you have to make philosophical adjustments to meet developers where they already are at the knowing that that will compromise some point of the scale or the way that planet scale builds yeah we are always open to feedback and listening and we will continue to weigh it um the reactions and excitement to being able to do like we've come to cus the customers have come to us and they've said it's been six weeks since we were last able to make a schema change we just can't do it like it things go wrong they break you know our application is like like we've got three features that need schema changes to ship right and it's a major serious problem the customers coming to us with excitement about the features outweighs the ones that are worried about foreign keys like it comes up now and then a bit on twitter but it hasn't been a blocker for anything big currently um so our ears are open but it'd be hard to imagine we would fall away from some of the really cool stuff we're doing and going to be doing in the future to to bring back foreign keys i think you know there's lots of iteration cycles left time is you know we have time on our side you know you never know there may be a solution that that is better does something better does something differently is better in our system we're always listening to those concerns um we think about it a lot i wish we could um change it but for right now it feels like the right trade-off based on how things are going that makes a ton of sense i will say i have the concern of like responsibility shifting where planet scale's done a phenomenal job of taking a lot of the responsibility of good database management steward stewardship away from me as a developer and just made it the default but there are practices that are necessary to continue operating that database well that are necessary at scale and it feels as though to some amount things like 4k constraints have been like that responsibility's been shifted up out of planet scale space in order to make planet scale the best solution at what it does how important is it to keep track of where that responsibility lands like right now it falls on active record or prisma prisma's i'll be frank i don't know how many persons people are here it's not working for us the prisma like uh or uh four key like relations that are built in using like the prisma wrapper on top error every time we try and cascade a delete if i have a room that we remove the user in room mapping should be cascaded and instead we get a production build er we get uh like a runtime error that's an obscure rust binding thing i wrote an issue a while ago it went stale it's whatever i'm not trying to vent about a specific issue so much as that shift in responsibility where the problem is the databases like decisions and assertions and i agree with those assertions but now that the responsibilities left planet scale the likelihood of that responsibility being handled correctly has gone down dramatically and i'm curious how you mitigate those problems both in like the design of planet scale and its product but also in the relationships you build with these other companies like prisma and how they solve the problems on that side it's a hard question to answer because like i feel a little guilt right like that we've moved that responsibility like i think you've gained from like telling me today and you know i deeply care about the user problem and taking those that pain away i think we're just taking a greater pain like the fact is we like on this specific issue i don't think we'll pass any more pain on anything else like our bar is so high for not doing that right that throughout the user arc and the journey of the customer i think we'll solve way more pain than they have but yeah you're right it won't be done as well it's somewhat maybe there's an opinion we have to make upwards i don't know um yeah it's something that we'll we'll get continual iteration and thought and um we've have like we have ideas i think we're still talking about uh a few other things and and the things that our tooling can do um yeah i think we'll just have to keep iterating and trying to make it better i want to be clear i actually think y'all are in a really good spot with this overall if i didn't see the collaboration between prisma and planet scale that i have been seeing these concerns would have went from like concerns to deal breakers that i would have taken action on but knowing that people much smarter than me and much more dedicated to these problems than any team i could possibly hire are working as hard as they are to solve them means that i'm not particularly worried i'm more curious how these things are thought about and decisions are made around them at scale as you guys try to be the solution for everybody how do you solve the problems everyone has even if those are problems that don't fit perfectly with your model and yeah it's it's a really tough thing to solve and we're running into this too with ping where there's people who want to do crazy things with this like we're regularly getting people who want to do game streaming on this product this isn't a game streaming product this is for calls but it's yeah it's a really hard line to walk yeah i think you've got to be very honest about what you're there to do so another buzzword in databases htap hi hang on let me look hey hybrid transactional analytic processing i believe yes okay it's the belief you can build a database that will do analytics as well as oltp which is what we're good at um i mean how's that real how is anyone able to truly do that but a lot people tell that they'd say like we've achieved it with the best analytical database and we're the best online database that's just not true it's like so avoiding stuff like that is how i think you do it right so mood in chat said having docs guide recipes is a good solution i agree like that's the point i think if it's not honest and if it's not like here's our trade-offs and why and if you disagree with them you're no like no let no less of an engineer no less of a great product per person or developer or whatever like as long as you you know we make them clear is why we've done it and like you look at this and you think yeah there's a fair exchange of value for me from planet scale um then i think we're in the right place uh when it comes to large customers and thinking about their problems we're very lucky that a lot of people when they're in pain with databases they just want to get out of that pain they have to unlock their business so i genuinely think and i and i mean this and i've spoken to a customer i spoke to a really very successful um large growing tech company and and i said how many you know probably 10 year old company now i said how much time do you think you've spent um of engineering time on the database like how many person years of just like database scaling i can't believe it he said probably a hundred like he's had a five person team cracking away at it for years and years and years and all the other engineers that's just the database team then the engineering team and then all of these so when i and i had this experience at github right you know you'd fix a database problem then you'd be okay for a month and you run into the next one you want to ship this thing you want to ship this thing and that's because databases are just very hard and very hard to scale and and so much has gone into it um that's why when these large customers come to us they're very excited that we fix that and we'll solve that for them and then it's done in a simple and easy way with a great cli like suddenly it becomes like okay theo using it to build his startup versus a developer at general electric using it actually it's the pretty much the same user story developers want to wake up produce value for themselves their boss their company whatever get their [ __ ] done not get hounded by the database and go to bed that's how we solve for both ends of the spectrum is we really think about what are the developers interacting with the system and then we have the other stuff that gives the boss a win right like we like that person's boss might get some cost saving wins they might get um they might get better security by moving to planet scale more scalability you can make it in every when one wins things but pretty much developers enterprises they use the product the same way and then throughout the power of the back end the enterprise capabilities are really there that makes a ton of sense and like to go back to the frame you had earlier of starting from the performance and pushing down to the initial commit including planet scale i think that does make a ton of sense it's weird because i'm so used to seeing companies that are focused on the easiest customer and then working their way up to the hard one with the biggest constraints you guys are doing it backwards in the sense that you you made it work for the hardest customers with the biggest scariest problems and now you have to convince the rest of the world that it's worth buying into early so you never have those problems ever absolutely absolutely and it's it's it's fun and it's awesome i was talking to nick who's our vp of engineering and we realized that to onboard some of these large customers that we've been working with we haven't had to we've we've all we've done is configuration changes for the test to make it tweaked to be optimal we haven't had to go like oh there's a that's a performance um benchmark you need to hit the test can't do we just config we've just been doing configuration and that tells us that we've got something great and you know the tesla's running extraordinary skill i'm like there's one vertex installed in the world that does uh 28 million queries a second god i'm assuming you can't share who but that's insane many githubs um in scale um it's huge like huge there's huge installations of this thing and then yeah like you said we scale it down it's the same tech you're using theo to build your startup right like that to me is amazing and we've only ever seen together like we have never had that from like really deep tech like databases we've had it from like um uh tools like versailles right like they scale to massive scale and and leveraging the nature of static sites and cdns and like that's a much more tractable problem it's not easy but it's it's it's not like databases and so to take databases to that scale it's awesome and it's the same code base as well that's the other thing that is really cool and you know we see companies that are building a database that are inspired by spanner well it's not spanner yeah you read the span of paper cool like it's not spanner this is literally the same code base this is they literally open sourced it straight out of youtube so it's pretty amazing that's i really like that way of putting it i yeah it's crazy to think that this technology that was built to make youtube's databases scale is running that level of stuff at github and is open for anyone to use and now i at a small startup don't need to know a thing about databases or even sequel can go click two buttons and be using the same tech and that's a really awesome place to be right and there's some really cool features in there that come from that journey right so um who and i'd love to hear in the chat who's ever brought down a database or course database problems by incrementing a counter just like hammering a single row like you're counting like views or something on a table right and you're just smashing a single counter right so we were talking definitely guilty or even better reading from a counter not that aggressively but it turns out that specific graphql resolver isn't cashed well and having 30 000 people reading from one table that didn't expect that is enough to take down all of payments that's which it turns out right so incrementing counters is really tough and to do it really large scale if it's a single counter and you come into all these different patterns and then they don't use relational databases to do it and now there's two systems to do and it's messy well here's a problem that you know when justin bieber released a youtube but his new uh his new video on youtube a lot of people go and watch it and that little account that view count is not just something that can be stored in a lossy format every single view has to be stored because they pay advertise they pay based on advertising dollars to youtube creators so you have a single view going missing so we were talking to another very large website that has a counter specifically for like it's like a like type functionality and they were like well you can't store that in a relational database um and we were we said well you can and you you did it at youtube and that's that's uh because they had to right they wasn't just like you got a tweet with 50 000 likes it doesn't matter if it's like 50 000 won or not who cares you can lose a like or two um but with view counts you can't so in vitesse the test has hot road protection built in and it will um take all the rights you can throw like every count that you need to count and it will flush and if it notices it will hold them cue them away from the database and flush them all at once so the database can get tens of thousands hundreds of thousands of counts a second going against it but that mysql gets one right as it flushes it straight through so that is again in like buying database tech from people that have that it's not pat there's not a reason it was built right they're just building it from the ground up some customers are going to find that problem on that new piece of database tech versus them finding it when they deploy to youtube and there is immense power to doing a deploy of a piece of tech having two and a half billion active users on it and then finding out the problems and you get that really um uh really awesome and it's the same with uh uh the query caching that we do if we see ten thousand of the same query we hold nine thousand uh nine hundred and ninety nine of them back sorry nine thousand nine hundred ninety nine of them is ten thousand uh serve the initial one and use the same results that to serve all the others so we can actually hold them in flight even without that primary query executing so there's so many like really amazing very robust pieces of technology inside of a test that we're there to protect and run the database at scale that we can all leverage now with this technology this is combining this with the point you made earlier about something like versailles being the easiest starting point but also the infinite scale i i've referred to that possibly erroneously as the serverless mindset when you're no longer thinking an infrastructure you're spending all your time thinking about the problems users are having and vercell did a phenomenal job of taking the technology lambda that allows you to not think about scale and abstract it a way where i don't think about lambda either i just write functions and call them it feels a lot like planet scale is putting in immense amounts of work to get sql itself to a similar point where it's almost serverless sql not in the sense that there's no server but in the sense that i don't think about it right that's why i love serverless because it's just like it's just you know that's when i see products you log in and like v cpus and what's a what's a vc like seriously like why are you asking i don't know how crap your software is i don't know how much i have to put into i just want the job done i think user serverless is focusing on the user story why has the user come to us to send us queries to get the data back and that's it that's all they care about that's why we we store your data in a high replica high availability fashion but we didn't ask you to provision three nodes so you can get high availability we just did it and we charge you for your no the storage not times three just once just like you can price by saying do you have 10 giga data right that's how much 10 giga data costs on pascal it turns out it's free but you know what i'm trying to say like we don't we're not asking you to like translate how many replicas you need for this and that we just we give it to you uh straight on and i think that's why serverless is so amazing because it's just the user journey and it's just the story that you want to you want people to use things simply and yeah like if you use versailles and pascal you could scale to millions of users without a single infrastructure engineer that's never been part of that that is just new era that is there's i just think the size of company delivering massive scale products is going to get smaller and smaller because of all this leverage yep couldn't agree more alex just asked a question i was going to sneak in earlier and find a good chance uh in terms of like the streamlining of the developer experience on top of these things to like do the the reach things the the stuff that sounds impossible this is one that sounds impossible that i think the right people now exist at both versailles and planet scale to do automatic preview links with versailles ci and github creating a new planet scale like instance that's fresh based on the schema for that branch a future where i can make a pull request and then have an instance that that's going against yeah we're very close to that in fact the bare bones are there um if you wanted to you could wire that up with a bit of github actions and using rcli the reason we wanted to do branching is that we believe that you like environments and copies of your database should be instantly available to you like abrupt like we don't believe in staging environment stage environments have to go like there's another environment to maintain and mess around with you should just get a branch of your database and it should just be there so and you you you could very easily with a little bit of automation on github actions whenever you create a preview branch on versailles easily get a branch on um client scale interesting i did not know that i have to play with that the bigger pain point for me honestly is off for preview builds because we don't do any like email pass auth we do everything through oauth so making oauth redirects work on an arbitrarily generated url was its own fun challenge but the since i haven't solved that i haven't been personally as interested in solving the database side but the idea of like github ci'ing my way to fully isolated environments for every pull request sounds super enticing it's definitely yeah points interest for well yeah and that you know that's how we test as well right if you're testing functionality you can just do it on a branch test and and that that's what they're designed for to give you that separate isolated environment that feels like production how many people are working on like a local postgres or whatever and that doesn't look like production that postgres is completely different on on on rds we don't want that we want people to the reason and if you any of you listening go to your plant scale database now if you create a branch you get a drop down to place that branch wherever you want in our region map um that's so that you can do local development you may be hosting in um ashburn or uh but if you live in san francisco you can create a branch near like on the west coast so you can get um lower latency to that development branch and do development against it that's actually really exciting to hear i know one of our developers who isn't on uh like isn't like california west coast is the one person who to be fair she was flying and want to be able to do dev on the airplane so she made a local my sequel installed for the first time since joining the company that were fully bought in on my sequel she was the first developer to actually install my sequel on her machine wow and after doing that she was having a lot better but enough of a better experience just due to how much lower the latency was on her local db that she started using that more for dev than the planet scale branches i did not know that we could make those in other regions i am going to try and convince her to give that a shot and see if i can get her back on the yeah there we go on the cloud gig yeah latency is very important latency and and distance between the things doing other things is so important that's why it irks me so much that other database providers pretend that it's not a real thing yeah i totally agree and i've been i'm surprised that you guys have like it wasn't so much that you were pretending it wasn't a real thing but it didn't seem like a a point of concern with the additional wins and like something i've seen a lot of is the claim that moving everything to the edge is going to make the internet so much faster how is authing my user at the edge going to be any faster than offing the user at or in west 2 if the user has to be off against my database that's already in west 2. you just added an extra round trip right i think the inconvenient thing for people to people to truly realize is that once you've terminated ssl near the user you've probably made 60 to 70 of the optimization you'll ever get from doing stuff near the edge yep we might get we made github ridiculously quick for people all around the world by just hosting in ashburn we had we had get active active across the world but uh across seattle and um ashburn but primarily served out of ashburn but with pops everywhere that terminated ssl near users and back hold the traffic that's i mean that's most of it that's a lot of round tripping saved and you can do loads more but you know because i i think some like databases trying to get out to the edge ruthlessly um for anything other than reads is it gets very very very complicated and probably is not worth the downsides totally agree and i've not personally felt the pain but i've had engineers that worked with me fix the things i broke because i had a counter and run into all of these problems in that process and all of those end up being reasons that we're not focused on our users and we're not shipping i think if there's any point i want everyone here to take home it's that while planetscale's doing these crazy technical things that's not their focus that's their solution to solve the problem of the developer experience building against databases and i think that's what i love so much about you is there are a few companies that know what they're doing so much and don't talk about it if that makes sense it's not that you want to hide the crazy stuff you're doing is that you don't want us to to feel like that's what you're doing you want us to just use it same with the iphone i think that's the perfect comparison for how planet scale's building versus other people in the space like when i think of other scaled sql providers especially in like the postgres side i go to their marketing page and there's like 26 words i don't know the definitions of it i've been a developer for over a decade where i go to the planet scale site it's like oh this is how this benefits me yeah right and that and and i'm i'm so glad you've um you've seen that because we try very hard to do that and it is hard like it's in sometimes it's it's actually um agonizing like it's sometimes you wish you could just forward the pain on and just be like oh well see our docs for a load of caveats but we just we won't do it right we we try really hard and it takes a lot more longer to do it but it it's great but on top of that when things don't work you don't hide from that either alex actually mentioned earlier one of his favorite things about planet scale and about your team is you guys don't pretend things are working when they're not and you listen when people push back on stuff that's one of my big things i i'm an [ __ ] i will complain about every single thing that goes wrong quite loudly and quite often i think that's why we work so well is i can't even finish my complaint before y'all are on it that's great to hear yeah you have to celebrate your losses as loudly as your wins otherwise you create this weird echo chamber for yourself and you're like it's very easy when you're building a product that's growing right and and you know i read our support issues as much as i read the tweets that praise us right like it's our twitter channel is great fun we get people all day long like oh i love plant scale i've just built this thing on plant scale this is my new stack like love it also got to work out the problems and we have got to know the problems we've got to ha like we've got to be more unsatisfied with our product than anyone else can be and that's how we make it good if we do victory laps constantly and say it's amazing um then then it will get worse over time you've got to be unrelenting and hold that really high standard couldn't agree more i want to it's been two hours it's been an awesome show so i want to start wrapping up there was one question that mom had had i wanted to clear up quick which was wouldn't developers have access to production data in preview builds if we were to move to a world where preview builds are uh automatically creating branches i'm sure you have the answer even quicker than me yes data branching is close and coming um you will be able to specify having data in your branch or not and watch the space for a nice solution to anything further at the moment that is a problem yep that is an issue um hopefully that's something we can get to in the future making it way easier for customers interesting i was going to flip it the other way which is one of my favorite things about planet scale is that their default is no data comes when you make a new branch so the default experience that would exist right now if i automated this would be no production data in preview builds because it's a fresh database instance right with the exact same schema though right exactly and i think mo the best way is most people um do it without data and that's the default it's much quicker to provision um also uh you should be seeding like see see data good quality c data is way better and you shouldn't test on you should never be testing on product data basically like if it's your little if it's your own blog i mean it doesn't matter but like if you get into that bad habit believe me when you grow up and like the the other issues it causes is way worse if you're using sql on your own blog i want to have a whole separate conversation with you that's in the side as a big markdown fan well i mean wordpress is still going right and their friend hand in hand with my sequel that is fair oh yeah this has been absolutely awesome thank you so much for taking the time sam means a lot both as like a user and a content creator to know that you guys will have these hard conversations and not back away from anything just for full transparency for the audience i tend to send a heads up ahead of time to any guest i'm going to have with like a bunch of questions and things that i want to ask i even will label a section saying like these are the hard questions i expect you to nope out of some of these sam's response was i'm so excited to talk about all of this so i i wanted to emphasize that point i think it's so cool to have a company solving these hard problems that is not trying to avoid the hard questions that often come with it so thank you so much sam we appreciate it immensely thank you so much for having me theo thank you for being a user of planet scale thank you so much for your to your audience for having me and uh listening to me plantscale.com if you uh want to try the next generation of database and you know my twitter has been linked in the chat you know where i am if you have feedback um yeah thank you so much for having me it's great absolutely gonna end it now uh quick heads up for the usual people i have a big announcement coming more ping related than anything tomorrow so be on the lookout for that i'll probably announce it on twitter might put some things other places keep an eye out for that and on friday uh my two co-founders at ping labs mark and brynn will both be streaming live doing a a uh how did they put it it was uh keep talking and every and nobody explodes except repairing a game boy where brynn cannot look up anything about game boys or game boy or pair whatsoever and mark's going to instruct her through it remotely on ping so if you're curious about hardware stuff that should be a really fun stream too thanks again everybody for stopping in for this one this has been an awesome show i'll see you all next week peace ## Please Stop Asking For Mentorship - 20240606 I have a confession to make I never really had a mentor as a software Dev I had moments throughout my career where I had like a specific manager who was really helpful and would push me to go in the right way but I ever had a person I could confidently head up and be like yo I'm struggling with this can you help me out and I honestly think it's a big part of why have benis successful as I've been software Dev is not about who you know it's certainly not about who you've convinced to help you out software Dev is entirely about how well you handle failure and I find that people looking for mentors are often trying to avoid that failure I have seen this pattern so often primarily in my DMs where I get still to this day at least a couple people a week asking me hey Theo will you be my mentor well depending on how you Define mentor there's two options that are valid either I already am your Mentor because you're learning a bunch from my content or the thing you're asking is stupid because I can't possibly dedicate a bunch of time to random people in my audience that no that doesn't work come on be realistic so let's talk a bit about mentorship what it means and where you can actually find Opportunities to grow that involve others helping you out because I'm really tired of this question and honestly I just need a video to link to I know this is going to bomb in the algorithm I don't care I have important things to say and I hope the right people listen the first thing you need to understand is how expensive mentorship is I'm lucky that I found a way to educate people that's quite a bit cheaper I can sit here and spend a little bit of time making a video and then I or my team can edit this and put it on YouTube and then thousands if not hundreds of thousands of developers can benefit from it that's huge but when it comes to actually helping a person individually learn and build skills it takes more time often with less results because now I'm dedicating a bunch of my time to understanding you what you need what isn't isn't working for you and then how to communicate specific stuff that's difficult that's really really difficult and it takes a ton of time to just figure out what an individual needs much less actually delivering that thing to them and what do I get for it I'm not trying to be super selfish here and say yeah you don't deserve me as a resource in fact you do you're getting it right now I want to provide help to as many people as I can that's why I spend way too much time making this content I promise you I'm not doing this for the money because I could have made way more sticking with my engineering career or just focusing on my business I do this cuz I have this deep desire to just talk about code stuff the way that I liked to and the way that I used to when I had my old job I learned primarily from my lunch conversations at twitch being surrounded by Engineers who just were smarter than me and more experienced than me and hearing all of the things they had to say hearing their thoughts on new technologies or recent outages or whatever the hell they were working on at that time the amount that I learned just being there was incredible and that's what I'm trying to provide here it was great almost as a method of exposure to show me the way these things worked and how people used and thought of them and if I just copied the things they said or thought it would have actually been worse for me but the opportunity not just to see someone present their way of thinking about a thing but another equally experienced person pushing back on it and seeing those conversations unfold helped me better figure out where I was and build my own stances on these same things if I had a mentor I would never have gotten that value i instead would have just done what they told me and this is the big problem I see with people seeking mentors is that both sides kind of get screwed the mentee looking for someone to help them out they're just going to follow whatever that person says and even if they instinctively disagree it's not their place is the mentee to disagree I hate that relationship for that reason because now the likelihood they find what's right for them is actually lower not higher I know from my experience when trying to help other devs contribute I could spend an hour solving a problem or I could spend 2 hours in a call with them and then 3 days reviewing their code back and forth to solve the same problem mentorship is incredibly expensive as a Dev as a YouTuber as a community lead and just as an individual and that doesn't mean no one's going to be willing to do that work for free however it does mean the quality of those people isn't going to be great this isn't to say you can't learn from these communities and being part of these places hey Theo I'm working on this project I'm using these Technologies you talk about this one piece is hard for me to understand any advice on how I could understand that a bit better absolutely you'll almost certainly get a response from me or someone from my team at that point but you need to be respectful of the people that you're asking for this help from the problem with a mentor mentee relationship is that they expect the mentor to drive that doesn't work in most fields and it certainly doesn't work in software because as I mentioned before you're going to be failing a lot and you need to get really good at pushing through those failures not leaning on others when they happen not saying you shouldn't have a support group of people to talk to when things are hard this actually why I'm so positive on both University and boot camps because being surrounded by peers experiencing the same things makes those moments feel much less lonely but mentorship isn't a thing you should go to because you feel lonely and it's not a thing you should go to because you feel lost these are things you need to figure out yourself and I know it sucks absolutely does and I've made a bunch of content about parts of how to get through it but the big key piece is that you set good goals and I want to be a programmer or I want to learn JavaScript those aren't good goals they should be much more specific around things you already understand for me the goal was I wanted to host a Minecraft server where my friends couldn't break my in order to have that goal I had to learn the basics of git of java of server hosting of crazy SSH and t-mo G screen stuff and as painful as those things were I learned so much because I knew what it looked like when it was working I didn't know what the parts were how those worked yet but I knew the result I was aiming for and by focusing on that and learning what I had to to build it I was able to get something I was proud of much faster even if I didn't understand the pieces and then I could go into those communities see what people were talking about do my best to infer the context and what's going on and eventually and I'll admit it took too long but eventually start asking questions about those things and at that point anyone could be your Mentor because they're not mentoring you they're part of a community that you're now becoming a member of and if to you mentorship is the ability to ask questions about the things you're learning then I guess I'm being mentored constantly every day but if that's what you're looking for you don't find it by again randomly dming people you find it by being involved enough in showing your work that's an important theme I really want to dive into here the idea of showing your work I already have a video about why you shouldn't contribute to open source and I'm scared it's going to lead people the wrong way here it's important to share what you're doing why you're doing it and how you got where you are don't just Spam the world with links to random commits that are you learning how react works but if someone's working on a cool project or technology and you're interested in it go make a demo using it maybe post that online like hey I thought tan stack router was really cool so I built a demo where I used it for this thing that's awesome and then if you hit me up like hey Theo I was trying out tan stack router I ran into this problem here's a link to the exact code where I had the problem I would love your thoughts if you're down my response is probably going to be hey sorry I don't know Tac that well go send it to these guys but at least you'll get a response from me at that point you got to show youve put the effort in though and when I see the message can you be my mentor I see someone who has fallen behind asking me to catch them up and I have bad news no individual is going to catch you up that's your problem and it sucks I'm not saying it doesn't suck I'm not saying any of this doesn't suck I'm saying pushing through the suck is what makes you a great engineer and what will make you successful in this field you have to be willing to set these goals and learn on your own and show that you've learned on your own one of my favorite things I'll regularly see from this community is a person who is surprisingly either new to the industry or young hitting me up with really deep informed questions about the stuff that they're working on and I'll just be really impressed with how well they know the thing say that's awesome let's chat about it more and then learned that they've only been coding for 2 years look at somebody like Ethan ncer who by almost any measurement I've been a mentor for he was one of the earliest members of the community he was always sharing really cool stuff I'll never forget when he randomly dm' me the link to next type safe URL which took the things I'd been preaching around full stack type safety and brought them to the router which I had never seen anyone do before he was doing that in next well before any other framework had these features implemented which which was so cool since then he's built his own stack the Beth stack and he made a YouTube channel where he talks about that he talks about effects and all these other things that he was interested in that I just happened to not be as interested in and rather than convince me to make the video he just went and did it himself and he didn't ask me how do I start making videos or how do I get started or even should I do this he asked if I was going to make a video about a thing I said no and he ran off and did it himself and that is so so cool to me there's nothing better than seeing someone take the right lessons from you and apply them in really cool ways and the stuff he has done is incredible I'm genuinely really proud of him and he's one of dozens of people from this community I feel that way about I didn't respond to Ethan because he was looking for a mentor I responded to Ethan because he hit me up with something exciting that he got excited about himself that he built himself from what he learned in this community his success didn't come from me dedicating a bunch of time to helping him out his success came from him learning the right lessons from my videos from my chat from my Discord from all these other places and applying them in a way that was exciting not just to me but to the hundreds of thousands of people who have watched his videos now that excitement and that energy is a really important thing to try and find and you will not get that from someone else pushing you that has to come from within and I find a lot of people who are actively seeking mentors are the people who didn't find it in themselves that doesn't mean you can't but it means you really need to put effort in and you might not find that by obsessing over individual Technologies but you need to find something that drives you another person will never be the reason you become a successful developer they might be one of the tools in your toolbox as you get there but you need to Define that path yourself and then realize it's wrong and change course half a dozen to two dozen times as you figure figure out what being a Dev means to you but none of that is my problem so get the hell out of my DMs until you have something interesting to show me I am sorry to be as Frank as I am about that but it's important you shouldn't be seeking mentorship you should be seeking interesting things to do and talk about that drive you through these hard Parts because until you get over that failure until you get over that instinct of failure bad need to avoid and you learn to lean into it and learn from it and apply your lessons and share them until you're there being a Dev is going to suck it's going to suck hard because we all fail constantly and I can't do anything about that I can't help you through the things that you need if you're looking for a mentor you have to do that and once you pushed through that you'll naturally find yourself working on really interesting things and I'm confident at that point we'll have a lot to talk about but until then you don't need my permission to learn just go learn go build stuff and come back when you have cool things to share appreciate you a ton as always I have a video in the corner where I talk more in depth on why your goals suck and how to set better ones so check that out if you haven't already I link it in half my videos so you probably saw it anyways see you guys in the next one peace nerds ## Please Stop Patching Globals - 20240615 Rea been getting some crap for their decision to override various globals specifically fetch which they've walked back but now they're also overriding date I obviously lean towards those overrides being good for various reasons but not everyone agrees including artam who if you're not familiar is the creator of mock service workers and one of the more legendary people in the unit and like code based testing side of the typescript world fantastic developer I've had great conversations with him highly respect him we don't agree so I want to take the time to read this with y'all and see where we stand in the end without further Ado let's get started why patching globals is harmful honestly I never thought I'd be writing about this but the matter of patching globals turned out to be one of those topics that a lot of Engineers seem to misunderstand most of us don't do monkey patching and even fewer stay around those implementations long enough to witness their impact all the more reasons to talk about it there's a next few thousands of words I will be referring to modifications of global apis as patching you take the code you don't own you modify Its Behavior you patch it I hope we are clear on semantics yep totally clear so far I am using react next and Bun as examples in this article because they have introduced features built on top of patch globals in the past months which was met with a sizable backlash from the community this piece is not part of the backlash if you came here to bolster your dislike towards these projects or companies behind them I kindly encourage you to close this tap and go on your way this is Awesome by the way I don't see anywhere near enough of this like anti- content that is like clearly drawing a line of this isn't meant to be used as ammunition to go after these people I have this specific bone depict why this should not be used in this way really cool to see this this sets a really really good tone as I start reading so already more inclined to to Vibe with this I've vo my concerns about the matter publicly and saw firsthand how deserve criticism is muddied with blind hatred and I wish to contribute to that kind of discourse no longer yeah absolutely agree the deserved criticism is muddied with blind hatred I feel this so hard yall have no idea you have no idea it's really annoying that like I feel like I can't critique certain things because it will be used to just muddy things further and I don't let it stop me I still if anything I'm probably more negative towards the things that I talk about than I was before like since verel started sponsoring me I've been way more critical about everything they're doing which is funny that I get more now than I do before but it is what it is thank you for calling this out really appreciate it I love API design all of the said companies have featured excellent design choices in the past today you'll learn why patching globals is never such a choice despite its reasoning and appeal which we will also discuss interesting angle so far background I first came upon the patching issue when I heard the announcement of the new caching API in next while the feature itself is a great addition to the developer and user experience the repos public API was rather unusual the team had decided to provide a nextjs specific feature by extending a standard Global API fetch here is the example with the new fetch next override they added the next key to fetch which let you do things like call or revalidate here if this is going to be the folus the fetch part we might end up agreeing more than y'all might expect but the fetch react override and the fetch next additions are slightly different but we'll see where we go after looking more into this I've soon discovered that react itself was patching the global fetch function to crash serers side requests in their in progress react server component model this is one of the most used JS Frameworks and one of the most used JS meta Frameworks introducing what I find to be a rather harmful design pattern a few days ago I stumbled upon a tweet from bun reminding it users about a convenient way to proxy HTTP requests all it takes is to give any fetch request a simple proxy option as such here I'll admit that different run times adding these things are even sketchier to me because like if Bond the bundler would at bundle time introduce a foxy and a polyfill for it that's one thing but a runtime adding overrides like this is a lot scarier even if just for like the type safety side we're going to talk more about bun and fetch though don't worry because there's a lot of weird things about the fetch standard that bun has been dealing with at this point it was the third time a major framework or in this case a runtime introduced a feature that relied on modifying an existing Global API I did and still do assumed the good intention from the authors yet I couldn't help but worry that it was an oversight an accidental spark of a flint that if not D would shroud our whole Deer Forest in fire interesting reach I have thoughts but I don't want to just stop and go on a tangent just yet cuz I have a feeling he's going to address most of my thoughts but why do I think these apis are bad what's so harmful about them answering these questions without understanding the reason behind those assigned decisions first would simply be improper yeah this is a great article so far I'm loving this the appeal of patching globals it's not an easy thing to come up with a good API even more so with an API that would be used by thousands of people I think thousands is a bit low here but I get the point thousands of people is a pretty low number for reactor but still the I don't even want to think about the hundreds of thousands who consume these things it has to be intuitive concise solve the problems it sets off to solve all while being efficient about it there's a lot of boxes to check with some of them pulling your judgment in opposite directions luckily all three examples we have today happen to concern fetch it's a global function to make HTTP requests on the web and it's known and used by a lot of people out there you call fetch when you want to make a request happen isn't that the perfect place to say you want the request to be cashed as well maybe proxied elsewhere and because it's a global it doesn't even have to be imported we are checking off these boxes so fast we're grinding pencils to stumps here yeah I will say for traditional request caching where like future requests are hitting a cash and proxying yeah the one thing that's missing here and I'm curious if this gets touched on as we go or not is the idea of D duping within a server request such that the requests being made aren't being hid an unnecessary number of times in the end why should anyone go through the trouble of inventing custom functions in methods for something the platform should have had to begin with and I do get this appeal I truly do there is however a cost to every decision and patching globals doesn't just have a cost that affects both users and maintainers but it also actively harms otherwise great apis and even the language itself now to the specifics harm number one maintenance when you patch a global you modify something you do not own Fair technically this is the case with global this too and like window but fair point maintaining the things you do not own is hard that is why you should always strive towards making the experiences you ship apparent and explicit like so import experience from your thing this will also help you assess the blast radius of any changes that you decide to make to your framework in the future see the globals are precisely that Global the only thing worse than thinking you can predict all the possible ways that Global is used in the Wild by both your users and other tools is to assume you can accommodate for it context hi I patch globals for a living I don't enjoy that I actually hate that and i' move away from that instantly if I had any other choice and I did moving the network interception to a service worker the moment that it clicked yeah the fact that mock service workers is the thing you created as a way to get around overriding stuff you're very uniquely qualified to be talking about this and good qualifier here sadly the nature of what I do doesn't give me much Choice luckily all the Frameworks I bring up as examples today do have that choice and I'll even show an alternative design to their apis later in this article I'm going to show you some edge cases that those alternative designs cannot handle but we'll get there you can take my word for it or you can wait for your users to tell you how meddling with globals breaks their apps and what an excruciating pain they had to suffer to discover that you've effectively throw a bear trap into the source code and someone's going to get caught at least it won't cost them hours of their lives Insanity to fix the issue but it will cost you using a more concrete example imagine your framework passes the global fetch functions to DD requests ooh ooh I might be getting owned here this works really well for the immediate consumers of fetch your users now what happens if they rely on a third party SDK that also has a DD mechanism built in the two behaviors would Clash causing all sorts of weird issues that are virtually impossible to debug interesting I was going to show cases where the third party SDK doesn't have a dup built in and if it's making multiple requests that can get really annoying so if I have like function just get user info user ID string see this function and one of the things this function does is check that you're authenticated first before doing the rest so we have like const o equals wait this has to be async fetch SLO service and we have to wait to make sure the user's off and then we const user data equals a wait fetch user data return user data like if we had four different things here where like this off call was being made by an SDK like this if this was being exported in package and it was to do this dup thing that can be checked across five places and you have to wait for this fetch to happen five times there's nothing I can do now as a consumer of this API if I could break in and cach this manually cool but if I wrap this we have a different function though that's like get app info and this gets app data again remember pretend we didn't write either of these These are being provided by SDK and we wanted to make this fetch call not happen twice if I'm calling get user info and GAP get app info I'm now calling the off service call twice and if this is how the SDK we're using was implemented which many are implemented not far from this it doesn't matter if we wrap get app info or get user info in a cache because that cash only affects that function it doesn't affect the things inside in the potential to ddop those I'm ready to take the blame for proposals that took me a few seconds to come up with ideally sdks give you fetch as an option and then you can imbue it with caching either on the framework side or your app side give people their fetch if you want to enforce things like that do once as many other sdks do the fact that I now as the consumer have to think about that and as the creator of the STK have to do that too is a bit annoying if the goal is just provide a good experience for serers side react the harsh reality is that a lot of these libraries are making bad assumptions about things being on the client and this lets you skip a lot of that by overriding the fetch at this level if by default two identical fetch calls on a serers side request are D duped that is a potential massive win is that win worth all of the potential breakage all the potential additional issues Up For Debate and that's why we're having this discussion right now anyways this is your best case scenario the worst case scenario is that the third party was also patching Fetch and relying on that patch to exist which your framework successfully undoes by introducing its own patch a magnificent manifestation of hack driven development at its finest H yeah I I think the slippery slope argument is actually one of the stronger ones here where like if react patches fetch can't everyone patch Fetch and now you're in a terrible like overriding hell it's like cascading but worse it's like we're taking the worst part of CSS and applying to JS so I'm going to think about this now harm number two predictability there's hardly anything more satisfying in engineering than knowing how a thing behaves if you use a console log you know it will print a message to the console now it may be the browser's dev tool I have to ref on this a bit because uh you don't know this anymore I uh yeah I will say as a DI hard nextjs and server component developer console.log doesn't always go where you expect it to go anymore like uh if you don't know if something's running on the server or not or if it's running on the client or not or if it's cashed or not that console log might just not happen but uh yeah for the most part I agree I no I fully agree with this it's just funny that console log isn't even sacred ground anymore now it may be the browser's dev tools protocol that does it or nodes writing of process to standard out but you do know what's going to happen you know what's supposed to happen yeah you can predict that by behavior is highly anything more irritating in engineering than having the same thing behave differently yeah yeah I don't think there's a point in here so far that I agree with harder than this oh God uh yeah I remember along back and forth I had Dan AOL around use effects like different behavior in Dev mode I yeah fully agree you've been building for web long enough I'm sure you have your own barrage of oddities quirks and behaviors of questionable sanity corked into memories you never wish to revisit it's my job to revisit them sadly remember how display Flex used to only work in some browsers oof that hurts that hurts my soul what about negative look behind in Safari what about rex look back at Firefox or just anything weever seen Firefox for all those joyful hours spent begging iie to render your page correctly if at all I had to push so hard to get twitch to drop IE God that's the chaos that happens when multiple agents implement the same thing differently yeah it's a shame that fetch only got added to node like a year ago it makes me appreciate the present even more cross browser compa ility has never been higher even cross environment compatibility is showing incredible progress with node shipping the fetch readable stream websocket and a dozen other browser apis it didn't happen by accident we as an industry came to the conclusion that nobody wants to waste money and time on compatibility issues we invested into specifications we deprecated old and gave way to the new I have to call out the fetch thing and the idea of Standards quick this is a fun example of how these standards are all made up things what do you expect the content length received by this server to be so you set body to one but you set the header's content length to two so as result going to be length one or length two currently Chrome Safari and Bun do the same thing here the content length would be one but node which is using un DC as its fetch layer throws the reason I bring this up is the debates that it's causing because of those differences in Behavior we hop to the quote tweets here Luca from the Deno team dropped his spicy take crowdsourcing implementation behaviors because you're too lazy to read the spec the correct answer is one here are Three Links describing the answer being one but Bun's Creator Jared replied we did read the spec and that's why bun behaves like chrom and Safari here it's also helpful to see what other developers expect the other important part here is that as Jared said many a time if it works in node and not in bun it's a bug and Bun and I I think that's important to understand is that Jared's goal here isn't just to follow the standards perfectly it's to make sure that our expectations as developers are met and if our expectation is that node works this way so when we run the code and Bun it should work work the same way that's a fair thing and effectively what he's asking here is should we do things the way the web standards expect or should we do things the way node expects which is a great question to ask and it's really frustrating that the response to this from a competing team which by the way like luk is not on node he's on bun I really hate the infighting going on there because we all have the same goal of pushing the node ecosystem forward with alternative approaches the dunking here was just really sad to see but that's what happens when we end up in these contentious places around standards because none of these standards are actually follow properly across all places pretending they are is absurd so while I agree we should be putting our best efforts into following these standards I think our expectations as developers don't always align with those standards as a result things are chaos did I say he's on bun he's on Deno my bad lcas on Deno Jared runs bun I don't like that Deno and Bun beef it's annoying hate to bring that up here but I do think it's relevant because the point I'm trying to make is that these globals being patched are also not as standard as we like to think and like Fetch and is still very new very early has all sorts of quirks we had some fun bugs when we were working on upload thing where the way fetch worked for like files for posting from 1813 to 1817 the behavior was different and then 1817 up it just worked how we expected but like it's not that simple this has been a chaotic ride for a lot of us and now we've come full circle we're back at the stage where multiple agents are implementing the same thing differently here's a request that will be cashed and then revalidated after 10 seconds and next cash is force cash next revalidate 10 this is new syntax being added to fetch that doesn't exist normally that exists within the next way of doing things will this request behave the same in felt or in remix or in plain JavaScript not really the revalidating part happens to be a next specific API leaking through the global fetch it's a custom API disguised as a global which drives it predictability to the ground I will say for next doing this largely agree this probably isn't the right way to do things especially with the lack of developer tooling and communication around next's caching behaviors between requests I'm going to pull back up excal DRS I don't think I did a good enough job explaining this in my previous video and I want to be really really clear there are two types of requests or we'll call them page request and server side request the page request is the one that happens when the user goes to the page so when I load a web page the server has one request every time I press the refresh button one page request happens within that page request there are usually going to be a bunch of server side requests so we have our page requests the user requests the page they're waiting for an HTML response within here A bunch of additional requests are going to have to be made so let's make a little blue box that's off request so we might have one off request we'll use the example above with the get user info make this one yellow get user info so within the get user info request you might have to do an off request maybe you use this request in like three places I'll make this bigger accordingly and we have a fourth one that is um get app info we make this one different colors so we have our page request and it makes all of these requests on it maybe we have a component that renders your user info maybe we have another component that is like your friends list that requires your user info maybe we have a third component that's like the top nav that needs it to know if you're logged in or not these requests might be coming from an SDK they might not be these being duped within a given page request I think is a good thing the slashes mean this thing is hitting a cach and is not being re requested the solid colors mean it is already requested so if we're on one page request so the user requested the page that page calls the Au request function four times which is a fetch call and it calls get user info three times and it calls get app info once the cool thing about the overwriting of fetch is that the off request call as long as it's the same shape only has to be made once across all of these other requests get user info also only has to be called once because it's being reused in these other places get app info still has to be called because it can't use the get user info but at least it can use the cached auth request where things get sketchy is when this happens outside of page request one the issue that I think next is causing is that these will get cashed too and now on the next request all of these things hit a cash in next I don't think it's fair to call What's Happening Here caching this to me is D duping and the term cash being used to describe this behavior is what I think is causing a lot of the issues people are having understanding what's going on because this isn't a cache in the traditional sense it means that the fetch call is stopping to check something before it goes and makes the fetch request to see if it has the data it needs already or not but within a page request I think dding is not a bad thing between page requests dding is cashing that's a lot Messier that is significantly Messier and I honestly think if this was all that was shipped and the rest was done through explicit cash rappers that would be much much fairer but this is like through one pass of a reactor render this is one function call that happens to do all of these things within it it feels weird to not be willing to DD there versus here when you have a further request having things cashed for that next request that's full of a lot of unexpected behaviors a lot of bugs a lot of things I think I made my point here caching within a page request cool with that duping awesome caching like this between page requests without really good Dev tools incredibly unintuitive incredibly unintuitive the other thing here that's important is that I don't think this should work on post requests because post requests are by design meant to represent destructive Behavior whereas this is supposed to be deduping fetch Behavior if you're doing destructive things on a get call like incrementing a account or updating a user's profile don't do that a get is supposed to be for non-destructive actions the same way you shouldn't have your service if you get more gets than expected having your service not crumble if you get less gets should also work the reason that they chose to also have this Behavior work in post is obnoxious it's graphql because all requests in graphql are done via post which is incredibly dumb yall get the point there's a lot of edges here blame graphql for this regardless if this is how it worked it was only here and it was just get I don't think we'd have all of this controversy although I would assume that the author of this blog post would probably still be iffy on it my gut feel is that he would be less so oh there he is in chat you can use get but nobody does that yeah their validating part happens to be a next specific API leaking through the global fetch it's a custom API disguised as a global which drives it predictability to the ground yeah I agree specifically once you're doing this stuff where you're adding additional keys to the global that's where things get iffy for me and I totally agree this not great but again the example I was showing previously you don't need to override anything for this to behave this way there doesn't need to be any additional keys or anything additional in Fetch I would argue this actually the way you would expect it to work in a lot of cases I'm intentionally not giving examples of the standard behaviors of fetch working differently across run times those exist too but there is also an effort to bridge the gaps improv specification compliance patching on the other hand pulls the ropes in the opposite direction entirely this is like the opposite of a pre-at where I make a point and then I get owned forward a little bit later which is the thing I went on the rant about with the bun stuff earlier and how node standard kind of sucks and doesn't follow spec this is a very fair point the fact that it doesn't follow spec as much as I can use it as proof that these things aren't real the fact that it doesn't follow spec is a problem that they're working to solve and it's a fair point that when I see the spec not being followed I use that as an excuse to not follow spec when others the spec being followed There's an opportunity to continue to bridge the gaps and improve that is a very fair point yeah I'll take the L harm number three learning oo boy a software that disregards the learning experience it creates is a tool destined to fail I like where this one's going oo boy as a library author I know firsthand how impactful the decisions I make can be for my users there's already a lot of things that a good API must accomplish it must achieve the task at hand provide an intuitive versatile means to do so align with the established philosophy and best practices the sendable and maintainable and transferable but there's one more thing the most important thing it must do an API must educate a good tool teaches you the concept A bad tool teaches you itself you dropping hard stuff here I have a lot of thoughts on this in fact I'll do something you don't expect I'm going to on next real hard for a second I've hinted at this here and there but the more I've thought about it the more I've realized how unacceptable it was to ship the state of server components without really good developer tools the fact that we like just recently got actual feedback in our CLI about what isn't isn't being cached that's absurd that it took as long as it took to get there for a large portion of modern web dev's history we've had a great way to debug things command option I we get this phenomenal set of developer tools that gives us so much Insight on what's Happening why we have all these different tabs for stepping through our code for looking at what's happening Network side seeing what isn't isn't cached actually running JavaScript in the browser depending on different things and of course we have the react Dev tools with uh the component in the profiler and somebody made a third party react server component Dev tool that I haven't had a chance to play with my frustration is simple we don't have browser developer tools on the server for react to move to the server and force us to learn more important new things it's a bit absurd that the quality of our developer tools had to go down so far because this thing is going to be harder than ever to learn for most modern react developers because a lot of them just haven't worked on servers much and when these behaviors are now confusing enough that you don't immediately know what's going on on not having Dev tools that make it really easy to identify those behaviors when they're happening is unacceptable and I personally obviously we could not have known this at the time A lot has been learned since but I would hope that for future releases and developers working on things like this going forward they will recognize that the lack of good developer tooling developer tools is too wide a term the lack of good tools for inspecting and debugging developer in JavaScript runtime stuff we're so used to the quality of the tools in the browser that when you're doing things on the server you have to bridge that Gap yourself and I haven't seen enough of that Gap being bridged there's too much excitement around these new apis and not enough effort going into the tools we use to learn debug and better understand them that's tough and I hope that going forward will see more effort into those things it should be a much higher priority than it currently is and I also think a lot of the controversy here would have been much much smaller if we had developer tools to show us immediately and obviously what isn't isn't being cashed that would have made this whole thing way easier to work with and also would have made removing the global over overrides a more acceptable path because we could see and visualize clearly what is and isn't happening even just console logging to figure out what's going on here is more annoying than it should be anyways every time a user reaches for your tool they have a problem to solve and the solution you provide them is always twofold the immediate one and the lasting one let's see where we're going with this for lack of a better example I'll shamelessly use one from my own experience I spent the last year making mock service worker more spec compliant the goal was to facilitate the standard fetch API so the developer would interface with it more often it was a challenge and a limitation I imposed on myself knowing that the gains would be tremendous so if you're not familiar with mock service worker the goal is to let you mock specific browser things via a service worker so you can have really performant like behind the scenes behaviors especially for tests in order to fake things like fetch so when you're calling it in tests you can have mocked responses that happen asynchronously so it behaves roughly how you would expect the browser to really cool stuff you think I should do a whole video on it let me know see when developers come to mock service workers they want to intercept requests and mock the responses they could do all of that before but the API was entirely contrived and specific to our library so they have rest. get/ user request response context return response context. Json name John this does achieve the goal this does intercept the request and mock its response it has that immediate solution right here ready to be used boy did it have no lasting impact whatsoever because it fundamentally failed to educate does the API teach you how requests are handled on the web does it let you explore what responses are and how to construct them no not really does it utilize the knowledge you already have to make your experience better nope o boy spicy take number however many we're into at this point uh does this mean your pro jsx because I would argue this is the beauty of jsx is that every other framework at the time was inventing its own weird DSL on top of JavaScript where jsx was like we already know how HTML works why don't we just lean into that for UI structuring I'm going to use this as a a pro jsx take going forward does this make you a better engineer interesting thing to build let's see where we're going with this let's return to our muttons what does this example teach me about caching okay I I see where you're going Fair Point this this brought to your brain more than it helps anything well the first thing it teaches is that requests can be cashed and that there's a standard Cash for property that controls how browser caches handled these requests so far so good but that's the standard teaching me not nextjs fair the next revalidate part is entirely contrived even if I looked it up in the next STS I wouldn't know exactly what it's subtracting over does it control cash revalidation or does it do something else entirely certainly doesn't teach me about the max age request directive of the standard Cash control HTTP header most importantly can I write the same logic using plain fetch not really kind of but I see the point I genuinely didn't know that's why I reached out to Lee for Help by the way Lee proofed over this and has been a bro so far I think he largely agrees with these things so cool to have him involved the way he has generally I've had good luck even before I was relevant hitting up the versell team saying hey I have the spicy thing I'm going to publish can I get your thoughts and I had multiple people back um super under appreciated blog both by me and by y'all I made a great blog post back in 2021 about nextjs and type safety being a total disaster this has changed since but there was basically no understanding of typescript at versell for a while and it was incredibly frustrating so I wrote this article about how bad it was before I published it I sent it to verell they left a bunch of comments I looked through the things they recommended and ended up finding that they were even more broken than I thought next an inference helper when using get server side props called infate serers side props which had one of the worst type definitions I've ever seen the inferable type again it overrides as key string colon any so it's actual nonsense and if you don't specify input types the way that it expects it just inverse everything to props never it was awful and I wrote this blog post because I thought it was awful they recommended this as a thing to look into and ended up being more awful but this resulted in a feedback loop that made next better though I love that and I as much as we love to on versell they are really good about responding to these types of things there's probably no other company that's more willing to like have a conversation with you if you have push back on this stuff got a message from the author Lee's gone over the toop helping me with this I expected to check the code Snippets where I used next and he went on to giving me 30 plus comments on the entire thing from the style the sentence structure to next insights yeah the way versell handles feedback is exemplary yeah awesome that we're fully aligned as we sit here on nextjs design decisions we all think versell handles these types of things surprisingly well so once again what Lee had to say here he kindly explained to me that next revalidate focus is on incremental static regeneration not just caching so no I cannot translate it to a PL fetch call seeing how tightly it integrates with next I believe it belongs to request in it even less Fair points the ISR stuff is really cool and even I struggle to to fully grasp and communicate the relationship between the new next caching stuff and ISR will get there someday but I really want to have better Dev tools before I go all in on that as powerful as the revalidate function in next is I wish it taught me more about what exactly it does so I'd get a better understanding at caching and ISR ideally while also relying on the existing standards that I can apply outside of next yeah and again better Developers tools to show you what's actually happening hereo that would help so so so much harm number four lock in I don't know how much I'm going to agree with this one but we'll see where we go with it the more sugar your framework sprinkles on top of standard apis the harder it is to move away from that framework I would hate to be an engineer who has to migrate this from bun in this case the fetch proxy call because I have no idea what bun is actually doing I know it's supposed to do from The Docks but the reality is often such that there are dozens of things that are happening under the hood there's no spec for how proxy behaves now I have to match all of its behaviors while migrating because each Oddity missed is a new bug in my app waiting to happen you took a thing you didn't own you modified it on the premise of convenience and now it doesn't work anywhere else because it was built in your own little Universe if that's not the definition of vendor lockin I don't know what is yes and no I think the other problem here is that if you're wrapping these things with your own custom implementations gutting that is even harder like if we go back to my excal draw example if we had a react or next cash wrapper that this Library get user info applied to all of its off fetch calls such that it could cach that layer now this library is specific to our framework the cool thing about the fetch override is that it allows for these behaviors to use a standard and then be embedded in something like react the next and have all of these new behaviors and winds without having to integrate it into set SDK so I think it's a two-sided thing here I think on one side it makes things less portable because you grow to expect these behaviors but on the other side it makes things more standard because you don't have to implement framework specific stuff in your sdks so that's the the catch2 I would say here for that point largely agree but I think there are benefits in terms of making things not locked in that happen here too author dropped another important Point here that you could simply miss the proxy thing like you can leave it in there expect it to work and it just doesn't and not notice cuz you still get a response absolutely same deal with cashing it gets a little bit messy here because it's hard to know when these behaviors are or aren't working as expected which is why I'm going to keep tripling down on the idea that like the missing piece by far here is the lack of good developer tooling let's take a look at harm number five her the progress what appears like a pioneering of innovation ends up being one big spike in the wheel of progress and it's a really really big spike here's a quick history lesson for you in the hairy days of the internet there was a library called Mo tools oh boy it's going to be squoosh gate it was a utility library to help developers survive the unfathomable chaos which was web def some 20 years ago its goals were Noble its means well not so much to be fair we didn't know that its means were not good yet we learned we learned a lot see Mo tools worked by imbuing the prototypes of global JavaScript objects with extra functionality in return you got a ton of useful methods like array prototype get last function prototype attempt and number prototype limit none of those really existed in JavaScript but in the end it was in such a sorry state to begin with nobody really cared yeah like JavaScript was so rough that something coming in and adding all this stuff not a big deal actually big deal the other way it was really nice until more and more sites got built with Mo tools and when the time came to define the next chapter for ecmascript to address all of those pains and make the language better the committee was faced with a conundrum they wanted to introduce new prototype methods on Primitives but they couldn't because half the web relied on the same methods from mols half the web might be a little much but it was a significant portion so if they wanted to add something that was already in M tools they would now Collide and if the browser version was different than the MU tools version your app would break great times shipping these methods as part of the language meant breaking half the internet which the committee found the wisdom to not do very fair they had to bend the spec to reality so we got string prototype includes instead of spring string prototype contains to stay consistant with array let me make this abundantly clear the language itself couldn't become more convenient because developers were addicted to a convenience library that modified things it didn't own yeah I'll see how that one settles my immediate feels iffy on this but my my mind might change as we go mood tools also spawn to the smoosh controversy causing a newly added array prototype flatten to break the web and forcing the tc39 folks to rename a perfectly valid method named to Flat yep if you guys aren't familiar with smoosh gate tldr for this controversy is that mols had a flatten function on array theirs behaved in a specific way when the browser wanted to add its own it behaved differently forgot the specific differences the mutuals one creates an innumerable flatten property so it's later copied to elements but if the browser ships a native version it becomes not innumerable and it isn't copied yeah there you go there's this innumerable the browser one wasn't it was going to be a mess because of the elements thing that they had G yeah so if your browser was expecting to run flatten and then get an elements object back but it was instead getting array back because the browser over raded again it breaks and the term smoosh gate happened because somebody somewhat ironically suggested that we should just rename it to smoosh to avoid the compatibility issues and that went viral so everybody called it smoosh gate as a result fun Beautiful Mess the usual things you expect from Modern web standards well web standards at the time we've learned our lesson since but that's smoosh gate M tools has passed into history but its impact on JS has remained so next time that you're choosing to support a short-sighted convenience please do not complain if the web standards communities introduce a proxy Target or proxy options property to the fetch API instead of a single y fair point if now with bun standard they can't use proxy for things in Fetch fair I admit I don't know the details on why mu tools chose prototype patching as their design Direction I'll give them the benefit of the doubt assuming that they thought it was the best way for their features to feel like extensions of the web and the language instead of a vendor Library perhaps they simply didn't know better and there was no other examples to learn from I am thankful they've become one for the rest of us a truly fascinating part here is that none of these costs and harms would even be relevant if one approached convenience with a bit more thought and precaution it's only proper that we looked at alternatives to Passion globals sorry you had to write this there are good reasons we all have opinions anyways Alternatives there a widespread misbelief that convenience either comes directly from the spec or it comes at the cost of violating one I I don't know how widespread this belief is I do kind of have that belief like I can be convinced either way again jsx is an interesting example here where jsx isn't JavaScript it's not following the spec it is hilariously more convenient and a lot of the convenien is because it looks like an existing spec HTML being against patching Global doesn't mean being against convenience fair I would never ever ever say the author is against convenience it's very clear here that he is more concerned about the longevity and potential ecosystem harm of overriding globals very fair if anybody here thinks that he's against convenience I'm on his side not yours he cares a lot about these things mock service workers is proof of it he can still have reservations about these implementation details I am all hands for convenience and yet I hate whenever Frameworks patch globals there's one thing I hate even more complaining without proposing Solutions you're dropping all of these bars in here love it there's a ton of solutions to any API problem better than patching globales and the quintessential part of any of them is being explicit abandon the magical cast aside the pretense that you own Fetch and it is only through modifying it that you can achieve the golden DX you dream about the DX is fundamentally and irreversibly flawed and of just given you five extremely detailed reasons above as to why Fair let's take a look at buns proxy API as an example and make it more explicit a wait proxy request equals proxy proxy URL new request and we fetch the proxy request instead um for this to work my assumption would be that fetch would have to handle a proxied request differently from a normal one that whatever this generates is not the standard object shape for what fetch expects like if I imported this from bun I created this and I passed this to node fetch instead or something else that isn't buns fetch my assumption is that this wouldn't work this has expectations and that fetch has some implementation details that allow for this proxied request to go through fetch normally but my understanding would that this would have to be a custom fetch as well okay so so the request itself so this request gets shaped so it's a normal request but it happens to be hitting something else that has the right data to do the proxying okay that's more fair UNC can do proxies according to chat 2 through fetch Ops dispatcher which is already configured good to know my curiosity here is that like Are we more concerned about the AP where having the proxy key here is the problem or are we more concerned about fetch itself having behaviors that are overridden my gut when I saw this is that this proxy call would have to be handled differently by fetch so we're still patching fetch some amount response from the author you're probably right I hope it'd be possible for the request constructure level to handle this but there's a lot of intricacies to handle yeah I wonder if you could pass a promise to fetch as an argument hopefully no yeah these are the the concerns that I would have Fetch with proxy if no proxy return fetch oh boy an implementation from bot good stuff let proxy strings proxy username password host yada yada new proxy agent which is coming from UNC which by the way if you're not familiar UNC is how fetch Works inside of node uh proxy agent u i dispatcher agent is dispatcher part of the actual fetch standard cool yeah so yep the proxying is Supply changing the request Ur and proxying headers okay it's in DC specific great um the reason I'm diving so deep in this and I know it seems pedantic there are two parts of this that are important to understand I think I have to go back to excal draw for a minute because we have two things here when we're overriding the globals we have behavior overrides and we have API overrides it's rare you'll have an API override that doesn't also include a behavior override but for the sake of explaining this I'm going to separate the two a simple example of an API override would be something like the fetch proxy example from bun where this is a new API being introduced it enables a new Behavior but this is a new API that exists in fetch in bun in nowhere else a behavior override would be something more like duping requests in RSC these things are very different the API overrides imply a behavioral override or a behavioral change but the behavioral overrides as long as they're behaving in ways that make sense to the the box they're contained within I think this is fair I think that's the the line I'll draw is that API overrides for globals messy should be avoided they do a really bad job with education they do a really bad job with debugging they make things worse for most people but behavioral overrides within a given framework where they have decided in this context they want this Behavior to work in this slightly different way I think this is a fairer thing and in the example here I actually like this a lot because they have removed the API override by making it a thing you import and my gut feel is that the behavior here would have to be different some amount when you pass this new object but you're using the API the way it was designed I think this is a really good balance and it seems like author agrees explicit predictable love it not to mention that with the resource available for selling bun folks could have designed a cashing layer as a service worker for service yep yeah you cannot safely DD fetch without an API override otherwise you'll dup calls that weren't meant to be duped like something non item potent if you're fetching the same thing multiple times within one server request they are item potent the user makes their request to the service and then out comes the HTML page with all the content index.html so if this Behavior was happening such that within mul requests you had dding that you didn't intend and that was causing requests that are item potent and have specific expectations to fail cool totally fair don't don't think that should be the default however if a user is calling this web page it would be unintuitive to call these functions in multiple places and have o get called four times I think this is the more intuitive behavior for get requests and if you actually have a reason that this request should respond to something different than this one that should be included in the data that you're putting in the fetch call in the first place but like when you're fetching on a server within a given request for a page remember once this is done the user has HTML and the cache in react no longer applies future fetches get new data as such I don't think this being built into fetch in react is a particularly big idea because it has allowed for a more intuitive Behavior to occur that makes sense within the framework Without Really breaking things in other spaces if this only worked via API overrides where I had to pass custom things to the fetch calls that would be one thing but this within the context of like like this whole thing happens within like 100 Ms or less if you're expecting one request to be fetched four times and have a different response in these four places even though all of the inputs are the same and the URL is the same you have a really shitty service like that is not a real expectation that's absurdity this debouncing makes a lot of sense and it's confusing to me that people would push back on that we're going to change this we're going to have a page now that um the fetch call is going to be get Epoch time so we're going to be literally fetching slash time and this is going to respond with Epoch time which is going to be a number that's different if I call get Epoch time three different places in my app when I'm rendering this page remember the output here is static HTML so if I am requesting a page and I get this Epoch call time three times we'll put this in here so say the Epoch time was 12 would you expect when you render this page for the three places you called this to be 12 all the same in the HTML or would you expect it to be 12 13 14 it makes no sense it makes no sense that within one request within one user request that you would have different responses generating different HTML within the context of this one thing if you're fetching the same thing cuz like you as the developer you don't know which of these is being called in what order anyways it's just so hard for me to Fathom any scenario where you would want the same fetch call during the same user request to respond with different things when you're using get here's a common one we have the like last updated app or like time page was generated if you have different results in different places on the same HTML that just it doesn't make sense Ryan carniato is one of the best people when it comes to everything standards and web and JavaScript behaviors I like his take on this too it's worth considering I don't like patching globals but hydration is really nasty in general hydration is when you render something somewhere that isn't the browser and then the browser connects all the parts again so JavaScript can behave how you expect hydration is nasty yes and almost every framework has to do it in order to generate HTML on the server and then let the client take over so because hydration is nasty and hydration is largely necessary with modern solutions we're stuck in hackland the whole thing feels like a hack without knowing the details if one were to patch Global purely for hydration and nothing else I think a hack to patch a hack is probably a very reasonable thing to do yes again if it's not changing the API it's just changing the behaviors in the specific unique admittedly hacky scenar scenarios much fairer overall I I went on that tangent for too long let's go back to the proposed Solutions I actually liked this proposal and I would be cool with this because again overwriting behaviors for the thing within the context of your runtime your framework your stuff is different from overwriting apis so the code in your thing is fundamentally different from the code in other Solutions and doesn't follow the standards and specs uh is it actually an override if we talk about the new features in new run times with proxy specifically w3c spec says it's implementation defined and therefore each fetch implementation just invents its own way to do proxies also a fair point like we don't have a standard for this and the expectation is that we Define it ourselves I think that should probably be defined outside of fetch or around fetch but yeah the lack of a standard existing is frustrating with this change the proxy functionality no longer appears from thin air it has been imported from bun explicitly nobody will confuse it with a standard JS behavior in fact devs will be reminded on every import that it is bun who's making proxying easier use your developer oriented marketing as a side effect of being a good API design I don't love having to import always but fair very fair point I like the explicit nature here I I generally lean towards explicit where possible as long as it doesn't hurt my ability to interface with other sdks we can no longer shove it into fetch so we have to be smarter about our proxy function we want to proxy request right so maybe let's accept any request instance as an argument and return a proxied request it doesn't interfere with how a request is constructed or a fetch call is made all the while it's achieving the same proxying functionality yeah I love that result of being an explicit utility our proxy function doesn't suffer any of the drawbacks inherent to to patching globals it's a function owned by the framework which makes it easy to version maintain modify and deprecate it's predictable because you clearly see where it's coming from and what it does most importantly it doesn't masquerade as a native JS Behavior I like that you're calling this out that it's not pretending to be native JS specifically and that you say this is most important because I agree this is actually really helping me understand where a lot of the issues are coming from it seems like the API changes are significantly more frustrating to people than the issues that we have with uh the behavior changes I think behaviors being a thing that exists with any solution is very different from API changes to globals and I like that this is being separated so well here it's extremely easy to learn as well you go to the bun documentation see the function call Signature and wait what's request request what I have to learn how to construct requests on the web now damn you bun I didn't ask you to make me smarter there's no lock in by Design and if you wish to play chaotic good here you could even publish proxy for other runtimes to use this is what I was saying before I'm not sure if that would work without some significant stuff as we saw in the Fetch with proxy from Cooper here it's not that easy to set up yourself you have to write a custom Fetch with proxy for that to work and here's where the next like spicy take is is like if they decide to override fetch so that you can pass it a proxied request is that the same problem or is that better my gut feel is that it's significantly better and finally you start to inspire and incite progress instead of pretending that it's happened already the others just haven't caught up yet you have me sold on this I almost fully agree with what we're seeing here since the ball's already rolling let's refactor the apis from react to next as well this is going to be mostly boring because we'll apply the same pattern to all of them riding them of the same problems and reaping the same benefits again the problem here isn't within your react code like I like this a lot for within your react code and the calls that you own they've actually implemented this already with react. we have this it shouldn't have been react. it should have been react. ddop and again the issue here is the ReUse of the term cash when one of these things is very different from another thing yeah and with cash again my subject here is that for with cach to work the way it's being shown here you'd have to change how fetch Works to receive the with cache and again if we go to the code example if that fetch call exists within Library code like get user info isn't your code this comes from a library you have no way to Cache this part of this function if you just want to cash this line I can't reach into the library and do that the fetch override isn't a perfect solution at all I'm not going to sit here and pretend it's the magic thing that fixes all of this but it made a lot of these edges a decent percentage likely more likely to be less annoying it speaks volumes that both react in next are already in a process of migrating away from patching fetch by introducing their cach and unstable cach apis respectively I hate the naming Collision here because unstable cach is part of next and it's a very specific useful cool thing for caching between requests and then cache which is react's way of dding server calls these are very different things and them having the same name as a mistake I things react should rename use server use action it used to be this LOL use client use Interactive react. cash react. ddop do I seek in use effect do not use effect or you will be fired we'll go with it I've struggled conveying the idea of a concept in rules is something bigger than implementation details like with react conceptually it has pure functions not just times that it happens to render that's why concurrent mode streaming react comp pile Etc can be built later on the same API similarly in next Dynamic versus static isn't just for setting the defaults on a page it's also to allow creating of partial pre-rendering expressing a dependency locally on the pams isn't just to re-render layouts it also expresses subpage requests lazy fetches and cach ability that comes later I see similar misunderstandings of react. cach is a per request page DD but that's not what it is it is a cache that depends on other inputs and that those can vary it's a cache because it can be expanded Beyond a single page and it can create stale values as a client cache patching fetch is never about dding fetches and patching date. Now isn't about a specific thing it just comes from the same principle of tracking inputs like how hcal tracks IO differently from other code the same thing can be used for a bunch of stuff I thanks for showing me a tweet where I get owned Zeo appreciate that ternative take from someone much smarter than me my rebuttal to Sebastian would be he's right in the sense that he's building react and these things make a ton of sense for that because the long-term goals are to do way more with this my reason for disagreeing isn't anything to do with what he's saying here it's simply that the average developer isn't smart enough to to understand these things and the naming is less about what it can do over time it's more about educating users about these new things and there's enough of these things going on that we need to make the ability for us to understand way simpler we need to improve the education materials we need to improve the developer tooling around the server and the client side and the relationship we need to use names that might feel stupid in order to be very very clear about what benefits and negatives and what behaviors we should expect with these things and how we should use them right now and as bad as that might feel it allows us to be more successful long term so I think it's really important for us to lean into those things let's finish this article because there's a lot of good stuff here let's see the counterarguments too below I'll address the most common counterarguments against my concerns just in case the article failed to convince any of you that meddling with global is a terrible idea who cares apparently the thousands of people who watch this video let me know in the comments if you care cuz I'm curious who does and doesn't but it's a better developer experience if all the extensive explanations of this article failed to convince you that patching globals is never a good developer experience I fear nothing will fair I don't think that this is a great DX I'll agree with that my argument was never about DX specifically buns a custom runtime there is no patching bun is built on the promise of node compatibility node implements fetch according to the what stand or what WG fetch standard and so does BUN they don't both follow the standard but as somebody linked earlier Mato commented here uh so yeah this is a bug I personally think it's pretty cool that this bickering between bun and Dino resulted in node catching bugs cutting issues for it and hopefully long-term fixing these things really cool stuff like the standards are being followed better as a result of us trying to implement them it's just funny that this silly poll by bun is resulting in node following standards better good stuff yeah bun is patching fetch deviating from the standard and introducing all the issues I talked about prior yes I think they're doing both I think on some hands they're overriding defaults on the other hand they're pushing the standard forward and doing their best to figure do we follow node or do we follow standards or do we push node towards the standards but node does weird stuff too of course it does it's a project with 15 years of history behind it I swimming that weird stuff on a daily basis at work we should learn from its Oddities and lead by example not using them as an excuse to implement harmful apis did I get pre-read again the other way oh another one that I always drop fetch doesn't exist on the server Global fetch API has existed in node since 2022 yeah yeah it's starting to really work but we're getting there you added this one for me well I I am honored that this got added specifically for me apparently we have an example here of just patching or passing Fetch with the proxy and it works head set forwarded from URL proxy original URL yeah assuming that the proxy server handles this properly this should work fine yeah cool let's see people making proxy work without having to change fetch yeah fine fine it it's taken so long for fetch to get to the server that still iffy on this and we're still figuring out what fetch on the server even means I think working around it and doing what you need to is fair like people in react native are still heavily using um axios like we're catching up still oh apparently we can't use the unc1 in bun because it doesn't export the proxy agent for the bun version thank you again Cooper for stopping in but the fact that none of this is that easy is hilarious this is chaos but these Frameworks know better they likely do but in some cases it takes them time and feedback from the community to arrive at the better I've mentioned before react and next are moving away from ping fetch in favor of more explicit apis when I asked Lee to provide more context behind the switch he shared with me the following in theory Community packages could publish their own code that used Fetch and set these caching policies on their own and we started to do that a bit but it was very opaque and hard to tell why something was cashed so we decided that we wanted to be more explicit yes but also the it's hard to tell why this is still a developer tools problem that I think really needs to be a focus perhaps we'll even see bun reconsider their direction of patching globals which would immediately make it a more mature runtime at least in my eyes bottom line is as follows there isn't enough amount of experience skill or credibility that would render you immune to making a mistake yep I I've seen some of the smartest people in the industry make really dumb mistakes like changing use action to use server the only thing that matters is having the strength to admit one and the wisdom to resolve it once you do I hope this article was able to shed some light on the dangers of apparently controversial practices of patching globals it's a foot gun and we've already fired it it seems that we need a due reminder that the feet we have are just two and again a thanks to Lee Rob and Jordan harband for proof reading the piece really love that you got other people to give you eyes on this fantastic blog post it did a great job of reframing the concerns about this and it's changed my stance too I now have a much clearer relationship between the like behaviors being changed and the API being changed that's enough yapping for me though this was a long video let me know what you think and until next time peace nerds ## Please Stop Putting Functions In Your Database - 20240104 I know I just made that video at how separation of concerns is a lie and yes I do mostly believe that but there is one place where I really like to keep my concerns separate and I can't believe I even have to say it your database is not where your logic should go ah why are we here why do people think that logic and databases make sense there used to be a concept of stored procedures where you could basically have a function that existed in your database to be called as part of your data process and it wasn't great I can't believe that was the norm for as long as it was and while for the most part moved beyond that and moved our logic to our servers and to our apis and let the database just be a place where you store State and information I have started to see a swing back and some of the things have seen terrify me the first I want to talk about is the concept of role security this concept became more popular again during the graphql era where everybody was trying to replace their SQL database calls with a graphql layer in front of it I think this is a bad pattern that's set a terrible precedent for the direction of databases going forward in order for you to expose your database as an API you have to have a permission set of some form otherwise any user would be able to update any other users's information or access their Bank transactions or whatever else your application supports so in order for that graphql to be limited as what someone can or cannot get from your database you have to build authentication into your database and the shape of that authentication usually comes in the form of role security which means that you have a procedure or a query that determines whether or not a user can make a query or get access to a thing and you define on a row who does and doesn't have access to that data this results in your API code and logic being a lot harder to work with if it's even owned by you at all because it's the shape of your database and how these things are defined that determines what you can and can't do and getting this configured correctly in an understandable way is Hell Ro level security and query level authentication become really hard to maintain patterns really quickly and just figuring out when you're writing an endpoint what someone can or can't access can be an incredibly difficult challenge it's horrifying and I can't believe we're going back to that it is great as subab base is as a product this is one of the biggest flaws it has that it relies on Ro level security so that you can use the sub based client in your JavaScript code on the front end directly and now the user isn't calling your service to get information instead the user's directly calling your database through subbases layer and I don't think that makes sense users in databases should not interact there should be a layer between them and we usually call that layer the API another alternative typ for this video could have been in defense of apis because that's the point I really want to make here when you start putting more and more of your logic into your database it becomes less and less clear what your api's role is and what it does and as soon as you want to change something where you change it and where that thing goes becomes harder and harder to understand and manage I can't believe databases are being used in this way and that it's being recommended as often as it is I just can't get behind it and yeah call me a an old head but I like my databases to hold data and I like my apis to do the logic so yeah call it a spicy take I'm curious what you guys have to say have you used Ro level security or stored procedures or any of these other like logic in your database type things what was the experience like did it work out well for you if you want to hear more about my thoughts on the current state of databases and what I do and don't recommend pin a video in the corner here all about that if you've already seen that one you're not interested there's one below YouTube seems to think you like appreciate you all out t as always see you in the next one peace ## Porffor Compile Your JavaScript To WebAssembly - 20240805 wm's been promised to us as a solution to the performance issues of JavaScript for a long time we've seen a lot of Frameworks trying to rethink the web with things like go and rust in order to make our sites as fast as possible well aom comes with a lot of uh how do I say it peculiarities make it not the best choice for doing traditional web development and if we're going to be realistic we have to accept that most web devs primarily know JavaScript that's why there's so much exciting development in the runtime World taking the code that we're already writing in JF in making it work in a more native way be it with bun and its crazy Zig bindings or static Hermes and all the crazy things Facebook and Amazon are doing to make your react native apps super fast at the speed of assembly and see what happened to wasm what happened to this promise of making the browser way faster and what happened to JavaScript what if we could just compile our JavaScript into wasum the same way something like static Hermes is letting us compile it into assembly if wasm so much faster why can't we do that it's a great question and there's a really interesting Dev working on a really interesting project and I want to talk about that today because porer is a fascinating attempt at rethinking how we write and run our JavaScript to be very clear this is super super early not ready to actually be used people seem to think I'm super excited about and adopting all these bleeding edge things I don't know if or when I would ever use this but the potential and the research going on here is so cool and I want to take some time to dig into it my face is covering the side here it's a from scratch experimental ahead of time JS engine compiling your JS code to web assembly or even to native code ahead of time it's very limited but the developers now getting to work on it full-time and I'm very excited to chat a bit about it we look at the playground here we see this simple is prime function if numbers less than two return false I is two i less number i+ plus return false return true just a quick way to check if a number is a prime and while counters less than or equal to 10,000 we run through this and we use porer number log to actually log that out and now we see the was code that this puts out and it's very wasy it very much has that assembly vibe that nobody would want to actually write What's Happening Here is it's compiling out this JavaScript code and turning it into wasum ahead of time so the same way typescripts compiled to JS this is taking JS and it's compiling it to wasm note that I said JS though because it's one of the most interesting aspects of what's going on here it's not relying on typescript as much as other Solutions do so this code executed in 7 milliseconds if I take the same code and let's hop into my terminal we'll make a new project this paste change this to console.log then node index.js I have to time this so it did run very fast as JavaScript 06 seconds total user times .02 seconds not quite the 7 milliseconds that we saw here but not too far off either but if we look at their promises things are very interesting it's up to 18 times faster than Javi which is what is Javi it's an existing JS to wasm toolchain on your js on wasm Javi takes your JavaScript code and executes it in web assembly embedded JS run times and create very small wasm modules if I add a zero here how bad will it be wrong button okay added a zero compile 56 Ms executed 450 milliseconds if I add the zero here and run this again 62 seconds so a decent difference not massive but a solid percentage performance win this is kind of what I expected though I didn't think the performance of compiling two wasm would magically be hilariously exponentially better but I bet if we just call is Prime and then don't do anything oh that's actually slowed it down somehow no it's just that's roughly what it takes cool and if I kill the console logs that tends to be the slow thing in node now they're like neck and neck 451 milliseconds versus point or 500 milliseconds so the performance here isn't going to be like massively better than something like node but that's not the benefit one more zero people are saying um give it one more see how long it takes sure my computer is lagging now is what's happening that might have just killed the tab is what that did that is what that did yeah don't put too many zeros if you don't want your browser to lock up regardless the performance win here isn't huge it's not like putting it in wum is magically a thousand times faster than the JavaScript equivalent what it does enable is for embedding it way way more minimally because if you compile your JS ahead of time you no longer need to bundle something like node with your project if you want to make a game with JavaScript that runs on people's computer comps and it's distributed through Steam now you can take that 90 megab binary of node plus your JavaScript and change the result to be less than 50 kilobytes it also uses way less memories it doesn't need all of the JavaScript runtime it just uses wasm or even native stuff if you compile to see and the performance can be up to three times faster these are some really cool wins and if you're a person making the rights of Technologies for something like this it has the potential to make a ton of sense I got a lot of really useful contexted info from the for Dev so I'm going to go through that and do my best to honor it first we should talk about honk because they're a fascinating creature 19 years old they were working at Mozilla for the last 10 months and they just quit so they can work on porer fulltime now that's really exciting wait they made test 262 no no that's nuts that just doubled my confidence in their ability to make this happen oh you're in chat yo Canada thanks for stopping by that's nuts these are the right people to be doing these things if like test 262 for those who don't know is one of the most useful res resources to see what features are supported by which JavaScript run times so if you want to compare how JavaScript cores feature set Works compared to something like V8 this lets you see each of these Solutions and how much of temporal is implemented how much of decorators are implemented all of these types of things and if this Dev is that focused on this type of thing it makes perfect sense to me that they are the right type to reimplement JS in such a crazy way super cool stuff yeah CRA there one of those rare like 100x devs that knows things I can't even comprehend so here we have a comparison with V8 spider monkey JavaScript core Hermes Rhino and porer hopefully I'm pronouncing porer right let me know how much I'm butchering it and you can see we're still early on a lot of things like these proposals and when it comes to es6 not too much implemented still not too far from Hermes but far from having everything implemented still nuts to see this much progress on a project that's this early and also very promising that the dev who made the site for checking it's also the dev working on it I think it's important to contextualize the position of porer compared to these other Solutions and honk did a great job reaching out to me and giving me that context so I'll do my best to share that we're going to open up excal draw we have a lot of things to put in here we have V8 we have things like Dino we have porer we have static Hermes we have bun we have llvm no it's not llvm it's LRT sorry LRT which if you're curious about I'm one of the few people with a video on it for a long time I was the only person with a video on LRT it is oops not mean to do that it is a runtime built at Amazon to allow for lambdas to spin up faster and also to ship way less code to said run times so of these if we look at all the options here I'll just make this a fancy little summoning circle with all these options where do y'all think porer leans what do you think it's competing with my assumption initially was that porer was competing with static Hermes which for context static Hermes is the attempt by meta Amazon and a few others to allow you to compile your typesafe JavaScript code be it in flow or typescript to native code and it uses the type definitions to figure out which memory to map which types to use on a lower level so that it can use those type signatures to make more optimal code and since porer is compiling to assembly and then native code with C the immediate assumption I would have made is that it was close to this honk has since made it very clear that it's not the case their goal is actually a lot more aligned with LRT I need to make a spectrum to explain what I mean here on one axis we're going to have performance as in Ops per second and on this other Spectrum we're going to have binary size the these are two very very different spectrums and all of these fall in different places V8s and I'll say uh this is binary size I'll say big here actually I'll say um optimized here big here and then I'll say slow and fast here so this is our rough Spectrum all of these Solutions fit somewhere within this bun isn't worried too much about binary size because it's worried about performance so bun is very fast but it is not small V8 is also relatively focused on performance and it's a bundle that already in a lot of things with something like node but I would say it is nowhere near as fast as Bund I almost put it like right in the middle but it's binary size isn't the worst but it's not good so I'd put that there Dino I would say is a little more performance optimized than V8 but not a lot because it is still using V8 technically speaking I also want to change V8 to node just to be a little more polite to it Dino I would say is a little faster bundle size a little more to consider because you have to bundle a whole separate runtime for it and then LRT this is where things get interesting because they're taking a hit on the performance in order to make the binary size the actual file that has to ship to a machine to run way more optimized LRT is one of the few Solutions optimizing for binary size and is willing to take a hit on performance to get there that's why porer is so interesting because it's trying to get there there without the performance hit these are arguably two different directions but the goal is the same of optimizing how much has to ship to a user or to a Lambda or wherever it has to in order to actually execute the code very interesting it's also worth noting as chat just pointed out that binary size and startup cost are linked which is an important point to make because having a optimized binary won't make your code run faster so once it's running the am of requests per second you can handle doesn't necessarily go up but the real win is interesting which is the actual time to go from not running to running is a lot better when you optimize I also forgot I put static Hermes in here let's do that quick before I forget static Hermes is a little more focused on the bundle size but a ton on the performance in fact I would say more so than even bun I put Dino a little back as well hopefully this helps contextualize where porer stands it's a very unique solution because theoretically it's slightly faster than no or Doo and other things but it's not as compatible there should be a third axis here of compatibility because porer LRT and static Hermes are all losing in compatibility it's almost guaranteed once you're over this binary line where you're optimizing your binaries you're rewriting everything and now as such your compatibility is going to go down bun has stated the original goal of being as close to node compat as possible it's not there yet but it's making a lot of progress and then Dino is effectively fully node compat now but these are all the important things to consider as you look at these Solutions like yes sure we're on there are now more JavaScript run times than there were JavaScript Frameworks 15 years ago but the same way most Frameworks have some specific goals in mind these run times also have very specific goals in mind the only ones that are even vaguely close are node and Dino because they were created by the same person so that almost makes sense that Dino was largely created due to the small handful of flaws that Ryan saw and what he created with node that he wanted to patch up so he just made a subtle move over with that bun says no we need crazy performance and we'll eat a lot of cost to make that happen static heres is we need a lot of performance and we're going to do the impossible and make a typescript to native code compiler for it porer says what if we could just make a smaller binary for our JavaScript code that ex or executes on users devices very interesting it's almost taking what LRT did for servers and trying to do it for users according to the Creator I'm doing good with the comparison so far thank you so much so as I mentioned before Canada honk reached out and they gave me a ton of really useful context that I want to break down I could try and paraphrases myself but their words are better I asked a few questions first off they confirmed what I was just sharing which honestly I stole from them most of this video is just me taking advantage of the awesome resources and info they gave me I started working on this before static heres even existed to compare against that directly that is much more focused on typescript in specific use cases rather than a general JS engine like porer I think people focus more on jits as they are good for use cases like browsers thanks to the relatively tiny compilation times but for some applications they're not great C LRT which in a way this shares some potential goals with I love that comparison and to again double down on the typescript thing porer doesn't have more info about what your code actually does because I don't know when you define something in vanilla JS if I like let some value equal seven if some value is greater than seven some value equals he since you can write code like this in JavaScript it's really hard to optimize it because you don't know what data type or memory allocation to make for a given value but if I was to use typescript to enforce this has to be a number obviously this code can't be written anymore but it could be optimized differently even if I did number or string we now know how to define this pointer in a way that we can make things a little more optimal on the native level but forer's goal is to let you take any JavaScript code AS optimizable or not as possible and handle all of it the same way something like bun Works where static Herm is trying to take advantage of type definitions to make the most optimal possible output also to note porer can optimize using typescript type info but not to the same extent as static Hermes makes makes sense to me so I ask some follow-up question specifically what weaknesses do they see with with the aot model which is the ahead of time compilation so you put in JavaScript it compiles to wasm and then you ship the wasm to the user versus just in time jit where I ship the JavaScript to the user and then their runtime usually V8 in the browser interprets that to be something more performant which is the jus in time right is they get the code they compile it to something else quickly so that it could run more efficiently and I also asked how has wasm helped and limited the development so far this is a response straight from the Creator thank you again honk for responding as quickly as you did for stuff like browsers where you were loading Dynamic content I would basically never recommend it and just stick to jits at least for the foreseeable future I love when devs call these things out I see so many devs that are like I made this solution and it works for everything but honk is straight up saying don't use this for loading dyam stuff in the browser if you're loading Dynamic JS don't use this instead also things like eval or function definitions won't work since you can't aot compile them if you don't know all this info at compiled time the other weakness is that since you're essentially Reinventing the JS engine as well as the runtime it will take quite some time to reimplement everything but it is feasible I would doubt almost anyone else saying that it is feasible and I certainly would doubt them they said they were going to do it if they weren't literally the creator of the tool used to compare how compatible different Solutions are almost any other person I would be calling a lot of on but I would be calling on them by using test 262 so yeah they can actually do this to my second question about wasum they replied wasm is great for the ecosystem especially looking into the future being able to potentially just give a wasm blob to something like a binary wasm opt function or package which will optimize it for you it's a very cool possibility it can be limiting sometimes but most things I've had issues with are solved in upcoming proposal like wasm GC because theoretically that will finally be in the browser wasm garbage collection is a whole rabbit hole man if you want to see how bad that one gets I have a whole video why web assembly can't win and most of this is a rant garbage collection so check that out if you want more info on that it is limiting for some performance which is also why I started investing in a native compilation by compiling the generated wasm to see themselves and then passing that to clang to make a native binary that's a pretty crazy compilation pipeline so imagine this we start with typescript then we TSC that or ES build that to JS then we compile that with a porer to wasum then we compile that to C and we compile that to Native binary that's quite a compilation tree if I do say so myself nuts but the potential of this is crazy when you think about it a lot of Technologies are doing things like this already like even now I'd be doing TS to JS to the V8 jit to some native chaos so it's not that many more steps but it is a fascinating build chain also they called out this is relatively early in research project and an important call out here from defunct which we'll get to in a second because I want to read the post about it a new chapter for porer porer is my hobby ahead of time JS engine but no longer this week I've resigned from mazilla after a wonderful 10 months to work on porer full-time supported by Chris writh from one of his unannounced projects writh is a legend created a lot of things also original GitHub CEO and as much as I might not be fond of ladybird the fact that he is sponsoring this development changes my tune entirely because similar to funny enough the issues I had with ladybird where it felt like it was reimplementing for the sake of it this is almost the exact opposite this is looking at this chart seeing what LRT and other things were doing and wanting something in the space in the corner if I just delete that there's a huge gap here that nobody was filling and static heres had no intention of filling so that's why I'm excited so much about what's going on here is this Dev saw a hole they wanted to fill they chose to fill it obviously there's another giant hole here worth filling but uh maybe not so worth filling the more you think about it but seeing this opportunity and taking it is very exciting and I'm pumped that they're getting funding from the original GitHub CEO in order to do it especially since they have projects that they're actually planning on using it for in the future so what actually is porer probably should have started with this honestly if you don't know porer compiles JavaScript or typescript code to wasm ahead of time rather than interpreting it or just in time compiling it like existing engines do compiling JS ahead of time allows some exciting possibilities you can ship it as wasm instead of needing to ship the whole JS engine better safety via wasm sandboxing massive performance improvements compared to interpreting and potential native compilation too and what's changed is that they can now bring full attention on porer Independent open source as well and they can continue focusing on things like test 262 making sure their stuff passes it and also maintaining it for other Frameworks as well super cool stuff shout out to Chris for funding this huge shout out to Canada honk for making this keeping me informed and doing their best to make my dumbass able to explain these things properly I'm actually hyped about this is it something I'm going to use anytime soon no does it magically make every website way faster absolutely not but is it a promising opportunity to change how we think about JavaScript and to build a new way of building our JS absolutely and if JS is going to be the language of the future things like this will be necessary One Last Thing Before I Forget make sure you give for a star on GitHub I want to see it explode even just today we've had that but once this video is out I want this in the thousands not the hundreds support them where they're building real Innovation give this a star obligatory plug for The Birth and Death of JavaScript which is one of the best tech talks of all time sadly not on YouTube but if you Google search this you'll find it it's from Gary Bart from over 10 years ago now I almost want to make a video where I reflect on the points on this and see how much of it did or didn't come true because this video explains how JavaScript takes over the entire world and tools like this are huge huge part of how we get there once again shout out to candada Hong for doing this and giving me all the information necessary to cover properly I'm really HED with the project you should give them a follow so you can keep up with it too until next time peace nerds ## Precommit Hooks Are Always Bad - 20221114 please for the love of God stop using pre-commit hooks I'm like I know I'm frazzled about this one but this is one of the few Hills where I I will confidently say I'm right and you're wrong specifically because you should not prescribe git workflows to your developers until and this is very strict until they have pushed the way that a developer uses git on their machine is their problem if you have opinions about how those commits should be formatted you can run those on your server if you have concerns that your lint rules aren't going to be honored you can check those on your server it is so easy to set up CI nowadays that if you are using husky or a pre-commit hook tool instead of CI you are being lazy and blocking your developers productivity for contributions in the future I agree you should enforce rules in your code basis the commit is the worst place to do that my personal workflow with Git involves a lot of commits I regularly make commits because I'm trying something and I don't want to lose the changes I made already and I'll go through after and squash them or maybe I won't and if you don't like how I'm using those commits and structuring things you can complain in the pull request and I'll squash it then but when I am working on my machine you should not block me from using git the way I want to use it if the problem is that the tooling you're using at your company sucks so CI is too hard you don't bring a foot gun in you don't make everything else worse you get that problem fixed pre-commit hooks are the most over prescribed solution to a problem that shouldn't exist that I know of in software TEF please know if you're in a code base that uses pre-commit hooks do your company the favor and turn them off quickly build the GitHub action let that run your CI and I promise you everybody will be happier trust me on this one foreign [Music] ## Prettier_ Nah I got something way better - 20240714 we've all heard about prettier what about sorry to my editor who has to bleep all of these because this is a very interesting project I got link this I had to dive in because here just seems hilarious to me so what is here ear a code formatting tool that aims to make your code look as terrible as possible is the exact opposite of popular tools like prettier which focus on improving code formatting and readability okay so this is like go format then shittier Embraces chaos messiness and confusion making your code look shittier than ever before is it at the very least deterministic like if two people write the same code and format it will come out the same shitty way with shittier you can expect the following random indentations for a chaotic code structure mixed case Madness that breaks consistency spacing nightmares with added or removed spaces tabs and line breaks oh boy shall we run shittier on a project let's grab one of my tutorials quick so here is the project I did my last tutorial with so this is a decent sized project lots of components and things in here it's all under source so it should be pretty easy to run shittier on so we will globally install shittier shittier Source only JS files cool that's a good start to use shiter you can't use typescript only JavaScript you can't have anything useful in your code my code has successfully been ified okay that's beautiful it even does random casing oh oh boy now we're talking this is great do you know what we need to do though we need the jQuery Source core Jos this has plenty we'll go here cool here's a decently sized file from jQuery and now it has been fixed this is how jQuery always should have been it's beautiful it's art oh man this is so hilarious like and this is valid JS HTM X to be fair already comes with the if you haven't already seen my HTM X sucks video check that out cuz HTM X is terrible as we all know I'm going to save without formatting when I saved it there it actually formatted it with prettier so now we have no formatting because why would we have formatting that's stupid we have a HDMX you strict there we go oh I know what we can do Source HTM X.J JS perfect add formatting to HTM X Source really quick point that I think's important don't just go file joke PRS and random important GitHub repos the only reason I can do this is because I'm friends with HTM X and I am pretty sure they're going to find this funny so I know them pretty well don't just do this though don't go file joke PRS open source maintenance is already hard enough don't make it harder for those maintainers unless you're friends with them you think they'll get it and you're doing it for a video to promote HTM X so yeah don't do this I'm not setting an example here don't copy what I'm doing don't pile on don't be don't be an and open source I'm just pulling a joke on my friends now that discloses out of the way let's file a really important PR I saw that the HTM X Source didn't include a formatter thought it might be useful to add one what how how did I just get a server error trying to file a poll request it was mad about the markup formatting be putting different things in the brackets that's so funny that's so funny and now let's see the glory it's so much better why wouldn't they want this it's great hey at HDMX I saw that your GitHub repo didn't have formatting enabled I thought you were trying to be a serious project Library don't worry I just opened a PR fixing it they didn't have prettier at all right yeah they didn't beautiful I don't know what else to say I think shittier looks pretty great this would be a great prank to pull on friends if you ever want to like file a PR and see what they're willing to merge just like run this on a file and see what they do yeah this is fun thank you to the your team for making this I can't not give you a star for making something that made me this this happy thank you guys ## Pretty much every website uses the wrong font size… - 20240430 this is a topic I've wanted to cover for a while I have hot takes about default font sizes especially for blogs and they've gotten me in some heat in the past thankfully someone else in this case Adrien rosaly wrote a blog post about the ultimate ideal bestest base font size that everyone is keeping a secret especially chat this is fun har already saw a great chat from Aiden that the right size is 13 pixels just to piss everyone off and honestly since no one's going to be happy you might as well piss them all off regardless I want to see what they have to say Link in the description if you want to take a look at this post yourself updated April 3rdd 2024 originally posted March 13th it's none oo boy we're already starting spicy clarification let me clarify don't set a base font size body font size yeah no got a lter or code Checker or boss man hassling you that you need to set something okay use something like this font size 100% oh boy where are we going with this one because this approach has the advantage of always inheriting the user preferred font size the one that they choose in the browser or on their system even if they did not explicitly choose one because the default was maybe good enough all other font sizes headings navigation footer Etc should then use relative units here's where we're getting even Bolder but I think I like where this is going so far ideally without being smaller than the default font size with very specific exceptions because you're avoiding calculation witchcraft any smaller sizes could be easier for authors to spot like .9 RM and 90% are clearly smaller that's a very fair point with the readability too I'm still iffy so far because so few users change their default font size in fact I haven't but I might even change it by the end of this blog post we'll see as we go I'm curious about this calculation witchcraft what are they linking here what does font size 62.5% do what what why where did they find this oh that is so cursed so the reason for 62.5 is that the default font size in browsers is usually 16 pixels which is honestly my preferred size and the 62.5% converts the default to 10 which means that REM values are suddenly always 10 pixels so it makes the math much easier I hate that so much I hate that so much and Witchcraft is a great thing to call that Aiden in chat saying don't look at any of his sites don't worry I won't Jesus okay so alternatively font sizes based on viewport units bring risk not the least of which is preventing the user from scaling it large enough to read then you need yet more calculation sorcery to prevent it oh boy I have to read into these addressing accessibility concerns when using fluid type the clamp function is often paired with viewport units for fluid yada yada it's a common as this technique is several voices warned that it opens up situations where text can fail wcag success criteria which specifies that text should scale up to at least 200% when the user's browser reaches its 500% maximum zoom level that looks at least twice the size as someone who regularly Zooms in pages I appreciate the effort to make sure that is a thing I often even not just for like reading for content or reading on my own I'll regularly command plus something like to 200 to 300% just to get like a really well formatted screenshot for a thumbnail and things like that so I've command plus minused a lot in order to do this type of thing but the idea that certain hacks people are doing are preventing you from scaling your text size up enough is not only real it's something I experience a lot when I'm trying to do those thumbnails I hadn't really thought of it as an accessibility issue before and I'm really thankful I did and the other link was to another Adrien post responsive type and zoom so this one was posted in 2019 but they've been updating it since this is a very detailed blog post that I'm actually really interested in if you guys are curious about the full responsive type in Zoom post let me know in the comments and I'll consider doing the full video about that as well back here though so let's see what other recommendations they have forms while you're tearing out an unnecessary base font size DEC maybe add this to your CSS to honor the user preferences in forms as well o interesting and again they have two additional blog posts that I'm actually really excited about as soon as I saw that there was an under engineered text box I I had to read this part too this is the latest and not last in my informal series of posts on under engineered controls I I love this idea the idea of the minimal necessary pieces to style things which they call out here here generally I'm looking for the minimum amount of CSS necessary to style native HTML controls while also retaining or improving accessibility and honoring different user preferences this part in particular the user preferences seems to be a focus and I I really like that last month I tweeted a bit of CSS to make the default browser text boxes of html text area and inputs less awful looking which uh yeah they're pretty awful if I just hop in code pen and I have input type equals text oh we don't like self-closing tags now this sucks this is like the wrong size like way too small the like highlight behavior is bad the spacing and everything just it doesn't match the rest of the page especially if we have CSS and rules set for like the font and everything input just gets ignored but if we add this CSS now it's actually using the preferences for the site which already looks better especially if we had other text outside hi div testing like these contrast lesson if I delete this now these look entirely different now they look much more matching good call out I I hate the default sty for these things there's also a bunch of fun catches with inputs like uh one that I saw in the ler Rob Iceberg post was that if you have a base font size I think it's 12 it might be 14 for an input and you touch it on an iPhone it will zoom in in Safari if it's 14 or over then it will leave you at your current zoom level so there's a specific pixel size for your text in an input that changes how Safari behaves when you start typing in that input which is just wild to me so here's the basic Styles they recommend font the font property will inherit all the styles from the containers some CSS resets will double up and use font size but that's not necessary font will bring in the styles for each of font size font size font family font style font variant font weight font stretch and font height when it's set it also brings in line height this is useful all the things that you've set for your site get carried through when you do font inherit I didn't actually know that it's really good to know let's combine this actually with the recommendations in this other post specifically the HTML font size here input type equals text div hello div yeah now it's actually using the like right font size if I delete that will it get differently sized no probably because my browser size cool font size medium recommended I'm changing this because I want this changed I've wanted it changed for a while so now I bump that up to large and now it's bigger if I remove it it stays bigger but if I had set this to like 14 PX or something like many do then that won't actually get change when I change the browser setting which honestly I'm going to leave this on large cuz I I know it's going to break things and I want to see what it breaks but also because I prefer to have my font a bit bigger I know crazy I'm a boomer especially because I use a small screen but uh I actually quite like that and of course it made this blog posts font a little bit bigger as well letter spacing if a user or author adjusts the text to provide more space between letters the default field is not affected inherently the font style does not bring letter spacing Styles along with it so you need to inherit the letter spacing as well if you otherwise take take steps on your page to support the wcag success criteria with hex spacing including a handy testing bookmarklet if you're not familiar with a bookmarklet it's a little bit of JavaScript that you can run by clicking a little bookmark that will do something with JS in your console on the page you're on so it seems like someone here made a bookmarklet that will apply styles to a page that handle some of these rules like line height has to be at least 1.5 time the font size spacing following paragraphs to be at least two times font size letter spacing 0.12 this seems really helpful and this lets you make sure that your pages are actually following these rules really handy links these blog posts are phenomenal so far what's crazy is that this letter spacing thing is not included in any of the CSS resets that theyve found very interesting you would I would think this should just be in all of them and I'm amazed this isn't in every reset I'm learning some good [ __ ] already also word spacing is not inherited as part of font that's kind of insane that letter spacing and word spacing aren't inherited when you do font inherit even though like line height is font stretch is obviously all the things that start with font off but for line height to be honored here and then letter spacing to not be that feels weird to me I would argue letter spacing is more the fonts problem than line height is in a lot of ways cssb CSS word spacing is weird what about line height note that I do not set line height it Cascades from font in all the browsers that they've tested if you find a case where it does not likely due to explicitly setting line height or more specific Styles then I suggest adding line height inherent to satisfy the wag standards here's an example from codepen let's take a look so here we have assorted fields and then we have one where we actually space the text because somebody has increased text spacing for things like dyslexia or other issues that make it harder to read really handy to have that handled for you and all they did for the space text I'm assuming is put a label accordingly yeah field set Legend space text okay so field set nth child so this is the second one because we have these two field sets so the second one has a line height of 1.8 letter spacing that is different from the default word spacing that is different from the default and an increased font size and it all just works because we did that reset above let's see what they have to say about this nothing they're just showcasing it cool yeah it just works really handy that all your inputs just look correct when you make these small changes and if you apply styles on top they get honored don't stop here you can potentially make text Fields even more usable and accessible for your users with a few additional Styles tweaked from your own design you can read a high level overview of what to consider in their post basic custom control requirements why are all of these so tempting this blog is incredible I seriously I know I say this in all of my videos where I'm reading somebody's blog posts but everything I've seen on Adrienne's Blog has made me want to go film like three videos another one don't disable form controls this is something that I've wanted to talk about for a while because it's so common that people disable things on forms or buttons and stuff like that yeah it's okay to disable buttons and oh God no don't don't tell me this is like the the goto accessibility like don't do this thing oh boy yeah uh let me know in the comments if I should do this video as well because I'm not going to be sidetracked again right now this is too good here's a version the same Styles as above but with a couple more things added in a different selector interesting they they're filtering out checkboxes files and a few other input types and then applying these defaults good stuff the selector everyone's favorite part is CSS the most complex part of this entire block is probably the selector as I mentioned above there's more Fields than input type text that can accept text generally we want to capture them all with some exceptions for example we don't want to overlap or override styles that we've set and our under engineered custom radio buttons and checkbox again let me know if that should be a video too there's so much good stuff here we have no need to style an image input since the image itself will do all the work of styling file inputs and range inputs have default layouts across browsers that are more complex than just a box so adding a border to them might be a bit much WoW even not supported in Internet Explorer 9 I didn't know that there's so many little nuggets here I make no effort to style the data list because there is no reason to the default styles are fine trying to manipulate them is more compx than warranted and then you have all of the wag standard considerations for moving away from user agent default Styles Spitting Fire they have a bunch of additional Styles here that they recommend mostly resetting things adding borders handling readon States error States this is all phenomenal and I highly recommend you check this blog post out if you want to learn more even high contrast mode stuff which you guys don't know anything about me I love my high contrast modes I'm a little color blind and also really dumb so it's nice having these things this is phenomenal yeah even print Styles if you're printing the page making sure it looks good when you do that custom dark mode Styles everything you need to do this right you do a lot with Native html text Fields using just a little CSS when you do style your own Fields look to the minimum Styles you need to make them fit with your overall design and still support the cases I outlined above you don't need to do them all but I recommend that you at least consider and test your options phenomenal I totally agree and yeah if if this person knows that much about doing this right then maybe just maybe I need to make some changes print Styles when it comes to print Styles the text may be too large for your audience regardless of if or how you set it if so you can set the base font in the appropriate Point size and all your other relative font sizes will work from there so if you're using media print because you did command P to print the page this makes sure the font size is right good call out too recap that's it that's a secret don't set a base font size but sure your case is special your case is more important than respecting user Choice I'm not your dad I can't stop you legally oh boy one of the commenters of on the blog post pointed out that uh setting your font size on body doesn't affect REM but setting it on HTML does and posts two examples so that uh we're sure that we'll actually put this on the HTML instead of the body element which resulted in the author making that change really good call out one thing that's pretty important to call out is for those of us who are on Tailwind a lot of these things are already solved their default reset is really good they have the stylesheet here it does a lot it's a a pretty comprehensive reset that fixes things like weird margins on [ __ ] weird padding on things where it shouldn't be it's a really good reset overall it doesn't include everything we just touched on But it includes a lot of it where font size is always inherited small is font size 80 sub and sub our font size 75% it looks like every font size call here is just done with percentages so it looks like they're actually following all these rules except for 1M which once you've set the 100% makes sense so it's cool to see tail one's already on top of these things I'll be honest this article convinced me and I was going to show you guys me changing the docs that we have for upload thing which if you're not familiar is the best way to do file uploads and next I was going to go quickly change this to use a default font size of 100% And I realized when I looked at the element that the font size that it has is 17 pixels and when I saw where that's coming from it's coming from nextra body type setting article which I went and searched in their repo and quickly found found that they're setting custom pixel font sizes all over this code base 0.9m 34 pixels font size is 90 the string this is the one that I was bothered by which is font size 17 pixels so I could go through and refactor all of this but I am not going to do that so yeah uh hopefully nextra V3 will follow these much better more sane rules with doing this and I will certainly be using font size 100% whenever I'm the one making these decisions in the future as I showed earlier this is how Tailwind mostly does things internally and more and more I think font sizes should probably be percentages rather than pixel values so once again huge shout out to Adrien for blackpilling me on this I was unsure going in and I have come out 100% on board font sizes should be percentages not pixel numbers and I'm saying this is somebody who prefers 18 pixels as the bass reading font so yeah I lean big whichever way you lean seems like percentages are the way to go let me know if you disagree in the comments and definitely tell me if I should react to more of Adrian's posts cuz this was phen until next time peace nerds ## Prime Learns The Truth About Rust - 20231011 I made a video before about performance in our applications I defined a thing that I call the line of prime which is the point where somebody like primagen who's really good and making performant scalable Solutions might want to come in and make sure your application is ready for scale it doesn't matter how big your company is or how big the project you're working on is if flexibility is necessary or you're still trying to figure out what your users need the API is going to change the Design's going to change the things you're building are going to change and the more change that is happening in the code base you're working in the more you benefit from flexibility and the less you benefit from performance eventually you'll hit a point of stability where you're not adding as many new features you're not changing things once they're specked out and you have many more users and can benefit a lot more from a more performant solution and I will never say rust isn't good at that point rust is a phenomenal solution when the specs ironed out the plan is solidified and you just want to make something that runs really really well I know a lot of people say rust isn't all about the performance it's about the safety but that's kind of the benefit here too is once things are kind of solidified to the point where pouring cement over locking this thing in place rust makes a lot of sense for that because it makes it hard to make wrong changes but it also makes it harder to make quick changes too and crazy enough Prime's finally accepting this for a while he would push saying that he could move just as fast in Rust as he could in other languages and while that hasn't changed his tune around it has a bit I want to show you guys a Prime video I watched recently where he talks a bit about this and go over it with y'all you know I kind of compete on which one's faster is just JavaScript or rust which one's faster I don't I don't know I'm not good enough at o camel to really be able to run with that one yet but I feel like as of right now they're about the same thing like if I can't use CLI tools those two are about the same thing but once I go beyond something simple rust is great when I know what I want to do right when I already have the idea in my head and it's a very self-contained program like I can imagine writing out a CSV parser is a lot it it makes a lot of sense because the problem the the the domain is a very very understood well shall I say understood that's a very funny phrase but the domain is is in some sense well understood there there's a set of rules that must be applied and you just got to apply those rules in a linear fashion and boom you're good to go so to me that seems like such a w right that seems like such an easy win it's well trodden it's at least mostly understood so a place with rust in that I forget that you don't edit your own video so you don't listen to yourself often Prime but uh crazy enough a lot of us do like listening to you and I am one of them so yeah I absolutely loved this the joke I was saying before I think makes sense here is that you realized you're not always on the other side of the line of prime what I defined previously in my line of Prime video was this concept of a point where the amount of flexibility you need cuz you're adding new features you're changing the spec you're doing all these different things the amount that that is necessary over time goes down and the amount of use your service get ideally goes up at which point using technologies that don't necessarily make it easy to iterate and change your feature set change the way that you're solving the problem or the solution you're building in the first place but do help you scale that solution maintain it over time and write code that you can confidently look at 5 years from now and it will work the same way and it will tell you when you're screwing up rust is a phenomenal solution for that in particular this isn't just it goes faster or performs better this is also the code makes it harder to do the wrong thing and experiment and that is a positive thing once you hit a certain point in the confidence you have in the spec that you're building and I put Prime's line at a certain point where the amount of flexibility you need in your application design and specking goes down and the amount you need performance or maintainability at scale goes up what prime has realized is that a lot of what he does actually falls on the other side of this line like when he was describing the CSV parser that kind of fits on the left here because you don't know what you're parsing or what you need specifically around that and as such a lot of the technologies that Prime uses don't necessarily have a great experience when you're on this side when you're actively iterating and changing the code that you're writing constantly the harsher way of putting this is most of the code I write on this side is meant to be thrown away if the majority of the code I wrote in my life isn't deleted before I die I'll be disappointed that means I failed because ideally the code I write is going to make good Solutions and eventually people will have to replace those with better more maintainable code solving the same problems that's kind of like what happened with webpack where webpack was Rewritten go with es build some flexibility was necessary there and go was actually a good choice where it kind of fits in the middle here and with go they were able to make a better web pack much much faster but now that we know what that looks like there's effort going in for Turbo pack which is written in Rust and it's taking way longer for them to build there's a team of 10 super talented Engineers working full-time on it versus es build which was the CTO of figma got bored and worked on it on the side and built something a thousand times faster than webpack in days cuz he was bored that difference is meaningful and I think goang is a really strong language for for being the in between here o camels starting to come more and more over to our side here on the left the fast iteration too but generally speaking sometimes you just have to be able to break things and move fast and sometimes you need to stop breaking things and move slow and knowing where you are is one of the most important skills you can develop as a software engineer knowing what problems need a rusty solution where you can leave it for 5 years come back and it's still running incredibly well it's still easy to maintain and when you make a change you immediately know if it's wrong or if you just need to make something that goes fast and gets out fast use goang or if you're already working mostly in web app Technologies and you just need to add an endpoint to your app Quick there's no shame in using typescript and JavaScript for that type of thing but as a developer more importantly as an engineer understanding where you are and where the thing you're building is on this chart is really really important and while I baited y'all saying Prime's coming around to my take on this I don't think his opinions actually changed too much here I think his experience has him talking a little differently I think we always agreed about this the benefit of rust isn't just that it's really fast or that it's way better than typescript the benefit is how much more stable everything around it is meant to be and stability isn't always a benefit for everything you're building top of that I think we overestimate how much exists on this right side but generally speaking it's important to have Solutions there and I'm pumped to somebody like Prime talking about them because it's not what we're focused about here this channel is more in pursuit of product Market fit regardless of the size and scale that you're building at rust isn't for that I will say though I love that Prime has been so transparent about his realizations here a lot of developers aren't willing to do something that seems like taking an L here where he said that picking rust for projects at work might not have been the best choice and I don't know if it's in this video or not but I've heard him in other videos specifically say that he kind of regrets picking rust for certain projects because when the spec changed it got really hard to shift it around and while he had a Clear Vision for how to build it initially when changes had to be made that clear Vision kind of broke down and rust didn't make it easy enough make those types of changes and it's really cool to have somebody with real work experience using these Technologies explaining how this line Works in practice and in reality so huge shout out to Prime for both trying these things really pushing them in work but more importantly talking about what does and doesn't work with them I feel like there's so many Fanboys that aren't willing to do that so yeah fantastic work Prime thank you as always you haven't already watched my video about the performance line of prime and all of this putting that in the corner really proud of that one hope that you enjoyed this as well it's a super fun rant thank you guys as always peace nerds ## Prime and Theo Talk NextJS Conf - 20231026 here [ __ ] I haven't muted there cool my bad thank you for the heads up we're about to get started sorry this total last minute setup a little more Jank than usual but we're good cool PR will be here in a second they're getting started with the stream so let's move over to that cool I started building nextjs seven years ago because I wanted to build a blazing fat website but I didn't want to deal with all the frustrating tooling and setup and infrastructure around it and it's been incredible It Grow till today to the tune of 850,000 monthly active developers that's a big number I know that I'm not exactly a professional with numbers but as far as I know it's a big number we're thankful for to you all because this is these are the folks that are building the web and pushing all your incredible deployments not sure how much I can do about that sadly by the way that's the population of the city that we're in right now San Francisco or even even 24 full Miami fum to see the goat oh no did that freeze the capture are you kidding play there we go windows so the community continues to did Warren do this come on I can feel it it's be nike.com okay there we go I think there stream froze actually oh no what you guys are missing is like I mean he's laying down some facts right now it's it's super good I can hear it as like as we speak other stream is dead too okay great um nice wait yeah no so the ethernet's fine the problem is that their stream went down let's go okay you know this happens you know if you've never streamed live you haven't crashed live that's a fact it's tooy right there how many times has that happened to you I crash once a month once a month once a month that's not bad apparently versel stream is back maybe refesh let's go by the way hello chat are you guys ready o this microphone sounds good I know yeah hi all right you're stop Whispering where's that chest going to be a Clos it's be a Clos battle between next 14 and performance we're good this is fantastic all right let's get some more people in Let's Go performance everybody hit that performance button it's getting really close all right I'll do all of them at once concurrently with sus oh yeah look at that that performance is getting so good in concurrent mode all right let's just go with next S14 it seems like the clear winner so far so the foundation of nexj S14 is of course the app Rider and it has three main pillars number one we built this app router on the basis of flexibility for the developer we wanted to give you all these apis like layouts and thir going to be metadata API deep of course app Rider had to be powerful the most powerful thing is this data fetching system with caching and invalidation built in that's very nice by the way last but not least we all hate those two items specifically course F honestly the cash makes it hard for me to leave next behind any reason just I it so much when I use anything else FS so most importantly one of the key tenants of the app router volume pleas is that you can adopt it incrementally alongside I can't make it any louder sorry even one page at a time now when we look at the public data How Far We've gone since that initial data it's been incredible that in the top 1 million websites on the internet we see tremendous growth in app router adoption this is folks using and deploying rea server components to production that thanful for everybody that's feedbacked it and we lost it in front of amazing experiences Mo to the bottom corner probably a good idea yeah that's usually the least important build app router to the maximum level of quality possible so today I'm happy to announce nexj S14 and guess what that is one bigger than 13 see I can math no new apis let's go there we go that's actually huge so why is it a 14 are they not respecting sver only does it have no apis we have device that will help you forget about some apis that you didn't ever Lear cause of the Tain is 14 the cause of the Tain so over the past year we've completely overhauled our documentation of course a framework wouldn't be great with I just boosted the stream volume manually refence we updated the design of the next's documentation shout out to our design team and we improved search so of course you want to go to next.org dooc and find things quickly but did they use AI for sear feedback about education we heard feedback from the community the AI package install AI That's their pack more I don't want to know how much they paid for that to uh to help you learn they use vzer for their doc now I'm happy to announce that we've but I'm sure that learn the new fundamental yes it extends into areas like authentication dates everything you need to ship a production grade full stack nexs application n I'm really excited because ever since we launched the initial next.org learn I know that it's educated millions of developers that have gone on to create a amazing things some of the which we highlighted earlier so I'm just really excited to see what you all are going to build after you go through next.org SL learn and in the context of that education the things that I hear about what you love about nexj is that ultimately it's opinionated it gave you this zero configuration Foundation I think I like but nextjs sits on top of react opin powerful engine behind the scenes and one of my favorite features of react itself is its ability to compose into reusable components whether it's the UI or whether it's the inter defa in the form of hooks oh my goodness Comm JS until recently they do a lot OFA in the next mod ability to put things into components one limited biggest pain points the Cent it's better than weird named exports you just have some random thing named page and whatever exported it does magic stuff had an answer that's what I want I want page as a function or component over the years functions just components that's the confusing part is it a function that produces components or is it a compon side props why not both but we knew that deserves an award for worst API of all time of make everything take 3 seconds longer as a function re Ser components and of course that's why we have something called suspense fror react our duty was to expose this API to you and help you explore them and experiment with them so to do so we needed to do three things number one we built a new router that tries to set up itself on top of this react foundations number two we created a new data fetching system that is tightly integrated into that router it handles things like not just data fetching but also caching and invalidation and last but not least an architecture that is built on streaming so that you can fetch data and make it available to users without blocking experiences that Vision materialized into the app router that we have today for example with lar adopted with a yeah everything we've been build up comp is it true that it's very difficult because you hear a lot of people on TT I don't TR T TT just what I don't any data coming from anywhere them for a sec we'll catch up so uh it's very different is the thing so in the old model there was a few parts that did a lot of different things and you'd often run into edge cases where the part you're using doesn't do the thing you need to do very well like if like use effect get used for a thousand different things most of which suck with the new model there's more parts that you have to deal with but you only pick the ones that you need for the specific problem you're solving and they're all much simpler so it's a wider set of things but each one's depth is much shorter and my personal favorite thing is that when you use something incorrectly you realize that much quicker you get the feedback almost immediately when something doesn't work versus 6 months down the line users are crashing and memory leaking or you have a use effect firing a million times when it was close to fire once those types of problems are very much gone with the new model but there are different things you have to learn to adopt the new model okay I think I understand and this data F like Shar on npm so uh a momy JavaScript and a daddy HTML had a baby re components and even invalidated when it's cached it's as easy as calling that function it's just a JavaScript function in this case called action of course this also works with forms so just like Rea server components these actions can be shared and exported to the community through npm with nexj S14 server actions are now stable bold scary excited because this was me you can fet data and of course you can think the camera High to catch something into CH so selfishly the best part is that you just write a lot less code so we have on the right hand side here the biggest thing is that you're not this really D if you the compar here mess with all this for dat fing any props the component has can be access through the action Ser code in the function create code and the form that end we're seeing incredible results from our community so this luxury brand Jennifer Fisher went from a monolithic e-commerce experience and went headless with app router on verell and xjs and the results that we've gotten are pretty freaking incredible so not only does it load fast which I love but every measure of the performance profile of their page has improved and this is translated into World results for customers it means that customers are happier and of course Jennifer Fisher wherever Google analytics beautiful earrings so all of this would not have been possible without the amazing individuals in the rore team that have been incredible Partners to make all of this technology possible and all of this glorious results possible so huge shout out to the react core team that have been working on this foundational technology for so many years that team does sh the companies that basically work with us along the way in in betting on re so many of you are here today I want to give a shout out got snubbed hard here Shopify payload sanity off so many other companies that are collaborating on bringing their data into re Ser component they do I hope you're joking this companies they're not just not explain it for friend becoming part of this emergent data ecosystem the news SDK can now be encapsulated as comparable and they will hide away a lot that we never want to deal with as developers when integrating so I'm really excited of this eming data ecosystem around Rea components and it'll open up incredible opportunities to many many companies in the ecosystem third the team the chroma team have been crucial Partners to every framework in the ecosystem providing Guidance just a quick WTF for second show the CH the words came up and it was the Chrome team has been awesome L I have some from that I'm going to be do for your contribs not just to this release but over the years in the course of next say it with me Madison our individuals in our community I'm incredibly indebted to you all so of course this no near cats here so many folks but I really want to give to all the Educators our community members who answer questions take time out of their day helpful friends who give us I recognize a delicious B let's give it up for our community it's been uh it's been of course my hands are in my pocket it's cold some of us not least I want to give a shout out to The Visionaries the Risk Takers the ones who dared to go deeper hmx let's go oh close I got close very close had it right all along server simpler programming model the OG serverless you deserve your accolades Lee sent me this early I didn't know what it was for that is hilarious but Jokes Aside ecosystem have also been giving us incredible how to leverage more of the stack maybe go back to some of the fals of the we have a video of him asking he's in his Lambo revving the engine got to use it I don't even know I think they need a PHP rap for said Lambo yeah I got to do something with it now let's talk about performance which was that it was almost beating nextjs for re don't get Lambos we get Yachts so our goal with nextjs as far as performance goes is we always wanted to all of the complexity to get to great developer experience the core idea of next is that just run one command you don't have to worry about assembling and configuring all of the tools we're talking about Russ this is your time FR and since we last spoke we made incredible strides in improving the compiler infrastructure in a way where you really didn't have to do anything else other than upgrade the framework to the latest version so we shipped a 22% faster initial compile that is putting up the dev server and getting to that first page a 2% faster you guys wondering what that sound was that was trash awkwardly scooting a stool next to us pressing save and seeing them on the screen Josh what are you doing and it turns out gent we went back to board and we asked our be a little high for him if he next do some push-ups later the results will shock you his performance still that is a great graph that's my favorite gra right there oh we're super aligned and the key question here was how we know that we you want performance how can we deliver there's actually a very very tiny sliver in there for new features where I click the wrong button accidentally in the survey and you know that nextjs talked about rewriting our entire nexj CLI and bundler technology in Rust we have to be careful of this we don't want the get the MC yeah I know it's been an awesome stream is not endorsed by the r found those performance improvements so my question was should we rewrite language should we rewrite Zig should we what do we do to new programming language should we rewrite in Zig should we what do we do to get you this improvements fast to you and I'm here to announce that we're still betting on Rust and we will deliver incrementally and fast so I'm going to tell you how we're going to do that they are doing okay so we're sticking with rust but we're refocusing our effort primarily on the next sh comper can't hear anything want to see the next compil succeed with this new infrastructure and give you the improvements to Performance as incrementally as possible and we want to see that in small large applications we want to see that in the pages router and we want to see it in the app router wow and the three things that we're going to be monitoring very very closely to decide whether our investments are paying off are number one a fast Dev server number two fast code updates from save to screen and number three fast production builds so this is running next build especially when that's actually an interesting change I wasn't sure if they were going to get next build on top turb how we give you all of this what's our how do we track our progress how do we measure that we're on track this I regret to announce the bathroom wall is not my GitHub contribution chart oh it's actually suffered quite a bit in the last couple years relatable this is how we're tracking the reliability of a rust based compil ER so this represents running the entire test suit turbo we've accumulated over seven years with every bug fix every reproduction every race condition you can keep track of it R we turbo.com and all this beautiful blue square 91.1% of next Dev tests are passing % of tests passing with rust 91 so it's been incredible to make this huge stride in reliability so let's talk about some of the performance improvements that this is going to unlock number one we're seeing 53% faster initial compile with the most recent introduction of Turbo pack and up to 94% faster Cod updates again these apply to both routers the pages router and the app router to recap we're refocusing a r powered compiler f efor we're delivering to the tune of over 5,000 passing tests already in the most recent release everything is faster all around and the mo the thing I'm most excited about is this is the new Baseline of performance to give you a sense of this when you run next Dev Das Das turbo we're running everything cold no persistent file system caching yet and it already really really really beats the previous compiler infrastructure just way faster so this is the new Bas the previous one JavaScript keep track of our progress on turbo yet I'm glad somebody said hey you got some JavaScript so now compile that simplifying bootstrapping call that Madison all want toer compile called strap Dynamic websites Simplicity typescript to the programming model so before I go into how we can deliver on this Simplicity and as promised with no new apis I'll talk about how I measure a fast website scared what what is what are they making simpler I'm scared they're going to deprecate something I use so this is opening my phone go to a page and I want to see you already know this is pre-wed for you I don't actually know I have been leaked details I was leaked to blog post but I haven't read it yet so I have idea just for me you know he knows I also care about no I know about go and HT when for example the state of my car I think I know what they're going to do or going be items on an e-commerce why I feel so short why I like taller than you and most importantly in terms of we actually got your chair a little shorter specifically it go down a little so through this lens through this CR our chairs areed our chairs are bloed with our JavaScript bundles and the rendering strategies that we shipped it's the firest direction I've had all started back in the day young r g with traditional server side run you're taller so this is the common SSR that you remember from backend Centric Technologies what happens here is I have a visitor potentially far away from a server that visitor is waiting until that server starts wearing that move your mic closer and what we're seeing is it took a while to get to the forward and the dynamic visual from that point on happened fairly fast diaphrag it squeeze let's see how we would rate diaphrag fast initial visual I would rate it sadness much better why because well we saw those four white screens I know what this is going to be the white scre they're talking about the white screens yes finally F Dynamic visual I went to our design team we settled on slightly smiling emo face and the the EXO is actually great I hear a lot of your feedback that the beginning of next CH was really simple it was just get server side props throw throw some no. JS code in there you're done the X was the inspo for what we're going to see today oh yeah the next step is the community gave us feedback that some of their Pages some of their workloads were fully static so we added static side generation capabilities and nextjs became a hybrid framework it could do both on an entry point basis so let's look at a static page here that' be pretty complicated but actually turns out later on I have to personalize so what Happ CH I wanted I give you the initial visual nearly immediately I'll let talk then I'll interrupt and then to actually get to the final state of personalized data that's where it gets tricky right I have to download lots of JS I have to fetch the data I have to render there could be waterfalls so as you could imagine visual is lovely we rated fast Dynamic visual deadly and the DX was okay but keep in mind that in this model you were juggling two ways of fetching data for example get static props and all the hooks on the react side to fetch data on the client that's painful so not fully satisfying let's now look at the bleeding edge what do we have today we have streaming absolutely incredible technology we have things like the edge runtime we have the ability to put the compute right next to the visitor so the initial visual gets better Dynamic also gets better but it really depends on how you configure it all it really depends on whether the data is close to the compute or not um it depends a lot on what ecosystem of Packaging you're using it's kind of like there fully satisfying on every this is what I do right now the initial visual could have been as fast as a the point where I interrupt so there's two methods right now if you're using next to do server side stuff with the new model model one is you use Lambda you block first bite on when the Lambda starts to respond you send a response whenever the Lambda comes up and knows what to send for the first response and then it can stream in additional stuff the other option is you can use Edge instead so it gets that first response a little bit faster but that edge compute might be farther away from your database so it actually takes longer to generate the rest or it you're running apis and things like Prisma that don't work on edge so neither of those are ideal and what a lot of people do is they statically generate the core like pages so they can throw them in the CDN and then they run the JavaScript to fetch the additional data to then fill the rest of the page with a ton of water falling so your options are kind of faster first load or like slower first load much better devx and better user experience overall but I hate that I have to eat L to cold start for every page load that's just awful and I think they're going to fix that for example okay the dynamic visual could therefore have happened faster especially when you're juggling your computer being far away from your data in waterfalls in the DX well don't get me started on the DX because now I have to figure out run times figure out regions figure out what packages work what packages don't work so if I do all of this the situation was good but again we're in the quest to simplify deal with Cann end up in a fast initial visual fast Dynamic Visual and grx and I'm happy to announce today that we're introducing a technology I've been asking for this for two years called I have so much documentation of me explaining to like gets activated at build time and it works into the nexj compiler nice so what happens is this when you build your nextjs project we will extract a static shell for each entry point of your application including all of your Dynamic pages in this phase nextjs can extract all the static parts and pre-render them so for example here I'm pre-rendering the logo of of the page the navigation and very interestingly I'm also able to prender the fallbacks of the dynamic Slots of the page so notice here I have this Banner that I'm reserving for a promotion that is tailored to each visitor and of course I have my card and my profile picture so those are the personalized Parts what next can do is it can give you this shell immediately and then stream in the dynamic Parts if we look at it from the lens of the experiment that we earlier we can see now I can get my initial visual as fast as static and then the server starts streaming and there are no waterfalls most importantly this is really easy and I didn't have to learn or adopt any new apis it's a win win win we all win I love winning so having accomplish this again this technology is in preview you're going to be sh we call speed of static not having to wor so let's recap what we War he's taking a shot every time HX comper goal amazing new Baseline of performance also ding down on corre and Rel with over 5000 test which amount over 0% of our test call Mrs buffering number two we have this incredible new learn course that not only teaches the fundamentals of nextjs and the app router but it extends into databases and off and everything you need to build a production ready app server actions are now stable which means that you can mutate data with a native react data model so this was the the missing piece of the entire architecture so we're really happy to make can you still accidentally leak stuff by actions uh they things into the form they're encrypted by defa without I assum like is like a mangling like how's the encryption I we can we can go that ler also T helps a lot with those or head to nextjs T helping with encryption that's everything I've ever wanted to say improvements I am really hyped I partial pre-rendering is a bit Niche but it's specifically my Niche yeah and people I just saw the question in chat what is the use of the CDN if the pre-rendering takes place the pre-rendered asset gets put in the CDN so previously I'd make a request to the server if it's a Lambda has to spin up it has to generate the First Response send that to me and then stream in the rest effectively what this is doing is it's taking that first response the server sends and throwing that on the CDN so the CDN gives you the first bites immediately and then things kick in the background then it streams in the rest because they're doing that themselves on their own Edge and then every time you make a change it just Auto invalidates the cash of the CDN and long as you don't be stupid and sneaking user data you got yourself a really nice little I like that that's that's a great idea and the way it works is from any suspense down that will now be streamed and dynamic anything above the suspense is by default now static which is huge that's a W Madison there's more from next future just like your feack how caching really powerful and really fible but want and we hear you the power of Turbo pack and a rust based compiler will not just be for development mode and it's also coming to production builds I'm really excited about how much faster production builds we get how much work we can reuse that has gone into the efforts in the compiler so far and most importantly production Bild big part doesn't do roll up for its production build Sol reting I saw that roll down yep let's get into the rest of from from techology Partners visit their boots here you're going to hear all customers so thank you so much and enjoy the conference let's go that's actually some pretty good stuff I really like that partial pre-render stuff yeah it's very exciting I I have literally been asking for two years for that specifically to happen and we got it woo when's the next thing that was a ringing endorsement Theo yes wooo I I yeah that was so much enthus I may have been I may have been reading the GitHub commits to next lately to see when that was going to happen and uh yeah I have been very excited to see they finally did that want to come in are we letting trash in I'm just kid let's ask chat trash come one's for trash to join us oh my gosh he's actually no no I saw his hand you get that hand out of here we're not ready yet there's a couple ones we got a zero from buff fine seeing enough ones I guess that will'll let trash in for a bit oh drink drink drink oh my God damn it nice catch turtleneck Mark you're lucky I didn't finish off your normal name with that one okay it rolled right out is my mic on yeah it is hey baby hello I don't I don't know how to use technology hello like microphones we're like a cell service here o we're a little thick in the middle I'd say I can't even read the chat it's so tiny I did my best you can't read that sorry I didn't see you there to oh I'm sorry well yeah how are we feeling about the announcements y'all uh I couldn't hear it oh sorry I heard p no I'm just kidding I saw it it was good it was good I so I missed it so there's next 14 MH with no new apis is it just what are they focusing on just more uh stability turbo pack and the pre-render stuff okay okay yeah the pre-render stuff is huge do you know anything paral pre rendering stuff is going to be sick yeah I I I think you were in one of the Twitter spaces where I was trying to explain to Dan abov why this was important hey that was like over a year ago oh yeah that wasn't that was a long time ago it's like like trying to like I explained cold STS and Lambda to poor Dan because he just doesn't know enough about the infra side and I try to explain like the new bottle's great except my page feels slower because you're stuck on that white loading page for longer even if everything else is measurably faster that felt bad enough that it wasn't always worth it and with the new model I don't worry about that at all like I'm actually going to stop shipping on edge now because I don't need to CU I still get the main benefit of a fast time to first load that I was missing wait are you all Edge on upload thing yep except for the things that hit S3 because getting the AWS SDK to work outside of node is impossible gotta Ed by the way Edge Master Edge by the way public edging really yes we're doing our best public and private edging does this have sound yeah that has sound that way you can monitor your voice I mean yeah it doesn't sound so cool that's what it's like to be a content creator yeah you wouldn't know have I know I definitely don't know wait you don't monitor yourself oh what like chat can you hear me self monitoring was like the best thing I ever did for my content it's how I learned how to talk like I was so bad at public speaking and recording and stuff until I started listening to myself and I only did that cuz I was editing myself and I sucked when I was editing I was like I can't chop this into a usable video I sounded like [ __ ] this whole time I was way too far away from the mic so I started self moning until I got good enough and now I don't sounds like me about every time yeah I was about to say that's this is a trash experience here guys we're in perfect order from tallest to shortest I cannot believe you miss that entire conversation about I made the joke that we're like Okay Madison you do have giant heels on so you might be taller than me when we I look extremely short on the top side okay I'm tall on the bottom side okay it's okay it's okay to be short you guys how does the startup feel about it CEO not being within the like 6'1 plus of CEOs here's the deal okay you know i' I've told this to a lot of people when I was a young kid and all my family is like 64 and tall I felt in my body a 6'5 Spirit okay did you identify a 6' I identify a 6'5 but unfortunately I didn't make it there but I still feel it deep down you know I'm 6'3 so I'm taller than you really yeah yeah trash you're 63 gosh I'm Goliath then yeah trash really short chair the trash is in the tiniest of chair you heard him I'm actually standing on a stool right now I love how much people actually really want to know how tall Theo is compared to Prime like I see this all the time on Twitter yeah he's like a good in taller than me right I know you guys but I'm never how tall are you I we don't share this info publicly don't we're talking about this okay fair I'm 6'4 damn 6'4 yes I am actually tall it's a good height I know imagine if he was actually good at basketball you're pretty tall too though I'm like six foot in some change are you I think you're 6'1 okay now you're just complimenting me I appreciate that Madison making me feel good about myself bash is taller than me I can confirm bash is like 612 yeah it's insane yeah you met you did me bash I met you too wait is she as tall as me cuz I'm super tall no she's not actually as tall you're beautiful man you're the top don't worry you've earned your credit thank you yeah it feels we doing this experience that we're doing right here and then looking up and there's like a 100 people just an actual conference going on around us as we do this a literal confence not talking to anyone I I'd say it's it's having the Velvet Rope in front of us that makes it even better please don't come near this yeah they swapped it from the red to the black momentarily or like a few moments ago and was like oh I felt like the red made us Cooler why would they take away the red I don't know I oh actually I know why cuz it's versel everything's black and white I was so surprised with the blue banner up there I was like why are they doing that that's like a huge brand shift for them why are they doing a blue banner I don't know something's changing I'm scared because everything else is the lambo is blue too did you notice that yeah but but that's PHP oh oh but are theying PHP is that how they announced PHP on versel the blue means something I don't know the blue means something we got ourselves a theory I like this dhh has been personally working with them yes that's what I heard he drove up in the lamb yeah it says Lambo yeah D and B they're about two letters apart in the alphabet that's pretty close that's close we're pretty much there yeah right there take a b and you remove the bottom part of it you get a p which stands for PHP like that's pretty much capital b capital B just like PHP it's capital P it's a lowercase p i mean really where you draw the baselines whether it's capital or lowercase b if you think about it I was picturing a lowercase B I was like that doesn't work crime at all God damn going upside down let me quickly check oh wow we're doing great on viewers I'm not look at like prime numbers right now damn 1.2k oh nice I announced in the Discord I got the D gen Legion in here yeah DJ Legion one's for the D gen Legion let's see you in chat yeah do you all even know what forel is if you are a part of the Deen Legion press one that's a lot of ones let's go let's go I see the T here too the te is not a is he going to react to us reacting to this for the channel sorry I didn't get back to you he should yeah we should probably talk about next at least once yeah what's next next is pretty cool yeah DEC trash I know you're actually using App router for is a shilling nextjs so hard good stuff 1127 PT by the way want to give us a spoiler for that yeah tell us more I just say what I like about it and I'm not going to spoil it did you say what you don't like about it there wasn't enough time we only got 10 minutes yeah give us I had like sketched out like a 15 20 minute talk and then learned it was 10 minutes and like had to chop a bunch of stuff but the result of over more concise thing yeah I went over and I was like I wanted to say like the bad parts but I was saying so many good things wink wink you know yeah maybe that's actually why they made it so short so there wouldn't be enough room for the negative what was the wink that's that's the real conspiracy wink wink figed out maybe next maybe next year I do my talk on what I didn't like yeah do you know what my talk is I think he just named his talk wasn't like how to do things the wrong way it's cursed patterns versell won't tell you about there you go I'm pretty sure I'm doing all those yeah I I promise you for bad PN I promise you you're not doing any of these there's some deep cursed [ __ ] that like isn't publicly known that I found for this talk I'm very proud of it those things you should patterns you should avoid doing asbert uh I won't I won't endorse or unor these opportunities I'm not saying you shouldn't use them I'm definitely not saying you should though yeah and and they're cursed they're incredibly cursed did you know you can use a function generator as a server component and yield results down the stream that's interesting it's really bad it is really fun is that bad how did you find this out uh isn't that somebody who works on XJ has told me about isn't that just like a four don't they just for A8 the function it it's so you're awaiting in the body of the like component when you render it but you're yielding up different results over time yeah yeah whatever on theide just assuming it's an async iterator then right yeah but I don't want to know how it works under the hood in terms of the actual cuz cuz that the async iterator that part makes sense on the server but now we're streaming the results to the client and the client is dynamically updating the HTML on a given component sounds complicated one example would be like you have a sign up component and it renders once you hit sign up it says okay we're authenticating with the server we're creating your account we're linking and you could send the server up the server could send updates to the component as it does each step very cursed you shouldn't use it but it's cool that it works I like it you know generator like the thing that powers your house when uh your power goes out I actually have a generator that's why that's why I'm looking at you I know you have a generator because I don't live in the city I live on a ran it's true how's the well by the way the well is fixed they had the drill 700 ft to achieve water but I'm not going to lie to you guys I have a strong flow 100 100 gallons a minute okay I don't know if you've experienced such flows in your life they actually measure that yeah that' be find the world's shittiest well ever would be like we dug a well there's water I don't know it could be fast flow I don't know we didn't we didn't even check my childhood well was like 12T down yeah that's because you live in a normal I live on like on a hill Wells are a little bit scary when you're a kid right yeah they're very scary they're very and they're very expensive when you're prime your kids might be kind of Scar what the hell are you talking when you were a little kid Wells were very creepy you could follow she talking like an actual are you talking about that's exactly what she thinks no this is like a tube in the ground that go if there was a hole in the ground that went 700 ft down I would F time your kids are going to fall in your kids fall they're going to fall for like 15 minutes before they hit the ground I saw your post yeah yeah yeah it's just it's literally just a metal rod but actual well is really creepy I feel like if I saw a well there'd be part of me that i' want to go into the well yeah to see if there is a little I live on a ranch away from the city I could see you having one of the old weird Wells yeah it's it's not it's it's a weird it's it's a good time it's a weird Flex to say I have my own well but I do okay I'm not crazy that timer is moving way too fast right you're on 2x I'm not on 2x I am on live right now life is on 2x what's next it does look like it's moving alarmingly fast yeah I think we're just getting old and time's now moving faster no that's not how it works when you get older the days are long but the years are short well right now seconds are short the days are short or the days are long and the years are long thank you prime for this philosophy moment I am old so we know we should talk about the philosophy history stuff we talking about no no no we're not talking about nothing something Prime doesn't want to talk about no it's it's just that I was giving people little history lessons over uh twitch it's not a big deal okay as you get older you find yourself reading history and then explain okay we're not talking about the Roman Empire all right that's just what's happening ever got head kicked to the face God damn it have you can you please tell me we need an answer right now head kick to the face I'm too tall tall as the is whose leg could reach that far I I could kick him in the head I I will let you try no no no because I would hit you in the head I would literally head kick your face and then you'd have to come back on camera you can put your leg that far up well like that's flexibility right there I I I willing to take the hit to see him try you do a kick jump you can do J I realized that head kick impi jump K jump that's backwards I don't know I'm I'm going to kick jump you in the face that's it I'm honestly okay hear me out I've been watching Prime's stream for so long that I say everything weird I pronounce everything Jason you know how do people at work feel when you say they just look at me like they're proud I assume they're like hell yeah you know what we could talk about is the discourse that's been happening recently but I don't want to say the word oh no which discourse I'm a lady yeah I don't know what it's about I haven't looked into the t word my favorite I haven't looked into it yet I can break down the taint experience I saw your video but I've been busy getting ready for this so give it to me like the space between the server and the client so the the best I can teal Dr it is is when server compon or the servers have data some of that data is sensitive sometimes you want to fetch that data and not give it to the client you want to be sure like when you fetch the user from database that the their off token or their phone number doesn't make it to the client unless you explicitly choose for it to so you can mark that object as tainted so now when you try to send it to the client you'll get an error that prevents it from going there so in order to actually get that data to the client you have to manually unfurl the keys that you want to so instead of passing user to a client component and accidentally sending a bunch of data you don't want to you would pass user. username and user. email or whatever but you have to specify what to pass instead of accidentally sending data you want to to the client okay but you were like involved with the taint somehow right yes I started the taint discourse were you adjacent I was or were you in the taint I was deep in the taint okay okay I go hard in the [ __ ] taint I get it there's so many jokes I want to make I can't jsh come on you can tan you make the most bizarre jokes on your stream and now you're holding back yeah you do this isn't this is a this is a forell stream isn't it yeah Not only was I deep in the taint I was deep in the taint on an airplane I was on the plane getting ready to fly home from Vegas the Tain and I saw a security and next article came out and I was reading through it and I scroll pretty far and I just see the word experimental taint in the blog post and I realized I have to make a meme before this plane takes off so I go off a mode right before we're flying out screenshot post the Tweet airplane mode again have no idea what the response is until 2 hours later when I land it is blown up that's pretty great it was wonderful that's what happened and then I saw it everywhere yep everyone was tweeting about it I I started the taint discourse was wait hold on hold on are you telling me that your Twitter timeline got tainted yes it did but I didn't want to look into it I just like you could tell me here you know yeah yeah okay I see so many people I want to pull in to chat for for a bit which means I think we have to say goodbye to trash and replace him with someone else yeah get the hell out how about Tanner Tanner Tanner want to come on in chat Tanner no come on do it take a spot he's not real bye everybody I love you yeah we Scot a tiny bit bye trash see look look at this I'm massively than you until we sit back down now I'm shorter than you oh I'm I'm caught runting so hard to be taller than me what's up hello I love that you have a shirt with your name on it part of it I have one of the original tan stack shirts and I feel so bad not wearing it cuz I never wear t-shirts I promise you I wear it around the house all the time though so for those who don't know this is Tanner Lindley creator of tan stack we know him mostly for react query but also for every other helpful library in the react ecosystem react table react location now known as tan stack router and some really cool stuff with forms coming love to hear what youve did you watch the keyot what were your thoughts I was there I watched it it's about what I expected improve on performance and improving on existing apis so good stuff uh yeah I think it's great I mean it's always nice to see no like breaking changes yes last year was I was like all the things broke so so as a library author this conference does not scare you more thus far at least yeah I mean like that's exactly what I want to hear it's just like let me keep building cool things on things that will never change awesome how are you feeling about server actions especially over in the form world uh I mean we're excited about it we uh I was just working with Corbin uh last night uh on like this cool little Factory that's going to let you use tanack form to do all of your client side validation and then with just a few like changes in code you just move all that onto the server with server actions uh and you get validation on the client and on the server uh you can split between the two and like do optimistic stuff on the Ser on the client and then do like they mention critical stuff on the server uh and it's just really transparent I I like it so that's really cool to hear I feel like a lot of people have tried to solve forums but all of the attempts have focused on a very specific like sliver of the problem and nobody's really cohesively solved it all the parts are starting to really be there now though and what's exciting for me with hand stack for is it feels like the first time where like the considerations of what react needs of the validation layer and that that needs to be on server and client and then the actual method that we post to the server like you're figuring out all three at once which is cool yeah and we're trying to keep it uh like nice and isolated um I use remix I'm trying to make sure that we could do the same thing for them uh and I also have a large application that doesn't use either uh trying to Port that as far back into my server as possible you know the goang guys on my team like you know they're like hey you stop right there yeah so being able to do as much as I can on the client is also a good thing as well so there's so you can't run goang yeah yeah what was that you can't run Zod and goang wouldn't that be great wouldn't it be great you don't do Zod and goang cuz it already has a type system yeah for us so we use buff build we grpc Checkmate atheist use a language with the type system no no we're using we're using protocol buffers uh with with buff build um it's actually type save across the wire which is great uh but like the validation stuff uh could always be better yeah um and buff build has some really cool things around validation that uh like they could support Zod as an official uh validating schema on their client generation so uh they've already generated clients that use react query so you can actually generate a react query client based on your on your protocol buffers it's pretty sweet we just want are annoying but especially like the Proto spec too where it's like trying to be a only we're back sorry help break things but I love it yeah yeah you're like one of the only people in the JavaScript world that likes Proto Buffs don't around Theo we back on YouTube as well he gets like hot and bothered are we also back on YouTube guys yeah camera isn't quite right let me continue OBS 29 did you know on OBS 29 you cannot do Stringer Stinger transitions I have to stream with two obs's at this current moment I have an OBS 28 for all my scenes that streams into obs 29 and then I used OBS 29 to stream out to two instances of OBS and two different versions yeah two different versions and nothing goes out of sync though no internet went down it seems to be back again for the streamer illiterate what is a stinger transition that's where you know like like imagine if if we would have pre-planned this and there'd be like and there's like a triangle that just jumps onto the screen and then comes off and we're in a new new thing now what it do is the triangle would come on and it' come off and then it sit there black for like 3 seconds and then it would transition fun OBS 29 on the topic of transitions the next talk is starting and I would like to transition to watching that if we're cool with that yep yeah I gave Sam a lot of [ __ ] in my last video so I need to watch this talk and see if we still disagree so I'll knock that playback speed up so we can catch up unmute so we can actually hear it all right uh my name is Sam sakov and I'm excited to be talking to you about well next in react today and um some of the things that gam talked about in keyot are actually a nice little te up for my talk because what I'm going to be talking about is how a lot of these improvements in are really delivering on react vision for the future oh no I didn't this is uh when I first heard about react server components T I was really excited because I was excited that we were finally getting a first class way to do data fetching in react this is a great video and um Sebastion and Andrew kind of traced the history and the evolution of server components and suspense and how server components are basically data data fetching for suspense and we were all kind of waiting for a first class way to do data fetching in react apps so that we could all stop kind of using our own Solutions we could have things that work together and um server components is basically what we got but uh when I first heard about this I was a little skeptical because uh there's a lot I like about fetching data in the client um my use Sr hook does this mean I can't use this anymore you know when you get an Spa set up with a hook like use Sr or use Query on the client uh there's a lot of really nice things that fall out from this you get to drop this in your component it can render a loading State and fetch data it can revalidate it can populate a client side cash so that subsequent navigations are really fast and um so I was a little bit skeptical but I knew that API come to react with a lot of thought and and so I kind of withheld judgment until I saw something that really stuck with me and that was this this is a server component it fetches data it's squeal right inside of the component boundary you're making a meme on your phone it has a direct handle to the database to fetch data but then it renders a component inside of a modal he is and this modal does all sorts of cool stuff in the client uh it comes up from the bottom not making a mem and uh it renders our new story inside of it and it attaches click listeners to uh keyboard events like a skatee that we can press to to close it so I didn't know what it was at the time but this somehow struck me as more react than any code I had written before that accomplished everything that this component did Ru and so it's kind of what started getting me excited for this new I should preface this with the thing that Sam and I disagree on he thinks that the like core value the thing that we should be talking about whenever we talk about server components is the new data fetching patterns that's the the one thing he thinks matters and everything else is implementation details and he's upset that I mentioned the HTML side as much as I do I think the HTML side's a much greater Drive yeah it makes me more excited about what's happening why is it a greater drive like what do you mean because that's what I think server should be doing I'm an HDMX dork okay yeah it's I'm on team HTML the one of the big problems with the existing serers side rendering models is that you can render the HTML the server like that the client will have on the server but in order for the client to catch up it then has to have all the same JavaScript that it has to rerun in order to synchronize the client in the server so if you have a like if you have a component that's a gigantic like 10,000 line of code file that component needs to be like that JavaScript needs to be on the client as well with server components you can run that component on the server and then send the result of it to the client rather than having to send the JavaScript as well you also reduce a huge amount of clients like because what all traditional server side rendering you have you have your entire application plus special server nodes and then you have to somehow wiggle that into the client version of this same thing and then you have all those two states sitting there and you have to keep everything in sync and so you just come up with just horrendous amounts of code just to keep these two things in sync where that's why I at least like the idea is that it reduces that to like such a smaller points and that's much that makes me much happier yes in my emotional spots the taint we talked about that ear so let's hear I knew it would come up again you knew it would let's hear why Sam disagrees with us feel more like react than stuff that we've had in the past well let's talk about react what do we like about react well a lot of people say it feels like playing with Legos uh it's fun and it's easy to use and it feels like Legos well let's talk about Legos L of people like Legos let's go Legos come in all different sorts of shapes and sizes and colors but they can all be broken down to a single interface right it's a brick that has tubes and studs and you can snap them into each other they're called studs and that's it that is all you need to know build basically anything you want you can start snapping Lego Legos together and you can get smaller pieces into bigger pieces you can snap those big pieces into each other and uh you can keep going until you have what you want and I think this story uh is really what people like most about react what we love about building with react because it feels very similar we can start with a news story and we can decide to put it in a modal that has all sorts of cool Behavior we can add a few more new stories and we can wrap those in a Carousel and so what we're really talking about here is a story of composition composability is really what makes building UI like this so easy and fun but this only applies to kind of the UI side of the app equation right uh these models and car cells are really nice and tidy and composable but this news story it needs data right so how do we get data into this news story well gently if I was using Sr I might do something like this drop my Sr hook in and hit an end point to fetch some data and if we have uh we're waiting on the query we'll return loading State otherwise I have a gripe already not that there's this pry cool uh he he's a letter he's not a conster he he's coming from the the Ryan Florence world of everything should just be let oh interesting why is that can can you explain that to me just so I understand that because maybe I want to mutate data that can't that can't be the only reason that's his only reason that that's the only reason yeah it's because technically con isn't really con because you can modify a key on the object so you just use let everywhere and be honest well no it's a it's a constant reference yes yeah we need cons const so we can have a constant reference to a con you are correct this is this is a Ryan flor's problem really it's so just in case I want to change something when I'm a little further down the file I don't want to go back up and change it yeah and it's less characters to type I got I know there's a better I know there's a better answer is there actually isn't I've tried if you're listening tweet me the better answer could be listening you know what I'll answer for Ryan say I'm typing three characters instead of four deal with it well the fact that you typed four for con makes me a little emotional a little bruised emotionally right now however you figured that out let me know because this sounds exciting drop this into my component render a new story and if we refresh the page here we'll throw the new story in a page refresh the page we see the loading spinner and then we see the data so this is nice but um we want to server render this page and so if we're only fetching on the client we can't do that maybe we want to use some of this data in an OG tag for a server rendered page or maybe we just want to server render for all the benefits that GMA was talking about so if we want to server render this component then we can use um something like that but we're next so we have so let's use props to build out this and this is going to beun our data and return it this is all going to happen before we start rendering on the client so that we can get the data to our new story and to do this we only need to make a few changes go page and that me our story in ring a new story we're going to give it the data you're going to think that injecting in here I know so that new story get about that and now we have a server rendered new story component and if we refresh we're going to see the browser loading spinner and then we're going to see the page render so this is nice we're rendering on the server has all sorts of benefits we see the data right away the first time new story is rendered we it has its data that it needs in order to to show to display the article but we've lost something here right um by making the component accept its data as a prop it's no longer composable because new story now has a dependency on get serverside props right because get serverside props Returns the data and that is needed for new story to work so if we look back at our earlier example where we had a modal Carousel news story this is not really what we have anymore right we now have a modal Carousel news story and get server side props we've broken the composability of this story and uh new story is uh not composable anymore the way the modal is if we want to copy a model or a carousel around our app all we need to do is copy and paste it but now every time we copy new story we have to remember the copy get servide profess something we have to be conscious of so it's kind of broken this react programming model that we all love and uh this is true anytime we add any dependency on a server side API to our components right and the reality is that all of our apps need to interact with serers side apis and services whether it's our database or services like stripe or AWS uh every time we add that to one of our components then the component is not a Lego block anymore and this is the essential conflict a mega on one hand we want the composability of react because it's what makes it fun and easy to use but on the other hand we want our apps to talk they have to like databases and third party services so uh we want to be able to copy around components but we can't as soon as they have a dependency on a server side API we don't mix Mega Blocks we have a special shelf forga this how we rendered new story but this was a server R new story this is how we could render on the server a new story directly from our database well if that was the case and we wanted to copy new story over to our about page how did we do that we just copy and paste it just like any other component yeah and what if we wanted to put it inside of a model and add a few more new stories and wrap it in a carousel oh my and it's all still happening on the server our new story is still rendering on the server if we could do that new story has become a Lego block again and it has all those benefits that we love about react so uh let's take a look at news story news story is a react server component it's an asnc function and it has a direct handle to a database within the component boundary everything it needs is contained so it's just like our originalr example because we can just copy and paste it around but it can be rendered on the server and we don't need to copy around get props to different parts that so it doesn't exal dat passed in it has all the benefits of both previous Sol leg recommended reads we'll throw this right below our new story and this is pretty cool we now have all these recommended reads and they're all still being rended on the server so when the page is first ready all the all the data but we're still playing with Legos we just Dro that into our reactory well post now there's an interesting thing about this page if we refresh it it takes a little bit longer to render because both new story and recommended reads are fetching data and rendering um however the article here Travis and Taylor you know he placed my favorite position in the NFL he's got a $50 million contract and uh well now he's dating Tor with so you know I'm not jous or uh good for him good for him okay so the interesting thing about this page is that it takes up the whole browser width and only when we scroll do we actually see those recommended reads so wouldn't it be cool if we could defer rendering the recommended reads uh so that the page could have an initial render faster well let's add suspense so we'll wrap recommended reads and now if we refresh we're going to see a faster initial render and then whenti that we'll see the suspense fall back and the and all of this is still happening on the server which is super cool and it's thanks to next supporting all react server side streaming apis and suspense uh suspense feels a lot like a Lego brick doesn't it we're still just throwing into our tree composing it with all of our other react components and uh finally maybe we can make these recommended reads a little bit bigger and throw them in a Carousel and we can have some animation there so uh let's take a look at what we end for one quick second yeah it looks like so when you're talking about uh uh partial pre- renders how does news story work because it's not on a suspense boundary would you kind of f it up a little bit uh that wouldn't be or that would be included in the pre-render so yeah so if you had a URL okay okay so new story had like user data in it for example then that wouldn't be or then you would want to wrap that in suspense otherwise the cach thing would be like whatever the user state was on the first hit but if you suspend everything that is user unique or dynamic reliably that just it works so to speak okay and my ass here would be that the new story is like fetching from database and then rendering HTML based on like whatever it got from the database that represents the contents of that post this would allow that to be statically cached and then the recommend or recommendations would be streamed in and could be unique to the current reader picked up after the St yes really cool stuff like a very simple reaction treat but there's a lot happening news story and recommended reads are depending on serers side apis within the component they're using serers side apis on the server and the and Carousel are using browser they're using they're getting references to elements they are attaching click handlers back listeners listen for um hitting escape to close so is this on server only only pieces fast yeah cool so here let's go to two this is the thing that literally nothing could do before the new model people always ask like but I could do everything with server components that I could do with other stuff in terms of like the user behaviors and some amount of like the parts of the features yes but this concept of interweaving client code that has JavaScript in it like a modal that necessarily has JavaScript to Define its behaviors and a carousel that necessarily has JavaScript to Define its behaviors but within that mounting a server component that is fetching data on the server side this is the magic you can't do this inside of a client file so if you have a client file it's marked as Ed client you can't or mount a server component in it but you can wrap a server component in a client component and you can compose in that way so as long as this page component is on the server you're able to mount children and they can have children that are interwoven between server and client components and you can pass a server component as a prop to a client component I honestly am too stupid to understand what you just said uh the basic example I give is imagine a tab component that has like three tabs and the contents of those tabs are rendered on the server because they're like getting stuff from database you could have each of those tab components that are fetching that have like await SQL calls in them and then pass all of those as props to like the tab container so you could have tab a tab B tab C all of those are server components and then the tab container itself is a client component that is a use state for which tab you're on okay and now the server can send the HTML of all three of those tabs to the client and when you click the button it's not fetching the data it's just swapping the HTML that's being shown classic okay uh by the way someone asked is this Prime's wife no I think the other thing he's talking about here too is that uh you can put the data inside of the components themselves you could do some of that before but you would have to like split it out into this like get server side props and then you try and compose the components and you're like oh crap they're missing data so you have to like you're split you're splitting your efforts between two paradigms right exactly it's it's very similar I mean it's completely different but it's very similar to like hooks right like you get to put things that move together and change together together right you don't have to worry about like matching the constraints in some other like desperate file or location yeah or like wrapping your component with the right 15 Hawks in the right order in order to make sure that it can fet your graphql data correctly those days are Hawk please is a hawk the exact opposite of HDMX I don't want to talk about them because I'm still bruised okay okay I'm sorry Mi you want a hawk oh my goodness debugging those things are just just the worst let's let's Sam talk running in two different places they're running in a browser they're running in a server but in our template it feels like a single app the fact that these are running in different worlds hasn't hasn't hurt the composability story of this we're able to write client code right next to server code in a way that still feels like playing with Legos um and this is pretty amazing because usually when we start writing server code to interact with our react app is when it stops feel feeling like playing with Legos and we have to use framework specific apis um to to cross that Gap so uh react has given us the building blocks here to wrap both concerns within the same interface the react component boundary and uh how the heck does this all work well if you look at this there is a lot happening between these lines in our editor and uh next is taking our server components running them on the server it's also route and code splitting all the client code and the client components and shipping that up to the browser next J is doing all of that for us um effectively running two different apps but again from our perspective it feels like one so that's pretty cool and um let's talk about one more thing we'll add one more feature to this little demo app that we have and that is a bookmark feature so we have our news story here and we want to add a bookmark so let's make a bookmark component in our news story so the user can save it and let's take a look at bookmark so bookmark renders a button with a little icon and when we click on the button it sends a fetch request to an API endpoint and the API endpoint is in our next app it's just a simple API Handler here that inserts a bookmark using from the request htx so you know now that our new story has it is it still a leg box strategy replace closest div it's kind of like a new story plus an API server running somewhere for it to work right so again the server side concerns the dependency here has leaked outside of the component boundary and um this is where server actions come in so if we come here and look at our bookmark all we need to do is change onclick to form action and then right here in the action we can use the server directive which tells this uh tells react and tells next to run this code on the server and that means instead of calling an API endpoint we can replace this with the code that was in our API API endpoint it has again a direct handle to the database and it goes ahead and runs that code to insert the new bookmark so in other words they just that code let us put our API endpoint back into code extra yeah whatever values they're using in the string whatever you know variables are coming from the client there's some function that will now exist there that's literally call form button whatever generated name RPC compilation it's actually it's actually simpler than that so this this will embed if you had like the value slug or something this will get embedded as an invisible input in the form for this button and this click is just posting to a specific endpoint well it's the same Endo CU it's just a default form post which has to be the same URL but it uses these invisible fields to figure out which action it's linked to and what variables are missing from that linking so that that will link in the slug and any other values that you're passing in which lets you with no JavaScript on the client side get this all working as expected that's cool the reason this is valuable is because this is a form action this isn't an on click this doesn't need to send any JavaScript to the client now correct yes it well it generates JavaScript a touch right because it has to cuz you can't just submit any form it has to be a specific form with the hidden field being correctly filled in which one generated which action right generates the HTML form yeah with hidden fields in it okay that tell the form like that tell the it tells the endpoint the generic endpoint which form is trying to Target oh interesting so there's they even generate a generic endpoint in which it has they changing the HTML spec I know this this sounds like you're making FAL all over I don't like it but that's just me is it a post or a again it's a post it's a post okay that's good yes even that's that's definitely definitely with like with form action and like like where forms are going scares me it's scary just talking about how much you're working on forms right now and now they're going to be like and [ __ ] that yeah they're like oh by the way magic yeah and a bunch of invisible Fields but the way way this is working on the server is there's basically a giant switch statement for all the different actions that a given route has and one of those hidden inputs indicates which of those actions should be run for the current post that way you could have 15 forms on a page that all have different actions that supposed to run without needing jvt nice so just RPC I would rather have like a function that that gives me like a URL endpoint that I could just put onto a normal form that that's actually what happens if you import a server action in a client component you can export a US server action from a file that's tagged us server and then when you import those yeah it is just like bling for those who don't know Tanner was working on a thing called Bling That is a generic RPC layer for server was you're still working on it's coming back what's so hold on oh no I'm not going to ask you a question now I have plenty of questions I I too wrote a generic RPC layer once oh maybe we should chat I'm excited for this RPC chat in a bit yes but I I want to let database goe and run that code to insert the new bookmark and so server actions have let us put our API endpoint back into the component boundary in the same way that server components let us move get serers side props into the component boundary and so now new story in spite of having a server side mutation is back to being a Lego block and so now our tree is back to being a simple tree it's all encapsulated and uh we can copy it around without having to be conscious of any other part uh that's needed for it to work so pretty cool um this is basically I think the most compelling part of server actions and server components this new react Paradigm which next has done a really good job packaging up into next 13 in the app rout over the last year and letting us all try out this new paradigm and figure out what it means for our apps and um basically we now have the tools to bring any server side concern inside of the component so that playing with components that have server side components feels like playing with Legos again and if you think about it really like the first 10 years of react could be thought of as having done this for browser apis right in the earlier days of react uh there were sometimes where you have a component like a modal that had to render outside the tree so that it could be rendered on top and not in inside the current children where the component is rendered and so You' have to maybe have some code that added something to the body or maybe a component would render and you'd want it to subscribe to a websocket service and so you'd have to write that code somewhere it wasn't neatly tied up into the into the component Foundry and you know over time we got apis like portals and use effect and now portals let you just render a modal that's going to be appended outside the tree so that it behaves like a well behaved modal and uh you don't have to think about that or you can use effect to subscribe and unsubscribed to websocket channels and so these days we have this Rich ecosystem of react components for all sorts of UI concerns and we can just drop in a model or a dialogue or a drop down and we don't have to think about it because all the implementation details are encapsulated inside of that modal component uh API that interface and now we're basically seeing this happen for our server side concerns and so what does this mean kind of going forward like where do we go from here now that we can fetch data and write data with server actions inside our component um what's next and so far we've really been talking about you know local database that we're using for our app story recommended reads they can't really be reused outside of my app they just myal Li drops those AR Dom specific those I just grab from npm these days the most fun and easy parts of what I do so um can you pause it for five minutes other parts of our apps talk to well when you add strip to your app usually have to set have some privil keys usually also have to have an AP resp web hook events imagine if adding strip to re was a simp if you want to not could be about an S3 upload something usually have UI something that let you upload objects to S3 but you also have your bucket what if all that was packed inside the component boundary or what if you had an off service and this is how you render assign in form and again that was it reference add anything else if you wanted to copy this to another part of the app copy this reactory you can throw it in model that would be awesome talk a about actually this idea CS that was thought from the ground your back end now can be well your service like as a software as a service provider like for us with upload thing or for Clerk or kenal or stripe that can be shared out as a component that can be mounted in your app and it handles both the back end and the front end concerns and we've put a lot of thought into this for upload thing and a lot of other devs are working on this too for their own stuff it's the idea that you can npm install someone else's infrastructure and all the backend infront end concerns are handled with like one package and one like component Mount is really cool nice nice future I'm excited about it'll be a lot of work but if we get there it'll be cool I've SE I've seen a lot of people do that uh with with various components where you can just use their entire service and it's just like a singular component that that seems very very nice yeah four server actions and server components I didn't you know decomposed in the way these headless UI libraries do these days so we still have complete control over the styling but to render data from our CMS you just render it you point to the field and it takes care of pulling it down and then forms that let you update it and have actions bundled inside of them that you never even need you just submit the form it hits your CMS you could view draft view you could view draft versions of your CMS content all just by rendering components and changing the props just the way we do with with UI stuff today so um I don't know about you but uh if this is what it's going to look like to add serers side apis to our app to write server code in our react apps and it's going to be this easy and fun just like it is with the UI stuff today then that makes me really excited about future react so thank you good stuff oh the next Talk's already started damn we're very late oh the next talk already started yeah oh Google person nice you it and run your ads I already R the ads hello everybody my name is j and I'm an engineer at Google I just run them whenever okay let's go my talk today will be covering next third parties and the work we've been doing to optimize third party loading in xjs all right to give you all some context of the work that we do I working a team called Chrome Aurora and our mission is to advance the web framework ecosystem by introducing better tooling I'm going to give a bit of context here because there's a talk that was at uh react or reactathon that got nowhere near enough attention where one of the leads from the Chrome like developer experienced team spoke and she said like they had done a ton of research internally so cuz they had this core belief that like vanilla JS was how like the real developers were building stuff and Frameworks were just for hobbyists so they went out and ran the numbers they pulled all of the biggest websites all the developers like who were working on building new applications and they learned that their intuition was exact opposite the vast majority of vanilla things were built by hobbyist students and by one developer most multi-developer real projects by companies were using a framework of some form and since then they've entirely changed the tune internally at Chrome where they're working closely with framework authors because they know how important those Frameworks are for making the web and making Chrome as good as possible but it took them like a while to get there and they only somewhat recently made this transition at Chrome but I've definitely felt the difference that's why teams like Aurora now exist because they're accepting at Chrome that web components were not the right abstraction maybe we need a real framework I wish they were the right abstraction I I I could speak a lot longer on that but we don't have enough time at next comp for me to complain about web components so they're so close they're not that close Frameworks and libraries they just like they're close in the sense that like car is close to collaborating with next team for years and we share many Comm trying to ruce utilities and automatic optimizations to enhance the developer and user experience of nextjs we've helped Shi multiple Utilities in the past number of years including the nextjs image components which is using more than half of all nextjs Sites but if I the next font utility which is used in about 15% of all next J sites next font still pretty scrip components which is using about 15% of next okay that's funny th those being the same amount is actually very funny to me because next font is really new and solves a problem everybody has next script is really old and solves a problem I hope you don't have so these being equally used is very funny to me next image being used 54% that makes sense next image it's like in the default template it's really good I love it is that the caching of the images thing yeah it's the image caching plus like rendering the correct size of image for the thing so like if you have like a 200 megapixel image and you that with next image it will on like the versel CDN or with cloud or whatever else you use as a plugin it will make that a bunch of different image sizes depending on the different sizes you can render at and then embed that correctly there's lazy loading too right yeah it's really nice and they even have like a blur has feature and stuff with it too so you can have like a blurry version embedded in the HTML and then the image lazy loads in after nice does it do that whole like jpeg small medium large generation okay cool yep it it it tries to use the best thing for the browser you're in so it uses like webp or or whatever the av1 equivalent is for like really like good image compression so you're loading images that are like kilobytes I love that you can't use webp on Google stuff yep context they invented webp just yeah webp always worked better on Apple stuff than Google but yeah irony of life for today's talk however we'll discuss the script component in particular oh boy and the work we been doing for the past while to leverage and extend it to make loading third party resources easier and faster I'm scared okay so what's a third party resource the HTTP web Almanac defines a third party as an entity outside the primary site user relationship it involves the aspects of the site not directly within the control of the site owner but with their approval it's good definition and third parties come in all shapes and sizes from ads analytics to content embeds chat widgets marketing and the list goes on and on and on TW the third part calling it now they're going to mention workers and they're going to probably mention I I'm expecting them to mention Party Town by name Party Town yeah worst naming ever yeah don't get restart on quick City system is a massive one that makes so many developers lives Easier by not having to reinvent so many common use cases one thing that my team tries to do quite often is get some data on overall Trends in web framework in the web framework ecosystem I recently wanted to find out how many third party resources do next J sites typically load this data is also from HW archive and we're looking at a sample size of about 160,000 nexts sites you can see here that over 94% of nexj sites load at least one third party resource about 6% that load at least third resources which is still the majority the number go on and on and lower and lower if you look at the end of the chart we see that 2% of next sites load more than 50 third party resources now 2% might seem like a small number but this is more than three seems huge but we have to understand that's actually Google analytics 50 times you think so you think it's actually just Google analytics over and over again no but sadly for one person it is and for that one person very B the type of sites that have this many thir with a of comp features for may mar ORS that may re the inclusion of so many parties interesting digging a little deeper I want to see if we could correlate the number of third parties that load in nextjs with overall site performance we could start with largest which is a useful metric that measur the time it takes to render the largest image or text Block in the viewport after a good deal of research we determined that a good LCP score is 2.5 seconds or less okay so how does the number of third parties that load in next J sites relates to LCP again we're looking at the same sample size here you can see for sites that load at least a single third party resource a very significant chunk has a good LCP score about 39% but when we filter the subset down to sites that load at least five third party resources the number goes down and then with 10 it goes down and so forth that makes sense during the Keynotes guo shared some amazing work that the XS team is doing to make LCP scores streaming a good LCP but I want to highlight for this talk is the impact third party resources 1% would be 30 there's 30 websites let's interaction an next which measures responsiveness by calculating all click tap and keyboard interaction latencies a good inp score is 200 milliseconds or less really 200 we see a very similar looking chart when we try to correlate the number of third parties that load with inp next to have sites that load more third parties have poorer performance when it comes to responsiveness that seems more like correlation than C very important to mention that correlation does not necessarily mean cation can't just look at the prev saw say for a fact that the decline of performance however when we couple that data with the many studies that I've shown in the past that we've done in the past it becomes clear that third party resources have a significant negative impact on user experience can try look at this from a different perspective we can also is high amount of third party resources a a different type of indication of like how the person is building the product more than it is not even I I would argue It's a combination of that plus the age of the product in the code base like a lot of more things being added and rarely are they being removed like I know we switched analytics providers three times for paying and we didn't switch we added analytics providers for paying so more being added over time the project is getting older or it could just mean you have a marketing team that's using Google tag manager yep that's very real sadly yeah I would say it says more about the team structure than it does about the like philosophy of building okay okay yeah it's one of those like like I forgot the name of like the rule where like code bases reflect the structure of the teams there's some old like Linux guy who made some ter for that but yeah there's some called stalman roll yeah stalman roll thank you is it stalman roll no it's not stalman R you're just saying stalman goest I did this with shad xen's taxonomy website it's actually quick shout out to Shen and some of the incredible work he's been doing in the nextjs Eos system yeah actually react plus nextjs right or has that taking to calling it react slash nextjs site was a it's open source and B it was actually a nice representative example of a next site with many routes and tons of function the nice thing too was that it didn't include any third part resources so I wanted to see what would happen if I tried to include some or 10 the most popular thirds when I did that I found the total blocking time of the side to increase 65 times so smart Prim now total blocking time measures how long the main thread was blocked between first p and when the site becomes interactive it's a really useful proxy to assess how responsive page is going to be to user interactions and you can see how easy it is to just have your main thread blocked when you include third party scripts if we take a step back and look at this from a higher level we can sort of see that there's two problems here all the data we seen so far show that there's a serious user experience problem that developers run into when they load more third parties into application fair but there's also a developer experience problem a lot of developers don't necessarily know how to load popular third party scripts and when they do so they don't know how to handle the performance issues or even add new custom functionality here are some anotal evidence actually and these are some things we see pop up all the time on sites like stack overlow next developers often struggle with the performance impact of third parties this individual here just talks about how they includ uh someone said this guy looks like he's been taking pre-workout before the presentation lowlevel learning uh we're on 1.5 speed yes we're very far behind we're we're playing this fast forwarded to catch up this is he's not just jacked out of his mind right now it's just SP up I I'll speed it up slightly less so people can keep up a little bit better here next site and their Lighthouse prly and this really is a cry for help here's another very similar example but on GitHub and this person says pretty much the same thing do Google tag manag is slowing down my lighthouse score and I don't know what else I can do to improve it I I will say I love that there is a Google employe currently on the stage at next comp showing an issue of somebody complaining about Google tag manager yeah that's like this is the new Google this is Google being willing to like the same way like vercel is letting us sit here and talk [ __ ] when I'm the only next user of the four of us like yeah they're they're understanding they have some work to do Google has become self-aware yes that's a scary thought but it's a good thought not AI yeah okay is this AI reference no we're going to have the world's shittiest version of Terminator developer exper I found an article quite recently when I was trying to see what developers do to tr and load Google tag manager in next and this person looked at the documentation for GTM completely decided not to follow it because developers try to find an idiomatic approach to including third parties they opted to use an entirely separate open source Library which is or may not be maintained anymore so what's the solution I think a very good question would be instead of trying to introduce framework utilities why can't third parties improve the performance at the source and for some third parties this may be I handled my own but this can take Years A lot of these third part by the vast majority really weird use any incremental improvements take a very Dynamic loading yeah where the scripts themselves have Dynamic cont for the develop experience angle why can't we expect the third party providers why can't they build a react or angularity ority and so although this would be nice it's not also very realistic the framework ecosystem changes so frequently that it's just a lot easier for thirdparty providers to build a one siiz fits-all solution what JavaScript releases Frameworks at a high rate when we built a SC component years ago we wanted to make it easier to low third new javascrip framework in like days dude I'm still using the experience of the script component in nextjs is to load after some or all of your application hydrates but we also included a strategy property to give developers some fine grain control on when to load a third party resource you can decide to load it before hydration happens after hydration happens or even during browser aisle time using the value lazy on load that's cool but it may be easy to use for like a single single script I have done but let's say we wanted to try to use a script component Google this is great we look at the Google tag manager documentation figure out okay we need to include this big inline scripts try to understand how to do so with the script compon get that working and then there's more that we also have issues with what's the best loading strategy to use do we just stick with the default approach or do we even decide to switch it up and do something slightly different and there's other questions as well I like to S it be placed in a layout component or page how do you even try to send custom events I'm using Google tag manager as an example here but this pattern will apply to any popular third party and for many like Google tag manager the majority of nextjs applications use them so one thing we decided to do is what if we can build on top of the script component to introduce a separate Standalone library that makes this process a lot easier instead of trying to figure out all those details yourself what if you could just import a Google tag manage component and automatically know that it's going to load in the most performant manner what's happening behind the scenes is nothing new or magical it's using the script components but we're doing the research to figure out when to load it for you so you don't have to think about that yourself and what if you were like okay I want to to send an events with Google tag manager we created a little function a little utility for you to send events as well that's nice they have roughly caught up to every other analytics provider here yeah yeah almost they're getting there got them hey we also tried rolling out a YouTube embed this actually if you want to include a YouTube embed and try to do with the script component you might realize the script component specific for scripts right but we could do this a bit further and think about ways to make even embeds or stylesheet or any other third party resource easier for you I like that and again we can take advantage here of not only making a developer experience easier for you but we can also figure out what's the most optimal way to load it instead of relying on the typical YouTube Ed we decided to use light YouTube Ed to load that much faster and we did the same for Google Maps in bed and you're starting to see a pattern here we're making a developer experience easy for you but we're taking care of the performance concerns for you okay a lot of the times Google Maps are just loaded automatically when they don't need to be so we're like why don't we just lazy them below the device Dort so it doesn't block any res page next third party is still under active development but we would love your feedback it's still very early stages we've only launched those three resources but we have a lot more plans to include future third parties in the near future so send us your feedback the more that we hear the more useful it's going to be and here's the link to the documentation of course they take a look feel free to also comment and get feedback there the more people that use this the more we realize the more that we know what to do and what performance issues that we can actually fix and overcome right super that he sold me with like the YouTube EDS the YouTube embed and the map embed I'm so the number of websites I've seen that have the YouTube embed in them but they have every single page loading the YouTube embed script because they just put that in the roote and then every page like in almost no Pages have YouTube EDS but you're still loading the JavaScript you're still eating it that being at a component level actually makes a ton of sense and I'm really hyped to see that I'm going to go pee I know we got a talk goings good luck grab me water if you can Prime check this really quickly don't mind my console log the tner as well peace thanks for talk bye man back L sounds good I started learning how to code a little bit later in life around 26 years old but ever since I saw teaching anyone around me whatever I had already learned so I started volunteering a lot after work for organizations like girls who code Flamingo coders path to college Code art and a ton more organizations the thing is is that I love to get back to my community in South Florida and I want to do I can too much for any have the opportunities to grow meaningful careers in our region so they don't feel like they have to leave their support systems or the homes that they love in order to find success in life which is something that we see quite a bit in our region and a lot of great people are working on this problem but truthfully speaking we are still growing and there's a lot of work to be done so this is where my Story begins with react Miami and how I used nextjs and versel to execute on the seemingly impossible vision of bringing a world-class developers conference to my home my name is Michelle Bagel I'm a software developer Community Builder and Conference organizer I work at gtii on creating initiatives to support the health of developers and connecting these developers to Great companies and I am an avid Daydreamer I excel in zoning out and in 2020 I had a lot of time to zone out and I just dreamed about what it would be like again I looked up all these web conferences around the world and dreamt about exploring a new city and meeting all of my Twitter friends in real life and shortly after this the Miami Tech seene started to blow up and don't worry I'm not going to dig into this this is just for context but it was pretty bizarre like super exciting obviously but a little bit bizarre there had been so many people the whole Miami wave was interesting when it was happening I I went to visit for like a month I was you I did not it was there was a lot of type people there at the time I feel like it was a web three bubble honestly that was myto yeah it a lot of web yeah I I find that when scenes form outside of the bay they tend to be more hype driven than when they're in the bay like there's obviously a lot of hype for like the start of seen out here like the the AI shit's just insane but other places tend to be almost but like the core is hype rather than being value and that's why I've been concerned about like the New York scene the Miami scene somebody's item right here oh that's me just we're talking about Miami in Miami the push were based in Miami a few years ago you're texting what now we're talking about the tech scene in Miami because she runs react Miami on scaffolding a tech industry oh she R react Miami all at whole world was looking at us is that the one Dax and everybody went to then chaos no Dax lives in Miami all of the but he still goes to that meetups and happy call that place everybody was on Twitter headed to Miami who should I meet it's like okay awesome thing we have all of these amazing Tech events happening now but what are we doing for developers and there were a few initiatives going on but I was like we need a conference we need a conference like the ones that I fly out to with speakers the Deep learning opportun did you ever go to Miami I did not go to Miami and so in the most serend moment ever I see this Tweet someone should put on a react conference in Miami and at the time I didn't work for Gabe but now of course 420 go um and I was like let's do it let's do this conference but Gabe and I we didn't have any conference organizing experience so this is when G2 partnered officially with Dev world and thus cre I haven't been invited to react now Rea Miami organizor sell some tickets this was the rudest Awakening of my life extremely difficult to organize the conf there are endless emails and contracts contract Provisions people look at me have you been to more react conferences or non-react conferences I've this is the only time I've ever been to a react conference is nextjs if you can call that a react conference react plus next but I have been to more react conferences than Russ conferences think about that one for a second really don't have to think that hard about that one for real I guess cuz there's very few dmca issues you know yeah I'm just a walking live I'm pretty sure I'm in conferences crap L I'd go I'd go gota wait for it to happen this was supposed to be fun we just got hang with all my friends for GI sorry for all the subs that I'm missing I don't have any access to any of my analytics on this ma thank you so much for that though we call him Crimson mama when you're organizing a conference you never know how long each contract or agreement or conversation is going to finalize and these are the most important things you have to focus on so whenever you're not working on these things you'd be making the best possible decisions with your given time anywhere you can be so that if a potential sponsor reaches out or the venue has to go back on something if anything comes up immediately that you have to address you don't want to be like uh can we talk about this later I've had this course a for like two hours sorry guys so this is why we unquestionably chose to build our site for react Miami with nextjs and pcell and it has been quite the journey organizing this conference so let's start with year one year one is the hardest year to organize a conference because you have to sell tickets and get sponsorships without any precedence for your event there are no tweets testimonials or videos online and so the only thing anybody knows about your conference is whatever is on your website so we needed to create a website and this is when I realized I had never created a marketing website before okay word next thing is that I wanted us to actually build our website we were so ear is still underrated I would have used it for something like this and I didn't know just I wanted us to build our s Myer started on or change implementation details we weren't locked down it was so easy and we also needed to utilize a CMS start easy get really hard information to site as well so again this is another new thing hadn't ever used a CMS before so lots of new things yeah but thankfully I didn't have to start from scratch because there is an entire Suite of free xjs templates online for you to be able to use so I found this one for the virtual event starter kit when you use this kit you get a whole application built out for you with about a dozen routes set up for events fully responsive page layouts type safety from front to back a project set up in a CMS that's fully templated as well automatic build and deployment set up in and environment when they started competing with these things so if I were to do this on my own it would probably have taken me a couple weeks all the other obligations that I have but in reality this was a few Mouse clicks and this is exactly the kind of time-saving decisions we had to be making wherever we could so this gave us a great head start with a lot of well-written code and established application patterns that we could just continue following all the way up to conference day so then conference day arrives and we sold out which was wild totally unexpected didn't wheeler go to this there were still a lot of challenges one of the biggest challenges is that I did a terrible job preparing volunteers and delegating work so I created this situation for myself which and pulled in a thousand different directions and there were some last minut items that I didn't get to and one of those things was to build a page on our website for the Afterparty where people would RSVP we send the headcount to the venue and this was a need to have because the production team already made all the slides with this URL and sent it to the AV team and so in the midst of everything I'm like how am I going to build this page right now my co-organizer had an idea he would create everything in a ocean document send me the link and we would just set up a redirect in nextjs genius okay great I actually had never done that before either but it was okay because I happen to be at this react conference with hundreds of react developers around me so I was sitting next to my friend Mark and I was like oh Mark I have to do this thing right now and he's like I actually already know how to do this thing and so he's like you just need these five lines of code and then it's blop doopop minute and a half later Pages deployed pric is averted part on so after that I knew forell xjs was going to be the stack for react Miami because it didn't matter if I was getting a huge Head Start from zero or if I had to make a code change to our website under a ton of pressure day of the conference there was always going to be an easily accessible fast and reliable solution at my R somebody in chat asked wouldn't a rewrite work as well the problem with a rewrite is that if it has any local resources that it's requesting like if it's requesting SL script or slash image and you have that Rewritten it doesn't know the post domain so unless every single Source on the page you're rewriting has its source domain handled correctly that won't work which is why redirecting makes more sense more often than not do you do a 302 or a 303 I do whatever NEX does by default I'm pretty sure it's 302 you know what the danger of 302 is caching no no when let's say you hit an endpoint with a delete you get redirected with your verb as well ah 303 redirects with a get interesting good to know actually HDMX by the way it's on their website year two I worked off a refactored version of the their Lally from Al poison you think that this is a picture of jto picture of me at nextjs last year seeing OG images being announced and then immediately using them for react Miami this was amazing for our site because our site links could be shared anywhere and they would be fully customized and branded based on the route so this example of our speaker cards from last year we were able to put in this beautiful floral Miami speaker information confence information without this we would create like Twitter or LinkedIn posts that would combine like text and Link and image all together but that messaging would only ever exist altogether in that post with OG images and being able to use this for react Miami we could just share links or other people could share links and that messaging would still all be together with really impactful and customized information so en un to speak the AL poison what does that translate to drinks drunk translate to 13 drinks and I'm here business decision thank you so much for that let me go back to when I said I didn't have any time to do anything analytics was something that didn't get shipped in year one for react Miami and that's so bad but year two we can install analytics in our project in just a couple of minutes and it's like the world blossomed open I could see where our sight traffic was coming from where in the world our visitors were which routes they're hitting how often they're hitting these routes and this was really beneficial to us because the last year has been very very hard for events the economy hasn't been good companies weren't sending their developers to conferences as much marketing budgets AKA sponsorship budgets were frozen so we needed a lot of help and analytics was a really great way to see what was important to our site visitors a really pretty analytics page who is that help move started as split B and they got acquired by verel so oh yeah that's great that looked it's just it's it's simple enough where you don't need everything and it looks like it loads pretty so we originally going to announce we saw how many people were coming to our site and going directly to the speaker page first we decided together in November and that's actually the moment that our ticket sales kicked off for the rest of the time leading up to the conference so that is just something that was really really huge for us that we would have got who beautiful that is not me so now another mini crisis again I just finished short somebody heard of pad CMS the payad CMS CEO just is about to walk up the stairs behind us I'm very familiar with p on the beach and I'm literally running get for Queen CSS herself unet is about to take the stage and I get this text message that our stream is down I still don't know what happened but our streaming platform it just wasn't going to work so I had to replace the stream minutes before this conference day was starting so the MC's are YouTube live streaming so hard we need to replace the stream so so they were actually going to use something else and it failed last second they had to Swit to a YouTube Ed minutes before the started oh my goodness never use I mean if you're going to not use twitch using just a third party crazy PL that's crazy no you got to use YouTube but like you YouTube is paying the money for this infrastructure and for all this effort to be done just just use them unlist the stream and embed it it's it's fine it will leak but who cares why would pause it one more second why does someone care if a like I noticed that a versales is unlisted what why is that a a deal I don't get it also you're not subscribed to forell I'm not signed in right now I'm not signed in my computer I'm not signing into my Google account on like a random provided by the company hosting the event PC fa yeah even giv them my stream key was scary enough but yeah uh the a lot of companies like if they treat the stream itself as like a thing that's like supposed to be part of like a paid ticketing system where they want to track it through their internal in a Linux and stuff and they want you to have to go to the next comp website or to be fair next comp's not bad about these things it's other events that are particularly bad about this yeah they treat it like their own like IP right yes interesting there actually a problem I've had I want to co-host and like do this type of thing with a lot of other companies and even getting them to like sign off on it like the execs will agree the people hosting the event will agree but some random like marketing team will be like yeah but but we can't track our UTM tags on that so uh sorry you can't do the event that's happened multiple times now I feel like having a high amount of YouTube views would be significantly better than whatever other we're currently getting more concurrence across twitch and YouTube stream they were getting on their TW their YouTube stream quite a bit yeah yeah this is huge for next and like ones in chat if you're watching this and you wouldn't have watched next comp otherwise let's see those ones yep make you my money guys we got one two 3 four 5 six yeaha case in points yeah we're making versell a lot of money in a WhatsApp message then at 901 I commit the code change it gets pushed 903 it's already deployed and live on our site and at 9:05 a prescheduled tweet goes out to join the live stream for un's talk and it's like nothing happened no one suspected a thing unless you happen to be in the room with me when I was making this Cod change you for sure knew something was wrong but aside from those people it was seamless so we had another really great year and really happy with how it ended up in the end uh after the conference I wanted to Fork this other nextjs template for the image gallery starter kit and this is just a beautiful uh gallery that I thought would be great to showcase our images from our photographer Daniel shmith and so I start working on this gallery and a week later forcella is like we do databases and blobs now and I was like what sick okay so what if this Gallery was like full stack for sell like what does that even mean so this was the stack I used the images and I took those blob URLs stored them in verell postest with additional image information like all text a few other things okay the whole could have used upload thing could use upload thing but uh I I guess blob fine oh no no she's not even using blob she's storing the image blobs as URLs with image data in versell postgress so she's storing the images as postgress data so don't do that either but go with next JS and it's deployed on for cell for really straightforward you grab the data from the database populate the image gallery it's deployed on for cell at that's how web applications work and it worked like a charm so another nextjs template win year three our site for year three was just uh deployed earlier this month and I decided to start it from scratch there were a lot of new things that changed between year one and two that I wanted to take advantage of and the first one was uh custom events from sell analytics so custom events allow you to set up tracking throughout your site uh to see exactly what's being clicked on and is I set this up on every L button in it's still using neon us neon okay did they open it up to other providers or is it still just neon so versel postgress is vel's infrastructure for post grass so it is just them reselling neon the same way like scale is kind of just reselling RDS but it's their custom weird way of doing RDS like all these things are just resells of other things but I use turo by the way yeah t turo is great Planet scale slightly better but turo is really good oh I don't know local caching come on yeah local caching is cool but uh vest is very reliable battle tested technology and yeah it is what it is our website and I can see how often these things are what areas of our site are getting most traction and just throw down a little bit deeper and understand how people are using our site so going back to the secr page example it's not entirely clear how people are getting to this route right are they going through the navigation bar are they coming from a Twitter post we're nearing Prime ADHD stream right now this directory layout because I like the collocation of functionality and resources to a rout folder you can also have things pulled out like into a components folder wherever necessary um over Everything feels a little bit less reacting obious you just see a lot less things you see a lot get props and with Dynamic you have uh flexibility as well so you can Dynamic routes on Demand by default or you can generate several Dynamic routes together at build time with generate static prrams OG images also got an upgrade so there is a route Handler now um with the file convention open graph image where you can store the code for your OG images right into the route of the the route that it belongs to basically page that it belongs to um and so again same thing these are generated On Demand by default for dynamic routes or you can generate several of them all together with generate image metadata at bu time I also got to use AI quite a bit for the site this year so number one fromell this is an AI powered UI generator so you you kind of describe what you want to build on a web site in a prompt box and it will generate layouts for you that you can edit and then you can copy that code and stick it right into your application so got to ship some of that and then also got to use b c it uses the verell a SDK under the hood and this will generate your CMS templates and ALT text for your images and a ton more things with AI so very fun these things were very beneficial to me to use which brings me back to my intention from year one I wanted us to actually build our website so that we could stay open to implementation ideas and Integrations two years ago I would have never guessed that I would build a website with an AI powered CMS but by using next JS our projects stay open to new ideas future Innovations and possib Sam from planet scale wanted me to clarify they're not actually on RDS this is really only my mistake there they know how to use myql well enough to not need that when I started using forell it was a platform for fast and simple deployments and year-over year they've continued to deliver on their infrastructure and framework capabilities to provide that value of their deployments to more of the developer stack and so when I think back on my intentions for react Miami and why we wanted this conference it's not to build a website or to generate OG images bring the world ofct together in some small big moment coming soon so I'm going to skip through this real quick you literally kill your internet in the middle of streaming you no promises of anything YouTube am I back we're back cool we're back on YouTube cool we're live again hey hi I can entertain the stream while you go do something I am absolutely miserable because they took my internet on me for 5 minutes and we lost everything so yeah yeah we're good to go now damn cool uh what's up you everybody ready to get mukbang you might uh let me tell somebody who's in YouTube chat say Theo said refresh YouTubers are probably going to have to refresh to fix it who's this new guy yeah good question I have no idea who that is all right hey the the name's Madison cool sorry again guys I did not know my internet would be taking out for 5 minutes that's always really painful to get a five minute internet we're out cool yeah we are now on the screen in the other room guys I did not know my internet be we can hear each that's always really we get a 5 minute internet can y'all not play the audio for the stream in here that's always there you go me never mind I screwed that up I'm so sorry uh yeah this is hard to do crazy enough streaming isn't easy shoot wrong button yeah streaming isn't easy when they yank your internet 5 minutes before you're supposed to be on the TV so shout out to everybody but whoever did that appreciate you y Aon thank you nextcom for having us we've been sitting here reacting this whole stream we've had awesome talks we just watched or we just watched a great talk from the hosts of react Miami thank you so much for that one that was great yeah really cool seeing people using necks to build awesome stuff and host awesome events just like this one the site did look a little similar a little familiar though did you feel that no no it looked completely bespoke and beautiful yeah you don't go to conferences what I'm I'm currently at a conference Fair fair you know okay so you know me I love react and I was sitting there watching that uh the Google one madis said get over here on the TV I'm not going to lie to you I would definitely use react for a YouTube button that's it if I could just be like make a YouTube video and it just worked every time but that's CU you're a react content creator I am literally I am core value speaking wouldn't it be fair to say you have more React videos than me I have significantly more react are we talking about how much prime loves react his number one favorite thing to work in his passion meaning of where all do come from is reacting got to make eye contact you take the damn right that was aggressive it was so how are you so cold that you're wearing a a like a little hat at this point beanie dang they actually believe I took that big of a bite and then you ask me a question okay okay so we're actually talking about the more muscles you have the more you're naturally less cold so I think that's what I'm I'm not cold right now we're talking about this makes sense Prime reaction we got to wait for him to finish his giant bike I'm not reacting that's a that's a scientific fact no how do you feel about this just do you want to feel my ey no it has nothing to do with that okay no you know what it has to do with I get so hot that my body tries to cool itself down but the warm the the coldest summer I ever spent was or the coldest winter I ever spent was the summer in San Francisco it's freezing out there and so I'm just not used to this kind of weather okay you quote like Mark Twain can a man not quote Mark Twain wow I I didn't think you were that classy he that classy sophisticant okay I use words like prescious all the time what does prescious mean mean it's it's having really great insight into a topic sure yeah you you might be confusing it with precocious which is showing early adolescence ability in something which P people typically this is like the thing I would be saying if I was trying to troll somebody who has dyslexia like you go ahead look it up hashtag it Google it I did see a really funny tweet recently that was like sorry not going to read this going to wait till another developer with thisy will read it for [Laughter] me that's a great tweet cuz who who would be reading in front of people with dyslexia that seems like a terrible idea do this hey I I have a terrible fear of public speaking so we all just embrace our problems we do TJ read for me and every single comment was who is this guy and how does he read so well it's funny trying to read on stream maybe realize I'm not actually a great reader I thought I was good at at it but then I did it on stream and I realized all my patterns and like how I parse things is horrible and really terrible to follow so hard and then you you also realize when you read out loud that you fix people's bad grammar and stuff there'll be like an a an uh there when it should be an an and you'll read and you're like uh you are okay hold on wait hold on let's go backwards here and then you're just all screwed up yeah it's shocking I used to copy edit for a lot of people and Dev and open source stuff like I still help Ryan carni and Fred and friends with like blog posts randomly and the way I read when I'm reading something for stream is not dissimilar from how I read when I'm doing something like that and it makes it really hard to because I I'll just stammer over all of the grammar issues as I'm doing read it through it's hard for me you know I think there's some pretty good stuff today I think so too okay what what's been your favorite so far my favorite so far besides for performance being almost the most important topic of the group during the the keynote uh I would say that I like what Google's doing I'm glad that they're embracing I'm glad that they're making things that maybe are great for developers cuz typically what Google does is they they they're like uh they're like the main character off of Idiocracy like they're not great they're not horrible they're just like the nipple of every bell curve it's just like yeah yeah that's a Luke again sophisticate okay uh like the smartest person in the world of dumb people basically basically if you had all the worst products Google would be not that bad but now that looks like they're actually going down on the uh they're no longer the nipple they're going all the way down the bell curve and the stuff they provided looked really great like that actually is good stuff yeah it has been really nice seeing Google more like embracing Frameworks in modern webd like it's not just like Google telling us how we should build websites it's now embracing how we're building websites and trying to help us do a better job using the tools that we're already using that feels like a huge like shift in like the entire web industry honestly and I hear they know a lot about the browser right like they're pretty good at it yeah they're they're decent at it can you fact check me at that one hey what's your favorite browser Madison what's my favorite browser Safari good answer Safari you're a bu user Safari absolutely my number one I've never used any other browser just sorry why would you need anything else it has really good battery performance on Max I just use Firefox I'm actually an opera guy myself thank you bash we need bash immediately bash can you please fly from Canada or whatever any website I browse via curl I don't actually want to go on I'm sorry okay so here's the deal is that clearly Brave is a great browser and brave is a browser and no one's mentioning it I haven't I feel like I tried Brave forever ago when there was like all this hype about it but I feel like it's I'm still hyping I'm still hyped up speaking of hype let's talk about how we build our javascripts I think that's one of the interesting pieces we were talking about before with performance I feel like most existing focus on performance for build has been Dev builds so making it so when you save a file you see the response you see the change as quickly as possible that seems natural but actual build times for when we're making our production builds has not been a focus even something like vit which is incredible vit is a wonderful technology that is a incredible developer experience it still uses roll up in production so our production builds with v still aren't much better than what we would see with something like web pack and one of the cool things about the turbo pack stuff they announced is that they're not just using it in Dev they're also using it to speed up produ builds so what I'm saying is we are the first production next we're words nextjs is the first production rust framework because we're using rust in our production builds that doesn't make any sense rust doesn't go in production okay yeah fair you only do command line utilities yeah is US CIS in your production though o yeah checkm atheist you just actually L literally got right there we don't have our c ERT bash here today sadly she is in chat and thank you for helping keep chat slightly less chaotic than it normally is wish she was here yeah thanks bash for leaving me out here yeah got sick at twitchcon apparently somehow we didn't I think she got sick of strong immun system us at twitchcon she's done with you guys she got a little allergic take another day yeah being surrounded by Gamers without being paid for it kind of sucks it does all right so so real talk though okay so I guess the thing I'm confused about a little bit with that previous statement was that rollup allows you to use S swc which uses rust so you can just do all your builds in that so you can get pretty Snappy production builds I've never seen roll up S swc before I've heard a little bit about that but I don't know if anybody using it I've seen it I've seen it that's good to know I've seen an end product using it so you just you think most people just don't use it no I I I every time I spin up a project and I see that there's an S swc option I get confused why people would use it but it makes sense if that's using S swc for the production builds that checks out that makes a little bit more sense that all said like the solution V has chosen is their rewriting rollup in Rust so that's the other side they're doing the rust rewrite or Turbo packs a rust project too it seems like rust is taking over our build pipes yeah that's because the ins and outs are really well understood and so it feels like a natural win there I'm curious though I am curious I I mean Zig Zig seems very exciting o camel mention o camel anybody in chat o camel I there's a lot of great L there's a lot of great languages today to do stuff in now I just why haven't we made a build tool in Ruby yet that's a great question um I think one of the problems with making a build tool in Ruby is that first you have to be able to find someone that actually does Ruby and then you have to actually write the Ruby and then you have to hire them from base camp which makes it a little bit difficult and then finally when you do hire them from base camp it just doesn't run fast at all somehow we got we're slower than JavaScript yeah python maybe but I hear Ruby is an incredible language I enjoyed my time with Ruby so much that I went to Elixir and elixir was great how look Theo how have you not mentioned Elixir boom Elixir there you go you got your Elixir mention Jacob I can't help myself uh we I do have our good friend Jose valim coming to the stream soon I'm very excited for that oh you got Jose to come yeah we're talk all about type safety oh yeah because uh Elixir is going to potentially have some type safety it's how how it's going to look I I haven't watched the it's very different it's very different it's like a hybrid of it it's somewhere between like o camel and rust in terms of how it is really strong on like the backwards inference stuff yeah hindley hendley Milner hendley Milner I don't know I I'm not smart enough with types I just like when my auto complete works so I'm not the right person to ask but they started on the math side like they mathematically prove out their type system ially sounds like Henley yeah yeah type safety is hard quick math so you got the fastest mathematician in chat right now yeah I who's or quick math so my favorite mathematician is math geek7 he's on Twitter every year he does Advent of code in Excel and he streams it he like five viewers and me and my community are all five and it's incredible what do you mean he does it in Excel I mean he solves the Avent of code coding problems in an Excel spreadsheet for every one of yes because you don't submit code for Avent of code you submit the numeric answer like the prompt will like have this crazy long input and you have to get an answer out of it you can do it by hand there's people who do it by hand for the first like five problems but then it gets too crazy he did it all the way to day 25 with Excel it was nuts what's his username math geek7 a great math geek7 absolute Legend yeah is the best programming language we all know that like why why would you ever use VB when you have Excel right there I like I like where this man's head's at yeah right you know what okay so if we're talking about languages you know what language I've become the most curious about in my land in my in my days of just reading about every language oh no JavaScript nope try again come on uh C++ nope not C++ I've already done C++ and I choose to avoid it I've already had it set in chat not o camel is it hcal I am very interested in O camel as well but it's not oaml it's it's it's a tie between o camel and pearl Swift Swift oh yeah you have been nerding out about Swift lately really Swift's a weird language have you been on stream nerding out it no no I've only read articles about it I I feel very excited so I'm choosing what to do for Advent of code it's either oam what makes you excited about Swift or what's causing this it's it's more like rust and also not like rust all at the same time you got to explain that one further okay so rust so here here's a greater way to put it uh uh pretend this table right here is all potential safe programs but the ones that Russ recognizes is like this little circle right Russ recognizes only like a approvable set of safe programs where Swift allow it has reference counting o camel has garbage collection but then you can also get into ownership if you need to if you want to take things fast or you can make the parts that need to be fast fast without all the pain in the ass that is the other part Swift does that which is something does that and O camel is now doing it too o camel 5 and it's also named after uh figures in uh what's it called what's the book Dune yeah that's a book oh love Dune read that forever ago really I'm on book three and it's weird I never read the second one I feel like it gets weird important question is there a swift HTM X package yet you wouldn't do a swift HTM X package why not you don't do HT htx you HTML is there a swift templating language if there is then which there is then you already have HT the package would be for type safety of like routes being correctly handled so when you specify a route in your HTM X that that route exists it is returning the right format that's just not a thing lame I know that um it's not a thing because you don't have client side state it's not a thing Ethan ncer was working on this a little bit with the uh Beth stack stuff where his actual like the routes that you were specifying for your HDMX if that route didn't exist it would type error yeah that doesn't seem I mean the thing is that only works if you have a framework that is kind of scaling everything which is what he has so he knows what routes you've specified cuz he owns the router he knows what you know what pages you're writing which because you know if you know everything if you know if the missile know knows where it is it knows where it isn't yep or the other way around the missile knows where it isn't then it knows where it is it it subtracts where it isn't from where it has been yeah to know where it is it's the classic difference right there so what I'm saying I guess is that you need to have a swift router a swift framework a swift compiler and then Swift HTM X yeah then you could then you could validate that yeah so somebody needs to remake that stack with swift what I was thinking about doing is uh cuz I cuz I already wrote we already have a working and cargo installable HDMX auto complete but I was going to make it so that it can also crawl all the files if you have like a little config it'll it'll just crawl whatever directories you tell it and it'll gather every htx tag and all of its routes and then give you an a dynamic list of routes for you and then technically I guess you could you could continue to add on to it in some way I'd have to think about that because the problem is I don't want to program at all you have to come up with like a plugin it'd be that that one would be hard because you already know the tags but the hard part are we still on or is this I have no idea if we're still on or not I think we are yeah cool we are people are listening to this yeah they're just restreaming our YouTube stream on their YouTube right now double YouTube yeah we're we're double trouble can you stream to Twitch which is getting restreamed to YouTube well with the new changes with the twitch policy almost certainly absolutely yeah when are you going to start streaming Madison yeah Madison what when are you going to start streaming you know I tried to stream a few times it crashed like every time I streamed I want to get back into it but I have to say the setup is so ridiculous like OBS and config and I tried to stre from my Mac which was a bad idea so I if I could do it but it was like yeah it was just such a hassle I'm going to make a video eventually about my setup because I get so many questions about it I'm like regularly surprised I tried to copy a lot of your setup like I got the camera you told me to get I got the mic you told me to get stuff and that stuff's really helped yes the uh actual machine that does the capture tends to be the hardest part though like even here I insisted that For Better or Worse we are running a Windows machine right now but Windows does tend to be the most reliable thing for OBS I think I got to get a Windows like that's cuz I just have a Mac go if anybody here happens to work at a computer company that makes gaming PCs feel free to hit any of us three up we're all looking for better machines to stream with let's just say if you if if you're oh I can't I we're on versel I can't I can't say what I was about to say I was about to make an asmin gold joke but I realized that you probably shouldn't make phallic reference jokes on a comp you replace the F cart with a triangle that's a great question you guys don't think we should make F drugs but you were talking about the t- word earlier extensively yeah but that wasn't when we were on the versel channel but but also like versel owns the taint they've been very clear with that they're they're the the the providers of taint so okay there there's the taint is the final line before you cross into too much right once you go past the taint then you're in the client then you're in the client and we just don't talk about those kind of things right here okay yeah you have a classy gentleman line yeah so you have classy Crimson or Mana Crimson mama is what you refer to them as with another 50 gift Subs we appreciate that a ton thank you for funding this stream at this point Jesus we appreciate the support so much absolute Legend out here familyfriendly stream yes yeah I really like to talk on the community website and building the conferences like conferences take so much I can see we haven't seen this conference amazing like all everyone all the work here yeah I kills it I learned this year how much work goes into this I I showed up here at about 5:00 p.m. to set up for the stream and I left at about 10 p.m. dang yeah and I brought half of my studio here in order to make this all work yeah remember when we're going to do more than one stream Target and everything I mean we are I'm doing that right now I could have added the multi rtmp outs here with like three button clicks that's the easy part okay the hard part was the hardware and getting all this set up and looking good we actually I had duct taped an an on air sign here and I guess it was too Jank cuz they took it down but yeah we had a super was it a black piece of paper with white writing no it was an actual neon on air sign but we had black duct tape pushing it up on the wall there but uh duct tape would be enough for verel to be okay with it because like the black and white theming but who started skill issue like when did that come up that's an old Gaming thing okay that's something you say to people to emotionally bruise them oh you said that to me earlier that's how like a Jonathan Blow huh Jonathan Blow tweeted that it was embarrassing that he could buy a brand new high-end Windows gaming machine and YouTube would still like be choppy to like browse and load videos in and I quote tweeted with skill issue and got blocked immediately yeah I mean it it was a skill issue but is it yeah on the side of YouTube probably but nonetheless there's a skill issue somewhere in here somewhere skill happened there that does sound brutal all right I am interested okay so I've never been to Miami and I've never been to a proper react conference I think there's only one thing to do hey can we get Prime to react Miami I'm sure Michelle's down I I don't want to speak for her but I be very oh there she is I know she was right in front of us that's iing she actually can we bring Crime to react Miami official blessing can we bring Crime to react Miami next year am I allowed to go okay well sure cuzz sometimes some conferences may or may not have mentioned in their code of conduct so I just wanted to verify cool there will officially be at least two mustaches at react Miami confirmed more T talk keep the Tain talk on the DL keep the what talk it's a react conference it's going to be mostly about the paint exclusive taint right oh my God like you guys waited your whole life to say this word as many times if you said it you're so much joy in saying we grew up watching jackass absolutely we needed this this is the problem is that this is why companies can't do this okay cuz now I I find myself abusing the taint which is just completely inappropriate to even say did you see Sebastian's reply to my tweet about it no tweet about it to be real just like I just screenshotted the like like the part of the post that mentioned the Tain for the first time and he replied I see my marketing strategy is working thankful one name could get us to start talking about security this was the plan the whole time and he succeeded we are now regularly talking about Security in the new f model he had fullon fullon 40 chest that one yes he absolutely did it's that even a native English speaker too that's the best part I like that now that I'm here I recognize people from their Twitter pictures every now and then someone walks by I'm like I recognize that guy yeah I don't have that problem I don't look at all like my Twitter picture anymore I need to retake it you mean cuz your hair is a lot lighter now the hair is lighter and mustache yeah yeah I'll fix it eventually just need to make sure the background color stays you recognize me yeah it's a good color just smell like that yeah that's all you got to do I'll just switch to your picture there you should have changed your profile picture on YouTube to tease when you were gone that would require me to do actual work that's fair it's a good joke I don't me you were creating earlier you were working okay I was I know well I was I I was going to try to find it I wanted to find a good little online program to just do a little paint on his phone like doing trying to like so I could just say I am not going to mention HTM X and so that way I could just like hold it open and just say I'm not going to mention it not going to do it doing our best poor is Warren even alive after all that is Joker gifting 25 Subs right now Jesus guys you're going crazy we appreciate the support so much so many Subs trash do you know what that's like comes sit down yeah he has no idea when's your talk trash yeah when's your talk can we react to your talk oh it did I thought they only had one uh screen though this year didn't they Oh Oh I thought they were only doing one stage this year my bad on that cool well I I promise we'll go back and watch your talk eventually I don't know if it'll happen live or not but was it good okay okay according to trash talk was okay so if if we have time for some okay content we might get there that sounds pretty exciting I I would love to watch mediocre content yeah yeah I want to watch watch it I didn't realize we missed it oh it's on yeah you can kind sit this one's on yeah trash come sit down yeah honorary speak I don't know I'm going to say this brownie is really good that's all I really wanted to tell you guys I appreciate that we're live right now brownie trash do you have any brownie in your teeth you good huh I don't want to are you guys live the whole time yes we're actually on the screen in the big room right now sorry you shouldn't have said that now I just put brownie on my teeth yeah got it every everywhere so good knocked I didn't know we were on the screen you okay nervous now that you're on the internet down as they were putting us on the big screen so I didn't actually know if or when it would be live which was fun but uh it worked out it all worked out yeah the teams working really hard to keep us online and get this all working I proud of the setup and how well this is all maintained especially with the chaos of like the noise levels and everything going on hey what uh what time is your talk I have no idea I should actually probably know the answer to that I will go check my guess is that uh the internet is really hard to run particularly here considering hey you're using up a good amount of bandwidth right to upload and there literally is 1,000 cell phones all connected to the same all trying to pipe through the same watching the stream hey look at that that sus yeah I so the uh yeah this is just for the main stage so I don't St no I think no one watching the stream can see us do that oh yeah yeah nobody watching can see us do this I just want to find look it's clerk. Dev when my talk is going to go when you're talking and prime it is that it no I didn't realize that the oh is there schedule button cool that's actually a good thing to click on yeah wow we missed a bunch of stuff yeah yeah that's because we don't get to we don't get to see them all we only see main stage oh there at 212 the things versel won't show you so uh for whatever reason not only did verel invite me to be here for this they also invited me to give a talk about the things that they won't tell you about nextjs so uh there's some fun cursed patterns in there things that you probably shouldn't do but I'll still you do so I have a quick question if there things that versell won't tell you but they invited you to talk at a conference about the things they won't tell you are they telling you to do that no that kind of sounds like a passive invitation I'm telling them hey by the way we're not say to do this but come on and tell us about it one of the things might have been from a versel employee but when said versel employee showed that thing to the other versel employees that actually make nextjs the response was wow that shouldn't work please don't do that so I'd recommend doing it yes if enough people do it it will become a feature just like rocket riding in fortnite it'll be fantastic yep that paper sounds real good trash yeah thanks trash Oh my God amateur content creator sorry learning your best yeah you're not you're not this is the real stream experience for anybody who's watching this right now on the big screen you've never watched a twitch stream before it is just this this us eating and making jokes at each other and occasionally bringing value I'd say like once every hour or two yeah I'm full of value yeah full of value value he's normally full of gummy Lifesavers but tonight it's value was that a center piece or was that an edge piece that you just had it was definitely not an edge piece it was pretty soft pretty soft it was good you had full Center it kind of tasted like full Center is pretty squishy you know the trash theorem right which is within at any point within 4 days there will be a picture of a brownie with the center cut out of it that he will upload on Twitter there's like a 4day period of time where you can always find one slightly more painful every time eat like kings baby Kings eat just the G we call it the G-Spot at home it's the good spot no it's no it's the good spot you don't that's not it's not tainted at all the double corner is the taint whereas like the center the gooey the good M someone said trash is my spiritual animal H trash is I would not age notal feel that way like wow I think that's oh we're we're bringing the claws out dunking over here yeah I personally would not agree with that stat person would not agree with that makes me feel slightly uncomfortable should see if there's anybody else worth bringing in for a quick chat it would actually be cool to grab some of the speakers to talk about their talks that would be great and also trash I guess no trash you've we no I hyped it up I already I hyped everyone saw it I hyped up next Jaz baby you know nested rout to be honest I mainly use the um app router for nested routes nested routes was just like something that just it just made everything so much easier with it you know it is Ryan but I also call I also called out that I like config configs better though yep you know there's part of me that likes configs better you know what I mean mhm I like a good config file you know I realized that no matter what you choose it always always slowly devolves into something I dislike yep that's pretty much my take on anytime it comes to routing yep I find with conf said something you like leaned in like that's too hot too hot too hot I try to lean back so you guys can you know make that lovely eye contact so I'm in the middle I I find that configs like starting point is slightly worse where like a basic website it's just kind of silly that you have that all in a config file and like file based routing makes it easier to quickly Gro like what is where M but once things start to get really complex the configs carry you much further there's a certain threshold where everything sucks but there's a decently large window between when configs like between when like file based running gets chaotic and when configs get unmaintainable I try to avoid hitting that point at all costs yeah try to make it simple my goal is to be simple enough for long enough that tan stack router is stable by the time I hit that level of complexity I'm excited no I just took it off for you cuz you kept trying to put it on yeah I wasn't trying to put it should I put it on yeah everyone was saying who has the bigger stash M 100% does not want to put that on I think I clearly have the but she's feeling the pressure now yeah caving to Pure pressure upside down I don't know me see yeah that's the right way you're good yeah that's all right who has a bigger mustache me or trash Dev go one in the chat for me two in the chat for trash Dev let's go oh wow it's huge I got a whole bag all right trash you you've won you grab your stash You've Won with your amazing stash my stash is on my name tag we're live right now so okay how can I ask a quick question so uncomfortable how do you guys like aren't you like itching your nose all day with this have you ever gotten used to something ever gotten used to something yeah you I guess have to get um yeah I guess so yeah there you go do you think about wearing socks around it's like always touching your body and stuff and weird and you just forget about things you know I know that was like math I just mathed you so hard Get Wrecked just genius uh I'll take this back you bring someone else on find we can find Michelle yeah I wanted to bring the speakers who we watch the talks of so we can talk so we could talk while we talk and react while we react you know yeah that make sense doing our best okay okay I'm just reading the chat sorry never read chat okay reading the chat me and Prime were meant to be the ones who know nothing about next an attempt was made that's fair okay that's fair I have used next okay Theo taught me next yeah and then he showed me T3 right afterwards and was like look how much better all this is the next I remember that happened perfect looks great now we're talking perfect the new the new3 stack Tain in it looks great T4 now T4 yeah T3 plus taint is that T4 I've been using next I feel like next has become like how you know as a front end of you had to learn react and now you have to learn next like it's becoming like that in terms of new people coming in you don't have to keep it on staying an attempt was made we we appreciate the effort do people are going to say the following phrase well I learned the next before I learned JavaScript am I going to hear that phrase out of their face Tri by they are it is is becoming the thing of like yeah re next learn immediately my hot take of why commit soku if this keeps going on my hot take if I actually really like people learning react through next is that you shouldn't just be thinking about the front end when you're learning front end like like front end is built on top of back end fundamentally even if you're just serving an HTML file that is being served by a server of some form and next isn't pretending that the front end lives by itself anymore so you are inherently doing a little bit of backend even if you're just using NEX as like a front end Builder you're at least thinking about it now and thinking about that relationship between the parts more and I think that's almost always a good thing my wife while we were at twitchcon called me up and she had a whole group of people on the on the phone okay there was at least six people and they were like hey hey we have two questions for you the first question was who hid the Bitcoins and I said B Maria and she responded with well you to mind them and get them out so who put them there to begin with it was the most adorable beautiful question that six adult human beings ever asked me in my lifetime the second one was when I go to amazon.com where does that go natur understand you're going with very confused it's good to learn about a server okay full circle okay it's it's good to learn about a server but I really just want to mention the who hid the Bitcoins cuz it's my current favorite thought that I have on the regular I kind of giggle to myself every now and then like someone did hide the Bitcoins if you think about it oh Prime I actually think I started using next more when I watch that video that you did about create react app ah oh That's a classic and that's when I really started going into next I forget about that video it still gets a decent number of views that was that was a while ago I did not know how to YouTube yet that was like an hour and a half long for a video that should have been 10 minutes lots of good stuff about the you know crate issues I seeing if I could throw off the focus I've been noticing it's going me and trash own side combo right now sidebar side sidebar I would have manual focused if I had people here sitting in the seats when I set everything up so I got stuck left on auto for it that's okay he just said you're really late yeah dude I was late I walked in at like I okay I K you I was standing out there I could like see into here and I was just like yeah I got to get in they're like where's your QR code I'm like what that's so funny because I just walked up and I was like I I'm on the live stream and they let me in immediately but then when you were talking to that guy and we came and got you and then the security guy he was like why don't you just tell me that in the first place Prim I don't want to be one of those people like excuse me I can't be dealing with with lies and [ __ ] I I'm speaking get out of my way like so I was like I got to like participate in the QR code I didn't mean you had to do it like that you you could have you know it's perfect timing I should have just walked by said nothing I have a real question now related to why we're here yeah okay this one's for Theo Okay so if we want some of to learn next JS obviously they need to learn the back end because you know API routes Etc do you think it's potentially too much for a newcomer to kind of grasp one react at its ecosystem then on top of that whatever specific to nextjs and then on top of that the whole back end stuff I think that learning fundamentals and building are different things and the problem I saw previously was that people would try to build the thing with just create react app and then quickly realize oh I guess I need one of these backend things what is that that's how we ended up with the Fire based chaos that we're stuck in this day far best reference called it yeah I think that like they just announced the nextjs learn portal we already have the incredible react docs and all the resources and stuff around that I think learning react and learning like the basics of anything should be a separate process from building with it once you've learned those core fundamentals which you should do on a website or a tutorial not in a project that you've scaffolded and built learn those things or even have a tab by the side that you're going back to as you try building with those things do I think you have to learn a lot of things to build a full application yeah but how much of each you have to learn depends on what you're building and what you're doing and starting from the point of having like I want to build a calculator for my World of Warcraft Guild or I want to build a website for my Minecraft server or I Want to Build a Better portal for people to check dogs into my local vet when you have the thing you want to build starting from there trying and then seeing what you don't know and what you need to learn more of and then going and learning that tends to be a much better process overall and with next yes there is more surface area you have to think about CU there's a back end in a front end now but it comes with the benefit of you now know where those two things are and have a better point to Google search from so makees sense yeah yeah I do think with the new RSC Paradigm it is kind of hard to understand at first where that divide is between the front end and the back end right use client That's Where It's At use Cent this is the uh Firebase chaos that you're were talking about oh God uh Google's a partner of verel so I will keep my mouth shut for now yeah I was say is a professional stream okay I've made no dick jokes today feel free to go through my go through any of my videos about databases or platforms and you'll hear plenty of me talking about Firebase so so this is something I've always been curious about because now we're kind of in the day and age where people how they learn is through a very practical means right a lot of boot camps a lot of like hey to get started we're going to start by you know moving squares in JavaScript and launching a server and express or whatever you know whatever soup dour of where we're at and now it's nextjs um I always wondered if it is a nicer path if it's better I'm not saying it is or isn't the whole university rounde is it still relevant today is it still good yes obvious some people just naturally do better in a 4-year program that's just like hands down right but I also learned how to program via Java but nonetheless I still Le Java I still learned how to do it and built like a terminal app and so there's not like I didn't have to know what a server was or what a request is I didn't have to even think about how to get the datas I didn't have to think about encoding and decoding and you know like there's there's like thousands of steps you have to do to just do anything where it's like I kind of got all of that slowly over time and then it just felt so easy to make those transitions because I was like oh yeah server I I know what that is I took a Linux class I think the value of University isn't just in like learning how to code and like these specific classes you take and all that like blackout drunk I I learned how to code before going to school but I got so much out of my time in University largely like I also I dual degreed in audio engineering and software engineering which was really cool I got a lot more of my audio program overall but more importantly I was surrounded with peers that were in a similar place like just talking to programmers every day working with programmers having them like just surrounding you and being that deep that way for four years during like what are the the most important Windows of your life from like like 18 to 22 that's when you're like most primed to learn most primed to make friends and to this day like half or more of my closest friends are programmers I met in school yeah that's fair take like my CTO and roommates I met at University most of my investors for the first seed round at ping I met in University these connections go so much further than any piece of paper ever could and even if you just go for a year make some friends realize it's not for you and you want to have a job and drop out a plus totally fine the value is not just the degree it's all of the opportunities of being surrounded by other people doing the same thing at the same time there's definitely a multi yeah there's definitely obviously you can achieve anything without a degree but well not fair you can't become a doctor without a degree but in programming world you can pretty much achieve anything you want without a degree but there is definitely like a multiplication just having the same people that's why I recm frequently I think TJ might have been the first person that pointed this out I know look at me I'm giving attribution properly uh which is that if you want to learn a new language a great time to do it is advent of code because Advent of code there's like 9,000 people also all learning a new language at that exact moment and you guys can all do the same problems on the it's like it's like a mini University field for just a moment and it's it's super cool what about the people who are you know maybe over 25 and you're still thinking about that question because I do feel like there's this big debate the question of do you need a CS degree to be a developer I think it's easier yeah yeah if you're struggling to find community and like surround yourself and other people who are coding and learning to code something like college can help a lot with that but like don't I I would never recommend a remote college that would be very hard for me that would ruin every aspect how do you think it's really interesting because it's debate of like do you need a CS degree to be a developer and then you have this one side that's like yes need a CS degree to be a legit developer you have like this other side that's like you you know you don't need a CS degree and that's gatekeeping The Gatekeepers right but I think it's really interesting because I feel like what we should actually talk about more is that computer science fundamentals are helpful one way or the other and you can learn them even if you didn't get a CS degree and I feel like that's what a lot of like the self-taught crew like including me were missing for a while is actually like understanding what is happening beneath the abstraction that you're working on and like digging into that that's why I've been learning some C someone in the chat just said said that but that's literally why I've been learning C just trying to understand like what's going on beneath the hore like when you learned JavaScript for the first time I didn't think about memory or what's happening and then you learn that in other languages you actually have to manually figure out allocate your memory and I just think it's so fascinating to you know Peak under the hood like that will make you a really good developer so in like the whole debate I feel like that's the part that's missing like we need to focus on that more and more curriculum for that more video you guys both rent about this a lot and yeah I I actually really disagree on this point I think that there's two pieces that get missed a lot so that's one of them but the the one I think is more important and you've done a great job of working through this is surrounding yourself with peers that are in a similar point of learning like learning how to code alone sucks not just because learning how to code is hard but because you don't know how much success you're having how if you like you're keeping up with others and I've known developers who are some of the best developers I've ever talk to that feel like they're falling behind because all they're seeing is like the three influencers they follow on Twitter who are doing crazy stuff all the time they don't have peers that have been programming for a year that they could compare themselves to and work with and learn and gauge their own learning it can feel very very lonely and isolating to learn how to code and you've done a great job with this with everything from your book club to your like involvement in all these communities and stuff like you don't even see this to a point because you're just hanging out with us anyways but the average developer especially those getting started are very lonely when they get started yeah I could see yeah yeah oh one one more thing that's positive about college is that it has Career Fairs yeah you know people like right now you TR try to just cold turkey all those different jobs hoping that you can get your first job by you know applying to 10,000 places you probably will eventually but it's way way harder whereas at a career fair at a university you walk up and you're like hey I'm in my third year they're wanting to talk to kids in their third year and then they're also talking to you can talk to them right like just even having a conversation that is 10 times more valuable no matter how cool your Twitter is your GitHub anything they just get to see you and go oh I like that person yeah yeah let's get a resume hey yeah let's let's get you in for 15 minutes and then all your other stuff just multiplies yeah and so that's where it's like I don't know I like that so interesting because I I think a while back I wouldn't have expected you guys to have those takes like so much more Pro computer science and it's not a very popular take on Twitter it's it's one my popular vide G keeper you're gatekeeper if you say that that's because Twitter's filled with the stupidest people in the universe the problem is you can only you can only form onedimensional thoughts on Twitter so if you say you need a degree then naturally people are like well technically you're like I mean yes you don't Tech you can't explain all that in a tweet unless you're going to be the person that writes those gigantic expanding tweets nobody likes that right I don't I've never written a tweet beyond the character like it's no one reads those right but I agree with you as point that learning to code can be very lonely and unless you have some sort of community you're falling off and unless you really try hard to be online a lot I don't know I guess that's what I did I used to watch your guys' YouTube videos now I'm here so yeah it works from the bottom but most people like like one of the hard things you have to deal with in that scenario if you're meeting these people online is that you're meeting the people who the people who are the most visible are the ones who are the most successful and keeping up with them is going to be incredibly hard keeping up with these guys oh my gosh I mean and that's great cuz I I don't want to be the smartest person in the room I want to be around developers who are better than me so I can get better and just like you know tonight everyone's having a drink and I can learn and listen but also it's hard to keep up yeah can I ask a question yeah would you leave the room if you were the smartest person in the room would I get up and walk away right now you mean no I'm just kidding um you know that phrase right don't be the smartest person I can leave if you want me to I'm not accepting that even as a joke look at when I leave the room if I was the smartest person in the room I had to I'm sorry okay I always hated that phrase sorry I know we're kind of tangent in here I love that phrase you ha it uh point do you stay yeah because the problem is is every room would have to be empty yeah because everyone leaves because everyone would eventually have to leave everybody is smarter than somebody else in some way yeah I mean that's the real answer is that being too smart is multifaceted but nonetheless like if you if you really applied that rule judiciously there's sometimes where you enter a room and you just are the smartest person in the room because it's just like Hey we're going to talk about the thing you've done for the last 10 years and you're like I'm really good at the thing we done for the last 10 years it's like yeah I just don't you know I don't you want that person to stay in the room and teach others if they want be helpful every person has ability to multiply a problem and it's just like I'd rather try to make people more multiplies and less I'm not trying to like [ __ ] on your favorite phrase or anything I just I just personally want to [ __ ] on that phrase okay I don't care makes me Ang I get it I get it yeah there's something about that concept of just always be learning from you know surround yourself with smarter people and then you will grow kind of like the College Point that Theo you're making yeah okay yeah see all of M I find that trying to teach someone a topic you know makes you learn it better if I want to get smart at a topic I don't try to find people smarter than me I try to teach people that are less qualified than me I just make a YouTube video where I use it incorrectly and read the comments that's also one of the single greatest ways to learn is to say something wrong on the internet you guys feel then about learning something and teaching it as you learn or like you know you you just learned this thing and now you're going to be immediately teaching it Poss that's when the is the freshest like if I was to teach next right now it would be much worse than if I taught it a year ago and I was much deeper in the weeds with it building with it every day but yeah I think it varies a lot depends on the goals like how definitive of a resource you're creating I like something I've got feedback on a lot is in a lot of my older like tutorials that weren't tutorials it's just me building live people loved that they were watching me debug and deal with errors but now that I'm planning my tutorials ahead an actual planned thing way fewer mistakes I'll still intentionally bake some in but it doesn't feel the same and people definitely notic the difference there there's a lot of developers who it feels good to see what it actually looks like to work and learn through a thing so if it's a resource in the sense not that like this is the definitive way to learn HTM X but this is me learning hmx with you so you can both learn the framework and you can learn how I learn things that's a whole different experience that can be very valuable yeah I love when I see you guys solving a bug live on stream let trash talk oh sorry trash go ahead oh no I have a lot of thoughts but I'm not going to see wait I'm like I'm still on the college part in my head I'm like do it I'm like empty on the inside really is what's happening of the things I want to say but I'm com no no so we're going to rewind to the college part I would say I'm telling to lean in okay I think at least specifically in America college is a privilege so it's like not everyone it's not accessible at least in the US right so it's easy to say yeah you should go to college and get a degree but the reality is in America it's extremely hard right like like in Europe and stuff I think I don't know from what I hear it's like free in some cases I don't know talking to like Julius and others it's like considerably cheaper but in America it's like for State University is like three grand a year that's where I went yeah so like back to your comment about like you know you could potentially go to a career fair right but I will say like companies do handpick pick you know those schools right like IV League etc etc which are like known for just being insanely expensive I'm not saying don't get a college degree but I'm speaking specifically in America it's just like you know it's tough It's for sure like way ever it's way tougher I'm actually much less for the like spending the big money to go to the big school that's not something I recommend very often at all and the career fair isn't one of the benefits I push for that reason what will happen though is one of the people from your state or local school will end up working at a cool company through like connections they already have or friendships or whatever and if they remember you as one of the peers that stood out in any way shape or form you will get that referral and the way you get your first job is almost always a referral it's so hard to get that first gig otherwise I agree with that but also like the internet now assuming you're like a somewhat outgoing person or extroverted you can make those connections online through open source and etc etc it it's it's easier said than done 100% but I will say you can definitely go that route if it's if you can't go the other way right if you go to planning to go for 4 years and then that route ends up working out in your first year there's no shame in dropping out I think that like the default like the the base recommendation the thing we the same way we say you should use typescript it's not because you shouldn't use JavaScript or you shouldn't use rust it's it's a really good starting point and when you're ready to move to something else you'll know and you'll make the right call I think you should go to college if you're wanting to become a programmer is a similar take where like it's not that you should you have to get a degree or you're not a real programmer and it's not anybody who doesn't go to school is irresponsible it's the base starting point that I recommend if you're learning looking to get into code and you can go to university you should start there and if better opportunities happen you should take those better opportunities and if they can't I would say join your Discord server right yeah hell yeah got a lot of people in that disc what we're talking about um yeah I I mean I was getting a masters in ml you may have heard of it pretty popular topic these days and I dropped out to work at n Netflix I you work there gross yeah gross trash kind of like Hulu it's just it is literally just like maybe like a like a kind of like a little brother to Hulu so you got the opportunity when you were in school and you decided go work at Netflix I said f that rack and went straight to he's like give me that back baby I didn't pause it I did not pause it I threw it in the garbage yeah I think that's the right call I you have an opportunity it's more exciting than college and you've made the connections you want to make ready to move on can always go back too yeah it's there forever yep that's harder that's that's not a real thing um I feel like I would do better in college now at my at my maturity level than I was C thank you CD for the gifts I'm curious about that I'm curious if that's a real a real thing I don't know but I feel like if I went to college now I would take it way more serious and cuz when I was in college I just played video games and parted you know yeah see I was just on the recently quitting meth train so I was I was pretty dang serious at that point so I kind of I went I got a 2.16 in high school and I got like a three something uh 35 36 I almost doubled my GPA in college in college versus high school pretty good yeah you switched to rust rust wasn't even invented then this was like what 73 trash you are old making old people jokes I'm 21 yeah okay I don't have a must Jos is in high school I he's clearly in high school I got to go to I got to go fly to UCLA after this I have a class second most typ safe high schooler mhm here you go oh my shut up Christine L learning shut actually says Christine on his badge it does someone someone's trolling me after cell 100% yeah this is so good I want answers well yeah what's your position classic department head hair stylist that is clearly a it's not real it's not real clearly it's messed up I one of the hosts when I grabbed your panel or your badges for you guys I was so hyped that yours just said Prime she's like oh my God is that like a problem like I was hoping he would go be Co with that like the way that you use Theo I like he's going to like that it just says Prime you're too worried and I feel like Prime is becoming a thing I never call you the prime I always call I feel like it's becoming a thing it's too long to say the prime one thing drop the the Gen well first off I can't get that that handle that's like an impossible handle to get wait what what handle Prime Prime oh it's impossible yeah it's like trash it's like a basic word of the of the language wait someone said why are they ordered by height o yeah uh should we stand up okay I can't I can't keep that position your gorgeous hair is adding a little height too it is it helps it does I was already tall extremely tall yeah it happens do this to myself we have another 20 minutes I think of being on the big screen before they cut back to the real content nice I'm glad we could not entertain them for this log I I I would check the viewership but I'm scared to see the number don't check it it's not worth it hash it's not worth it they're still getting 800 on the live stream so they only went down by like two 300 so that's nice yeah I guess we doing well on theing someone I my twitch what's twitch at 1.1 oh not bad especially since we went down twice yeah I know hey that's pretty that's pretty neat it's you're here want to be here trash I mean we want you On's in chat if you're here for trash one's in one in chat if you're here specifically please I if I don't know you just please oh yeah there we go bash bun yeah bash bunes is this what it's like to be famous this is oh Jacob see Jacob wait he's putting zeros never mind yeah he mistyped and put a one I just realized Sam Lambert was texting me letting me know what when we were down that would have been very helpful for me to have noticed earlier all right I haven't actually tell us about your book club oh sorry I let trash talk let trash talk hash it hash that no I my book club uh was started when I was learning to code and it was very lonely like we were talking about you're just I was by myself you know living with my parents at the time trying to learn to code sorry keep dress short is very funny keep dress short and uh so I started a book club that eventually got like we have like 10,000 people on our Discord but it's still ongoing weekly now and we've read like 10 con books but we also do like leak codes and things too because you know there's a bunch of people on Twitter or in different discords but actually meeting up on Zoom is like people really don't do that as much like you know actually trying to have some sort of real interaction where you're talk speaking you know writing code and things like that so yeah it's all about trying to create a community if you didn't get the Cs degree but you're still trying to learn this stuff yeah we were just reading uh cracking the coding interview super famous book you like trying to go I feel like I feel like there might be some bias there with that book yes it's a it's a great book though I can't tell you how many interview problems I've had right out of the gates of that book do you got a commission from your sister no no no she she's on I wish that would be cool it is a good book though it is a good book I abused it all right followup question which is all right so I'm new to programming I'm looking somewhere to be first off Theo why haven't you linked her Discord Link in the chat second off I can't how do I jump on to this moving train is it is it really just joining the Discord is it moving fast do I need experience what does it take actually it depends on where we're at in the books like in the book series so I think like right like reading cracking the coding interview I wouldn't say a beginner should have joined that one cuz should you as a beginner learn algorithms immediately but we've done other beginner friendly ones I don't know I know you guys have opinions on data structures and algorithms but yeah one more question do you accept people who struggle with reading I know Prime's been looking for a group to hang out with do you have like are you are you guys going to read the book like cracking the reading out reading out loud thing reacting to the coding interview re okay here actual question do you think the books are helpful like within like this specific like scenario of you all meeting up weekly like what's keeping you accountable like like do you find it you think it's been like working in general so I think in the beginning so we've been doing this since 2020 it's been a really how many years is that um we've been doing it for a while I think that oh no I'm seeing Fs in chat is the stream down oh no is the stream down refresh no it doesn't seem down back up okay we're back we went down I guess so you guys miss I just told a crazy story if you do coding problems if you just read a book that's probably not as useful if you do the coding problems and actively work on them with other people I think that's where it gets useful but I've run into the problem where you're just reading a programming book and you're not really doing anything right it's like watching a coding tutorial you're not actually really learning you're just watching you talked about this you're watching someone else you got to ad code it up yeah sorry adventive code is incredible and one of the best resources for but like the amount I have gotten from Advent of code as a single thing is just absurd do you have a video on that I I have a couple but there actually I think one is yeah I forgot what spefic like this programming challenge made me a good programmer or something like that that I put out end last year when I was doing it I I love those challenges for those who aren't familiar Advent of code is a yearly code challenge that starts in December for the entire for December 1st the 25th like an advent calendar like the little thing you take chocolate out of as a kid who celebrates Christmas and the Avent of code challenge is a new prog problem gets released every day at around 9:00 p.m. Pacific Time midnight eastern time and when that problem comes out it has two parts and you can only see the first part you can do whatever you want to solve it you can write code you can do it by hand this is one person who does it in Excel you just have to give the numeric answer that's based on your unique input they give you a long input you have to process it do whatever you want with it as long as you get the right answer you get to move on to the next part and when you're doing this there's literally hundreds of thousands of other people doing the exact same problems many are doing in the same language many are doing in different languages many are doing it in the craziest ways you can imagine but it's this huge community of people that are solving these really increasingly difficult problems in increasingly unique ways and it's such a powerful way to improve yourself as a developer work with other developers solving problems in interesting ways and just do cool stuff I usually like to solve about Days 1 through 10 for me I know you go all it's masochistic by the end but I do the whole thing every year I think if if you're looking just to gauge if you can be successful in an interview if you can get through 1 through 10 that's like a pretty good way to know I I can do like other than getting completely blindsided by question I've never heard of and I have no idea the data structure you're going to just kind of go through I AG nintend to 12 is like the sweet spot and after that it's like man you're just so hard it's just I can't even like my ad I'm just like reading halfway through I'm like I don't care anymore most years they'll usually have like between five or 5 through seven there will be one that's just like way too hard just to throw people so Ted it's always tedious ones to which just like there's 19 States and you need to make a combinatoric of all of them in COD there was only like two or three of those last year but uh the year before had a lot of really tedious ones there was one year where they had a recurring uh forgot what it was like you had to make your own assembly interpreter problem would make you continue iterating on it so you one day it sucked so they haven't done that since thankfully but yeah that was my favorite cuz that was actually rebuilding the int computer on the Apollo whatever and you're like effectively rebuilding what NASA had at one point it was super cool it was awesome that was yeah the op code one dude that that was so I I actually wish they did that again where they actually had like a progressively harder story over time oh man what that message say go I'm 11 years old teach JS so fun twitch fact even memes like I'm 12 what is this will actually get you tossed banned for being 13 or under on the platform so be very careful when you make jokes like that I've also kicked somebody out of a Discord because they're like I 12 or something like that I'm like you got to go so in order to get your Twitch account back if that happens you actually have to send a picture of your ID to support and if you're 14 good luck with your ID yep real loser yeah it's location oh dang you're 12 get the hell out of here dang guys anyone old AOL days you guys are all young oh yeah I know see you're old you're yourself I'm normal ASL I'm normal baby what's normal uh somewhere between me and prime a value that is one would be normal you got your energy back you had your coffee you calm I know calm down I know I'm star I'm starting to get a little juicy I need to find some caffeine at some point I'm dying out here straight over there I don't drink coffee though Jamie give me some give me some lates there lates up there I need a tea what's your favorite tea if you say some regular ass tea you're not a real tea drinker I'm not a real tea drinker I'm a caffeine hunting teabag you what is it what do you like Earl Gray or black oh I was right iink black coffee like a don't drink coffee not a coffee drinker so just only tees pated tees yep I don't normally have too much Ca honestly like a British cater they drink they drink yeah Matt poock and I are the the two the two British typescript guys once you get good at typescript you start finding yourself craving Earl gry y that's how it goes you just start writing everything and like suddenly grow hey speaking of typescript and te's and all that when's your site coming out oh re Early Access baby typ hero. death typ hero. what the hell's type hero. death it's for masochist that like typescript it's basically leite code for types okay lead code for types okay so if you know an Fu who's done like bjz all that stuff he has the type challenge repo yes so Matt poock got me on that and I got addicted for like two months I'm just doing type challenges yeah you were live streaming them for a while I was I was live streaming doing type challenge remember that I was doing like type challenges ripping I was addicted and then I went to trpc I was like I got to apply this to real world so then I found TPC through Theo and I was like let's see what I'm made of and then and then I was like you know I'm just going to make a whole ass website here we go he made an assas website if you can believe that remember the type challenge I gave you that we just evolved and did build bug with the bug yeah good times did you hear oh sorry keep going I I had one hard typescript problem ever I had an object that would take a validator that had like a type signature and it would also take an action that was a function I wanted to infer the input on that from the validator in the same object but uh backwards inference in objects with keys just straight up doesn't work it's entirely broken and it's like the one time I need to do a somewhat hard typescript thing I was like there's no way this is this broken like I I have to be doing something wrong here so I posted the snippet I had trash I had a couple other like typ Wizards come in they were going back and forth for like two weeks on it until multiple issues were filed on typ SC I think somebody put up a PR trying to fix it but like it was that was chaos can I tell you a story now sure I haven't watched SL rdit I don't even know if it's a video or an article but its article name is I made Flappy Birds in typescript types oh man I know so I'm just like I got what is what the hell is this I got to look at it I'm scared there's also the other one where he did um the something of Life problem what's it called there you go sorry my my head keeps coming up someone did thatt I did in HDMX what HDMX mentioned Warren buffering drunk oh my God I swear you are HDMX I have a serious question for Prime yeah are you ready did you this microphone that's not yours oh does it stink no but I have face on it no no Tanner Lindley was he did put his face on saw oh it smells like T when you when you smell it SM just smell because it's all brand new so it has this really it has that new electronic smell and there's just something so amazing about new electronic I hate you all so much gas some people think it smells good some people you say gasoline gasoline yeah what the hell you like SM gasoline some people love the smell some people don't it's not bad I do love the not I can lose all my brain cells I just want to sit there and draw my own mustache and Sharpie just to enjoy that oh my goodness just be like eyes roll just it just immediately filter out anybody who say they like the smell of gasoline they can't be trusted I agree with this I agree with this phrase my mom would let me smell a Sharpie hold on I know that sounds really bad but she said just one smell cuz it causes brain damage if you do too much so I just just one smell cuz then I wasn't too curious and I didn't run away like smell like 9,000 times yeah she's just like just once but you can't you know oh man I what are we talking about right now huh good parenting technique I could see it yeah it's actually the same way I recommend using unsafe and rust exactly just use a little just once get a smell just remember that one time that Prime taught us rust on Evan and code it was awful that was so hard God I was using Vim though and you were proud of me remember that dude hell yeah God that's when you were on his stream right he was on my stream by the way Superior streamer the better Netflix stream by the way by the way uh I'm not a Netflix stream by the way I'm just a regular ass regular regular regular so Prime was teaching trash R yeah he taught Theo too uh trash was much more receptive uh clearly great coder um clearly Theo loves Elixir yeah I really I am Elixir curious my manager's Elixir div and he just keeps like Shilling it to me in my 101's yep we I was like man I'm Elixir curious yeah I it's funny I I have now coded in typescript significantly longer than I like did my Elixir production stint but I still miss it every day it's an incredible language although I did take down production cuz I used a lowercase p instead of an uppercase P once CL small P mistake that's small P energy right there he can tell right away small P Pi go by the way it works what what what what I need a I need a cafe I can show you where one's at we have six minutes guys you can you can hold together for six more minutes oh we got this we absolutely got this you are you sniffing that microphone right now you are I'm like in an internal struggle to know what I can I can't say cuz on my stream I say messed up oh yeah no you can lean pretty far into it I've leaned in PR last six minutes what are they going to do it's a good point you got to be who you are already you guys hanging out tonight I have no idea what I'm doing tonight I have to get all my equipment home somehow some point but other than that I have no idea what's up yeah what's up I don't know after party I think after party yeah potenti at the hotel lobby uh Prime and I have to film a video with GMO in a bit oh we do yeah oh yeah we do yeah we do we know what it is about oh yeah this thing is this thing is going to be a 10,000 like this is be big one 10,000 yeah after last year and we have to do the same thing again which where we each do the thing yeah you know what I mean AB what I remember last year's which was like uh CEO of vercel destroys open source Dev and it was you guys playing ping pong and you sucking at ping pong uh I won that game by the way did you yes cuz I let him get nine points on me and then I beat him from zero all the way to 10 you did do that I had the hot dog him I hot doged the poor man he had no idea what was going on the hot dog what do that mean yeah no I don't know what that means either I genuinely don't I I I don't know how it happened but I decided to start using the term hot dog to like replace it with Bamboozled it's just is such a funny phrase to be like I hot dog that man they're like whaty it doesn't even sound sexual but I don't even know how to like like take this in right now it's confusing that is confusing it is super fun yeah I like using words that almost sound right one of my favorite phrases is by cam from chat if Cam's ever in this one uh he'd say left-handed cigarettes it's just like those like little phras that like kind of kink your mind for a quick second that's the point there is no such thing as a left-handed cigarette Oh I thought it was like cigarette smokers know this no no these are left-handed cigarettes you can't have just like there's something so funny about a good one appreciate sorry my oh my goodness what is this thing so apparently they originally had planned to give us a folding table like a crappy like I'd rather have a folding table than a table with wheels honestly yes but I'm like they don't lock they should lock yeah those ones might have gotten unlocked at some point I can deal with that later but I don't care enough yeah the uh apparently the other table that they had didn't have any way to mount the mics and they didn't have like normal freestanding mic stands so this is what we ended up with I'm happy that we pulled this together in just a couple hours we were not ready at all before I had to bring I had to take multiple Uber trips to grab a bunch of stuff for it worked out hold it off see everybody yeah it's weird just being in the middle of the room doing a podcast while everybody else is like around people keep coming up like yo CH I'm like I'm literally live right now I'm sorry no one said that to me literally no one said know not a single person Christine so no one knows who I am either yeah who's the girl who are you I'm the yeah you're you're who's that that girl what you guys doing with right that's twitch chat right now is this oh my God you're the real girl you wouldn't understand oh I know this I don't understand what I'm saying right now legendary goang developer yeah you may have known bash money right here we miss you bash money wish you were here we were going to get ready to get our Madison command in YouTube chat so oh yay thank you yay what does that mean when do you do that that's an arch user shocked that there's a real girl a real one wouldn't understand yeah I can't relate I've been on Macos for like eight years yes I I could start talking to my mom again because I went back to Mac oh nice yeah yeah I still can't I don't have audio rip you'll get working someday I heard ala is doing okay nowadays right is that the one I have programmed a little bit of the Elsa uh driver and uh I actually got audio to work by using C and and actual ala but using Linux and just playing it with like a headphone I just I struggle sometimes I feel like there's more people who have contributed to Ala that have actually gotten it working reliably what is ala salsa without another Linux sound something no he's right it's just salsaa salsa without I love salsa on chips is that the topic it's Salsa Salsa Salsa Salsa spicy Elsa is that some spicy Elsa jalapeno Elsa I can go all day I keep is that habanero Elsa queso and Elsa y'all can't be stopped do we were in the partner Lounge at twitchcon or we were just saying the same thing for like 20 minutes there cracking up is that Pico DEA or alsa dude I want ala these Al alsa the nuts oh got we made it so long ladies so long we've been on the stage for like an hour 20 just L up the first D not I know I've been wait no you did have I thought there was one earlier earlier there was one earlier but it wasn't on stage it was just yeah this one this one's put her on stage okay kind of a big deal the chat we are all primes away are you guys all here the whole until the end of the conference wa what I don't know when the conference ends but I'll be around I don't know how long we'll be doing this for I'm honestly probably not going to go too much longer after we're off the big screen but uh I do think we're about to get off the big screen so one last thank you to next comp for having our chaotic little crew here if you're not already familiar I'm theot t3g search theod Dev you'll find me this is Madison kna with a k k and and a we have the primagen who you don't need to look up trust me it's for the better and then trash Dev who has a really silly face on Twitter you see like a poorly like Ms paint drawn where sh I need to meet him Shad did not make it sadly no way yeah yahwe that's only reason why I came thanks for for the shout out I appreciate the shout out got quiet once people started moving was insane that was intense but no I'm so Shad now um a good one let's see if we're still on the big must disgusting hey thank you everybody take care if we're still live screen we're still live yes we're no longer live on the big screen for them at least we're still live on our stream but uh all right not on that one are you guys just uh just hanging out I'm want to hang out for a bit I want to get some like water and chill out hey Chad can I say a big thank be a good time for us to sign off I think I'm cool with that before I just want to say a big thank you to Chad for hanging out making this really fun I think it's awesome that you guys all stuck around especially through all the stupid things we've had to say I want to say sorry to Warren buffering for taking 1,00 shots with me saying HDMX the entire time Madison it was great to have you on here I got to I got to have you speak with your diaphrag more though because I know you got to just really get it out there you know what I mean work on that and we I think we all owe one gigantic thank you to Theo for doing all the leg work to make this possible you should saw the email chain we had it was all of us linked on email and then it was just Theo production team Theo production and it just went on for 900 email sorry we could have get you your exercise ball we tried it's okay I I really wanted to bounce but I can't now and it's just sad and then thank you for trash yeah I just showed up I just crashed it I just crashed it I'm sorry no this was awesome what do you mean that's bash not trash Oh wrong bash bunny you know bash Dev I see I see you're you're you made it out here I thought you were sick you're looking a little sick I can kind of see it in you you know yeah what do you mean by that you know exactly what the hell I mean okay I feel good rude trash bunny right on the topic of bouncing I think it's time for us to bounce appreciate y'all a ton thank you everyone and nextcom for having us and thank you to everybody who hung out for this chaotic mess of a stream this was quite the experience but I'm happy we got to do this thank you all and I'll see you for my usual scheduled programming next week God damn it I need to turn this off before they get too frisky peace there thanks again ## Prime and Theo just hanging out - 20221028 yeah anyways no more Echo sorry about that look who I got with us you guys excited hey someone said hi Mark there's Mark yeah Mark's here too Mark made a guest appearance yeah none of you guys follow him on Twitter yet y'all should follow Mark can one of the mods like his Twitter yeah look at this we're together yeah we're at the crew and hanging out yeah as you can see I am not as tall as everybody seems to think yeah I think that's kind of a small guy yeah I'm a shorty oh Madison's actually the tallest see I am yeah I'm gonna take these off so I don't get docks during this one oh you get you have a phone number on there very bad idea I mean it's good unless you're like live all the time I am here hello everyone hello hi no no typescript type script with with me we're just hanging out no programming today no programming yeah no code we want Theo to be relaxed today yeah after yesterday I need it that was a stream God how did you see so I I I I had to bring a new computer that I never like when I turn on Firefox just says it can't play any video and I don't know what happened I'm on Linux by the way I use Vim by the way and so I just can't figure out this whole Firefox problem and so I just don't even I don't even watch anything I saw your live maybe in a few years we'll get audio working I haven't got audio working I actually I actually can't right now I'm playing the music I want to listen to off my phone [Laughter] so I can program and I sounds so cool I am the coolest man alive you need a car thing of what a Spotify car thing not quite it's a unique thing it's the car thing huh it's like the worst name for a device ever yeah people are saying my pants are awesome of course my pants are awesome I got you you can't rip them with scissors you rip them with experience okay this is the car thing it's like a weirdly well made device it's meant to be put in a car but what is it for though playing music oh Spotify music player and it's like a little Bluetooth yeah but how would I plug in my headphones [Music] uh it's just a remote he said it's just a remote yeah it controls something else like you can control your phone's audio with that on your desk who's Madison she's Madison okay somebody already did AJ thanks yeah that's me it should I just want to add comments or uh commands for it feel free yeah I have a very short way see look at this let's sit as tall as you can my waist is actually pretty long now I know you're taller than me that means I have short legs you do yeah you have short legs you have little chicken legs videos the shortest yeah our one yeah where's the headphones we don't need headphones this doesn't make any sense yeah no audio we didn't actually play anything today did we no we really didn't I had like a skid or two plan but I didn't get to like setting them up in time and we're gonna jump anybody got questions hey you got some questions somebody's asking about you forcing me to learn rust there's no Force I'm accepting it yeah you're gonna love it it's gonna be great could Prime work at Theo's workstation probably not December 1st I can't imagine he would like my keyboard too much no and not not only it's staggered okay gross wait so you're gonna learn rust on December 1st wait I didn't realize that we were doing it for like these three I don't know we were just gonna do like old ones as like practice no that's the new advent of code okay are you gonna I'm not yeah not for the challenge when I'm doing that so I'm gonna know the answer but it's gonna I know the answer in typescript no let's just you don't understand Advent of code is the one thing I have I compete I take it very seriously I am there like the second it drops I have scripts for you to dump it in my computer I try to break top 1000 like I I go a ham it's like the one thing I have left to flex on my ex twitch co-workers that I actually know how to code yeah I've won every year three in a row I'm not giving up my title okay do you so do you stream it or no no no nobody's allowed in the room when I do it oh that's like it's a very personal thing yeah that's the one thing I can definitely do that because I'm downstairs the next day I'm very down to like go back and do the problem again and rest but like day of just no I I'm I'm in he said that's the one thing you have yes the one thing that's my thing that's the only thing it's not like he found of a company since leaving yeah nothing living with Mark yeah but March I locked myself in my room to do the same thing wow wait so what is so special and important about it I haven't really heard about it I know it's like a December challenge it's all I know yeah so Avid of code is a Christmas themed programming challenge that comes out every year it's every day of the month of December for up first the 25th just like an advent calendar where you like open it and get a candy every day but instead of something good like candy you get something shitty like a hacker rank type problem the first Parts like they're Goofy and Christmas themed actually pretty fun problems the first part is like a pretty complex but doable usually and it's more than anything it's about being able to skim like four paragraphs of text and figure out the three things they're actually asking for and then you're given this giant text input you have to process that with usually code but somebody doesn't Excel or in um Excel every year people or lunatics because you just have to submit like a short numerical or string output it's usually like an 8 to 20 character thing so it doesn't matter how you wrote the code to solve the problem you have to get the right answer out you paste that you get that and then it reveals part two which takes some part of the previous problem and expands it in some chaotic Direction so depending on how you wrote your answer for part one part two is either really easy or [ __ ] miserable and I love that because it makes you think through your solution a little bit more but not too much because you're trying to go fast and the way the scores work is from the moment that the problem comes out on nine or at 9 pm Pacific time from that moment onwards it's timed based on how many people have beat it before you and that's your score like how many people had beat you before it and being number one is like the goal because then you have a perfect score so the uh leaderboard is how many people did you beat on each day and as such I'm there at nine on the dot ready to go with an answer that's amazing I've been reading chat and that's amazing they're making fun of you Mark and then somebody also said I'm less than three I should have brought another chair but screw that guy let's ban that guy who is it drum wave get him out okay because when you're over there I kept looking bad it was should we get you a seat too you want a seat we can grab a stool it's not good yeah we can get you another a seat and grab you a seat sometimes more more than one of us then I'll take the lap if it's open open offer anyone anyways Hey so uh okay we got okay so someone said Madison greater than the rest of them okay that's pretty good I'll accept that something I probably should have thought of ahead of time is moving the mic so we can see that better I know I was thinking about that the whole time but I didn't want to say anything look none of these headphones are what I want I don't want those headphones these ones look too sweaty you actually you would probably really like my Phillips oh okay yeah those are starting to already look like mine I can tell you right away just trust me I like them the most comfortable headphones ever made yeah you just like forget you're wearing them it's yeah try them on you want do some headphones oh these are um my recommendation made it all the way to Ludwig so yeah they're officially streamer certified they are yep nice okay I like those headphones yeah that's so cool you know when you've been wearing headphones for so long that you take them off and your ears ache yep yep that's what that's all the headphones I've been going those headphones are a big part of why I can wear like dangly earrings again oh yeah that's been my issue yeah like you were in giant like Pearl dangly earrings with those on you barely even notice like it's that would be amazing I had to give up earrings yeah I do one of the day [ __ ] cleaning yeah ass adult cleaning all right do you know about that yeah I do I saw I saw Ludwig thanking you what do we know that fast cleaning do I know about it I've been getting down on the note of the Earth one of my friends runs the company carrot I'm gonna slightly leak I don't I'm sure you won't be too upset with me Eric but uh he wanted to do more LinkedIn influencer [ __ ] I'm on I'm all heavy on that grind so he asked me for permission to tell the story of like how to Market your brand through like weird activations by telling the story of how I gave or asked leaning to Ludwig what we're talking about think of it as like the Uber of ass cleaning you can call somebody I'll be there 10 minutes or less how I mean this is not a leading conversation how dirty is it oh no you guys are ruining me honestly true story is I bought ashdot supplies like five years ago because I thought it was funny when I saw it was available so I've just sat on that domain for a long time I mentioned this we were joking look at other funny domains so I looked at ass again and found astock cleaning was available I said oh I could buy this that'd be hilarious what would I do with it though like I'm not starting up a day company and Dev mentioned that Ludwig was starting a bidet company yeah so I immediately bought it and held the domain hostage trying to get a lot of work to acknowledge me so we could have it it worked and he did I gave it to him he was hyped he shouted me out a whole bunch that's amazing I think they're gonna have a billboard with it on it soon yeah I'm kidding yeah you might have to fly to L.A to take a photo with them I think they're doing it in New York now of course I did you really actually think it was an ass cleaning Uber service no okay I did not yeah I didn't think that that would be so great just like huh I know the developer's like famous for about you know buying random domains but I didn't think it went to that level now I know yeah I have pog.capital it's one of the ones I'm most proud of how it got Capital let me get in here oh thank you I realize that it's just no no Theo you say what are you doing what I could do here's your thought okay okay I know right insane okay do you want a seat oh I'm fine I'm really fine guys you guys are getting like the full next comp experience right now this is exactly what it was like when we went out yeah it pretty much is Primus I'm not the tallest but I am taller than most the people in this room even if they're cheating pretty sure you're the shortest person here I think trash Dev is not here yeah that's why you're the shortest got him okay you know our trash I've been short my whole life okay I don't know why you gotta be like this it's fine like you've more than made up for it you just have to make up for it but when people meet me they say I'm tall but then I know secretly deep down I'm not tall you know like what the tall people know I'm not tall but the short people think I'm tall so there's like this this thing that happens yeah how does everybody not think I'm tall everybody expects me to be like short to normal height which has surprised me if like the first thing you'll say when they say he's like oh my God you I never thought you were so tall you're too angry to be tall oh tall people are just happy they don't have anything to be angry about they're like I'm sick too life is good explains a lot for you thank you so happy yes thank you David Davidson oh he's just talking about uh man stature is not measured in height measured in rough skills which means you're gonna get taller starting December 1st or 2nd I'm trying to think of a fun like I'm trying to come up with a good reason to grow a mustache because I'm not gonna just do it I need like to lose something first but I can't think of any good challenge that I would actually lose yeah you're gonna make a bet with someone but yeah I did with Ken wheeler she just said he'd land a trade but I was like okay if you actually land a trade flip he wanted to make it like 100 bucks I'm like I'm [ __ ] no I'll grow myself if you do it and then he didn't even touch my skateboard the whole time you see it oh yeah he thinks he can land yeah no he can't he no no does he skate I didn't really did can can if Ken used to be an insanely talented rollerblader too he would do backflips and [ __ ] what yeah can you drink it too many alcoholic beverages at this point in your life you're not gonna be able to yeah it increases the confidence decreases the success rate yeah it's like unit tests yeah whoa this is a friendly conversation wow it wasn't much specified I know this Mark this we're gonna have a great time oh did we just see a flip edits in here oh nice sorry that's that's the editor of the century well at least I think he's editor of the century you probably have your own editors yeah Mira's been [ __ ] killing it he at least editor of the year I flip can I have Sentry mirror earned it this year though okay [ __ ] on the grind I I have like four videos ready to go he got two done for my last stream already nice nice oh wait you have two editors no I have one editor but he got two videos done since my last stream videos about two people when you said someone wins the last year okay uh he his editor's been editing for him for a lot longer than a year I think I've just had mirror for like four months oh okay okay gotcha yeah killing it though I do have legs I'm Dale this sorry the chat's so stupid guys you guys like already been funny something is just what's viewership like I can't even see the numbers from oh my goodness should we do hand sizing oh is that like who has the biggest hands oh my goodness Theo's gonna destroy me oh hand sizes oh God yeah uh I don't want to do hand sizes I don't want to do hand sizes well my nails are like making me look like oh my God doesn't really matter yeah I feel like my hand is like I'm getting here yeah it's it's thing that's like a tall person problem yeah yeah I know I'm not tall yeah I'm not gonna complain oh that was fun realizing the thumbnail isn't clickable enough because you two aren't in it so honestly I kind of want to just take a quick screenshot of the stream in the makeup thumbnail instead okay all right we got something important afterwards though we're gonna show the greatest thing ever and we need lots of lots of people ready yeah drop the pr stuff let's give them the lgmt oh yeah I forgot about that yeah we do have something don't worry we actually do have one thing we have one thing okay it's very important I hope you guys are excited let me see let me see what it has to say let me see let me see let me see you how are you doing something are you crushing it right now uh numbers are good not great but I think once we switch the YouTube thumbnail over to be all of us and it'll be a lot better we all look and smile at the camera oh yeah where's the camera perfect uh I think that's a good enough one a nice delay on that new is this your new move every single time uh that's actually is that a real thumbnail okay is this your new strategy I'm getting I'm getting in on Theo's little strategies over here what's the strategy sorry I was looking I am [ __ ] thing uh my favorite Strat I said I was looking for he oversaw my last thumbnail I love the little strand of hair that you have it's like right there yeah I normally much more like planned with that but I've been trying new products recently and it's been a mixed bag I'm actually eating pretty much you are not Maria who is Maria porque area just created and thank you Maria come on you don't know who Mario is no I have no idea I don't watch TV okay I was homeschooled I don't know anymore I grew up without a TV you were not allowed to say you're homeschooled in this situation okay oh I know what that's probably I feel like I [ __ ] up is it from like Nacho Libre Maybe or um did you just say a Spanish name because it sounds very Spanish medicine rewind this this is not going good this is oh really oh really energy is about to take that back someone said terrible taste and themes Canada from our found here I love it I have good things yes she she does have terrible Taste of things she gave pink like a b tier that was beautiful oh now Chad's getting upset about me not having a chair why is everyone so concerned because you need a chair because when you're like half leaning like this it's just oh gosh that's even weirder hey Mark you're a great guy yeah it is because you look good so what was the movie from or what's the quote Maria porque Maria yeah what was it from the Amigo me Amigo that's a movie how do you know oh cool Francisco is a comedian and you can do the movie theater voice guy Pablo Francisco also does things and there's this guy that busts in he's doing he's doing tele novels or telenovel telenovel what's that anyway Spanish soap opera he's doing an impersonation of that and he busts in and Maria was cheating on him with Fernando oh dang Mariah no I have some bad news on YouTube we're at 227 viewers but only 66 likes because they're not liking the stream right now for some reason so I don't know what's going on but uh I thought you guys liked us a little more than that so if you could hit that like button like subscribe that like button likes are free so free the light oh by the way please please please please sorry Theo actually hit a small Easter egg in the description you have to hit the like button on the way to the description yes it's the only way it comes up it's on the way it's a little we're trying on a new program it's pretty cool so once trust me you gotta try it out you gotta check it out it's it it'll be shocking the guys that's what people are going to YouTube just to like go twitch people go you guys are amazing works for me I'll take the W thank you all hey no problem all right now that we've Bamboozled them all right so we do have something that we need you guys to participate in okay so I don't know if you know this but this is really really important um versel recently announced a new Builder turbo pack have you heard of it I may have have you heard of it perhaps have you heard of it I have not okay so Theo has no idea what it's about but it's very very impressive and but the thing is is that they're missing some pretty key features and I made a PR now I do have a few approvals we got some pretty higher up people in there dropping their approval but I don't feel like it has enough yet and so we do need a lot of lgmts from you guys all of you every last one of you um please go to that and give lots of lgmts I know since this is on Twitch one of you guys will say something stupid I'm positive of it okay I already know this is gonna happen every time I do this no you know what why don't you talk to Karen is being intentional you've said it every time you've been to say lgtm oh no I haven't I have dyslexia plus dyslexia yeah okay I was like what looks good me too I want to be in yeah that's what it is yeah it's MGMT that's what it is MGMT uh the pr is actually hilarious and honestly like shout out to versel for keeping up with and putting up with the [ __ ] I was not sure how they would handle that and it's been well responded to yeah we had we had beautiful quotes from Palmer yeah Palmers was hilarious threw out a ridiculous requirement and then approved the pr when I did it he asked for three blazingly fasts in there which was impossible because there's only two places in which it fit and I found a third I found the third that actually makes it work and I was very very surprised and then even one of the other core people on there also approved it so we have like three out of four possible approvals I hope it gets merged I think you had a good chance it's looking good to me my my guess is that uh Matt podcock podcast how do you say it partner cook did you put an r in there no it's ER yeah PS that's it it's p-o-d-d-o-c-k I'm almost Paddock Park yeah oh there's an r in there oh yeah we I met him yesterday whatever next chance it's at the end yeah it's the word that you don't think you should say oh pocock yeah he said cork now I said [ __ ] you're not gonna question what I [ __ ] said she's totally I'm not gonna talk about [ __ ] no no you're going don't challenge you are there you're like pool Kirk might have been the Boston accent yeah that's where the R's have gone it might have but then me overcompensating for the Boston accent okay trying to kill it I yeah pocock so how is it it's not pronounced pocock Matt typescript wizard now works on turbo repo hopped in as well yep and so my so I my only worry is that no pun intent this was actually a really great pun but now it's gone on too long is that he was gonna [ __ ] block me and say no to the pr I thought it was so good but now I feel stupid because it went on way too long no it's good such a good idea there's gonna be so many awful Cliffs from the stream yeah why would you do that one way or the other it's over I'm here against my well enough ask Prime about the uh stack over no questions wait no I'm sorry this is actually her Netflix interview this is her Netflix interview God right now you're doing pretty good oh God this is when it all ended for me but I'm not gonna lie to you when you tried to make yourself taller than me really put you down a couple levels on that Netflix interview uh yeah okay stack Overflow thing I made a ridiculous comment on stack Overflow and got moderated pretty hard and then while at next conf there's a person that just ran into and they're like oh I work at stack Overflow it's so awesome blah blah I was like oh wow that's cool I recently got into some trouble with stack Overflow and without prompting or asking questions he just goes are you the dick guy and I was like yes I am the dick guy he's just like that's so great I've got the dick guy like had to get a picture of my name tag and all that it's posted on slack that he knew the dick guy he'd been referring to him his penis the whole time when you're the real thing I've been calling you penis for how long and it turns out oh my goodness I thought penis was a new thing from the last few days no this is like an M Night Shaman Milan episode like I've been calling you penis the whole time but oh my goodness I'm the dick wait so oh my goodness I see people asking like who are the people who aren't Prime and I'm like what the [ __ ] only one of us has broken 35k followers on Twitter yeah there's only one person yeah oh you guys are a bit past me though you because I've been like this for a while but you guys are like that so that's why I'm gonna you know I'm gonna catch up though yeah yeah different types of exponential growth yeah you're gonna you guys are getting there I've been noticing that he's gonna be number one out I want to know who's at 35 okay first because you're both like getting close oh you will be I I might be yeah stupid on Twitter lately your stuff gets way more interaction on average but I'm just on Twitter too much oh I say stupid things that's why I went yeah they get filtered out by when I say smart things sometimes which is a problem yeah I don't do smart things what's a smart thing and what's a stupid thing because sometimes something looks dumb but then you think about it for a bit like a take and you're like oh that actually makes sense yeah that's all of my takes a little tank think about it so everything is dumb at first but then later yes yeah the amount of people who like hit or in my computer go like I [ __ ] hated you the first five times I watched one of your things and then the second one was like like circling in my head I couldn't stop thinking about it it's like oh maybe he is a little right on that maybe I'll try that and then they did it like they're like oh [ __ ] it's still right about everything is that a Theo opinion thing or is that Theo in general they're like you in general you but on dates this is like life-wise yeah yeah it'd be so funny you got you're gonna work on it though because it's like five dates hey hey they would never go on the second date right so you gotta like figure that out how do you like so almost everybody I've been with like I knew for four years and they hated me for at least one of those years you can confirm he's watched this happen yeah I skipped the hate section I never hated it yeah that means it's coming I mean I mean I was not in the Pro before it's in the after so today I I mean I don't like you yet Mark but I could imagine I could I could learn to like you wow it's like an arranged marriage I could learn to like you over time I can learn to like you real time Mark was like it went on a a rare Mark rant yesterday about how surprisingly hyped he was on you yeah let's go Mark yeah Prime's one of those like rare real ones I love the keyword surprisingly hyped I know yeah he doesn't get that hyped well you know strike me as a guy that gets hyped I don't yeah I'm pretty hyped that's why I keep notes sometimes he does yeah it's usually when he like makes a robot arm that slaps people while they're streaming did you actually make a robot arm I did it's very small though there's it's a very small robot arm and it's it's integrated with ping I just it won't let me ship it you know it's not about the size of the robot arm okay yeah I mean you could have just left it there looking so good that's what you do with it looks good to me that's what guys tell themselves anyway okay sorry hey you received a restream award yeah a thousand messages today I have received a restream award what does that mean it means that I'm using a bad thing for keeping track of chat because it's the only thing I'm signed into YouTube and twitch with right now yeah we are on many dick jokes right now we have had several dick jokes we've gone a little deep on the Dick jokes people okay it's time to pull about just pull it out all right no more so where did the penis nickname come on and I go to Theo's booth and yeah wait no no you had it on all day no no it was just at the visual party the guy was sporting penis for multiple days don't don't let him don't let him lie uh I mean I'm always sporting hard okay it was ridiculous and when I first met him his name tag just said penis on it it had a little picture too a picture I don't remember Monday just confirmed a chat it was just to be Shojo party so it was just okay wait Monday's here yep yeah uh Hey Monday yep and Jacob's here too hey Jacob well Jacob Jacob you know it was at the booth tell me it was at the booth Jacob he showed her name tags nope okay maybe maybe I just had penis on the brain at that point and just can't blame you I just didn't you know just couldn't get it out it happened I projected okay I projected mark yeah more people are commenting my outfit than usual just funny it's actually like don't like this shirt this much is far from one of my favorites but just having you next to me means I look like I'm dressed really well you look so nice right yeah we're pretty like dressed down yeah I feel like yeah you have nice clothes on too for like try hard but look like you're not trying hard you know what I mean I don't leave this floor of this apartment if I don't have a nice shirt on I just like don't have it in me even like when I take out the trash and from wearing a t-shirt I'm like yeah I'm not sure like what if somebody sees me my wife said you cannot wear these pants and I was just like wow I mean they're really awesome though like old and comfortable I get it I have actually if I have some of my dress pants are these one of the yes these are the ones no they're not I have a pair of these that I ate so much [ __ ] skating to work in and just tore them apart but I actually cinched them back up and I just think they look cooler now what about the days when you're just like relaxing and it's just like you know the day when you're watching TV how can I be relaxed if I don't look good look good in sweatpants right can't they we have different definitions of good or love no we call it sweatpants are called the not tonight deer pants oh yeah yeah but you're not you're not trying to look good in sweatpants is this T3 cuff this is T3 conf yeah would you guys opening attend it opening a lot of free show this is the free show we gotta work on our opener yeah T3 cop teaser I have so much planning for that as a dude you guys have no idea I'm so [ __ ] I the ideas I have are way too big for us to do really realistically like the return is not going to be there at all yeah no no no no you gotta go you gotta start small and you gotta build a joke and then you make the joke bigger generally like a penis that's not dick jokes okay Chad ridiculous it's ridiculous you can't help yourself I know it's just like I just think it's so fun I mean I'm standing next to the man himself well we're all standing around the Dick's guy himself yeah the dick guy yeah yeah a legend Maggie we need more nicknames like Theo and I don't really have one do we you don't yeah I don't actually in this community that's weird I have so many themes of like the skate community and [ __ ] can we hear something the big one's Bigfoot that's just kind of what I'm called in that stuff how big are your feet size 14. yeah it's Bigfoot that's a big foot right there yeah you look on Ken's face when I said that yeah well Ken is not a big guy height wise and so 14 size foot that's a big foot yeah but I would expect his face to turn red weird foot flex can we see can we get a foot on the camera deal no no we've been over this twice we'll do a handful comparison what my hand to your foot no my my feet are unimpressive they're 11's okay I'm extra medium I'm like almost big you broke the one rule what he's doing three feet he's wearing shoes I already showed ankle look at that oh whoa oh yeah oh guys so be careful I need to have a hot tub and frame if you're gonna do this oh yeah sorry yeah you're right we do sorry yeah I I legitimately though can we do a hot tub stream at least first off we have to have a hot tub I I will arrange I will rent an Airbnb with a hot tub and internet gladly and I'll buy a cheap Chromebook so we can do a programming hot tub stream I would love to do a programming hot tub spring where you actually program in a hot tub right how about the funniest [ __ ] if you got the guys only one no okay come on you're absolutely in if you want it the problem is we need like a second we need something needs to help the viewership time it would not be that beautiful you're asking okay mods can you get a poll up for would you watch a just Theo and primagen hot tub stream yeah I want to hear that hey I want to see this yeah either way I actually see the pole though that sucks stream it sometimes stream it to only fans oh oh that would be an only fans one did everyone hey did you guys get on that GitHub VR and make some noise I can check that quick I know I I don't get signed in on uh what's it called my phone people that check like diffs and stuff on their phone I I'm not convinced of it I feel like you're a little bit I can just leave no I do most of my coach reviews on my phone at this point in my life yeah that seems so inconvenient just find a computer but what if your phone's already in your hand yeah that's the thing oh wow is that a middle finger no that's a thumbs up oh sorry I can't see that dyslexic for emojis I am dyslexia [Laughter] there was even more another one so I'm so bad at GitHub at this point that they recently did this feature where people request a change and it's a red flag I thought that PR got closed I even tweeted it ended not realizing it's not even ended yet wait guys where's the poll that's all good did you all do the poll oh yeah where is the pole there it is going yeah it's 89 yes well that's because people are disgusting you guys you guys only want to see me and Theo yeah I'm more disappointed in the [ __ ] the 12th or the 12 people who said no yeah I know before they do that those are the unfunny ones everyone wants me to film we've had like several people saying I'm like filming interesting that would actually be really funny hiring like a woman's voice in the background like filming and [ __ ] and like you just like refusing to be on camera yeah I think it's way funnier like wait I don't know well there's a lot there's a lot of things that are required hmm I I like this idea I like this idea how can we do like a good like proper interesting couch programming meme I've been thinking about okay oh my goodness I've been thinking about this for so long because I work at Netflix so I thought I was gonna do something funny a lot of Casting Couch scene and then I actually got talked off by remember when I told you that I had many talks with uh PR yeah that was one of my many talks I didn't hear about that one what not to do publicly and that was one of them is you can't have a casting couch scene I thought it was funny well apparently bad things have recently happened that people don't think are funny yeah we could do it on stream though I was just thinking like a casting couch themed like code review Tick Tock or like interview tick tock like a fake job interview but you're not sure which which role it only fans the job is for oh my goodness oh my goodness oh my goodness oh oh my goodness it could end with the person's talking and it really sounds pornographic it's like I've been solving hard problems for years hard problems yeah it's gonna be like by the way this job it's gonna be a little rough okay next scene C plus plus so hard so good I I think this gets coming together it's like only fans mixes up two candidates I have a bunch of friends who are six burgers and we could have them do the programming interview I could actually orchestrate this this would be so good that would be pretty good I'm sorry in advance for the DM of sending you later today that's actually she's gonna be so down for this as long as I'm allowed to make dick jokes I guess it's okay then finally a place where I can set the dick free I've been having I'm looking for this for so long I can't believe I haven't heard of that only fans he's careful about who he talks about it around yeah yeah I don't I don't just expose my dick jokes to anybody okay what I learned about only fans last night which you and others which I guess I won't name them I won't you know call them up I was talking about you have to get your only fan like I need to wait I shouldn't say I need to go grab yeah no no no no no no all right nevermind nevermind that's exactly this down looks worse everybody everybody this now looks officially worse guys there wasn't anything bad never mind this is a great way to Hype up your only family yeah it was I was everybody's checking to look in your bio right now it was related to programming yeah guys only 9.99 just kidding nothing yeah okay next topic that was too good if you press the like on the way down you'll find the only fans link but you have to press the like button First on YouTube how are we doing likewise on YouTube yeah unlock the only fans yeah for the like only that just got us 20 bucks when you said that absolutely I was trying to do a little degenerates earlier [ __ ] d-gens all of you degenerates value that's a value add right there if you sub you get a month of only fans it's true if you gift just enough Subs unlocks free only fans yep the link is in my sub only channel in the Discord so join my Discord too you know classic what's your only what's your uh sub only channel name so Vegas just sub all the way yeah I think I'm in it so it's like Subs only there's a T3 club which is for the tier threes which is like the cool one no okay yeah right I do let's go you wouldn't know no I'm subbed to you okay however well it's called yeah it's uh we actually have two levels there's the startup which is exclusively images of Arnold is the only thing that gets posted in the sub only channel in my Discord is just Arnold meme after Arnold mean that sounds totally worth it I know it's pretty good it's pretty good and you know Sylvester will make an appearance and all that and then of course there's the exact chat oh gotta get in there yeah yeah that's two or three if you're in the disc ROM I'll I'll give you okay yourself only is really pretty good because you say something you don't say anywhere else oh you haven't seen the tier three chat it's so much worse it's that's why I just let it out oh no no sub only is things I expect to maybe get screenshot especially with like the huge gift bombs by the way everybody was gifting I will shout you all up near the end I'd need an easier way to check that sorry in advance appreciate y'all but yeah I I have to be a little more careful and sub only due to the nature of the number of people who are in it there's like 2 000 people in there it's wow so like that's a lot of people's yeah it's nuts and tier three there's like 100 or less and I don't know he's paying me 25 bucks a month just to leak my [ __ ] if you are good on you honestly people gift the T the t3s and then people with whom don't have the same I would hope anybody being gifted a tier three is being gifted a tier three because of an understanded respect of them and I would trust the one doing the gifting there to be making a good decision as to who they're letting it I love you too this is where we leak [ __ ] that's right agar you get it yeah so one time so I I pitched this idea on Netflix and sorry you're leaking thing really I really wanted to catch on and we couldn't do it uh that's not a dick joke by the way no leaking thing here uh so the idea was this is we accidentally leaked for 30 minutes the next season of House of Cards early right as in all the news articles all this and I realized why not just do that more often just leak the next season early but for a short period of time and just create a huge amount of Buzz and then all the sorrys go out everyone thinks it's an accident anyways that was another time I went and talked because it turns out you can't make all the suggestions yeah I know that's a really good idea right I mean it's like who can catch it and watch it yeah and then they know about it it's like an exclusivity thing yeah maybe you pay extra for that in the moment if you get on yeah why would this not yeah I think Netflix is also one of the few companies positioned to do some of the stuff like the ARG things that steam used to do like the Portal 2 ARG is still unmatched where like the game had a release date but if the community managed to solve puzzles like in time it would get released early that's cool but it'll like they only solved enough to get like three days early and it could have been up to two weeks early it was still nuts they pulled that off but like what if the next season of something you don't even know the release date and it comes out because somebody found the button on a website and clicked it like you can do crazy [ __ ] like that you guys are in the position to do them have the distribution mechanisms to do that that would be interesting yeah there's a lot of cool things we can do and I think you'll I think Netflix has a lot of cool things actually I was like inclf for T3 oh [ __ ] you got so many ideas there's a lot of ideas are cheap action's expensive that's the problem next you guys because I haven't had a talking to at work yet about anything what am I doing that is not true you had to have broken problems oh yeah but I feel like it wasn't like it's not the same I opened up I optimized to have that happen in the first week if I can I try to set people up to break crowd in their first week just to get out of the system otherwise they're dreading it forever yeah I guess that's a good point okay I have yeah yeah it's a dummy broken prod yeah we haven't been spoken to for something outside of work yet something like non-prod related yes yes that's what I meant yeah we need to up your ship posting game I know yeah today is the day today is like a clip of me talking about like the dict or something that we can use you know something good from this yeah or the only fans promo the only fans that was strategic leaking so that was actually the application of strategic leading sounded like I was about to say yeah this poor girl didn't know feet picks were a thing until earlier today so like if you didn't know about Wiki feet Wiki feet that is not a thing I only wait I actually can't say why oh my okay anyways I like Wikipedia but better it's Wikipedia are you on there with your big face damn right that's where my biggest fan club is I gotta go Gotta Go where the viewers are do you learn nothing from me check that out uh what do you think yeah what do you think Marcus Marcus let it out this is a safe place everyone just staring this is nice this is a safe place it's very famous it's not a safe place let's see those feet I've shown my feet on stream several times ew why oh someone linked to Wiki so I'm curious now yeah what's your feet um the reason why I've done that is because one time Chuck gave me a bunch of Subs so I showed him my feet look at me like so disappointed I'm so disappointed in you Pride you let me down I'm just kidding the the turn was just like it's like the Hero death I just watched it I don't know don't meet your Idols chat don't do it literally saying today I was like probably you're like my hero and don't like don't let me down I know she actually said that in the car went on a long conversation about it she's just like it's just really great to finally meet someone that's not a complete idiot yeah who doesn't sell his feet on the internet I said quickly yeah he's like you got some dignity left it's a shame how quick it disappears I definitely did that don't meet your Idols just DM them yeah yeah just to DM them yeah that's only three laptops I heard that works really well wait for that dick to pick coming yep well you haven't got any yet I actually have gotten very I get so okay I get so little DMs I only get a couple weird ones really yeah so little gotten like three today I'll start sending you weird yeah you know I've actually never I got you I've never gotten anything everybody in chat this is your invitation send prime a weird DM yeah send me a weird name I want he'll post the best ones oh my goodness I'll do a YouTube react to your DMs we'll do a YouTube react to DMS everyone said it perfect we'll do it next week this is not a guy I think that the guys aren't going to get as weird as I am generally speaking Yeah it's like a lot of you know hey babe hi you like python yeah yeah none of them were that good though or I would reply it was like really intriguing then I would be like hey what's up but yeah like you're gonna DM her take that whatever the hell you had typed out there send it to me instead but if you find that that's shameful it means you shouldn't have sent it to him he should still send it to me yeah send it all over the video I actually had the coolest DM recently uh someone from the Twitter side wanted a one-on-one convo and she just laid it out with like the funniest back-to-back jokes about the startup and everything and just like slow rolled me into being like and by the way I can have a 10 minute coffee chat and I was like yes you can that was that was that was the way to do it it was the best dming I've ever seen so somebody where where were they from like they just found you on Twitter you said yeah they thought they were like in playrooms I was like oh damn that's hype like I mean seriously this is how companies need to be doing recruiting and [ __ ] especially if you want like the best of the best that's how you need to slide like I've gotten DMS from like random database companies they're like yo you should have our CEO on this show I'm like yeah sure 10 grand yeah and then they like actually are down because they're so awkward which is weird but we'll figure that one out soon if I have some awkward database provider I don't want to talk about too much before or after on later you guys know why anyways then I'll get like maybe I'll do what he has to do for 10 grand okay yeah others have random database guys on you know yeah but then like Luke spaghetti tweets yo let's do Showdown react native versus flutter Theo versus B but I he does the react native app and I do the flutter app I'm like yeah that's a [ __ ] great content idea I'm so down but like if you hit us up with good ideas and understanding and respect for where we are and what we do we're so much more likely to be involved and excited about that or like I get DM a lot of shitty like my first project type stuff but every once in a while I'll get DM something that's like genuinely really cool and I definitely have seen people who like wanted to DM me something and didn't because they were scared to and then I stumbled on it and I DM then they're like oh my [ __ ] God I was scared to reach out about this but like yeah if you're working something cool that is the stuff that we like and are excited about just [ __ ] hit us up we're gonna reply hold up what up chat sorry Chad content idea teach Prime to kickflip I can kickflip I used to be able to you'd have to give me proper skate shoes and I got you I can monkey face right now tough butt I had a monkey monkey flip on this carpet right now first try you don't have to be it doesn't really want to try yeah I could do the first try easily time it doesn't it doesn't require a lot of space you know monkey flip you know what the hell ah yeah no that's actually a lot harder because I like on wheels on a carpet sucks yeah well you don't have to move that's the best part oh you just be like before in the Japanese no no no you stand you stand on it and you reach down and you jump but you don't have to you have to pull your hand and flip the board through oh [ __ ] yeah yeah you have to be of a certain body specification to be able to do that that's the one I got I have to pop the board into my hand for it to get there no one of my homies Ollie for vein he does like the craziest you showed me I'm weird no I didn't show you ollie I've shown you a few of my people Ollie I definitely didn't he just does super technical flip tricks that's all he does it's his goal to see how many times he can flip the board in the air once he did like an impossible or he he did a kickflip blade impossible and an impossible late Impossible on flat ground there's [ __ ] Luna fiction that's cool yeah he's unreal he loves just dming me random trick challenges and wanted me to do a monkey flip to cross foot and I've never come so close to [ __ ] my [ __ ] yeah you have no idea oh yes okay Mark didn't all right here people are just so concerned he's got a chance he'll just like walk 40 plus miles around the city for fun he's weird half the time we're talking I'm sitting like on one side of the counter and he's just walking around the kitchen that's just how it is you know cat now Prime and Mark looks like a couple I said that was kind of a western voice you kind of do now I'm just trying to cancel out the gay with the Western that's why I did that I avoided it it's my my inner my inner head American Prime are going to enjoy a nice evening tonight I think we'd like to hate more in her thigh I oh I'm already close to the Inner Man thigh doing a new job yeah someone said this looks like Silicon Valley the reboot but am I like the marketing girl I think you're Jared the girl the whole point the [ __ ] the girl from the VC was like the only smart person the entire show that was like the joke yeah that's a good point yeah the main actor like the guy who was doing the fake Paul Graham thing he was so funny and he died after they filmed the first episode so they had to write him out of the show is he the guy that talked talked like this yes oh yeah that guy yeah he he I like that guy I actually I'm so sad we didn't get a whole like at least seasoned with him like it sucks obviously like your [ __ ] happens but yeah that was so tragic yeah it was Lori Lori brim was that the replacement I don't remember or I don't know actors or characters names of things I just had a baby today I don't even know your name just I like I like that she is one of my favorites we never mind no what no I actually can't I can't I would if I could but I can't oh I don't even know what you're doing I can hit the new button for a second just let chats like especially like can you hit the mute button we gotta like make sure it's muted though yeah are we muted terrified it just reminded me of that whole thing I was yeah it was so funny oh my God yeah it turns out Prime hates all animals yeah it just hates them specifically the cute ones yes he's actually talking about his only fans that he's you know happening yeah where I hate on animals yeah the problem is the animals love him yeah they just love me yeah I can barely get my cat off him boom actually your cat did follow me to the bathroom and sat there and made out of me and made me yeah pet the cat over and over again that sounds about nice required I know and then and then it started biting me and then I'm like okay okay I'm like okay sorry sorry yeah yep I told you only pet his head it's a weird cat you know the the like no no take only throw of dog meme where it's like they have the dog has the ball it's like fro and you gotta take it's like no don't take only throw that's funny yeah my my boys they they know what they want but they don't like how to get it oh kitties I saw miles like trying to come through and not being sure of the right way too which was adorable yeah you're getting some love on there mark You're cute oh yeah oh you got some cuties in there Mark with the c or okay okay wow are we not looking more accent no do you have an accent speak again what do you want me to say okay I thought I first you know this gonna sound really stupid because I've talked to you so many times but I just thought you had like an Australian accent there for a second I actually no I almost thought you had an accident right right when we met yeah I've been told I have a California accent which is like very embarrassing you do so cute you do Jared I absolutely do somebody in chat asked if we all stream games yeah we're all big game streamers we're game streamers yeah I do a stream van it's my favorite game yeah it's my least favorite game I'm really bad at it keep getting really low scores I'm gonna make fun of you in my next video for fan is that okay yeah of course please do yeah yeah we need our covered Vim addict no we're gonna say someone that's not good at them oh and you're gonna like yeah yeah I know you're gonna you can be all upset about it but I was just gonna be great you know Guillermo is like really into any of them right no I I was so close to writing that up before you guys chatted because it should have been part of your pitch but yeah so I tried the Tweet generator on Theo and this is what it came out with oh my goodness for those that can't see it a tweet generator can I read it for them yeah is this gonna be used it says a Theo still haven't found a replacement for vs code question mark check out Neil Van it's my editor of choice right now that's pretty good there's a tweet generator can you generate one for me yeah let's see if I can find it this is kind of exciting what do you think I'm gonna get chat what do you think I'm gonna get and then be good what is it gonna be great I'm gonna be good next.js is now available in Neil Van illa come on come no that's just it it'll just say dick dick jokes rust or bust Coronas everything in an accent Corona Corona for Maria all right I have a lot of technical skills with stupid things once at a wedding uh in these wedding speech by the bride she did say I was a person of a thousand useless skills that I came with nothing and left everything left with everything or left everything left everything she's like you came with nothing oh what do I got all right buddy all right tweets for me today I learned that Firefox has actually has been bindings I knew there was some reason I kept going back to Firefox oh my goodness that is so good here you go look at how nice that one is should we cheers so what to JavaScript hey JavaScript brought you here [ __ ] well actually Netflix paid for me to come here yeah I worked all weekend on Netflix yeah you were working real hard on Tuesday no no they already knew that was baked into the cake yeah I said are you were you planning on this before next comp was on the table oh you already had this like week planned oh damn yeah it was really good timing oh [ __ ] yeah that is right and then the man of the hour asked me to come but I've forgotten his name is it Iman Hassan Hassan dang it it's on the legend he feels so nice talk all the [ __ ] you want about anything and everything at nexcom Hassan worked his ass off for that event he killed it I feel bad getting it wrong he invited me to go play spin here in the city tonight oh damn yeah I know he's a nice guy yeah he's great I said I already had one spin is a uh table tennis Enthusiast location where you can eat drink and play table tennis I used to be super serious about table tennis I thought it was ping pong foreign I I just want to check Twitter quickly to see because last time I checked it was absurd not Young Turks guy no no this guy's way cooler honestly sir just notifications no the uh 55.6 000 views on our best friend and favorite rust developer here getting destroyed by a certain CEO at ping pong I won three out of four plays in the video yet I was getting destroyed it three out of four plays where neither of you made it across the net it was him not making it okay I missed one too I missed one yeah I had many adult beverages that evening all right can I tell my can I tell my story okay so I used to play ping pong so what happened was in college I never played ping pong and I'm saying it you know for the Layman around here and so my friend and I we had a ping pong table on the second floor of South Hedges at MSU and so we're like all right well let's let's try this out and we just started like hitting it back and forth and then I played for four hours every single day for like a year and a half and then I went to China to go play ping pong and I had a line of people out the door and I was just destroying one person after another and it became like so entertaining because that's just not what happens over there and I was just crushing every last part it was great they even had the T they even had the school's team come and I was like beating each one of them and they're just like what is this having watched you play a decent bit of ping pong on Tuesday I'm gonna call [ __ ] on this entire story I can ask my how about this one oh no no she had a we've had a very bad moment before I would actually call my I can call oh my gosh we could text such random people you don't have a list of friends that you could text any random thing like yo weren't you there when I did X and just make something up and they're ready to say yes no matter what no no he was he was in China with me yeah I'm sure he wasn't I'm sure if you said hey you were in China with me for this right he'll be like yeah of course I was how about this one I will not lead him and I say people don't believe me I have to ask you two questions where did me and you go across the seas and two what sport well he'll say one of two basketball because we also have the basketball team we also played against the basketball team they're not they're not as good as basketball he has a bunch of the lot how am I supposed to believe that when you're the shortest one in the room because Mark okay yeah in China I will stand up [ __ ] huh Mark you are damn mark taller than me back to back with Madison yes yeah I have 10. and you are I'm like six and some change no news to me oh my goodness we could go back to my foot yeah you're he's taller than me yeah yeah so Madison's huge you've been called stacked and huge today I love it yeah someone called me stacked on Twitter I was like thank you be free stacked I got I got called Jack that's five foot eleven energy oh my goodness that is not true why did I not say mt3 stacked that'd be so trashy it's not too late you still reply with that I will well I already replied with a little heart but I'm gonna reply tweet with it I will that's good yeah we need the promo we still have to break 10K uh other stars on Creative yeah trash is definitely six one yeah if trash to have a six one you're you should have been in the NBA for a lot of reasons no which means maybe our good friend trash isn't quite that tall at that point you just go like that did you guys see the edit that Chris from my community made of his talk I honest I couldn't again it was very real thing it was so short it was just like the last five seconds that mattered of it link it in chat and play it here for you guys to see I don't think I don't think trash damn cries he's five foot six right no he doesn't I don't know how tall he actually is but he doesn't complain or anything he's not like one of the Annoying shorties for sure that's annoying that's like that I love someone I reinstall my [ __ ] that like [ __ ] everything for me of course did you see her come no I don't know what you're talking about what am I seeing over there looking at a chat this is not family friendly at all all right yeah let me hear it back to the configure where I'm at now we have this common develop configuration we see SSR true so by default it's false so if I uncommon that's it they had that up within minutes of the talk being live I was so proud oh got him is there sorry trash oh he's here I didn't know he was here oh gosh of course he was I would never make fun of trash if he wasn't here I would okay I'd make fun of trash if you live in here but I'm just saying that I wouldn't say that real talk though I have been so impressed with trash's grind in particular he heard about trpc I think from something that like I was involved it was like my stream it was just like me tweeting about it or something such Jared energy right there anyways sorry was taken for a selfie yeah he was just like oh this trpc thing is cool I kind of want to contribute to this I'm gonna go become a typescript wizard so I can contribute to this and he actually [ __ ] did it he did I watched him do those streams yeah that was nuts that grind was insane he normally somebody has a goal like that it's like I want to be a react contributor so I'm going to go become an expert in JavaScript like you you just kind of like make fun of them for it yeah and honestly if I had heard that goal ahead of time if he had mentioned that to me I would have been like that's a that's a bold one good luck but sure as [ __ ] [ __ ] he's one of the lead maintainers now the V10 release he helped with a ton of [ __ ] there yeah when he started in fact he did all those Rea or those typescript challenges he was so stoked about doing them that I actually did it two streams I did typescript challenges as well just because of that I still haven't done them because I'm gonna embarrass myself I followed I followed trash because of how stoked he was about it that's cool that's a good story I'm more into typescript the vibe than typescript the like type syntax is same with Ross I had I totally get that yeah oh okay so try to find the recording to get this tweet just right it's crazy how rust can make anything faster other than rust compilation um that's that's so rude why would you say that okay is that everything they know they're slow okay yeah and so did we but we're gonna make it faster with rust and y'all are gonna take that win while not taking the L in your own Community here's the deal rust is slow at compiling yes that's all I got I realized I had a great joke and I totally couldn't get it out that's that's all there too you heard it somebody clipped that it's there you just have to trim it right rust is slow from primagen it's there yeah easy W right there yeah I know of course here you can click that one that's your thing I can stream I can stream my master Clipper who refuses to edit for the channel is here have you ever had that like a person who just like every clip they do is like timed perfectly like they get everyone and they just don't want to Video Edit for some reason yeah I don't blame them timing on a clip is sliding two bars and knowing what's funny that is harder than video editing no it is not that's like that's it's designed versus web dev it's like if you actually know how to make things look good and you learn any amount of web dev all of a sudden you're a unicorn because knowing how to make things look good is the hard part web dev and HTML is you love to say is not that hard I guess because it's not a real programming language wait so if you learn them it's not that hard to make things look good that's what you're saying no I'm saying that if you learn them whether or not you know how to make things look good and unrelated okay but most people don't have that skill that's something that's like deeper within you and if you do have that you should just learn that next thing so if somebody knows how to do timing and make funny clips yeah that's the hard part they can go learn final cut in a week not even I see okay yeah and there is an insane demand for like quality video editors in like this in other spaces right now like you could just like if you get decent enough and get videos on like two or three people like our channels you could easily go to an event like just head up [ __ ] like jam stack conf and be like yo y'all want somebody to edit those talks down so they are nice YouTube videos and make a quick like 10 grand on the table I think being a good video editor takes time I'd say being a great video editor takes time if there's a video editor that can make good content more watchable versus an editor that can make bad content very watchable where it's like how much can you take this pile of content and make actual content out of it that's what depends on your input and the output yeah yeah my editor takes bad content and makes good content yes my editors take okay content and have made it progressively better content over time I still can't believe that react video blew up the way it did I'm pumped on that one the uh they fixed react one yeah I gave the full uh revenue for that one to mirror because he kicked so much ass it's just unfair for me to be the one making money on that that's swing that's good wait what was that about uh it was the react RFC when they originally announced the use syntax and the async components the stuff that like next conf was largely built around what I had that stuff leaked to me pretty early so I couldn't talk about it for a while is that Jay Phelps sorry sorry I actually read chat always if you're wondering if else sorry keep going keep going I'm just gonna command plus that twice more so we can actually read the names yeah thank you I read everything and so when I I just love it oh oh man I'll read now wow There Goes My astigmatism thanks Theo sorry about that hey Mike how you doing buddy was I bitching about before oh yeah I'm talking about the video going so like it's 95. the Asic component and you stuff I knew about the use key or word and like the things that we're doing there but I didn't know about the asyn component stuff I was I didn't think I was allowed to talk about it for my talk and then I went on stream after filming my talk and somebody LinkedIn Shadows Maple whom first here linked me the RFC that had just dropped that had all the things I thought I couldn't talk about it was public and I was like oh [ __ ] it just went on like a rant and a half about it then and after that realized people didn't get it because they didn't see it like next to like code so I went into my editor and just showed an example of what it would look like and my [ __ ] God bless me or he took the examples and the useful part of my rant at the beginning and trimmed up and out all of the [ __ ] in the middle and made him actually cohesive video out of like an hour and a half of me just smiling at the camera and it blew up because I did one of the fake it was the first time we did the fake tweet thumbnail where I had the react Twitter account say we fixed react I feel like I did see that okay it got over a million and a half Impressions on YouTube so statistically speaking you saw it yeah you opened YouTube and you write code I usually watch all your all your videos to yourself mirror killed it on that one because I literally like hit end stream at I think like 6 p.m or so like I usually do said hey I want this video ASAP yeah didn't specify a timeline he had it to me five hours later that's amazing out of Bangladesh it was like [ __ ] probably 2 A.M where he was by that point which was nuts and it was just like I just sat there and smiled on stream like I normally do this video took off it was unfair for me to be the one to make the money off that that just felt wrong so it's going where it is deserved it's [ __ ] killing it that's good that's awesome what are you doing over there we are you gonna get a video editor and start pushing out some content edit your own videos for the first at least few months so much no you and you're wrong that's why I'm gonna surpass you oh yeah no you're gonna surprise me because you're willing to talk about JavaScript you I already know that I think it was Json [ __ ] that's JavaScript object notation commonly referred to as Gizmo all right it's not a very common reference no if I were to talk about react I think I could double I think I could double very easily but I refuse to I don't want to be a part of this wave that helps and on top of that you have more of a Content brain than like the average streamer generally speaking what's a Content brain and it's I want one you gotta get the jizz ball edit your own videos and you'll have one very fast like okay that's what did it to me I thought I knew what I was doing yeah I hired an editor way too early I actually hired him to work at ping because he knows streaming [ __ ] so well and I needed more help on sales and stuff shout out Adam love you we love you Adam once I hired and broke a ping I couldn't realistically have him editing my videos all the time anymore so I had to start editing my own videos and my streams got so much [ __ ] better so fast because the videos sucked to edit because I didn't think about the video when I was streaming and once I started editing my own streams down I was like oh I need to rethink how I'm doing this if it's going to be an even like viable thing for me to be doing edits while I'm running a company B skills shut up sorry I had to interrupt he's gonna talk about hands all right just do it Go Theo just make it happen I have baby I have little baby hands okay my hands responsible has it grown since I was 16 because I broke so much [ __ ] isn't it that it just stopped make me feel good about myself oh my God at my outfit my hands are shifted down just to make you feel better it was do it again do it again do it again but make sure your palms are touching at the base no no no no no I had huge hands I had gigantic huge hands they're so big just let it out but they'll feel I need this win right now [ __ ] I should have you should have brought that yeah so I could have taken a picture with that with my [ __ ] like monster club or claws that have been hilarious huge huge is one of these things are again we'll never yeah huge um okay so here here's so here's my inverted take which is I shoot no content live yeah so if you don't shoot content live I think you can't have an editor that knows Tech in an editor that's willing to not know Tech but knows how to react to Tech and then you can play so my editor plays the aggressor right I hand them content which is flipped by the way flip a hand flip content and he watches it and goes oh he's making a weird face he'll literally make fun of me multiple times every video so he's playing the aggressor I think that works but you have to find the right person I think that it takes a long time to build that relationship and you already have to have the content brain flip is flip is truly the win the key here is you have to be thinking about like the final piece of output before people start watching and understanding and like really deeply getting that is something that's hard as [ __ ] to do and most of the time I see people getting an editor too early it's because they don't want to do that they don't like how hard that is and they're trying to offload yeah they're even big people who do this like big streamers who just don't feel like doing YouTube they find some random to run the YouTube for them give them half the revenue yeah and they're like like Hassan's YouTube channel like Hassan the the twitch streamer the really big one on Hassan from Brazil he has one of like for sale guy better though Brazil guys better for sure Hassan the streamer has like the most abysmal Twitter Twitter and YouTubers editor of this he said bro got a stool but still standing why does prime have air tag on the belt loop what thought what do I got oh this this because I gotta get into Netflix yep that's an Netflix stick yeah Netflix stick well hey whoa whoa get that out of there is there still uncomfortable all right anyways keep on going sorry sit on the Steelers four hours a day they're fine all right keep on keep on going so sorry this is actually yeah Hassan's YouTube presence is [ __ ] because he's not a YouTuber he's a streamer but if you want to take YouTube seriously if you take it seriously your way of taking it seriously is thinking through a video really hard ahead of time coding up whatever you want to code up and then sitting there and recording and making the video but the thing about doing YouTube right is you have to [ __ ] make videos and a big part of that is editing if you're not going to edit yourself you have to make up for that like 10x by doing a bunch of other [ __ ] and getting really involved with the right editor yeah it's just like like it's unreasonable to do that so like one so one of the one of the tips for the content brain idea or especially if you you want to hire out editing because I understand it sucks you don't have time if it's the if the trade-off is you don't make content or you hire an editor hire an editor right there's people that just like they can't do like I couldn't have done it I have four kids beautiful wife it's either kids wife or content editing takes a long time if you want to do good editing I like Randy level editing Randy is my hero yeah so my argument is you shouldn't be striving for really good editing until you figure out what the [ __ ] you're doing yeah yeah I guess that that's fair yeah my channel didn't have good edits until a few weeks ago yeah yeah fires we had good enough edits with a cute few funny skits my editors have been [ __ ] killing it forever now but the goal was to make the content watchable not to make the edit like part of the experience it was more using the edit to make the like to trim the experience in something more digestible than using the edit to create the experience itself but when I started editing more I realized that the input I had wasn't as good as it should be to make good edits out of so I improved the input from what I learned from that point but having enough understanding of the pipe to step back and do that is really important is the equivalent of like if you're a front-end developer and you really don't want to learn back end just hiring a contracted back-end developer but you need to know what the [ __ ] you're doing enough to at least know what you're looking for when you hire them like imagine like a front-end person who's never touched like the command line even that's exclusively worked in figma trying to hire an engineer yeah this is a good idea I love it all right so but my only Counterpoint is that all of his recordings sorry Madison no I was like I like this I'm passionate passion he's gone gone it's just that all of your stuff is is geared towards live right so I don't think you can apply the same things towards non-live content what do you mean geared towards live meaning that you record everything single take whereas what I do and I trash does this too if I'm not mistaken is that you record small sections and you do them over and over again until you get the right one and then you upload five videos and be like all right this is the video and that way you have like one good take one good take one good take one good take one good take it's already ordered it's all good and now the editor has to make that into an experience and so it's different because those are very different ways you do like my last one Gizmo I did the Gizmo part like maybe 15 times because I realized that I couldn't well not the Laughing part actually that was just first try because that was like it was the very because I was recording through the video I was like what else does he say and it also is like Gizmo like oh gosh that was adjustable wasn't the like original core of this argument that not everybody has the time to edit the videos themselves exactly then you don't have the time to be recording 15 [ __ ] takes per video well you gotta remember that every video I do I do all my work on Stream So the Json coding one was all done on stream then I take that and I go okay I gotta make a video of this intro that's it's a three minute record I might have to do it four times all right let's do this that's another four times but to edit a good video it's like an hour for every three minutes like if you really want to get some sweet like I think it does awesome stuff right which takes this is way long this is why I did I want long I want good I want long and strong like a python dick if people see saying it's at Theos three take Tony like I do multiple takes I'll just do it live I'll literally like talk about a thing like ah I don't like how that's gonna be on the edit and just repeat myself from the beginning yeah I don't give a [ __ ] yeah give us the viewers they'll hang out they're gonna be here anyways that's right guys they're more than dealers okay yeah Mark over here is dying yeah but realistically speaking like how many that we have here we have 786 people here versus like 200 000 that might watch one of the videos like if I have to repeat myself twice here to get it just right but also for somebody who Tunes in late or somebody who didn't quite get it because I explained it poorly the first time that stuff helps a ton the best thing I did for my videos on my channel by far was start self-monitoring you have to yeah yeah yeah blasting my own audio back in my ears so I hear loudly every single thing I say and do that helped me a ton I just started speaking better I started recognizing when a word wasn't clear and would go back and fix it those types of things just it made the content so much better and I would never have noticed I needed to do that if it wasn't for the fact that I started editing my own YouTube videos again dude you just got a ten dollar hold on whoa whoa whoa money for years dollars to let you know no maybe I did fail High School a little here and there guys [Laughter] run drugs hey watch your mouth Mark Billings Montana Bozeman Montana oh my gosh that's so good okay hey you know what you know what everybody you know what JS sucks okay that's what happens okay that's what you guys get you guys are a bunch of high schoolers want to tell you hmail's a programming language all these people whose hoodie that is okay the Steel's hoodie I left behind in South Dakota I was gonna give you the Deno hoodie because I do have that one but oh I have that one too that would be great you wait the day one dinner hoodie yeah like yeah yeah of course the dinosaur and everything yeah I don't know anybody else who has that I they closed it and then I emailed them and they gave me an extra one no [ __ ] that's great I had that like minute one because I was I was so hyped on demo early I know but then you realize you just Dash a yeah just let everything go like it's known spelled that out right I really like it for things funny enough like Advent of code where I don't want to set up a build change oh yeah I just want to have a typescript file and run it it's really nice you don't TS know that nope oh yeah it takes so long to get all the right I'm always like types installed node types installed this thing types of 99 Names yeah and with denim I literally make a typescript file I write code in it I type Deno run name of typescript file and it runs it's so nice and you can even add dash dash watch and it will watch it it's like for me doing admit of code is actually essential for me to get like [ __ ] done in time why don't you stream it but you do not open chat or anything you only sit there I I cannot let the public Nate understands I might record it I've considered recording it but that's not to be a public thing both because [ __ ] it it's my thing and also I don't want to give anybody that the advantage of seeing me working on the answers yeah that's actually probably yeah because I could look at it and use it but even that just feels stupid so like every every way I've come up to do [Music] every Theory I've had for a way to do this the conclusion I come to is the people who I would want this to be for are the other Advent of code nerds and they're busy [ __ ] watching why would I do it live yeah they're they're doing it themselves they're not gonna watch that's true yeah yeah I do need a big state there's a big game I want to do something with Excel guy though I very badly want to do something with Excel guy this year last year I was [ __ ] nobody and I was this biggest Fanboy and Twitter he's like [ __ ] 40 followers nobody knows who he is but you know who the Excel guy is he I don't remember his hand off top of my head but he did all of the problems up to day 17 in Excel oh my goodness I quit day 12 on Rust yeah I don't know how it's insane like the things he had to do the amount of times he ran out of memory and the amount of like 40 plus gigabyte files that were accidentally created in the process of the chaos he engaged in was beautiful yeah okay cool I really hope the hand motion I did earlier isn't clipped it is yeah now that you've said it it is and yeah by the way only fans everybody um I was talking about programming uh what kind of programming do you do yeah had the best kind and also people who might actually be recruiting for that yeah I'm sure if JoJo has a role or two yeah but you do have to become a YouTuber Madison is a YouTuber would kill it that'd be hilarious sorry a what vtuber do you know you don't know what is a YouTuber social you know meta parasocial learning yes so so he threw up this thing that said uh you don't watch V tubers because they're cartoons but if you just record somebody it's still just pixels on a screen you just are being like you're just discriminating against what kind of pixels you like it was like the funny I thought it was just the funniest people don't know what a YouTuber is I didn't know what a YouTuber was until I went to the V SoJO party it was so awesome by the way V SoJO I think you're awesome I knew what the first was email with first Speaker he's not a retail to Oto [ __ ] he's the reason I can do all of this he's the one fixing all my broken code sorry for the the free promo you want I'll go get a pink shirt please this is I would wear a pink shirt but I feel like I look better in this right now than like a hoodie so now you know I've never thought about that I just like hoodies oh really yeah and you came with that hoodie did you you walked in with it no one gave you that hoodie no one gave me this hoodie I printed this one do you have like a nice shirt at your house yeah yeah I belong to a country club I play golf I've only played it for one year you know so I I need a photo of you on the golf course you know how oh my [ __ ] hard that would go on Twitter the the best part is not it's not just that it's that when I play the golf pro finds out when I play and he will drive out and go you're not dressed right get off the course I've been kicked off the course like so many times at this point I never remember that you have to dress up to play golf I just want to have a nice time you know so I'd throw on a little hoodie the triggers are just always dress nice okay well I I used to do that but guess what I'm a good job you know what here's the deal okay here's the deal as CEO I don't got time actually you know the real talk though I buy one shirt so at home this is just purely for decoration here but at home I have one shirt it's the same shirt 10 times in like three different colors one cup what my wife loves it when I wear blue goes well with the eyes and I wear that shirt every single day I just go through a thing and stack next to my pants I grab a pair of pants grab shirt and I grab socks we don't fold socks I buy all the exact same socks so I don't even have to fold them pull it out I don't do anything this is the way everything it's in one drawer and I just go and I don't think about it because I don't have the emotional capacity yeah it's like the Steve Jobs turtleneck okay everyone says put it down every once in a while I think my autism is bad but Jesus Christ oh no down getting Spectrum Dove God I you know I just like looking good it's fun and I don't care why people don't the reasons yes Spectrum part do you like that we'll wear a short sleeve too I'm fine okay that's pants though I won't wear shorts okay yeah yeah yeah yeah no I know that's a my wife really likes the longer things too we both think we each one of us thinks that the other person isn't on it but we each or I don't think I'm on it but I think she is and she doesn't think she's on but she thinks I am so that means you both yeah we're both yeah okay I was like fancy clothes kind of uncomfortable though like whenever I'm in like a really fancy dress or even like you're a woman you just get [ __ ] [Laughter] no what color oh it's all over the company's over it's it's done do you have time for a twit logger I was trying to give a somewhat Progressive take woman don't get to church [Laughter] the more I think about the titles of my favorite that was such a great day that was so beautiful I love when you try to say something nice and it comes out like that no he had the best intentions the intentions were so I know exactly what you meant and it was literally I get it anyway yeah someone who's accidentally purchased many a woman's jacket those were not built to be comfortable in any shape like at all yeah yes totally so so you're comfortable in your clothes so you can keep them on the the thing that no one will tell you about like it's okay the thing I want to say about good men's clothes is that they are just as comfortable as like other [ __ ] if they they are fit right okay this is no less comfortable than if I was wearing sweats and a T-shirt and if you think otherwise that's because your clothes don't fit you get that [ __ ] fixed yeah the one thing we do have is like dresses though it's like this shirt is actually a dress dresses are super comfy so that's like the one thing we have and we can wear dresses it's just we get looks yeah it's just you get looks but Celts yeah I know I the guy that smokes the pipe and wears the Kilt and goes to the smoking Lounge in Rapid City he's a cool guy like talk to that guy the Kill Everybody yeah the reason I brought all this stuff I think it would be funny for Halloween if I do the hoodie and the akgs and you wear a nice dress shirt on stream I can I can dress shirt I can do it I own a couple I I would give you a men's Express discount code but uh I don't sorry I don't order such cheap where my my expensive the one company that made nice [ __ ] that fit me got bought by [ __ ] ASA so I'm just [ __ ] Aces the computer monitor place no there's actually a cheaper company with a similar name Asos that's like the fast fashion brand and I'm pissed because they used to make nice stuff and I bought two shirts from Top man thinking it was still top man just under a new like parent but they're like Asos labeled and they got stained just for me putting them on you know I like shirts that are built with the stretchy material so I get those uh this is decently stretchy yeah these ones aren't stretched because of pants but um I like the uh I think they're uh roads Rome yeah Rome yeah right yeah my wife gives me the wrong basic black tea and the blue ones for the eyes so no button-ups then all right we're butting up some of course remember we talked about it I thought that it was just like a polos that you're talking about though yeah those are polos are those not button-ups no no you need the blue well if it doesn't button all the way up and down it's not a button well really that's funny because there's buttons and you button them upwards so I don't know why you guys have such technical definitions this is bike shedding mark bike shedding our first IRL stream is US Kirkland is where it's at our first IRL stream was teaching final engine had a dress yeah that'd be really fun Imagine bringing Prime out to the city like getting him like very fancy clothes I love that it'll be so fun it'd be like Pretty One um everything you guys are saying somehow doesn't settle well that's true I've never seen you in like anything besides this I wear really normal I would do a suit I do a suit for certain things be great to see thought of UNSC is hilarious to me yeah I do it for a wedding gonna look nice for a wedding um that's about it anyway could we invite him to our wedding yet [Laughter] where's the invite yeah where's my invite will Prime leave Netflix Theo I'm not allowed to answer this one this is for you will I leave Netflix that's always a better offer yeah versel think about that it's always an option Netflix pays me two million dollars a year by the way of Versailles so you better you know go buy anything you spending the startup yeah multi-billion okay dang for Millions to billions that's the real move M's the B's yeah CEOs are expensive I would know yeah and the reality is I I'm multiple CEOs cheap Chief empathy officer edging officer mostly mostly edging really badging is really where it's at yeah I I think first of all you could use a chief edging officer honestly they do yeah I would continent the current CEO you guys could be co-ceos co-ceos I I agree with that that's one of my demands will be I need a CEO title what is that all what do they do what's the job responsibilities of edging yeah is to keep people on the edge of their seats oh okay being engaged Madison why would you think it was about I don't know keeping you from releasing Madison I don't know yeah you don't want to release too early Madison that's been a problem with yourself recently actually so yeah yeah releasing too early is a really big problem will Prime affects turbo pack if they hire you Theo there's tutorial pack broken did make a recent commit the yeah it was as a core maintainer yeah once this PR goes through speaking of PR make sure you go lgmt yet what is it LTM yeah l g e t m looks good enough to me okay good enough let's get them toes lick my toes lick my toes that's what lgmt stands for liquid toads goodness I'm very I'm not going to say something inappropriate we have a Mark here penis here you'll speak bad for the penis guys let's get to monetized because we said penis too much I'm gonna be so amused the Dick's jokes how does that happen because you say yeah is that the p word instead can we just remember Marcus p word I feel like it's fun here p word hey B word 64 bytes of pee that's a very good joke I know people like it but I don't think anyone's gonna like that dang I know it's a word it's just about JavaScript kitties in here kitties now it's a terrible joke oh Dev it was a great job Jeff I thought yeah who's the awkward guy which one guy okay I know the words three of them which awkward guy and then me sorry yeah 32 bites when the time frame show up in the background what's the best joke yeah what's the best joke he said I don't know what the best joke is he said to you he said Prime what's the bishop I don't know if I know I don't think I know that's joke oh talk about your history of programming Theo the one you told me no history when you make eye contact with me yeah I died what [ __ ] joke I don't know the bids oh the 16 kill of it the 16kb I almost want to make it a band term at this point foreign God how'd you deal with 16 KBS uh turns out if uh I think they fixed it now but yesterday when I tried the next JS stuff if you use so their polyfilling fact should do some weird [ __ ] yeah and if you get a response that is bigger than 16 kilobits it just fails silently and hangs on the fetch I like it I like it yep it was very unintuitive teaches you a little something everybody in chat was saying the 16 KB bug is like what the [ __ ] a 16kb bug somebody links me to like a chromium issue from five years ago there's nothing to do with anything we're talking about okay ban whoever the first person was to mentioned and it turned out it was a different GitHub issue that was actually the problem you got another little uh gifter right there for 19.99 from Dev coffee is that what that says sorry I'm trying to read except I never think I'll get Justin Khan on the stream uh return your email so no yeah uh he replied to some of them but they didn't he replied to the bad ones and not to the good ones so yeah a little bit of judgment on my part light judgment that's not what we talk about that person is so far behind did you um did you make sure that live replay was not enabled because that person is like that person is so far behind they have no idea what's happening right now poor YouTube guy yeah that's like years ago Chuck I know this is like 15 minutes in the future but we appreciate you Chuck but you're so far behind you have no idea what's happening yeah can we check who won the lottery so we can send it back to him I like that um is insane I guess this is normal for you guys but this is kind of slow for us wow this is a slow day yeah it's so late yeah it's late it's late it's real late I'm surprised we're getting this type of viewership this hour but all right talk about rest I don't want to talk about rust you guys want to call it you want to go get noise so I said they're only here for Ken and he's not here yeah oh I liked Ken yeah Ken was great Ken slapped me only once yeah well I forgot but like be in the nuts and film and I've totally forgot he came up behind me and what slapping we grew up watching the exact same [ __ ] it's just the jackass like oh yeah yeah what a day Word of Life gotta watch that monetization he would uh Ken was definitely like ready last night he was like he's getting last night again you're doing this whole last night thing slapped you with one next two days ago that's two days ago yesterday I was so tired from next comp that just yesterday didn't happen so I feel like I keep saying last night is in checks out we call it right yeah this was fun Yale nerds got lots of good Clips I'm sure thank you guys if you're not already following our wonderful set of people here please do we have Madison Twitter Dev Legend getting hired very soon hopefully not sure where just yet that's her problem not ours I know we have Mark our marked on Twitter the person who is responsible for me being able to do content because he's constantly fixing all my bad code from a year ago and primagen uh without introduction that's awkward just just hit that it's free click that don't stop Subs aren't free but they are really cool so you can hit that button too yeah you know why the hearts art sandals are underscore Mark can the mods be spamming these in the chat but you know why the heart's empty right because their heart is empty too damn right follows are free not willing to give away free I don't know about that get on that assistant only times again what is it who are we rated we're gonna fight after this I know right you're only fans I do have one the prime yeah only fans vs code content you can see something right long tiny hands okay they're not tiny I don't know that's true they're very masculine okay there are great silence they're big yeah they're huge okay they're huge they're huge look at these things so like bigger than my head I'm struggling to find anyone let's see it's a big crew to throw at him someone said whose voice never mind oh oh yeah there's like nobody it's so late you can pick just pick somebody pick somebody low because he's a YouTuber yeah you can do a YouTuber I don't want to pick too low with this size of a crown what was it V2 has things to do with animals last person said the word huge also had tiny what's good okay we'll talk about it officer okay okay I missed the first joke because I was too busy American Eagle shirts are whoa my goodness this person so far in the past which person she said American Eagle shirts are comfortable it looked pretty good we won't talk about clothing like 30 minutes ago see this is like yeah yeah that's I don't know what you're watching I'm setting up the raid now we're reading midnight Simon looks like he's programming or something yeah midnight seven he's actually he has a very soothing voice cool that'll be a perfect uh thing to play us off by the sounds of it then because uh one set of soothing voices to another yeah and very soothing my voice well known for for helping people fall asleep yep I uh also contain the cartoon voice so I'm very happy about it missed a ton of subs thank you all I promise to shout you guys out in the next stream I'm seeing five guests from locked and coded and from over deaf oh over debio over debbio let's go that's good guy [ __ ] I appreciate all of you guys let's go over Debbie thank you all see you guys probably next week peace nights bye bye now ## Prime and Theo take on React Miami (With Madison and Dax!) - 20240420 live I don't oh we're live dang any of the things I probably should have before that but uh the alternative we don't go live so are we live Twitter uh we are not live on Twitter just twitch and YouTube we do not have the bandwidth for that we don't have the band with for it no we don't have to B much of anything here but we got it working sorry for everyone sorry that we're late it was uh a lot of work to set up I've been here since about 9: in the morning and we just now got it working mostly so uh let us know in chat if things are wrong I won't see it but I hope somebody else I'm pulling up chat right now okay cool I will do the same jeez sorry YouTube chat we're just not going to see you today apologize YouTube we're going to treat you the same we treat you every time which is you don't exist anyways sorry YouTube chat oh I don't have internet love you oh yes internet you don't hell yeah all right hey you never gave me the title oh um just say live with Theo yes I want to watch the tutorial for stream manager right now that's exactly what I want to do twitch how no all right hey Chad I don't know if you know this this is react Miami okay lots of people put a ton of effort into making this happen even Theo's been here just all I knowa but what's Miami Miami is the city of the soulless that's why I live here makes sense Dax you look so incredibly small compared to me I I hate it I hate it people the same size boother dude my bicep is as big as your head that's actually just true that's just a fact we can scoot slightly I have plenty of room here should we scoot yeah but but you guys have to be slightly back and I have I'm worried for Dax there you go I'm worried for do you want to I'm going to I'm going to PO my chest out I'm going to stand up straight and hopefully it helps my head still looks tiny it's cuz I have so much hair and I don't have any thanks for rubbing that in thank you what it like you should reorganize so it's shortest hair middle then me here and the longest hair hair radi whatever you want torso length we could we can we could go by torso link for real for real all right hey let's go by let's go by tallest the real question is how many people in chat have actually been watching react Miami to this point right because they've been live streaming do we have any casual react Miami enjoyers cuz I have not gotten to see a single talk yet because I've been doing this this whole time oh are we Frozen is the stream working the stre should be working okay you guys are kind of rookies here hey anybody in chat if things aren't working let me know yeah can you put Fs in the chat for success that's what I'm trying to say don't them put Fs in the chat in the chat you know how much Fs in chat stress me out [ __ ] why do they you it usually going full right now we're getting effed up right now oh I love it f f f successful I think it's cuz we're Frozen it's I really wanted to have the react experience which means we have to successfully fail yeah failed successfully it also react but we can't even react at react Miami it's called react Miami I guess we have to bring the react ourselves I had one chance to do this well and I screwed it up what the issue is let me let me announce that I'm I'm going to announce this the stream and all that sounds good joke okay yeah I have to do my ADD everyone still actually let me do that on the real question is that's good for those that have watched any of the talks what do you think so far they fantastic the are great what was your favorite part really incredible the first one and the second one were good who was who was the first one uh it was a a react a developer that uses a react Kent would be his name yes yes Kent amazing the only react Dev so good he's the number one react Dev on Earth I think he is he is known as number one he also rides a big singular wheel yes I wrote it last year there and then someone took a video of me and it was pretty embarrassing are you bad at it are you like that bad I was okay but you know first time it's hard do you think you first time oh I've won Wheels you've one wheeled yeah I think I could ride it first try oh you can it's not hard to learn yeah it's my toxic trait I think I can do anything literally like a like the particle simulator particle and I did I did a particle simulator in one hour I was there I saw it yeah I hate that you did but you did I did it it's my it's it's how to be a successful engineer is you have to think you can do things which you physically cannot fail physically emotionally spiritually you were doing some jumps in there earlier with Moy we had a jumping contest we need to talk about that immediately for those that don't know this wait I got a video of that you got a video wait I missed a jumping contest there was a jumping contest and let's just put it this way mey came in with the excuses and Melky left with no trophy you come to lose you lose I'm pretty sure I could jump over mky like standing height no it was a distance it standing long J distance that's lame that's standing long up is super hard it's like standing is literally just do you have like long enough like legs that's not true when you jump high did you know that there uh between a flea a deer and LeBron James they all jump the same height there's actually a maximum height terrestrial creatures can jump but there's but the long jumping is much more varied and so long jump is a much more entertaining way to see human feet and jumping than height jumps as a skateboarder I have to call [ __ ] no there's a terrestrial maximum we can look is that terrestrial maximum somebody jumping over a picnic table the long way because no it's it's because of it's uh it's due to the fact that uh velocity is proportional squared right so there's like only so much you're going to be able to go against a squared or you made the par accelerator I get it you can acceleration goes is square it's actually just a constant in the simulation that we're living in they just capped it the con there in the simulation the fact that All Things Fall the same speed sounds like an optimization hack like there's no way the universe just works that way it's just easier to do the math that way it is it is anyways chat so there we go a bunch of us who don't actually work in the physical world just just got done explaining physics quantum computers next you ready yeah real streamers talking about things we don't understand at all it's actually it's it's actually how you do this all right I'm going to get this in the I'm going to get this in the the old chat thank you sorry that none of this was prepared properly ahead of time I did my best I I swear this was a a long and complex setup and I've learned a lot since shout out to chantastic Michael Chan for those who know him the guy who hosted the react documentary for supplying half of our microphones also shout out to adam. deev for the camera and everything involved with that shout out to Michelle and everybody involved in the conference for making this possible in the first place and getting us this beautiful table yeah it's been a night or a day it feels like a night already Jesus and shout out to Theo for working on this since hours ago and get trying to get it all to work oh my gosh I thought I took too much money for the sponsor I did not take enough that said Thank You clerk for sponsoring as well and making this all possible getting us all here for this cuz thanks clerk thank you so much Clerk and that just be just to be clear that's not the movie with Jay and Silent Bob no okay that's clerks oh that's clerks yeah different that's a different show we're not talking about that you could reuse the merch I bet just cover the s or take a clerk merch thing and put the S on the end that could work I'm so what's the plan are we going to watch the talks we can't watch the talks none of the things I need to do that were provided we're not some of them were but they were entirely broken so it's like the opposite of providing Hardware I see so we're going to sit here and we're just going to guess what they're saying in there yeah let's predict what's the current talk and we can guess what they're talking about is it going on right now is there a schedule that I can open without changing or closing my channel talk last year was it good it was excellent wait who talk is it Uno oh un oh is going to be [ __ ] phenomenal she showed us all this crazy CSS stuff that I didn't know you could do oh yeah because we all use Tailwind I've heard of Tailwind have you yeah yeah I have it's quite controversial I actually think you would like Tailwind Prime I actually do like tailwind and I try to explain this to people here I'm going to give you the the the old kogin programmer reason why Tailwind is great are you ready for this yes all right so in the IE8 i7 ie6 days what we would do is we would build something called left and all it was was float left then you'd put clear fix and you do that and then you do 1/3 and you'd go through all these different things you'd name a bunch of utility classes and you'd build your divs by using a bunch of utility classes cuz it was impossible to do CSS like it was so so super hard and then we got all this fanciness and everything came into being and so we quit doing all that and then everyone started doing like JavaScript CSS and it was a terrible terrible like last 8 years and then everyone realized that IE s days were always the right days which is just a bunch of utility classes wow this is wild this sounds like a long time ago was this in like the 19 20s when this happened when was this happening this was happening are we currently sitting in age order I think we are wait how old are you I'm not going to say my age I'm above 18 she's a woman you never ask her age she's 28 clearly D what the heck you never ask a 35-year-old woman her age okay I'm sorry I'm 42 four kids beautiful husband four kids beautiful husband I'm not 42 okay I'm not in my 40s yet Sor I am a beautiful husband 42 you're 51 yeah beautiful husband love it love it yeah I tail one's been an interesting one where like the only people who dislike it oh thank you Eva for the gift sub appreciate you a t but uh trying find the right way to put this point like I feel like the midw meme misses a lot of nuance that's important in midwit conversations where like there are like in the middle everybody likes tailwind and on the far ends Everyone likes Tailwind but there's a gap on both sides like from like knowing something pretty well to really well where in that Gap there's a range where you hate Tailwind because you don't understand CSS well enough to know how good it is but you understand CSS enough to hate Tailwind right yeah I mean we I think a lot of people were doing the tail one thing anyway like for years we were just making a bunch of utility classes they were inconsistent not as polish going so they just came around and standardized it so who didn't have margin small okay who put margin small which was always 12 pixels I don't know I never I don't have small margins I never had small margins I don't use margins margins are an anti- pattern yeah margins affect things outside of the element your element should not affect things outside of it ideally when you mount something in a component as a parot component you should dictate or you should dictate what happens outside of it a component do not control what happens outside of itself you guys sound like a bunch of Zoomers I know like some of us didn't understand any of that some of us have to go out there and make tables at one point in our life okay how do I get padding but on the outside yeah was that the quote that is how margins work padding on the outside also reminded be shout out shout out to Mark our av guy my CTO and the person who quoted Prime on that wonderful wonderful quote possible how do I get padic on the outside I on the that quote mark pting on the outside yeah it was in a terminal okay it's a very different experience in a terminal it's still called margin yeah actually margin's very useful when you're building terminal apps I would imagine how do you do margin in a terminal what's your strategy tell us so there's this thing called charm have you heard of charm bash bunny can I shout out bash bunny you spent how many hours trying to reinvent it before caving and using it uh first off our system is genuinely more Superior because we can do we can do modals and did you ship your Mo your system uh yes we did we got pretty far but then we bailed to prove Dax wrong wait how did you prove me wrong we buil well I built it in one day TJ went off and apparently fixed your oo or whatever it is his credit card I built a UI the least UI person built a UI TJ fixed your UI that's what I remember my favorite part about all of this is that the the service like the back end that runs all of this was written by Dax in JavaScript and they wrote the whole client for like the CLI and go yep we are the only Inver we call it the funnel stack the funnel stack it upside down Oh I thought that was a joke when you guys tweeted that no it's theun joke how happen well I didn't that's why I didn't do that I did that that's why I really tried to make it it's an upside down triangle wait so how did this happen JavaScript on the back end it's very very simple it's extremely simple um TJ and I are really based and awesome engineers and then Dax helped out yeah than to me the app actually went out you know what people are saying on the internet and didn't because it just says react Miami oh yeah I did see that but that's not my fault that was your guys side the company's not going well we're already fighting a lot of fighting going on there's going to be one Co the co-founders are going to push one person out who's it going to be not going to be Adam's the most useful fund and start a another company just to fight back out of spite and I'll be sure to invest in that Adam is the most useful person he is the biggest and strongest but he's the one that takes all of our [ __ ] it does it's true I did not expect him to be the most jacked person here it's outrageous Adam Adam is an actual Greek god like he he is pretty Jack you think he's the most jacked person here he like he could lift meky dang yeah he pinned Ken wheler for the record this is Adam not Adam rakus his Adam's diet is clearly Adam Rus would like break his leg thinking about it veganism no are we converting toan we got a raid from Janet thank you so much for thank you for the raid it's not your I have no idea how we're doing numbers I could see foring anything from here all right but seriously though did I don't know if you know this but coming up here shortly in about about 9 minutes I believe uh Tony kasoro is going to talk I'm I'm actually sad I'm going to miss that him and I have created an LLC together really we built companies together so you known him a long time I've known him for a long long long time where you first meet uh Netflix you're both working there he started he started at Netflix in 2014 and I started in 2013 wow and so then we worked together and we'd argue a bunch he was on the website and okay so I had to make this this feature along long time ago in the react land you may have heard of react and I broke the website a few times uh using react but one of them was that we have this show called Black Mir and the first episode of the first season is a little bit more controversial than the rest of the episodes oh I think I know what you're talking about yeah and so we reversed the ordering for when Netflix did our season season 3 so you'd actually see the newest content first cuz it's an anthology series and so I had to come up with a series of flags in which were um which were really really great except for one of them I screwed up and I called the flag hidden as opposed to show episode numbers ah you know so I put a little knot in there so there's a bunch of not hiddens spread throughout and Tony was fairly disappointed let's just put it that way I upset I like it's it's on every single platform I ruined actual Netflix code that was me I did that and that's how you guys became friends and then we started a company together afterwards so Tony's great Tony should should be starting here soon Tony's topic is on the trade-off between complexity and designing a good product how do you plan for now and not forever what Tony GA by chance Koro oh he's great yeah there's another Tony at Netflix who I love there's a lot of Tony to it's actually 10% of the staff's named Tony yeah the guy who like TR we describe Tony I worked with at twitch he who went to Netflix he was the the graphql guy at twitch who like made it so company of T scth could move to graph well seamlessly out of [ __ ] nowhere just showed up and did that and it worked great but he always felt like the front end people didn't really interface with him enough so I kind of became the bridge between the like the services side of twitch and the like client side of twitch and him and I just met all the time and like push a ton of heavy stuff it wasw was his last name GA GH he was a legend he's a huge part of like me realizing I could like reach over past like the the area I'm supposed to be in and have real impact like all over the place and it was huge like I owe him forever the funny part is is that I I did work with uh Tony Tony uh quino and I also worked with Tony miles and Tony casoro but just not and there's also another couple Tony that I didn't work with there so many Tony I told you it's 10% of Netflix staff at one point were Tony's they should have named Devin Tony they should wow Rebrand I don't feel that we should talk about AI yeah because I get too triggered and Chad is going to try to trigger me can I get F in the chat for fantastic we don't want in the chat we don't want this I I dislike your appropriate creation of Fs in chat L stands for lovely take so can I get some L takes in there for a lovely take we have lovely take and Winner Takes okay it's just L's and W's for us all day long an optimist I'm an optimist lovely take thank you see look everyone's so happy about it you know what the real good insult now that we're on AI is is saying that's an llm take you're the most average take I've ever seen in my lifetime I I'm going to wrap all of this around it's an LL take if it's really bad react code you're insecure about because lowle learning has not let me look and a at and audit his react code and it's been like a year now that he's been telling me I should and then I say okay I'll do it and then he says wait no I don't actually want you to see my code you're going to judge me too much it just won't let me do it nice hold strong that he accidentally left Source maps on so I was able to get all of the source code for his website so I can now Rogue react to it I really want to wait what is his react code for it's a project uh yeah I I don't remember it's some typ of like website for learning about lowle stuff that he built a learning uh it's his learning platform I actually I'm a student there oh no [ __ ] um yeah it's great I love it is it buggy uh it's buggy it's really buggy I'm sorry I'm sorry no this makes the audit so much more fun I have to do this now like I couldn't log in the other day and I'm like I paid for this but I love it it's a great course as I I took the C course I started taking the C course it's amazing I love lowlevel learning I'm SOC there's a few there's a few bugs I'm not going to lie but it's okay it's an adventure it's an adventure all right hey you know it's an adventure you're learning C I'm trying to learn c yeah we had some good discussions about it tell us about pointers so we say anyone in the chat learning c f if you're learning C is that am I doing it right F if you're learning c yeah F the C if you're learning it right now I'm still confused on pointer so a pointer is literally oh he's about to go to I'm sorry I'm a devoted student I I did cancel my subscription but I will I will oh my God but I'm signed up recently she also unsub to you on YouTube I'm going to become a lifelong member anyway yeah so okay pointers are literally just a memory adust pointing to Something in memory but I don't understand yet why they're so complicated so I think I haven't written them enough to know why people stress out someone tell me no you just nailed it that's but why is it like they're so hard they're so hard I don't get it I think people are used to languages where it's not a thing so when they see a new thing they think it's like something crazy so how does memory work like in JavaScript then so like there's no concept of pointers how would that work there is concept yeah but it's like under the hood right cuz I never knew when I wrote JavaScript I didn't know what a pointer was so when you an object you mutate it does it mutate a new copy or do you mutate the one you pass in uh wait what when you like fun function changes a key on that object oh okay what does the original object change or did a copy oh my gosh it copies it right wait no it changes my bad my changes yeah there you go pointers I don't know JavaScript either that that's literally a pointer unless unless you pretty much always in JavaScript passing is passed by reference so when you something right instead of my value I see I see okay the value just happens to be an INT which happens to be a pointer so we always copy you just copy pointers huh mind blown yeah all right yeah so technically everything's a point when I used to hear JavaScript pass by value pass by reference I thought that was a JavaScript thing starting out I didn't realize no long time long time AR RA are a JavaScript thing that no other language has this JavaScript or uh Java did it a lot so Java was all about that are those up I don't have sunglasses yeah I question I have a question about the point pass by value pass by referencing I feel like people have different interpretations of this right so there's some languages where you can do a Implement a swap function you pass in XY and the function can swap the values in it for anything referencing it outside that's how they Define as pass by reference we are definitely talking about react right now at react I I just don't understand that API what do you mean by that like you have like two numbers if you have so if you have a function called swap it takes X and Y what are X and Y numbers whatever or pointers to numbers okay so it's a pointer to something yeah so the the same type wi or something else so this function can swap the values yeah and anything reading those values are now going to be switched on the outside I would say that whoever wrote that function should get fired cuz that is an evil function okay it's a function that only shows up in textbooks so it's it's not a real s to far from how reverse Works in JavaScript to be fair that's cuz it mutates the original right yeah it's the most evil thing I've ever heard in my lifetime I actually love reverse reverse is my favorite JavaScript function it scre people over so much I don't realize it's return mutating the original array because you can't judge a book by its cover in JavaScript oh it's cover says it's returning you in Array it takes an array or returns you an array must be copied boom no boom goes Dynamite no and then sorts is different and now you have a what's the one that mutates a sword two sorted no sord sorry sword mutates yes two all the ones with two don't uh mutate they copy they're adding two reverse and to a bunch of others now too to fix this problem but great now we have twice the number of functions let's go back to talking about C we'll just talk about C all day at a reacton for no I'm just kidding all right so a pointer is literally just like you said it's a Memory address that points to something is just a piece of memory now how you interpret that is the type you put on the pointer because remember memory is just a bunch of ones and zeros it's AR of ones and zeros a big AR like an array of ones and zeros okay and so if you have an INT pointer and or we'll go an I64 to make it more understandable that means what it points to there are eight bytes that are uh a signed integer mhm that's all it means so you're going to interpret what's behind the pointer by the type it is but the internally it's going to follow the pointer and get that memory so it's literally just eight bytes but of type integer yes okay has anybody seen Ken by chance yes Ken request so far we aot bu today I think I think he left though I don't know if he's still around is prime getting jacked I wouldn't say I'm getting jacked um I just you guys want to do like a high school photo you want to do like a high school photo nothing I know I just hurt my neck oh my goodness just I just hurt my neck I've been there I know exactly you look really huge like it's crazy like I I I just work out a lot objects and mirror are bigger than they appear Prime worked out today I did work out today you know what's amazing is that I worked out today and I was invited to work out with Madison yes and now I went by myself so we made a plan last night Prime and I were staying in the same we were like okay we're going to meet at the gym at 8:20 and then I woke up I'm like hey I'm ready and Prime's like oh I already went at like 500 a.m. sorry you missed out wow I can't I got to daxes on Wednesday or on Thursday morning was that that was yesterday Jesus Christ I scheduled a mess but yeah when I got to daxis yesterday at like 7 Prime was in his [ __ ] bed refusing to come out so yeah you going at hang out at 7 I see how it is we were all prime was just tweeting in bed we knew he was awake cuz we just saw his tweets Prime had to wake up early this morning you had to take a selfie first thing you did gym selfie D self influencer girl you should done like a booty pop right then booty pop takes a picture first sends it to a CPA and then he sends it to Twitter yeah just so they know I am actually continuing to work out do you know you can go to the gym without taking a selfie it's impossible I don't believe you first off okay and second off I mostly keep my shirt on that's you mostly yeah yeah I you know I what are the exceptions the exceptions um I want I'm you know what I don't actually have a rule there if feels it in his heart I feel it my heart I go by what I feel here that sounds about right also when I'm coding HDMX it just makes me feel hot and bothered and got RI the shirt off sorry HTML I just mentioned HTM X at a react conference HTML prom Bas the same thing now with server components so so true all right yeah one happens on the client and one doesn't work so here's the real question okay who here is actively using react right now oh uh we we're yeah are now using it you're using solid that that basically counts uh no I don't want to count it that literally does count if that counts I have to switch cuz I'm only using solid to be different that's the only reason don't worry you're still very different that you you don't have to put extra effort in there you're like making a company this whole thing is be different for for no good reason just for the sake of it it's highway rooll I'm from New York you know H front ends and go so I mean I'm there with you I'm pretty different myself that's the company you know you said your logo is B different so you know that's taken s stands for B different yeah the S the S and the T stand for B different didn't didn't it actually stands for some stupid thing people don't know that what's the stupid thing tell us that's what it stands it stands for some stupid thing oh that's it really no that's what it that's what now it stands for some stupid thing yeah okay but what does it stand for it it's a long story we don't need to get into it it doesn't stand for it doesn't stand for anything anymore we used we wrote a book called serverless stack and this was like the guide of how to build stuff on AWS and we abbreviated it to SST that got big we reuse a name for our product and now we're stuck with the name you're insecure that if you change the name that nobody will use the new thing yeah people mostly downloaded our stuff by accident that's where like 90% of our downloads come from I'm just typing like n react and I type and SSD comes out exactly people download stuff by accident that's a joke no that's where most down no I'm kidding it's a really great way to do um what's it called uh what's a uh supply chain attacks is anytime any new library comes out you just you create every like a typo Rel you just NM post install hit him with that script that your Bitcoin and then you're screwed uh so I work for a company called inbox messenger and the app's name was inbox on the App Store and most of our downloads were from people looking for like Google inbox which is big in the day but some of them suck around so you know if you're starting a company name it after another bigger company it actually kind of works hey I want to let you yeah someone just said that your voice is as if pirate software and I had a baby that is not because pirate software's voice is already perfect so it's just he's just saying as taking something perfect and like messing it up with like a little bit of rust and mustache taking something perfect Ming it up no it's pirate software's neck beard his mustache combined together creates the full beard can we change topics I'm not liking where this is going at all we like this this is what the people want this is what this is what they with chall I think a selfie would be for a scavenger hunt and people have been very Wiggly with the definition of selfie with Theo because I've been too busy to actually do the selfie fire I saw okay I saw so many people come up to you and you were like just not even you're like doing working and camer for us just just watching it just okay yeah normally I'd like wrap something around the camera but I did not plan ahead enough for that people are very scared of the monopod yeah it scares people it's uh not the most stable thing I've mounted a two $4,000 setup on to be sure should we get any of the speakers on the after half to give like a quick recap if they want to yeah I would love to grab people around I don't know if it will be speakers or whoever but just relevant people are always fun I see VES right there who's the creator of excal drop and like one of the most OG of the react World he's wearing full Bo too that's pretty radical we Ryan Florence walking around back there yeah there's from the grab people guys I can be our little Grabber what the wrong word no you can go around and start grabbing people and don't say anything who's the best person to bring on First grab good enough can't be an impossible act to follow is the catch so you have to balance it out Ken wheeler Ken wheeler where you at there's no chance Ken Wheeler's on premises there's no chance wheeler is currently using react or Miami's drug Supply right now all it's it's actually gone it's a dry after yesterday if you came party is right here that is a fair point we can start with Jacob all right do that hi Jacob Jacob want to come on to the show we only have four mics so boot me you want we're booting Madison me come around this way cuz we're booting Madison and we'll send you to go find people uh you're on my I Jud you know people well if you can find anybody interesting bring them all right Ryan yeah get Ryan oh you don't that's fine howdy representative from clerk number one you're out of control be one of those indiv like number two whoa whoa you got to talk towards everybody you can't just only look talking to the camera first off is our sponsor you're a sponsor he a clerk now I'm working at clerk that's right engineer nice did you help Madison get here help who get here Madison isn't isn't part of the the the sponsor deal was organized separately through me I'll we're working at Madison let me pay for her travel she after all of this she should be convinced so you you helped sponsor her to come here that's pretty cool that's rad did you see my tweet today someone some a clerk employee left their laptop in my house and I tagged ozero asking if they wanted to buy it I I mean I I know it was Jeff yes I didn't know if he actually know it was Jeff I just assumed so I love I just confirmed it whoops I didn't know if he was going to get in trouble so he got you he got you he got you Dax um did he get Core 2 out he literally got it out at dax's party so he did actually ship it it didn't tell me and you also didn't tell me even though I told you to tell me nice for those who don't know basically all of the annoyances I've had with as an off provider just got solved like at once with a big overhaul of the the core of clerk called Core 2 you don't install two you install version 5 but with that comes the better core it makes the performance way better it makes the middle wear way lighter it just gets out of your way much better and I already recorded my tutorial using that new version funny enough cuz I recorded it twice with the old version and got so frustrated during the setup I said screw this we're using beta software I know it's beta whatever we'll do it so if you watch the tutorial you've already used 4 2 if you haven't you should try it it is way better beautifully done core two with version five Core 2 is version five yeah so Core 2 is basically just think about it as like a lot of the internal stuff we call that Core 2 the V5 is uh the version five of the SDK for like next JZ what's the internal uh name for Core 2 it's it's Core 2 you missed CH electric Baloo that's ridiculous I am I I have to admit how old put it in your mouth put like yeah right right in my face all right yes I would agree with you that that was a m did it even come up did anyone suggest it electri boal no you guys just start paying this guy I literally a marketing genius I'm just going to call you anytime there's some like like anybody's like Hey we're going to do a a new product release I'm like hey Prime okay just let me know immediately you said no AI never mind no AI a uh a machine learning based generator for Prime names for things where we take all the things Prime name stuff in the past and train a model against that you know I've been trying to be pretty clean on this stream but it'd be nothing but dick jokes if you did that I would not recommend using whatever I've said as an llm generator just got info apparently Ken will be back from lunch in 30-ish minutes speaking of Dick jokes oh my God that's why I came to mind he's like a big walking dick joke oh my god oh man just not emphasis on big I mean for him maybe oh man giry makes wom uncomfortable so how many the CLK team are here today uh so uh don Demetrius my my my uh uh head of Deo yeah is actually mcing so yes he's wearing uh quite an outfit it's it's it's it's beautiful pink suit he got his hair done his hair looks great like looks looks like like a not that I know what that's like but like a like he looks like a boss do you ever miss having hair oh my God sort of you know what you would think that having less hair is less work but I got to shave my head like every two days it's a lot of work and honestly that's that's part that sucks so how come you're not just like doing this thing just letting it happen like little skullet going I feel like that's like clinging on to something you don't have and I I just hate that I hate that feeling it's gone the moment I start losing my hair I'm like it's gone I'm taking that all off do you think that you're trying to let that much chest hair out as compensation for the hair lacking on 100% that is exactly what I'm doing I've never seen definitive prove that somebody can have both both what hair on their head and hair on their chest amount in both but like one is compromised obvious no Jay have you seen Jay have you seen his hair his hair is amazing and he's got a lot of chest hair but he might be the exception to the rule yeah exception that proves the rule even yeah I love that I love that term people hate somewhere well I mean I don't know about his whole body but mine's mine's working in Reverse I'm losing hair up here and it's working its way down that's good that's good that's just transforming into a viking it's true it's true you're going to lose in one spot you got to grow somewhere else so someone it I mean not me personally I just keep a full head of hair being almost 40 plus some nice chest hair but that's unusual I get it g um but we did get asked a very important question Dax I'd love to hear your opinion on this is clerk used in our app for authentication no we actually rolled our own off which you know which is known for working really well for you guys right hey Works roll it like sushi people here's the problem does clerk have a terminal SDK I was going to say like this can easily be solved clerk just needs a go based terminal SDK for signing in well no we just need we just need CR unironically though having like a really minimal at least an example of how to like bounce off from your CLI to the browser in back would actually be really nice so I I would I would I'd like to mention that uh two things we do have uh rest apis that you could just hit just build whatever you want using those apis and not have to deal with like building out the backend database infrastructure stuff you hav been able to avoid writing JavaScript also he loves JavaScript though I love it so much party kit there's C uses clerk yeah I mean we technically didn't roll our own o we just use SSH o yeah you may have heard of SSH stands for secure cell Shell Shell um it's Quantum secure are you guys Quantum secure Quantum secure yeah so what I'm saying is it's harder to off on their surface than it is to set up off using CLE you know no I disagree yeah ours is as simple you just do SSH and you you got it everyone has SSH around can we talk about about how uh uh Prime here invented jwt's like decades before anybody else even knew it existed is that true yeah so when I used to do so Facebook do you guys remember Facebook apps yeah what's Facebook what's Facebook meta right well no the application still called Facebook I can call it Fook base if you need me to like I we can lean in here you don't want that anyway so Fook base has these apps way back in about 2009 to 2011 and part of that is that it had a very limited subset of what you could do and so I kind of figured okay so if it's like an ey frame and this is all you kind of get you have to kind of play pretty smart and so I'd store the entirety of their authentication in the URL and I did that by taking Json objects en coding them then base 64 web encoding them and then hashing them with some salt and some other things from their account and all that and the way they did security and signed in their pass blah blah blah blah blah right and then I would generate a small little front part of the hash to know if they changed the object at all oh so only the server can generate objects so it was hash do their object which is exactly how JWT it's pretty much JWT so I did that yeah about 15 years ago you also invented graphql before graph Q was a thing we did falor yeah well and then I uh quit and then I also made the world's greatest security violation repulsive Grizzly so you know I've been around that's amazing and now I don't work in Netflix anymore I know related what related related I I did not know about that yeah unemployed by the way I'm unemployed can I get Fs in chat for falor God imagine hiring Prime right now like you look up his name online when you're like interviewing him and you're like oh uh yeah yeah we really hope your businesses work out because there is no other future for you I actually agree with that statement I wouldn't want to hire me much l you yeah I wouldn't hire me either gosh but hey to be fair to be completely Fair um I do have friends now and they would probably hire me hire you D I would hire you yeah yeah he's yeah if you need a de I can be a de R I can do that I swear I would only sometimes talk about dicks about what dicks or Nicks dicks not Nick I'd rather you talk about dicks than Nicks I would never have Nicks in my mouth don't worry I didn't realize how funny that joke was Jo right now that was hilarious that was really you accidentally nailed it stuck the landing on so what what's your current uh uh plan here are you just um like now a rust consultant okay hey first off actually you know what I'm going to be doing here in the next like 3 weeks I'm going to be doing a little bit of consultancy for people with their nodejs servers because they're entirely too slow is that true not I'm not making that up at all yeah yeah you're doing actual work I'm doing actual work something on Rust makes no sense because that implies that people who are developing in Rust are actually making money on their service yeah check mate Jacob you write rust to tell people you write rust yeah you write go to finish a product and you write typescript so you can rewrite it later like everybody knows the steps cler's backends and go right it is my goal for every St I write in typescript to eventually use it that service so heavily that it's only responsible if I rewrite it and go but my goal is to make things that are successful enough that they deserve that effort I mean I we rewrote uh and Cloud Flair uh workers we rewrote the CLI from Russ to typescript yeah um because it was just better that sounds like I have never heard skill issues pronounced so long in my entire lifetime we actually stopped using rust and use typescript because uh considering it's a tool for deploying so much I think it makes a lot of sense the performance of your CLI is not a problem actually we moved from JS to go for our CLI because of performance was a problem CLI that's actually one of the best places you want fast stuff is on C cuz that means developers are using it constantly which means they want that snpp for day for day-to-day workflows like it's got to be Snappy you know got to be snappy snap it up once the thing spins up I don't care too much like if you're interfacing with it regularly like multiple times a day maybe but if you're using it to spin something up that just like runs in the background like my my task Runners do not need to be in a real language so why don't you use intellig then there's only a onetime cost but then it's like the most Superior editing experience because I don't like the editing experience if it was just the spin of time then I would actually probably use it but I just don't like intelligent I've tried I tried so many different one I I tried uh way back at like way back I tried Adam I defend elect oh I tried Adam too I think we're talking about two different things Adam Elmore yeah Adam Elmore the vegan we did not write any code this I told him he just start CrossFit I will some who is obviously not vegan I'm a little sad about how much you bully Adam for because he is not the like loud vegan you very quietly no and and that's even more annoying it's very annoying that he is a reasonable vegan like extremely Anno you expect the V to be annoying so when he's not you have to be more annoying to make up for the Gap there I think our favorite thing we've done though so far is every time we go to a restaurant we barely get sat down like oh by the way he's a vegan this guy is the vegan truly amazing and the waiters start to roast them like the whole time it's been amazing entire time the waiters roast the waiters destroy I love that speaking of intellig uh I'm going to ask you this question cuz you are quite old thank you uh I like the term experienced did you were you ever in the C world yes yes I was do you remember all the jet PRS tools for C I never used any of them cuz I used the proper editor for csharp which is Visual Studio no but do you remember re resharper resharper I used a lot of resharper was incredible resharper actually was I think Pinnacle resharper was like 2009 yeah it was so fast I could type like 500 Words a minute cuz resharper was just like it was the greatest Auto complaint it put co-pilot to shame it put everything there was no better thing you could write a bunch of code and it would just suggest like it would rewrite all of it and just make it better it was amazing it was the best resharper is probably the coolest we should start swapping more people in hate to kick you no very favorite person to bully here shall we pull in the Z both voices sound almost identical really interesting I've gotten that once or twice and even like when I was mixing things and where we both hung out I was like wait I'm struggling to tell who's who sometimes really yeah well that's kind of exciting here yeah if you don't mind I think I've ever done a well welcome is has viewers who who hasn't streamed the two viewers during Co you want to guess how many people are on the stream I have no idea for what it's worth a few more 300 a few more really yeah h I didn't think people liked you guys don't screw it up they don't but they will watch yeah they will watch want to know it's called anties it's a bit over a thousand on Twitch alone right now that's pretty good and YouTu might even have more because I have a thumbnail on it with prime space in it which is very clickable if you haven't looked at that face like do you not want to just click on that when you see it I I really don't want to click on that but my favorite one is that's how you make that's how you do YouTube by way you're on a YouTube so space all the time like shocked shocked Pikachu I've reduced the amount of time I used the shocked face recently to see if it has a difference in it it's been slightly positive for sure you want to hear something weird don't open your mouth don't open my mouth yeah for YouTube videos you when when you when you're doing a thumbnail you go like this but if you you safe to record the whole video it'll actually reduce your clickthrough rate opening your mouth I hate everything about this the only reason for that though like all of this comes out of the same thing it's novelty when since the open mouth crazy face thumbnail became so popular doing it differently makes it the thing that's different stand out more as soon as everyone as soon as it becomes the meta the meta's over what if you just uh it's a picture of the back of your head honestly that might work I'm I'll try that I give that a shot if you all need help you yeah for those who don't know actually we probably should have introduced you who the [ __ ] are you uh I'm I'm David no you're Z that was my when people say David a we try you need to try it again uh uh you know I guess I'm Z which is zeeg or David or Kramer um I started Sentry a long time ago I'm an executive Sentry uh everybody knows what Sentry is um the in chat if you don't know what Sentry is if you don't know what Sentry is I'm confused but uh the guards right you know something like that guards yeah but uh yeah we just do application monitor actually number on you know yeah there's a lot of ones ER when you push your code out we know it's going to break but do you know if it's going to break that's why you use Sentry you get alerted when your code breaks which is going to be all the time yeah we see see everybody's bugs you know the hell that is taking like your Source Maps your deployed software what your clients are running on their devices and then the errors that happen from any of those parts and trying to pull that all together make it easier but they are the place you put all that data also we don't write errors like go developers have no errors that's why the air handling is so bad is that right no go has good handing I hate go I hate go so much and has good air handling we we don't have errors because we know when things erir oh yeah like here's the function I mean John only errors so what we mean by good error handling is you're expected to always return an error is one of the things that a function returns like always yeah he hates that he comes he comes from the python World python they figured this out yeah your python code doesn't ever error because your python code doesn't really run you want you want to consy what if we fund JavaScript because all of the JavaScript code is broken and it keeps us in business I I would believe that except I don't think you need to do that I think most developers just Bren spor of me makes so much more sense it all just came together so I result in more Engineers who make more mistakes using the tech obviously next a are entirely broken nobody would ever ship anything on those so by doing that I'm now making an infinite set of future customers for centry wow does that mean whatever you think of AI is beneficial for Century meaning if you want more AI it means that AIS are worse programmers than humans thus introducing more errors thus helping sens in the end but if you say you don't want them that means AIS are actually the superior program rers because they don't introduce as much errors thus they're not going to be as beneficial for you you I have no idea this scop is so great I want to know right now what's your opinion on ai go uh it doesn't exist I don't have a controversial opinion I just don't think it works you know I like the the co-pilot intellisense thing but it's just like slower than any other version of intell you should try super Maven it's faster it's not much better but it's a lot faster super M does not work in Neo nothing works in I'm amazed that people use VI still I guess there's somebody here with a neim shirt actually yes it's defia s from twitch chat oh no [ __ ] yeah is there a Neo emx neox Doom Max it's emx yeah it's just emx yeah unlike them they actually keep updating emx I'm just letting you know that vim's a great editing experience and if you can't edit with it you just have skill issues oh there's defin you have to learn how to use it I'm great with Nano by the way Superior super your terminal editing tool if you're not good with Nano there's something like fundamentally wrong with you okay you might have died you're I'm great at notepad also my friend actually exiting Nano is fundamentally harder than exiting Vin true X I believe contr X but if there's a save thing you then have to like pick the save and if you say no it like doesn't let you exit Okay Bings are you old enough for Nano never heard yes I know what Nano is I I knew screen before I ever wrote line of code [ __ ] I was hosting Minecraft I knew it I knew exactly why you knew it you're like I need my Minecraft server to be around even when I disconnect my VNC session and you I was an SSH G screen Wizard and knew git very well before I ever wrote my first lineup code I actually think learning git before learning how to code was like a superpower because I up until recently had never deleted code I needed like for 15 plus years of coding I did for the first time ever a few weeks ago where I deleted code and couldn't get it back CU I didn't put it in get at any point you say you know GS but you don't rebid yeah cuz I know get enough to know how to not get hurt and unlike you guys I use G with other people because I'm on a team I know that's a crazy concept but like Mr Dax and I all used rebase and we all and uh and we all worked on a single Branch it was great yeah single brch oh yeah but we we talked about this we all worked means something else no we all worked on no no the thing where people commit directly to me trunk but without request ores what we just did trust we trust each other oh trust based development yeah we roll you're unemployed you have zero users this also sounds very good for the whole like helping him get more code that errors thing to be fair we had so many users we actually had to scale up quite a bit we did we had to use servers we couldn't use serverless Theo we couldn't you're Mr [ __ ] serverless stack yeah and we use servers cuz I started a company using serverless you started a company trying to scop serverless you got to you got to play that marketing we we have no opinions if you want to deploy something we will help you as long as it's serverless and on AWS yeah or on cloud flare and and T if it's on cloud flare and it uses like one fth of cloud Flare's features or less and it's the ones that they've actually implemented our so I know I feel like there's some fake news going on over here you know what he told me just give me the exe you smelly nerd so we gave them no I said give me the binary don't accuse me of that window stuff I said give me the binary he does use Arch by the way if you don't know so how's that palumi going it's great we're having a great time with palumi it's amazing still terraform free yeah what is this is that a Pokemon this looks incredibly puntable can you explain to us what this isure from vulture oh vulture speaking of servers our Engineers are blowing up I'm over emerge and they're all watching you let go wrong place their fault react Miami it's the place to be awesome I you guys yeah giv him this of Free Press no you you if you take that picture you ow money anyone who takes a picture with this thing gets $250 of free credit on me if 250,000 can't help it guys love you for everybody watching stream right now thinking that you can just show up to my social they're not listening to sorry man like we have another sponsor like get it but yeah did you say that his interns love us is that what I heard yeah his interns okay I'll take it so he was offensive he got free PR and I don't think he's that offensive he said that his interns watch us yeah I'm about that why I love when interns interns are what makes software work cuz you're referring to them explicitly as your interns not as your team interns and new you're you're using the term to Silo the people who actually watch our content into a smaller lesser group just to say he could just said his team watches us but he didn't I don't know I think you're reading too far into it I am because I'm trying to understand why I can't tell he said interns or Engineers it was one or the other I'm pretty sure he said really good-looking and smart people watch us to hopefully get better looking and smarter I like it I like that interpretation that's all I doing any last words before we boot you I don't know how yet do you do this like8 hours all day six to seven hours a week I'm going to give you a I've noticed recently on Twitter that you're logging out all of your frustrations and happiness with go oh yeah but I already uh I already threw go in the trash can yeah I I I love that though I think it's great Chad does it even more in there I just love when someone tries to do something just to prove it to themselves if what they're doing is actually right or wrong oh yeah I keep do it's all wrong all the time yeah yeah fun grab CH Chan the person who made all possible let's do it thanks y of course thanks for coming honestly easier for me to just sit in the middle and put our think about it the best I can whisper and people can't even know that I'm saying things like they have no idea what's up boys and boys monitoring this yeah we accidentally KCK Madison and I forgot about what that would do to our diversity right everything's terrible I had our or on handles we'd do that anyways for those who don't know who the hell are you uh I'm I am Michael Chan chantastic kind of nobody but just having fun Enthusiast Enthusiast at large this is my this is my Play you do it well yeah what are you saying over there are you flexing over here I'm not doing anything I'm totally normal I have a firm erection I'm feeling good let's just keep going here okay fully erect I also hate not having like a mic on the desk I know it's kind of weird it's kind of weird I've never done I I I've done very little content without a mic on this I've done no live content without it it's just like the thing I'm always looking for like is my mic in the right spot also I saw an ad on Madison's uh screen over there so someone's not subbed oh uh oh Madison is not subed not subscri MADD not subscribed I sit down oh she's based I knew it okay that's a good answer I'll give it to her can can we I just she was on the mobile browser on her phone she was watching chat earlier so I'll let her have that one okay okay just one quick just just I want you to walk right here just for a quick second Madison no no uh TJ oh TJ te can you just walk right here for one quick second I know where this is going I know I just want everybody to see and feel the dad energy coming off of oh yeah the outfit look look at that yeah the matching shorts this is this right here wait you're doing the same thing I don't oh my goodness I even noticed that look at all these fathers look fatherhood you can just tell you can just see it look at these fathers call me a father figure or you can say I've got a dad bod either way works for me once more hello you can call me your father figure or you can just say I have a dad bod either works for me you heard it here first Miami sorry we had to get him in here we couldn't not for those who don't know Chen here he's the other person who's wasted the same money on these same annoying wireless mics as me that matched perfectly so we could do this in the first place and I like I in the panic mode of setting this up I knew you were here I knew you were somewhere I F played telephone to figure out where you were sitting in that room went in when the talk ended the talk was 8 minutes late impatiently waiting to bump over to you and be like hey can I borrow your mics and you actually let me borrow your mics so now we can be live so thank you again for that my pleasure happy to contribute I actually really enjoyed our time in Epic uh at Epic web just talking we nerded out for hours about just we're the gear ners make sure you chatted with Adam a bit about that stuff too his camera that we're using oh nice yeah the was like the the one that I just keep looking over to make sure that it's still up like I'm so nervous man that thing is terrifying it looks it's firm it looks good every time press a Buton on it it shakes like at least like 20° when the sessions come out and like the people rush out that that stresses me stresses me we should get one of those like little velvety ropes yeah normally I would ask for that but every time I asked for something from the venue everything got Del late an hour so yeah so how's it going what's going on yeah we're just watching chat talking about react and development and you can see chat terminal shop yeah not checking it much but I can see it that's good yeah I would I I mean I wouldn't read it if I if I were you and you were me so you brought these microphones why did you bring him you know actually uh I enjoy doing interviews from time to time yeah yeah I was going to I was going try to get one with you and Dex actually nice all right Dex Dex is [ __ ] a oh sh you can do it right now you can't if you curse you can't follow up with oh [ __ ] after okay like that ruins like the Oopsy Daisy [ __ ] you're good good good uh no Dax dax's pretty cool I was actually really I was entertaining this idea of a like mean-spirited interview in in kind of the spirit of uh you know you've been doing some of those which are great I did one with Fred and I did one with Rich Harris yeah yeah a lot of fun they're totally fake they're extremely edited you know people take them seriously we had I did the Rich Harris one where you know we like yeah you know pretend to be angry at each other someone replied being like this was so mean you clearly made Rich Harris feel so uncomfortable I feel so bad for him I was like what is it about devs that just don't understand sarcasm like why is that such a common thing in our space so how did you how did you land on that format though because like I I want to do one yeah let's do it okay we should do it yeah uh how did I land that for I don't remember cuz we so we were doing work with all the different Frameworks so we did one with Astro and like how do we want to like talk about this we didn't want to just do like oh let's let me like share my screen like showing the thing it's boring no one's going to watch that so like what's the funniest thing we could do I'll be right back uh and yeah I like love the between two bottom M I don't want to mute it and uh and Fred was down and uh I'm like comfortable with Fred so it was like I couldn't do this with someone that I just met so yeah we just went for it and turned out pretty good yeah I so something I've been kind of I've been a little bit obsessed with is the notion of like I've always wanted to through I did a podcast for a little bit called react podcast and I've always wanted to ask the question that like people want to be asked yeah you know and I think that they always end up being like my my perception of those is like the kind version of that question but like there's something fun about that framework where it's like maybe they want to be asked a question where they feel like like they can come back and be a jerk or like an [ __ ] and really go for it you know it's awesome like there's a there's a ask me a question it's a bit of an egg do it right now on the spot I the harder better what she said so if all your sponsors like just dried up immediately tomorrow do you think your takes would get any better I think they would get a lot worse I think they would straight up get a lot worse because right now all my sponsors are the things I use and if I needed to put the money on the table I would start getting spots for things I don't use so they would get way worse we' be like deploying on Heroku again see I don't have a mean all right do Dax next do Dax next should be easier okay so Dax you have an amazing beard I love it you're doing terribly so far did you know that it would like did you know that it would come at the expense of like your personality or that was was there that's like not really a question an insult in the with the question mark at the end of it [ __ ] d that was so good was good I I have no words for that honestly uh yeah I'll take it you know my personality wasn't great to begin with so how does it feel to know you will never do something as great as the Zack Al and AIS Obama interview honestly I having done these I'm so much more appreciative of what how good professional comedians are like they are so good like we're nowhere close to that well I'm not yeah you you might be a bit closer beard personality problem yes I know it takes you like 3 days to realize how funny my joke was which doesn't say positive things about me do people realize are your jokes funny I've had at least one person tell me days later that my joke was funny so at least once at least once okay it is it is amazing like how like how much harder it is to like land a joke like you know hang out with your friends you kind of get a sense of like oh yeah maybe I'm a little bit funny but you're right like that that comedian level just it's like the difference between like a pro athlete and like someone who has like an at home gym yeah exactly and and they're doing with people they just met often times and like completely improved and it's just like yeah you're either born with it or you're not you know I have the fun problem of like people who are like objectively very funny that like have people who follow them just for their humor they always say I'm funny but the people who like them for their humor don't think I'm funny so it's like favorite artist yeah you're not funny so it doesn't matter it's like it's the artist favorite artist but for humor but it's even worse because I have no influence from that position at all I'm just the kind of funny guy that makes bad jokes yeah I rock it I know my role talk about JavaScript and not be funny I'm drinking my vegan Water by the way oh man I I think the idea of non-vegan water is actually interesting this is ex drink it for sure sure actually you know those like Prime drinks that Logan Paul made you have to make Logan cuz he made prime prime should make Logan and that should be the the water non-vegan water my my idea was tried out on uh Adam is I would sneak in a couple drops of like chicken stock into his water and hand it to him I just he bu dependency on it yeah slowly trick him into wanting me yeah I think it's a great idea start with one Dr I've heard worse yeah L move the guy's name is Donnie eat plants so I mean I mean you sound a little biased towards my great ideas any things you've really enjoyed at this conference so far what was your favorite top you know honestly I've never been to Miami before so really fun I it was really fun to see uh B douy up there I haven't actually seen b douge give a talk it's really nice seeing his takes on like how to contribute to open source shift in like my direction it's really cool yeah douy was one of the first people who like noticed what I was doing too first person to ever invite me on like a podcast as a guest like I was nobody at the time too it was super [ __ ] Co that was a great interview by the way thank you yeah people are finding that years later now it's so cool so what was the was this the open source talk yeah yeah I wanted to see that one so I I I did not get to see that one he give me like a five five no honestly he showed a graph and then just said what is this massive erection like at one of the one of the points and he sold me sold me phras what is this massive erection man sneaks erection into a talk sold yeah a lot of like 90° angle a lot of like hip-hop references and jokes too he called me the Michael Jordan of devell once that's right in in a in a talk he gave multiple times nice yeah no his whole thing was about uh open sace and they're just kind of building a platform to see who's actually open I checked out their I've been very confused about that whole confusing someone involved in both yeah building a platform to be able to see like how people are contributing to projects but like just not not just code but a more holistic sense em like which repos are you involved in do you cut issues how often do you follow up on them it's like the real stats to see a person is a good open source contributor or not it's not just like look at all these repos they convinced to merge a like typo fix but really like like how involved is this person on GitHub and as such they've learned a lot about what a good open source contributor is and it's not somebody who goes and closes a bunch of first time issues and like typos people who actually use the thing that they're contributing to and is talk was around that it's like build things use things look at the things you use here's a way to see if this project takes actual contributions or not and what that looks like and maybe try it but he gave the example of typescript which doesn't which uh in or four of last year not take a single external contribution like if you think you contribute to typescript you can't you're wasting your time contribute to things that actually take contributions but also use things that you're actually like using and familiar with very measured take and that's coming from the person who made a video title don't contribute to open source it's a phenomenal video by the way you should watch it if you haven't all right I think te just queued up let's gra I got one last question for you though I didn't get to I didn't get to ask you a question need to do a prime a prime roast when when you heard that you could one day have your own coffee joke by the way like that I like that when you heard that one day you could have your own Planet full of virgins did you know that it would be Earth and that the virgins would be uh Teenage Tech insults I don't get the joke is he just listen facts about your life are you just first off I'm a confirmed four-time sex H I have four kids okay so I don't I don't get this at least two of them are his too at least two of them are tested the other two yet but second off that place already exists it's called Arch users right here you got one right here I don't I don't have I don't have children he doesn't have children yeah it's true cheers I I wanted a good question with like a a ripping oh made a statement about me being a virgin and it hurts a little bit I didn't you're a virgin I was talking about the the the tech virgins that you're surrounding yourself with Dax and Theo you win damn you still insulting them man no I guess I got see I'm bad at this I can only have sincer conversations I'll let you guys go hey always been of course I'm sure we'll hang later we should have Michelle on too we should have Michelle on for sure and we should grab find Madison wherever the hell she went hello people out I I was going to volunteer to be the one to swap out but then I realized it's my channel doesn't matter but the other way is slightly better hell Bing hi who who's this guy who are you Mark Mark yeah no you [ __ ] I'm te welcome to react Miami I hope all of you have been enjoying the stream I've been enjoying the talks did you buy that at the airport on the way in nope I've had it for a while I got it why well why not because it looks like that so far I've gotten a lot of compliments Madison sees him and she goes you look like a dad on a cruise and immediately teach is like I am a dad on a Cru this is like this is okay so we have different definitions of compliment is what I'm hearing yeah that one was a man it's he took it as one it is I would say why would I not want to look like a dad it's the thing I'm most proud of in my life basically not only that but you know what that says this says I am the most confident person in this room extrem confidence the confidence is oozing like I'm more confident just being around you to be fair all of the confidence came from Dax giving me the seal of approval this morning yeah [ __ ] Mary Hill being a dad Arch Linux neovim uh I guess Mary being a dad technically speaking that that was my R you heard it here first TJ's marrying his dad we we'll kill Arch Linux and I'll Make Love to neovim yeah as one does on a daily basis how else do you change your config it's a very intimate process yeah have you heard his streams where he works on it it's something else I'm about to rewrite my whole config I just got done doing that it was it was a it was a healing experience so like an average Tuesday no I only rewr it once a year I had have never Rewritten mine I have most I have a bunch of config that's still the same from like when I started 10 years ago I respect that yeah yeah but uh this time I have it so chat can send a lot of um let say gifts like flip my screen upside down make me edit in uh vs I we don't have a bleep button do we no this family friendly stream um in the visual studio editor of the code variety or like open it opens my current file in Libre office for like 5 minutes and then I'll close it afterwards so it'll be good time I just remembered you do all of your photoshops in [ __ ] no photopia oh photo yeah photo is dope I like Photo use [ __ ] I'm the G yeah which why you don't do your thumbnails I don't do thumbnails yeah I still do all my thumbnails and I really shouldn't I do take commissions I did you like the one I did that I great yeah sure yeah yeah if you want one I can do a really good one I've got a what I need to do is I need to get more compromising pictures of prime so they're like exclusive like how Peter Parker gets special pictures from like last year but I've used them all since ah crie you got a gift from a certain buffering individual what is that it's from the ocean it's from the ocean it's like still warm wet yeah I just got it is that Coral show it Coral show it to the C show it to the camera what is this what is this F the table coral Coral this is definitely somehow a penis some way I know it's an ocean penis do not ingest that that do not put that near you I know what this is you want swap I said the word penis I knew I could bye Dax all right we got some sweet guess what have we been talking about let me guess Bo yeah Theo's been making fun of me about I know I made one been talking about your configs for five minutes now as VI people do I just barely found out what a config even is I put my first plugin in in plugin in plugin this is my Vim setup I got Kickstart and one plugin called neot tree that's what I'm going besides the tree agree ask Prime what's prime what's your opinions on file trees I think file trees are an anti- pattern I think files are anti pattern put everything in my file yeah I didn't think you could use next wait do you actually believe that able to I don't file use the only time I use a tree in any sort of way is if I try to create a file wait so I've seen you stream never see one and I'm always like did I miss him using it how do you like like when you're organizing a file in your head how do you know where to go well I type in its name in telescope and it goes there I open let's go okay so for me cuz I was a a vs code where's the bleep vs code user for a long time and they have that built-in editor so I just the tree directory I was always used to it but then in boom when I started I'm like wait where's the where's the tree it's one of my big recommendations that's one of my big recommendations is the first time you open a Vim it doesn't have on that side the file tree you will feel inherently confused very confused I was like where am I I was dropped into an ocean and I have no what's the quote about file trees CS in his famous book that JRR tokens had was his first good book out of the Silent Planet he talks about a guy landing on a foreign planet and he looks at a mountain and trees in the ocean and he says he cannot see any of it because it's so new to him he can't even recognize the things he should be able to recognize and so when you open up an editor that's different you can't recognize it cuz it's impossible and that's part of why it's so scary on the topic of file trees we could transition to graphs and if we're going to transition to graphs we should talk about the tool that I use to draw all of my graphs and all my diagrams the creator of which happens to be here graphql are you down to swap yeah thank you te te it was amazing having you I missed the combo because I was over there but hey what's up not much good to have you on the show long time fan first time chatter yeah D here for those who don't know who are you and what do you do uh so my is chis also known as visual on the internet and I've done a bunch of things so I helped open source react I organized the first reacton I co-created react native uh and pra ex cro and CSS in ja and uh yeah of the things a lot of very useful things that I build a lot of things around so ni did you see that wrestling yesterday where uh Ken wheeler and Adam were like wrestling each other on the ground it was actually over prettier so like you built a really incredible to it's yeah semicolons it was the semicolons that makes sense I at least one person has been punched due to prettier and you should be proud of that yes good stuff you want just talk so I want to oh sorry go ahead I want to you I want to ask you like okay what is your advice to someone who like wants to build more things or get into building more what would you say because youve built so many amazing things this is like someone is me basically so if you were at my talk like earlier today I did an entire talk around how to be successful at doing open source so this is like a good um uh like thing to look at but I think the the best advice I have for people is like uh programming is a tool and so it's a tool for something and so usually what I do is I look at what what is buzzing me on my day today and then try to figure okay can I solve this and then I'm going to like look at whatever technology and whatever tool I can use to actually solve it and this is like most of like the project I've been working on uh like how I've been thinking about it I don't if that makes sense yes AB yeah I love that okay consider the things that you you built that makes a ton of sense so what frustrations LED you to the creation of excal dra so excal dra was actually uh uh procrastinating so every uh six months uh at Facebook you have to like do your self review and your peer review and your manager review and the kind of things and like I didn't want to do it and like there was a deadline so I was like okay I'm going to do something else because like I cannot write stuff and so what I end up doing is trying to like write a blog post and I use a tool called webler which is basically ex draw where you can do like uh line like uh handwritten drawing and everything but unfortunately like the demo website was broken and so I couldn't use it and I was like oh can I actually try and build it and so I started using code sendbox to like write a small demo and I posted on Twitter and like I got like 200 or 300 likes on this and I'm like oh [ __ ] like this is cool like people want it and so the next thing I did was to like create a gith repo and write like 20 issues around oh we should have like a drag and drop we should be able to recy should be able to move around and then a lot of people started like building and building and building and it was like the original story about it but really what took it off is uh sadly like Co happened and was in January of 20 2020 and in March Co happened and then a lot of people were like okay we need to like have a virtual white board and people started looking at this and were like oh it's actually like a really cool like uh virtual whiteboard and uh this is where like a lot of like the activity and like things kicked out uh within Facebook we started using it for interviewing and like a lot of companies you started using it for like all of your live streams I was using it way before then I was using it in that January February window because I was following you due to pretty and all the other stuff you worked on I saw it I shared it inside of somebody else might have shared ril slack I don't remember if I saw it in slack or if I shared in slack but I remember seeing it in slack using it a bunch and using it for all of my presentations and the things I I was doing internally at twitch and got so many questions for me it was a really like big like mind opening moment because I've always had terrible penmanship like I get embarrassed when I have to whiteboard an interview or use anything that involves like handwriting because my friendship was so bad I almost got held back in elementary school for it and suddenly I could actually whiteboard and for the first time I could do something that that looked and felt handwritten so I wasn't spending all my time perfecting the diagrams I was just drawing what I wanted to show and it looked really good despite being really simple and easy to quickly do and gave me that that freedom that most people have when they use a whiteboard normally what are you laughing at my penmanship nothing you know we're just I love excal I love it too I I use it all the time now it's I I first heard about it from Theo cuz you were using it and now I just and I love some of the like AI tools that are built in like like with what is it now mermaid that's in there and all the cool stuff you can do it's amazing yeah I have the Plus Membership actually where you can like everything it's so awesome it's so Co I love it can I can I make can I can I make a live feature request yeah sure a dvorac friendly key binding set oh because I have to take my hand off the keyboard and put it back on for say rectangle that makes sense so we uh a one-handed layout for deor so if you want to send a PO request and to Live code it on stream this is something we may uh want to accept cool because actually that's like I just knowing that I have to put my hand from the mouse back on the keyboard do this I'll just open up up [ __ ] and just start drawing in there cuz it's just it's less emotionally bruising that makes sense understandable honestly yeah so a challenge for you if you actually like do it on stream uh I'll review the pro request and accept it if it's good are you do we have a deal I love that you guys should do that oh yeah let's do that let's do that I am so hype real open source happens here real open source we are breaking the cardinal rule that you just said for open source and which we all recognize which is that I I only the tool lightly it's not a problem I'm really trying to solve but the reason you're not using it is I'm trying to solve it in the executive way of just complaining on the internet well but you're complaining and now you're actually part of the solution the problem perfect use case Okay this open source at its best here stop lying Prime I know do you have a um a project that you're most proud of cuz there's so many cool ones I don't know I think the most proud of is uh like probably like CSS and GS is uh like a lot of people like thought it was crazy and everything but to me it just made sense and so if you look at the history like we started with HTML CSS and JavaScript was in like three different things and uh when react came it was like okay now we're going to put like the the JavaScript and the HTML together and the next wave was like why do we actually put Styles in a different place yeah like this doesn't make any sense to me I and I had thought of it that way before the idea of like like CSS and JS not as like this curs technology that makes CS that makes JavaScript run longer but as like the the making the component model work inside of like like the way that HTML and logic are collocated the style is being collocated the same way we call that locality of behavior for the dictionary yeah and one of the thing that uh like if I can like talk to the audience like a lot of people say that like uh writing the inline Styles in JavaScript is uh slower than CSS but it does make sense to because like CSS you have to like do the rules you got to Traverse the D you got to do all of this complicated work where it's like oh if you actually set this particular element to like this specific value like it should be faster and so if somebody can like show me a benchmark I just did a video somebody did this Benchmark and inline CSS is way faster in a bunch of cases especially like crappy mobile devices inline CSS loads like twice as fast nice it's not small it's like 2 seconds to 6 seconds difference yeah so yes inline Styles technically speaking are way better on the client side I know that offends you Mr hmx no no no I she just told me to wink so I hey how do I mute this thing again uh the button on the bottom should do it make sure you confirm with Mark quickly so I told you to because uh someone in the chat kept asking Prime was reading Prime someone was asking what what you kept reading on your phone and he said wink someone said wink if it's the chat I'm like yeah of course it's the chat is one of the yeah cool you're good yes me this is terrible is he's gone cool I wish it showed any signal of the mute being muted on the device but it sadly does not yeah Road I love you but you're letting me down a lot more lately anyways so what does chat want to know chat what do you guys want to know ask a question to The Legend who created prettier and solved all of our formatting discourse forever how does that feel actually I'm car this myself like I went from caring a ton about syntax to effectively not giving a [ __ ] at all thanks to prettier yeah like how does it feel to have just ended a whole section of discourse oh this feels so good and uh the thing that's also like super cool is like I feel like the power because I made a lot of the decision around style that uh like I wanted to based on like research and everything but I got to like Define like how a lot of people are writing javasript code today so yeah it's pretty good why not trailing commas then so we have an option for trailing commas but it's not the default so the it should be the default but the issue is like when we actually did prettier uh training comma was not part of the like JavaScript spec and so if we would have enabled it by default for everybody then like we' have to break stuff so now it's been a long time so we probably should like start flipping at the default but yeah and if you need the legacy mode you just turn it off yeah so Mak sense and uh so we've done like PR 2 where we did some breaking CH like this and PR 3 so maybe for PR 4 we could actually like flip the switch uh is for when you're doing spaces and tabs finally I don't know I was excited about that one so I don't care about tabs versus spaces but I've heard really compelling arguments on the accessibility side which got me much more interested the idea that a tab is a different thing from a space is useful for things like screen readers when you're reviewing things oh wow is it really I didn't realize there was a case for that yeah wow since Tabs are like like rendered as their own individual thing you can change how big or small a tab is so it's also pated on the code level too wow czy I went from giving zero shits to slightly leaning towards tabs now but I also refuse to have a pretty your conf fig if I don't need a pretty big I don't have one because I want to just use the default and as soon as that file exists in the code base now we can start getting into that conversation again where we're talking about and fighting over the style system I don't want to think about those things I just want to write code that makes sense you change any of the defaults now uh we haven't changed in a while on that do you personally on your project when you're using prier change the defaults yes so at Facebook we use a slightly different version uh so we use um like single quotes instead of double quotes and uh like the training commas and also for jsx we put the shov run like in the in a different place but out of this yeah pretty much a one good stuff do we have anybody else we want to grab before I forget we're going to milk next yeah he's any last words to our chat our react and react accessories crew watching if we do this live anything you want to promote so I'm actually uh doing a weekly challenges on my Twitter and so if you're interested in Tech and like doing like fun challenges are not useful at all but what kind of challenge though like what what's the challenge uh so this week's challenge is uh so there a whole thing about Bitcoin and so to reimplement a small coin and uh just like for fun and for learning so last week was about the eclipse that was the eclipse in North America so can you like implement the three body problem to know when the next eclipse is going to be and so oh so implement the Netflix movie yeah every week I'm trying to come up with like interesting pring challenges should take you like uh two or three hours and uh there's a cash price of $150 uh per uh like week and so you can also get some cash uh if you're like uh scoring high so good [ __ ] I I do love those challenges I Haven had a chance to do them but they're super cool yeah that sounds really fun yeah so if if you're interested and like if you want to do one on stream uh one of you uh it could be also a cool content for you guys very down love it good stuff as always thank you again for coming byet Ste that milky we're going to milk the milk man here we go the milk milk yo he streams by hey but that stra up you know the what's hey I have a quick question I just got a chest this chair is broken oh damn uh hey it's broken mey hey if you unbuttoned one more time I don't think your shirt halves would connect anymore do you want me to do it yeah you want me to who's who's who's account streaming getting rated dude imagine twitch staff showing his nipple on stream imagine twitch staff getting X twitch staff banned from twitch live that would be a title that would be that' be a weird way to call up on a video yeah that's that's way once you have too many things in the title that like contradict and complicate it gets way way worse current twitch staff gets X staff banned off twitch like that would be funny to like screenshot and tweet but it wouldn't be a good title for a video yeah that be it be a great tweet though Melky chat right now is just going fast wild smooth and they have a very important question yeah how are you so studly and manly what happened dude I apparently you were born in Europe first yeah I was born in Europe I was definitely born in Europe were the most American I was born in Europe they I moved to Canada and got kicked out so now I'm in the US so we'll see how long until I get kicked out of here what did you get kicked out for JA just being too European to you know I'm on that Shane Giller skill right now so I got to you know I gotta watch I know who that is because I'm not a European so my mic oh him yeah put your mic in your [ __ ] face closer there you go closer all right all right my bad there almost like you're licking it that is this better actually slightly if you put that there go co you want to get in you want to get like can you do that can you do that motion again no show me I can't no no I couldn't see that I know you're very competitive and you bet you could do it better than me but I'm not even going to show you my technique okay your Technique will blow everyone's mind it would their minds are be mind oh yeah with Prime's uh mic holding technique yeah I I hold a lot of microphone you do I hold a lot of chat saying that Shane Gillis is the most American comedian ever he is I'm pretty American I never heard of him so you know what's funny today uh Theo said I was I don't know if you said it's a joke but Theo said I was the most American guy in the room and then Madison agreeded immediately yeah was no hesitation she said yeah obviously and then Theo left to go help set up and like figure things out and then all of us were like what are you talking about and then she flipped so fast she like wait actually never mind I totally see how he's not American okay in my defense I thought mky was pretty American but then your shirt like your chest hair then I'm in Miami baby chest hair I'm in my Miami wait hold on hold on are you saying his chest hair makes him am the open shirt combined with the chest hair it's very and the chain it's very European the two chains I got two chains it gives me the ick I love you I'm it gives me the ick I just no it looks great looks no thank you earlier she was saying she's never going to date a European guy sh my face I it's true I would never to let you down honestly true there could be way worse right I don't think a European man would date you o I can change him so um meky tell us about I want your video that you did recently okay how you use vs code and Vim like way to not take a stand by the side by the way BR but tell us about it yeah sure so um so his thing is called fence sitting I'm when you don't make a decision and instead you try to please both parties and then nobody watches your videos I actually so I used neim for like four years and uh yeah ignore that just there's not even there I'm right I know I'm talking to you watch I'm talking to you I know so yeah I used new of them it was dope I love it uh I think the team does a great job with it I think it's like super fly yeah um younger older brother teach old my older brother literally is one of the core maintainers so uh and then I hopped into vs code to try it out and I really liked it uh for whatever reason I just felt like I don't know it was like I didn't have to worry about configuring it as much it was like a nice One-Stop shop uh but then like at work I still use Neen I never like I work for twitch I never got off new of them I still used it never even tried to get on vs code and uh yeah and that's how kind of use both so you switch between both for some reason yeah strangest like because he uses neovin professionally V so neim in the streets vs code in the sheet that's like s between rust and go like why would anyone do that this is the strangest thing I've ever heard my enti life I know it doesn't it doesn't have to make sense but it works cuz I think okay so here's why I don't the technology at work moves slower than the tech I'm exploring in my own time so what I'm exploring new things like even in the JavaScript ecosystem or wherever I'm like trying to play around things as much as I can uh and I think vs code like plugin extension is just kind of handled out for me I guess easier uh but whereas at work like there's not really money things changing I'm just ready go and it's all good this is ASL she's doing ASL right now you want to come on I was saying come on in 10 minutes like come anyway but go on but okay M that was actually such a good reason why yeah thank you can you repeat it sorry I was trying to she was doing ASL you're doing ASL can you repeat it sorry one more time the only okay tldr is I the only reason why I use neon work professionally is because the technology stack that I use at work doesn't change as frequently as the tech I'm interested in my own time and so uh what about contact switching is it hard I guess it's easy to just like switch between all the time it's it's really easy just because I use Vim motions so even when I'm in vs code I use Vim motions regardless and my bindings between my new Vim configuration and vs code is like the same but do you use a mouse uh I don't use a mouse no I don't my mouse is in between my keyboard okay something else I want to know and I actually haven't heard anyone's opinion on this except for Prime but I'm really curious I've never heard this before you were saying that file trees are an anti- pattern can you explain this also what is it directories what's called so file trees um and I I want to hear everyone's opinion on this but can you first explain I'm so curious I've never heard this and I'm like should I just not use my file tree and B can you explain why I'll give you the quick okay the quick one is is that having it open provides you nothing perusing a Project based on file structure is an exceptionally small amount of knowledge you can gain I agree with everything so far yes and so creating a file of course I don't think there's any problem using a tree type view to create a file you click to where you need to be or navigate if you're using fimm like a real man and then you get to where you need to be and boom you create your file but like having it open at all times yeah I agre that what are you do screen state is valuable stop having so many distra so I was using the like vs code plug in that you have like little animals in the sidebar instead which was great but it got really laggy it's of my editor so I stopped doing that but I need something to put in the space so I just put file tree there so I use something called Goya when I'm doing like my offline does it have cute animals no what it does is it puts empty spaces on both and puts the text in the center of the screen fill the cute spaces with animals I have ADHD I'm getting confused what is Goya and what what space are we filling you and the side spaces so if you take out your file tree all of your codes on the left hand side of the screen so you're like looking like this so I Center the code and nothing on either side I see you just text line Center yeah that would be great imagine using text line Center for all of your coding that would be [ __ ] hilarious I might try that there you go so I I try to have a distraction free environment mostly agree it sounds one I one window monogamous I trees often lead to people thinking that they represent something more than they do for me the reason I leave the file Tree open is that I do a decent enough job of collocating at like a directory level like the things that are the immediate concerns of where I am if I could just have the folder for where I am right now open on the side instead of the whole thing that would be a decent bit more useful but called nerd tree that's VI you may have heard of them I I have a couple like hot takes like tangential here which is that when you're learning a new code base learning it by looking through the file system is the worst way you can learn it single hand look at the FL request not the code tab if you want to see how a code base actually works I look at tests wow interesting looking through the file tree is not helpful because it's because the vast majority of files haven't been touched in a long time and probably aren't relevant to what you're trying to do and plus when you know there's a problem you use your LSP to navigate in or out you do not use the file tree it's crazy talk to use the file tree yeah or you can just search for like the function using I want to hear your what do you think then is it is using a file tree an anti- pattern I mean I don't like I don't think it's as strong as an anti- pattern but I agree with everything these two guys said like I don't have my file Tre open um I mainly just have file Tre open add a file add like a directory uh but I use like if I'm on new ofm telescope if I'm on vs Cod use an exp extension called find it faster which is like basically telescope or vs code um it's nice obviously I think telescope is like far superior uh but a nice yeah it's it was it was a very nice extension to find cuz it made me feel closer to like the GP the searching from from telescope that said pepper his opinion with a little bit of salt because he also uses the same single excal drop file for all his diagrams ever it's like literally like hundreds of hours of stuff in this one single gigantic excal I get so stressed when I see it yeah it's disgusting so stressful and when I zoom out Zoom it in yeah dud when I zoom out if I go far back enough my whole computer like freezes cuz it's like retrieving all the info from local storage that just like hold on I got to buffer hold on hold on and it's Madness how do you know where anything is I keep going right oh like specifically I have no idea I always go right yeah I always go right ER like you can't go left you don't know how to turn left and be Turner but why male models but why mil say it but whyel but what but why male models never mind they're so based you're actually it's it's too much based based B speaking of male models we should swap to our next guest yes to kick you out but swap door next guest Michelle model she's way more interesting that transash steal that or you pass way to her let's give a hand to milk you there's a little and vs code user probably the only one on earth who uses both anyways we have our next guest probably the most important guest at least the most important guest here facts yeah for those who don't know how would you introduce yourself I'm Michelle belel and I am an organizer for react Miami thank you she's mellel she's an organizer for react Miami yeah I asked you how to introduce yourself so you just gave me how to in perfect no a plus I love it again no nobody gets my humor and that's fine you'll all realize how funny I was a few days later oh yeah for those who don't know Michelle is one of like the most legendary people in the space she's given a ton of incredible talks that most of the things I show up at we run into each other all of the time like everywhere you were at Epic web last week even though you're running this this week yeah you were you gave an incredible talk at Epic web dev last week on all burnout like work life balance like the essentialism plan which I'm trying to start my it was incredible no in possibly the worst person to give a talk on work life balance me no I have work life balance I learned the hard way yeah tell us more so basically um uh several years ago I developed a stress related heart condition from overworking and being working in kind of like a toxic situation and so yeah I mean it it was just generally uh an unsustainable way of working and I kind of like left left this job where that was developed went to another place that ended up kind of being worse and it got like really really bad um to the point where like I really I just had to like I had to like stop and figure my [ __ ] out like um did I want to stay working in Tech do I want to stay doing this like you know cuz like I'm 29 years old and at this point and I have like a cardiologist which is like crazy to me so yeah I uh I have I have to have work life balance otherwise my heart hurts so what was the first step you took cuz you kind of you identified you have you're visiting a cardiologist like how do you break break that cycle cuz once you're in the cycle it's very hard to break it it takes a while but I will say like this heart condition like it it's like heart palpitations that stir up when when stress starts to occur and so it had gotten so bad that like I would try and talk and I wouldn't be able to speak and so there is just like this you know breaking point where it's like you know like you have to just start figuring something out and like it took a few years to figure out what I was going to do or like how to start changing things because it they are hard habits to break and it's hard a hard mentality to break like to feel like don't work on the weekends like I still have to like if I'm like oh no I'm going to like do this little thing it'll take like 10 seconds like no like just leave it for Monday like so that you can like rest properly so it it's years of work and learning did it take you a bit of time to like unwind it in the sense that did you have to work even less for a long time before you could come back or was there like like just a slow reduction I ended up working when I started working for gtii the company has like really good boundaries and uh work life balance demonstrated by the founder Gabe who's here um and so I basically just like emulated him and he he is like yeah so it was just like okay well I'm not going to worry about doing anything that the CEO is not worried about doing so I just I just kind of like learned by copying as as a CEO of the CTO that's much more worried than him understandable everybody everybody is pretty chill at gtii that's good so then you decided to start a conference did that flare anything back up or is this kind of like that relaxation where I would be lying if I didn't say I had didn't have heart palpitations trying to get this thing up and running I I am sorry I am so sorry we the table and I was like oh my God yeah this stream was a lot of work to set up shout out to for all the effort to make it happen battle today we were at war with the internet the war is over we have won we are here this all worked thank you again but it does but it does it but react Miami in general it doesn't I I love this I love I love Community I love Gathering people so this is very very fun for me I look forward to this every year it's crazy to me that this doesn't stress you out to no end like the thought of running an event like this just like like it makes me flush people are commenting on it in chat the first couple of years yeah it was pretty stressful but like after a while like people you learn that like when people come to conferences they're prepared to take care of themselves they're prepared to seek out the experiences that they're looking for and so the first couple years when I was really stressed out it was cuz like I was like thinking I have to do everything for everyone um like I'm the host right but after you know seeing two years of this it's like okay everybody knows who they want to meet everybody knows where they want to go and they take care of themselves and I don't have to stress out so much one of the things I thought was really interesting about how you talked about and how you were on the comp where it's yes there are awesome talks and they're really important but a lot of your focus was the hallway track like us being out here getting to hang out with and talk with whoever I think that that's like something really special about this conference and I even noticed that here myself I want to turn that off there we go yeah and we're we're trying something new tomorrow I think the camera has slowly gotten skewed apparently I'll fix that quick keep talking should I just leave I got it and then we'll just like adjust which way would I go we look great from the upward angle yeah um so Thea said keep talking okay so tomorrow we're going to try to do these smaller workshops and just kind of emphasize the hallway track so like keep some learning but also make it more interactive and kind of be hanging around hanging out around downtown Miami um so yeah it should be a looser format should be more lowy okay so so why did you decide to break it up as like this more kind of workshopy type building one day just kind of based on feedback of people wanting to do something maybe a little bit more Hands-On or do something more interactive or like focus on more networking so it's just kind of an amalgamation of feedback that it's like okay well let's try something new yeah I know Tanner was talking about the idea of like what if we had a conference where it was literally just the like aisle or like the hallway track and I think you've done a good job of like balancing that out and making something that that feels both like a traditional event and a place to just go hang out with friends like I know Prim even describ this is like he came out here to hang with friends and then we could do all this coal additional stuff too I think you've achieved that goal and I'm surprised where people aren't leaning in that direction awesome I'm glad to hear it well Miami I feel like brings out Echo apparently there's Echo and the audio is bored now any idea one help I'm going to help him out with the audio the the audio sucks the audio sucks eching is it echoing is it echoing I wonder why do I stream on Twitch eing like I'm not doing anything you look like the dorkiest secret agent in the world into that don't tell me my business I'm very impressed that you can do all this honestly know this is incredible The Vibes are Immaculate I'm impressed by you guys and what you guys do too so mutual I'm unemployed I don't you're a full-time streamer now you like basically graduated to the next level streaming is hard I'd like to say I graduated that's a nice that's a nice term that's a good one is it fixed am it's was fine the whole time probably you are gaslighting me because they realiz I'm checking chat now the hardest part about any of these things is just like getting all the people aligned and making like I I've I I would say lightly is a very very like impressively too large word for me uh but I lightly helped out on the Neo bimc stuff and so it can't be my mic guys there's like no way it's my mic it is outrageous how hard these are so I'm always just I'm massively impressed that you can organize this many people and there's like not a fight like things are coming together no one's up you want to get in a fight Ken you want to get nicest man on Twitter is about to get in a fight here we go after the fight yesterday my M oh my goodness okay that doesn't count Ken and Sam was not a fight I turned off my mic is it fine now mics are out of s I don't care about that keep trolling apparently there's Echo keep trolling keep trolling I'm seeing equal numbers of yes and no which means that all of you are tell him tell Theo he has we're fine oh is it is it the camera mic scroll down and see if the camera has audio coming through oh that's a good idea tell them there's lag no okay then y'all are gaslighting me there's nothing we can do it's hopefully fine I don't care no uh you guys don't know which bike's on the far right 3 second lag now not seeing it at all it it could just be restream [ __ ] up if you can check the Ram dashboard quick this is wild I don't know how you keep track of stuff like this you get used to like reading like in chunks basically you have to learn to read differently we put a lot of time into twitch chat making sure it comes through in chunks even at High Velocity so you can actually read it if it's just a constant stream you can't reach this is wild the lag there's enough people saying it that it's not trolling that it is actually screwed up somehow our Tech gu is on it Tech gu is on it we got F CH hey Mark are we still connected what maybe he found a problem he possibly fighting a solution to the problem I just love this stuff sorry I can't help it investigating said problem some by two that's going to be okay the the lag is fake the echo is real there will be some amount of echo due to the nature of how we're doing this so we're just going to have to deal with that I just got a notification that I'm close to a 200% move goal on my hey a 200% move goal yeah I was at 22,000 I have no idea what this means I turned all of that off because it stressed me out the amount of talk I hear people with like closing the ring I don't really know what this is but they're like I'm about to close it we're closing it my sister every day I need to close my ring yeah my wife will do that every now and then she's like I gotta go I'm walking I'm going mov her I was like break your streak and free your mind like free yourself from The Ring the mono so they're not moo mics they're all the same microphone I just have fancy things on top of them for those two just saying my mic's pretty good I never uned mine all right all right good job everybody get back to start a fight if you're for a fight you can start a fight yeah you guys are still looking for a fight so uh did you hear about dax's amazing protective dog Mark's confirmed there's nothing wrong with the audio you are just being annoying cool all right cool we'll go with that uh that God cof and whe under control the other night yeah love it the pictures were brutal Zuko security for the party Zuko security for real good [ __ ] should we grab is Ken get on you ready it thanks for subing by thanks for having us appreciate you event sorry for all of the issues before during and after don't you're fine thank you so much for the help howdy yeah the chair is a little uh I'll swap it with with Adam and he did it yeah what up internet much good to have you here man yeah sorry about the alive now this has been quite for you putting in all the work to make it happen thank you we're grateful for having you here yeah so uh you just organized your own conference last week obviously how was that I was there it was amazing seeing it was so cool thank you for coming I was there hiding in a back room filming random interviews yes also thank you for being there also I I wasn't there I I wasn't yeah that's okay uh next year Well you wanted to be epic so I I I get it and web so Kent did a uh just casually did a back flip off the stage at one point and I was so impressed I was like apparently your mic's not audible um is is his mic on no don't wor we did is this good yeah just make sure it's really close so yeah flipped yes I did um so yeah it was just like we were taking the photos at the end of the event and uh the stage was right there I was at the edge of the stage and somebody said Kent do a back flip off of this I was like well the event's over if I hurt myself then it's fine do you do like gymnast stuff regularly or is it from the past yeah it's from the past I um I plan on doing more of it uh going forward my I have my kids in gymnastics um but yeah when I was in junior high I competed uh so I was I was into it quite a bit do you know Mark gansky yeah yeah he I actually went to his gym with him when I went to teach a friend and Masters okay yeah did you go also no me and him do a lot of contests but no none of that dude yeah it's it was fun yeah and I'm inspired by that guy he's he does really amazing stuff so that's cool so yeah how was epic web dev I mean I was there but yeah it was it was so good um for a year one conference we had 160 people there which is uh 10 more than the lower bound that I promised the sponsors so thank goodness yes um but uh yeah the speakers killed it like the the most Theo actually asked me what was the most surprising thing and uh the most surprising thing was how few people there were in the hallway track like everybody was in the the uh for the talks because the talks were so good uh every one of the speakers just nailed it so really grateful because like there's a there's a certain level of respect that you have to have for the attendees and the organiz organizer to spend that much time on your talk and so it was like really sweet I guess uh you know in all senses of the word uh for the speakers to spend that much time putting together such great talks yeah I was really impressed I only had a chance to watch one or two but the quality bar was insane I've been excited to go sit down and watch the rest one of the few conferences where I actually have like been waiting to find a time to sit down and just watch through all the to yeah yeah I so in like the next day or so I should get all the the edited videos they'll all go up on Epic web um for free like Yeah just something [ __ ] up with mine will there be any YouTube or any link or the live streams are on YouTube that you can just watch the live stream if you want but yeah edited stuff will just be on the website do you have a YouTube channel epic web yep okay is it epic web yep okay I'm I'll just put it in chat for you at Epic webd or something like that oh yeah let's put it in chat yeah so yeah that was an incredible conference I got to see a little bit I went to uh Main Street in Park City with siron we got to explore a little bit and it was beautiful it was so much fun seems like a lovely place is I'm so glad that so many people were exposed to that wonderful place and it's a cute little city um lots of like Mom and Pop shops like selling you know you know their own stuff that they're making and whatever pretty pretty cool spot I'm glad that you got to walk down Main Street yeah tell us more about your talk that you gave to here yeah um so my talk was titled uh stop lying to your users um which is kind of implies that people are lying to their users um and most of us are um whether like most most of us are doing so unintentionally but the the LIE is um the app is ready like you can start using the app um and when in actuality like you go to click something and then something pops in and you're clicking the wrong thing um and so lots of it is the content loud shift or like the buttons are all there and whatever and you go to click something but the JavaScript hasn't loaded yet so the button doesn't do anything um so stuff like that uh I just uh it bothers me and so it bothers me too Twitter's like the worst offender oh yeah yeah Twitter uh like I I can name a bunch but I I did actually give some specific examples and talked about how you could change or like simple things you could do to solve those problems because it's actually the web platform um has a lot of like built-in capabilities that you don't actually need to wait for the JavaScript to load or if instead of loading this on the client and making a bunch of requests you just have it server render it's it's not any more expensive to server render something than it or to send Json than to server render like that's the server doesn't care if it's HTML or Json so like yeah just server render the thing and then you don't have to have spinners all over the place so yeah that's the idea I love that like it is a it is a lie yeah yeah I love that I'm excited to watch it yeah well the user sees it and they're like oh great it's ready for me but it's actually not and that's annoying good stuff what did I miss sorry I was debugging audio issues yeah I was just talking about my talk oh I cannot wait to watch it did you did you say Madison MC yes I did was this your first MC my first MC event first ever time which I was like so honored that you asked me you did such a great job God I had uh my co-c mark Texon shout out to he was really helping me he was like coaching me through he was like giving me a pep talk the night before it was amazing it was so much fun so what are you have seeing next oh uh to be announced I guess this is an open invitation invite the hardest part was like um the hardest part of mcing was for example uh like when lunch was running 10 minutes late so we as we walked up on stage we were like okay what do we do with this 10 minutes what do we say that seems natural and fun like off the cuff when there's something you know like cuz some speakers go a little over some go under so you have to fill the space and you want to be funny and natural and so uh people said we did good we got a lot of really lovely feedback that was the trickiest part like what do I say right now yeah yeah and if somebody else wants to book you in the future how do they do that oh yeah uh Madison Ken gmail.com I guess there we go let's go perfect so do you think having two MC's is better than one I think it was easier I think one MC is a lot harder I'm sure and I took some you know Mark has done it before so he was kind of my ment Mentor so I think I had the best ever experience cuz he was like coaching me through the whole time like you did great or try this I think 1 MC seems like a lot harder actually and we just played off each other's energy I mean Mark is just so much fun like I became like I think funnier on stage because of him like people were laughing people don't normally laugh at my jokes the first time AG first time ever it's true I'm just not funny but like I was just saying random things like uh we someone lost their glasses so on stage throughout the day we were like hey here like glasses and then we were doing giveaways and I was like let's do a glasses giveaway and I think Mark's energy was so amazing but the crowd was also incredible like the nicest people I've ever met it was a good crowd it was easy to do because I think it's part of like Kent SE Do's atmosphere like everyone are like orbiting around you is just like a good kind person like everyone there was so kind and amazing you know that's one of the things I love about this conference as well I I I found that conferences are kind of an extension of the organizer so however the organizer is that's how their conference is going to be yes and this is very true for Michelle's conference like these people are awesome super nice uh and the speakers are great and um just um a very positive energy going on here so yeah like when I was an epic web and I realized how nice it was like this could be Kent but this could be Utah then I came to Miami and it's still really chill so clearly this isn't just the state that we're in so yeah it has a lot to do with the organizer I think makes sense like epic Webb was so chilled that I managed to squash my beef with Ryan Florence finally it was awesome yeah I was so H to do that CU I've looked up to him forever and now he actually understands that I'm not bullshitting when I say that yes it actually it really changes your relationship with somebody when you meet them in person absolutely and so like from now that we've met for like all of our interactions online are going to be changed in a very positive way cuz we understand each other like we can hear each other in our like I've seen your streams and stuff but like meeting you in person it just changes things absolutely absolutely yeah I will say you're basically the exact same everywhere I've ever encountered you like people think that the positivity is like a face you're putting on and then they meet you first you're like nope that's just Ken well yeah thank you uh like I do I'm not always always per positive um but uh I try to be genuine and uh yeah hopefully that comes through it it more than does and I I think you set a really positive example for everyone going forward too it's like you you made the web absolutely a friendlier place it's really cool to see oh I I really appreciate that thank you thanks for coming up yeah thank you want to see what happens when we subtract one letter and how much the energy changes because we have a very fun guest next M TA in the other for us Chad get ready all right the man the myth the legend what do you have to say to me I don't think gr box looks like an old I'm still salty about that Sor what group sorry I thought you said his box my box Groove box the color schem doesn't look like an old Buick you don't think so no you son of a [ __ ] it's very muted and like Earth Tone how are we doing for the echo now guys real quick I just tried setting this back up let us know in chat or note yeah can you hear Theo not bad yet not bad great okay cool we seem to be good again finally audio okay they've been talking a lot of [ __ ] throughout but seems like we finally fix the audio issues talking [ __ ] K look it's good all right Ken wheeler in the house cool yeah yeah out here I feel so much better now yeah how long you streaming huh after yesterday yeah well you know what I like contrary to popular belief I'm actually an introvert what I call [ __ ] I don't buit three for three [ __ ] I get like absolutely like drained socially no that's the alcohol yeah no so like this morning I'm like like I went out to like breakfast with people they're like how are you I'm like I'm good they're like what are you up to today I'm like I'll probably go to the car it was like a normal human being for like 73 minutes yeah still I didn't see it I didn't see it yeah I don't know video I'm back in play now tell me chat can't see but tell me this is a picture taken of an introvert that's [ __ ] hot right let me see it oh wa yeah that's very introverting can you send me that no that that was blackmail keepe we got some black on chat chat is really wondering this question when did Pit people become a father and have kids and Le the right code too which apparently you know how to do I don't proof but you talk about me you talking about Pitbull you of course is here I funny enough actual pit is presenting at the I know we we tried to arrange a selfie but he's very in and out oh I don't know around like 28 nice yeah I was like 28 years old and um it's I'm not as crazy as you think me and my wife have been together since high school that's kind of adorable yeah we we we had been together for oh I don't know 10 years at that point how did you meet at a party High School who were at the party were you sober or no you were she asked where to go to the bathroom right that's exactly that's exactly right that's where the bathroom was and now she stuck with your children I show you're like the bathroom that way did she really want to know like about the bathroom or was she did she really need to go to I've used that l had to go to the bathroom when I like try to go in the bathroom she stop that like a line we like we like mad from this point forward you now have to be very careful who you ask where the bathroom is oh God take it back that could be your husband I know I'm never going to find could be your husband remember that yeah and uh yeah we have a we have a freshy now he's like one and a half and he's hilarious I've never heard somebody refer to their new child as a freshy no no oh I thought you said a Frenchy like a French B I was like well I have a Frenchie as well a freshie and a Frenchie yeah uh but yeah yeah dude uh it's funny having a little boy cuz like I don't know like today's day and age like you like like sensitivity around like pushing Any Which Way on them um but like with no encouragement whatsoever this [ __ ] is just into dinosaurs and trucks which is hilarious to me yeah good [ __ ] she naturally dinosaur and truck loving yeah and sunglasses loves them absolutely loves them so so how how you Ken you obviously have a very aggressive job that you work at got put in some you got to make some good product out there yeah how do you balance that all with the freshy people want to know this well I work at home no commute that's it yeah I I make a very conscious choice to work at home baby in one arm SP 404 with the hand and webcam for the calls makes perfect sense I like uh I've I've given up a lot of opportunity yeah to not move places or not be in office or commute to New York and it was extremely intentional to work from home uh just to like see the kids more be more tapped in like I have buddies and like they like go to work at like 5: in the morning and come home at like 8 at night they see their kids for like an hour a day and uh there's just not money you could pay me to do that yeah I don't even have kids you could pay me to do that no that's just 5: in the morning though for you that's fair but the the the idea of spending that much time going somewhere and being somewhere that isn't where I like to be is very stressful so it's funny like I actually used to enjoy the commute just a little bit I had like a 45-minute commute at one point in time and what I would do was I would sit and I'd make a beat on my iPad in the car while driving that is very you that sounds safe and like every morning I would make a beat on the way to work and I'd rrap to the beat and post it to Instagram so I have these like ridiculous raps on Instagram this may be the most Ken wheer thing I've ever heard can you right now no cuz cuz if I if if I start rapping I'm going to say things that yeah no my this is on my twitch Channel it was on yours maybe but is that K du [ __ ] yes it is and I'm like Yo Booty and breast this is try [ __ ] bad [ __ ] did I just hear breastesses okay it Rhymes I just remember profanity profanity a curse I've been swearing so much throughout this you're fine I don't mind when other people Cur I love it but for me personally I don't like curse I actually try not to C do at all I've always yeah I don't I I say like why uh I just think it sounds tacky when I first I just don't like it you know it's fine I explained it to my kid the other day she's nine your mic your M oh it's not on we didn't turn it back on yet to turn it back that's us not you can how much you just cursed I can't believe they took yeah so much cursing so my my my 9-year-old curses and I had to tell her I'm like I'm like you can't just curse there we go there we go sry I was recruiting people to be on our you know you're doing your job that was our fault not yours we have to Pepper the cursing it's like seasoning yeah a dish you mean you eat a plate full of salt and pepper I actually I actually get where you're coming from CU there's certain sets of curse words that if I use them I think I sound cringe using certain sets like there's some words that you ever heard him say piss sounds weird as hell he says it weird do you want to say it say it no I go pee pee yeah he so scared of saying you want to go PE PE of how it sounds dude bang PE in the chat right now I have certain words like that I will not say I think that they sound horrible I'm not going to say it now I'm not going to say I have one that I don't say that's not true yeah it is I don't say the c word ever oh the c word absolute worst my bag the British they love it automatic gunfire that word so I'm from Boston so I just use [ __ ] in all of the different senses and like you even pronounce it differently it comes out different like I fact yeah when I when I'm drug enough it comes out as F does it yeah absolutely that's how you that's how you can measure my alcohol levels or my stress levels by how much [ __ ] becomes [ __ ] I was just telling somebody before I I was in uh WBA W WBA W no not W WBA oh [ __ ] what the language right now this is east coast I go to like the uh Outback Steak House and I asked the hostess I'm like what's going to do around here and she was she was you want to fcking Patty and I said oh my God who's unbelievable very Boston I love Boston I don't but you're not Bostonian you're like a farm boy yeah I am a farm boy but I how Farm me what how Farm me well how far how farming yeah I my street was named Po's Farm like literally was a farm converted into a street what kind of farm was this it was primarily apples and horses wow that's exciting I was like my backyard was a horse farm oh I love that you an equestrian I wish I was rich enough to be a crazy horse girl I spent a lot of time riding and like yeah you know the term Crazy Horse girl wow it's a girl who's obsessed with hes I Look to farming and your decision was what I started to understand was is that um the farmers they they don't make money off the apples they make the money off of throwing weddings in the farm yep there was a lot of weird weddings all over by town and a lot of cranberries too weird cranberry BS Farm like events and things and like a lot of degener this conversation um Hey guys you're having a very East Coast talk yeah and we're feeling very excluded over here so tell us about Ranch you left us out yeah I also have a horse so you have a horse three of them you have three horses I'm kidding you have four my neighbor does uh she puts her horses on her land because her land's too hilly and one of their horses broke their leg last or two years ago and we had to shoot it so decided to change what do you shoot a horse with a gun what kind of gun well you only need so big a nine you can you can use a nine get a horse with a nine you could you could definitely kill a horse with they're not Grizzlies okay like there's not so one time I'm hanging out in New Jersey right yeah and um it's like 5: in the morning yeah and I hear like bang bang bang bang bang I'm like what the [ __ ] is that and uh a deer got its leg caught in the fence on my property yeah and I didn't know that I went on put like a headlight like a headlamp and like walked out there and like boxers and like [ __ ] like Hunter boots I'm like like what the [ __ ] and I see this deer in there so I go to Depot I go to try and get the right bit to take the fence apart so I can get him I tried a couple things I tried to put like a piece of plywood whatever um and my old man came over and and then he texted me he said don't worry about it he broke his leg snapped his leg trying to get out yeah and then I I called the town and I said I said I said hey can I dispatch this animal or do you have to do it and they said we have to do it so Town cop comes over and just [ __ ] takes his [ __ ] out with a 45 right there at 700 in the morning in a [ __ ] Suburban cold theack crazy bow D was crazy it's not crazy that's just what happens man yeah I know but like I feel like I've described outage as very similarly to this like hey can I fix this or do I need the other team to and then they send someone out a few hours later and they just like reset the server and then it's good exct my neighbors all came over they're like what are you doing it's crazy turn it back on my mic is on is it is it on there's a button underneath so I'll show you it's here it doesn't change at all when you press the button which is really dumb oh should work now so you don't know if it's on or off he said dispatches a gentleman's word dis it is it is really really isn't it but that's the word it it's that's a technical word I mean yeah I mean throw dispatch in a bar right now different huh put dispatch in a bar right now you don't want me to Freestyle I don't want you to Freestyle you're right you don't I really don't did you see that I was on the uh think now he's thinking so hard right now I see that I'm sitting here trying to not rhyme dispatch with this ass like so hard I'm like I'm like where else can I go with this it's like not propane what else RH you know Harry Mack right yeah did you see that Prime and I were on his Show recently no he came to uh the Awards it did freestyles in the lobby and it was Prime uh pirate software me and like another friend and we all had to give random words [ __ ] gives marup no I give marsupio he gave like plenty yeah plenty as words for him to sneak into a freestyle I could RP up both of those sure you could we'll hear it after the show yeah you guys look dapper at that thank you it's what happens when you rent a tuxedo you did you see the St on the [ __ ] tuxedo after I documented them throughout the night it was incredible like 45 minutes from showing up to just have the entire left side like just covered in [ __ ] I don't know what it was hey I live my life oh God I don't let a little bit of stains get in the way neither do I yeah from your uh what is it I don't know what from oily smooth I got stain on me right now you do oh my gosh what are you doing avocado avocado it looks like mayonnaise or perhaps mustard I got the same meal as Prime and he's all dirty and look I'm in white flet how do you get away with it that's a skill issue how do you do it she doesn't have to Skillet you yeah getting it all over yourself drink I just literally don't eat it I just pretend to eat it and I don't you know I actually eat it they in lies my problem I actually waterfall it I just you should about the same say the same thing but if you see her drink water you will immediately understand why she doesn't spill how do you drink water okay so I have she sure lips and I make sure I try she's a well regarded water Drinker I'm a regarded a well regarded water Drinker like you pour it in your mouth like you don't trust your friend's Health you's doing his job don't give him [ __ ] well Ken let me ask you a question have you ever worn lipstick no judgment here we're a sa SP wa really yeah you sp on for fun I have girl children oh that makes sense that's so true I B you have any idea how pretty they made me before I Babys it yeah I can tell you're wearing a little eyeliner right now but you don't want to get the LI you want me to show you no this is just me drinking some water okay never mind let's move on next topic this has been way too much fun I'm enjoying this a lot did you grab other people or because I I don't want to keep this going for yeah I've got uh David next then Ryan and then someone else we've got a bunch of people all right start blasting through them then all right where are we're getting more gifts oh lithium keeps gifting I need to thank you for all of the gifts you're a lunatic you've GI it over a 100 total in the channel thank you so much we'll see you later later gator Li love the K to Ken a by the way I think it's so good cuz they're only one letter difference and it turns out that means makes a lot differ yeah we won't say which was which though no I'm not asol I I I'm so sorry you have to follow up Ken like genuinely like that that sucks but I appreciate you for being here regardless yeah yeah thank you anyways how you doing man I'm doing good how should I introduce you I don't know you should say this is a guy who uh is the use effect guy I guess yeah he's the anti- use effect guy I'm the neutral use effect guy and one of my first like big YouTube videos to be reacting to his talk about use effect which if I recall you haven't watched our reaction still uh no I haven't yet yeah probably for the better I think I'm going to unlist that video it's it's cringe yeah so I I saw it then I read the YouTube comments and you should never read the YouTube comments and I was like oh yeah that's rule number one yeah whatever yeah also there ahuh okay CL is better with these all right not sensitive I suppose yeah anyways how's your war against use effect going uh well I'm going to be talking a little bit more about that today my your talk so my Talk's the last talk 52 and I'm actually doing a joint talk with Jenny so oh that sounds really cool yeah yeah what are you speaking on we are speaking it's called use wat so oh God I actually will be watching this I know exactly where this is going but tell the audience where this is going all right so basically use SW it's just there's an old talk called what the greatest Tech talk of all time yeah of all time I will not live up to it but basically I'm just talking about the weird stuff about react so if there was ever a reaction video this would be the one to do can you give us like a small I I will for sure like a very small stink peek no I can't cuz it's just like freaking everything every single or like a ton of hooks the some of the weird stuff about react server components just how react is weird in general but how like the the spoiler is it doesn't really matter if it's weird like you know it's just extremely useful it's a great tool to use yeah what do we uh mean when we say weird like unintended Behavior or unintuitive like I guess SK isue Behavior like when you add the string one to the number one in JavaScript it com out to but if you if you subract it it just breaks like thatp of like it's the weird quirks of javasript was the original what talk but it's going be equivalent that for react specifically by the sounds of it yeah no that that's exactly it very fun do you does strict Mode come up at all it does come up I very excited to see what happen when when a behavior changes between strict mode and not strict mode that that is when you know you're in deep yeah yeah and there's so many of these little gachas where if you're experienced with react you already know all these gas and you know it's still weird but you just deal with it they can presented in a really funny way though yeah I mean hopefully funny we'll see that's so interesting cuz I feel like I you know when you you start using something and you're a newer developer and I didn't you don't realize it's weird cuz if if it's like the first thing you started out with you think it's normal and then later when you expand more like you try other F like oh this is weird I could see it like you think it's just regular does that make sense yes it react does a lot of that I'm saying as a big fan of react it the way it makes certain problems go away implies things that aren't really how the like the world Works which is really good when you're writing react but it's really bad when you're writing anything else yeah yeah I wonder how that translates to like you know you learn to like think and react and how that switches your mindset when you go to other things it has resulted in almost every other UI framework rebuilding itself to have components or just dying slowly instead it's been really cool seeing like the Apple ecosystem realize that react was right and slowly adopt the patterns in Swift UI yeah and that's one of the main points is that react is really really weird like like you said thinking in the react way it's like extremely unintuitive but honestly as far as Frameworks go it's like top tier that's so interesting to me like what is uh can oh wait hold on hold on I have to interrupt did you a framework framework react is a framework you heard it here first react Miami react is all and none at the same time I'm Miss spoke in my talk I'll call it a library so what is um what's like a way that react is unintuitive like and maybe I don't know it I'm really curious all right so there was this thing a long time ago where the tagline was react is just javascripts and that's like so far from the truth and I'm going to talk a little bit about that in my talk but like hooks we just accept hooks like this is how you update State and everything it's like that's not how JavaScript or like it's like this implicit Global State you really have to sort of understand how that works um jsx that's also weird server components doubly weird you know lots of things use effects a fun one too where like like the the refusal on the react team to give anything an object config with key values is hilarious where like use effect has seven different behaviors all encoded by like where or if you put an array at the end whether or not you return something in it and all of these are weird implicit behaviors you have to know about react you can't just autocomplete your way to it because you can't make an object that's like the function that you pass it and then the oncomplete function and then the like dependencies is just all implicitly bound based on these specific things or like all the hooks they return not an object they return an array where the order of the things in it matters there are certain I love that you like that yeah that way I have the type I have to check the type know which way is which that's actually my favorite API of all of three app the fact returns a tupal and you have to have an LS you have to looking up on the Internet which one's which it's nice you can name things whatever without having to type a bunch of stuff twice but then you have to Define your props while typing a bunch of stuff twice so oh man I forgot dependencies definitely get confusing for me like I'm just like what is happening here what is what is firing when is this exactly where's all the dependencies like it's can be tricky for me yeah yeah and honestly you would think so now I mean obviously your experience with reacts um you used it once or twice yeah so you know like okay we have to put a dependency array it's like drilled into you but reading the original docks is it's not until you scroll at the very end that you see hey by the way there's this thing called a dependency array it's important and people don't realize that they're better about that now but they're not good enough about it still completely agree yeah what's the Dum react bug you've ever seen all right so when I first encountered the whole strick mode double rendering of use I love that one came to my mind immediately yeah going be a good one it's terrible and the fact that it like they have such good justification for it but or I I don't want to call it good but they have a very Thor justification for it but still it doesn't make sense having Dev mode and prod mode be completely different in Behavior like you said earlier it's yeah that's the one that got me I was like why are things logging twice I remember when react class components I added things like why did this component update and you were counting like oh wow it was 17 instead of 16 renders wow I should really check on that no one does that anymore why because react is just like did you see the argument I got into with Dan about this I have not it was a while back I was trying to like showcase some things live on stream and kept on running into really weird stupid edge cases due to the use effect double fires and uh what I really wanted it was very simple I wanted the equivalent of like use memo with a cleanup because I wanted to be able to something on definition and have a way to clean that up when I was done with it and the component unmounted which meant having a used memo having the thing appear and disappear twice always guaranteed mhm and absolute help defining that cleanup function because there was I I just want Ed memo with cleanup that's all I wanted and I could not convince them eventually some of the use case came through with like the use action stuff and then they got rid of all that too so yeah I I have my frustrations with a lot of these react core behaviors as well as a fanboy yeah that's the thing too introducing and then removing moving apis people don't talk enough about that but oh no worries see you in a bit later maybe no oh cool are you going take your phone with you my next sounds good thank you yeah I did not know Prime was going to be disappearing I I'm sure it's for a thing that is of value but I'm sure it's for a thing that is good it better be good you're you're Prime now you need to go shave and talk a lot about rust are you were you leaving I was waiting for I don't know if that's on and you're certainly holding upside down either way is this on still no now it is on I was really waiting for Prime to be done so we could so I could go home and take a nap so me swapping for him doesn't exactly work but you're thrilled we're exced all oh there it is Mr State machine Mr yeah I'm actually not talking about State machines at all that's not that's impos literally impossible you had such a good job not mentioning State machines we just been talking about weird react things yeah you know that uh he is a Florida man I am a Florida so sorry you done a great job of covering unlike most of them I'm not a Florida man I I chose Florida that that's even worse it is worse that's significantly you chose to live in the swamp yeah as long as snow I'm happy about it I literally grew up on a swamp and I got bit by more with mosquitoes in the 3 hours I was in your backyard yesterday morning then I had been in like a whole summer in my hometown you know it's great having you guys around because I always get bit by mosquitoes but when you're here when Adam's here I never get bit they go straight to you they look for the fresh blood they know they're sick of me yeah understandable any last words to mock react a little more before your talk uh I'm afraid to I don't want to get canceled online so I'm just going to keep my mouth shut understandable I'm the one here to get canceled appreciate you immensely I believe that we have what's it and Ryan yeah first up Ryan and awesome to a certain Ryan all right sure you know which one good seeing you all sounds good thanks again I'm going to swap these chairs out cuz I feel really bad for whoever gets the broken chair IOP it with yours I'm happy to sit on the the bad chair I'm fine what happened I'm not even on the stream yet chair hey got you a fresh chair broken what's happening in these chairs that they fresh brok no idea why or how but uh yeah sorry Jacob anyways good to have you here Ryan how you doing I'm good how you pretty good for those who don't know how should we introduce you try to turn it off what I think M on however you want all my on yeah no we're we're all good cool I make a chair yeah other ways probably just for that yeah so how would you like me to introduce you however you want Ryan is one of my favorite technical speakers and contributors he made things I don't like and things I do like and influen all the things I love to be better he created remix as well as react router and has been pushing the react team in a very good direction for how many years now too many too many for sure he's the one who got me hyped on hooks originally if you want to know how far back this goes yeah he he have those wrinkles when he started I did it's not related to age it's all related to react yeah it's all react that would have looked the exact same as when I was 30 yeah it is a long time actually I was just looking at um so I'm I don't know if this is public knowledge but I'll be on the page eventually I'm speaking at react comp and uh I was just looking at the commits on react router May 9th 2014 damn so that's literally 10 years ago I'll admit to one of my few engagement bait things I have done I went through a bunch of popular repos and found the source commit date and scheduled a like happy birthday tweet type thing for all of those on Twitter so I have a schedule where like it just will randomly like like I don't remember when it was for spelt but like spelt fifth birthday check my Twitter that's when you're going to know when it hits but I'm going to have to put react router on that list for sure yeah man May 9th good to know my birthday's two days before that oh you're back I'm back back I am even more scared to know what you had to leave for that was that important but it was also short enough is my mic is my mic on yes does he need a fresh chair I had to pee so he needed he doesn't need a fresh chair I just had to freshen up I had to go to the old little General's room fresh I didn't want to tell chat cuz chat makes fun of me for using the bathroom Chad Chad cool sorry uh chat is the people watching live I'm I'm an elder Millennial so yeah I am an elder Millennial too I'm not is online as you that's fair yeah I'm online too much he's online a little more than enough I would say so my kids actually call chat GPT chat that's hilarious that's yeah they're like oh I just asked chat for this he calls it chippity CH how old are your kids 16 13 and 11 oh my goodness okay so what is it like having a 16-year-old uh it's the best yeah kids are so much more fun when they're old you get to go snowboarding with them go on hikes they know stuff you don't know sorry I got to eat the mic um that's what I always told people when we played shows when I played in an old punk band you got to eat the mic need to dig into that too um punk band really power cord uh was that your nickname I I know some harmonic minor scales too like pentatonic sorry not harmonic pentatonic never mind I know nothing now obviously uh yeah so uh teenagers babies are the best they're cuddly like I I just kind of feel like there's this cavity on my chest that like I can't feel anymore but like but I can imagine my old babies they just like snuggle in there perfectly and so that's sad I don't have that anymore but teenagers are super fun because uh they're smarter than you with a lot of things so like you actually learn stuff from them they're fun to talk to they have like their own independent thoughts about things and uh I know he learns a lot from 16-year-olds in his twitch chat I do they help me with react I don't know if you've heard of it it's a framework hot new framework yeah I learned that before JavaScript yeah well I decided to use react learn react instead of unic Bas is his mic not on oh it's higher I can I can go higher on that topic though I genuinely feel like I learned Mo tools before I learned JavaScript I was just copying and pasting crap that was online and then one day I realized oh I know JavaScript and same with rails uh I was learning rails I couldn't I couldn't distinguish the rails from the Ruby right I it was just rails and then one day I woke up and I realized oh I know Ruby about so I think I think it's valid to say you learned to react before JavaScript so what you're trying to tell me is you copied and pasted JavaScript and you learned JavaScript from copying and pasting JavaScript thinking that I was copying pasting M tools yeah so you learn JavaScript by using JavaScript yeah yeah there's there's there's the truth and then there's the experience right yeah yeah yeah I get that well I mean the best kind of learning is a learning in which you get progressively less lied to I want to dig into the punk thing though because I've noticed a weird pattern where like a surprising number of people not just in our ecosystem but like web dev as a whole are deep onic so many and also like Punk artists in particular like do you know the history of Ryan carniato other Ryan yeah I've talked to him his band was called solid Mr solid or Mr solid that's right he still has the Mr solid like Mr te experience you got to have like the Mis in there yeah I still call him Mr solid sometimes but I'm trying to get under skin AIT it's fun yeah love love him so much I like that that's like a cross generational thing for him not generational like just just a lifespan of the word solid his progression and like his history is insane when you think about it it's it's like you know he he's still one of my like personal Heroes I've learned so much from that man I love other Ryan Yes quick quick question if if your band name is Mr solid and then you end up writing something called solid JS is that nominal determinism is that like itz I'm not old enough to know what that means who you are right and so it's like he named something and he was the thing and then he became the thing he worked becomes it again yeah he wanted to be really solid framework yeah and a really solid band yeah solid man as someone who's heard and used both respectively in that order yeah effective yeah uh my partner Michael he plays music didn't know Michael was also music Michael by the Michael Jackson by the way yeah um happens to be a musician if you didn't know so to my children when they hear someone talking about Michael Jackson the pop star they get so confused they're like yeah how do they know how do they know Michael and it's like and what are they talking about his alum anyway um yeah so there's lots of people um I'm trying to think of some other ones but I'm brain farting what what do you what Lindley is like EDM artist too yeah what kind of music do you play now now that you're in your Elder days your Elder Millennial days what do you what do you play now last song I performed was Sweet Child of Mine with my daughter she's a drummer and for one of her drum recital I was up there playing the lead guitar and then her um her drum instructor he plays guitar too he was playing the he sang and played the the rhythm guitar guitar but um I basically just play whatever my daughter wants me to learn CU she might be learning a song on drums and so so we've done Green Day we've done Journey we've done backseat lovers um which band is the easiest to sneak JavaScript puns into the song title or song Like lyrics of oh no I've never done it never tried why is it that the hip-hop artists are the ones who keep making really funny JavaScript like meme songs and not Punk I'd love to hear a punk JavaScript song all right one can I be real for a second yeah I don't like funny programming songs I didn't Kit's freestyle JavaScript thing was actually well done and funny it's someone with like an obnoxiously High bar for hip-hop stuff I was annoyed that it was it almost crossed the cringe to not cringe but it was still I I still had hard time if you watch it with just like the the track like the lyrics on the screen like like a muted Tik Tok which is how I use most video when I'm like scrolling through things it seems cringe and then when you listen it's actually decently well delivered I was impressed yeah I think he did a great job yeah I thought you do some pretty sweet karaoke last week Ryan at the Epic web you were doing some awesome what was that song you did you did a couple uh all the punk ones that they had in the catalog of course which was two blink songs jaming All the Small Things I love the songs dang it yeah got to keep my brand and um classic blink182 song Dang some 41 there were two sun41 songs uh into to deep and oh yeah I I can't do sun41 though Derek his lyrics are like or his vocals way too high pitched I can I loved your talk to you I loved when you were talking about how there are so many people who created something and then what it ended up being used for is so different than the original intent the that's most a lot of tech yeah that was a fun talk what's the worst thing you seen somebody do with react Rider cash way too many things I I worked in a codebase that was a lot of those things yeah this is actually a conversation that I was just having with my team it's hard to design apis when you have a lot of experience with people using your apis because you start getting paranoid because all the weird stuff you've seen them do with what you've made that then you're like you come up with a good idea and you're like oh this would be great and then you can see all the ways that people are going to like be weird with it and so then you don't want to ship it because you don't want people to do weird things but you can't design anything without people doing weird stuff it didn't stop react from Shipping use effect use effect is still good I like it use having you right is actually kind of funny now I think about it yeah yeah I I'm use effect neutral you're leaning positive he's obviously leaning very negative so he used to do workshops for us at react training um one of our Ked him out because of one of our contractors no but it was just it was kind of cool that we all taught the same material but like you definitely got a different flavor based on who you were talking to but I mean just compare use effect to component did Mount and component did update and it's and it's good yeah I I like it because of the way it lets you build your like life cycle around your data instead of around your components and like when they mount rather than having the data life cycle be commandeered by the component life cycle yeah exactly that said the use effect API question it's hard yeah it's a sharp it's super unintuitive until you've like read the whole dock on it and then used it wrong about I know but you don't like buy a Japanese chef knife for 200 bucks and then when you cut yourself on it be like oh yeah but I this kn is bad I don't Japanese anymore what's wrong with them I don't expect Japanese knives to go with my McDonald's ass framework I I want the one that I can't can't cut a tomato with and then I'll hurt myself I'll Mash that tomato that's fair I've definitely felt the knife nature of there there are sharp knives and there are foot guns yeah it's very hard to distinguish speaking of sh thing you made is one or the other you never know until you ship it speak of sharp knives and foot guns how are you feeling about server components I know you've come around quite a bit I think that they are an incredible Innovation that have not yet found a great application you said so coming around to them so you started off more of I didn't I I always loved them first time Dan showed them to me they weren't called server components it was just he and I in a little video chat he sent me a message like Ryan check out this cool thing and uh I was like that looks great uh we're building this thing called remix and it looks like you're just going to move the code from the loader into the component and that's generally it and that's how it mostly pend out so no I've been I've been a big fan it's the it's the they're just hard to do right I think like it's um it's really really really cool Tech really great Innovation but I don't think I think they're I think they're way too misunderstood and overexplained yeah like we just keep explaining explaining explaining it instead of like shipping one that's a version of it that's easier to use I have a Hut take on that one I think a lot of why hooks were easy for us to adop often learn was that you can adopt them from like a least up like any person at the company who likes react enough to update the major version can start using hooks on something in your code base whereas with server components you got to start from the roof you got to change everything to start adopting it so that's in remix it's going to work the other way um uh we actually just uh Jacob on our team who's working on it just uh has a demo for us internally about the progress he's got on it yeah where from our loaders you can just return like data right like an object with some keys and you're going to render that stuff but but uh our first stab at server components is not our final story but just the beginning is uh you can just return jsx from your loader and it'll come through like all the rest of the data from use loader data uh but that thing is going to be a server component and so it's uh you don't start with server components it's still all whatever remix is I don't know if it's server or client first it's kind of both um but it's still that same remix model but now just your loaders can return and actions too so so you could just be like okay this little this little thing is our components depend on the data like we don't know what our bundles are until we fetch data which is the like best use case for RSC the clearest one like you go to a CMS right and there's 10 different types of blocks that you could be rendering so you don't know which of those 10 components you want fetch it from the CMS and then render you can just take that one thing where in today in remix is rough because all 10 components are going to have to be in the bundle whether you use them or not and you can just move that little bit of rendering up into the loader and now you get the benefits of our without like having to switch to like app directory right you can just keep going I think another huge part that you're not giving enough credit to here is that like this works great if you're already using remix but getting two remix from an old create react app based react app is actually viable unlike it is in another framework but even then uh uh even then with react router if it works in remix it just means we we put it in react router they're the same thing um means react router loaders will also understand that but that react router loader would have to run on a server which is a big scary part of the adoption you're going to have to fetch from an RSC server yes so you could keep your spa out there and then deploy uh a react app that sends RSC content probably easier in this case if it were remix but you don't actually have to like expose That Remix to the app right you can just call its endpoints that send RSC content from an existing react router Spa this sounds like the exact type of thing I would hack into the code base and then get yelled at once somebody finally noticed after I shipped it which I love that's how you get adopted yeah you got to you got to sneak s into it so I've had one I had one boss that I really hated in my career but he had an amazing comment that has stuck with me my whole life he said you know we we were trying to decide to go to react from Ember and I was talking to him about it and he was like the technology that survives a really long time is the kind that can be easily adopted and easily deleted yes and so that's what we're trying to do with RSC is it's like just return a little say that one more time uh the the the technology that survives and last a long time can be easily adopted in like a small piece right in your existing system it can be adapted incrementally into an existing system and also removed incrementally from an existing system so you get it in there and then it can grow and eventually take over the whole system react was that way we we embedded react into an ember app the first time we ever used it because we had this one little input field that I won't get into details but it was not fast enough in Ember you type and it would pause all over the place so we made it a react component version of it and it was super slick and so we just embedded that into the Ember app and we could just remove it too if we needed to but was it is it I mean react fundamentally is super hard to remove once you have any sort of momentum like any framework like any Library framework whatever you use it becomes virtually impossible like I would say the web pack build that created it is the hard thing to get out of yeah really yes absolutely specifically like like with next for example which I'm obviously more familiar with if you use next in like Pages router error the old way you're literally just stubbing out a bunch of API functions that you could call from anything else I've actually ported a nextjs application to solid before by copy pasting the entire API directory dropping it in something else that has webpack and can deploy it via node for me and then just rewrite the UI and connect to it that way instead yeah so that's not easy to pull out rewriting the UI is the whole that's I mean that's the point technology that last or technology that's hard to remove the technology that meets a need it and you can convince people why or let me say it this way I think technology that's built this uh well built the last will be technology in which you can solve a problem with and other people can understand why the problem is solved specifically with this I don't think easy easy deletion has anything to do with lasting Netflix is still Prim primarily class components want to guess how long ago those were like it was a long long time ago for that ex so it's like are those easy to remove no they're actually extremely difficult to remove are they easy to start using no you to rewrite the entire app to start using these but they have such longlasting power once you've made that commitment yeah I guess um sorry when I heard that I was just trying to reconcile with my experience it's like when we launched remix and we were talking about Progressive enhancement and web Tech and everyone was like react and Progressive enhancement what are you talking about um but no so so in our case it was literally we put a we put an empty div on the page in the Ember app and then in an ember life cycle hook we said react Dom render and then just dumped it in that one little spot and we could easily just pull that thing out as as well right yeah but um yeah when it's already when it's grown huge and it's your whole app um I mean even react router stuff is hard to bail out of too um and it's hard to adopt just a little bit of that how did you test that like because because Ember and all these things you've already have written you obviously have a large amount of stuff you're sending down and now adding react to that you've increased your payload user experience all those kind of things how did you do that or was it just like a Dev decision this is a long time ago but the the performance issue was not like initial page load um the performance issue was as you're typing like the thread was locked up and youd like hit a character and like nothing would happen for a second or two and this is kind of where at the very first react comp 10 years ago I did that stupid DB monitor thing that like compared react Ember and angular um uh that that was actually a real app too um yeah react had actually you and I were talking about this last week at Epic web comp where you're like people didn't start using react for or people use react because of the component model not because of and then they put up with the performance perance problems and I was like no no no no we absolutely adopted react because of performance everything else is so much worse back then that uh react was like smoking fast they just didn't Market that way they they never they were always like like Pete hunt was always like it's fast enough we're not like that's not the goal to be like the fastest renderer just has to be fast enough but yeah and let everybody else optimize outside for you yeah but so to go all the way back to what you're saying with RSC we're trying to do it in remix in a way that you can just like put a little bit in see if it helps out and if it doesn't make it easy to pull it out as well um I I absolutely believe in the tech um I think it's going to take us years to apply it really really well across the whole ecosystem super excited I'm curious about when you were talking about uh you know building something that's easily easy to delete I guess I'm wondering like how do you how do you build something that's easy to to delete like what do you keep in mind compition I'm really curious I know that's like a dumb old programmer thing to say but can you expand on that um I want hear from C very much like like a bash like you're just typing stuff you know how you can like pipe one operation to the next like you could do like C package.json do the pipe and then you could do like grep react so that's two different programs you pipe the output of one into as the input of the next okay um and then grep is going to like find the lines that say react in it right so like you just go do that in any project and kind of see what happens if you do cat by itself Cat shows you the whole thing G just searches for the lines so these two functions uh cat and grep they don't know anything about each other um but they do one job cat reads the file and Echoes it out to you and GP searches the lines and Echoes it out to you and then the second important thing is that they share an a common interface which is strings they take strings as their input and they put strings as their output old nerds know I'm talking about the Unix philosophy here uh which is do one job and do it well I'm not old and I still love Unix but but the second thing that everybody misses the second rule there is use strings because they're the universal input use the output of one program as the input of the next I know okay and so um anything that kind of feels that way like react components right you can like you can drop a context provider around something and now it makes things available down in the tree and then you can pull that thing out as well um I actually had a I had a note-taking app that just wrote everything the local storage and then uh if you click sign in I I would underneath the local storage component a Firebase one and so I just took the the stuff that was already going to local storage and then I could just send it up to Firebase and synchronize it there and it was literally just dump a component in and now it's synchronizing to fire Firebase pull the component out and now it's not anymore so that's because of composition and sharing inputs and in react that's props and context and state okay so the one thing that I I I want to hear more of your thoughts on this one which is that you're saying that like you're your example with context for me is like the opposite because context is a two-way bind because on top you're like hey I'm going to start giving you a value starting here and Below you're like I'm going to rely somewhere above me like you're doing this thing which is which is very non-unix if you will environment variables that's what they are right in in the in the in the in the parable here uh context is like environment variables yes if you can generate them based on user behavior and change them at any moment the change moment the sketchy part because yes I'll give it I'll give that I but like I'm a program and I depend on something that I didn't Define and that's how some components work I depend on some context that react router put there um that's a lot like an environment variable my ideal use cases for context is not being able to from a component level update the context usually like the component level trigger something else like a navigation that would then update the context or like the user changes their like theme from like to which updates the context but I try to to minimize how much a component itself can change the context have the context be just like he's described with an environment gr I actually really like that framing I'm going to use that the future for sure this has been absolutely awesome thank you for stopping by and coming to chat pleas great yeah thank you find find Unix philosophy let's go yeah you told me I was going to be in one of your videos for testacular I know I and for the first time I watched a whole one of your videos I was going to just to stroke my own ego by the way uh Karma testacular which by the way was my favorite testing library in 2012 I used it like wild and 2011 yeah right in that region yeah it was a good one it was it was a great one yeah I just I couldn't say the word in a meeting without everyone asking me what the heck was going on it was obvious it's spectacular testing except it said the test Runner with balls yeah okay that's fair description okay maybe I tried the cope a little too hard there I love it well thank you so much passing that to yeah thank you so much thank you so much Ryan before we start the next one I have to thank our sponsor clerk for the wonderful mic stand that they have so kindly gifted me if you guys don't know clerk is the easiest way to set up off not just with reacting next but also with remix from our good friend Ryan yeah thanks to them for sponsoring us getting us here giving me my mic stand anyway thank you so much clerk yes join us who's coming on oh boy hello howdy howdy really close yeah there you go super close on how are you today I'm good how are yall doing good you must be tired you've been doing this for a bit now I stream for six to seven hours straight usually so I'm more tired from setting everything up I'm starting to get my energy back if anything all right every time I talk to any of you who are streamers the first thing I'm like ask is how do you do it because I feel like I tried it one time exactly one time and I was just sweating bullets by the end of it cuz you have to keep track of so many things the chat the whatever you're doing like the the Live monologue in your head it's just a the monologue is just kind of a default I wish I could turn that off sometimes but it it just goes and goes and goes and I have to to do my best to make sure it comes out in a digable way speaking of which before we go into the monologue we should introduce you and who you are all right Hello friends how would you like to be introduced um however you want I can introduce myself if you want you go with that all right so hi everyone that's watching my name is Yuna I'm a developer relations engineer I work on the Chrome team and our team focuses on web platform UI so all the things that you use to build websites primarily htl and CSS and a little bit of JavaScript for making things interactive um is what we focus on so we want to make sure that we're building the right things into the platform I work with a lot of other browser Engineers too to make sure it doesn't just land in Chrome but lands across the board so we can all use it and the goal is to make the web a better place that's really the goal yeah you could definitely do that for just an example of where she comes up when whenever I tweet a complaint about Chrome Dev tools or some weird behavior in the browser she's the first person that's tagged every single time every time I'm like let me help and you've done a great job at it yeah no it's cool and before I was doing this I was doing a bunch of stuff in the UI engineering world so I used to write react like I used to be in that space um Design Systems World unlike most of us you escape I don't know how I landed this job it's sort of a very Niche thing but it's pretty cool cuz I get to actually listen to what people need for the form I have a lot of opinions too and then make it happen like let's he some of those opinions what's the worst thing about react all right thoughts about react I feel like I don't have as strong opinions about Frameworks because everyone a use use a framework that is of your choice react his framework no no I know but he he's been trying to bully everybody saying reacts a framework since it started no react a conference react Miami I'm trying to tell them Community she's correctly identifying react the interesting thing about react is it's gone beond Beyond Facebook we have events here Facebook is not involved in this event Facebook was not involved in any of the react events except for the one they're hosting this year so it's pretty crazy to see how it's taken off and what it's become it's wild watching it because I remember when they first announced react at the JS comp and Amelia Island it was like 2015 and everybody was like this is dumb why would we write code like this jsx they were so mad at jsx and I think it was you know it was the way that they talked about it that didn't make sense at the time it's crazy how normal it's it's become it's like the thing on job applications now that people look for 10 years of reactor experience yeah I I think that the how react was introduced internally worked so well they assumed that would work externally which it didn't where like react worked specifically because they taught everyone at meta what react was like like one-on ones and like forced everyone to understand it and adopt it and then they took the things they learned from that put them in a presentation and that's what people need to hear to try something out for the first time I think that's usually how open source works like you solve a problem for you or for your company and then you share it and you hope that other people like it and so I think with react when it was new it was very much like well I'm not Facebook do I really need this level of Cru almost you know for all of the things that it does I mean virtual Dom there's a lot of great ideas and react that have now spread to other Frameworks so I think it's really changed the way that people code and I don't think it's necessarily a bad thing but it's definitely become a the web platform for a lot of people and that's interesting to see like I've talked to people last year as I react Miami it was my first react conference I talked to a couple people about CSS and they were just like hey if it's not in Tailwind it's not in the web platform for me I can't use it it's not a part of CSS in my world of styling and that was interesting and I worry that that happens sometimes in these ecosystems where you learn a feature a library and then you sort of stick to that and it prevents you from kind of digging deeper and learning more things that could help can I an alternative take on that one cuz I know crie is going to love that and agree with that as somebody who doesn't write any code in the web but I someone who writes a lot of code in the web Lally just wrote a startup yesterday yeah which is a yeah which works through the terminal he had somebody else write JavaScript for their servers in the back end and he wrote the whole UI and freaking goang in the CLI so he does not write web stuff no hate in fact he's been giving a bunch of crap to the one person on team who wasn't trying to build him a website because he's trying to build him a website okay so my hot take isn't that my hot take is that I had largely gotten burnt out on keeping up with what was Chang with the web it honestly felt like a 50/50 shot as whether or not this new thing was going to be worth looking into at all like web components flopped I I hope we can all agree on that web components have not reached even like like close to other Frameworks levels of adoption and web components have had a lot of issues yes it I I I could spend a long time randing about that I don't want to go too deep into it but we mostly agree web components were not what we expected them to be when they were initially launched and pushed other things like a lot of the new behaviors around line clamping and CSS for example are things I would want to use and consume but I don't know which ones do and don't work or how I should consume them or if they're ready or not something like Tailwind or something like react are actually great gateways where people who are deeper in those things and trust them more can make the right decisions and then bring them to me so it's not so much that I'm not trying new CSS features because Tailwind it's actually kind of the opposite is I know which ones to try because those are the ones tail into dos I have a couple thoughts and I actually meet with Adam every month and we talk about new platform features to make sure they get added to the browser slash to Tailwind as they're added to the browser um okay so my thoughts on this are I think that when you're talking about standards those are features that are added to the platform that get consensus that are designed in open communities and in working groups so it feels like those are things that if there's positive signals across browser you can trust will become a part of the platform of course browser support Etc tail one is not a good example of that actually because ton 4 uses features that aren't even landed in all browsers yet like app property color mix is brand new so I you know there's arguments to be made on both sides of that I don't think Tailwind is like an inherently bad thing I actually support people that use Tailwind the part that I struggle with is when people say this is my web platform and this is my subset of features that I think limits them so today I talked for example about scroll driven animations that can be used really well for Progressive enhancement I talked about popover features I talked about Inc positioning which is kind of like next to the web platform if that's not in Tailwind yet are you really going to ship a bunch of script because you waiting for it to land in Tailwind like why is that a better indicator especially for Progressive enhancement features like scroll J animations all I might have seen this I I feel like this mindset started to die out though where like in the early react B especially with hooks I saw people using hooks for everything including a lot of things that don't need to be running in the react like world at all a lot of the things would be better to just to find an object outside of a component and do a bunch of work there async and just bind that two reaction any of many different ways but I definitely have seen some number of people who who get so deep into a solution that they don't look outside of it I do think that's rare than we give it credit though generally speaking I think people see the tool as a tool and are willing to try tangential things like I I haven't met I can't think of any Tailwind devs I know that aren't willing to bust out the CSS file when they really need to those are Tailwind devs when I talk to developers generally in the community a lot of them learned Tailwind as the way they learned Style they didn't learn other things yet that was their entry point and when I talk about you know why is it the case that's why my boot camp Tom me that's the way that I entered the industry which is obviously shows why it's valuable because then you don't have to learn the entire Cascade you kind of get no Cascade you get like these bits and pieces that you can apply I mean the biggest Pro for Tailwind is that you copy and paste if you're using the base same base Styles you get what you are thinking you get yes you don't have to apply it separately we can agree for the most part cascading is not good behavior especially when learning I disagree I think cascading is really powerful it just is another skill that you got to take into account when you write code I'm actually tot first off I'm totally on your team with this one I'm going to come out the anti- Theo stance on this one which is that he always does the the value in an engineer isn't the value of the library it's how they understand why the library is there and how well they can go in and out of using that that's what makes a good engineer so understanding why CSS does the things that CSS does it's great I love Tailwind I use it all the time but there's so much more value in understanding CSS and then using Tailwind helps Tailwind helps you understand your code base more like because you don't even know why tail why is why is Tailwind so modular well until you built like a bunch of websites and go man I should not have called this one list item Foo and this one list item video because they're doing the same I should have just had our list item and then you start like oh look at this I'm like building these things and you understand the philosophy behind it because you took the time to understand the concept not just the library and how to use it I'm very into like the core mechanics of learning so I my hot take still stays the same here where like I had done a lot of these things I had gotten bored frustrated annoyed with them I I consider myself almost anti CSS I hated working with CSS so much and like I had tried every style solution i' had been deep in them like I was like about to start contribu material you guys I was so done with stuff and then I decided to try Tailwind I didn't even decide somebody else at the company I was working at used Tailwind for the website I had had a Blog to I was like oh fine I'll give this a shot finally after like 2 days I was fully hooked and it made me start liking learning CSS more again I had stopped learning about new CSS stuff because I had stopped liking doing it and Tailwind made it fun again and made me go deeper because I finally wanted to I will also commend Tailwind for implementing new features pretty quickly and for example like they too quickly for T and 4 I think it's you know quite bold um but like they for container CES had a first party uh extension pretty early on um when I talked to Adam about incos J like they're interested in making sure that Lance and Tailwind like they want to be on top of the latest stuff um but I think that that's important and good I don't think that's the only thing that you get you also can't learn semantics that way like there's just you know so much more one world turn framing I just thought of because I mentioned it what is worse for a developer learning standards Tailwind or material UI I think there's one that's obviously much worse UI is a third party material library that that everyone uses instead of learning anything about the browsing there's a lot of component Library yes but but mui is like the one still even a bootstrap kind of but like mui has been the one for a while now I just don't think there's a lot of value in saying like this one's way worse or this it's just I think one actively encourages you not touch CSS the other one literally has the CSS is supplying in your editor when you do it I just don't think so I think that people eventually whenever they use especially like any of these type of things they go I don't like how this is I want it my way and then they have to go and investigate why these things happen either of these tools I think that they're similar to me and that the utilities that it will get you there quickly 90% if you don't have a team if you're literally a small startup with no designers and you don't have a design system and you just want to get something shipped for a prototype great that makes sense not only that but there's a lot of money to be made by these companies selling components like mui has a paid plan I don't even know it's like $20 a month for component Library like for just like a data table for things that are just to too hard to build right on the platform which is what we're trying to solve like making that easier making that more democratized so I mean the goal is to make that all easier so that people don't have to rely on paid solutions to build cor platform features but also you're never going to get to 100% of a custom like nice feeling unique UI that makes you stand out from the rest of the crowd without actually digging in and writing code probably CSS and HTML I I think this is the part where I disagree specifically is that like when it comes to like like what percentage of of perfect can you get to with a different tool I think withal UI both doesn't get you as far and gets in your way a lot more when it's time to go out where the the jarring nature of going from mui or a component library to writing CSS is a much bigger Gap you have to jump over than going from Tailwind to writing CSS apples and oranges it's a different Fidelity and type of Library a component Library versus utility Library I feel like it it like there's a a notable Gap there that isn't just like app versus oranges well the utility library has components you can copy and paste that use tailin doesn't tailin doesn't have a showcase a separate sold tailin UI thing that almost no tail and devs use because they use something like Shaden or something else instead okay but open up any blog post that talks about tailin you can copy and paste their UI components sidebar whatever it is cards profile not really that's that's I mean that's how vzer works is that I literally copy that and I get so they're doing it based on chadan which is a whole separate thing that's built more heavily around react r than it is built around Tailwind Tailwind like a implementation detail there rather than being but it's but like you don't Google search Tailwind components and get Chad CN you Google search like modern web components and get Shad CN I think we're we're we're too far in the Weeds on this one we're not actually making any sort of real progress my issue is I'm in the weeds because I can't find examples of what you're talking about I feel like things like bootstrap and material UI were a real problem that they they forced developers to be so far away from CSS that they weren't learning CSS I think Tailwind is a huge gap a huge jump in the right direction where to use tailin you have to know some CSS to use material UI you don't know any CSS and as soon as you learn CSS you realize how much these things fight each other I just I I do feel like uh learning tail one made me learn more CSS and I like that I hear this so which I like to hear last time I was here I was surprised to hear a bit more of the opposite which was more that this is my domain of what is possible in my realm of CSS knowledge and I don't plan to learn outside of that because my team uses this Library chat let me know hit me up I'll do the rare hit me up with my DMs if you're a person who feels like after learning Tailwind you were less interested in learning CSS let me know cuz I really don't think that's the case let's do the chat no no what I would like to know is if you are someone who uses Tailwind how often do you write custom CSS and are you following along with updates to the platform to constantly improve your CSS and that's what I hope most people are doing but I I'm still researching that like I I want know I think you also have a huge bias problem you also didn't know CSS and you're building things and you're in the middle of your journey going through this so by the very nature of building something in the last two years if you are newer and you're using Tailwind you're going to also be learning CSS oh so you're saying people are biased like if someone just came in they learned Tailwind first then you think that did you learn a component library before Tailwind or use one um yeah no I had used them before but I I would say like I I thought tailin was like fun to use so I actually got more like before I was kind of like oh I I don't know if I like CSS and I felt like ta was fun and then I started learning more of the fundamentals and I felt like oh it's it's more exciting to me now this is exactly what happened to me and I hear this so often I I I I know I could name a dozen people on top of my head who got more into CSS and more into the platform and the standards and all these things myself included because of tailand it it helped us get away from component libraries we were stuck in component Library land for like a decade in react World and getting people to stop make like buying or grabbing a component Library instead writing their components for the first time time even like shsi and which we talked about it's components but they're components that are in your code base so you can change anything about that's a new thing for react devs yeah I think that that's great to hear honestly because I agree that the right direction is away from pre-built components you have way more customization if something changes in the ecosystem you don't have to worry about having to update and then having things break so 100% like separating your logic from your Styles is a really big part of the thesis of what we do and when you have your component libraries you have a lot more sort of inter weaving of logic and styling which is yes a lot harder to break out of so again I'm not anti-wind I I'm happy to hear that this is making you more interested in learning CSS and I hope that that's the case across the board yeah also your talk which or one of your talks I saw last week love on all the cool stuff that's happening with CSS right now I don't know if we already talked about that and I missed it when I was wrangling guests but no we were too deep in the woods about I I am really excited we talked a bit not I I didn't have a chance to watch the talk yet but we talked I think it was the night before going in on the uh what was the other name that was proposed for the layer that Adam was talking about but the like dialog layer is being introduced yeah so dialog is actually stable in all browsers right now so you can use it um it's been out for a couple years um it's the top layer I think is what the top layer so yeah dialogue pop is an attribute that you can apply to any element give it your own semantics it could be a menu it could be navigation it could be a tool tip um and then yeah you don't have to fight Z index wa we we have moved past the index for your modals finally after how many years oh my God I'm still trying to get this a style drop down that's that's I remember Adam was talking about having like hierarchies inside of the top layer and then realized he was Reinventing Z index on top of Z index supp to escape and now we're doing it again yeah you get a ton of other benefits too with things like popover and dialogue where you get default like tab management so even if you have your popover at the end of your Dom you can just tap into you know from the popover button into the popover um you don't really need react anymore because I was about to say like I I put so much time into crazy things with react portals this is Magic to hear about exactly so you because of that you can have it inside any component and then it trickles out to the top layer outside the rest of the components and then again about C andex are dealing with portals um there's a lot of other good stuff too you get automatic keyboard navigation for like escaping and double toggling so you don't have to add any of those events yourself um there's a bunch of other stuff now I'm just like thinking off the top of my head what's your favorite thing coming to the browser in the next couple years that you're that you're allowed to talk about anchor positioning let's hear it anchor positioning I also mentioned today it's actually Landing in Chrome stable next month it's not in other browsers yet but it is such a powerful API so if you ever tried to have you ever like tried to build a menu NE never once what's a menu yes you know like a drop down then maybe have a sub menu I I brought popper to Twitch and it was a nightmare I caused multiple outages in the dumbest possible ways funny do to Z indexing plus popper but yes so fun fact popper is on like 4% of all websites it's wild that makes a lot of sense yeah it's cuz it's a problem that's so hard to solve with everything you have to deal with scroll you have to deal with you know um resize observing you have to deal with element observing like as things enter the viewport as it hits the edge of the viewport all of that is very heavy logic so anchor positioning does this natively you just have to say that your anchored two elements you give it an anchor name and then you can use the balance of the anchor to position any two elements two or more you could have multiple anchors together declaratively in CSS and it's super super straightforward what's in more websites popper or web components probably popper I had to I'm sorry but that is so nice to hear that anchoring is finally happening it's so like that's just one of the many pain points that I've had with chrome and browsers as a whole that's finally being solved and I feel like I've seen this progression in Chrome over the last few years especially especially when Nicole was there I talked with her a bunch and she was incredible it feels like Chrome stopped trying to Define how we use the web and is trying to help us use it to its best has been a notable shift I think that one of the big shifts too is I don't know if you know about Houdini like the Houdini effort for CS don't so this would be like 5 years ago and before then a little bit um there was a real focus on shipping platform Primitives like the typed object model things that were way more lowlevel and the hypothesis was hey you know we're going to have developers build libraries that other developers are going to use we want to give them the Primitives to hook into the browser system instead of the highle features um and that felt like JavaScript developers writing CSS like trying to Define CSS and there's been a big shift since then of just having people who care more about CSS really like take the lead and the focus on the future of the CSS ecosystem um there's a lot of other things that have changed too but now the focus is higher level declarative features that give you a ton of control and power that fix these gaps these really big gaps in the ecosystem like styling drop downs like anchor positioning popover these things are required for styling drop downs is all in the same vein you know view transitions really powerful view transition are so cool I'm really hyped to start using those for more things and they're a really great Progressive enhancement so I think few Transitions and scroll driven animations are an awesome Progressive enhancement like don't even worry about shpping polyfill it's not cord your user interaction you can get like the default you know interaction now which is probably just changing your page or items coming in like usual and then add little on top I think they're really good Progressive enhancement the other way too not just like browser technology level but like has your JS loaded or not level so like if you have Js Transitions and those haven't loaded yet and you you go to the wrong page and you click about and it can transition nicely before the JS even loads that's huge yeah and like speaking of performance during my talk I showed a case study where um well one team that we work with tokopedia they studied their uh performance off you know as you scroll it went from like CP like 50% CPU usage to 2% when they changed over to the native feature versus using classic JavaScript events cuz you have to do all the scroll handling yourself it's really janky sometimes I I I hate the trend of doing everything in JS for your scroll Behavior even like apple makes this mistake now it's horrifying right so hopefully in the future we'll have a smoother web platform because of these features and we able to separate the styling like scroll is style you have things animated on scroll that's style from the actual logic like that's the whole idea scroll a style is pretty dope yeah yeah I'm hyped I I've recently been too deep in the new JavaScript features not the new CSS and styling stuff so is all super cool why I speak at react conference like I'm not a react developer really anymore per se but otherwise we won't hear about this it gets out of the Tailwind hopefully Anor will be uh I think it will be soon hopefully um but yeah this is why I think like the audience of people who really focus on Frameworks on JavaScript on you know that ecosystem full stack developers front-end developers even are more full stack backend than they used to be I think um these are the people who benefit from these CSS features but they're not following along as much uh so I'm very happy to be here react Miami to talk about CSS it's my favorite thing to do this this enough love it thank you so much any other things you want tell the crowd about before we find our next guest they want your Twitter Handle by the way my Twitter handle is Yuna like USA with an N why do half our guests have better handles than us I think my handle is Prett I'm older than you you and z are like the the Kings here it's insane you're three and four characters yeah the three character handle um I got pretty also in GitHub is Yuna and codepen so the three Coden love it yeah the three platforms that matter right right exactly so find me on Twitter I write about all this stuff I share a lot about it thanks for having me thanks so much for here all right I'll see you later thanks again all right our next guest is Ryan and then we've got Wes boss which Ryan uh sorry I poting to the wrong person uh sure bring my mic get him over look at my name my first name name is the name is I put it down and then get him just sure yeah that works too I'll find him I don't know who he is who are we bring onize don't bring him I have noidea yeah yeah West is here we'll take West we'll take you're you're up West are you ready are all the mic's on yeah they were wrong hey folks howdy howdy how I know that are you excited I'm soaked soaked to be here thanks for having me on of course thanks for being here man the other way too deep in the weeds react podcaster video Baker whatever you want to call us nowadays yes the content creator I suppose is our term now yes yeah whatever it's it was tutorial guy at the starting or blogger way back when and little a little closer yeah little a little closer all right I'm so happy I got to miss the tutorial wave or Al honestly like pull us out of it I was so tired to that [ __ ] oh the like just making tutorials everybody tutorials are snoo the tutorial YouTube most YouTube was tutorials like the traversy era where just like everything was a tutorial and everyone like to this day I still feel obligated to make them both because like the few of bet have had such positive feedback but also like that's what tech YouTubers do they make tutorials right you're an educator that's just teaching people on YouTube yeah yeah exactly yeah it's it's crazy to see all the the content go change over the years and I know that's kind of cool I I've told you this before you had my favorite thumbnail of the year last year okay you know which one it was I had the favorite thumbnail you made one of my favorite thumbnails of the year last year probably the favorite I don't even know what what no what was it you had one particularly incredible thumbnail you don't know what it was I can't even think of like a good I've ever made it was the webcam in the split browsers oh yeah yeah that was such a good thumbnail for those who don't know I can't really show it easily here he did a crazy hack where he got a bunch of browser tabs to synchronize so that they knew each other's window location so he had his in all of them and he could move the windows and have space pry Co that was so wild yeah we you get the cuz you can get the screen value and you can get where the browser is in relation to the screen and you can offset the values and like that's been doable for like 15 20 years but for some reason one guy like brought it back up and then everybody started doing demos with it and yeah that was kind of an accident I just took a screenshot and then the video did Super well and I was like oh damn it was an incredible thumbnail maybe I should be thumbnailing a little harder yeah the video was also good just to throw it out there yeah bad videos don't perform well yeah yeah that's true yeah but I I a video can't be better than its packaging though that's the key is like in order for a video to succeed the video has to be good and the thumbnail has to be good and the thumbnail and the video have to have a powerful relationship where they actually like meaningfully intertwine and by having your thumbnail literally be part of the video and it be something so compelling CU it stands out so much it would just like I all of my check boxes for a great thumbnail I loved it I thought about it at least once a week since that's awesome thanks a lot you can also just go surprise Pikachu yeah whole uh uh repertoire of those yeah I I used to film at the end of every stream I just sit there and make funny face at my camera for four minutes and then take a bunch of stills from it and then I learned I I know the quirks of every single piece of video playback software on Mac OS because none of them let me take Stills that easily fun fact VC media player will weak memory every time you save a screenshot a file 4K or higher until it eventually crashes or hangs your whole system what so we for the podcast we built a script that scrubbed through the an hour of podcast and took 500 um just random screenshots and then it uh used AI um face detection to describe the emotion and then we like sorted by the highest emotion so you could like sort for like angry or like like happy and then you would get like good frames because like our editor was like like I need I need like a good thumbnail and he' just be kind of sitting there dragging along you know looking for it so like we built this little script that would just take million screenshots feed it through AI it took like a minute or two to run and then it kicked out sentiment analysis that's what it was called so did you have guests that were just like oh this guy was really indexed into angry the whole time like some emotions on yeah rate the guests by their emotional profile was actually not a bad idea like stats like how happy or angry was this send him a heart rate monitor too that could be useful that's like oh that' be actually funny instead of like the YouTube plays show the heart rate on the scrubber bar I watched a game show a few days ago was Game Changers drop out or on drop out for those who are curious where the way the show works is they don't tell the guesss what the rules are they just get scored throughout of no idea what's going on until usually the end and they gave them all a mic booster that was actually just a heart rate monitor and they would give them points or not based on whether not their heart rate was 20 above resting for the whole game show so how do we do that but for a podcast is now what I'm thinking I think you could use that as a way to make your guest uncomfortable right like the moment it starts going up be like really tell me more about that true you know where to press oh that would that's actually not a bad idea like you could do that with a aop or something like that yeah do IDE so I actually do I've considered putting a heart rate monitor on for stream sometimes for fun but I don't want to get bullied for how bad my resting are heart R nowaday it's so bad yeah there's also the that's a sad thing to be bullied for the resting heart rate yeah man you're out of shape or on or on meth either way you me good 75 being excited right now let's see that's amazing eat I'm not excited to see you're going to be rocking 90s I know I can't help it mine is super low as well it's like something really I think you means you're dead my last is it right now I'm at a 75 but I'm excited about this so I think my resting is like a 63 I'm at 93 right now that's really good3 93 yeah 93 you got a lower your life brother told you yeah as I said remember you guys said you wouldn't bowling before and here you are oh no we're not this is not B this is genuine concern I'm Melle trap this is like a you're years for here buddy he says we're bullying him I'm just like my bully hand bullying consoling so now y know why I share that number change languages I wonder what m is that does maybe air handling is the reason why you're at this rate I want to find out what mine is it's definitely Sur to be clear I have terrible resting heart rate right now cuz I got I did I slept like four hours last night drank a whole bunch and then exercise in the morning my heart rate and hydration is probably just horrible the com did give me a good opportunity to back for those who don't know West created syntax FM which is now part of Sentry yeah a conversation we had earlier with Z was that a huge part of centry strategy is to S off JavaScript into the greater like world because it's so prone to weird stupid errors that Sentry's product now is more and more necessary I'm curious what's your role in the in shid ification of the web in order to help Sentry have more customers yeah honestly we are just trying to lead everyone astray so that they write the most garbage JavaScript they can more erors JavaScript yeah yeah well obviously so you're for the course JavaScript no oh we can we can make it work with typescript as well you know just more enies fine guys by the way use any everywhere you can it just makes life easier no lots of assertions like under yourself you know I search it's in the libraries where you can't see them that's ideal those are great yeah just throwing randomly whenever value isn't exactly what you expect and not do like making the error accidentally copy pasting the wrong error so you get the wrong thing back I'm actually a huge proponent of asserting like wild in your code are you yes it's called tiger style n and it makes uh significantly safer the the general rule is you should have two asserts per function per function yeah negative space programming you assert like if there's something you do not so John karmac also did this a whole bunch in like a lot of his older games and the whole notion is that if you expect the world to be away and it's not your program should crash and tell you your fundamental assertion about the world was wrong and you have to to fix it oh I see what you mean typt and typescript and assertion is no it is this it's instead of like writing like a type guard where you're you're checking it that's what I was talking but yeah I agree yeah you it should crash and you should fix it I like that did you say it's called tiger style tiger style I wonder like how many things we use because the name sounds so cool no no no tiger beetle made it up how many how many things do we use cuz the name sounds cool how much does like naming factor into like what you're using you know what I mean Rea is it a reactive framework by the uh what the mean stack got pretty far because of how how cool that SED yeah that sounds pretty cool what what else that's why I the the lamp stack obviously Leos got really far named after the disease lepos was telling you about the upside down stack that you guys were doing that's hilarious than I can't do the hand gesture because apparently some people find the hand gesture offensive you'll just show me later okay I'll just show you now can we see it yeah so so that's the upside down stack it's an upside down triangle we a funnel so is that offensive to versel yeah so yeah triang so we like to refer to uh Dax as bottom G yeah what gyo is uh we call him a topg so uh he's number one Dax is the last one and so now that's our stack is go in the front end I like it typescript in the back end beautiful I love it yeah I hate it but I'm proud of you regardless yeah we made the single most cursed stack are you gonna stick stick around with that Cur stack yeah yeah it's very it's doing great it's running beautiful I like it all their customers have to SSH into their servers in order to buy coffee I saw that I was talking to TJ about it brilliant he been telling me about this idea for like a year now first of all like coffee in general genius but like buying it in the terminal Next Level I love that yeah there's no time like when I'm in t-u like trying to make my project run where I'm like yeah I need coffee right now let me SS to terminal that shop yeah you know whenever I'm in a project it's not like I'm going to open up a website and go do something jez can't do that don't basic basic [ __ ] Behavior over there I'm already using all of my Ram between slack and electron vs code in electron three browser tabs and like my terminal which is also in electron sometimes so I can't keep like allocating more memory obviously I should just use the terminal buy my coffee I think it's brilliant idea I I think it's great I would buy I'm going to buy some is is it sold out uh no we intentionally shut it down until after tomorrow because tomorrow is going to be where we actually go to the like the workshops and we'll be making coffee for people SL letting anyone who wants it in person I'll like sign a bag or not sign a bag like please don't touch my bag then I won't touch it they want to make sure there's enough left for people you can buy it you're selling it to yeah you made me coffee on great on Netflix it's an important detail you're not just giving it to them you're also offering to sell it to them yeah we're offering to sell I'll be handing them a couple coffee which would be delicious or they can buy a bag but I we wanted to give them an opportunity because you know you're in person it's a little bit more fun you know I I heard that I'm getting a bag for free if I tweet my honest experience I'm going to be like this coffee sucks I'm just kid we did not make this agreement and I don't know who did g Adam he's in front of the part of the business deals anyway I'm excited to try the coffee for sure yeah that's sounds awesome what's your weirdest merch that you've sold yeah someone who's a king of weird merch we made a bath basketball which was cool I made a skateboard it's not really weird though I have the skateboard I haven't set it up yet I'm excited try your skateboard came with grip tape already on it what the [ __ ] yeah well so we got them made and they're like do you want them gripped and I was like yeah you know I know you're not supposed to like pre grip them but like I know that it's like buying a computer case with the motherboard already installed yeah it's called NXT and I do it all the time the motherboard and everything else buying a complete is one thing but imagine like a partial like you're with the motherboard you still have to do everything else like come on why do that one step yeah no skateboard was really cool um we made Koozies which we're giving out tomorrow at the live recording they're but like like metal aluminum ones that are pretty cool and then we're looking at a bunch of stuff I had samples for a vanilla air freshener like a vanilla JS air freshener I like that that's pretty fun what does typescript smell like then oh I don't know Annie it it just smell like a chicken or it's like you open it it's a random one changes every couple days CRT monitor you know like they like those like like beige CRT monitors they that computer new computer smell when my wife and I got married some time ago we uh handed out Koozies as a wedding yeah that's I love azi great yeah did you do the foam ones or the yeah I was trying great for boats great for the foam ones is like more like my style but I think half the people here would throw it out so we're like let's get let's get the aluminum ones and hopefully people keep them around for while I think part of my sponsor deal is I have to keep one on my desk so oh yeah do the do the aluminum do they sweat no oh no they're it's like a like a vac it's like a it's not a Yeti but it's the same idea it's like the vacuum sealed in between two layers of aluminum so that there's no how much science is going into these coasters Jes lots of science yeah you got to know about thermodynamics and how heat transfers he knows about particle simulators now yeah easy tell me about it well I said I bet you I can make a particle uh what's called a particle engine like that can't be that hard I can do it in about an hour so te was like no way so te was animating on the coffee in their terminal like little like steam that would come off it and he was like why are you he's use chat GPT which is fundamentally dumb when it comes to that funny but it was like he just had like three that he was like rotating between yeah and he was like no we got to simulate it for real we're going to put a real particle engine in and I was like that's not how that works and he let me find the exact quote cuz it was great did you you build it yeah yeah it was I never created a particle engine but I'm pretty sure I could do it first try says the primagen and an hour later he actually made it work so how do you how do you do it how it's very very simple so the general idea was this is that you know what a normal distribution looks like right yeah yeah so it's heavy the Middle Light so I figured the cup is like a normal distribution the center is where most of the seam will be the edges won't be so I just put 100 particles in there distribute them according to the normal distribution said you have a max speed and how much Max life can you have chose random numbers in between zero and that and then every single like X that it fell into or Y that it fell into I'd count and if you exceeded certain numbers I'd display a different asky code so the more numbers I could just like do that then I even made it so that like you could do a list of asky codes if you're greater than seven and if you're greater than nine you could use this list of asky codes so it can kind of change and so I have some other fun ideas I want to do another one where I added even where like you can specify the why as well so that way you could have everything face this way and then when you go up one level it faces the other way so it can go like d d right like it's kind of fun and so that's the idea is you just have yeah I like that a lot I've I've done some like not that but like that with like emojis when um there was some method came out in JavaScript like eight years ago that uh string. repeat came out and I was building some fun stuff with that that's really cool definitely not normal distribution heavy though but it's like super fun because I know the idea exists I'm sure I could come up with something inside my head it's just like let's do something we've never done before and so we did it I like that what did you say earlier uh you said that a developer's mindset has to be that you think when you build something on the first try that you'll actually do it is that right what did you say well I said curious what you think it was like the engineering mindset isn't just using a library the engineering mindset is understanding why the library was created I said something thought you were also saying uh you have to believe that you can like build it on the first try you know what I mean yeah I I have I called my toxic trait which is that no matter what it is I don't care if it's playing in the NBA becoming a professional soccer player or programming something I think I can do it I just think I can do anything and so like but to be a great engineer you have to have the fundamental belief that you can do something cuz you'll take every cliff and you'll try to jump it and most them you'll do it most time you'll be very successful yeah my wife always like you're so unapologetically confident you know like you got your head up your ass you think you can do anything but it's it's a like it a little bit cocky but also it's a good trait if you want to tackle stuff that seems hard wait I love this how do I uh hone this trait guys oh that's a good question what is your best advice you give to somebody to be able to have that I really want to do that like yeah I I think like the the thing you should tell yourself is like how hard can it be you know or what's the worst that can happen you know how hard can it really be what the worst that can happen is you you don't do it you know the worst that it's it's not very good but you'll probably have fun and learn some stuff along the way and then you just like the more stuff you build the more confidence you gain and and that type of thing you think ah I could probably figure out how to build a particle simulator I love that I love that so much the content as well what about U Prime yes how do i h that I pretty much have the same opinion as you the the general idea is that if you look over your past if you've been programming for longer than one year you can look behind and see several times in which you had no idea yeah and then you did it and you're like wow that wasn't that complicated like I thought it was crazy but actually no it's just a bunch of strings that's not that crazy that's every single problem literally every single problem just eventually breaks down to something super super it's all ifs fours and variable declarations like that's programming yeah Y and go-tos that's an if if's a jump with a it's just a named go to I think the other thing is if you do look at people who are like have done it you you go talk to somebody that works at Facebook and you realize like oh [ __ ] like you just went for that you know like you're not you're smart but like you're not some like genius like amazing like I probably could have done that too if I tried the same way that you did it exactly take is no one here is a genius most people aren't there's lot there are lots of very smart people that are miles ahead of me and they they create a lot of really cool stuff but most people in this room are are not that's actually encouraging distribution that's encouraging to hear because it's like you know I think there's like a mindset you can have of oh like they're just naturally smart and I'm not but it's like actually just work hard like you're saying have confidence you can build and and get better and better I like that good mindset for every one Ryan carniato there's like 10 of us to talk about what he's doing and like a thousand people who should just be building and making cool [ __ ] yeah love that they'll build it I'll use it so my little I I wrote I have one successful open source project and that one no no oh the is my most successful one and that one I probably wrote 17 different versions of how this idea should come about like okay I'm going to scrape your jump list and have the last X Files that you most like visited become this pinned list of files that you visit or I'm going to have an alternate file plus a second alternate file it's like impossible to manage work and so crie just builded all over himself yeah just move on I actually wasn't even going to mention it just keep moving but one of those things where like to solve a problem often you have to go fail like eight times because you don't actually know what the solution is but you know what the problem is and it's more important to be able to look and see a problem and know it needs to be solved than knowing what solution is the best yep love that beautiful yeah and if you saw it wrong 10 times that just means you're closer to the solution to most people you figured out all the wrong ways to do it like that's awesome now now you only have to find the right one Speaking of react that is actually one of my favorite parts of react though is the amount of effort that's been put into figuring out which Solutions doing don't work and why and like the whole Community moving forward as a result of it's been awesome like I one of my spicy takes is I don't think Tailwind would exist at the very least it wouldn't be adopted so heavily if it wasn't for react in the way that react works yeah yeah components in General yeah yeah and it's allowed us to on a more granular level be both right and wrong you can be wrong at so many different levels now full scope small scope component level application Level there's so many ways to be wrong now it's great so rewarding I love being wrong I don't get to be wrong anymore anywhere near as much at least and it sucks oh yeah I'm pretty wrong dude so yeah yeah it's good it's good life I still I still bat like a Major League Hall of Famer I'm at like 30% I I am not that I should not bet on the stock market I would fail so thing I been talking about for a bit and I like actually am getting closer to wanting to make it the idea of what if there was something I was saying what if it was like Wiki feet but for code which is a hilarious pitch what I actually mean is what if there was a website where you could like leave a review of somebody based on their GitHub code like the code that they've actually published and put out there I think it' be very funny to see how others review somebody's code like on a line by line level there's the AI one that just recently came out that tells you what kind of person you are what kind of developer if you make pretty code all this kind of stuff really is that the interviewer I would no no it's different it's a GitHub profile analyzer I would just like to let everybody know that the average person apparently on GitHub based on this AI is a 4.8 4.85 something like that out of five for writing secure code so it's a really good analyzer oh yeah great definitely wow yeah yeah everybody writes really secure code yeah but they told me I was like a UI engineer I did a lot of nextjs you're kidding I yeah I was just like man this Project's amazing it's going to take our Inc Is mindblowing On Any Given project on GitHub like if if it's not like the projects that you filter based on stars but just like anything that's on GitHub the average project on GitHub probably has more HTML and CSS than things that actually matter and as such it's probably going to be pretty secure like if I took a random project I just initialized it's an HTML file CSS file and no JavaScript that's very secure it's absolutely secure i' give that a five out of five I don't think it is probably has a lot of cross-site scripting attacks if it's just HTML and CSS NOS or any bount EMA me we'll to differ click Jack attempts and all these fake things if it's just an HTML CSS portfolio you made which is I'm saying the majority of repos which are some stupid [ __ ] that somebody just threw together with like an HTML file oh yeah yeah I think that's such a bold statistical statement that it's not true I I the majority the majority of repos are just CSS no the majority of repos on GitHub are portfolio for people absolutely way absolutely no chance I I'll find a way to figure this out I know I'm no chance let's go but like that's what I remember like years ago Google had Google code search had the ability to get stats on stuff and like the GitHub search is really good but I wish that there was a way to get like analytics on your query you know I'm going to bug V douy after this CU I'm going to prove this with numbers I okay does following a tutorial count on one side or the other how about this one what percentage of code on on GitHub do you think is typescript or JavaScript very small percentage like what percent do you think is HML or css oh no I this isn't about the number of lines of code or the number of files the number of repos on GitHub that are exclusively CSS or bet it's 12 plus CS 12% JavaScript CS the majority of repos on GitHub are majority HTML CSS I think we don't realize that the majority of repos don't even have to do with the web is my guess you think so wait what are they no that's just wrong that's you're think the majority if we filter out all repos coding isn't on the web okay if the majority of rep is things above 10 Stars everything you're saying is true but the average GitHub user somebody who just wanted to learn how to code and is following along some random tutorial yeah they usually would be doing like Hardware if they're interested in Hardware there's like a [ __ ] ton so I have I have a little um Bluetooth uh label printer and I went into I was like I want to hack this thing so I found the chipset inside of it and I first thing I do is I go to you get the like uh chip ID and you go to get up search put the ID in I found like 50 Chinese repos that like there's a whole world of like Hardware hackers on GI up I've never known Hardware Hardware is such a huge field yeah my general hypothesis is that Hardware is is slightly larger than web development it just doesn't pay it just doesn't pay nearly as well plus the the number I I would make the venture to say that the number one person on uh that's programming right now with a half year to two years of experience is probably game developers you think so yeah yeah it's cuz all the kids growing up want to learn how to build games how many of them are open sourcing their work though people are using get up Dem man things because it'd be crazy not to use some sort of PR are free now yeah so they're still going to have repos on GitHub so are we counting private repos in GH repos too when I say this well you yeah you said you said repos on GitHub I I'll add the aster of public repos on github.com I still don't think the majority are even web I I feel like I don't know maybe theb but I feel like it has right I feel like it's not HML CSS I think you how many tools for the command line do you think there are out there that are way less than people who wanted to learn how to code made a shitty portfolio and then gave up that's that's the thing it's like like if we're talking like like there's a level of filter IE once you go from I want to be a Dev to I am a Dev once you're in that I am a Dev area you're entirely correct but I'm not talking about people who are devs I'm talking about people who use GitHub which is 95% people who want to be devs 5% people who devs and then in that 5% 1% of such Anan stat because how why would someone just do HTML and then go and learn git and manage it via G because the following along tutorials like how to make a portfolio or how to get started with code and like the GitHub step will be in the tutorial zoom in zoom in wrong I am so excited to see numbers for this so is a thing where I think right is the thing where I'm like 99% stock overflow I think that overlow do you think look at coding or do you think it's more web heavy it's very web heavy okay cuz if you look at the St overflow stats it's overwhelmingly web why you don't think that's an accurate representation of the world yes but it's not overwhelmingly just HML and CSS either so his original was just I thinko is majority of those things only we could tell I'm look at okay I'm I have to know this now like I'm so curious chat type one in the chat if you think it's majority HTML CSS type two in the chat if you don't think it's majority HTML and CSS I need to see the chat for Public public was one agree or disagree it looks pretty even split honestly uh that's a lot of lot of now at first it was even split though what was two again two was it's not alternative framing do you think the majority of GitHub repos will do A and B so it doesn't mix up with one tw a if you think the majority of GitHub repos are minimal people trying out something for the first time that are mostly HTML CSS and JS probably even leaning HTM CSS or do you think the average repo on GitHub is more likely to be something that isn't that b for that if it's less likely a for that if you think probably mostly web stuff well it wasn't mostly web stuff you just changed it on that mostly early start stage web stuff that's like not saying B lots of both lots of I some C's in there to run these numbers I am positive I'm right about this you guys do not know how many noobs spin up a GitHub make one repo that is useless and then stop using GitHub that is the majority of repos that are public I don't know how many repos do you have that are public yeah how many repos do you think everybody in this room has not enough to account for the difference for the number of noobs 57,000 yeah I'd say probably within this one is probably well above forks no cool because if we're counting Forks I'm [ __ ] I lose yeah I'm at I'm at least at 500 personal repos at this point have like two 300 yes but for most of mine what is actually the reason I thought was is when I initialize something with like create react app or even with like next I'm always see wow most of like the the little GitHub tracker thing where it shows you the file like the language split is JS for a config file and CSS for CSS purposes what dat does data Stacks have a booth I wear the middle yeah this is like the worst possible place to ask data sack was a sponsor but I don't know where they're at yeah I'm sorry you're ask in the worst possible place imagine looking at a car be like this is where I should go to ask for advice of where things are yeah that's great it says right actually is a pretty good a sponsor so it's I don't think she knew we were it seems like it no it looks like a desk where just a bunch of idiots are arguing about GitHub rep with microphones and she like they're not doing anything this is honestly not that important what's it called uh it doesn't even have H to build a project that tracks this and sees what language being used the most which is a kind of a unique one but as far as things go I mean that's not surprising it like most oh this is for PRS though oh well PRS excuse it wait spicy your one do you think the average repo has or has not ever made a PR or had a PR oh what do we got here most popular languages is this on GitHub yeah most popular languag is not looking good in the old web Department oh for sure JavaScript 28% 2018 20 oh javascript's going down why typescript is going typescript yeah typescript going out oh it's it's not oh yeah okay they should put those together though so December 2021 JavaScript and typescript are 22% and that's not majority's 51 yeah it's 50.01 whatever Python's way higher than I would you might be able to a plurality but on a majority that's actually that's way higher than I would have thought for the other languages I would assume C++ is Dam May the world doesn't revolve around the browser you'd be shocked at how many people don't program the web yeah the web is disproportionately obvious because it's the world you work in yeah interesting yeah that could be that could be a bias cuz I respond to people who work on the web I interact with people who are on the web you create an ecosystem also how much that python is a web backend are you would you consider a lot of ml I'm sorry but but JavaScript being 18% and go being 9% suggests this is [ __ ] go is popular go is not half as popular as JavaScript these numbers are made up I think it's just surveying the the GitHub language thing I I want to know more about how they got these numbers I that just is not believable I know it's shocking but there is a lot of other code being written not like not in go there's a lot of code being written in go but not that many repos being start started with go right now that's just that that's to me patently like the problem is is you're making something up and you believe you're drinking your own Kool-Aid and saying this tastes delicious like I don't know how many repas are being started with go I'm not making any assertion my only you honestly think there are half as many projects being started on GitHub with go than with JavaScript that's line count so I can't tell you how many things oh is this line count oh the go is going to obviously win you import all of the [ __ ] modules as like code in the code base that's like absolutely the case okay that makes what's that one I don't know what I'm looking at help me man you guys got don't call a comeback why Java still the champ damn Java coming out there as a champ I don't what is this thing that's from I know but what is ites yeah I I have ways to get this info the question I was trying to ask is do you think the average repo has multiple branches or one branch I have no idea I would be very surprised median yeah yeah average and median are very very different Medi I would say the majority of GitHub repos have one world repos that's what I've been saying the whole time I think more repos than any of us want to give credit are a hello world repo of some form something like that one branch in hello world are orthogonal you cannot say they're the same like you you literally cannot say they're the same I just got done launching a coffeee company with a singular Branch so I with three with four separate working on it one branch one developer well I mean yeah I would agree that one branch one developer would be the majority but that has no indication into what it is yeah well yeah like we need like stats on over over six months if there's been 20 commits you know like if it's actually something someone's working on but in chat saying Theo is coping I I will take the biggest l in the history of JavaScript Twitter if I actually am wrong on this one but I'm going to put the time in some point next week to figure this out because I am that confident right on this one all right well you guys underestimate we got we got get somebody from GitHub to run the stats for us I'm very interest I'm going to bug b douy after this like for sure I'm so curious I just I thought this was just understood I'm actually surprised people don't agree with me on this wouldn't like built have stats well the hard part is that you're also the dis genuine of only use an open one is how many developers just don't do things on GitHub yeah yeah that's true like there is an enormous amount of people that only work on private repos on GitHub or gitlab or stash so my thing is like what we're talking about here is the 95% of devs that don't necessarily make it down to like doing programming for a living if we just filter it out of like have you ever been paid to code I am fully in agreement with you I know but 95% of devs is a crazy number to say only 5% of devs programm 95% of people so out of the 100% of people who have a GitHub I would honestly believe only 5% have ever been paid to code I think the vast minority people have you know you can like look at the free Camp Stars and just subtract that cuz like that's where a lot of those are coming from I 5% I had a GI for few years before I wrote code you are super unique I wrote code for a decade before I had a haveing z after you started coding fdp in right into the box I I think this might be the Gap actually the age Gap honestly now I think about it are we the old guys you you learn to program in a different era I think people Le was invented before I went to college but GitHub wasn't a standard until after you had a job yeah that's the difference here that's fine but still you're still making the Assumption which I don't think is correct that like the fundamental assumption especially the 95% of all people on GitHub only 5% counts on GitHub most of them are inactive okay well then inactive ones that you can't tell if they are or not getting paid now now you're just making a because I have like what six inactive accounts on GitHub those inactive ones are definitely getting paid the point I think netflix.com are massively underestimating the number of people who try to learn to code get far enough to have a GitHub and then give up for any of many reasons I think my general assertion is that all statistics are made up so I'm just saying I'm just simply saying I don't believe you that's it I'm not saying what it is I just don't believe it confidence in your numbers but I would love to see the the actual numbers I guess we're going to find out we have a lot of work to do I'm going to I'm committed write stupid [ __ ] figure out some stupid [ __ ] somebody at Google has like a big query of all of GitHub and they can run these these queries there someone laughing right now I already know I already have stash hacked Gan who made XY back door probably already has this information he's laughing Gan give me the information Gan oh man good [ __ ] who are our other guests I want to make sure that we can wrap up it's 520 we probably need to wrap up because we are past they're breaking down the events so we should probably I know we need to grab David so we'll do that yeah thank you so much for coming by appreciate you a ton West where can people find you SX FM best place yeah next West boss online in the internet me and West boss cured our relationship last night it was it was beautiful beautiful start spitting everywhere beautiful yeah I'll thank you so much tap David for us thank you no I think David's a good wrap up talking about solid to wrap up the react comp we'll probably have to make it pretty quick though yes I guaranteeing you they want this they want us out all right we'll be quick they want us out about 20 minutes ago yes howdy hey how's it going do you want to uh like introduce yourself sure I 19 um 18 19 .8 million public repos 3 something million no 9.8 rjs 3.1 RC Plus+ is what that says are we live right now yes we're live we're sorry we just got in a long argument I think actually we'll start with this first we'll introduce you for those who don't know this is David he's really involved with solid JS he's the number two guy next to Ryan who's running the community running a lot of the coms and everything even had the sticker on his badge he the one making so we can actually adopt solid in most ways fantastic work so and the originator of solid Primitives oh no [ __ ] that's awesome what solid Primitives oh nice it's like our W react hooks Library other people create State sorry is it create is it the create state is that how you call that what's the what's the create signal sign create signal sorry that's po so that's core you know the like like there's all of the libraries that are like common hooks for people like like like react hooks the package that has a bunch of them he's building the equivalent to that for solid is that correct V it's like what we built is very similar to V actually got us almost as many downloads as damn that's really interesting because that's actually a huge difference from how the react ecosystem Works where like it it's almost like react intentionally is missing a bunch of parts and expects the community to fill all of those holes and the result is every react code base fills those holes in entirely different ways it sounds like that's not actually the case in solid they're all adopting like similar stuff yeah pretty much that's really interesting yeah are do you think people are happier or less happier with that overall I'm very curious um Closer Closer oh gosh um I I'm not sure actually it's a good question to pose to to the to the community I I would suppose happier though yeah it seems like there there a lot of people who are just burnt out on the decision fatigue is that like part of the goal with solid and how it's designed these ways you're asking the hard hitting questions today um I'm echoing again are you kidding [ __ ] Christ do you want to use my mic here no it's fine cool we just we're good anyways you want to rephrase the question for me sure uh how much do you feel I I'll change it actually a bit uh how many of like the solid users you find yourself work like talking with regularly do you find are like there because they're burnt out on react actually you know what I'm going to backtrack on that um probably in the past year or so I'd say that it's not really fatigue that drives them it's more curiosity about like solid is this similar but dissimilar thing and it's more curiosity that drives them over I I don't think we we don't really hear them coming over and saying I'm completely fed up with react this is like Troublesome to me a lot of people will complain about rsc's and what's happening in the ecosystem but um I they just don't come into like our Discord and start ranting and raving about this it's more about like this is a different flavor of of uh jsx what can I do with this how is it different and they they're interested in experiencing it the funny part though is once they get into it they expect it to work like react and then actually complain because it's like why isn't this working why isn't re rendering the component we literally have like an FAQ section that we're building that answers all the same questions over and over again most people don't realize that like you have to change your perspective you have to change your mental model and expect that it is different you know we've had this conversation internally like is jsx really helping solid at the end Ryan will say yes absolutely but you know people come in use jsx and they expect it to work the same way as we act would it make more sense to have a DSL that doesn't create that expectation so like these are some of the questions I've asked internally and Ryan will obviously defend it endlessly because you get the value of the ecosystem you get all the tooling that comes along with it so we're sticking with the jsx part of it but yeah you got to kind of reframe your mind and like rejig your brain to understand that this is a A fine grain reactive uh utility it's not it's not react very interesting I hav thought of the jsx decision is like a how like obviously I got into solid because I had tried spelt I tried other Solutions and I missed jsx a lot and when solid came out and it was the fastest and it was jsx and it looked kind of like the react I was writing every day I got really excited and that like uh how do I put this it it's why I tried solid out and I ended up liking it I also ran into all the same booking you're discussing where like I expected it to work like Rea and it wasn't it's not react but I found those to to be also Pleasant in a lot of ways like the power of like the the that blew my mind with solid is uh for those who aren't as familiar with solid in its syntax they have a create signal that works a lot like use State and react the difference is you can take a create signal call for like a counter that's in your component and just move it out of the component and now it's a shared thing across all of your components because the state management is what calls the components rather than the other way around is it still on oh thank you the Constructor function versus render function got me the first time I use solid that's pretty the classic one gets a lot of people um other things are like create resource a lot of people you know expect things out of it or the API is kind of weird and different than from something that they've seen in the past so like learning it can be a little cumbersome you know these are all things that we're well aware of we hear this in our Discord all the time Ryan is listening to this like some of the recent changes with solid start and bringing like create async new cash primitive all these things are designed to kind of uh I guess overlay on top of it and make it a lot more accessible yeah I found it you know I love this so you're doing great I I find this stuff so interesting I hadn't thought of this in the frame of like does jsx imply to a developer that this should work like react CU that's a way I had thought of it before like I think of jsx almost like a technical impementation detail where like Astro uses jsx now for its syntax under the hood it was a big shift for them to do that but it doesn't feel like react when you're writing Astro it feels very different and it's interesting to think like due to how solid is like like how you compose a solid component it feels enough like react that it makes those differences even more jarring yeah it's uh the drawing aspect is part of the fatigue uh aspect of it so you know like you you really have to come in prepared and ready to expect something different um you know it's funny how react has really morphed our brains to have expectations I call it react totis not meant in a derogatory way but you know it is uh oh God not an Affliction but it is a state of mind and for uh you know a lot of um a lot of reasons it's a posit thing because you know you think a particular direction um I'm actually thinking of writing an article about this um and correlating it to uh this is going to sound really strange and I'm trying to find a way to I've been bouncing uh this Theory off with a couple of people recently but um you know I it reminds me of like the this is really nerdy the Prussian um education system versus like montau education system the Prussian education system was about basically pumping out soldiers pumping out people that all had a base level of educ education um and monor was more about that more private more personal education and I'm trying to find a way to like compare that with react and other libraries like react is trying to teach a way of thinking a way of being a base level of education so that you can be productive right away to a larger system that's the corporations and I feel like a lot of the other Frameworks are imposing more of like a private monory education system where you have to do a lot more work to learn that um but you you're not abiding by a similar kind of system so but if someone were to learn solid first they would have the identical mirrored attacks attempting to use react is it really just I mean to me the problem at least for me was that the API a component is a capital lettered function is kind of like our convention uh right there along with returning jsx MH like that is the if you will the API or the language to describe what I'm doing is identical mhm and so I can't tell like I can't look at it and tell the difference like if I'm using a string and C versus JavaScript there's a big big difference and so you come in with fundamentally different expectations but this one's identical with two separate behaviors yeah so is it really just like what you learned first is going to be what you bring into it past past experiences dictate how you how you learn yeah yeah if you were first people would be saying the same thing to react why is this rendering a bunch what is going on here you're yeah but there there's also like there's a whole bunch like we can go into this pretty deep but like I I feel like with solid you it is actually just JavaScript I know that react uses that a lot and it it is Javascript with a lot of rules on top of it cre effect is not JavaScript signals are not part of JavaScript we we we have some uh compiler magic yes um but I'd say it's a lot less rule oriented and what I'm getting at is maybe you're learning more JavaScript actually when you're using something like solid as opposed to react where you're using you're learning more rules right so it's more of a you're learning a state of being as opposed to an actual language that's not a correct way of phrasing it but I think I mostly agree with that I I didn't agree with the original framing though CU like I actually think that Frameworks especially something like view does a much more much more of the like teaching everyone to think and work this exact same way versus react which is like you need to know and agree on this core set of things everything else is up to you so if we were to do the education comparison it's like in react there are these like three core like courses that you're expected to learn and then everything else is elective go do whatever the hell you want with it but something like view is here are the seven courses that you need to do to do anything with this language yeah what are your favorite what's your favorite thing about solid Madison probably never used it I only recently like looked into it I don't know about it stoping your face they can't hear you madis I've only stop I I think both of them are at their limit for stream I know that neither of them normally do these seven hour things like I do so this might be a good time to start wrapping up yeah yeah anyways I do I do like that idea but uh I I don't the only thing I will say for solid is a little bit different is that for every kind of signal that you create it's a point of change within your application M and that can be passed anywhere which kind of is very JavaScript kind of feeling yeah right can you can you explain that more like typically whenever you're using react you have your set and you have your value that you have you have your set and your Gap and those typically remain within the component it'd be really strange to pass those around right like you define your use like you call I say you call signals outside of component too you put them wherever you want sign solid store is really control the components it control yourself you can put it in the component it can be outside it's a bit more we're both having you can just put it in like the HTML or like without being inside of anything oh okay so the benefit is just like more flexibility from where points of change yeah it's and the the bental train to push is like with react you think in terms of your component so you have like your app component that mounts your top nav and your body component that mounts all these other things throughout with solid you have your template that is all of the content that gets rendered but you also have your state which is its own separate data thing that you can map to the components by calling instead so it's said like like in react when you have like the count comma set count equals U state zero count is a Val like a variable that you just use in console log there with solid since everything can exist externally it doesn't know that that value is dynamic or not so instead you have to call it as a function so you wouldn't just say count you would do count parentheses to to call it and when you call it it's now built the relationship between where you called it and the data itself I will say one thing that's unique about solid is that or one thing I really like about solid is that react in some sense makes people think about the data they're grabbing as a tree or you're not necessarily Bound by that same thing you can have different ways in which you approach an application that just makes it simpler yeah but conversely uh you have to follow the reactivity like you have to make sure that you're wiring things very very specifically and that is an advantage but also a disadvantage it adds complexity but um it gives you more power the the component model like both of these are hierarchies of how your application works react the component hierarchy is the single source of Truth for how your entire application function and your data graph flows through that in solid the data graph is the thing that commands your entire application and UI gets attached to that I think the the thing here that's important is that UI hierarchies are really easy for us to understand because they work roughly like HTML and they are very visual because we see them and we can understand them that way whereas even just noticing that there's a data graph much less visualizing it much less explaining it and mapping and doing all these things it's more difficult to show that than it is to show component hierarchies I I will say like uh um react react is fantastic like I not met somebody deep in the solid ecosystem that's like a contributor to solid that isn't relatively into react we're all into react like there's H and especially Ryan you know this he's really really passionate about react we really passionate about the whole uh the whole ecosystem the the reality is like react serves a very specific purpose it's meant to be productive in large uh large teams large scale environments it's easy for beginners to pick up and learn these rules well easy um it puts them on Rails um Frameworks uh fine green reactive Frameworks like solid are a bit harder to get into uh like the learning curve is a lot higher um but I I feel like it scales easily like once you learn it you can actually build really large applications very similarly with with react I feel like it's easy to pick up and then gets way harder afterwards so it's kind of the inverse uh I I want to see more big solid apps because I found like there's a lot of parts that come to an application getting big it's not just like a lot of code that we have to deal with it's also the quality of the average contributor I should say quality the the knowledge of the average contributor goes down as the project gets bigger because there's more people contributing the likelihood that they know the things you're using much less where they are in the code base is much lower so while I have seen a couple pretty big solid code bases there had been no new contributors to them for like four to five years whereas with the average react code especially at a big company a lot of people learned react by contributing to one of those big code bases and that's a thing I think we haven't seen enough of in solid to know for sure my favorite like like thing that I rant about all the time is the idea of like the average react developer where the average react dev has probably never initialized a react project they probably picked up react because it was in a codebase at their company that they just started using and it was point they did not choose react the average person writing react code did not pick to use react it was kind of forced upon them some way whereas with solid the average solid Dev absolutely pick solid they want to work on solid if they're using it at their company either they were the one who brought it to their company or they picked to work at the company so they could use solid yeah no I I think you you nailed that part of it you know like it's very interesting to see to see what's going to happen the next couple of years like our community is growing there's you know so many opportunities to actually learn new things like have you guys ever seen a large solid code base yet I have what's the largest you've seen I got a decent bit of a tour on the post news site okay that's yeah that's a pretty decent sized one so I've now helped on and or constructed about four reasonably sized packages or apps with maybe about 20 30 row or one had 50 and so how many contributors on the biggest one was about four good reason re reasonably SI I I learned to react on a code base that had 800 contributors you've seen some pretty scale like well scaled code um probably seen some crazy stuff at uh Netflix as well one of the craziest react code bases in the world I if I worked at Netflix I would probably hate react yeah remember the television doesn't have a concept of focus yeah so Focus runs through react you know what's funny right now Ryan's actually doing a stream with the guys from lightning JS um so it's a framework that uses solid's Universal renderer to actually Create TV applications it's very hard if you only have left right up down and back which is like or enter which is your only guaranteed five buttons at one point in time yeah how you think about an application changes yeah no it's it's completely different ball game it's uh very interesting excited for react native saw all this for us half a joke it's they they're doing really cool stuff with react native but I yeah building TV apps is hard for reasons other than the framework you chose yeah yeah that's thank you for this we appreciate getting to bring in our favorite framework right before the end of the conference about our other favorite framework sorry Library solid way to end I'd say a really good is solid a library or a framework oh no don't ask me this question he said Rea he said fine grain reative framework earlier framework confirmed okay we'll go with that cool perfect hopefully we don't annoy Ryan too much uh he's yeah he'll be Fine's tting right now oh no no he's streaming shambles right now no he's in a six- hour stream he's not going to see this until later perfect well I'm excited to see that stream too oh we want to thank clerk so much we really appreciate you guys my job oh sorry yeah thank you so much David now we can do our outro of course what are your last here you can hold this I have this cool thank you again so this was awesome I'm pumped that we actually got to do this sorry it was a bit chaotic sorry about all the audio stuff sorry everybody but me is wrong about GitHub repos thank you again to clerk for sponsoring this and making it possible getting us all here helping us out being the best way to do off like I know they're a sponsor I know I'm going to get accused of paid shelling but I do use clerk for every single project that I have off for basically since it came since I started using it over two years ago now it has like measurably made my life better it is the best way to do off and full stack stuff I can't recommend highly enough even if they pay me to put their logo in the corner when I talk about them they've never once told me to say a specific thing in fact I regularly disagree with them but it's a cool product you should try it if you haven't love it last words um yeah I mean this is so much fun I've learned a ton from you guys this is fun and thank you so much audience for watching appreciate it did you know that at some point in your life you quit playing tag with your friends and one of you are still it for the rest of your life you're it I'm not playing tag think about that people walking around right now in this room probably that are currently it can you end the game when you're it I just lost the game I'm going to be up all night I know is that just wild you don't know in the last game I thought this was going to be the whole like there's one like there's a last day if you hang out with your friends in elementary school outside and like you never know when it is but you don't realize till after I thought it was going to be one of those things some weird existential [ __ ] I hate you should we play tag tonight no nope not at all this is a good ending Mark can you hit that end button for us and we going be done goodbye y'all thanks again I should raate somebody but I'm la ## Prisma is removing Rust_ - 20241215 remember Prisma the omm that I was really hyped with when I started my channel the core of the T3 stack the first really good typescript experience for databases I haven't talked about it much recently and there's a reason I moved to drizzle almost all of the apps I've been building have been using drizzle but there are things I've missed about Prisma the one I have missed the least is the performance which is why the title of this video might be confusing to you because you would think well if you want it to perform as well as possible you should absolutely be using rust which is why you might be confused about the moving from rust to typescript but there are very good reasons and you might be surprised by them the Prisma omm Manifesto is a very interesting document that spells out an actually pretty exciting future for Prisma that makes it a much easier recommendation for me and not just because I don't like rust but because rust was probably the wrong choice from the start and they are more than willing to admit it now we're going to go really deep on all of this in just a moment but first let's hear from today's sponsor single store the last database you'll ever need and I mean it these guys are cool they are a combination of SQL Json Transformations your crazy analytics and Vector stuff it's nuts how much you can do here all with a single SQL API I could give you all the marketing mumbo jumbo but honestly I'd rather let the customers speak for themselves I have a lot of respect for Jack Ellis and I was blown away when I heard that he was not only using single store but it moved all of the databases for fathom analytics over to it as he said they're now all in on single store Helios they've been able to remove reddis Dynamo and MySQL saving them a fortune while also improving performance if you're worried about pricing don't be it's free tier is crazy you can probably get away with it most of the time and if you can't their pricing is not particularly egregious and if you're on different weird clouds you have plenty of options here but it's also free to self host with Docker so if you want to host for yourself you can do that for the rest of your life and never have to worry about a thing but obviously they're hosting it really well for you having them manage it makes life easier it's what I would personally choose they did ask me to cover one thing and this is one of my favorite details I've said for a while that you could basically make work anywhere by just storing Json in your database they proved it they made an API that's a 100 times faster for operations you don't have to change any of your code or any of your queries you just hit their compatible API directly it's a oneline drop in replacement and you're good to go so if you're stuck on and you want a database that a little less painful here you go singl store is pretty dope I hope you like them too check them out today at soy. l/ singl store let's dive in the omm manifesto Clarity and collaboration this Manifesto outlines prisma's vision for the future addressing key challenges setting clear priorities and empowering collaboration to build a better experience for our community refocusing for the Future prismas come a long way and we're proud of what we've achieved together from accelerate to pulse to type SQL and Prisma postgress the tools we've built have grown alongside an incredible community of devs who rely on Prisma every day but the scope of Prisma omm has expanded we Face challenges in governance issue management and communication priorities haven't always been clear deadlines haven't been consistently met and over time we've accumulated over 3,000 open issues and a backlog of preview features that stretch years back I think an important piece of context here is the history of Prisma it originally started with a thing hopefully none of you guys have heard about but for the few that have I'm sorry graph cool graph cool was an attempt at making your database in graphql API this was during the peak of graphql hype and the goal was to make something as nice and easy as graphql work for your database which never works this meme seems to age better every day don't make me to the sign graphql goes between the server and the user not between the database and the server stop doing this thankfully unlike many of the others who had this problem Prisma realized it a major realization we had was that a lot of value we provided with graphcool didn't necessarily lie in the quick provision of a graphql server but rather in the fact that developers didn't need to manage their database workflows explicitly pivoting to Prisma the realizations led us to a pivot which ultimately manifested in the rewrite to Prisma with Prisma we found the right level of abstraction that ensures devs keep full control and flexibility this all sounds great and kind and awesome right the thing many didn't know is at the time when Prisma came out it was still using a lot of graph cool under the hood so it would spin up a rust server that let you access the database via graphql and then their typescript code would call that rust code via graphql in order to get data out of your database which was chaos they moved off of that thankfully but the tech debt Left Behind was chaotic and a lot of that abstraction was built because of the focus on this graphql API and rather than throw away all that work they built a better tool for typescript devs on top of it but they were stuck maintaining that pile of rust which had a lot of problems be it the tech Deb and Chaos of the Legacy code be it how much harder it was to make plugins and all these other things it makes sense that that part is in a rough spot which I'm sure we'll get to as we go throughout this as Prisma says here we want to do better so here's what we're changing this Manifesto is a declaration of what we're going to do differently how we'll set clear priorities manage our work more effectively and involve you our community every step of the way if you feel something important isn't represented here open a discussion we're listening for what it's worth I've always been surprised at how down the Prisma team was to hear me out even when I was being nasty for full transparency's sake despite the fact that I haven't used Prisma for a new project for like over a year now they're still going to be sponsoring some videos in the near future because they're working on cool stuff and still want to work with me despite the the fact that I'm more than willing to critique them so account for the bias that they have written us a check and there will be Prisma stuff and sponsored content going forward like you'll have some ads from them in the near future about some of the cool things they're doing their willingness to continue talking to collaborating with and answering things from people who many would ignore I've had a lot of Brands very quickly autofilter everything I say and I can't honestly blame them I'm a bit of a stirer but Prisma cares enough about doing the right thing that they are more than willing to look past that to try and make the product better to be clear I'm not saying you should go show up in their GitHub discussions and be an I'm saying they care so much about making Prisma good that I trust them when they say this for what it is worth anyways where we stand today Prisma Powers 547 th000 repos on GitHub it serves over 400,000 monthly active devs and delivers upwards of 9 million monthly npm downloads over over the years we've achieved a lot 200 releases 5,500 poll requests merged and over 7,500 issues closed these are all great numbers but as they say here there's more they need to do to ensure the community feels valued and supported with so many devs and organizations depending on Prisma it's important that development happens in close collaboration with the community and that the Prisma team work according to a clear and well- defined set of principles so here's how they are changing this first part is a big deal they're defining first first class databases historically they've been a little bit too willing to add support for new things and I have heard from people there and people externally horror stories about implementing certain squel like databases that didn't actually follow the rules they're no longer going to let themselves be slowed down maintaining all of those things they have set this set of databases as their first class databases the biggest surprise here for me by far is according to the people I've talked to at prison was surprisingly easy to implement and support compared to some of those other sequel like but not properly SQL databases that said I didn't expect them to go all in on it and call it one of their first class DBS Maria DB makes more sense because I'm sure the people using it as some of their highest paying customers and it's very similar to my SQL so I'm not surprised to see that obviously not surprise for sqlite but being here was interesting in their most recent blog post which was literally a few days before November 27th they introduced two new databases D1 and turo they're both based on sqlite but they are new databases they are different things that require their own support so my understanding is these have been relegated to community support if I'm wrong about that there will be a pinned comment correcting me but that is my current understanding yeah so what does it mean to have first class databases what's the benefit here the key thing is prioritization these will be the focus for bug fixes performance wins all of that they won't be slowed down as a result Innovation future product development will be designed with these databases in mind ensuring seamless integration and compatibility so if there's new features there was a long time where new features would happen it only support one of the databases or three of them and not two of them and it was a mess that's going to be a lot less of a problem now that they've picked their set of DBS they're supporting and for databases outside of the group they provide clear points of extension to enable the community to meet their own needs developers can extend Prisma capabilities by creating custom databases adapters adding support for additional databases guidance on building and using these adapters is available in our documentation all sounds great there is a catch here but they address it in a bit to give a hint I'm sure you guys can imagine that the users of something like turo and D1 are not big rust devs so if they needed to make this database plugin work in Rust it's probably not going to happen see where we're going here anyways they also and like you got to make your money if you're one of the companies using a database that isn't supported in this set they will work with you if you pay for an Enterprise support plan which honestly if you are big enough that you don't want to move your database and you're on some weird database I'm okay with you having to pay for that I think that's fair by focusing on the core set of DBS we want to ensure the highest quality and reliability for the tools you depend on while also empowering your community to expand prisma's reach as usage in demand change will reevaluate our first class databases to ensure they continue to reflect the needs of our community customers and part Partners awesome so yeah if some new database becomes huge they might change their mind cool personally if you're making a new database I think you should be focused on building a really good typescript orm yourselves something like eddb for example they are rethinking how to work with a relational DB where they're going more relational instead of less most nosql databases have less relational behaviors they have way more and technically they're built on top of postgress they also provide their own SDK and om including their own schema and their own schema definitions their own CLI their own migrations their own everything and I would be surprised if a new database got meaningful Traction in these spaces especially in the typescript world if they didn't do this themselves which gives less incentive for this to be prisma's problem just speaking realistically point two clearer issue management community prioritization and engagement this is an important call out it's not as relevant to the point of this video which is the Rust part but they called out that they've not been good at managing their issues it's nice to see open source projects do this there's a lot of Open Source projects where the state of issues is horrifying for example flutter there are 12928 open issues on flutter and they recently purged it for a while it was the repo with the most open issues on all of GitHub so they're not that bad they are close enough that it's scary but at least they're not here acknowledging it and putting effort into fixing it publicly is huge I can't remember last time I saw a company come out and say we did not manage our issues well enough and we're going to fix it it's cool to see a well organized set of issues helps us focus on what's most important and impactful we deeply value the time and effort you've put into raising And discussing issues is what drives Prisma forward to ensure Clarity and sustainability we're committed to organizing our backlog closing out data issues and using automation to scale our ability to engage with you so they're going to start reviewing organiz and closing issues over the next few weeks awesome fiding timelines labels and priorities I'm curious how much progress they've made so far because this came out a few days ago they're still at 3,002 hopefully they're closing a much faster [Music] now doesn't necessarily look like it yet at least I'm hopeful I think they'll get there but it's going to be a an uphill battle they also want the community to do things like upvote and comment so they can prioritize better as well as a partnership with dosu maintaining code should be easier than writing it it's a startup that helps you triage your issues that's actually pretty cool I can see this being very very useful next piece is the predictable preview feature life cycle these are again things that are nice to see done so transparently they're cleaning up the process of things going from an early feature to a generally available feature right now there's a ton of things that just sit indefinitely in preview they're finally fixing that awesome but the piece you're here for the Rust part point four enabling Community extensions and collaboration Prisma architecture has historically limited Community contributions as well as the places you can deploy it as well as the performance you can expect from it as well as the reliability there's a lot of things the architecture was causing problems with and they are very willing to re architect I've seen this from them before but this is a bold move core functionality such as query parsing validation and execution has been managed by a rust engine which has been opaque to our typescript Focus Community expanding capabilities or fixing core issues has often fell solely onto their team we've addressed this by migrating prisma's core logic from rust to typescript and redesigning the orm to make customization and extension easier they finally did it they rewrote Prisma at its core and threw out the rust engine whose days started back in graph cool finally they don't have performance numbers here yet they don't have the things you probably want to see and I'm sorry I can't tell you how much faster or slower the typescript engine is yet I'm sure this will come up in future videos once they're further along with this work but considering how much faster drizzle is in my experience than Prisma I would not be surprised if this comes with the performance win this is something that Ryan carniato says a lot Ryan's the creator of solid JS which is the fastest JS framework and he says that benchmarks comparing a rewrite are often meaningless because the second time you do something you know so much more about it and you make many fewer mistakes even if you work in a slower language the result is going to be faster just because you are better at doing it and you know more so my suspicion is even though the language they picked is slower the thing that is slow in your database connection isn't the language you wrote it in it's the io and the management of these complex queries none of that is going to be bound on the power of a single CPU thread there's a lot of opportunity here for better architecture to result in huge performance wins so I would be surprised if this ends up being slower I wouldn't be surpris at all if it ends up being meaningfully faster it would be pretty cool if it ends up being comparable to drizzle and other faster ORS I think they have a good chance of getting there so what does this mean for Prisma it means the core will now be in typescript which is more accessible and open for typescript developers it means that extensibility will now be in the design where previously that weird way of exposing the API and the Rust part was super opaque and they even had to work around it now everything is built with the focus on extensibility and plug-in design which is huge and collaborative growth an approachable codebase empowers the community to address issues and add capabilities directly yes I have looked at the Prisma code base and immediately walked out cuz it was is terrifying and I'm very excited to see how much more approachable this could be it's important to make sure the solutions you're building that are open source are accessible to the people who are using them in a way that they can understand the code make changes and push forward I'm concerned that this might end up being the same thing that happens with stuff like turbo pack RS pack Etc because we as web devs want these tools because they're really fast for our webd work but we as web devs won't contribute to them because they're in languages we don't understand there are very few devs that understand rust deeply enough and compilers deeply enough that also care about typescript in webdev enough to build something for web devs in Rust most of the people who know compilers in Rust really well spend more of their time on typescript than they do compiling it I'm scared there will be a similar problem there where devs don't have interest in contributing to those tools because they're in the language that they're not using that's what happened with Prisma it's really really key that they caught on to this and they're making this change and as awesome and exciting as it is I'm scared it might be the writing on the wall this is going to happen to the other rust rewrites of tools that we're so hyped about right now I this is one of those takes where I hope I am super wrong to be clear I'm not saying this because I want to say rust I'm saying this because I'm scared and I hope this isn't the case that said Prisma is absolutely doing the right thing here and and I'm genuinely really excited about it one quick aside on that point by the way Nan who's the creator of stylex one of the like industry experts in compiling your typescript because he found a way to get Styles out of it as a CSS file lunatic called out that this point is so much more important than people realize that being the contribution aspect being able to contribute to these things is super super important in these rust rewrites are not considered enough of the risk there I have a video coming out soon probably not out yet keep an eye out for it the premise is is why JS rewrites in Faster languages might not make a lot of sense it's focused on the same Core theme JavaScript is in my opinion A working class language is very forgiving of types also they're not a typescript fan which I know makes it hard to trust them it's easy to pick up and supported by browsers is a huge pool of people who are conversent with it for years we've had both Library authors and consumers in the JS ecosystem largely using JS I think we take for granted what this enables Matteo from the node teams quoted saying that most devs ignore the fact they have the skills to debug fix and modify their depths they are not maintained by unknown demigods but by fellow developers yes and that includes awesome things like patch package which to be clear I'm not saying you should use patch package a whole bunch but the fact that you can write a patch to one of your dependencies in your node modules and not have to get it merged or Fork the depth you just make a few changes and now you're good to go that's huge it is such a useful thing you shouldn't use it a whole whole lot but at the very least they make it easy to go file an issue or a poll request making the change that you made here there aren't many languages in many ecosystems that make it this easy to change how your depths work and these are the things we throw away if we're just compiling binaries from rust anyways back to Prisma I'm excited for them to move off of rust because For the First time it'll be possible to meaningfully contribute very exciting stuff but it's important this is maintained so let's hear how they plan to stay engaged open source thrives on collaboration and we're making changes to ensure our connection with our community stays strong and transparent GitHub as the core this is an important detail people's like comms get split across so many different places and it sucks they call it directly here GitHub is where all of their primary platform for everything they talk about is going to be no more some things are in Discord some things are in slack some things are on their blog some things are on Trello some things are on GitHub it's all on GitHub awesome Discord will remain the place for realtime discussions though yeah the split always scary but at least GitHub is the core now that's a huge change and they're also going to be doing a monthly AMA so you can go there to ask questions share updates and get feedback cool A+ they also called out their guiding principles developer first focus on quality open and transparent collaborative continuous Improvement cool these aren't empty promises we're here to deliver in the coming weeks and months you'll see us organizing issues in our repo fixing bugs and delivering preview features if we ever fall short call us out this is a link to their Twitter by the way they are down to be called out credit to them I have been harsh on Prisma and they have not let that keep me from being part of the community I have so much respect for this team there are few people that were this willing to take that many L's about the way they were doing things before and then grow not just for the sake of it but to show us how to do things right and bring us along for the ride I'm genuinely hyped to know prisma's not going anywhere and all the people who Bet On It long ago in the OG GT3 stack days are going to have a bright future ahead of them Prisma should be great and I am excited to say they are as far as I can tell on a path to Greatness once again thank you to Prisma for all of the work you're doing here genuinely really appreciate it and until next time peace nerds ## Pro tips for picking the right stack - 20241222 can you give me your opinion on which of those Frameworks are better to start with pick what's popular and if you don't like what's popular pick what you like it's really kind of simple if you're not deep enough to know what the right solution is the popular one's popular for a reason it might not be perfect it might not solve every problem but it works because it wouldn't be popular if it didn't I hate seeing so people get stuck at this step in the end it doesn't really matter that much which you pick and if you can't decide just pick the popular thing ## Pushing the limits of Typescript - Interview w tRPC Creator Alex (KATT) - 20220719 I've pushed for a bit that I think it should be a whole new name because this looks like a new library to me welcome welcome so excited for today's show I'm sure almost everybody here already knows what we're talking about and hopefully knows who we're talking to but for those who don't mine is grossing yourself quick yeah malix I'm the creator of trpc and been a web developer for a really really long time we can keep it at that very simple short and simple no sounds good to me I am sure a lot of people here know of you but don't know too much about you I know you want to keep it simple but I think there is some value in talking about your history a bit and how you got to trpc mine telling us a bit about like how you got started with web development what you liked and didn't like and how that kind of led us to graphql and eventually trpc so I started off in web development in PHP and I was over 15 years ago and what I really loved about the PHP is like you know you can have an index.php file and you can make everything just work with one file you know you can write database calls and then render stuff in http ml straight from the database and you have this like really amazing productivity and that's something when you look at trpc you'll see that there's a lot of influence there of how the productivity you can have of you know just using the same language and leveraging that um but my career has been like a bit all over the place I worked as an iOS Developer as worked as an Android developer front-end back-end developer in a bunch of different languages and what led me to create trpc is sort of also a bit of a zigzag thing I started a company was it like three years ago and I really loved graphql and I've used that in production for several years ahead of that so we're sure I wanted to do a graphql back end but I also wanted to move fast and I didn't want to write a graphql back in for Scratch and Prisma 2 was still in beta so I ended up using has server for the back end and has sir for me is a as a project how I usually put it just like it makes things that are already easy even easier and it makes things that are naturally hard like writing your business logic doing good continuous integration testing what not a lot harder and I didn't think that stroke the right balance and I got to the point where like hey I need to either like I need to write my own packet not using a backup Service Tool and I was close to writing my own graphql server but at the end of the day it was like I'm just making a website here why do I need this like big and complicated API back in the day so I would just write this whole thing in an index.t PHP file um and I started looking for Solutions and there was nothing really out there that solved this itch that I was having and I found an early proof of concept of what was called trpc that quickly changed into something that was just 100 Alex and just fell in love with that idea and spent a lot of nights weekends and days on doing the first version of trpc which is now on version nine although it should really be like version one uh we're going to talk about version 10 now that should actually be called version two but I've been really diligent about breaking changes so even when I change like a type definition that is to exported I do a major version change def major of trpc was released in September last year and today we're going to talk about crpc versus version version 10 which is going to be the first breaking change for almost a year now I couldn't be more excited I am so so so hyped for trpcv10 if somebody in chat just pointed out this is kind of V2 in binary 10 is 2 in binary so we can call this V2 I've pushed for a bit that I think it should be a whole new name honestly because this is the stuff that I've seen at least looks like a new library to me yeah and I've considered changing the name but it also coincided like I worked on this sort of implementation of touristy for six months or so on like nights and weekends right um because I have a day job too um and uh I considered changing name but when I talked to like core users of trpc that's been on the journey for a long time they sort of like the name and their familiarity and it's gotten so much traction lately that it would sort of be it would be a shame to change the name to something new because now it's a thing right now it's a sort of like established uh name out there it's in in people's mouths like trpc graphql rest mostly agree I think that due to the level of hype there is a unique opportunity to funnel that into something big to really like emphasize how crazy a new launch and honestly new product that you're shipping here but with that all said I think it's easier to show than tell I'm gonna do something I don't do a lot on stream I'm going to try and do a screen share with a guest so we could go to the playground or we can show just the way things are different now what's what would you like us to do um I haven't tried to playground for a few days you don't know if it works but that's actually the best place to look like I would assume that most people on the stream are already familiar with trpc um since you talk so much about it enough aren't that we might want to give a very brief overview there are 700 people watching right now across platforms I'm sure a handful of them don't know what trpc is so should we give a quick intro on what it is yeah sure like trpc eliminates the need of having API schemas like traditionally if you want any sort of like really typed guaranteed shape between you back and front then you would use something like open API or graphql and trpc removes the need of it of that by allowing you to reuse the type information that you have on your back end and you fronted what that means in in layman's terms it's just like you define a function your backend and then you can call it on your front end and the same way you can return yes data from a function on your backend normally and just copies internally you can do that but Across The Wire yep I can confirm that's exactly how it feels to use trpc you write a function on your back end and then you come out on your front end and the only difference between the two is the file you're writing them in it is such a seamless experience and I've had a lot of fun working with it which is why I'm even more excited about what's changing how would you to sentence to your best ability the change from v9 to V10 like what is the the higher level goal that you are seeking out with the new design so removing the barriers between front and the back end even more so right now you on the front end sort of invoke a function and with the new version it will really really feel like you're calling a function that is part of the same system and you can do stuff like refactoring straight from the front end you can like change the name of an API endpoint by use like right clicking the function your front end and it will change in your backend as well and all of this happens without having any like extra compile steps uh it's still just using typescript you don't need to think about any weird ass webpack config or anything like that you just call a function and that is through a proxy object rather than these like string paths for those that don't know what a proxy object is I want to quickly describe what's happening here because it is so interesting okay when you have a proxy in JavaScript you can wrap a function and then when you access different parts of that object you can actually remap that dynamically to different places so what all that this does when you call proxy.greeting Dot greeting which is a weird endpoint name it will actually just remap that into a string and when the actual function call it is called at the end something else happens so it will actually call a client dot query and it will use those first parts of that um of this like stepping through the object and pass that as a string to the back end but as a as a consumer it feels like you use axi accessing at the property now thanks to the proxy object you can do this dynamically on the front end to put out needing any actual um runtime information about the back end does that make sense at all it it does to me but that's also because I've been thinking about this a lot the way I want to describe the change for those who are currently familiar with trpc if I go back to the home page you'll see when you do a query you're writing a string there's effectively a list of strings that are predetermined as valid trpc endpoints based on the the query keys and the mutation Keys you define in your router now we're moving away from those strings towards an object with a shape and that object shape is what determines your API it's almost like graphql in that way with a graphql like nested schema but instead of it being a separate World a whole separate language of graphql that we then have to like translate on both sides it is the object in graphql in typescript that describes the API and how it's fulfilled on the back end as well as how we query against it on the front end but without a different thing doing that translation yeah and at one time the client doesn't actually have any knowledge whatsoever about how the back end looks like uh the the client is completely dumb and there's no extra runtime information sent to the client uh it's just the compiler that knows sort of what the what the backend can do and that is the whole Magic of it like at the end of the day you still get this same string as you had before uh but the DX is a bit smoother and it sort of uh yeah Bridges the gap a bit more than the current version so I just changed for this from greeting to message to see if we will get an error on this side now and look at that we do greetings not a valid endpoint messages but here's where I think some of the the craziest magic of what you've built here is if I right click and go to definition on this function which to be clear this is front end cone code code this could be a hook right here like trpc dot query or usequery Dot message and when you right click go to definition it brings you to the backend code from the front-end code yeah that is like one of the biggest changes with the new version is yeah it Bridges the Gap like it's just a seamless experience when you if you work on the back and the front end doesn't matter you can use like goes to definition on both ends somebody was asking for this link so I'm just going to share it in chat quick uh yep so they have that and there's uh not that we mention it there is actually uh if if you want to dive into the react World there is actually uh a starter with the new version that I'm gonna send to you uh I'll send it is it Discord best twitch test probably the easiest actually others will have the link if that's okay I've sent it on the pain chart uh that that one we can play with a bit cool I will grab that from in here yeah should I just clone it yeah I think it's best to just like get it on your computer and it doesn't use any postgres or whatnot it just uses uh SQL light so it should be just jarn Dev I think I'll check that for you yeah yarn Dev will also do the migration necessary to get it running since I never use yarn I don't have any yarn things cached oh yeah I mean it will work with whatever you're using as well you don't even have a lock file in it no because this is um sort of like just a folder in the trpc repo that is pushed Downstream to not branch so the like the mother repo has the actual log file that's fair so so like in the main meantime maybe we can ask uh Slack okay cool someone asked if they will be sweld support and yeah like trpc is agnostic to react uh so trpc is built on four different packages right now that are official there's the server which is uh which will be able to run on Dino or node or bum and there's the client that doesn't have any dependencies whatsoever and then there's the react library that you can use if you want to which just depends the same react query and react but trpc will work in views well solid angular God forbid and anything else I'm getting distracted by the question you asked in the comments here so I'm going to do my best to not get distracted by that and instead just show how cool this is so there's a trpc router probably the easiest ways to go here where we have oh no that's going to a setup function interesting one layer too low here we go here's the app router so here we have the app router it has a post router and a health router as sub routers we can go to the definitions of these and we'll see that post router is a router it has a list which is a t dot procedure.query which is consuming a trpc helper to create a query and by ID which is a procedure with input and one query so you put the input outside of the query it looks like you define this first and then the query yeah so the the big change here for people familiar with trpc is that instead of chaining the router where you have like a big router object where you gradually add stuff by um adding a new like chain um on the router you instead have a flat router object and then you have procedures that are smart and the procedures can be changed Chained and reused so you can add middle wires straight under procedure rather than the router itself and then you can reuse those afterwards but we can get into like middlewares and more advanced stuff a bit later I guess we can start with the basics of just like Define a query Define the mutation calling that Etc works for me I yeah thanks so much here that's interesting it's hard for me to not rabbit hole on the pieces I'm curious about and give just the overview but and I'm also very open for feedback still like this is still sort of like a private Alpha whoever used like responded to tweet to me I've given them feedback and now I guess like 600 people on this stream um but I'm still open for API changes and whatnot if people have really good if people have ideas on how we can improve things I'm really really glad to receive feedback well we did just get a question that I believe was one of the core things that this new architecture addresses I'd love for you to chat a bit about is V10 going to fix the scaling issues I'm assuming that what that chatter is referring to specifically is when you have a large number of trpc endpoints in one tier PC router how that affects your typescript compile times yeah so the new version is going to make it like you know fixing it it's a typescript problem uh it's that they have a slow compiler that often crashes however uh the the new the new way we're approaching trpc makes it a lot easier for the compiler but there's still a lot of inference and stuff like that which I can't really avoid if I want to do a great a developer experience that said you can do probably like 10 times the the back end 10 times the size of the back ends before you start encountering those problems and when your approach those uh when you encounter those problems there are uh ways to solve those that are a bit more I don't know straightforward than the current version so when you do a large scale typescript project the typescript perform official performance documentation tells you to do a lot of things that tells you to not do a lot of things that we rely on in TPC which is don't rely too much on inference and do stuff like like everything that is fun about typescript basically tell you not to do so when we abuse those things that's with your ntrpc at a certain point you will have to do some optimizations on your own and that includes writing a few different TS configs across your project in order to let typescript compile certain types of your app independently but the short answer for this is yes there then you scale the scaling problems are sold for the 95 use case couldn't be more excited to hear that I have been in hell with project references myself back at twitch we had a very slow very big typescript code base that ran into a lot of these same issues and even if you work around in France and write all your types out manually and do all the things the way the docs say there is still a size where you run into those problems I think that knowing how to solve those problems is more valuable than a library slightly extending the runway you have until you run into them if that makes sense yeah yeah and um at a certain scale you'll have to learn those things that's just the nature of the Beast totally makes sense uh but but should we talk a bit about how you define maybe a router how you define a procedure how you define your sub router let's do basic stuff like that let's make a new router uh I will hop into where are we defining this router right now it's the same structure as you might be familiar with cool so I want to make the new router inline because I'm lazy yeah cons I can't type new router equals yep added here I'll look at the post router for reference yep the t-router oh you literally just put the keys for the things you wanted in it yep so message T Dot I love co-pilots perfect all right we'll name it test new router let's see how easy it is to query this on the client const test query equals trpc Dot proxy we're probably going to get rid of that proxy thing because it's just an abstraction League should just be trpc Dot makes sense DOT test Dot message I should dot use Query and now test query is a typesafe result dot data if we hover over this it should be string or undefined because we might not have data yet because this might still be in a loading state or error state or something along those lines yeah that was yeah and you can command click that message and jump back in oh not not there exactly yeah yeah cool yeah so for everyone else here this is react front-end code this is the usual JavaScript you write the one weird thing is the use Query that you call is a sub key on a pretty deeply nested object but the magic that we get from this is I can right click a message go to definition and it brings me to the back end code for that chain for that function theoretically I'd even be able to right click uh rename symbol test rename and that should have yep change it on the back end too from your front end you can full stack refactor an API Name by right click uh rename symbol that is insane you're just smiling really nice no I'm happy like it's it's really fun to like see people's reactions to this right like I've worked by working a lot on this for like the last six months like it's been going back and forth and this is sort of the conclusion right now but there might be tweaks we can do like you might not like that dot use Query that you have to write in the end but you might also understand why that's needed yep I it's growing on me I was unsure at first but it's definitely growing on me one thing I'll give for some feedback just because I'm in here and I've been thinking about this since I saw it is there a real use case for more than one trpc react query context or can we pretty safely infer that you have just one uh we're actually adding so you can have several uh because it's uh it's a use case that some people want that they can create several um context several trpc contacts because some some of them have several independent trpc apis they're working with at the same time so we're going to make like until now it's always been one Global context that you always use um but it's going to change so I would assume in that case that you'd have like a different trpc object that you're importing depending on which API so here's my proposal dot uh invalidate yeah yeah we that's actually the proposal we're working towards I can send you the RFC where we're talking about that let me see proxy because that's actually what we have landed on so I'll send you here it's very close to what you're saying you can open that if you want uh where'd you send that oh yeah that's too many channels I sent it here on the pink chat I'll send it on stream chat so everyone else can have it too and so I can get to it a little more easily yeah yeah I'll send the next message just there instead perfect cool so create proxy methods for react queries use context oh you're already doing this okay so what I was thinking is a little different rather than having to use context off the proxy directly theoretically and like depending on how this is all defined I could just be talking on my ass entirely wrong here the context doesn't have to live inside of react and you can operate on it out of band relatively trivially what I was imagining is that the instantiation of the trpc react helper would have an out of react binding to the context such that just by importing trpc or wherever like the react site is I don't have to do any of the hook side at all I literally just from importing trpc and out of band invalidating but that is like react query smart enough to let you trigger that update out of band and then re-render inside of react I'm not sure uh I assume that that breaks the rules of hooks and that would also break the rules of react query the react query doesn't work by the usual uh rules of hooks right so it might work not sure I think that rules of hooks are mostly meant to apply when you're inside of react and once you've made a hook especially once you've made like a custom hook there's a bit of an assumption there that you have hooked into reacts lifecycle and if you choose to operate on that from outside of react through like using external store and other methods that's fine and I don't necessarily think that having a function here that globally ish triggers a change that then causes a react change without having a hook that attaches to that initially is that big a deal I do so much stuff like this in ping it's not even funny okay fair enough uh such I saw Sachin was in the chat uh he is one of the core contributors on terror Percy I hope face uh he's listening yeah more than happy to pull in uh Tanner as well as DK in the future too if you want to have more of the like react query side of people given their thoughts on this too because I could just be entirely wrong yeah yeah yeah uh I mean the best the the way I approach these things is just like I tested out if it works I assume it's good until proven advice that's the right way to do it cool trying to there's so many other pieces I really want to dive in on I want to check out the middleware stuff in particular as you know a use case I have had a lot is instead of new router let's say uh admin router so on this router I want to check if a user's name like ID has admin colon in the front fail if they don't and if they do from that point process the request okay so let's um so what we want to do then is that do you want to do several procedures that have this rule or yes one I want this router ideally to have the rule such that every procedure within it will only be hittable if the rules passed so it's slightly different uh the way you think about this instead is that you want to do you have an admir router and then every procedure in that router uses a middleware by making a very reusable middleware so you want to create an admin middleware an admin procedure that you can use uh so we can do an admin procedure uh and then that is T dot procedure dot use that use yeah and then here we have access to the context this is a callback function and in that context so this works you don't get out of this yeah let's uh uh it's quite scary yeah exactly uh and this is basically based on your context object right so go to the context.ts and let's make an imaginary user on that I don't know why this is so mad at me right now uh you can't quite see the error because of our faces covering it it's uh void is not a sign oh yeah okay you have to return next on this similar to the existing middlewares you have to you have to return next at the end and next is also something you destruct from the parameters here yeah and then it's going to skip yeah then it's going to stop complaining and then the context object here similar to the context wrapping that we have in the current version you can call next with a context that is different from the current one so you're interesting so you can do like if context.user funny that it's that's right yeah and then you can do throw error oh wow that's really smart we don't have user on this type how would we earlier in the chain uh actually what's on this by default nothing cool how would we add things to the chain earlier then so the the context object in trpc and B10 is exactly the same as uh the context object of v9 it's created once per request so in your context.ts in this project uh you will have the contest object objects being set up so this is based on the incoming request it's just split out in two different functions so it's going to be so it's easier to test but in your create context in there uh yeah let's just uh you can so in here yeah yeah and theoretically I should now have user with ID cool then this will throw otherwise we will pass so now in the admin router I would want to chain this in front of each query right yeah so instead of doing doing T dot procedure you use admin procedure and now that's secure okay okay and you can you can reuse that several times and I'll have like if I add something else in here uh status context okay to put this in a context yeah so context adds uh does a tiny little changes that context you don't have to spread anymore it will just always just add whatever you add add on that so in that context you will have um that's really cool and then you can also do reusable middlewares like if you want to do uh if you want to abstract this admin procedure middleware that you now did in line here as use you can instead do if you define a new con a new variable under the line above or below you can do const admin middleware admin well where he said yeah and and then you can do T dot middleware instead of t procedure.use and instead here I would T Dot procedure.use the bad guy yeah exactly and that would be exactly the same thing and that should still give us yep user info context Dot user oh it does not interesting it's not keeping the status okay okay prettier's Matt oh no it is it was just being it does sound yeah cool that's so rad and if I change this to something else type error because that middleware comes through that way oh yeah that's so cool uh so in this way you can also do like you know usually now in your context the user is not knowable uh but similar to that like most some of the requests might not have you sir so if you would if user would be nullable and you would pass it through after doing this a search and that user exists uh that would also be propagated to each procedure thank you very interesting yeah so like to quickly give an example of that I'll make user what's the easiest way to make user yeah exactly uh so as user I mean Define the use of objects yeah cool now that could be null right yeah is it not smart enough to actually or know what huh it's just assuming that exists yeah it should give a typer there I wonder if the or null is being destroyed somewhere else up that chain yeah but maybe we don't need to get stuck in that uh that should be useful or undefined I'm gonna or empty objects thank you that's true or user no cool that that did it yeah exactly so now you need to do a jacket what's cool what I'm gonna do actually let's let's chain these a bit const auth middleware testing the waters can you stack Metalworks yeah yeah you can I see you shouldn't you should pay both no you should be able to uh but this is a demo so this these things always make me nervous right I have tests for it if no context.user turn next user or context of user and now we'll know theoretically expected whatever oh well I guess it's not smart you know tier Sierra code enough right yeah so now how would I chain this here uh so that's a very Advanced feature that I'm probably gonna throw out the door because it's usually not useful um but we have a function called unstable concat uh but he has some type so if you don't do this if you don't do the admin middleware as a reusable one you can do it easily a simulated you did before then you can just do uh off to proceed like admin procedure and you can use that middleware and then use another middleware but stacking to Middle worst that changes the same sort of key is a bit more tricky I'll give the first example just so people can see it because it'll be more useful to potential users in the future so const opt or off admin procedure equals T dot procedure dot use auth middleware dot use and now I can yoink yeah the contents of this guy and theoretically since we asserted prior this should now be typesafe because user has to exist because in the auth middleware we throw if it doesn't and then we assert from here that it does so now we have the ability to create a procedure with off such that if we chain additional middlewares we still have this knowing it exists whereas here we aren't certain cool now that we've seen the right way to do it I want to try this unstable thing okay uh so t I haven't deleted it yet have I I think I intended to because I didn't want people to use it uh there should be on T dot unstable there's a c Dot and the only options are config merge middleware okay I already I forgot about that but I actually already removed already totally fine yeah I personally have a lot of use cases for stacking middleware in Dumb ways but I think that the procedure abstraction is probably the right place to do that because I I don't have many use cases where I'm hot swapping different middlewares in different places but I do have a lot of places where I like I reuse our off middleware all over the place and being able to stack that into an admin middleware could be useful but doing that stacking in the form of an admin procedure that's fine all right so now we know how to define uh we we know how to define the router we know how to define a procedure we know how to define uh middleware what else is there what else do you want to know you're the Creator man what what have we not touched on yet that we should know more about I mean we haven't touched on mutations and then you know you have infinite queries and stuff like that too um broken do mutations maybe they're very similar to what you did here with the query the only difference is that you end the procedure on your server that it's going to be a mutation instead of a query interesting that procedure is used for both it feels more yeah but like since the high level primitive that's being like reused and built around is procedure instead of router it almost feels like the control flow has been inverted and yeah procedures the new base unit and from that base unit you can extend a mutation or query you can extend a like middleware like within it and then you could stack those into a router Nest them do all these other crazy things with it yeah I just ended up being a lot more simple at the end of the day in trbc v9 uh all of the logic that you did like you did all this middleware on the router at the end of the day they all got stacked into this like massive procedure object so now instead of having that on the router we just have based on the procedures and it makes it so it's a lot it's a lot more flexible than the current version uh like you couldn't do stuff like reusable middlewares before uh except for like if you want to do some really really like hardcore type scripts generics you couldn't really do reusable middleware uh but there are there are some other stuff I could show you where like uh but yeah let's just let's do some more Basics first let's create a mutation I can add one to the router I was hacking on in here let me delete all of these that are no longer type safe and switch to auth admin procedure here cool so now that we have a t dot router our admin router where we're creating admin procedures let's create a mutation uh uh delete user we'll call it yeah Dot input oh yeah you actually never added an input on the query maybe we should do that first I've put it putting it here is the same difference though isn't it uh yeah but you uh how you call the use Query function uh depending on you have an input or not it's a bit different that's fair so maybe true and try to add an input there and if you can do do them side by side like the front and the back and so you can see like the typer is propagating through I don't have Zod is an import Star as no no that looks right that might be something else does it not now it needs the object probably yeah oh there there you go cool Andy said this changes now do I you now you have an input there right yep and this should be the same type safe ID string that's coming from the infer off of the Z dot object there and if I go to the front end where we weren't calling this yet uh well I know we are calling it ah it should get the type order uh wait this is the admin router oh yeah or not the uh test router cool well if you switch that over I'll also rename it admin router now is the function named it was still test rename cool and this use Query type errors because it expects nice we're going to put my options just comma options yeah yeah that's the options and they're probably going to tweak this a bit uh because you have previously complained a bit that it's a bit hard to know what is trpc options and what is uh react query options yes and I think that would be a really good distinction to do so maybe all of the trpc options should maybe be under a property called trpc or something like that uh in order to make it like really clear that look at the react query docs for this or look at the therapy docs for this yes uh the only thing we will add is we add the context and we add SSR on this I maybe it's not worth breaking trpc options out separate rather breaking react query options out separate maybe like query client and this is where you dump all the react query stuff and then SSR and the other option you have that are trpc those are at the top level next to react query options and then that is where you go deeper for RQ stuff this is always a hard to balance right because like for me he knows he know what I'm looking for it makes so much more sense to just have them flat because it's a nicer user experience or developer developer experience but I understand that it's not perfectly clear for people coming in uh what is what so it's always a hard balance there like between like I don't know like new users and people that are a bit more experienced with the tools the typescript Cavalry has arrived we now have Matt and chat oh wow nice to see him here I wish he was here for the rant about how typescript says to not do inference I want to repeat that one quick so Matt can share his thoughts in chat yeah yeah like everything would do with typescript that we think that that is fun and makes the developer experience uh good is the things that the typescript performance docs tells us not to do which is a shame uh when you do a library like uh trpc that is heavily based on inference and people start getting like this you know maximum call stack exceeded and stuff like that and you want to advise people on that uh or the typescript server crashing or it just like costs everything is any all of a sudden and typescript performance doesn't matter when it's Rewritten in Rust um hopefully that will happen um but I mean I'm not too optimistic about typescript compiling on a viewer written in any other language and just work you know how are you feeling about that there about the typescript rewrite in another language yeah I've seen like I'm gonna I'm gonna do the C plus plus I'm gonna do it tomorrow so I'm gonna do it then go not happening I I have talked to too many people much smarter than I and at least as smart as though is claiming they can rewrite the typescript compiler in something else I actually have a running BET right now some dude said he'd get it done by end of year I think I put five grand down saying like you won't but if you do I'll move the code base and if I can compile the PIN code base in your C plus plus or whatever other native language based typescript compiler immediately paying you five grand and moving our code base over I need it that badly like if I can compile my typescript code with type safety that fast yeah the problem is typescript is the most javascripty thing ever made that doesn't only use but Embraces all of the weirdest behaviors in typescript or in JavaScript so encoding those describing that AST and doing all the things necessary to succeed in recreating the typescript compiler outside of JavaScript feels nigh impossible if you picked a good subset you could totally do it but yeah 100 and I think that's how that's the difference between what was that what's that the other one called uh that's Facebook but reason uh that is similar-ish language typescript but it doesn't have all of the baggage of JavaScript uh it can do stuff a lot more I mean performance uh but problem with that is like the adoption is going to be a lot slower because then it's not just like a strict chipset of JavaScript right that's why typescript wins uh someone asked me uh asked a good question capex127 asked at how many input points uh can one limit ah how many endpoints can you have I guess is the question and uh right now I have a unit test that runs with everything that has 2 000 procedures with input arguments as part of the build and that works and when I play with that ingest I get a feedback loop which is roughly like two three seconds on my machine uh which is pretty promising uh but that's still like a very simple example it has a few like subrouters and in total it's like 2 000 procedures and a few nested levels uh but still you know I don't want to over promise but that works really well uh uh and in a real world application when you have all of your own application logic and inference magic it might be a different limit right but I know comfortably that it works at 2 000 procedures uh and it's an okay um you know feedback loop for a simple case um and the current version of trpc v9 goes Haywire at like five six hundred that's super surprising promising one other question like related to that something I was playing with a while back was first off splitting my trpc router out in a mono repo so that was compiled and like cached and managed separately from the rest of my code base but what I'm seeing with the procedure stuff is a real opportunity to abstract like a level or two deeper where you could actually have a like five different like sub repos that export a router or export just a procedure or a few middlewares and then an other packages import those and create like your own package hierarchy that becomes your trpc router yeah and uh that's that's part of the things that the new way of doing things makes a lot more simple and also it enables stuff like if we ever want to do file based uh routing that is like automatic similar to the pages in next uh the Cur the new model of trpc translates a lot easier to that so maybe you want to do a file that yes I have export default T dot router or TDOT procedure and that automatically maps to something and that that's going to be a lot more like natural with the new version so that'd be cool maybe I should talk to your T3 stack guys about that to show the other proof of concept I'm sure there's some people that would be more than capable of throwing something together there yeah I I need a trpc turbo repo Bono repo example with a working Expo app so badly I have went hey I'm trying to make this happen and just get pissed off every time I try and the sooner I could not do that the better I've released an issue with a bounty so if someone on the stream wants to pick it up go nuts I see Matt saying he's interested apparently he's been diving into terrible repo recently so that's exciting so there is a bunch of monorepa examples already but not particularly like specifically with turbo repo and Expo that should be manageable right like if I had a day uh where I wouldn't spend on other stuff I would do it like it's just far down my priority list all I can do right now is just outline what I sort of want to see and then maybe someone else can pick it up somebody in chat mentioned that their upgradings are to V10 so that's exciting the zart's one of them omers and Omer is looking at that uh yeah shout out to zomars one person in chat said that trpc.io is down for them and somebody else just said that t3.gg is down which means that uh versel's CDN is down it's not down you're on Versa for the trpc site right doesn't seem to work right now might be dead or DNS in general right now uh maybe we overload the Versa type insight yeah a bunch of people are saying that uh they're down for them but others are saying it's fine I'm really thinking that there's some DNS going on there yeah all for the Tipsy is down for me all right well while we're tangenting to un import or to less important things like the internet being down I did happen to notice that there's over 230 viewers on YouTube and only 76 likes on the Stream y'all Bots no go fix that get on that guys so anyways this is super exciting stuff is there do you want to go over the post and the migration stuff I think that could be useful to a lot of people since I'm sure oh yes here are users yeah exactly so people might be worried about oh yeah I'm using trp C9 what the is this this looks completely different is this gonna force me to rewrite my whole app in one go and that's not the case uh uh there is an interoperability mode uh it's in the bottom and in that table of contents so there is interrupt mode uh interrupt yeah so here's like the beginnings of a migration guide of how you start working with trpc V10 if you have an existing trpc app uh the only thing you need to do in the 99 use case when you use trpc is that you upgrade to V10 and you add a DOT interrupt at the end of your current router and then your app should work exactly the same as it does now insanity this is having done some not this Great Migration stories in my life this is almost like meme tier just add dot interop then you can combine the routers and you're done where's the Legacy interop router with your new one yeah so that was the that originally I plan to do V10 that's like uh completely uh breaking change renaming the project to something else and be like yo if you want to change uh to the new thing just like start migrating stuff over however I found it very helpful uh someone brought up the like interrupt mode as an idea and then I started playing with it and I realized like Underneath It All like it looks very different on the surface but the underlying logic of middlewareson procedures and whatnot is 99 same thing so I started playing with an interrupt mode and it was actually really useful because that means that with all the test Suite of trpc with all the weird edge cases and whatnot I can just add dot interrupt on my whole test suite and make it run and get pretty good confidence that everything works the same on all my example projects that I have about trpc have like six seven different example projects and also Run free CEI I could just move them move them into an interoperability folder add dot interrupt and all of them and then sort of get a somewhat guarantee that it just works to upgrade um so it actually saved we have once a bunch of time uh because I didn't have to rewrite you know 100 of the test Suite of trpc that is a benefit I hadn't thought of before you mentioned it now it makes a ton of sense I was kind of expecting a big breaking change when you showed me the new API initially and knowing that I can adopt it as soon as the version is released is pretty nuts I'm really hyped about it you can adopted now that's scary I mean it's running I I try to interrupt mode on my company's uh site and we are pretty extensive like end-to-end test and the integration test and whatnot and is that I updated it in a new Alpha random test suite and playwrite your sets like okay it works yeah that's I'm happy that you have the test so that I don't have to but we don't so adopting this right now is a little scary I'm still very down and probably I'm going to I yeah excited that said there is a really good question for Matt uh how integrated is trpc with what you're doing in your data or in your day job um I use trbc every day um that's the main thing right so a lot of the real production use cases for tier proceeds and like all the weird edge cases you know the the need for reusability in middlewares and be able to do like a large-scale backend uh is lessons I learned on my day-to-day job and I currently don't spend uh working time working on trpc but that is something I'm discussing now with my employer um on how that would look like where it could be like Mutual mutually beneficial for myself and the company to use crpc because obviously like for me uh and for the company like contributors to trpc becomes like a massive pool of talent and you know having a big open source project out there where I can do marketing both trpc and the company is also like a really uh good pool of talent we can use does that answer the question I think that more than answers it I see a bunch of people asking what the company is I don't know how much that's been shared just yet yeah uh so I can't talk too much about it publicly right now we're still sort of uh pre-launch but as much as I can say it's like it's a fintech company that was in the same uh y combinator batch as Theo and I'm one I was employee number two uh it started in January and I started in January and now we're 10 people and we are working on making the easier for small and medium business is smaller medium-sized businesses to pay and get paid really good stuff and I see how the focus on small to medium-sized business makes a lot of sense for trpc in particular I see one more question that we've gotten enough times I want to squash it out and then I want to Pivot over to the graphql conversation that's more than overdue oh cool but this last question it's I've seen it a bunch of different ways and some people are asking it in what about multi-part forms others are asking and what about file upload what are your thoughts on supporting files in trpc it's gonna happen uh the question is like what uh so right now theocracy is written in a way where we only support Jason as the transporter mode uh but I would open that up so there's uh there's an issue uh that is outlined where we want to support more content types than Json and there's no limitation really like it's pretty well separated on the server where we should be able to add a new content type we have already added different transfer types right like we have subscriptions and over websockets and we have and we have the course of mutations over HTTP but you can do it also the websockets too and the same way yes we have different transfer types we also want to add other content types so we want to be able to support the binary format that is more performant for sending you know images and whatever you want to upload and stream that to your procedures instead so that's going to happen and but for now when you deal with images and file uploads and stuff like that we do you can either do like a mutation into your procedure returns an S3 pre-signed URL that you then upload to or you can do everything as a Basics before blob that's what we we use ourselves so like if file handling isn't your like main Core Business If you just like want to upload a profile image here and there it doesn't really matter if you use Basics to Forfeit us then it takes you know twice the long a length when it's a request you do once a month that takes 500 milliseconds instead of 200. so the way we deal with it is like we base64 all five log loads and send that up to mutation interesting that was not quite the answer I expected I've always viewed trpc as the best way to pass Json to and from your server and it's a great way to send a pre-signed URL from your server to your client to then put the file somewhere where it belongs I in relatively against like doing object manip and like managing files in your servers unless that's like your business like if you can use S3 or you can use something else there's any option to not roll your own you should take that option uh but it's a lot easier to do it yourself honestly like if you do if you can do an input that is like Z dot binary or whatever like and you can then get like a stream in your mutation and then stream that up to S3 you don't have to do that extra round trip to get the present URL and stuff like that and it's a lot easier whenever for me like my experience is just like whenever you can shift logic any sort of logic from the front end to the back end it's a good thing and if we can support other content types uh shifting that logic to the backend would make sense a bunch of people are redeeming find a cat I have one right here cat is next to me we're interviewing him well yeah that's unexpected but really good answer I'm super happy I asked the question I totally agree like if you can make it elegant that's really powerful but I personally don't see a reason to upload on my server like the the one back and forth is a lot easier than eating all of the data going into your especially in like serverless land like eating that data transfer when you don't have to is not within my interests personally but it's really interesting to hear from your side I mean you do HD video streaming uh you pay for that you can also pay for a few file uploads here and there I think Fair we're not doing the file streaming on our servers either though for that reason no no no uh but the the file streaming could be like instead of sending that present URL you can have a mutation and then you stream it from that mutation of test free and then you can cut some logic and you know cutting logic means cutting man hours and cutting man hours is has more impact impact on your costs than saving a few Pennies on your data transfer I have seen this one come up enough times I want to jump on it what's the difference between grpc and trpc Alex grpc is something completely different so like RPC was a fake before tier proceed before grpc and uh grpc is a big project by Google uh where you worked with like you work with a binary protocol and you have a strictly defined um data shapes that are guaranteed on your server and uh you can pass data around microservices or from front and tobacco whatever in really performant ways but RPC just means remote procedure call and remote procedure call is an ancient way of doing apis where you sort of like mimic being an assistive even though you're outside of the boundaries of that system and you used call functions that is what RPC is in simple terms somebody in chat said Google RPC versus true RPC you could put you put it like that like Google RPC requires a lot of more wiring than crpc uh but it's also way more performant so I mean I think this is a pretty good segue to the graphql trpc's discussion actually because that's also like one more one I want to jump on somebody asked if you can encrypt the trpc response and unencrypt it in the client yeah SSL is really cool yeah that's what has to sell it for is for all right yeah you don't deal with that yourself like you have a provider that can give you encryption uh dealing that's what dealing with that yourself totally agree anyways graphql why should I never use graphql again uh you probably should you know that's my answer like uh it like I a lot of people ask you know what's the benefits of trpc over graphql or vice versa and what I usually say and what's in the trpc docs already sort of like if you're already using trp graphql you're happy you have a big organization around it uh don't change um but graph kill for me I've used it happily in production for several years before creating trpc so I don't it for me it's I don't know how to put it like I would never bad mouth uh graphql in any shape before um but the fact is trpc allows you to move quicker especially at a small scale like small organization and I feel like graphql is really really good at solving organizational problems as a language uh where you can have like this beautiful graph this beautiful domain layer of all of your data in your organization and there's one unified way that is really strict on how you query that data uh if you're a startup if you're a smaller company typically what you actually want to do is sort of like uh query something show something and trpc is a lot faster way of doing that and I'm not only talking fast in terms of like development speed uh it's also more performant graphql especially if you talk about node.js it's slow like whenever if you ever tried to return a big payload we're talking like a megabyte of Json in graphql it gets really really slow because of the type checking that it has to do at runtime on every single node in your graph totally agree I the way I like to frame it is graphql solves a communication problem trpc solves a DX problem both look similar in the sense that they are a definition of your API that is much easier to work with in a type Safe Way on your client but the approach is so fundamentally different that it feels like they solve two different problems like if I have a big back-end team and a big front-end team and they're constantly stepping on each other's toes and there's no way for them to like interrupt and work together graphql is a schema that they use now as the communication method between the teams that also works in code trpc lets you flatten all of that into one code base where you don't think as much about it and it's a matter of do you want to think more about the shape of your apis or do you want to never think about it again trpcs yeah exactly I don't want to think about it graphql is I want to think about it so my teams don't have to talk as much yeah as my job would since we work with crpc we've actually never had a conversation about API shapes we never had a conversation about like this is the shape of our data when we return return is from our API there's no spec uh with like uh this is how you return a list this is how you return a function the um an entity this is how you return related data that entities it's just like you call a function you return whatever the you want uh based on the needs of that specific page and everyone is a full stack developer like we try to not have that distinction like obviously some people are stronger one another but you just your job as an engineer is not to build apis or back-end things or buttons on the front and your job is to solve business needs um and that is the sort of framing like trpc is a full stack framework and it's also like one thing rather than like in graphql you might have to have like four or five packages with sub dependencies um and it solves the the layer between front and the back and then sort of you know first it Fizzles out like what is front and what is back and you like you don't have that clear distinction anymore uh but as an organizational scale you might see at some point where you know trpc doesn't really work solve these communication problems anymore you already have moved into silos and graphical might solve those problems for you and when that day comes or if that days comes you can probably just like copy past all of the procedure logic that you have in trpc in a beautiful graph instead and it'll be pretty good to go started responding to chat messages mostly yeah I highly agree with this I I think I'm seen as anti-graphql now a bit which is sad because I'm very programmed ql I'm just anti-graphql being prescribed for the wrong what things the same way I'm against next being used for static sites if it's avoidable like there are better tools for certain things and graphql the front end DX does not have to also be graphql the full stack backend hell Alex or not Alexa AJ from the Redwood project brought up uh quote around or along the lines of uh do I think that or somebody else actually asked it do I think that graphql is just pushing the problem to the back end because graphql on the back end is a decent bit more work than a traditional rest endpoint where you just dump data I would like your thoughts first but listen I have a bunch myself I mean there's a lot of I've worked with back-end Engineers that thinks that's the case and I work that's a backend engineer and I don't think that's the case because graphql allows you to do you know one end point or one resolver that fulfills a lot of different different needs uh so you write it once and then the clients can use it how they want so I don't think so and all of those sort of like scaling problems whatever with graphql that sort of you have to solve any way but it's a different take of the same problem and that problem is a bit more Loosely defined and a bit more unfamiliar to people like there are a lot of things you have to like buy into when you go for graphical you have to do think about query complexity you have to think about field-based authorization and authentication and stuff like that that in rest or sort of rest and RPC land is sort of similar in that way you don't have to think about that as much you just think like does this user have access to this endpoint rather than does this user have access to this field and that's a bit of a problem that is easier to grasp but at the end of the day you need to solve both anyway so I don't really agree that you know graphql is more work than rest also it gives you a lot of that the rest doesn't give you like you can rename stuff you can you can deprecate things of the API you can introspect what is actually used in your API um and a lot of really cool in like introspection features uh but yeah I would love to hear your take on this yeah I don't think I agree on this one I think that doing graphql isn't inherently more work than rest or RPC doing graphql correctly is very much a lot of work and you need someone who's incredibly familiar with it and its strengths and weaknesses to pull that off right as so much in the chat my take is like graphql is great if you have a graphql guide at your company to do it right and push it the correct ways but if you don't have someone experienced with graphql that is a really the worst way to pick up the graphql experience is when you already have a communication problem you're using graphql to solve like learning gql to solve an external communication problem is doing two hard things at once in a way that's likely going to Doom you and I I very much agree there similar to like this is why Tanner still blows me away the worst way to learn typescript is building a library like the best way to learn typescript is building an app where all the libraries are well typed already and you're just inferring the type off the thing that you're calling and the most complex thing you ever have to do is install an app type slash package once and package like Library maintainer land as you know better than anyone the typescript you have to write it's very different from the typescript most of chat here has to write and I have recently adopted the take that the one of the biggest like reasons typescript is such a pleasant application development experience is because it's offloaded that work to library developers it is required developers like you like Tanner like the core react team to build type definitions such that we as consumers of those libraries and users of typescript can have a better experience developing software I think graphql does the same thing to the backend developers but on a smaller like company scale which is why it's less I guess both are pretty invisible problems but I think there's a lot of similarity there yeah that's an interesting take and uh yeah on one note on what you said like don't don't write the sort of generic that you can see if you dive into the trpc here we are query or whatever open source project you find in typescript land don't write that in the application code like generics I mean some generics might belong in application code but the sort of advanced advanced you do should be offloaded into libraries um I think I think you strongly agree on that note agree more the simpler your application logic can be the better I think we have like five custom type defs in the entire pin code base and most of them are because of next off yeah and just like learn inference like if you want to if you want to level level up your typescript skills list like learn how to leverage inference like if you have a sod schema you don't have to rewrite the interface of those types learn how to infer the types from zotsky email like let the zonsky email b or pointed truth and then infer those types elsewhere and learn how to mix and matching types from different things um a really nice thing about Zod is that it Maps really nice to typescript right like all of the features in Zod uh Maps really well to have typescript works so yeah but on the graphql uh question did did anyone have any like more questions on that um subject though did we exhaust that I there's a slight tangent within of why would I use trpc instead of Redwood or uh blitz.js in the sense that like redwood's a full stack provided graphql solution and Blitz is more similar to the trpc style of like RPC patterns but I did see one matte comment I want to call out that he someone disagrees with like the don't write advanced typescript in your client code not because what you're saying is wrong but because you have a different definition of advanced typescript from me and I have a different one for most of the community here there is a level of like using some generics to make like a reused like use super bass hook slightly easier to maintain in your code base and you don't have to go as advanced with like the chaos that you're doing to get a little more from typescript and that's a lot of what like Matt's materials and like like the typescript I think it's like I forgot the thing I saw trash doing yesterday on stream that if you could name that and Link it I think you built a like tutorial game series thing where you play with different like harder typescript challenges yeah I've seen that typescript challenges thing yeah uh and yeah yeah I should retract a bit from a statement earlier like yeah don't be scared of generics and having them in the application code uh but I would slightly disagree still with nuts take like I don't think like you know if you have a generic status of remapping stuff in typescript I don't really think that belongs too much in uh application code uh but yeah I mean there's diff differences of opinion right like I can comfortably write that so might take my text are sort of like yeah I can comfortably read and write that myself but I it sort of what you said about graphql too like then you need a typescript card in your team and you if that type script God leaves who's going to maintain that stuff somebody link this into that as an example of a typescript guide yeah this is chaos this should be simplified but it does its job um but it should be I have a task to rewrite this to be a bit more simple but this is the sort of like procedure Builder that you see where you can you know add dot input and then uh when you call a resolve function after that you get the typed uh typed input type based on that but yeah it's using the Builder pattern which is really nice I saw Matt's mentioning that on Twitter yesterday it's really powerful Matt just made one actually very good point about the typescript guard thing if your graphql God leaves the service rods if your typescript God leaves you add a bunch of enemies no no n is in application code no one is please I I'm with you but when you don't have a typescript god anymore people make compromises and you can work you can work with any more easily than you can work with a breaking graphql service that nobody knows how to maintain fair I mean Nader is good yeah let's just leave it to start right like I think that it's a bit of an unfair comparison because it's two very different problems right but neither is good and you shouldn't depend on the one God in your team to maintain your code base uh so if you can if you if you can write code that anyone in your team can maintain that's a good thing like try to write code that someone else can jump into and fix like ideally you shouldn't be able to read the code and know who wrote it that's good development practice to me totally agree and that is why I like use the prettier stock config it's why I love so I love trpc it's I still remember the moment where I was like showing the PIN code base to like a friend slash investor uh Dax way back he I remember like when I was just showing him one of the trpc router files just I think it was like our like room router and paying for like managing a call he just looks he's like wait isn't this a typescript file where's the typescript and I realized there wasn't a single type definition in my entire like 400 line trpc router with all of my procedures for managing calls because it was all inferred off of the actual function calls and values in there there wasn't a single ads there wasn't a single like colon type def it all inferred from what I wrote it was just JavaScript and you didn't have to be a typescript God or even typescript aware to work in that and benefit from it and if you get a red squiggly line that's not because your typescript is wrong that's because your code is wrong yeah exactly and that's the power of inference right which you shouldn't do according to the docs I might have to make that either a title of a clip from this or just my next video the the power of inference so yeah with that now thoroughly exhausted let's get into the Blitz and Redwood convo for a little bit because I'd love your thoughts yeah yeah I mean Redwood uses with trpc simple as that it works well with trpc uh there's several Redwood uses that uses uh uh trpcs with redwood and that that's my thoughts on that if you like I think uh Redwood is built for massive scale and uh the graphql element of it is something you might not need uh in the beginning so you can use TRC with it and on the blitz conversation is that uh Blitz as everyone the way everyone knows splits doesn't exist anymore or it's changing uh to being something say more similar to the combo of next off plus next plus trpc uh but it's still in Alpha um and it's the their RPC layer is a lot less powerful than trpc a lot less uh customizable and is tied to a built a build tool so you can't just like in first off from or import stuff from your server from your client without having a pretty complicated build chain in there and there the abstraction on the back end in order to how you build out your backend is not real layer framework it's more like um Bare Bones if you will yes I totally agree and for context for the audience Blitz is a huge part of why I made create T3 app because I do like the idea of hey this thing is good or like how do I put it the power of full stack type safety is really powerful and the ability to set it up quickly is super valuable as well for something to not be so tied to your specific build tools you have to use something like trpc but in order for that to work without really heavy build steps and compiler type stuff there has to be a bit of boilerplate involved like the inference helpers the proxy object now and these pieces have to be assembled to get around the build side and the goal of create T3 app was specifically to bridge that Gap to give you the elegant getting started the x of Blitz without compromising on the modularity and the lack of assumptions around build time that something like Blitz had to make around like like Blitz is a top to bottom way to build an app create T3 app is a suggestion on how to assemble it yourself with some of the Annoying Bridges between those parts assembled yeah exactly and I mean if you want to use the blitz RPC layer and react native for instance you don't get any types and I don't know how far along they are to get to that point but once they are there it's gonna involve a pretty completely complicated one build pipeline and that's probably going to be ask Harry if not Terrier to set up than it is to set up these like two files in TRC that you can copy paste in from the docs I mean in terms of C it's going to be two two things you set up on your server you set up the T object and you do and you do that by calling in this dot in a trpc and on the front end you set up the react query hooks which is one function and then apart from that you also need the API Handler but you also have to like wrap the react app with the context you have to put in the API Handler and you have to understand the relationship between those parts and I think it's something that I have a slight disagreement with you on I to go back to the V10 dock that you shared before I think you aren't doing this as badly as you were prior but it felt like oh yeah you fixed my complaint yes never mind yeah so for context for everyone else the original version of this V10 doc had a full stack example at the top like it wasn't just the playground link it was like here's everything to create the back end and here's everything to create the front end but the majority of my day-to-day building and uh trpc isn't the way it plugs in on those sides it's very specifically how I Define a procedure in the sense of a query or a mutation and then how I hit that on the client and this new version of the dock immediately shows old here's how you define a router new here's how you define a router now and then here's how you would call in like of the vanilla client in react here's how you call it now I'm much happier with this it's much clearer here's how things changed and previously your comment was it felt like doing this was hiding things because we're just showing the parts that are good I didn't think of it that way I felt like this isn't hiding the parts that are hard in the boilerplate rather this is highlighting the things that you actually are going to work with every day when you use it yeah I think you're right um so yeah I added those took five minutes so I think that was I always think that was a good shot um I mean this this Doc is sort of like gonna lay the foundation of whatever like migration post or uh introductory blog post about to be 10 is going to be so I'm really happy for any feedback on this document as well we should probably plan a formal like V10 launch like event with a stream in a video get some people to come on and talk about how trpcs change things for them and like we should make this a thing yeah yeah yeah I'd love that also we're going to do a new website uh that's in the works well there are at least like 600 people who are vaguely web developers watching between twitch and YouTube right now so is there anything in particular you want them to put eyes on potentially contribute to help with a link I could share here that would be helpful trpc Discord Maybe yeah yeah I made a therapy Discord for sure and there's a bunch of issues that I've outlined that are like you know good for first uh good for newcomers so good first issue I'll send that maybe that's a good thing to look at if someone is secure it's about helping out their therapy and realize now there's only seven things there a good first issue which is bad uh but if someone wants to contribute to TFC in any shape or form uh my Twitter handle is twitter.com alex.js I actually have a command on the twitch chat exclamation point cat Kat to get the link to his Twitter okay cool uh so that's that's yeah I mean there's a lot of work to be done on trpc like if we if anyone wants to help out uh formatting the docs in a nicer way we probably need like probably want an API reference thing on the um on the docs that is not just like these guided sections um it can be a lot better structured the whole documentation side Sachin has done really good work on the foundation of that if someone wants to help out with that someone has design skills on this uh on this on the stream uh someone wants to do a new logo of trpc give me a palette to work with on the colors uh want to do some really cool uh example projects on the front page of trpc gifs videos what not there's so much things we can do like I when I dive into trpc whenever I have time it's mostly about like diving straight into the code enable new features um so I the the things about like documentations and stuff is stuff I pick up later uh and therefore they are lacking in a lot of places there's dark spots um but yeah if you want to help out join the trpci io Discord um and write a message in the contributing Channel and I'll happily guide you in any way you want super exciting if I can help you help me if I can help you help me that'd be great the I can say just from my experience the quality of the contributions from the community here has been surreal I'll get a screenshot once more because I have one particular number I am really proud of on create T3 app we have 42 contributors insane yeah that's amazing so cool yeah that's sort of like close to umpire with trpc like super cool yeah I I was floored to be fair there are more low-hanging fruit in a CLI to a knit an app than there are in something like trpc but there's still so much work to be done in both and it's really cool to see how like the community isn't just here to like post and learn like I am they're here to do a lot more and unlike me who kind of just sits and posts until other people do the work the people here are actually willing to do the work so shout out to the whole Community if you all want to take what you've learned from here and both hear the stream but also hear create T3 app and use that to make trpc better you have a great opportunity right now yeah just ask me I also saw Matt trying to sell out my job to somebody else I am the trpc dev Advocate don't don't give away my role yeah and yeah please uh also get such in some new followers please yeah Sachin deserves a huge shout out uh yeah face full of this guy Sachin has been instrumental in helping out with trpc it since he got started to get involved I don't know when it was like eight months ago or something uh yeah give him a follow yeah I just Spam sessions link quick side rant uh on the topic of Sachin this is something like a pattern I've been seeing more and more commonly in the software and open source space I feel like there are more and more developers like such and like TK dodo like the handful of incredible people in our community shout out like Julius and Nexel who are I don't know how to put it other than they see this thing that's working they see the opportunity to improve it and just accelerate that thing so hard like the work that TK's done to make everything in react query land so much more accessible and so much more powerful the work that someone like uh sachin's doing to make V10 possible the work that uh daishi is doing in poivanders to Keeps Us stand moving while also working on jodye of Alto and select from contacts and like 15 other libraries now I think that these like second level open source devs it's like kind of the artist's favorite artist effect but it's like there's this layer right below the big name open source maintainers that you're more on that side now or you're like the name that talks about the thing that comes on the show that does the stuff but there is that really important support layer right next to you that makes this all possible and I just want to shout those people out more because I don't think they got enough love yeah yeah I feel that's strongly about that with like take a Dodo like everyone knows Tanner and take it out or does the vast the bulk of the work right now on rear Curry um and he deserves a lot more love and following uh Danny does even though he gets a lot like he's not a unknown uh person either but yes Sachin has been really good help for me uh both ways you know having someone you can spitball ideas with that is like very familiar with the code base um and also like he does quality contributions as well and it's on the court and helps me with API design decisions yeah it's really really instrumental to have a right right hand man couldn't agree more and it's like I think a lot about burnout because it's something I'm lucky enough to not run into a whole lot but also like I'm betting on things made by individuals that could burn out and figuring out which projects will and won't and how they're thinking about themselves their own work and their own contributions is so important like the first time I had a sit-down chat with Jared before it was even like a thing we did on stream about bun all I pushed with him is how do you parallelize yourself 90 hours a week is not going to be sustainable for a project that you have to lead and build what does parallelizing this look like and how do we get there and I think that you've figured not only figured that out early but addressed it very effectively with contributors like Sachin and hopefully even more people from the stream here I actually like started from that point I knew I couldn't build or maintain create T3 app I had a vague idea of what it could look like but I didn't want to do that because I would burn out on it super hard and a bunch of people would be stuck on this template that I'm not going to help with but with developers like all the people we're talking about now that's how these projects can build an audience and not hurt that audience when the creators inevitably don't have the focus to keep working on it yeah for sure I mean I've I've definitely felt a fatigue with Tracy like I I always wanted to be 10 steps ahead of where it is and some days it's just like oh it I can't be asked to do anything and it's really it's just so cool to like you know you jump into Discord uh a day or two after or about GitHub and like the questions that people are popping all over the place now are getting answered without you know some people I never heard of before are answering really eloquently um Advanced topics on guitar discussions or on the Discord and it's really really gratifying to see like the sort of community coming to life without I don't feel like I've done any sort of community building one more thing I want to show you on that topic like I've done a bit more community building but uh one of my favorite moments in a similar aspect because I've totally seen the same thing in my community where I've been very impressed with how well my community understands the things that we talk about here to the point where they can answer questions better than I can sometimes even my questions so when I first used create T3 app I was blown away it made it way quicker for me to start an app and for me the only thing that was missing was prettier and I wanted prettier because I use prettier on all my things and Nexel immediately replied we could have a config but I think that might be too opinionated I personally just use the default if someone wants prettier they can install configure it themselves yeah it's just an npm install there's no reason to include that in our template if you can just npm install it yourself and it does the right thing the thing that this exists for is the stuff you can't just npm install the things that have cut like interoperation like and relationships like next auth and Prisma into your PC have a relationship you have to Define that you have to understand well enough to Define putting that in the template makes a ton of sense putting prettier there when you can just go install it if you want it doesn't and it was surreal to have my own philosophy thrown at me in a way that's like yeah you're right I shouldn't do this then I closed my own issue well he closed it for me yeah that's really cool also like yeah it's really cool to see how this project has blown up over the last few weeks it's amazing yeah the power of YouTube and twitch yeah also one thing I've I've been thinking about on this thing as well oh by the window subjects like this so for the tangent is that right now we have great T3 app is amazing there's a bunch of examples as well on the TPC website but there's no tool um that makes the migration to trpc uh good you know like it's sort of like okay you just create create a T3 at once when you start your project but if you already have a really complicated project set up and you you want to like try out your PC uh if someone on the stream is listening from that project if you want to tackle a hard problem that would be to like if you can interactively add all the T3 stuff on an existing next app in an easy way to be sick there's an issue for this uh somebody's been working on it pretty hard I think it's uh oh chip or a check if I recall has been deep in it he says something on the lines of like I've been this has been keeping me up at night yeah I've dreamed about this and like what really how this could work with like the different code mod techniques and such so there are people thinking about this who theoretically could make it work but it is difficult and I would say out of scope of create T3 app but it is absolutely something worth looking into because that could that sort of stuff could enable create T3 app to be more than just something you use once at the beginning of the project I think if you want to add a new recipes or whatever like I I think that these are two different projects but this is the right starting point to do what you're describing I think having a good simple focused here's how you start a new app from scratch using this Tech is a missing piece that we've seen things like Blitz and red would keep being created to address I want to make I hate to put it this way but I want to make it feel a little bad to use Blitz not in the sense that bullets is bad Tech but in the sense that you're choosing to give up ownership of those parts and you're when you make the choice to use Blitz you should feel a little bad that you're giving up control in favor of everything being like handled externally versus create T3 app it's knitting things for the best start that you now own and I I really like that role of this particular project but there's absolutely a hole in what you're describing for a CLI that interactively adds pieces makes suggestions all of those types of things I personally think that the example stuff is much better overall and my personal goal for like the direction of create T3 app is less like more CLI tools much more guides resources links to kitchen sink like more than half of the issues that people have brought up in like Discord asking about create T3 app I have resolved by replying with links to kitchen sink into trpc docs and having a good documentation set such that it brings you to the right places and to the right examples when you run into those problems is very exciting also AJ is in chat he's deep in working on a guide like a written doc on how to start with and use create T3 app and this stack which is crazy because he comes from the Redwood world but is very excited by what we're doing here he liked the issue actually I don't yeah I I don't really see them as competitors right uh either it's just Redwood is one of those things where you get a full table set out for you and T3 sort of like here's all of the ingredients in a bit more unstructured way um and you can cherry pick what you want and yeah just linking to trpc kitchens thanks people were asking about it yeah I definitely agree stuff there yet I did a bit of a rant on this actually this would be really this might be a good final thing for me to get your thoughts on because I know it's really late there for you but a talk I'm planning on giving soon that I've been like sketching out is buying time the idea that when you make these types of technical decisions you're buying yourself some amount of time until you have to to change that decision and that time is like a cost and the cost is in three pieces there's how much does it cost to adopt this thing how much does it cost to maintain using this thing and how much does it cost to move off this thing in the future and I was trying to chart like different solutions where trpc has a slightly higher cost to adopt because you have to understand the boilerplate enough to set it up the goal of create T3 app was to reduce the cost to initially set things up and with trpc and with create T3 app as well I firmly believe that the cost of using them once set up is pretty much flat you're not eating much when you do that where with graphql you do have to understand graphql well enough to eat that cost so what I've like diagrammed here is Redwood is a decision that will be more expensive to work with on the day-to-day but you can get to a way larger team size with it than you could with trpc and create T3 app in its current state whereas if you rolled your own graphql you can go a lot further but you get to a point where the cost to move off it is unrealistic yeah I like the I like your framing here and I don't know I mean I don't know where the employee account stops for trpc because I know for a fact there's a lot bigger organizations that use therapy than 100. there's a few unicorns that are using it so I should say rather than employees like number uh around keyboard number of regular contributors to code base using X so yeah it's uh do you know the company that has over 100 people contributing to a code base that heavily uses trpc I don't know if this I would assume so uh but I don't know for a fact I'll have to ask no worries yeah I'm very curious because I want like like I am giving this talk I think in two-ish weeks I I booked something I need to get better at calendars and dates in general but my goal is to like meaningfully communicate when you make a technical decision how do you calculate the costs around it and I think that I like this framing of comparing it against the number of people at the company because you if you have a four-person company or was it back I used to have time on the bottom like how many years is this decision going to last you and that didn't feel right so I switched over to a number of users but like trpc scales better than graphql does just by like infraside because it's so simple so I kept thinking it's like oh it's the number of people contributing to this because that represents like the size of the code base the amount of money the company's making the amount of time it's existed for like all of those are uh if all is going in a way that it would affect the performance of these Solutions it's probably affecting the number of Engineers working on that code as well yes to you know should drum a bit on such in a bit again he's working on some really cool stuff that can extend this a lot uh in terms of maintainability over time uh he's working on a thing that can give you a bit more guarantee of the and more confidence in terms of the output of your procedures so one of the big issues or big challenges with trpc right now which is also one of the superpowers is that there's no you know all of the information about what something returns is just there at build time you can't use like reviewer at your seek you can't just review a backend uh a pull request and see that okay changing these things in your services will change the output of this query in this way so it's quite um it becomes a problem where you might actually leak some information that you don't want to leak in a particular place so searching is working on a CLI tool actually that could potentially Auto generate the sort of like typescript that is returned on each procedure so you'll get an actual output validator but you don't have to write that output validator it yourself which is the big superpower of it I'm one of this for so long is specifically at Jake at Railway this was his biggest pushback on trpc and he's starting to come around to it more I think this will push him over the edge also peace Matt thanks for stopping by I yeah I'm really excited that that's coming that reminded me one other thing I definitely want to bring up because it's super exciting and new and people ask a lot about it sorry not Jacob Cloud for Jacob rally my bad Jacob but uh the open API stuff I saw that there's a package floating around now the trpc open API generator I don't quite know how it works but effectively it lets you use your trpc procedures in a traditional open API rest uh workflow yeah exactly so that's one of the other core computer core contributors James that's been working on that and it allows you to build an open API um spec based on your trpc backend you can jump to that I think code explains it better and the only thing you need to really Define extra from what you do normally is that you also have to Define an output schema um in order to describe you you need to add a few extra meta Fields like where does this endpoint actually live in the open API spec and what is the output of that so the open API schema can know what is going to come out of it uh but then after that you just get an open API spec that you can use in other languages um which is pretty powerful uh but if we then combine this with the work that suction is doing we can actually automatically create the open API scheme by just by writing typescript very exciting because because then you have all the information needed to generate the open API schema you have the input shape you have the output shape you have the name of it you'll just have to say like okay this should be accessed at user slash by users slash ID um and it should be requested by a get and then you can get an open API spec from it really exciting I I'm a little concerned about how much you have to put in meta for this to work but if you've like as a team decided to do that this could be very valuable yeah I mean it's for people that don't use TR typescript on both ends that's the way I see it or if you want to do a public facing API um but we'll work towards a point where it's as little as humanly humanly possible for you to Define manually very interesting I ha I have to think more on this one I haven't played with this too much right now I just when I have the rare occasion I need a public endpoint or something else I take the function I wrote into your PC I call it in a new endpoint file and next and now there's a public endpoint but the ability to opt in certain routes to become open API and then generate a doc and everything for it very exciting stuff yeah if you already do it take this for a spin and James is very open for feedback too really good stuff I'm hyped I'll share this link in chat once more for anybody who wants to possibly play with trpc as a solution for more non-type scripty spaces as well all fantastic stuff thank you again so much for stopping by and taking the time especially on such last minute notice for those who don't know I had a cancellation super late or super unexpected yesterday so I had to fill the slot I've owed Alex a chat about V10 for a minute and he jumped on top of this super quick so thank you so much again man is there anything we didn't talk about that you want to touch on now I think I think we're good um yeah uh it's really fun like as always I I like I like my conversations with you and there's the it doesn't happen often enough because of the time differences uh and when we do we might as well just do it on a stream because it might be interesting for other people totally agree and I can tell by that 600 people who are still chilling watching that this was a very interesting conversation having this many people this late is huge so thank you again for stopping by and taking the time everybody here if you're not already following Alex please fix that alex.js on Twitter I spammed his link I'll spam it once more here please help him however you can be involved join the Discord when can people expect V10 is a question I am seeing do you have a a timeline in your mind right now um I think you're gonna do oh we're gonna do a public more public Alpha you know in a few a few weeks and I made the public Alpha it's already stable right like I've already proven it works with my own company's code with all the test examples and stuff and if you wanna if you're eager to play out a play with tier Pacific time just do it now there might be some slight API changes uh before it's you know proper V10 but the V you know going from alpha to Beta to release kind of dirt to uh major is just because I don't want to do breaking API changes it works it's stable if you want to use it today good uh so that would that's not a clear answer but hopefully like you know before the end of summer I was planning on possibly doing and I don't get chat too excited but it I was thinking about doing a code stream after this where I was gonna build a full stack app for the first time in a while do I use V10 100 yes yeah yeah just used start that use that SQL light starter as a starting point no we're using Create as the starter to be clear like creative through app is the only way we start apps on this channel now but I will be porting the create T3 app template that it generates over to be V10 compatible yeah that should be like 10 minutes of your stream so that's easy well considering that create T3 apps take in the first hour of my code streams and eradicated them trading that for 10 minutes if trpc sounds fine all good to me good stuff well thank you again so much for stopping by man I can't wait for this to all ship we're gonna go play a whole bunch with the code now that we can and yeah thank you again so much thank you peace man ## RIP CSS-Tricks (we finally know what happened) - 20240301 where I'm at on the whole CSS tricks thing if you're not already familiar with Chris Kyer he's the creator of a lot of really important things in modern webd including code pen and more importantly in this instance CSS tricks if somehow you're not familiar with the single most important website for most web devs CSS tricks changed everything this site taught us so much stuff I used to joke I would get the CSS tricks flexbox URL tattooed cuz I was there so much like Chris and team's work on this site helped us modernize our CSS and styles to a level where it was night and day the amount I learned from this particular blog post is hilarious they even sold it as a poster because of how good it was oh they're even selling it you could download the highres poster for free had really good diagrams and comparisons to help you better understand how the container behaviors worked and how the child containers worked just detailed piece for piece with really good descriptions and diagrams this was essential I would not have understood flexbox if it wasn't for this page I learned learned so much from CSS tricks I still reference it regularly but it's kind of Fallen to [ __ ] like it's just it's Fallen apart and the reason why is because it was sold in March of 2022 CSS Trix was sold to digital ocean and it's been a notoriously not great acquisition I can't find the tweet I was looking for but I just found these two from Adam rakas never forget digital ocean straight murdered a beloved Dev resource CSS tricks they bought it then abandoned it and aren't giving it back [ __ ] them I'll use Hera before I ever touch anything of theirs people calling out anybody know what happened with CSS tricks I know it was purchased but it seems kind of strange to go totally dark for such a Time funny story digital ocean bought them laid off all of the staff working on CSS tricks and it's now just sitting on the site I'll go back to Heroku before I ever used them for a [ __ ] thing this kind of breaks my heart cuz I was not this anti- digital ocean in the past in fact I'm going to show you guys something that's really important to me the digital ocean posts for how to create a Minecraft server back in the day this is yeah this is the one I probably read status deprecated cool I don't care this article is how I built my first Minecraft server it might have been a slightly older one but I bring this up because digital ocean got me more into code by writing articles like this and helping me not just click a button and spin up a Minecraft server but actually setting it up myself and even though I didn't use digital ocean at the time it got me in and it got me more familiar with their product knowing they host servers and in the future I could use them for it this article and things like it were a huge part of their top of funnel it's how users discovered digital ocean and started using it and as they wanted to compete more with something like versel and less with something like Heroku because Heroku died and versel didn't they realized they needed to Pivot more into the web Direction part of how they planned to do that was using CSS tricks as a similar lever to what they had built here with their previous documentation and tutorials the same way they were able to build a thing that got me to figure out what digital ocean was they wanted to build a thing to help like my audience figure out what digital ocean is and CSS tricks seemed like a shortcut there turns out it wasn't and I want to talk about why well I want to talk about Chris Ker's exper experience as to why it was March of 2022 when I sold CSS tricks to digital ocean so it's been just about 2 years now this was me and my wife's thinking point one the negotiated sale price was fair point two that a big company a public one even with tons of resources and their clear stated strategy was to invest in content and Community because that's where the top of funnel is and it's good for their business they didn't just talk this way they were obviously investing in content and Community there's a chance CSS tricks could have become better again I agree with this especially with their history of investing in content as a top of phunnel this makes sense they were already decently wellknown for good content in devops and backend for missing solid front end content filling this Gap made sense yes checks out I swear I didn't pre-read this they'd be able to rip the ads off the site there would only be one ad use digital ocean I'm no advertising hater it's always been good to me but the thought of CSS tricks as a clean AdFree site was appealing they'd keep on Jeff the lead editor if he wanted it he did and they did I was way way way too busy to run the CSS trick site and also co-run code pen and it was hard on me as someone who runs a YouTube channel in multiple companies and also does investing fully sympathize after the sale things seemed kind of fine for a bit and that was encouraging it was cool seeing new voices publishing new work I had nothing to do with then started to limp using up the momentum that it already had a year later they fired Jeff along with everyone else working on content and community that was the real torpedo it seems digital ocean got excited when the whole industry started doing huge layoffs and they followed suit and slurped up the profits the necessary directional change was screw content in community a month after that the the last article was published on CSS tricks an overview of Pas Keys which will now apparently be on the homepage forever very strange bit of content to em blaz in on the tombstone of the site they also added a cookie button that looks like a fourth grader designed it and started publishing every blog post as a guide yeah how do I feel about all that well I'm not stoked but I'm an adult and I knew the risks I sold the site they now control it they can do whatever they want with it they could replace the entire site with an H1 tag that says Chris coyer smells like donkeys and that would be within their rights I've heard from plenty of people who are pissed some are pissed at me sellout yada yada but I'm actually fairly pleased that the site is still online relatively untouched and with everybody's byy lines including my own intact that's a better outcome than scotch.io purchased from Chris Sev which was neutered and ultimately turned off that's a much more in glorious ending and I hoped it would never happen to CSS Trix hopefully that doesn't happen although during my 3-month Consulting period I know they were very interested in importing the content to their own internal static site generated system someone who's built a lot of SS G powered sites and also a lot of Wordpress sites all I can say is that CSS tricks is word pressy as hell and I cannot possibly imagine a conversion that maintains any level of quality is being worth the effort a lot more people are pissed at digital ocean people saying they'll never use them again and are generally upset that they take such a useful asset and do nothing with it aoid in the industry that doesn't sit right but does any of this negative sentiment actually affect digital ocean meaningfully I have no clue it can't help but I'm sure if it was that big of a deal that prioritize fixing it somehow seems like it's more of an oh well you win some you lose some shrug it off it's almost certainly not acting as the strong top of funnel player that they were originally hoping for it's kind of funny that the goal of the purchase was to introduce more web devs to digital ocean in a positive way and let me know in the comments if this is the first time you've heard about digital ocean because I'm sure it is for a lot of you and it's certainly not an opposit light obligatory if you're looking for something like them Railway seems pretty cool you also have render and fly and if you just want to host a website I'm obviously a big for sell fan boy anyways back to the article I bet you could guess all of that or piece it together from things that are publicly said what you probably didn't know is that I tried to get it back oh that's a huge twist okay strap in boys I got an email from a fellow a while back who's now a VP of content and community at digital ocean who came over from the cloudways acquisition I think ownership of CSS tricks kind of fell in his lap after some internal shifts unlike his predecessors he didn't have any Hang-Ups about just talking directly to me what he originally wanted was to just learn what it's going to take to get spun back up up in producing again a return on investment is what he was after understandably I was as Frank with him as I am with anyone it's going to take a lot they would need a new lead editor and you might be able to see how people might be squeamish about the role with the last one publicly asks not long ago maybe that person knows WordPress development pretty well if not ideally you have someone that knows WordPress pretty well because the site uses everything CSS oh boy I did not like I knew they were on WordPress I did not know they called themselves a poster child WordPress site if I need to make more WordPress content let me know in the comments as I was saying and maybe that person knows how to Wrangle up really good front and specific writers if you find that magical person that's a developer writer Community Builder and site running editor is going to be expensive more likely you got to build a team again and it's going to take them a while to get things going so your investment gets deeper and deeper while the return remains unclear this got me thinking maybe a little braggadocious here but I'm basically the perfect person for the job let's just say the most perfect person on Earth for this job lol but I'm not even sure I'd want to do it again and I have no idea if they would even want me to but I definitely don't want to do free Consulting work on it so I took my big swing here's my best and wildest idea I run CSS tricks again myself CSS tricks is big and complicated anybody walking in the door alone is going to have a serious learning curve just in getting comfortable in operating the basics I already know every inch of it I get people reading again I get people writing again I get people excited again I erase any bad mojo against digital ocean fix that brand damage get people saying they want to use digital ocean instead of saying they never will again I wonder how many of these are Adam rakus Adam stalinsky and OT at least I called one of them being Adam then we do the most valuable possible thing for digital ocean get content on there that helps people know about and do things on digital ocean there are some big wins there astroid is Big right now in front of why isn't digital Ocean on the list let's get this article written and linked up we can make a special section in the site that is just digital ocean content making it easy to browse and find stuff then we can do the second most valuable thing that is possible move the hosting to digital ocean and have it be a living breathing endorsement of digital ocean being a great place to host a WordPress site now we're back in Action why would I do that you transfer ownership of CSS back to me why would you do that you're trying to break even on it that means you aren't spending any more money in time you're just extracting marketing branding and conversion value out of money already spent you don't have to spend any more time on this personally or institutionally any other internal costs are gone and most importantly the community will love it the trick is in the details we' get to an agreement on what has to happen for it to work for example no other web host can be advertised on the site for X time Etc I'd call that a big swing anyway I'll just take it back please and thank you but I feel like I made the case okay and that it's not completely crazy crickets for a while a few back and forth emails like still thinking about this later and the conclusion is that the fella basically doesn't have the conviction to push it within the Halls a digital ocean understandable really I wouldn't want to be handed a huge Golden Nugget by my boss and then asked for a meeting and be like I think we should give it back to leprechaun that's a pretty great quote quot when I pitched that I wasn't even 100% sure I wanted it mainly for stress reasons but I'm sure I could have figured out a way to run a more minimal ship with reduced stress and the site would be in a much more pleasant place anyway if you want to know some more basic information about pass keys I know a site you can check out that's a hilarious ending what a journey thank you genuinely Chris not just for this but for all the effort you put into building CSS tricks in the first place I can't even imagine how much it hurts seeing something you pour that much effort into and get treated this poorly I know you know it's not towards you but that doesn't mean it feels good and it is clear you're putting the effort in to try and make it heartless and uh I have nothing but respect for that I hope the site's archived well enough that if something does happen to it we can still access the resources and maybe repurpose the best ones in other places that are better homes for it but it's sad that it seems like CSS tricks is being left to die at do don't know what lessons we have here other than be careful who you sell to I guess I don't even know if the sale was wrong though cuz he made the money this risk always exists yeah this just sucks that's all I got this time guys um let me know how you feel about it cuz I I'm not feeling great it is what it is I'll be careful who I sell the YouTube channel to I promise peace nerds ## RIP React Router_ - 20221121 routing has just changed forever now it's a bold statement but Tanner is a bold person and routers have not innovated meaningfully in a long time things as simple as query params have been lost in The Ether where next.js kind of throws up his shoulders and just gives you nothing for the first render things like file based routing have taken over the industry and changed where we put our routing but not necessarily much of what we can do with it there have been a lot of cool patterns around data loading with our routes as well but the simple question of when I click a link how do I know it's going to the right place and that it's going there with the right data that's not a question that we've asked ourselves enough recently there are some code generator tools there are some other experiments that I've seen all sorts of around the internet what I haven't seen is someone really go back to the router and rethink using our favorite thing typescript can we make the entire experience of routing for your app safer and more consistent by using typescript as a set of contracts for our router and Tanner has proven pretty definitively that the answer is yes you absolutely can I am so impressed with what Tanner has built with tan stack router this is the first fully typed safe router with first class search params and all of the tools you need to integrate it into many Frameworks right now it's react and preact but we have solid maybe even viewings felt coming in the future there's work being done to add SSR and there might even be some other fun features coming soon I don't know how much Tanner is confirmed publicly so I can't say but uh there are working SSR examples there are lots of cool things here but what I really want to do is just go into the demo and show y'all how great of an experience it is we'll just go to this basic one in stack Blitz here we are here's our route config this is kind of like a trpc router where it's a big config that has all the different routes there's a create route helper that takes a path and a component you can do SUB paths you can have a path that has children that have different routes within it as well and these paths these routes and parents and children and the params you expect within them are combined and the result is a router that is fully type safe so you can provide this in react here just like react router or any other router but your links use the router as the source of Truth so router.link is a link component that is based on this router's definitions so if you try to pass a path that doesn't exist so like I'm just going to do slash fake we're getting a type error here because that is not a real route and if I just do the string here I can auto complete and see all of the different paths that this router knows of that I can route to and from Magic so powerful but once you get into using the query params is when things get a little magical in super cool ways so I have here loader data posts router.use match posts what this effectively says is that posts is a component that we expect to be on this route and because it's on this route the router has loaded this data and now I have this data and I can right click go to definition and it brings me to the loader that defined this I could even do the trick I shared earlier where we can yeah rename symbol to uh post or many posts maybe and I bet this will rename yep here as well magic because this contract exists within the typescript like virtual uh like the typescript AST so this is that same entity that we had in the loader there this is a direct binding to that value since we're importing from the router rather than defining types everywhere we get to just use the types that are there whatever is returned in the router is what we're accessing here and if I change this from slash posts to slash I'm going to get an error because this route doesn't load that data but if I change this the slash posts now it will because it knows that that data exists on that route Magic this makes life building complex applications with lots of nested routes and URLs so much easier or this example where a post a specific post has to have an ID if I remove this parameter we're going to get a type error because this route needs a post ID we put an empty object here but we're still going to get a type error because this needs to have a post ID in it for this route if I delete that it'll be fine but if I have the post ID here it knows ah this is so cool I I don't know how many of y'all have struggled with like needing to move a route from one place to another or building a link component or having links all over your app and then moving one thing and all those links break this is a great way to make sure your links never break your state has what it needs in it and your data is loaded well at a route level one more magic piece that isn't I don't think it's demonstrated here but is super powerful it might be in kitchen sink let me switch over to the kitchen sink example fast we're gonna go into here to the main and a dashboard users sort by ID filter by Theo cool the reason I did all this is it's going to so not show the effect this all has on the URL in here because that's really dumb if it doesn't yeah that's really dumb uh this is a different route this should be a different URL here I also want to Fork this and run it locally open in a new tab it doesn't show paths in that field okay if I open in a new tab I don't even do that that's the wrong thing open a new tab there we go cool here we are dashboard users name filter Theo very cool Irvin so the magic here you see that these query params are kind of chaotic I wouldn't want to be the one translating these and you probably don't either because it's really rough one of the magic pieces of react router is how well it handles query params so you can have path routes in path params so like in here the path has invoice ID so this now in the URL itself needs an ID but you can also create search params so in this case we have the validate search params this is what defines the query params this page can have it can have show notes which is an optional Boolean can have notes which is an optional string and now these are two valid query params that we can have on that route or we can go to the one that we're on right now so if I oops search for dashboard route link dashboard that's I'm too far here and this has a child that should have the search params oh this was that one wait was it no there's another one with search that has like the filter yeah here user's view has uh and this is a sub key so this key is nested in the query params which you can't normally do you can't normally Nest query params but users view equals and that's what the percent 7B does this is nesting sub objects within the query param for this route which lets you have multiple different routes mounted at once with multiple different query params and query param like keys that they can manage nested absolutely magic and you can now move one of these routes somewhere too so I can copy this create route like route instance and move it somewhere else and get type errors all over my code base based on where the URL now exists I'm pretty sure percent 7B probably maps to like open curly and then there's a closed curly on the other side the episode 70 is probably the close but it does that all for you it nests it because by default query frames can't be nested so this is doing Json parsing into and out of your query params there's a library it's using for that I don't remember the name of but it handles all that for you so you're not thinking in url search param parsing terms anymore you're now writing a Zod validator and you're done that's it it's so much easier and it always should have been this easy and that's the feeling I get whenever I play with or look into tan stack router is a wow this is how easy it always could have been it's magic I am so happy with what Tanner has done here the results is magical for dashboards that have lots of like things you toggle and filter on that you want to put into query params this is very useful people have left behind query params because they haven't been easy enough to use all of a sudden they are a first-class citizen sadly this is not there just yet for like stuffing into your next app we plan at ping to use it for certain routes where I'm going to take a route and stub it out and say from here on everything is tan stack router so we can use it for pieces of our app but generally speaking this is a very new thing if you're mostly client-side and you're using react router this is probably worth moving to but if you're deep in like SSR file based routing we're not there just yet doesn't mean I don't think we're going to get there just being realistic about where we're at right now this is still one of the coolest developments in the web dev world of the last many years honestly it's so cool to see Tanner applying his like mindset of solving the problems he has to something as critical to Everyday work as routing I do see so much potential in this library and I'm excited to start using it in my own projects if you build complex single page apps you should give it a shot too thank you for stepping by for this rant if you haven't subscribed for some reason which half of you haven't please hit that sub button it helps the channel a ton you're also probably getting a video recommended right here that you can watch if you haven't like the video for some reason get on that as well ## RIP React_ New Qwik Release Is REALLY Interesting - 20240215 towards quick 2.0 lighter faster better no stronger interesting choice I've had people asking me about quick since my channel started and I don't talk about it enough even though I did have M go on as one of my first ever stream guests he's an absolute Legend he created angular and has done his best to apologize for it by creating quick it's not my thing I have my reservations about quick I specifically feel like the problems it's focused on are not necessarily the ones we should be focused on as we build for the web but it is important that we have people focusing on things like how long it takes for pages to hydrate or how long it takes for things to become interactive and I am thankful for the quick team for pushing as hard as they have but I also am very curious what they're up to in the future because right now it's not super compelling but quick 2 very well could change that so let's take a look at this post by the quick team to see if quick 2 might give me enough reason to finally check out the framework quick Prides itself on having an instanton application with an HTML first approach we have performed a lot of comparison testing and in each case resum ability wins over hydration in terms of JS downloaded executed and delayed before before the user interaction is processed and we're really excited about that resum ability comes with a cost in quick 2 we're focused on lowering these costs further and we like to discuss them here oh boy is this post going to address the fact that resum ability isn't perfect for everything and explain how they want to work around that very exciting for a system to be resumable the HTML must encode additional information point one is that it must encode The Listener location this is in the form of an attribute and it is very small two is asked to encode the component boundaries this bit is a non-trivial amount of additional html text we'll focus on this at the end interesting point three is the application State we're also making improvements here but this will be for a later post okay I'm very interested in a quick post focused entirely on application state that sounds very at my alley they also call out here that they're committed to backwards compatibility so they're not planning to introduce any breaking changes in the 2.0 release however they feel that this is a significant rate of the internals so so reason to celebrate oh boy understanding the application whichever framework you choose the framework must understand the applications internal structure by this we mean knowing where the component boundaries are which text nodes are bound to which Expressions where to insert new rows in a loop and so on this data is a kind of tree where the framework has references to the relevant Dom nodes so that it can update them so how do we get a hold of that tree well there are two choices one is that we can re-execute the application and rebuild the tree from code which is hydration the other option is we can serialize the tree into the HTML somehow which turns out the HTML is already such a tree it's just missing a few things interesting for those who aren't in the weeds enough to know what all these terms mean I'll give a quick tldr when you run a react application that was server rendered you run react on the server and the result is an HTML file the HTML file has all of the things that you rendered when you run that on the server but also has a JavaScript tag that includes the JavaScript for your application for react and all those other things when your browser gets the page it gets the HTML with all the stuff in it and then it get the JavaScript tag that will make things interactive going forward but when you have an on click that you wrote in react how does react no which button that onclick goes to technically speaking it can't so what they do instead is they rerun the same code that ran on the server but they run it on the client so that you can get all of the data attached because the output HTML matches you're effectively running the same code twice once on the server and then afterwards again on the client in order to make things B correctly so when you click a button it actually does it this is far from the fastest thing in the world and it's kind of the thing that quick was built to fight directly they hate this concept of hydration and I'm sure a lot of you do too if you've ever had a hydration error when you had a date time in your component that ran on the server and the client dealing with the mismatch when you run the same JavaScript twice sucks which is why there's so much effort being put in to avoiding that by binding things different ways the way something like quick works is they're including metadata in the HTML so the JavaScript knows which element it attaches to so you need to rerun all the JavaScript just to know which line of code in JS applies to which element on your Dom how it's done in quick version one let's take a look at a minimal component if you're already using react this probably looks pretty familiar you create a component catches you have to use their helper to create a component because of how they do the bindings underneath but everything else feels a lot like react const count equals use signal maybe a little more like solid but same general pattern and then return count colon count out value then we have an on click notice the dollar sign this dollar sign is how you tell quick to bind these things together it's meant to be a signal to the compiler hey we need to allow this JavaScript to run here in this place and then the compiler can bind things properly in the future we then have a layout which is another component that happens to mount the slot which I'm assuming gets past here like yeah main counter main cool pretty traditional stuff the output HTML looks like this we have the top div with a container that has PA as the value render is static SSR version Dev base build yeah anybody's complaining about tailwind and they're also using quick you anyways want to talk about semantic HTML CU this is not semantic HTML at all to each their own we have the main element which we showed above there then we have all of these comments that are in the HTML these might seem simple and unnecessary but these comments are actually how quick Works they're used for the JavaScript to know what is where so it can apply things like this text here correctly when you increase the count it needs to update just this part not count or the things above and below it so they do that by surrounding it with these comments to allow the JavaScript to trigger this tiny little piece inside of the HTML when we look at the button on click this is being bound via the thing we talked about before so as the ID so that it knows which jks supposed to run and at the bottom we have the quick Json blob this blob helps with a lot of the bindings I'm sure they'll explain this in a second right away you might notice that quick needs to create virtual nodes in the form of comments so I just quick need this information well the first part here the example a parent layout component not shown is used for routing parent components create the main element and projects the route content which is the counter into the layout component so the framework needs to know where the component projected output should be inserted quick needs a virtual node for that this syntax here is for one of those virtual nodes which one is this is this the this one ID yeah ID is 7 so this is the second virtual node there's three layers of virtual nodes before count and then a fourth one before the number the second virtual node represents the counter component the component requires component props which are stored in the data section which is in the quick Json thing below the component requires component props which are stored in the data section which is this quick Json bit at the bottom I will say this is not that scary a pattern this is done in almost every major framework especially with the react nextjs stuff where when you pass props to components it needs to know where they are it embeds a little Json blob in the HTML so the JavaScript knows what was put where the additional attributes are used to cross reference the props with the virtual node a key point of resum ability is that one should be able to render a component without the parent component needing to be resumed as well but components need to get props from the parent so the props need to be serialized and recoverable so that this component can render independently of others Qui needs a virtual node for that then we have this third node where the counter component jsx has a top level fragment represented by our favorite empty brackets this is a thing in react as well it's necessary because each component needs to return one jsx element and this lets you take three elements and make them one element and in order to do that quick needs yet another virtual node after that we need to make the counter update work so we need another virtual element because this isn't its own div if we had wrapped this in something like I don't know like a span before doing this might be able to buy into that instead but honestly I would expect another virtual node below that as well and then we have even more of these attributes that are littered throughout the HTML that are serialized state to refer back to the Dom nodes so now let's talk about the inefficiencies the first inefficiency is pruning in the above example the counter component will never be downloaded to the client this is because a user interaction cannot trigger a structural change like adding and removing Dom elements and quick can already update the count signal with without the component present meaning the extra virtual nodes we've been maintaining are not needed the complication is that quick streams the data to the client Qui can't determine that a component is static and therefore not needed until after quick sees the whole application because there could be some component later on that could do some sneaky stuff quick is forced to generate this extra content just in case IDs when serializing data quick needs to be able to refer back to the Domin no for example attaching props to components updating signal values or having references to the components however because quick streams the h as it renders it doesn't know if the data will be needed because it hasn't gotten that far in the Stream and by the time quick is sufficient information to make the determination the content's already been sent to the client one more important piece about the hydration versus resum ability that we've touched on a little bit here is that not everything needs to be hydrated like in the HTML example here does it really matter if main or count are hydrated because these things will never update there's no way for these to change these could just be part of the template so to speak and we only need JavaScript for the button this is how server components work which which is why they're so compelling when something doesn't have clients side JavaScript it doesn't need to be hydrated in the traditional sense because it's just part of the HTML template and with server components use client means this portion needs to be hydrated so you're able to only do the hydration for the parts that need it a client component will still run on server and on client so that code still runs twice but a server component's code doesn't run on the client runs on the server it generates HTML and then that HTML is used as the state kind of to render the correct thing on the client for context all Frameworks need this information so this is not unique to Quick the unique bit is that other Frameworks get this information by rerunning the components on the client side where quick gets it from the HTML so it can resume if you're not already familiar with the concept of resum ability I probably should hammer it in here if you're familiar with hibernation on Windows it's a similar idea where when you traditionally boot a computer you have a bunch of data on your hard drive that has to spin up and run and do things put some stuff in memory spin up run more do more put that in memory over and over again until it has everything you need for your OS and then you open an application and has to do all of that again the concept of hibernation for computers is it takes what you have in your RAM right now so the things that are open and it saves that exactly as is on your hard drive so when you want to boot your computer again it just takes that exact state from your hard drive and puts it back in your RAM and you can skip all of those steps resum ability is trying to do the same thing for the browser whereas I described before with react and hydration you're rebuilding everything on the client after the server has done it resum ability is that you're trying to embed all of the data necessary so you can skip that step and just immediately go to the state of the code being bound again so the same way you're storing however much RAM you have in your hard drive quick is storing all of its state and bindings in the HTML so that's what resum ability is you can think of it like hibernation let's see how quick 2 resolves these issues in quick 2.0 we are fixing serialization issues to make quick even faster and more efficient the philosophy is as follows one move all non-human readable data to the end of the HTML stream we still need to know where the the component boundaries are by moving them to the end of the HTML we can render the UI faster and then deliver the data to the framework runtime point two come up with a more efficient encoding scheme for the virtual nodes in point three make the resuming algorithm even lazier so we materialize only the virtual nodes that are needed for the processing to handle user input further reducing the runtime cost excited to share we're progressing excellently on this front let's take a look at this new HTML div Q container is paused render static version Dev still has all of these state things so that quick knows if things have been hydrated or sorry resumed or not or if they're still in the paused state but there is no more weirdness here there is script type quick State and script type quick v- node interesting but all of those comments are gone finally the output is super clean and yet all the same information is still encoded in the output let's figure out how moving virtual nodes to the end of the HTML this seems to be the big piece here instead of having the virtual node information mixed within the HTML output is now all moved to the end in the script type equals Qui quick /v node element place at the end of the document this means the content rendered by the browser for the user can get to the user even faster recovering virtual nodes quick still needs to have the virtual nodes so the information can't disappear but now it's shrunken to just these nine characters sing Point hdb 1 yeah let's figure out how this works I do not understand initially so here's the state we need to recover so we have the HTML we have this JavaScript and we need to know what applies where so how do we know the signal value is at a certain place in the Dom such that we could update it we need to recover that state note that this is more of a vdom than HTML yes this is the code that runs in quick land not Dom browser land we need to bind it to the Dom so we need to identify the main element we need to identify that main contains a virtual node represented by counter you to identify that counter contains a virtual fragment represented by the fragment like open close bracket we also need to identify that there are three text nodes and the second text node is bound to the signal this going to be tricky because HTML merged the text nodes into a single one yeah we don't have in the HTML here these things separated this is one piece of text but we need to be able to update this bit without updating the whole thing so how do we get quick and how do we get the JavaScript to separate this piece bind it correctly and let us update State let's see how we do it first they use the document create tree Walker API to retrieve all Dom nodes in depth in the first order interesting our Benchmark show that retrieving 50,000 nodes is possible in about 20 milliseconds 50,000 nodes is an extremely large document for comparison quick only has to retrieve the elements whereas with hydration you must retrieve walk and reconcile the elements actually have to render them all which is craziness Additionally the tree Walker API does not need to be consumed all at once instead you can split it over many idle microtasks to spread the load they're already using that API to retrieve all the comments in the current implementation and it's pretty performant that's good to hear the other part is they use ad depth first sequence of numbers to identify each node this way we don't have to assign IDs to them all even without an explicit ID quick and identify any node whether an element or a virtual node it's just a text node interesting there's only one text node so how do we break that up we have ways to identify browser extensions that inject extra nodes but that's a different B yeah browser extensions and the Damage they do to these Frameworks is insane like one fun one that I dealt with when I was at twitch was it even an extension it was the browser translations when you let Chrome translate the page from one language to another that would break reacts understanding of the page content and further updates would both randomly break and often cause crazy infinite Loops that cause huge memory leaks for us at twitch it was something I put a lot of time into figuring out so what the hell is this set of characters this looks like rust code not a binding to HTML the exclamation point encodes how many elements to skip to get to the main element the bracket represents the main element having a virtual element this stores the component props and that information is stored in the script type equals quick State part which they're not covering here again I'm very excited for that state blog post the next bracket is the component element which contains an additional virtual node represented by these here H appears to be used as an index where it tells you that you can go seven characters in for the first node so the first node is Count colon space d is the third zero indexed letter so the next node is these three letters here and then the final node is B which is one so it's the last exclamation point at the end and then the number one at the end represents the number of elements to consume so in this case it's just the button hm think that makes sense I will say zero index letters interesting choice but to each their own and he calls out here that they can store strings longer than 26 characters they can also use lowercase letters to extend the encoding to grab any number of characters the uppercase letters are used both to encode length as well as delimiters for the next encoding saving a comma interesting the uppercase letters let you know it's just that one thing that's that's a very interesting design it's like a pseudo hex advantages by Shifting the encoding of the virtual nodes to the end quick can now perform additional tree shaking of the data because quick has seen all of the components in the application at this point it can safely apply her istics and remove unneeded data for example it can drop the virtual nodes and their IDs our counter example shows that it encodes all of its virtual nodes to simplify it but still quick would determine that no code path would require structural change and hence it would determine that these virtual nodes are not needed and remove them this would further decrease the amount of HTML being sent and because the new encoding uses depth first indexing no additional unneeded IDs are left behind so let's talk about the lazy virtual notes interesting concept we mostly talked about encoding but there's also a runtime discussion to be had we will not go deeply into it here but we wanted to point out a few things one thing is that the new virtual node implementation uses arrays to store data rather than objects arrays facilitate growing the data you store easily without being penalized you can store all your data for a virtual node in a single array relieving memory pressure another Advantage is that arrays are always monomorphic and have Fast Access under all conditions all this is done to lower the memory pressure of the virtual noes monomorphic performance and craziness around arrays in JavaScript is a hack that a lot of Frameworks use one of my favorite examples of this is react with hooks where hooks are indexed in an array when you call UST State it's not referencing the U State it's referencing an index for that component hooks which is why if you put a hook under an if statement it breaks it breaks because react needs to know where every Hook is in that order so it can call them efficiently without having to find something with some key back to quick though because these points are interesting point two is that the new implementation follows a lazy approach it prioritizes efficiency and minimizes unnecessary work parsing the script type is quick SLV node does not create any ver virual nodes eagerly these nodes are created lazily on an as needed basis to further save on memory allocation the result is that the virtual node tree is very sparse and only contains a materialized view of the nodes needed for the operation in our example only the virtual nodes would be related to the signal not the whole component finally the virtual node understands that the underlying Dom has a single text node and several virtual nodes sharing those text nodes the system retains a single text node until quick writes into the signal node and it is only at the time the system creates new text nodes and spits the text over them how do I simplify this point so when we had count colon number exclamation point that's still just one text node it doesn't matter that it can be three nodes until we click the button and it needs to change so we don't evaluate that until we have the potential to do that so until the button on the screen and it is loaded as JavaScript that binding doesn't exist and it's just one node the virtual nodes come in when necessary to trigger the update coming next is data serialization we haven't discussed changes that we are doing to the data yet that will be a topic for another blog post but these changes are equally as important and as interesting a deep dive as well exciting let me know in the comments if I should check that out when it drops exciting future for the quick Community before we end this 2.0 teaser blog post we wanted to also share another thing we're planning for the upcoming version during the past few months we ran a few surveys and gathered feedback from a lot of you quick developers in our community we asked what you loved about quick and what you thought could improve the most common feedback we got from you was the following one you want more quick ecosystem projects like a component Library two you want quick to feel more like a community project and three you want even more activity on the core framework I'm going to call this point out in particular CU something that's always frustrated me and a slight Prime call out here a lot of creators that aren't as deep in the react ecosystem like Prime seem to think the prolification of react packages is meant to Showcase a failure in react like the fact that we have popper and then a react popper binding or we have hsjs for video and then react hsjs for react suggests that react needs these helper packag is to have good experiences with these things where something like spelt doesn't which is why we don't see those packages that's a lie that's a fundamental misunderstanding of what's actually happening here every framework needs some amount of massaging in order to attach these other packages that exist in vanilla JS land to our framework in a meaningful usable composable way the difference is a combination of react making it very easy to do that in externalized package and the size of the react ecosystem meaning we have a lot of these Solutions already made the reality is that the react hls pack package is very similar to what I would have had to build if I was building it myself the fact that it can be shared in a compartmentalized composable way is one of the biggest strengths of react and spelt couldn't do this because of how weird their way of binding equals is you couldn't have something you wrote outside of a spelt file update things inside of a spelt file unless you bind listeners in the spelt file because the way listeners work at spelt used to be with the equal sign this is why runes are so exciting because For the First Time spelt can actually have composable packages that you install in your project without having to do a bunch of weird bindings to just do the thing so finally spelt can have these wins too and with such I would expect things like the Shad UI equivalent for spelt to get much more love and attention in the near future even if the spelt Community is pissed that runes look different quick from what I've seen from its design doesn't necessarily have these problems and is a little more similar to react with how these bindings work so they should have this ecosystem they don't have enough developers to have it just yet so we'll see where it goes it's cool to see that the team is focused on helping with quick UI now which is very important I can't think of any other major framework where the core framework team is working on a UI library for it I am curious how much is this meant to just be their equivalent well they have a headless kit is it just headless do they not have a designed version makes sense still very very early apparently it's radx based or it's just their radic equivalent yeah these things are hard to build and they have to build the whole thing from scratch in order to catch up so uh best of luck to him we also decided to listen to our community and to make Qui feel more open to more contributors and companies who' like to support his development seems like they're working on some fun things for the community I'm curious to see what that is I was just corrected by Jack Shelton who is one of the quick UI contributors who pointed out that the core team's pretty hands-off overall with quick UI still I'm curious if that's going to change as things go forward with quick 2 but yeah that makes sense I appreciate the work you're doing a ton like those are the unappreciated pieces that are necessary for something like quick to be relevant so huge shout out to jack for the work on that hope the team continues to support you going forward quick shout out to Builder iio they putting a lot of work into this and it's cool to see a company that's building useful tools for developers also having major stakes in the general Dev tool ecosystem even if Quick's not for me I can respect the work the Builder's doing good stuff think that's all I to say about quick for now if I should talk about these other things in the future let me know but I'm curious what you think is quick exciting is it weird is it scary or just something you don't really care about I'm curious as I gauge which content and which Frameworks I should be talking about more going forward so let me know in the com comments until next time peace NS ## Rails Deserves Better. - 20240601 if you want to know why an app needs JavaScript on the client and can't just do it all on the server just look at hey or any other Hotwire app this is a great demo of a very slow popup and bad interaction and I'm sure dhh is going to have a totally normal reaction to this like 100% totally normal right right I actually made a bingo Board of all the things I expect dhh to do when he overreacts and let's see how many we hit uh calling the content disingenuous check bringing up no build for some reason check bringing up his cars for some reason check bringing up a blog post about how rich he is for some reason that has nothing to do with anything here check plus I I don't know why he's like this but I don't want this to be about DH because the thing going on here is so much more interesting than his dated weird takes that he loves to preach about I honestly thought he would be reasonable with this one you know like HTM X was nothing about the hyper media driven approach includes including this new event UI in the original request and showing it with some scripting HTM X is not anti- JavaScript why can't they just be honest like this in the rail side or you know like our friend Taylor Orwell a very sizable percentage of new laravel apps are paired with react or view on the front end linking inertia JS which he regularly cites because we love react view spelt and more and we've created super easy ways for you to pair them with your LEL backends without losing your mind yeah they understand that having good client experiences is important and when you're interacting with your application you shouldn't be blocked on the speed and latency of your network first I need to Showcase just how bad things are and not with the artificial just slow 3G like they're all saying like your internet's fast right speed is a more complex thing so I'll have to break that down as well then I'm going to Showcase other technologies that do this better and why but we're not talking about the rails backend performance as embarrassing as it can be at times because I don't think it matters that much there are plenty of ways to scale your backend you can spend more money you can spend more servers you can do lots of things to make your back end faster but you need the right Technologies in order to make your front end faster and to be clear I'm not saying you can't do this with rails we did it for years at twitch using emberjs for the front end and rails for the back end what I am saying very very definitively is that if you don't have some JavaScript in your client you're not going to have a great time and I don't just mean like an all-in-one bundle like HTM X or live view or live wire or any of these types of things certainly not Hotwire what I mean is application specific client side JS if you're not putting any JavaScript code in custom for your app you are making your users experience worse the amount worse is Up For Debate and Depends a lot on the application but I want to showcase just how bad it can get when you have an interactive app like hey so let's give it a shot I had a hell of a time signing back up for hey because I didn't verify my original like recovery email and they seemed to reset my password for me which makes no sense I use one password I had a randomly generated thing nothing no reason to reset it they knew that my old account existed but they wouldn't let me reset it so I just signed back up and had no issues using the same email address I had signed up with before which I find kind of funny seems like a security issue if somebody doesn't have the ability to get back into their account someone else can snipe it eh it's each their own oh look at that it doesn't know my signin State when I'm here and I click sign in it goes to what I'm assuming is yeah an entirely different app. hey.com cool hey is an email app built by the people who created rails and as such I would like to think it's a good Showcase of rails I will be honest though the people who made nextjs have one of the worst xjs dashboards I've ever used with the versel dashboard so goes both ways I'm not going to sit here and pretend that just because they made the framework it's perfect and everyone else is going to suffer with these problems but they should be considerate of them at the very very least so if I hop over to the calendar I want to be very clear here I have no throttling on no VPN on I have a gigabit internet connection in San Francisco basically as ideal as you can get and we're still going to see a little bit of Jank as we move around this application so I made this test event here I can drag it over and then we have to where it lags out a bit and then shows where it goes and this is again with a gigabit internet connection I can hit plus here and did you see the pause for a second when I had the empty thing that was the wrong size and then expanded to be the right size also my favorite here watch when I open this up watch the like section here with the today and such you're going to notice something do you see that temporary flicker of the wrong content there good old content shift what there's this meme that like webdev is copying the way things were 10 years ago wouldn't it be nice if the people who are building things the same way that they did 10 years ago could learn some lessons from us like you know the larel guys did or The Elixir guys did or any of these other communities did the rails guys just refuse to acknowledge their way of doing things doesn't work great all of the time like this is just so Jank and this is again zero latency gigabit internet as close to the data center as you can reasonably get but I want to be a little more uh a little more challenging for this so we're going to hop over to the net work tab we're going to switch to slow 3G and we're going to run this again I command shift art so we have to load everything we're waiting we're waiting page is almost done loading cool now the page is loaded still loing more content that's fine and here we are we have the page let's hit this plus button again now that everything's loaded now I know I know dhh said this guy forgot to share in the clip that he artificially throttled his browser to 3G yes he did and I agree these throttles aren't the best way to represent bad internet connections we need to talk about internet speed because there's this assumption that internet speed is just the raw throughput like the amount of megabits or megabytes or whatever you want to say per second that is not all there is to internet speed there's effectively two specs when you're talking about internet speed imagine a pipe so we have this pipe and we're pushing I don't know water through the pipe there's two things that determine how much water gets moved the first thing is what we'll call latency it's how fast the water is actually moving so the speed of the water and the amount of movement the water has that's your latency so if you're going to a web page the amount of time it takes for that website to respond is a separate thing from the bandwidth you can think of the bandwidth more like the width of the pipe how much data can fit in the pipe how much can it move but then latency is how long does it take to go from A to B these are different things and it's very important to note that when you're using browser tools like this there is no way right now to artificially through the browser Force latency you can force lower bandwidth constraints by hitting these buttons but my latency there was exactly the same as it was Prior so how do we fake latency because I think it's important to do that because as I said here I'm on a really good internet connection in the middle of San Francisco maybe we should simulate being somewhere further away turns out there's a great way to do this I have a thing called a VPN I just have Nord on here I know I know I use mulot on other things but this is what I had set up here so we're going to use it I'm going to connect to Brisbane Australia okay according to chat I can simulate latency that's a somewhat new thing and I don't trust it I don't trust most of the the latency and bandwidth throttling stuff you can do in browser cuz it's all done very uh weirdly I want to be clear here though I have none of the built-in throttling we have no throttling selected I'm just connected to Australia so let's see how this performs now I'm command shift ring so that I wipe everything going in 3 2 1 now waiting not too bad because again this is just a latency hit so the data still comes through there's like the penalty for how long it takes from the first request but the rest comes in pretty quick after that so let's play around again let's start with my favorite test the test event I'm letting go of it now that was a solid second and a half move back over isn't that great let's have some more fun I'm going to move it to Wednesday then I'm going to move it to Thursday right after or Friday let's see which one it gets persisted okay it persists in the right order at least usually hopefully now we got in a weird State this is the issue when you have latency like this you don't actually know if the thing you're trying to do happened or not oh God that was real bad I hit that and it took forever to come up so I'm going to command shift R again so I clear the cash because UNC is realistic let's be fair let's hit the plus button again I'm clicking in three two one that was bad do you see the flicker still too it happens like half the time oh and it comes way later what happens if I start typing before I do that okay I started typing and then it bugged out a whole bunch that was great go back here if you start typing right when you see the UI instead of waiting a second you might trigger other things that's super cool that's wonderful I click that I start typing even though I saw the new event it's triggering hot Keys that's horrible experience so I'm going to wait now I can start typing this is so fun and again if I move it around takes its time to get there and if I go over to the VI it's not as bad not great but not as bad why is it sending a request on every key press is a question we just got from chat and that's a great question that's cuz that's how it works so I am sending a message when I make this event are you kidding LOL genuinely something special I actually can't believe it is like this one of the things dhh tried to push really hard is this idea that other Spa like things are going to be just as bad like Google Calendar that was not my experience at all so let's give it a shot now I have a calendar with nothing in it so command shift aring now remember no throttling just the latency of going to Australia so if you were in Australia this is like maybe twice as bad as you would expect there because I has to do the round trip back and forth but if you're anywhere that has latency for any of a billion reasons this is a real realistic thing so let's hit the create button CU that's what they're saying is really slow huh that opened immediately let's click event that took a second but not even that took like 200 milliseconds and now it's right here and if I make a new event it's not going to log a whole bunch of things on every key press when I hit save it will post it have this nice little saving UI event saved now I have this event and I can drag it around it still lags a little bit when you first drop it but only the first time for some reason which was interesting every other Dragon drop you do from that point happens instantaneously if I knew why I did that I would tell you but overall this is like a comically better experience it's hilarious and again to showcase the difference anyways thankfully none of these problems actually matter because according to dhh it's also find to make the argument that if you're somewhere in the world without a modern internet connection you shouldn't use the web at all for calendar or email but hey never had a lot of customers in the Amazonian jungle or the Arctic or whatever or wherever else that may be really really this is like you guys know the the meme of like JavaScript devs making really slow sites because they all have really expensive MacBooks and really expensive phones but sadder than op's original deceitful clip is the spa stands who appear to buy any tortured argument that the the web must run on Json instead of HTML motivated reasoning suspends basic questions like how would hay sell anything if it worked like that all that being said I totally agree that speed is a feature we are putting the final touches on a data center Outpost for hay in Amsterdam to speed up the whole thing for all of European customers for example that's completely orthogonal to Json versus HTML though okay let's see what this is like to use in the EU then I'll quickly switch my VPN over what's a good European country I can use France now I'm in France command shift daring no moding taking it time to even start that's fun cool now we're in in France this time drag and drop same experience add a new event not too bad but still pretty rough if I close open and start typing it still just does random but if I open wait and start typing still sends all the events but at least it works oh that was actually really rough so check this out I am making a new event I'm going to press the enter key to submit it pressing enter now you get no response that the enter key press happened insane actually insane the first time I pressed it I didn't think that it worked because I didn't see a response when I pressed it press it twice let's see what what happens uh I pressed enter twice this time it made two are you kidding are you kidding oh my God how does it how is this serious okay uh I'm gonna make a lot of this event pressing enter as f as I can let's see only got two out that time ah Jesus Christ I need to show twitch chat right now because yeah yeah can I set it to offline and hit enter great question I am offline now nothing at least it goes way faster without the online and if I move to online again nope one more fun thing I want to point out though somebody else pointed this out earlier we have all this JS if I filter to only show the JS we're still loading a decent bid like 651k is not no JS but if I then hit plus here I go back to the JS we just loaded a bunch more JavaScript to do this like quite a bit more if I resize it so we can see where these different requests happened I'll just refresh and do it again CR shift R to force it to be cleared God also just the sheer number of JS files this is your brain on no build I'll hit the plus do you see all of the JS it had to load to make this work anyways like if you're going to load all this Js to make the input decent why not just load the extra JS like why do you care so much it's just kind of insane to me that this is how this would work so I'm far from a local first guy but I want to give them some credit so let's talk about locality of your applications on one side here we're going to say server driven and on the other side here I'm going to say local first your needs for all of these things are going to be fundamentally different things that fit in the local first section would be stuff like notion stuff like vs code stuff like figma where you would expect the behavior to keep working and be reasonable offline even if it does have some online functionality then there's things that are very server driven where like if you're not online you don't really expect it to work like blogs like Bank websites like there a lot of different things you'd want to put server first I'd say arguably most things games is an interesting one uh any video sites like twitch YouTube are fair here where you really want the server to be the driver for it for the most part but there are things you want to make work well on the client the argument I want to make though is that most applications live in the range between these two where there are certain things that you would want to have server driven and then other things you'd want to have local first in fact basically everything here other than blogs I would argue fits under this category where you'd want things to have server driven parts and client driven Parts the issue is that the technologies that became the most popular the ones that were the most recommended I either lived heavily on this side like Ruby rails where everything was driven by the server or they lived too heavily on this side like Spa with react the Ajax era let's take a look quick Chris mord's a legend and I dearly love him and all of the work he does so he'll probably put this better than I could but I talked about this atof last year because I think a lot of us uh we take on a lot of the client side single page app complexity out of good business reasons but we adopting a lot more complexity than we had originally planned because I think if we're actually honest with ourselves at least my experience as a consultant working on dozens of applications and a bunch of different domains I've never had a single app that actually Justified a full client side application solution right like I've never had to write Google Docs in the browser if I had to I would absolutely reach for a client side framework but there's always been just parts of the app that have needed this kind of Rich interactive experience so I think a lot of us are using single page app Frameworks for good reasons because we need those bits of interaction and usually if we have to go in if we have to go all in and buy into a framework because we need to accomplish these interactive business requirements then we have we have no choice but to buy into the complexity agree with everything other than the complexity part like single page apps can very much be less complex they have costs but the costs aren't necessarily like this is so much more complex and hard to work with a lot of the things we use with single page apptech are less complex and then other things on the server side can be more complex too these things are not as simple as that suggests but everything else here I totally agree this is a spectrum and I also want to be clear just because I'm about to draw these different Technologies in different places in the Spectrum doesn't mean you can't use them for other things or even that you can't make good experiences using them for other things it just means it's a good bit harder and we need to acknowledge that let's try to show what I mean here by doing like spectrums so as a simple agreeable example of a local first Spa type technology I'm going to put angular here hopefully no one's going to get mad about that right if only the angular Community would Embrace serers side stuff and not just poor Brandon Roberts doing it himself anyways so angular is a technology that works well in the local side but as you go more and more server driven angular's not going to help you out and on the other side we have something like rails which is very much server driven there are Technologies like Hotwire that let you have more client behaviors like navigations that suck a little bit less so I could put underneath here rails plus hot wire thankfully even though that doesn't fit there anymore it doesn't matter because we're actually going to extend the Box something like Hotwire lets us go further and further into the territory of the things we were talking about prior so if you want to have a little bit more interactivity if you're like interactivity Target which is a hard thing to Define but if the amount of interactivity you want comfortably fits like to here rail is a great solution as long as you have something like hot wire for it but as you get more and more interactive this solution starts to break down and the further you go in this direction the more pain you're going to feel the same way if you try to like do something that's really server driven and like a Blog and angular if you go too far this way using angular you're in for a bad time if you go too far that way using rails and hot wire you're in for a bad time too we could also put something like laravel in here let's make this green sound like a good color for PHP hopefully you take something like laravel here and you could use laravel plus it's not live view it's Live Wire right is there equivalent of hot wire and live view where laravel plus Live Wire might go a bit further but they have a better solution here too laravel plus inertia you saying Live Wire is further than hot wire that's fair but I wanted to highlight inertia because inertia goes very far because inertia lets you bring in things like react or angular or view or other Solutions because laravel recognizes there's a line somewhere where we can't provide the best client experience anymore so what if we build good Integrations with other things that handle this side better what if we create a bridge between these another way to think of this is not that LEL plus inertia goes that far it's that it's a bridge between things like react or angular so if I put react down here what laravel and inertia effectively allow is for you to create a bridge between the two that is a really convenient experience that kind of gives you the best of both and if you want serers side focused developer experience but a good client experience as well in these more client heavy things cool these Solutions exist now I'm bringing up react here for a reason because previously react very much was in the same space is angular but now that we have server components we're stretching really far the other way now too react plus RSC allows us to do much more server driven stuff which is huge but if you want to just have static Pages or the dumbest possible end points server components are not going to get you there because they defy a lot of the ways these things work in our heads and how they've worked over time we recognize in the react community that there's good things from the server side the larel community recognizes there's good things from the react side there's other Technologies too like HTM X which I find really interesting because HTM X effectively lets you build one of these Bridges to itself where you put HTM X as the layer on top of something else like you could put like go here you could put rust here you could put even larl here and then use HTM X as the layer to make this more interactive you'll never get as far as like react does but if your goal isn't to be all the way here rather your goal is to be like here HTM X might be enough to get you to where your goals are which means you don't have to adopt client side JavaScript Frameworks at all and if it turns out you actually only need to be here but you have like one single feature like just one thing you need that's over here even though the rest of your application exists in this area you can pull in another reactor javascrip framework or you can just write some manual JavaScript or hyperscript I know that's what the HDMX guys like they are yourself they actually have a whole blog post about this that I might make a dedicated video about I think it's really cool it's part of their set of chapters whatever you want to call it the uh what is this called the hyper media. systems and they have a chapter on client side scripting rest allows client functionality to be extended by downloading and executing code in the form of applets or scripts this simplifies clients by reducing the number of features required to be pre-implemented common criticism of the web is that it's being misused there's a narrative that www was created as a delivery system for documents and only came to be used for applications by way of accident or bizarre circumstances however the concept of hyper media challenges the split of documents and applications fundamentally hyper media systems like hyper chat which precede the web featured Rich capabilities for active and interactive experiences including scripting yeah if you think this is good let me know in the comments I can make a whole video dedicated to it cuz I think this is a great post and again the HTM X guys are on the right side of this even though our Tech couldn't be more different and we're not shipping the same stuff at all it's weird to me that people think rails and HDMX are on the same side because rails is stubbornly trying to convince us that everything from this point forward is dumb and shouldn't exist that is the rails opinion I shouldn't say that's the rails opinion because there are good people in the rails community that are just using it for apis but when you are blocking this whole side of the application world because you think you're right and you think we're all doing something stupid because you hate the idea of building your JavaScript code so much it's kind of insane to me again if you're okay with your experience for people who aren't right next to your servers looking like this looking like test event pressing enter three times and getting a pile of new events added if that's within your expectations for what your experience should be like awesome but if you're expecting more for your users or your users are expecting more from you you need to do some client side JavaScript period the solutions of the future aren't the ones that say we're going to live here figure out the other stuff yourself that's more what angular does or what rails specifically dhh does which says everyone on the other side is coping and wrong this is the only reasonable way to build at scale people who are on either one of these sides are wrong the people who are building bridges between them things like inertia things like server components things like HTM X these are the winners of the future the winners aren't the ones who can't stop saying the other side is never going to make anything of value the winners are the ones who look at what the other side is doing get excited about it and use it as a way to elevate their own side and their own stuff too Apple copied the idea of react components with swift UI laravel copied the idea of live view with Live Wire these are good things that is awesome the whole ecosystem gets to move as these ideas are discovered and these experiences are created and the bar for what a good experience is continues to go up the reality is that a website like hey if you could somehow send this back 10 years would seem really really cool but the bar for a good experience on the web now is significantly higher like significantly higher and that's the issue I have if this was like a Trello or can ban board this would suck if this was an email client which it is it kind of sucks how many requests are we sending cool not that many I pressed command plus twice let's check the scent to see if I sent that twice how do I even get to my scent in here is it in here sent where are my sent messages I just sent a message okay it only sent once so they are debouncing some things what just happened there that was like I didn't click anything that just did a navigation okay so I'm going to Showcase superhuman which is an email app that sucks a lot less they actually require you to have a Chrome extension because they want it to be such a good experience in the browser and I will say I'm going to have to show this off in a second the loading times suck because the first time it loads it has to load a bunch of stuff so here is my email inbox this is using an awesome app called superhuman superhuman is a web-based email I'm in the browser you can see here mail. superhuman docomo things even when I'm offline so I'm going to prove that by going offline Network go offline now I'm going to open up this email even though I'm offline I can still open the email I can close it I can navigate to other emails I can go to another one here and all of this is working I can even archive emails but it says here on the bottom good news superhuman Works offline messages will be sent and received when next online let's prove it I'll go to slow 3G it's pinging it's realizing it can do things now now it's starting to do those things I do a lot of email nowadays I do a lot of email on planes too superhuman means I can actually get a bunch of email done on a plane that is dope that is awesome most things don't need this type of local experience I agree but email in particular I have found to be one of the best options for a product that benefits a lot from having a good local experience it's awesome it's become an essential part of my workflow and even though they cost like what 30 bucks a month I would never even think about doing email without superhuman anymore and this is just one of the reasons why their ability to charge a premium is because they have a premium experience and their premium experience exists because they went all in on good client side stuff by not ignoring client side they made something awesome and it is actually hilarious to me that anybody would think email is an app that is totally fine to require a low latency gigabit connection and I'm not a big local first guy I generally think local first is overblown but it's insane to me that anyone would think this isn't a good thing I'm curious what this take is and it was sent by Ryan and tweeted by Ryan so it has to be good if someone was going to build a an app like that with laravel they would definitely choose inertia every time like they would never try to do it with PHP or even with Livewire I think if you're going to try to build something like as High Fidelity is something like a linear or a real a good I can't do anything about the volume guys blame Dax and crew for keeping things too quiet there's nothing I can do about that but uh I'll summarize the take it's if you were going to build an app like that I don't know what they're referencing nobody in the LEL Community would do that without inertia like if you need something interactive you're building something that is heavily interactive obviously they're going to reach for the technology that makes more sense there and honestly that take and the general way that the L guys have been positioning themselves is making me pretty hyp oh they're actually talking about hey calendar that's even funnier thanks for the context there like the thought of doing something like this without good client side experience is just kind of insane to me and it feels Rich coming from the people who said running JavaScript on the server is stupid to say that running JavaScript on the client is stupid like if you hate the language just say that and obviously the person who forced coffee script on their entire ecosystem is is not a big fan of JavaScript cool that'll make sense I'm just annoyed I have not covered this part yet this is also a good point that uh egoist made love this dude every time you click a day in hey calendar it makes some API call to fetch 2,000 lines of HTML and then it spends 2 seconds in Clone node to update the calendar like if you hate JavaScript why are you running JavaScript much more than almost any other application I will say that running profiling does throttle you get way worse performance when you're running a profile and when you're not but that's still insane their arguments always been shipping JavaScript is too heavy but they're shipping more JavaScript files and those JavaScript files take more to run and require bigger payloads on every side it's the worst use case of the hyper media thing absolutely and I would hope that like the HTM X guys would come out and say yeah if you're building this do more of the work on the client side like we don't need this to be on the server side because more and more of the community is starting to realize these things the same way that react realized we need to be more on the server side laravel realized we need ways to get better experience on the client side and bed tweeted comparing notion calendar which is actually very slow and just loading with uh yeah just VPN no throttling this is a comparison of load times on what I would consider a slow calendar which is the notion calendar against the hay calendar just VPN no additional throttling just additional latency notion one's pretty slow we're still waiting on the hay one that's insane wasn't the whole point that by doing it server first we can get that first paint faster because I'm not seeing that at all here actually seeing quite the opposite of this here or just in your own mind I would like to believe if I could get dhh to try inertia he would just delete Hotwire that what I like to believe because I I think um I do think like he's it's holding rails back um and I love DH is my hero and I hate to say it pains me to say this but um it's holding rails back on and you could hey calendar is the perfect example of how and like why it's holding rails back Taylor are we best friends now because I think we're best friends now that was beautiful that was better than I could ever put it another great one from Dax which as you guys know Dax and I do not always agree on what is best here we like very different things but we still ended up on the same side here because people are choosing the way they like to develop over the way the users are going to use the thing in the words of Dax I hate JS I continue to write a ton of it because it's how you deliver high quality apps you can escape it for some products but never for productivity apps yep I got nothing else to say here this is a fun one I appreciate everyone from all of these communities that aren't dhh even people within the rails Community for coming out and saying yeah client side JavaScript does make a lot of sense and using hey right now does kind of suck I totally agree with Taylor I even agree with Dax I think we should embrace clients IGS where it Mak sense how much we should embrace how we should do it what Frameworks we should use all of that those are fun ways to bicker and fun conversations to have but which framework you choose is a different conversation from if you should have client side JS at all and the people who say one of these sides is always wrong that's the only bad take you can have here as long as you embrace the value of the other side you're going to come out on top eventually but if you pretend the other side is always wrong and that the way they build can never work you're just going to make worse things so until next time go try out live view maybe just maybe play with the Nur server components too peace nerds ## Rate Limiting - 20250506 Rate limiting is hard. There are some quick solutions, but as a problem overall, this is a complex topic, and I'm really excited that a community member actually wrote an article about it. I've been wanting to read this one for a while, but we're finally getting the time to do it. Let's take a look at visualizing algorithms for rate limiting. Why rate limit? Imagine a Twitch chat with many active participants and just one spammer. Who who could ever imagine that? Definitely not experience I've had before. Without rate limiting, the sole spammer can easily dominate the entire conversation. With rate limiting, however, each user has a fair chance to participate. Yep. So, right now, the spammer is sending tons of requests, and every other user has some going in, but you can barely even see them in chat. A rate limiter lets you control the rate of traffic that your service is processing by blocking requests that exceed a set limit during a period of time. So, think of that like you have every 10 seconds you can send one message. There's actually a setting for that on Twitch where I can do chat settings slow mode, which is effectively rate limiting built into Twitch so that when I check one of these options, then you can only send a message every 30 seconds or 5 seconds or however often I choose, which helps keep it so that individuals can't spam chat quite as hard. They even have some good examples here. It's useful beyond just throttling spam and chat. Like if you have something like a login form, you don't want people to be able to brute force and just spam until a password gets guessed correctly. So every time they try to get in, you limit how often they can do it. I was actually trying to get into a site yesterday when I signed in, I typed things correctly, but it auto hit enter for me effectively when I used one password and then I hit the login button. So it sent two requests instead of one and I got rate limited and I wasn't allowed to get into my account for another two minutes. But that's terrible as a user experience, but also important because it means people can't just spam passwords over and over to try and break into your account. API endpoints are also frequently rate limited to prevent any single user from monopolizing resources. Imagine that you want users to only be able to hit an expensive endpoint a 100 times per minute. You can track the hits with a counter that resets every minute. Any request after the 100th within the minute would get blocked. This is one of the simplest rate limiting algorithms called the fixed window limiter and it's a common way to control traffic to a service. Yep, very very common. I use this in a lot of the things that I've demoed and the products that I've showcased in my tutorials and my previous videos. Using something like Upstash and their rate limiting SDK lets you set this up with like three lines of code. And that's enough for a lot of things, but not for everything. And I'm excited to see how this article breaks it down. As they say, it's not always that simple. When does each 1 minute window begin and end? If I begin a burst of requests near the end of a window, can I exceed the limit? Is Windows capacity restored one request at a time, or is it restored all at once? In this post, we'll explore the three most common algorithms to answer each of these questions. I actually don't know the immediate answer for this, which is interesting. The three options are fixed window, sliding window, and token buckets. Let's figure these out. Here's the fixed window example. A set number of requests can be made within a predefined time window. Requests increment a counter that's reset to zero at the start of each window. So notice that this time window starts regardless of when you send something. Regardless of when a request happens, this window is an existing time frame that just exists via something like a cron job. So we know this happens within this window and then messages happen to be sent. You even pause requests and see that the window stays exactly the same even with no requests happening at all. I can also spam hit and see the result too. This is a really nice visualization. What are with all y'all insane devs and your crazy visualizations lately on these blog posts? So cool. So yeah, the pros are that this is simple to implement and understand and it's predictable. Predictability is not necessarily a good thing, as I'm sure we'll get into. The con is that this allows for bursts up to 2x the limit. So yeah, if we're getting near the end here, that once we get close to the end, I could spam and then immediately start getting requests going through again. So you actually can do really bad damage in those short windows because you can up to 2x the damage in that frame. There's a real world example of GitHub's API which uses a fixed window rate limit of 5,000 with a duration of 1 hour and the start is set to the start of each wall clock hour. So every user is allowed to make about 5,000 requests per hour to the GitHub API. So if you make 5,000 at right before midnight and then 5,000 right after midnight, you're fine. But then the next request is what fails. So you can still send 10,000 requests to GitHub in a two-minute window. You just have to do it at the right times, which is a real risk to consider when you're building things like this. Ooh, there's a tangent about 24-hour windows. Oh boy. Apparently, there's a subtle issue with the 24-hour limiter above. Its window resets every day at midnight, but midnight according to which time zone? A standard fixed window might reset its counter according to your server's midnight or a standard time zone offset like UTC. A user in a different time zone who ran out of requests might retry just after midnight and be surprised if the limit hasn't been lifted since to them it's a new calendar day. For these applications, you need to offset your window starting according to the user's time zone, which has some potential for abuse as users can manually adjust their time zone once they've run out of requests to gain up to one full window of additional requests. Yeah, I I don't recommend doing a 24-hour window. Certainly not sharing that and telling people that the requests restart at midnight. Yeah, not like Twitch does that for certain features and things like the tracking of how often you stream. It's not like the best way to get partnered on Twitch fast is making sure you stream between 4 and 6 p.m. Pacific time because that goes over the 5:00 p.m. window where they counted as 2 days instead of one. Those totally aren't things interesting. Another way of doing fixed windows, which is how a lot of things will do it, is instead of fixing the start time on a set interval, each window can be created at the time of the user's first request within that window. So now if I hit pause, nothing happens. Still nothing's happening. And the window that's 24 hours doesn't start until I do a hit. So now that I've done one, I can do up to however many this allows. I have one request left. And now I get errors until I do one after that first one's been 24 hours. So the window shifts based on not if it's midnight or not, but based on when your last or in this case first request was. But this sucks as well because now I can get more requests if I start at 23. So I'm starting now and I was able to do more requests. But if I wait and I do nothing, so I'm just sitting here doing nothing. We're going past the window. Now I'm going to start spamming. I can only get half as many. So it's actually strategic to do a request every 24 hours. So you can exhaust that existing window before starting the next one. As insane as that is, so is doing your rate limits in this way. Yeah, as the author says, it's especially important to show users the time remaining until the next window once they're limited since there's no set time that aligns with those windows. Speaking of aligning windows, sliding windows, instead of refreshing the capacity all at once, sliding windows refill one request at a time. So here we see there can only be five requests. The way showing this is vertically. So if I pause right now, we've done two. I can do three more. And now we're going to have errors because there's no no space in that vertical real estate. It's actually a really good way of visualizing how this works. And you can see they go gray once that requests limit has expired. So instead of thinking of this as like you have a buffer of how many requests you can do, each request has an amount of time it exists for so to speak and once five requests have that timer overlapping, you can't make more at that point. Well, six here. But now I can't do more because the spot's already taken. But as soon as it's been 24 hours since that first request, then I'm allowed one more than another than another once it's been 24 hours per request. So that's a sliding window. The benefit of this is that it smooths the distribution a bunch and it's well suited for high load, but it's also harder for a user to understand and predict and storing the timestamps for each request is obnoxious to do. Totally agree. Yeah, if you do rate limit send a retry after header. Very much agree. You can see what that is with the MS or the MDN web docs where you can have a 503 or a 429 which tells you as the user hitting the service that you've sent too many requests and to wait till you make a new one. And there's even a retry after header that you can send that can either be a date or a delay time for how long you should wait until you try again. Back to sliding windows. Because sliding windows tend to be most useful in hight traffic scenarios. The fact that the naive algorithm is resource intensive is counterproductive. Shouldn't a hight traffic rate limiter use an efficient algorithm? For this reason, most real world sliding window rate limiters like those provided by Upstash and Cloudflare, they all use an approximation often called a floating window. Using this approximation, we have all the same benefits, but we can remove the resource intensive point from the cons. Here's how that works. As Upstash mentioned, they do these things well. You can count the number of allowed requests in the previous fixed window. You can count the number of allowed requests in the current fixed window. You can weight the previous windows allowed requests proportional to that windows overlap with a floating window ending at the current time. And then you can add the weights from three to the unweed results from two. So if we see how that works here, we have this imaginary window that exists that knows when requests did or didn't happen. And it can use the average between that window that's just last 24 hours and the window that we're in right now in order to make things a little more reasonable to understand and to give users a rough guarantee of when they'll finally be allowed to do things again without having to store all the same data. In practice, this approach limits requests at roughly the same proportion, but it's far more efficient than tracking all the requests timestamps. While the two algorithms will end up blocking different requests, the long-term average number of blocked requests should be very close. You can see below how it compares. I'm going to pause and do the hits all myself. Yeah, it's literally just taking how many hits exist in these two sections and just averaging them based on how much you're in any given one section. So, if we were to spam a whole bunch at the end of one of these here, like that, it's going to weight heavily on that left side because they're all near the end. But if I spam them all at the beginning, I should be good to go pretty soon. But I won't be because there's just so many messages that are backed up there. And it is counting the ones that are outside of that little box because it's just averaging the amount of messages in the two box and using the split of how much each box is currently in view. It's hard to describe, but it is actually a really good visualizer for it. If I spam this one, so we have all these messages at the start there. I'm not going to be allowed to send more messages right when we get into this new box because even though we only have the second half of that box in there, it is still averaging using the values from the whole box. So that's the key here is how recently or not recently it happened doesn't matter. It just matters which window it happened in. This is a really good algorithm for this. And apparently this is how Cloudflare's rate limiter works. They use an approximated sliding window. Good stuff. Token buckets. People in chat were already bringing this up. Let's see what we have to learn about tokens. Instead of thinking in terms of windows with durations, picture a bucket that fills up with tokens at a constant rate. Each request withdraws one token from this bucket. And when the bucket is empty, the next request will be blocked. The token bucket approach has some useful properties. The first is that the capacity of the bucket is the maximum number of requests that a burst can possibly support, not counting tokens being replenished mid burst. The other point is that the refill interval represents the long-term average of allowed request interval. Having distinct bursts in average capacities without the need for multiple rate limiters is one of the main benefits to the algorithm. So here we see it's actually a really nice visualizer. I'll pause so we can do the request manually. This is the request and we get a new one added to our bucket every in this case we have six requests 24 hours. So every 4 hours that sounds right math is easy. So every four hours we'll get a new request in the bucket up to six. I fired one and we just happened to be near that 4 hour mark there. Now I'll see every four hours we get another request added to the bucket. But if we run out we can't do any until it we get one more of those. But the interesting thing here is we get one more request and then we can't send any for a bit. Then we get one more then we can't send any for a bit. Good stuff. The pros of this are that you're allowed to do burst traffic really well too while still having a long-term average. It's also more flexible, which allows for traffic spikes within acceptable ranges. That's also really nice here because if I can do a higher maximum because I don't have to worry about the doubling problem because you can't brute force 12 requests here the way you can in any of the others, especially the traditional fixed window. It's really easy to do things in a way where you have 12 requests really tightly coupled. So, if I go back to the top example up here with the fixed window, I'm going to spam a whole bunch through the end. one two three four five six and then one two three four five six within a very small window I just snuck in 12 requests if we have the fixed window with a userdefined start I can do one request wait till near the end and then now when we're getting to the end I can spam that last five and then do another six that lets you get 11 in that really tight window so you can get effectively 2x what you set your rate limit to with these options with sliding window it's a little bit harder but you can still kind of do it But then with the tokenized version, you can't. The user can't send more than seven requests relatively quickly. And that only happens if they're near that renewal. So 1 2 3 4 5 6 7. Yeah, cool. And that's it. Now I have to wait another four hours so I can do another. So it makes it much easier to define like within this window there is a maximum number of requests that can happen. But the big con is it's really hard to explain this to users. So you can't just be like you can make requests again at this time because they can but probably one request. So, how do you communicate them when more of these tokens get fulfilled? It's a tough challenge. Apparently, this is how Stripe does things. Stripe uses a token bucket in which each user gets bucketed with limit 500 in a refill interval of every 0.01 seconds. So, you're allowed to do a sustained activity of 100 requests per second, but a burst of up to 500 requests. Really good to know. OpenAI's free tier for GPT3.5 is limited to 200 requests a day, but uses a token bucket with limit 200. And it refills on 86,400 seconds divided by 200. So, you get a full bucket every day, but more importantly, math is hard. You get a new token every 432 seconds, which is every 7 and a half minutes roughly. The Twitch chat demo above is rate limited using a token bucket with a bucket size of three, allowing bursts of up to three requests and a refill interval of 4 seconds, which creates a long-term average allowed rate limit of one message every 4 seconds. For what it's worth, Twitch's slow mode is just doing a fixed window starting when the user sends. So, I send a message. Now I'm not allowed to send another message for however long that is and that's per user because we already store time stamps so we don't care. Thanks to the flexibility of the token system, token buckets can also mimic the properties of some of the other algorithms. For example, if you set the refill rate to be equal to the limit and now you have an equivalent to a fixed window rate limiter with a userdefined start. Yep. I don't think I can turn off the automatic here. Oh, it's just constantly going. Yeah. So if you refill the bucket every 24 hours after a request has been made, you effectively have a fixed window again. Good stuff. Didn't think about this as a way to reimplement all the other solutions. Kind of like how in React all of the hooks are for the most part just built on top of use reducer. Like use state is just a use reducer under the hood. Fun fact. Other considerations. If you decide to add rate limiting to your app or endpoint, in addition to selecting an appropriate algorithm, there's a few other things that you should keep in mind, like creating a persistent store for that rate limiter. Yep. If you're trying to scale a rate limiter across multiple servers providing the same thing, you need a place to actually store the information. If you ever intended to horizontally scale your server or even just restart it or use serverless, also an important point, if you're serverless, you can't just have this be a variable. You need to store it somewhere. Your rate limiter data can't be in memory. Popular option is to save rate limiting data to a key value store like Reddus which has built-in functions for expiring keys on a separate machine from your application. You can however use an ephemeral inmemory cache to block requests without hitting reddus while the limiter is hot. Yep. And this is already what's being used by something like the upstate limiter SDK. So just use that and this is handled for you. But good to know. You need to make sure this data is stored somewhere. So if the server goes down for a second and comes back up, it has the context. Also fail open. If your service connection to the persisted store fails, make sure to allow all requests rather than blocking access to your service altogether. Also important, if the Reddus service goes down, you shouldn't block all requests. Ideally, you're letting everything through temporarily. DOSs your Reddus is way less bad than DOSsing your actual database like exponentially. So, also optionally throttle bursts. Throttling can be used in combination with rate limiting to reduce the impact of burst traffic. Very good piece of advice. If you can throttle things and that solves your problem, probably worth doing that. Then you have to fail requests. Also, choose sensible keys. In general, rate limiting is done on a per user level. For most apps, this means keying on the user ID. For APIs, the key could be the API key. What they mean by key here is how you identify what user is being rate limited or what process being rate limited. Because if I have like a rate limit for signing in and a separate one for hitting my API, you need a key to identify which is which. that needs to be unique to the user because I don't want all users rate limited for signups. I want one user or one IP address rate limited. One of the best things to do here is to just use like an IP address. They even mention that here. For unauthenticated users, the options aren't great, but a popular method is to use the requesters's IP address or device fingerprint or a unique installation ID or just some type of shared limiter across all those users. You can also surface useful rate limiting errors, which you really should if you can. As we mentioned before, use a 429 HTTP status code when the request is blocked and include the relevant X rate limit response headers. GitHub has a good example of the header for their fixed window limiter and OpenAI also has some examples for their tokenbased limiters. This all means that when you hit something and you do hit the rate limit as a developer consuming one of these APIs, you can look at when it says okay start again now and just delay until then. Wrapping up, if you need a simple rate limiter or predictable window start time, use a fixed window. If you need traffic smoothing for high volumes of requests, consider the approximated sliding window. But if you need to support bursts of traffic while also enforcing a lower average long-term rate limit for requests, use a token bucket. This is great. So even a fun playground at the bottom here where you can see how all of the different things handle different types of traffic. I love this. This really is like a Sam who article but not by Sam. Oh, it even says that here. Pre-eread. This post was inspired by the amazing load balancing visualizations that Sam's done for his stuff. Also, a huge thanks to OnSClOM for pairing with me on the canvas visualizations. And also a thank you to Upstash for their docs implementation stuff. This was great. This was awesome. Is the author's name somewhere here so I can shout them out or is it just like the company? I wanted to find out who this actually is. Does anybody know who this is or their Twitter? Bone broth, was this actually you? I didn't even see you in chat before. My bad. Bone broth. Is there a Twitter I could shout out for you? Give me a Twitter if you have one that I can shout out. But if not, totally fine. This was great. Thank you so much for this. You don't have Twitter. That's for the better. Do you at least have more blog posts? Need somewhere to point people at? Oh, that's actually hilarious. Email and password off should be a last resort. Couldn't agree more. Seems like we're going to agree about a lot of things by the looks of this. Yeah, hilariously well timed. Regardless, take a look at Smudgeai. Fantastic stuff. Love this blog. really nice to have good information about these things and honestly kind of surprising there wasn't already a good article like this about rate limiting. Let me know what you think in the comments. Let me know how you're handling rate limiting on your services. Until next time. ## Ratelimiting Your APIs With Redis (The Theo-Proof Way) - 20220831 y'all won't stop spamming my web app and now I have to do something about it seriously the VOD for roundest which is the first full stack T3 app I built on this channel way back a year ago sitting with 200,000 plays almost and because of that it's getting spammed nonstop you guys keep boosting Pokemon that are not round to the top of the list and I'm tired of it thankfully we have an awesome sponsor for today's show first time I've ever taken a sponsor because I really want to check out reddis and up stash is the best way to do it so without further Ado let's get into how I used up Stash's rdus deployments to make it so y'all cannot break my app anymore I am so hyped because they make it incredibly easy for us to have fast Global low latency data they did an awesome blog post recently about rate limiting at the edge with Cloud flare workers they have a open source I was really surprised when they said rate limiting SD I thought this was going to link to docs nope this links to an awesome open source repo that only has 18 stars for some reason I can't easily show the star count there it is but it is a super cool package to quickly set up a rate limiter you could so for those that don't know a rate limiter is a thing that runs before your server that based on any of many conditions be it who is making the call how often they have called what IP address they're coming from allows you to decide whether or not they uh request goes through and this allows you to easily on an edge worker add a rate limiter that prevents users from spamming I think this is actually what I want to build first specifically because of all the people who have been abusing roundest recently if y'all haven't seen on uh if I go back to that's the technical interview if I go to the roundest results people have spammed 98.65% Zapdos 78.8 6% Dialga the these are people spamming the end points and absolutely screwing up the uh usage and utilization on my versel and on my planet scale I want that to stop so I think the first thing we're going to do is make that stop using the new rate limit SDK how do we feel about that as our first thing to do with redus and then we can go possibly build a whole app with it from scratch after I taking look at this example repo here I think most of the code's going to be in the middleware redis rate limit fixed middleware at that this looks fantastic want to see how easily we we can get this going let's do it this is a blog post on how to get started they told me I could stream so we're going to test the limits of that I am not going to hide my screen when I set this up and if they reveal the info for the new database I created with like just showing it on the screen I'll be upset I'll delete it and redo it it's a mistake a lot of people make but this is learning for everybody so let's see we'll uh roundest rate limiter do I make it Global do they even say here what they recommend or if they have a recommendation do not choose Global instead create multiple databases in different regions where you expect traffic interesting that sounds more complex than I was expecting that's fine we'll go with it for now the database is already in West two so hitting an edge in West two is not going to be the worst thing it's definitely going to show it cool let's see I I am expecting it now uh do we want to SSL it I don't think ah let's not SSL it for now creating let's see it doesn't show it look at that guys look at that great job up stash thank you now I'm going to hide my screen for a sec no I'm going to go set up the environment first and then when I'm doing environment variables we'll deal with the next part cool so happy that up stash is already catching these W's this early CD code t-o using r as client with TLS kind of sucks uh the URL does not have the password I do not think no why is that open nope the password is separate I have to copy it separately someone just ask what is up stash up stash is the easiest way to distri or to set up redus for your serverless environments and distribute it around the world it's kind of like for sale but instead of for your code and your deployment it's for your redus and your scaling of it cool oh yeah it shows it there it hides it here and shows it here so close so close and we all missed it too guys don't don't put the password Here I'm just going to not have that open for the time being and do my best to avoid it until we actually need to be there so I think I have a separate [Music] stream uh is it roundest I don't think I have this downloaded right now uh make dear stream CD stream uh and no it's not the username it's the password I I triple checked when I went through that again it just it it shows you the password so close but so far uh cool I wanted to go grab roundest come on quick hop into here get clone this URL somebody just said they don't know what Reedus is for and they're afraid to ask and that's actually a really important rant I should probably go on and clip and put at the beginning of the video up stash is or redus is effectively a key value store in memory that is fast as hell the goal of reddis is to make it easy to to take like a computer with some memory like RAM and then share what's in that Ram with multiple computers as quickly as possible redus is mini database really really fast an in-memory key value store is the the short of it generally reddis is used for caching but it can be used as a database it can be used as an O check it can be used as a rate limiter it can be used for all sorts of things one of the cool use cases that I actually might touch on in a bit is you can use it for next o as your off provider or your o adapter that actually stores the off State so in here up Rus is an option and this will make your authorization for your like applications insanely faster than it is if you're using Prisma as the backing for your next doth setup super super cool stuff yeah there's a lot of like like within the T3 stack there are genuinely a ton of cool places to stuff in up stash and to stuff in redus I didn't take the sponsor because I needed the money I took the spor sponsor because I needed the money and I think redis or up stash and redis fit well into the sack that was a really convenient like point that I recognized as soon as they hit up or hit me up and it's something I funny enough I had made an account on up stash a day before they hit me up it was just perfect opportunity so I know that they're paying me but I do genuinely think that this fits our stack really well so that's what redis is it is a super fast key value memory or store BAS in memory first I need to get round working which is going to suck pretty hard the more I think about it get status uh open this up npm install quick how hard is it to set up redus without up stash I haven't in long enough to say I know that you can do it with Railway but it doesn't handle any of the global stuff it doesn't handle any of like the over stuff there's a lot of other ways to deploy your redus but up stash is one of like the biggest Community like pushers they have awesome stuff it's almost like up stash to redus kind of feels like versel to Next in a lot of ways where they're building all of the ecosystem pieces for us as serverless developers to not worry about the relationship between uh the different rdus instances and scale it forever I I am genuin if we were using red as at ping I would be using up stash so in here we have the old project I'm so scared to see version numbers here uh what version of next okay 1204 that's a lot less bad than I was expecting uh yeah none of these are old enough that I'm going to like be very upset with soone as if they have to pay for redus and up stash no redis is the open source protocol that is used on up stash it's kind of similar to vers to like MySQL and Planet scale where that is what they are using and you're just paying them to use it directly and their pricing is actually really good too it's a uh two cents per 100,000 commands so you can do 100,000 requests to your up stash uh Rus instance for two cents that is absurd so yeah I personally would rather pay this very small fee oh sorry 20 cents yeah not two cents 20 cents per 100,000 commands which is they should have a zero there I'm bad at reading yeah 20 cents per 100,000 commands is nuts and I will happily pay that to never think about these things again somebody said it's kind of like [ __ ] to Atlas and yeah that's also a very very good comparison give this one more go I need to set up the environment variables for this I'm just going to mpm run Dev and see what happens it's unhappy with being old that's going to fail because I don't have environment variables cool so I think I can verell or let's see green yes ping Labs link yep cool PX verell andv pull and now I should be able to mpm run Dev with the exact same environment that's in production locally without you guys seeing any of it and look at that it did exactly what it was supposed to so the first thing I want to build is a rate limiter for this I actually the first thing I want to do is upgrade the next version so we have the new middleware stuff so let's do that first uh can I next 1225 is the most recent right probably patch that up in a bit too yeah 12.25 uh PM install kill that uh igore the environment leaks we're at two environment leaks so far so I leaked the password twice and I safely got that down once so flip your numbers update by changing package Json is madlad it's it's right there when I hover it tells me what the newest version is it's great how do I do it any differently half joking you should probably use the tools but I don't use the tools number of environment variables that leak prediction on Twitch oh that is a hilarious idea that is an actually hilarious idea I will thank on that cool so now I have this set up locally we have the new setup let's start by going to not the tab that has that I want to just yoink this middleware just G to copy paste see what we have to learn from there and here we want to go to Pages middleware dots is it Pages middleware or is it just middleware nextjs middleware TS interesting they have you put it up so high I'm putting it in source and it matches on API hello we want it to match on API TPC uh does the matcher let me do this is that valid I think I can just match all API calls here that's fine uh need to install these packages cool now those installed I should be able to get this configured uh does it have environment variables for how it's connecting oh yeah these are up here uh red. from environment interesting how does it do that up stash Rus rest URL and up stash Rus rest token will those yeah that that'll work for how this handles things cool I'm going to to hide all that momentarily wow uh the overlay I have for everything seems to have broken hilariously that's fun let me grab those keys and quickly put those in the environment quick sorry I can't share my screen while I do this and risk breaking everything theoretically this should just work now I'm going to throw a bunch of console logs in here [ __ ] see cool let's I want to make the window smaller because people are like very fast and I'll have to for that thetically I should now be able to close reop this that should just work are we Reon success true cool so if I do a bunch of stuff really fast like too fast we should get limited look at that see that we hit got we hit a limit that's actually really cool guys I I actually think that's cool as hell that it was that easy to block people from spamming too hard you know how hard that [ __ ] used to be to do I just copy pasted this code here I'm Gonna Bump this to just 20 and 10 seconds that's one vote every half second it has to fetch and then when you vote that's another request so there's two requests each time yeah uh I would imagine that what's happening when we hit those limits is failures on the client side see this is not a valid Json response uh I would probably so yeah this rewrites to API block you could change this to rewrite to whatever the hell you want to right now it's just hitting the blocked but in the future we could redirect that to something that makes more sense I'm just committing it now quick uh we're committing uh added up stash Rus based great limiter hit push and in however much time it takes for versel to deploy that I'll open up the ping account doesn't matter too much uh oh it's here because I just deployed on it we want the deploy take a bit not too long hopefully so that now theoretically if I just refresh super fast so I'm making tons of requests we should be rate Limited there we go see that see that guys how cool is that I I'm actually really hyped on how easy that was I'm going to start using this for other things that's dope rate limiters suck to set up and I just made it so y'all can't spam this goddamn API is hard that's really cool 404 is right because we're redirecting to something that doesn't exist so this is getting re into SL API backend I could write it to something else uh 429 is the right message I could API blocked go make that a 429 in the API so let's do that new file blocked. TS you know what I bet that these guys thought ahead here and in their next example I have a feeling look at that there there's your 429 that you were absolutely correct is the thing we should be sending get status get ad send correct blocked response get push and now we have a properly rate limited spec compliant solution how cool is that so I didn't announce the stream I absolutely did I'll hit the publish button in case that didn't get published but yeah fantastic to have you guys here we're talking Reedus now and I am genuinely really hyped at how easy that was to set up I am probably going to start throwing this in front of a lot of my other apis because my shit's getting spammed hard lately yeah this is a video in and of itself I'm gonna hit that marker button because everything before that can can be a video of its own and I want to play with some harder stuff now I don't often say wow that was really good about someone else's nextjs code but this was fantastic the example in here was exactly what we needed it was the middleware I would have liked for it to have a better matcher oh I just realized that the matcher also runs on the blocked which is bad so I need to opt out of the matcher oh no it has they handled this here oh no did they no we're not opting out if the batch is uh or if the match is for something else uh I can change that very quickly though uh let's quickly console log the request URL just to make sure it is what what I think it is uh are we r as in nope that's not what I was thinking I want the path then I think that that's an option here uh is it not anymore next URL that might be what I'm looking for uh protocol yeah that's what I'm looking for so I'm doing a quick opt out here so request. next to you all that path name let's get out of here early if request oh was that auto completing correctly cool then we escape I guess I can do the right thing cool comment early Escape if hitting the locked redirect Cool Fix redirect get push nice so now that's fixed in production I should probably check the production environment I don't care enough to I trust it works and if it doesn't somebody will yell at me ## React + Servers = Confusion - 20231117 it's no secret that the server actions roll out with next and react has been confusing at best it's a really cool new pattern for how we update data and do mutations and interactions in react and react server components but it's a lot of different things at once and it almost kind of feels like the use effect equivalent in this new model where it has multiple different behaviors depending on where and how you're consuming it none of which are intuitive initially until you really start to feel and get The Primitives I've been getting a ton of questions about server actions as well as seeing source code that seems to fundamentally misunderstand the way you're supposed to use them and think about them and as a result I made a repo where I showcased a couple different patterns with server actions both using and not using trpc to try and highlight some different ways to use the new server action patterns so if you want to try out these new patterns and also understand how they're supposed to and expected to work this video should be really helpful without further Ado let's dive into this repo I'll leave a link in the description if you want to see it on GitHub let's take a look at these different patterns and why you would or wouldn't want to use any given one of them before people say why not bun I used pnpm because bun had issues with Drizzle and sqlite and I wanted to use sqlite to make it as easy as possible to quickly grab this database that I had inlined in the code base so let's go open this up quick have a quick intro showcasing server actions and rsc's both with and without trpc so this first example is vanilla server components plus server action so there's no trpc in this one it's very simple new post submit new post appears and you can delete things doesn't wipe the content of this which we'll talk about why in a bit this all works and importantly this all works with or without JavaScript so if I disable JavaScript another post and it creates it and funny enough it actually wipes this too the reason it's doing it like that is it has to fully reload the page with whatever response you get from the form post we'll go into the details of all of this in a bit let's enable JavaScript again because I want to go through the source code first and foremost so if we hop in here you'll see I have in app three different folders vanilla action trpc client and RSC trpc action these are the three different examples I wrote so vanilla action this is the new react server component way in here here I have some pretty simple backend code cost post equals a wait db. query. posts. find many this is a SQL call to my database that grabs posts and returns them since I'm using drizzle the response is type safe I know it has an ID a name and a created app you can go into the database definition and see this if you want to don't think it's too important but it's right there if you want to take a look anyways we grab our posts now I want to list them I make a quick posts head H1 tag and then I list the individual posts the important piece here is by listing these posts and giving them their own component I can then Define an action in inside of this component first I need the type for the Post View and I just infer the return type off of the posts call because it's easier to grab it that way and then I use that as the type for post but then in here I have my async function delete post action notice that this doesn't take any inputs the only thing a form action gets is form data which if you want to parse the form data yourself is great but when you click the button once you've bound it to the form you also have to include all that data in the form which is not a great workflow so what I try and do when I need something like the ID because I need the post idid here in order to delete the post rather than try to find some way to pass this into the action I Define the action somewhere where the ID already exists so if I had defined delete post action up in here then I would have had to embed in the form the ID for every one of those buttons for delete and also parse that out in that function and hoped it all worked as expected because you have no type safety or other guarantees whereas here that value gets encapsulated because it's part of the closure where this function is defined because post post exists here post now also exists inside of here and the way that react does this is by embedding that information in the form if I actually go in here and I look at this form with this delete button you'll see that this form has a bunch of additional data in here this weird hidden input field that's encrypted what this is doing is including those values that might not have been included otherwise as well as identifying which action to run these implementation details shouldn't matter too much but the important piece to know is that for data to go from your browser to your server action it has has to be included in the form if you're using it via the traditional actions method I'll show you something you can do slightly differently after but most of the time you're using server actions especially if you're using them in server files and specifically if you're binding them via form action equals or with action equals if you're doing either of these things then the form has to have the content data does not get to this unless it comes from the form so know that going in in this case it gets here because it exists when the action is defined but if I had pulled this out I would have to pass and manage all that form data myself which is obnoxious so I putting it here once the post already exists you can skip a bunch of that and make code that's way simpler and then in here I have the form the button delete post action and I'm done but because this is running without any JavaScript on the client I can't really have JavaScript behaviors so if I want to empty the content of something I would have to do that in javascrip the client component I also have a note in the code here for the action to work it has to be in a form you can't call an action with without a form or JavaScript and I'll show you what I mean by the lad in a bit let's quickly look at create post before we go too much further though in create post I have this create post action function which does take form data because there's an input and I need that data because this component isn't a client component I don't have a u state so the only way I get the input value is if I read it from the form data and since I bound this post action to this form I now have access to anything in here so I said that the name of this is post- name so now in my server action I have to form data doget post name and also cast it as a string myself because we don't know what this form has in it because the relationship between this and this are not deterministic even if they're really close to each other starting to see why this gets a bit confusing and isn't super reliable because once you're collecting the data this way you now have to validate it and check it yourself because it's possible somebody just posts this Endo themselves like through something like I don't know a postman and you have to deal with that you can write your own type definitions to work around some of this but none of it's a guarantee and you absolutely do need to devalidate like I should check the post name is a string before blindly using it here it's meant to be a simple demo and then I make this form and that's it for the simple basic vanilla solution if I wanted that input field to be wiped what I would have to do is move all of this code into a client component and then set up behaviors there in order to do that I'm not going to do that here because I'm lazy but you're starting to see where client comes in when you want client behaviors versus where the server comes in when you're doing these data back and forth things and as much as this is different there is still something magical about awaiting inside your component and using what you get back immediately it's such a nice experience and I'm really happy with the DX here overall but I'm also calling database things in line here all over the place which isn't the best thing because now I have these weird database calls everywhere there's no guarantee for auditing if you want to learn more about the security and safety model here watch my video about react taint where I go in-depth on next verell and react team's recommendations on how to structure your code to keep things safe one of the recommend in that blog post and video is creating an abstraction layer for all of your data access and changes they call it a data access layer and I think it's a really good pattern we'll go into how I do that with react server components and actions in a bit but first I want to show you a hybrid this hybrid solution is interesting because I explicitly don't use server actions in it and I've gotten a lot of users and developers with confusion around how you combine trpc with react server components and server actions and these are the two different ways you can do it this one I went out of my way to do all of the mutations via TI PC the old school way so all the things that you would use actions for are using client code but the data loading I'm still doing on the server side so here posts is await api. post. getet posts and for us trpc fans I can command click and you know where it's going to bring you my post router where I have a create function that validates your input and it runs this mutation I have my delete function that validates your input and then runs this mutation and I have the posts endpoint which takes the context because it needs that for the database then it just does the database call and returns it obviously that's all type safe because prpc I'm using the server caller pattern for the trpc here so app router. create caller this basically just let you call the functions from trpc directly and because it's a server code this works great I also import server only to make sure you never accidentally use this on client now I have this guaranteed layer where as long as I'm accessing through API I'm guaranteed it's only happening on server and it makes code review and guaranteeing that things aren't leaking significantly easier when you have one entry point for all of your data so this entry point defines all the things we need for the page I have the API post that get posts and then I have my post view this is where things start to get interesting you might have noticed this file is shorter which feels great but that's cuz a lot of the logic's been offloaded both the trpc side as well as into separate component files where I have to have two components now because they need JavaScript in order to run so this version of the page will not work unless you have JavaScript running in your client but now you can do a lot of other things you wouldn't have been able to otherwise I don't oh yeah this is the type error I even commented I'm too lazy to fix the types on this so in here I have my create post function has the use router it has the use State for the current name and then I have my API call api. post. create. use mutation and this is the use mutation from trpc and react query that lets me make the actual post so on here I have my onsubmit I prevent the default and then I create post. mutate with the current name pretty traditional react code if you ever done this you could also put a separate button and not even have this be a form but it being a form is a little more correct in here I have my input I set the value doesn't notice this a string and I don't feel like setting the types correct so it does so it savs as it is I have the button type submit which triggers the submission this all roughly what you expect the important piece here is the router. refresh which says hey by the way I want new page content after this is done but this is an additional waterfall so the mutation happens it responds to the device and says hey user the mutation's complete and then that device has to then go run the router refresh also set the state to be empty string again but it then goes and gets the new data and reloads the page content without fully reloading the page this is how you refresh the content that came from the server comp components so if the content of your server components has changed like in here the posts are different now we refresh in order to get the new posts and that does waterfall there's a round trip here now versus with the original version where in the vanilla action I actually call revalidate Path and what this says is hey next I need to during this mutation during this action regenerate the page content and send any changes back to the user so in just that one post request you get the new content without having to Waterfall really cool stuff versus here you have to do the waterfall which to be fair this is how almost all applications work today they do the mutation they're told it's succeeded and they go back and do another call to get the updated content pretty common alongside things like polling so fine but having it all in one request response especially one that doesn't need JavaScript that's some of the coolness of this new pattern and then deletes nice and simple same deal where I have to manually router. refresh when the content is changed which is a little annoying because it makes that delete button feel much worse and I'm not going to do any artificial slowdown I'm just going to hit delete here it was almost immediate with the vanilla action version so if we go back to the trpc client side version and I click a delete you'll see it takes a good bit longer and you feel the difference you really do because it has to do the delete get the response back from the server saying the delete was done successfully and then ask the server for the new content and just doubling the number of trips makes the performance feel much worse creating a post feels not quite as much worse especially since the text field resets which it doesn't in the other version again you can Implement that yourself but let's do a quick check testing the title huh what's happening check console error viewer is not subscribed you're not subscribed I'm providing you all of this value for free you can't bother hitting the sub button you know subscriptions are free right just click that little button at the bottom of the video helps us out a ton thank you let's go delete that code so I can actually show you the creation of a post which feels pretty good overall but since I failed in the onsuccess we ended up with two of the same post anyways let's take a look at the third option the hybrid because I think the hybrid hbd is really interesting so again with this one I am using trpc the first thing you're going to notice I don't have that components file anymore because I don't need use client in order to do the posting because I'm using server actions in here you'll also notice the code looks very similar to the vanilla version at least this far and once we get into here you'll notice it looks nearly identical same infer async return type here same post view code here the difference is the server action calls api. post. delete with the post ID and by doing this we get the benefit of the data access layer and we're still using trpc but we have all of the progressive enhancement benefits and most of the DX benefits of using server actions directly but if you're using a server action with trpc you really should make sure you're calling trpc via the caller directly which is what I did here with create caller and that you're not using an HTTP based calling method or a proxy calling method which is actually what we're defaulting to in creat T3 app right now for app router and we absolutely shouldn't be in a complain to the team a lot we're going to get that fixed the catch with caller is that you can't do an async context since DB is sync and headers is sync this is fine but if I had an off function that was async here this wouldn't work sadly that's the only catch otherwise this pattern works perfectly fine with trpc as it currently stands I think this hybrid pattern is a really really strong way of working with the new server action stuff but I wanted to show one more piece I said there was four mutations that's the name of this repo but I actually only have three made right now so I'm going to show you guys something I think is really cool we're going to clone the trpc client I'm going to rename this to client side actions because server actions have a really interesting hidden Behavior it's not that hidden but it is very interesting right now in components we have create post which uses the use mutation from trpc which means we have to use the react query we have to do all of this here what if I told you we can still do this on client side with client side code while getting most of the benefits of server ACC actions and that it's actually one of the default behaviors of server actions we're going to make a new file here called actions. TS very importantly we're going to Mark the file as use server and I'll be very clear about something there's a lot of confusion about this you should never have to mark use server on a file that exports components only reason you mark a file use server is you're exporting actions for other files specifically client components to use so what I Define in here needs to be an exported async function this might not error here but if I go into here oh they stop giving you an error for that previously if you exported anything from a used server file and it wasn't an async function they would yell at you for it I think that still probably should be the behavior because this function should not be accessible to other things otherwise but if I go put this in create post maybe look at the error now console.log aha there's the error I'm looking for they were treaking it out once you actually try to use a value from a use server file you will get an error because the only only thing you're supposed to export from a Ed server file is an async function and they call this out specifically because of the thing that we're about to do so let's delete that all because we don't actually want to export or import a string what we want to import is a function with specific behaviors so if I go back to the RSC trpc action hybrid and I grab the create post function I have here we're going to do things a little different though because as mentioned before I hate this form data what if instead of form data we just had input name name String and I can just say input. name here and I have to import API and I have to import revalidate path looks pretty simple right don't even need the use server there anymore so I have this asnc function but I can't just bind this the way I did before CU we're in client code I can't just bind that to the form how do I use this well I'll show you we're going to hop down here and we're going to call create post action with name okay I can't wait in that let's see what this is mad about promises must be awaited end with a call to catch or then cool this our es lint rules really nice so that then we want to router. reload and we want to set name to empty string I have to void to let it know I don't care about the result cool so now in here I'm calling the post action how can I do that though this is client JavaScript and I'm not binding this as an action well this is that hidden Behavior I was mentioning previously oh yeah the uh I don't even need to do the refresh anymore you're right yeah so I need to change this to be the right URL really good points guys thank you client side actions so what this says here is when this function is hit the response should include the content of this page so if you're on it we can get that new content and now when I go into the code here I have the create post action which is just a traditional promise the way you would call otherwise and This Promise gets past name from my react code and then it sets name to empty string when it's done let's see if this works oh create post. loading that's not a thing anymore so I don't have a lot of these other states you can do it you can get those with used form status I'm too lazy to do that now let's do a quick client test and that was almost immediate the way that this works now is when you import a server action this becomes a fetch call this becomes a built-in function that's almost like an RPC where as we Define this on the server and it's accessed on the route this becomes a post end point that the client can hit and when you call it the compiler turns this into a fetch call and handles it behind the scenes for you this is dope because you can write a server action and bind it to a form the way I showed earlier or you can throw it in a file marked you server and import it and basically have a DIY trpc I liked this import pattern so much initially that I actually made a library discussing how to use it all the way back more than 8 months ago Zod server actions the goal here was you define a server action you export the validated action which is a wrapper around a server action definition you validate it with a Zod validator and then you pass it racing function and now you can just call this on client I even wrote a basic uact hook which was kind of like use mutation for react query a mutate data and is running and now you have all of that state super simply in line that said I don't want to maintain this somebody else made next safe action which is a very similar library that does the same thing but is way better maintained and probably works as expected our library was a total Jank mess so I'm really hyped that somebody else made this for me and I can recommend it to you you define a schema you pass it the schema and your acing function everything behaves as you would expect it to and it's very easy to introduce the use action call that they provide to execute these things in line it's a really cool pattern but again it's an optional pattern that you can build on top of this really strong primitive so this is the the thing I said at the beginning was a little weird and a little use Effy you server does something different depending on if you do it in a file and Export a function versus if you do it in a server component and bind it as an action these are different behaviors that use the same terminology because they're roughly achieving the same thing when you define it in the component itself on the server and then bind it via the action call like we do here these are very different behaviors but they both let us do roughly the same thing and this is the thing I wanted to highlight server actions can be used in these two different ways as a serers side binding to a form so no JavaScript is necessary or as an asynchronous import that does a fetch call inside of your client code so if you really want to control your server actions on the client have loading states have these different behaviors this is the place to do it and if you don't you can bind it with full Progressive enhancement all these fun new features by just writing it in the server component directly I wanted to highlight all these different options with these new patterns because I think they're all pretty cool in the resulting DX is immaculate I've been loving all of these patterns in mixing and matching for what makes the most sense for what I'm building when I'm building it I haven't settled on the the main path I'm going to take but I definitely know a data access layer will help us as we continue to grow our code bases with app router and I think I'm probably going to use trpc for that data access layer that's all I have with this stuff again the repay will be in the description might even push the changes I just made up now so you can see all of these different ways of building using the new server actions patterns I hope this helps clean up some of the confusion and know we're not talking about the SQL templating thing you should check out Josh's video for that if you want to learn more about doing server components in app router safely I'll put a video in the corner all about react taint if you've already seen that or you want something else YouTube thinks you like the video below it appreciate you guys as always peace NS ## React 19 Is FINALLY Here - 20240426 the react 19 beta is finally here of course we have to talk about it it's been a wild Journey here from when a lot of these features were announced all the way back at nexcom in 2022 but I'm so excited to finally get to share these things play with them in other Frameworks and applications and be able to call these features stable because up until now we've been using a canary version which is a a little bit sketchy but this beta things have changed we got to go over this release this is an important note at the top here this Beta release is for libraries to prepare for react 19 so if you're an application developer this isn't for you react 19 will make it to your apps very soon but the goal of this release isn't to get everyone using react 19 it's to specifically help Library developers framework authors those types of nerds like myself even get to experience these things early it doesn't mean we can't go over the new things in this release but just an important note they even say here that app developers should upgrade to 18.3 and wait for react 19 stable as we work with librar and make changes based on feedback what's new in react 19 first off we have actions a common use case in react apps is to perform a data mutation and then update state in the response for example when a user submits a form to change their name you'll make an API request and then handle the response in the past you would need to handle pending States errors optimistic updates and sequential requests manually here's a traditional before actions example we have the use State for the name the error the pending and we have the handle submit function that sets pending to true we have the error case once we've handled that we set pending to false and if there's an error we set the error to true as well and the usual input button you get the idea here but in react 19 we're adding support for using async functions in transitions to handle pending States errors forms and optimistic updates automatically I will admit whenever I hear the word automatically especially around forms I get a little bit skeptical but I'm optimistic about what they're doing here optimistic is a bit of a pun can't help myself for example you can use use transition to handle the pending state for you so here we have the set name error and the start transition is pending function here this transition Hook is very handy because you can set that current that uh this used transition Hook is very handy because you can set this transitional State when something is going on so in this case when we're doing this push to a server we can start a transition do this update here set the error if we have it do the redirect there and instead of these stateful updates coming through one at a time like they would above here we would set pending to True we'd handle the error or we'd do the call then we said pending to false so there's technically a point here where pending is false but we don't have the error if there is an error usually react batches these things well enough to handle it but if you had additional acing stuff here that doesn't work with used transition the start transition content whatever you have wrapped here will not trigger a state update until all of it is complete which is really handy so if you do three State updates in here they'll all come through as one update at the end really nice the async transition will immediately set the is pending state to True make the async requests and then switch is pending to false after any transitions this allows you to keep the current UI responsive and interactive while the data is changed Ching that's another good point too when you have this all going on in a transition like this you can handle whatever else you want wherever else in the app you want to and not have to worry about it as much important note here too by convention functions that use Asing transitions are called actions actions automatically manage submitting data for you by having things like pending state where actions provide a pending state that starts at the beginning of a request and automatically resets when the final State update is committed very very handy to have a proper pending State before and after things without having to write a bunch of addition code for it the amount of code you have to write just to do a fetch call properly and react has always been a bit me because it's so obnoxious and now that kind of stuff is just handled also optimistic updates I'll admit I haven't been pumped with the use optimistic workflows but I'm excited to see if they've improved it all here and also haven't really used them enough to have them click so maybe it's a skill issue and I'll end up liking it more in the future but at this point in time I have found to use optimistic to still be a little clunky that said every optimistic update pattern I've seen has been relatively clunky so it's not unique to this but as they say here actions support the new use optimistic hook so you can show users instant feedback while the requests are submitting also includes error handling as well as working well with forms directly which is nice because up until now react doesn't really acknowledge forms they've just kind of been a paino for all of us react devs let's take a look at actual action code now building on top of actions we're also introducing form actions to manage forms automatically use optimistic to manage optimistic updates and the new hooks use action State and use form stat status to support the common cases for actions and forms or here's a simple example using actions instead we have the use action state which has error submit action is pending you pass it the action code for so this is the stuff that you actually want to do when the submit happens and now we have the form with the action and submit action the input the button for submitting the error being shown in the form directly and now here we have async previous state form data so you actually have the previous state if you need that for some reason we run the update the one annoying piece here is that form data is being used for everything and as you guys know I'm a type safety nut there's no way here to know for sure that the input type text is actually going to give you text here which means there's room for somebody to make a custom version of use action state that has like a validator such as Zod in the middle there to make sure you're validating and getting the types that you actually expect I could even see a library that does the jsx part too where under the hood it's doing exactly what we see here but at the very least it provides you like type safety and consistency guarantees that aren't provided by the code I'm seeing here that said generally speaking making things simpler is the best win for scalability because if you can make this code really simple the likelihood that there's an error that sneaks through in code review is way lower and relying on type systems in order to allow complexity to exist is great but if the complexity doesn't need to exist you should go as simple as you can still skeptical because I would love for this to be signed in a type safe way where different inputs are handled properly and I've never loved the form data. getet method for getting information that that said this code is objectively way simpler and more reliable I I like this direction also of note though is that this form it has the action bound directly to this hook so that's an interesting relationship change that hasn't really existed in react before the idea of a hook that returns something that's only really built to be used within a specific element type in this case a form it's interesting I I have feelings I'm leaning positive and mostly because I've been using form actions inside of nextjs with server action for a bit now I have confidence this will work out but it is very different from what I'm used to in the next section we'll break down each of the new action features within react 19 including use action State I've seen some controversy around this one let's see how I feel after reading this something that I've always been iffy about with react is its love of returning these arrays rather than an object with named Keys the benefit of doing it this way is that you can name these whatever you want so if you have like three use action State hooks you could have like error form one error form 2 error form 3 without having to write a bunch of additional code but if I just guess I'm pulling out my Editor to show what I mean here a few moments later I had to spend a good bit of time setting up a test rep put to play with this stuff uh this is not the easiest beta to consume because the types aren't included since you have to get types from at typ react but that package isn't up to date you have to install these custom versions of npm types react at Alpha and then do an override here not the most fun thing thankfully they documented it well enough if you really want to try things which I did so we got it working so we have to rely on this array being the correct order because error has to go first the submit or what they call here submit action has to be second and then the third thing is pending has to be third you can name these whatever you want which is useful if you have a bunch of these hooks my issue is that you have to remember the order of these things for example if you got these out of order like that this is something very subtle that would pass code riew that is entirely broken and avoiding mistakes like that is annoying it also makes things like types safety a little more annoying too my ideal here would be something with an object so instead of returning like this we would have error submit action and um is pending and if you actually wanted different names for these you can do that like error first error submit action first submit Etc I'm getting type errors here because this isn't actually how it works but if you wanted to give these things custom names you count with the object it's more verbose but it would be nice generally react has leaned away from using objects there's a lot of reasons why I think this customizability is one of them but it is always a little frustrating especially now that we have these named steps within what's being returned and we're expected to do those in the right order they also expect you to pass two to three things to use action State let's take a look at the type def yeah we have the action you also pass it the initial state which isn't optional even though in all of the examples here it's not passed which is very strange that in the examples use action State doesn't have a default but in their type definition it actually requires it as the second argument interesting I I have feelings this is still clearly a little early but I would have expected that to not require the initial State and I'm a little surprised it does I do like the idea of a a hook that is a A Primitive that does a lot of these types of things there's a lot of this type of stuff that I've wish react included for a while including a used memo with call back which would be a life Cher for me I complain with this forever but this is specifically for actions especially in forms I see the potential I just wish they named these keys and gave me an object instead something like react query does this really well here's an example of react query where we have status data and error which are all things returned by used query it makes it really easy to select the things you want like let's say we don't actually care about the error State here but we do obviously need the submit and is pending you have to do an underscore for that and know the order of these things I just I don't love that pattern I wish react would start moving away from it it it wouldn't be as elegant as we expect from react but I think it would be better anyways let's keep digging into this hook use action State accepts a function which is the action and it returns a wrapped action to call this works because actions composed when the wrapped action is called use action state will return the last result of the action as data the pending state of the action is pending this is actually a really nice part too I haden't thought about before it's pretty easy to build something like this in react but if one of your submissions takes longer than the other one like let's say you submit once it takes a while to resolve then you submit a second time and it takes less time if you didn't set things up correctly the first one since it came back later ends up overriding the second one even though you did the second action second which is super unintuitive to be typing away hitting submit changing your mind hit submit again and then it updates to the Old State because it got the first update back later weirdly common mistake a lot of applications have especially those using react and rolling their own stuff here this is why I've always eduse react query having it built in is really nice no react. use action state was previously called use form state in the canary releases but we've renamed it and deprecated use form State good call cuz there's uses for this that aren't just forms although again on the note of react query I am sorry Tanner and tanat query and TK Doo seems like react is now challenging you directly where is the mutations here we are mutations as you can even see from here are very similar the big difference being you have to pass an object with a mutation function key which again you guys know where my preference is here and has the the is pending is error is Success all of the stuff that we're used to getting from what we just saw there what we don't have with t stat query is this deep integration with forms though in fact doing this without being react yourself would be a bit hard you'd have to make your own component Library as well actions are also integrated with react 19's new form features we've added support for passing functions as the action and form action props of form input and button elements automatically submitting forms with actions cool it's interesting they're leaning into this idea of like letting the form perim do its thing but seeing this more and more I still think forms are cursed but it's cool that they're getting slightly less cursed over time when a form action succeeds react will automatically reset the form for uncontrolled components if you need to reset the form manually you can call the new request form reset react Dom API interesting very interesting for more information see the docs for all of these components interesting that there's now docs for form input and button in the react docs what do these even look like Canary reacts extension to form are currently only available they're calling it extensions to form that is what it is the built-in browser form component lets you create interactive controls for submitting information anyways let's take a look at use form status because this one confused me a lot during the react and nextjs early stuff in Design Systems it's common to write design components that need access to information about the form that they're in without drilling props down to the component this can be done via context but to make the common case easier we've added a new hook use form status and this is a good description of it imagine you have a fancy button that your designers gave you from your design system and you want to use that as the submit button instead you shouldn't have to pass all of the props down to that button for every single possible condition ideally anything it needs from the form is accessible directly which it is here with this new use form status hook you just have this hook inside of the button component you no longer need to pass props down it's able to tell that being a child of a given form that that's what this is linked to it's weird because it's an implicit Behavior rather than explicitly passing the properties down but for are full of weird implicit so I think it aligns with that use form status reads the status from the parent form as if the form was a context provider I really like this description actually it's been hard to summarize what this hook does this is a super concise it's one of those like Dan aov descriptions that took months to think of to get just right but they nailed it with that one it treats the form like a context provider clean use optimistic let's see if they can help me understand this one cuz it's been hard to work with historically another common UI pattern when performing a data mutation is to show the final State optimistically while the async request is underway in react 19 we're adding a new hook called use optimistic to make this easier in case you weren't familiar with optimistic updates the idea is that you show the user what things would look like when it's done while it's going on so that the app feels more responsive really nice especially for people with like bad connections or services that take a long time to resolve it's good to feel like the thing worked when you're doing it rather than having to wait and see later on have the whole app freeze in the interim so here we have optimistic name set optimistic name using this hook so if we're rendering the name on the top here your name is whatever but we're waiting for this form like update to pass before we update it it'll take a long time to actually see that but with the optimistic change here instead if we're using this instead of a traditional use State we can get that early I think the big difference here is that with something like a transition a lot of this gets opted out of so if you did like a oneoff set State inside of a transition it won't update because that's the whole point of transitions but if you wanted this to update calling use optimistics set instead of a use State set will actually Force the update early let me know react team if I'm wrong about that but it seems like that's the goal of this Hook is to opt out of the transition stuff because the action stuff as well as just calling use transition directly results in these State updates being batched but we don't want to wait until the update is complete to see the result so use optimistic just gives us an early Escape yeah the use optimistic h will immediately render the optimistic name while the update name request is still in progress when the update finishes or errors react will automatically switch back to the current name value where is current name even hidden I didn't even notice this little key very important piece that whatever you're passing here is the value that it's returning if you ever want to temporarily update it set optimistic helps with that okay this is starting to click for me more now I see I see the value it is weird having a value that you get from somewhere else and wrapping it with this hook just to allow temporary updates but I also like the idea that when this is called within a transition it gets set back to whatever the value it passed or you pass to it afterwards interesting it's like a a use temporary state with early change typ hook where this will only be changed during the transition and it will be changed during the transition makes sense it's like a weird pile of hacks on top of UST state to get through some of these rougher transitional type things they have a whole doc about that if you want oh boy another hook that I've had a lot of trouble using use I have yet to get this one working in a code base in a way that actually made sense to me let's see what they have to say in react 19 we're introducing a new API to read resources in render use in render is a key piece here for example you can read a promise with use and react will suspend until the promise resolves so here we have import use from react function comments we have this hook to here we have this async function that gets us the comments then we return comments. map where we actually wrap all of these in a paragraph I will say this should technically have some wrapper around it because you can only return one element and this would return an array so this isn't technically a component funny enough but it's a good example regardless but there's a comment here that's important this will resume the promise from the server it will suspend until the data is available this is an important note though use does not support promises created in render if you try to pass a promise created in render to use react will warrant as such a component with was suspended by an uncashed promise creating promises inside a client component or hook is not yet supported except via suspense compatibility libraries or Frameworks to fix this you'll need to pass a promise from a suspense powered library or framework that supports caching for promises in the future we plan to ship features to make it easier to cash promises in render seeing why this hooks a little bit weird you can also read from a context with use honestly I think this is going to be the best use case use case sorry because you can use the the use hook regardless of if it's in a condition or not if you're used to writing react this code might be giving you a heart attack right now because you're used to hooks being a thing that you have to call outside of if statements so that react can do its crazy optimizations now you don't have to now you can just call this use hook directly and it should just work pretty nice and it's the best way to access context no more context consumers just call use wrap it or pass it the context and you have what you're looking for small typo here this dark theme context comes from theme context this one comes from light theme context if they just passed both from theme context and give an object you know my complaints already regardless did they not go more in depth on this because I I have feelings I have a lot of feelings the the key here is that we have to handle suspense somehow and this does not showcase what that looks like in order for this to work commment has to be called inside of a component that has a suspense boundary and ideally also has an error boundary so that when comments is pend you can show the pending State when comments is done you can show the complete state or an error if it failed so you have to wrap whatever this is being called by inside of a suspense boundary I'm assuming the reason you can't pass promises is because these promises are all being resolved outside of the component and once they are resolved it lets the component do the render that's the only reason I can think of that restriction it's an interesting one to say the least anyways that's enough about all the hooks we're going to dig into my favorite part server components you you guys know how I feel I was skeptical initially and I became one of the biggest proponents I love what react is doing with server components it's really cool stuff let's break down why server components are a new option that allow rendering components ahead of time before bundling in an environment separate from your client application or SSR server the separate environment is the server in react server components server components can run once at build time on your CI server or they can be run for each request using a web server I like this description a lot it's an important piece to know react is effectively with server components allowing you to decide when the HTML file gets created it can be created at build it can be created on runtime it can be created on your server you have a lot of options which you didn't have before which is really cool it's almost like a template that is dynamically created based on your specific wants and needs depending on if you want to run it on server you want to run it on build or you don't want to run it at all really cool stuff I've been enjoying it a lot obviously I'm leaning heavily into the server side where things are Dynamic but you could also use this to build something static like an old Gatsby vog this Tech is really cool for those types of things react 19 includes all of the react server component features included from the canary Channel this means libraries that ship with server components can now Target react 19 as a peer depth with react server export conditions for use in Frameworks that support the full stack react architecture so how do we build support for Server components bundler and framework support for rsc's can be built on react 19 but the underlying apis will not follow sver and may break between minors in react 19x to support react server components we recommend pinning to a specific react version or using the canary releases we will continue working with B buers and Frameworks to stabilize support for react server components in future versions I like that they're calling out that they don't follow sver and breakes will happen because historically react hasn't really broken for people like you can use a react component from 10 years ago in a react application today and it works just fine happy they're calling that out because it is an important detail server actions server actions allow client components to call async functions executed on the server when a server action is defined with the used server directive your framework will automatically create references to that server function and pass the reference to the client components when that function is called out on the client react will send a request to the server to execute the function and return the result since I'm sure a lot of people who aren't normally keeping up with this stuff are watching this video it's like an overview of this new version I want to call out that us Server doesn't do what many of you think it does use server isn't the thing you put on top of a server component us server creates a binding between the server and the client when you put use client at the top of a file it effectively tells react hey make sure the JavaScript here gets sent to the client so they can use it it's creating a tunnel from the server to send stuff to the client When you call you server it does the same thing but the other direction it's creating a tunnel on the server for the client to send things to it so if you wanted to submit data with a form like we were doing before use server is what you would use in order to let the server accept that information from the client JavaScript goes down with use client Json goes up with use server hopefully that helps clear it up another note here literally what I'm saying here there is no directive for or server components a common misunderstanding is that server components are denoted by use server but there is no directive for Server components the use server directive is used for Server actions I still think this should have been use action it actually was back in the day I found some old commits that showcased that they changed it to use server because they felt like it mirrored use client better but by doing that they made even more confusion so I have feelings server actions can be created in server components and passed as props to client components or they can be imported and used in client components love this these behavor are relatively different but it's so so cool that it supports both you can pass a server component or a server component can define an action with the used server call pass that down to a client component as a prop or just embed it in a form or you can have a folder that has a bunch of used server server actions and then just import those in client components directly the fact that this one primitive supports all of these use cases is really really cool and I haven't seen anything like it before it's like the best parts of remix and the best parts of trpc is a bundler step great stuff improvements in react 19 the first is ref as a prop rip forward ref you will not be missed now ref is the first ever default prop in react components okay I guess children kind of counts but now this key ref just exists in react previously you'd have to wrap things with forward ref to tell react to treat this key differently but rather than doing that ref is now a reserved special prop that will handle all of these behaviors for you so overdue I am so thankful this finally happened no refs pass the classes are not passed as props since they reference the component instance interesting didn't think about class components here because I don't really think about class components a whole lot I'll be honest diffs for I have to screenshot and tweet this anyways you got the idea we now log a single message with a diff on the mismatch super spicy take as soon as hydration existed this should have existed too the fact that there was a concept of HTML that react hydrates and binds things too and that can fail that is the point at which we should have had these types of Errors we shouldn't have waited years later like we did it's annoying I'm thankful we have it but these are the types of things I think give react a lot of the bad rap it has stuff like this stuff like the lack of good debugging in Dev tools for the serers side react stuff now like nextjs not having good tools like in the browser we can get away with it because we can just open up the dev tools but on the server we don't have a Dev tools equivalent and not providing us something to meet our existing expectations as web developers has caused a lot of the frustration that we're seeing today this is another one of those examples where like the existing Dev tools don't help us fix this problem which is why people were so frustrated so thankfully they're now ridging that Gap context as a provider oh boy react 19 you can render context as a provider instead of oh no this is super simple again they're simplifying context because use makes consuming the context significantly easier just a nice cleanup change speaking of cleanup clean up functions for refs oh I've needed this for so long if I call use ref will this still work if I call use ref will this still work oh it only works when the elements are removed from the Dom so I don't think so actually when the component unmounts react will call the cleanup functions returned from The Ref call back this works for Dom refs refs to class components and the use imperative handle previously react would call ref functions with null when unmounting the component if your ref returns a cleanup function react will not skip this step future versions We Will deprecate calling refs with null when unmounted components good change overdue due to the introduction of rough cleanup functions returning anything else from a ref callback will now be rejected by typescript the fix is usually to stop using implicit returns for example previously if you had this wrapped in pen it would have failed just wrap it in an object it's no longer implicit you're fine makes sense the original code returned the instance of the HTML div element and typescript wouldn't know yeah you got the idea oh you can code mod this pattern with no implicit ref call back return I'm going go a little more R here if this is the type of change that's considered breaking and react you understand you should hopefully understand how little there are breaking changes in react they even provided a code mod like react doesn't break the fact that people are so concerned about all these react changes and they don't realize all their old react code's going to run fine it's annoying the amount of effort they put in to make sure these things don't break is absurd and even if this happens to be a thing you're doing wrong all over your code base you can just code mod it out this is the the biggest breaking change we've seen so far and it's not particularly bad let's be real use deferred value initial value we've added initial value option to use deferred value nice so deferred value can now be passed an initial let's see what they have to say about that initial value is provided use deferred value will return it it as the value for the initial render of the component and schedule a render in the background while the Deferred value is returned one example of how you would use this is you want to show stale content while the fresh content is still loading so if we want to show the current value and wait for an update to happen come on do I have an example here okay here we are so we have this deferred query and we can wrap this in a suspense and now when a change occurs we can suspend while we wait for that change to come through super simple really handy the query will update immediately so the input will display the new value however the Deferred query will keep its previous value until the data has loaded so search results will show the stale results for a bit really nice back here because they added support for document metadata I can't believe this this is one of those things I just can't believe wasn't in react before pump that is here now in HTML document meta tag or in HTML document metadata tags like title link and meta are reserved for placement in in the head section of the document in react the component that decides what metadata is appropriate for the app may be very far from the place where you render the head or react does not render the head at all in the past these elements would need to be inserted manually in an effect or by libraries like react helmet and they also required careful handling while server rendering in a react application yeah handling like the title tags and all of that type of stuff has been annoying for a while happy that this is now baked in primitive you can just call Title and it should theoretically hoist it to the right place when react renders this component it will see the title link and meta tags and automatically hoist them to the Head section of the document finally now this will ensure that it works with client only streaming SSR as well as server components finally they did call out that you may still want a metadata library though if you want to do things that are across your application using a library to generate titles all that type of stuff might still make sense to use it like that but for a lot of cases just calling these elements is really nice oh stylesheets didn't think about that as part of the link stuff very interesting uh for those who aren't already aware react has never given a about Styles it's just not been react's thing that's been for us to figure out if the developers building with react now they care let's see what they have to say here so I'm not familiar with this bit Styles sheets both externally linked via the link tag or or inlined with a style tag require careful positioning in the Dom due to style precedence rules in case you're not already familiar if you have two different style sheets or style tabs tags in the same application and you have them both update the same class name whichever loads last is the one that will be the top so if you have class A with background blue and you have another style tag with class a background red that one takes precedent and this gets way crazier if you have a is blue b is red and then you apply B then a to your class names since B came last in the Styles it doesn't matter you put it first in the class name it just gets overridden so the order of your CSS and your Styles is annoyingly important so making sure they honor that is important too building a stylesheet capability that allows for composability within components is hard so users often end up either loading all of their Styles far from their components that may depend on them or they just use a style Library which encapsulates this complexity or we just use Tailwind anyways in react 19 we're addressing this complexity and providing even deeper Integrations into concurrent rendering on the client and streaming rendering on the server with built-in support for stylesheets if you tell react the Precedence of your stylesheet it will manage the insertion order of the stylesheet in the Dom and ensure that the Styles if external are loaded before revealing content that depends on them that is really cool here we have a suspense that wraps these style tags and it won't render your article until these Styles have loaded that is super handy to not have flash of like unstyled content unstyled content flashing is the worst and this just solves it that's so cool I did not know about this change yeah during SS R react will include the stylesheet in the head which ensures the browser will not paint until it's loaded if the Styles sheet is discovered late after we' already started streaming react will ensure the stylesheet is inserted into the head on the client before revealing the content of a suspense boundary that depends on it so if all of this content gets streamed in later it will block the result until it's added in these link tags and then loaded the data chef's kiss and then during client side rendering react will wait for newly rendered stylesheets to load before committing them to the render if you render this component for multiple places within your app react will only include the stylesheet once in the document I love these D duplication things too for users accustomed to loading stylesheets manually this is an opportunity to locate those Styles sheets alongside the components that depend on them allowing for better local reasoning and an easier time ensuring you only load the Styles sheets that you actually depend on I can promise you that at a company like twitch which I only know because I worked there at least half the styles on the site probably aren't being used anymore because we didn't have a deterministic link between a component and the style it needed so we just dumped Styles everywhere in our CSS and now they just sit there so nice to see this changed style libraries and style Integrations with bundlers can also adopt this new capability so even if you don't directly render your own stylesheets you can still benefit as your tools are upgraded to use this feature I'm excited to see how different libraries like Styx could take a ton of use of this I'm sure lots of others will too support for Asing scripts the amount of hacks I've done to make this work in next is absurd let's see how they hand handling it in HTML normal scripts like just a script Source tag and deferred scripts like defer are loaded in document order which makes rendering these kinds of scripts deep within your component Tre challenging async scripts however will load in arbitrary order even worse in react 19 we've included better support for acing scripts by allowing you to render them anywhere in your component tree inside the components that actually depend on the script without having to manage relocating and duplicating script instances this is so useful for something like a a a player for media if you're not familiar with how hard it is to stream video take a look at hsjs it's massive and it's obnoxious if you have a video component that you only want to have render and you only want to load that JS when the user is actually playing a video now you can just dump that script tag into your video player and it will load the hls.js pile of once you're mounting the component and not until then no longer wrapping things with react that lazy importing libraries and hoping your bundle or figures at all out just Mount to script Tech this is great in all rendering environments async scripts will be dupc ated so that react will only load and execute the script once even if it is rendered by multiple different components in SSR Asing scripts will be included in the head and prioritize behind more critical resources that block paint such as stylesheets fonts and image preloads speaking of preloads let's talk about the preloading resources I've heard good things about this but I haven't actually taken a look during initial document load and on client updates telling the browser about resources that it will likely need to load as early as possible can have a dramatic effect on page performance this is something that the this something that our friends over at remix realized a while ago and they got smart enough to start sending things like the font data you need during the initial response before they even had HTML so the browser could start pre-etching that stuff before it even starts rendering really handy this is now just built into react you can tell it to pre- initialize different scripts pre-load different fonts style sheets even prefetch DNS that's actually really cool you can preconnect to different things when you will want to request something but you're not sure what yet yeah this is cool because now when you reference these things later on they already exist inside of the code and of your environment oh another typo result should have a t here these are the smallest typos I just I can't help myself but here we see the actual result is that these things get dumped in as pre-etch and preloads automatically these apis can be used to make initial page loads optimized for instance by moving discovery of additional resources like fonts out of stylesheet loading these apis can be used to make client updates faster for instance by providing and prefetching a list of resources used by an an ipated navigation and then eagerly preloading those resources on click or even on Hover that's really cool the idea of you you might go to a page that requires another script so as soon as you start hovering over it we can preload that would also work with like the play button example for the video player I was talking about earlier once you're hovering over the thing that needs that ability to play video you can start pre-loading the JavaScript and even pre-load the video maybe cool stuff compatibility with thirdparty scripts and extensions we've improved hydration to account for third party scripts and browser extensions I have actually dealt with hell with this uh yeah um since react assumes everything in the Dom is placed there correctly and by react it breaks if you have a Chrome extension that like puts an element in a weird place or another fun one is if you're translating a page using like built-in browser translations that will absolutely break react ideally this will handle some of that we've improved hydration to account for third party scripts and browser extensions when hydrating if an element that renders on the client doesn't match the element found in the HTML from the server react will force a client reender to fix up the content previously if an element was inserted by thirdparty scripts or browser extensions it would trigger a mismatch error in client render yep in react 19 unexpected tags in the head and body will be skipped over avoiding the mismatch errors frea needs to re-render the entire document due to an unrelated hydration mismatch it will leave in place stylesheets inserted by third party scripts and browser extensions nice doesn't quite fix the problems I had but fixes a decent chunk of them I'm excited to see what he will do with better error handling we've improved error handling in react 19 to remove duplication as well as provide options for handling caught and uncaught errors for example when there's an error in render caught by an error boundary previously react would throw the error twice once for the original error and then once again after failing to automatically recover and then it would call console error with the information where that occurred this resulted in three errors for every caught error yes it certainly did I wonder if they're also going to fix effective to use a client component for R boundaries well see as we go but now we log a single error with all of the information error hit at throws at render the above error occurred with the throws component yada yada react will try to recreate this component Tre from scratch using the error boundary you provided additionally we've added two new root options to complement on recoverable error they also uncaught error which is called when react catches an error in an error boundary there's on uncaught error which is called when an error is thrown and not caught by an error boundary as well as unrecoverable error which is called when an error is thrown and automatically recovered for more info on examples you have the docs custom element support is this for web components yep it custom elements are the Lynch pin of the web component spec Yep this is web components just wanted to confirm custom elements have been part of the web platform for a long while now however using them with react has been impractical because react has always treated unrecognized props as attributes rather than as properties react 19 adds support for custom elements and it passes all tests on the custom elements everywhere Benchmark during server side rendering props passed to a custom element will render as attributes if their type is a string number or the value is true props with type object symbol and function as well as with values like false will be omitted during client side rendering props that match a property on the custom element instance will be assigned as properties otherwise they will be assigned as attributes thanks to Joey for driving the design and implementation of custom elements support and react I'm pumped that they found somebody to do this because they've wanted this for a while I just say react wanted this but a lot of anti- react people have wanted this I'm not actually sure how common a case it's going to be to use this but at the very least it shuts up the web standards people which if you know anything about me you know I love making the web standards people shut up speaking of shutting up I think we're done let me know what you think in the comments and until next time peace nerds ## React 19 Is Here - Are You Ready_ - 20240216 before you get mad at me for the thumbnail this is what Andrew Clark from the react core team actually tweeted it might not be quite as extreme but this is some big news and I think we need to talk about it because throwing away use memo use call back memo forward ref react. lazy use context throw promise and context providers there's a lot changing right now so what the heck's going on why is all of this going to change well first and foremost it's important to know none of this has to change you can continue using things the way you currently use them and even in new react versions you're going to be fine I don't think they any intention to deprecate the existing functionality at any point you just won't necessarily need the things on the left side here in the future some of them are just semantic changes like context. provider becoming just context because you no longer need to use context you can just call use with the context there's also has some performance benefits we'll talk about in a bit but we need to read the official update from the react core team react Labs what we've been working on February 2024 these blog posts are great and they haven't been doing them quite as often as I would have hoped like the last one was was that a year ago yeah March 2023 was the last one so it's been almost a year since the last of these updates very thankful they're still happening and also Dan still helping out the first update is react compiler react compiler is no longer a research project yeah we mentioned that before in the Tweet as discussed in their previous post about it react can sometimes rerender too much when State changes since the early days of react our solution for such cases has been manual memoization and our current apis this means applying Ed memo use callback and memo apis to manually tune how much react reenders on St changes so if you have an element that you don't want to have render because the things you're passing to it didn't change but maybe a hook above that did you could memorize the component you can memorize the data there's a lot of places you can throw these checks to keep those updates from happening but even knowing that you can do that much less how to do it and how to do it properly is a big ask for a Dev that's just trying to have an input field that responds when they type I'm very thankful to know that in the future they won't have to do that without having to adopt a whole different mental model like signals oh look at that they're saying the same thing here manual memoization is a reasonable compromise but we weren't satisfied our vision is for react to automatically render just the right parts of the UI when State changes without compromising a react Coral model first part is yeah that's solid JS you can use other things for this but wait without compromising react's core mental model there's the difference spelt and solid and all these other Solutions have their own gotas with how state is encapsulated how you have to call things instead of using values how equals is bound to weird behaviors and spth all these types of things that react as a pretty good job of sidest stepping where I still feel like react feels the most like just JavaScript of modern Frameworks solid is really close but react still as the the most JS Vibe I get and that's a huge part of their core mental model as well as the composability of all these pieces in the way that those interface together back to the post we believe that reacts approach UI is a simple function of state with standard JavaScript values and idioms is a key part of why react has been approachable for so many developers that's why we've invested in building an optimized compiler for react JavaScript is a notoriously challenging language to optimize thanks to its loose rules and dynamic nature react compiler is able to compile code safely by modeling both the rules of JavaScript and the rules of react for example react components must be item potent returning the same value given the same inputs and they can't mutate props or state values these rules limit what developers can do and help to carve out a safe space for the compiler to optimize within of course we understand that developers sometimes bend the rules a bit and our goal is to make react compiler work out of the box on his as much code as possible the compiler attempts to detect when code doesn't strictly follow react's rules and will either compile the code where safe or skip compilation if it isn't safe we're testing against meta's large and varied code base in order to help validate this approach there is so much good information in here so first off lint rules as a way to make the code more optimizable that's a bit scary we've all had lint rules that prevent you from doing things that are obviously not performant or have weird side effects but the idea of lint rules that are specifically to keep you within the bounds of the Java JavaScript that the react compiler is the most capable of optimizing that's an interesting concept like genuinely really interesting and I'm curious how that plays out the other part is that a lot of your code isn't going to fall within that optimizable set and when that happens you can't just opt out of the compiler entirely like how do you deal with that I'm sure there's a lot of code in the Instagram code base period but importantly here there's a lot of code in the Instagram codebase that probably doesn't follow these rules exactly and that's why this call out is so important because if it works there and able to make it work around those things maybe you don't get the same performance win but at least it's compatible that's huge and historically react's been really good about this in the past in the past other Frameworks like angular when they had major updates from angular js1 to angular 2.0 you couldn't just use old code in my always betting on react video I did last year I gave the example of taking a component from this blog from 2014 and putting it in a brand new app router nextjs RSC project and actually server rendering that ancient class component react's historically been incredibly backwards compatible which is a huge part of why Hooks could take off the way they did because I could just update react versions all the old code still worked but I could make new components with hooks and even Mount old components with classes inside of those new components and intermingle them effortlessly that's how I do things with server components largely too it's surprisingly easy to take code from the old era and use it in this new stuff and it all just works together like the Lego bricks they built but if the compiler is strict about what things it does and doesn't support that all gets thrown away which is why it's very good to hear their building outs into the compiler for developers who are curious about making sure their code follows reacts rules we recommend enabling strict mode and configuring react's eslint plugin these tools can help catch subtle bugs in your react code improving the quality of your applications today and future proofs your applications for upcoming features such as react compiler there's going to be all the crazy like rules of hooks and such I should do a longer Deep dive on why those are important there are some crazy optimizations with hooks that yall don't even know about anyways we're also working on Consolidated documentation of the rules of react and up updates to our esent plugin to help teams understand and apply these rules to create more robust apps really good to hear that they're committed to making esent experience much better previously the react team hasn't been as focused on these types of tools that are external ecosystem things like es lint being mentioned this much in a react post is interesting to see even things like JS do comments on the type definitions aren't particularly interesting to the react core team things like that tend to fall on the shoulders of poor Matt pook who's stuck making all of those definitions himself but God bless him for it those are going to be a very nice IDE win see the compiler and action you can check out our talk from last Fall Again check out my video where I show the cas this if you want to learn more about it time of the talk we had early experimental data from trying react compiler on one page of Instagram since then we've shipped the compiler to production across all of instagram.com we've also expanded our team to accelerate the roll out to additional services at meta and to open source we're excited about the path ahead and we'll have more to share in the coming months oh boy I cannot wait for this to be open sourced I am so curious about the actual implementation details here it's going to be a fun ride speaking of fun ride let's talk about actions which have been a particularly wild ride for me we previously shared that we were exploring solutions for sending data from the client to the server with server actions so that you can execute database mutations and Implement forms that's weird to reduce it to these two examples there's a lot of other things you want to do with an action I get what you're saying though the idea of having a a proper built-in primitive for the client to send the data to the server important stuff during development of server actions we extended these API to support data handling in client-only applications as well oh boy they're formally blessing the use case of using server actions for client stuff huh we refer to this broader collection of features as simply actions actions allow you to pass a function to Dom elements such as form huh so this is for react L JavaScript in a way hm the action function can operate synchronously or asynchronously you can Define them on the client side using standard JavaScript or on the server side with you server directives when using an action react will manage the life cycle of the data submission for you providing hooks like use form status or use form state to access the current state and response of the form action by default actions are submitted within a transition keeping the current page interactive while the action is processing since actions support async functions we've also added the ability to use async and await within the transitions this allows you to show pending UI with the is pending state of a transition when an async request like fetch starts and show the pending UI all the way through the update being applied I'll be honest the examples I've seen thus far for use form status and use form state are really hard to digest it feels a little bit too much like magic at the moment I need to make some really good ones so I can both communicate it better and confidently show it in my videos just know if these hooks make you feel a little dumb right now you're not alone not only am I struggling to share how they work as like an educator I haven't really implemented them my apps just yet so yeah if anyone on the r team wants to bully me into using them let me know use optimistic however also very confusing I have used it it's really powerful alongside actions we're introducing a feature named use optimistic for managing optimistic State updates within this hook you can apply temporary updates that are automatically reverted once the final State commits for actions this allows you to optimistically set the final state of the data on the client assuming the submission is successful and revert to the value of the data received from the server it works using regular asyn a we so it works the same whether you're using fetch on the client or a server action from the server Library authors can Implement custom action equals function props in their own components with used transition our intent is for libraries to adopt the actions pattern when designing their component apis to provide a consistent experience for react Developers for example if your library provides a calendar on select event handler component consider also exposing a select action equals action API too this is really interesting I'm I'm starting to see what they're going for here right now if I have a component that has a loading state in it and I want to use that loading state to render something differently above it that kind of sucks to do you have to have crazy call backs that are embedded in that component the call back estate selector in your parent in order to do all of this now instead of that the actual action I send to the thing is also capable of doing the updating and triggering that all the way up the tree as far as I need to wherever it's going to hit that use form status or use form state or whatever of these helpers and it means that these generics built into react now have behaviors that interface with children automatically that's interesting I'm starting this is starting to click for me while we initially focused on server actions for client side data transfer our philosophy for react is to provide the same programming model across all platforms and environments when possible if we introduce a feature on the client we aim to make it also work on the server and vice versa this philosophy allows us to create a single set of apis that work no matter where your apps run making it easier to upgrade to different environments later that's a interesting way of putting it I kind of thought of actions less as a react API more of a recommended pattern where it's the the method in which you bind things from the server to the client so such that the client can update them and send data to the server it felt like it was describing that relationship more than it was describing the actual behavior of the API it's interesting to see them really double down on the API and how it works within react I'm going to have to play with this a lot lot more I really feel like I need to understand those hooks better so uh make sure you like this video and you give me a subscription because that's going to take a lot of work new features in the react Canary we've introduced react canaries as an option to adopt individual new stable features as soon as their design is close to final before they released in a stable sver version canaries are a change to the way we develop react previously features would be researched and built privately inside of meta so users would only see the final polished product when released to stable with canaries we're building in public with the help of the community to final features we share in the react Labs blog Series this means you hear about new features sooner as they're being finalized instead of after they're complete this is also huge because the community can give a bunch of feedback and push back on things like the original RFC for Server components was not great I didn't care I even in my original video called out how dumb it was that you couldn't async await and just await a DB call inside of a server component and they ended up rewriting the proposal and making the whole thing async A8 based without weird file pathing these improvements only happen if the community is involved in the process otherwise there would be too much commitment on a specific way of doing things that no longer make sense this is a huge part of how react will continue to win and it's awesome that they're letting the community be involved it sucks that this has also resulted in some fud where people feel like you have to use a canary if you want the new react features no you can use the new react features when they're stable but if you're willing to be part of this experiment where we're learning and figuring out all these pieces you want to be there as we figure it out and finalize it you can be now and there's a whole process and opportunity here to do just that and next was one of the few that really jumped on that opportunity server components asset loading document metadata and actions have all landed in the react Canary and we've added docs to these features on react. deev the directives we've talked about a bunch I will very quickly say people seem to think these two are like opposites of the same thing where use servers for Server components use clients for client components they're not don't think that check out any of my videos about server actions in particular because these are for functions that the client calls that are on the server so if I want to post things to a for or update my user metadata or something like that use servers for that that use client is when I want the component to ship JavaScript to the client so this is I want to ship JavaScript to the client this is I want the client to be able to ship data to the server these aren't opposites they're different behaviors entirely and they're bundler features that happen to be built around react that doesn't mean only react can use them in fact solid is starting to build U server into solid start which is so cool to see other Frameworks adopting the opportunities here they Mark the split points between the two environments use client instructs the bundler to generate a script tag similar to Aster's islands where use tells the bundler to generate a post environment like trpc mutations I'm going to take a little moment of Pride here the reason trpc made it here is because trpc became a popular thing that nerds like us talk about to discuss modern best practices for full stack webd trpc mutations and specifically trpc got its first big break when I started chilling it really hard and it's so cool seeing trpc go from that weird side project that I heard somebody working on that originally came from the guy who made Zed and got taken over by Alex who pushed it incredibly far just a typesafe way to write server functions and call them in react query and now it's this legendary moment of time where we realize that the way we were communicating between the server and client was not ideal so much so that it's being cited next to Astro in the react blog post about what they're doing it's so cool Dan abov himself even tweeted basically this he probably wrote this part to be honest he specifically said that Astro islands are used client and trpc mutations are you server which is very good mapping if you know how these two things work together they let you write reusable components that compose client side interactivity with the related server side logic yes very very cool stuff it's once it clicks it you can't go back document metadata is an interesting addition here too we've added built-in support for rendering title meta and metadata link tags anywhere in your component tree these work the same way in all environments including fully client side code SSR and RSC this provides built-in support for features pioneered by libraries like react helmet yeah RP helmet in all the libraries that like did these things differently if you're curious why this matters it's cuz these all are supposed to go in head which isn't your body which is where react normally renders so if you want to render a title in your component where does that go when these are part of the framework it will handle that and throw it in the right place that's why right helment was previously so valuable because it would take the thing you put in your jsx rendered in the virtual Dom and instead of putting a similar element in the real Dom it just writes it to head instead that's why it's helmet you can put it anywhere and it goes on top asset loading we integrated suspense with the loading life cycle of resources such as stylesheets fonts and Scripts so that react takes them into account to determine whether the content in elements like a style a link or a script are ready to be displayed we've also added new resource loading apis like preload and preinit to give greater control for when a resource should load and initialize this is some remix stuff what's cool here is now if you were to use suspense to wrap your page because you didn't want to have things flash in not only is suspense going to wait for when the components get stream down it's also going to wait for when your style tags or similar things load in so you won't have that flash of uny content anymore because it won't flip to the new content until the style tag is loaded this is really cool and the fact that they expose it as a generic API where I'm assuming you can just declare anything as a resource yeah such as script Styles sheets and fonts as soon as you know you need them that's really cool so you can specify in other places that this might be needed in the future and preload it so that it's ready to go when you make those transitions good stuff I'm really happy that they're like more deep in the documentation of these things that's been a very reasonable critique of this up until now where like there's all these new things happening we're seeing them on Twitter we're seeing them in next but we don't know how to use them where's the docs finally we have some docs being linked actions as shared above we've added actions to manage sending data from the client to the server you can add actions to an element like a form you can access their status with use form status you can handle their result with use form State and even optimistically update with use optimistic when you put it that way it sounds easy but uh the behavior of these things is not as simple as I would like more coming soon since all these features work together it's difficult to release them in the stable Channel individually for example example releasing actions without the complimentary hooks for accessing the form states that would just limit the Practical usability of actions introducing server components without integrating server actions would complicate modifying data on the server as someone who shipped server components without server actions God bless trpc before we can release a set of features to the stable Channel we need to ensure they work cohesively and developers have everything they need to use them in production react canaries allow us to develop these features individually and release the stable apis incrementally until the entire feature set is complete the current set of features in react canary are complete and ready to release the next major version of react the thing we are all here for after a couple of years of iteration react at Canary is now ready to ship to react at latest the new features mentioned above are compatible with any environment your app runs in providing everything needed for production use since asset loading and document metadata may be a breaking change for some apps the next version of react will be a major version react 19 there's still more to be done preparing for release in react 19 we're also adding long requested improvements which require breaking changes like support for web components can't believe they're actually doing this they've been punting the ball on web components for so long and I get why because they don't really fit the react model great but sometimes you have some crappy web component from some third party provider like you're I don't know your rate this out of five that goes to some third party being able to quickly embed that when everything else is react that's nice I see why they're finally caving here our Focus now is to land these changes prepare for release finalize docs for new features and publish announcements for what's included we'll share more information about everything react 19 includes how to adopt the new client features and how to build support for Server components in the coming months I haven't heard the mention off screen screen in a while oh boy this is a fun one it's been renamed which is a good decision offscreen is two in the weeds technically what the hell are we talking about well let's dive in since our last update we've renamed a capability we're researching from offscreen to activity the name offscreen implied that it only applies to parts of the app that were not visible but while researching the feature we realize it's possible for parts of the app to be visible and in active such as content behind a modal the new name more closely reflects the behavior of making certain parts of the app active or inactive activity is still under research and our remaining work is to finalize The Primitives that are exposed to library developers we've de prioritized this area while we focus on shipping features that are more complete I'm happy they they called this out because offscreen has not been mentioned much the best I will poorly teal the art here is it gives you a way to run things in the background such that they're not blocking the main react thread but they're still going on so when you change views like you have a canvas that's been hidden updating in the background and then it reappears that it's synced already without having to render everything you can keep running the virtual Dom without having the real Dom update until you choose for the real Dom to update kind of in its own thread it's it's a lot in addition to this update our team has presented at conferences and made appearances on podcast to speak more on our work and answer questions really good stuff here the two reacts post I have a video about that that was really good too lots of cool stuff here I need to pull these people on the show more normally I just DM them a bunch and then shout at a camera later on but this is a great post really thankful they've been writing these again h shout out to the whole team everybody involved both with the communication of these things as well as actually making these changes possible well uh that was quite an update let me know what you guys think in the comments and until next time see you later peace nerds ## React 19 is finally out! - 20241209 the journey to react 19 has been wild to put it lightly there has been so much work going into this release everything from the new server component patterns to all the crazy stuff with used transition to the ways they kind of broke suspense but not really it's been a journey but we're at the end of it and react 19 is finally stable and ready to use today not that you couldn't use it before I'm sure a lot of us were on nextjs and taking advantage of the canary with app router and ser you get the point is actually officially stable now and there are some changes that are really important to understand so if you use react make sure you stick around but first a quick word from today's sponsor today's sponsor is bold. new and I actually already shot this ad and I threw it away because I just learned something that I think is more important than all of the other stuff I've recorded if you don't already know b. new is the quick way to spin up an app using Ai and actually prompt and have a whole editor in the browser it's by the people over at stack they know how to make a good editor in the browser and it is one of the best ways to start your new app today what I didn't realize is the entire thing is open source what why did no one tell me this whole thing prompts and all they're not hiding it so if you don't want to pay you can go self-host it and do whatever you want I've even seen people forking it and throwing it on Docker but I just think it's really really cool that you can go in and actually understand how it's generating your code that makes it so much more trustworthy than all of the similar Tools in my opinion like I'm a cursor guy it's closed Source I don't know how it's generating stuff here you go see every single little bit and it's not like it just starts apps in one specific way that they like you can tell it to start an astro app a remix app a spelt app think you even tell it to do a python app it knows what it's doing it can even make presentations with slev and when you want to deploy you just tell it to deploy and it does it automatically for you on netlify I've been really happy with both it's been a super fun way to start building your apps and you should give it a shot if you haven't check them out today at soy. l/ bolt or you can just go to bolt. new react 19 is now t for what it's worth most of this post is the same as the release candidate post back in April I have a whole video about that if you haven't seen it kind of crazy to think it's been since April that the release candidate came out but uh we're through it it's here let's focus on the important New pieces which are improvements to suspense and the reactdom static apis both of which are really cool the suspense changes are what held up the react 19 release to quickly TDR suspense is a way to have a good fallback State when components are doing things that are asynchronous be it fetching data generating things that are require an async call just things that you don't want to block your main thread for previously the way suspense worked is it would try to render all of the components go through all of the children one at a time once it was done it would check to see if any of them were waiting for things and if they were it would throw into the fallback state which is in this case just a loading div the problem was it had to go through all of the sub components and start their renders before you could get to the load State react 19 originally introduced a change where it would go through these components one at a time until it found one that needed data or something that it was blocking on and it would immediately go back up and throw the fall back and then go through the rest of the components one at a time the problem is that means all of these aren't being kicked off at the same time back in react 18 this would have taken 3 seconds to render roughly because all three of these components would have started at the same time so this timer this timer and this timer are all going together in parallel because of how Facebook uses react they fetch all of their data at once when the page loads so having to wait for all of the components was causing the fallback Behavior to be slower so they decided to just stop once the first component is hit and not start the next ones but if you're using react and suspense in a way where you actually want to kick off all of these things at once the performance was really bad most people aren't using suspense at all to be fair but the ones who were were not using it too too often in that way I know if you're heavy on things like use suspense query and react query or deep in the react 3 fiber world you might be using it for really cool stuff and if you are doing those things this was a really really bad change there was a bunch of outrage I have a long video detailing all of that but we finally have a resolution now in react 19 when a component suspends react will immediately commit the fallback of the nearest suspense boundary without waiting for the entire sibling tree to render that's the change I was talking about before but they added to it after the fallback commits react schedules another render for the suspended siblings to pre-warm Lazy requests in the rest of the tree what this means is after it realizes here oh this is suspending throw the fall back then go through and kick off the rest of the children for their renders that allows you to get basically the exact same performance while also getting the fallback State much earlier which is an awesome change for us suspense NS this primarily benefits big code bases with giant components especially those that are heavily using suspense most of you don't have to worry about this but it's awesome that they found a compromise here that allows for a code base like Facebooks to be as performant as possible while also allowing for us to use it for crazy things like we see in react 3 fiber and as they show here you had to wait for all of the children before you could see the loading State now as soon as one child suspends you see the loading State and the rest start to get rendered this change means that the suspense fallback displays faster while still warming lazy requests in the suspended tree this change took a while for them to get right to get tested everywhere they wanted it to and this is the change that blocked react 19 it's here it works they released a ga of this a few weeks ago everyone seems happy I haven't seen anyone complain just yet so I think I hope this is the end of the suspense drama what a susp ense F event it has been just to show this is a very good change Dominic who is the lead maintainer for react query and tan stack query did a quick demo using the new version of suspense in react 19 said it's not quite the same as it was in V8 but it is definitely the perfect trade-off he was very happy with the results so he said start fetch one then start fetch two render fallback both fetches used to start at the same time react 19 would render the fallback after fetch one wait and then start fetch two now it starts fetch one renders the fallback and then right after kicks off fetch two you get the fall back faster and you have to wait for the Finish awesome A++ we're going to cover the other big change quick and then we're going to do a higher level why you should care about react 19 the other big change here is that react Dom static has a couple new helpers for static site generators pre-render and pre-render to node stream these new apis improve on render to string by waiting for data to load for static HTML generation they're designed to work with streaming environments like nodes streams and web streams for example in a web stream environment you can pre-render a react tree to static HTML Now using pre-render so here we see we call the pre-render function from react Dom static we pass it our app jsx component our app we give it any bootstrap scripts that it requires for things that it does we get our Prelude which is the response that we want to send to the user and then we can return that as HTML prender apis will wait for all data to load before returning the static HTML stream streams can be converted to Strings or sent with a streaming response they do not support streaming content as it loads which is supported by the existing react Dom server rendering apis this is really cool because it allows you to do like a static HTML pre-render or even like generate something like a Blog that doesn't need react code at all in it in the client side at least but you're still able to use react on the server kind of gives you all of the benefits that you're looking for really nice win and I've seen some really crazy stuff going on with this so previously if you wanted to use react on the server like this you had to use their pre-render function from the react Dom server package which presumes that it can resume the results on the client side which is which isn't always the case and you'll see it still has the Prelude and postponed concept where the Prelude is the first thing it responds with the postponed is what comes after nice that these things are accessible in places that aren't just the crazy server component world like everyone should be able to pre-render their stuff and there's a lot of places this would be very beneficial and since it's a static thing you can now run this in something like your build instead of having to use this for a server rendered thing very nice these pieces are going to make it a lot easier for people to make their own I don't to encourage this but you can kind of more easily make your own bespoke framework light around what these Primitives offer and I'm really excited to see more bespoke react Frameworks popping up taking advantage of these things we have Sebastian lber here who is planning on using this for SSG and docurus I also saw that you now have an RS pack option for docusaurus that's really cool to see great work on all that docusaurus is one of the best options for documentation yeah there's no render to string equivalent in react 18 very good context to have render to string was always a bit slow but it's good to see that we can get around all of these things I certainly talked about this in the previous video but it's so nice that we finally can get way better diffs when we have hydration errors hydration errors are the worst I totally understand why people want to leave react when they run into them for the first time now we get way better errors where it says why it thinks the thing happened why the branch between server and client may have occurred in the specific diff that it sees in the HTML really really nice for the weird cases where your server and your client render things slightly differently hopefully by now you have a rough idea of what react 19 specifically is adding but I want to talk more about the mindset shift that react 19 represents back in the day when we built something with react it would look something like this where we had our HTML had ahead it would load some script it would have a different metadata in it like your title stuff like that on the head and then your body would have an ID rout or even more commonly app and one of these scripts would be script Source equals app bundle.js so when you actually went to this website it would have to fetch all of the things you have up here all the CSS all the script tags and show you whatever the default state is in your body until the JS loads and then can come in and take over from here react didn't start until the page had loaded the JS had loaded been parsed and run and then you were actually using react nextjs had the goal of taking over this part and giving it a bit more of a relationship with the react code let's say you have a specific route that needs a different title like on Twitch when you go to my channel it should have different data in the head tag so when you send that link to somebody it can correctly embed the metadata in the Discord message the Tweet whatever else using the right info for that specific page previously this concern largely existed outside of reacts area and that's why something like next was so important because it allowed you to control those things on a per route basis while using that alongside react that was nice but it was really like a a one-way relationship where it was like nextjs wrapped the HTML which wrapped the react so if we were to diagram this it's kind of like we had HTML and then a smaller Circle in here which was react but the HTML was just the container that the react was in react had no control of it but we needed more control of the HTML so new tools like nextjs were made in order to give us that extra control also to fix the wos that were our bundle and everything else alongside that over time we've realized that this isn't ideal because it's very One Way nextjs can do things outside of reacts bubble but all it can really do is create the pages in the environment it can't really interrup with the react part on the inside the perfect example of how this worked is something like get server side props where you would have a function in a specific route on your code base that would generate data and it would pass that to the top of the react app that you would have to pass down component by component but the idea of something within react having access to something from next wasn't real the only way a given component could get something from next is if you passed it to the root and then it went through all the way down to that component if you you open up any page router app using next you'll see there's a little next data tag that gets embedded in the HTML that has all of those page props so that if a component tries to access them it has access there to then pass it through the react app but literally what is happening here is nextjs puts a script tag in HTML and then the react code is told to fetch that data from that point in the HTML there is no relationship between these they can't pass things back and forth it's literally just the from next being embedded in the HTML so that react can access it kind of like passes down back to react but there is no way for the react code to go back up and request different things request an update and really do much of anything it's just that next sends things to the HTML that then react has access to the new model is fundamentally different here in a way that's really exciting and honestly I can't really think of how to diagram it because it's kind of like react is just at all of the levels now so if I was to do this the like complex literal way it would be kind of like I put another circle out here that is also react but I don't think this is a fair way to think about it this is what it seems like when you first discover all these new tools and technologies that react is now this greater thing on the outside that is that controls your server and changes how everything works but I think of it a bit differently I think of server components in this whole new way of building almost like a bridge between the parts so we have this path that's been made between the server side the HTML that the user gets and the react side examples of how this works are things like the power of static rendering a component for your shell the unique capabilities we get with streaming where you can send down whatever is done immediately and then stream the rest in later which fits like the HTML layer and then all of the Power around the like passing something that only runs on the server down to the client my favorite demo and I have it in this project actually so here we have your classic tab component we've all seen these in docs where we have tab a b and c you can click to swap between the three if we look at the code things are going to be a bit interesting we have the page component which doesn't have used client which means this is a server component by default now when we look here we have my tab wrapper component that I imported and I'm passing it tab contents tab is a tab is B and tab a c so you would expect all of these to be logged there because I'm passing these components down so when the react code renders on the client that means it has to console log those right kind of they made a nice change where the logs on the server now get passed to the client so you can see them but in production you wouldn't get these logs because in production this code doesn't run on the client and it doesn't run on the client here either these logs are coming from the server because all three of those components get rendered on the server and then their results are passed down so that react can swap between them on the client side you can pass a server component's rendered output as a prop to a client component and then use client side state to swap between those different server rendered States this type of thing is what makes the new react model so special it's not just adding a couple features here and there to patch these broken parts it's rethinking how react interfaces with all of these other things the way I kind of think of this and it's going to make very little sense and I'm going to apologize in advance the first thing I would change is I'd put client in the middle here not react although obviously the client JS is running react but what react now thinks about is what subset of all of this can it provide the happiest path to so that the other half is way less complex I've almost felt all of these circles shrink as a result of how these new patterns work where a lot of things I would have to do to like generate a static shell for the different pages I had render something on the server and only pass down Parts I want to the client all of these things required so many hacks and so much weird F just just weirdness with your JS that's all gone with that the model is now very different and we have to think differently about how we write our react there were so many patterns and paradigms and ways of building that we had to do these ways because of the complexity around react like I know at twitch we had a go service that would generate the different HTML shells for different routes that would all just load the same react code in the end you might look at this and think it doesn't benefit you and something like server components doesn't matter cuz you're rendering everything on client hear me out for just one second let's say your page wasn't just this tab wrapper let's pretend it has a lot more stuff that it needs wouldn't it be nice if you didn't have to wait for all that JS to come in to then tell the browser everything else it needs like let's say this component has a specific font it needs or some CSS it has to load if we use server components literally just as a top level static wrapper and send everything else down on the client when it's ready you can basically move any existing react app to this pattern have a slightly better static shell that allows you to stream quicker and start fetching things like the fonts a little bit earlier previously you'd have to wait for the whole HTML to load then it would kick off the JS load if it had the CSS embedded in there awesome it can start if not it has to wait for react to then figure out what CSS it needs you end up waiting for the HTML then for react to load and run and identify what it needs off and it has to load additional bundles then you have to wait for it to add the right tags into the page to fetch things like your CSS like your fonts like all this other stuff while at the same time the content is starting to render with this model react can hoist all of those depths up so that they're in the HTML tag as soon as the page loads and then everything else comes in when it's ready this doesn't mean you have to run react on the server this is one of the most common misconceptions with server components is the idea that it has to run on a server when ever you go to the page there's a very real future coming where you can static render the server components where instead of thinking of a server component is a thing that runs on the server you could think of it as a different place that react was rendered in technically your Dev machine is a server so when you run npm run build on your machine you are running those server components on your device as a server and now you have those static pieces that come in on the client side when it's ready that is a really powerful thing the idea of server components not just as the thing that you use with nextjs when you run react on the server but as react being the piece that generates the HTML layer it's taken react's area of concern it expanded it slightly but it allows us to do the right thing for the user much more easily and to not have to patch that in with a ton of other tools I've seen some chaotic stuff of people brute forcing pre-rendering into react by doing things like spinning up the server hitting it via Puppeteer or playright saving the HTML response and then using that as the static site even Frameworks Like Remix used to recommend this strategy as the way of building your static parts of your react site the reality is that every website has some things that are static and some things that are Dynamic react used to only care about the dynamic parts and making those as easy to work with as possible and the reason for that was just that the dynamic parts were hard to do at the time when react happened static had been figured out we were deep in PHP and we were more than happy but jQuery was the wrong way to do the dynamic Parts it was better than what we had but it wasn't good enough Rea made Dynamic great it made it so great that static started to fall behind and the thing that's changed here the real mental model shift is that react isn't just concerned about the dynamic part anymore it's concerned about the holistic set of pieces that have to come together to make the experience great they're not prescribing every solution to every one of those parts but they're giving us what we need to assemble it how we want that's why things like the static apis are so useful because this shows that they're building ways for us to take advantage of this mindset in these new benefits of react without having to adopt something like nextjs yeah as Sebastian said Here remix and react router 7 do have pre-rendering and in the implementation it's surprising but they spawn a server and send real requests to it to generate the HTML that is how we've had to do this for a while but the ADV of these new apis is you could do this without all those weird hacks and the amount of those hacks that have made it into production the majority of like Fortune 500 react sites are probably doing something like that there's even a famous story of Netflix removing react what they actually did is they rendered the react app for their signin page on the server filled in a little bit of JS to make the form active and now they're sending almost no. JS to get started with Netflix which helped them improve load times on the first page once you're actually in the Netflix app obviously they're using react for everything there but since they built their own crazy pre-rendering you get that homepage faster and as I said here it was only for the landing page and they still used react the point being you can do a lot better now and react not being client only might frustrate people because they don't think of react as an HTML generator or serers side framework or any of these other things but the reality is Javascript providing a good experience for the user requires the right things being done on the server layer the data layer and the HTML that the browser actually gets now these are all pieces that react is thinking about and giving us solutions to that is a really nice shift and the results that are coming from it have been awesome that said I know a lot of people are concerned that this means react is leaving the client and focusing more on the server and the static rendering the pre-rendering data fetching all of those parts I couldn't be more certain you're wrong and there's one really big reason for it here is my proof see how this has literally no lag that's because of a new thing that makes react on the client significantly better the react compiler the react compiler efforts are entirely client focused these don't benefit any of the server or pre-render or any of those parts at all this just makes the client experience faster if I turn off the plugin and we go back here look at the lab see how far behind that falls even though I'm on a really beefy M2 Max computer here since I'm updating that state and every state update is causing this slow component to render this now lags terribly and all you have to do to fix these types of things now is use the new compiler which is built around react 19 thankfully they somehow got it to support 18 as well really cool they did that I want to make sure you guys understand that the react team isn't just leaving behind client this app here is a app it has no concept of server components at all you basically couldn't really do server components until V V6 which just dropped the point being these demos work well on client apps because these benefits are huge for everyone yes this is a great way of phrasing how the build stuff works edart it's like the components are being made before the page is deployed they're being made in the build process you could do this with static rendering in nextjs but it would have to render the whole thing the idea of partially rendering a shell having some pieces that get passed down and the components can render the big thing you couldn't do before is if you had a client component that needed something you couldn't pass it something statically rendered on the server let's say like if I had my Tab demo here in this tab wrapper component was slow for some reason like I had to fetch some data I had to do something on the client side so it couldn't be part of that static render we can still static render the tab contents the things that we passing it as props so we can have that be built at build time and then on the client this gets loaded on the client and these static pieces get passed down as part of the actual build output which is so cool we no longer have to have the static part go up until div ID equals app which is what it was before if we look back at the old way of doing things NEX would allow us to make the HTML static up until a certain point in our Dom and as soon as something was Dynamic enough that we didn't want in our static bundle everything underneath it had to be similarly Dynamic that sucked that was not great and I've had to do so many crazy hacks in order to make sure the static Parts can be static and the dynamic Parts don't block it that's just kind of gone now and once this interweaving thing locks in your head and you realize what the new model enables in terms of the relationship between static Parts Dynamic server side parts and client Parts it all comes together in a admittedly a little bit of a mess but a really really powerful one that reduces the amount of complexity in how you build significantly every time I go back and look at something I built the old way I find a bunch of hacks I did to try to force in behaviors like this now that's not a problem and the compiler is very similar in that way the compiler is taking things that we had to like hack around that made the react experience I would argue just worse like if I wanted to take these demo components and make everything work the same way react compiler did I think I had to add five memo calls to these three components I had to memorize props I had to memorize functions I had to do a bunch of use callbacks and it made the react code much harder to reason about even though I was writing better code in the sense it was the correct code I was writing worse code in the maintainability and any small change could have broken it keep an eye out for the video All About react compiler and the render problem coming very soon but it's important to understand how much worse the code you had to write was to do the right thing for the user if I memorize Color Picker it doesn't matter because I'm inlining this here so in order for this to work properly I would have to wrap that in a used callback I would also have to do it up here because if I pass this this Anonymous function that gets redefined on every render if I take this same code and throw it in the playground for The react compiler you'll see it has this weird dollar sign syntax sorry those of you using jQuery alongside react compiler what it's doing here is memorizing every single piece so it doesn't have to be revalidated on every render you could write code like this you'd probably write it with more used memo Ed callback instead of all of this chaos the point is that you shouldn't have to write this code because it makes the experience of authoring building maintaining code reviewing and everything else significantly worse what I only recently realized is that this is what the new react model on the server is doing too the goal is to take all the hacks we had to do to do these types of pre-rendering things and just make it not necessary it's destroyed a whole dimension of problems that's always been what react did react would take the way we built look at the edge cases and how rough they were making our lives and figure out what it would take to not have those cases exist at all good Engineers write bugs great Engineers patch bugs 10x engineers make them impossible to happen in the first place and that's what I'm excited about here as much as react made weird States hard on the client it didn't solve the client server problem now it's given us the pieces to solve it how we need using as much or as little as possible to build the best possible thing for our users without making the code unmaintainable for anyone other than a wizard I am so happy with this release and what it enables for the react ecosystem and for the web as a whole and don't forget about react native because they get some real cool benefits here too that's all I have to say for now keep an eye out for the server components on mobile video as well as the react render video all coming very soon make sure you're subbed if you're not until next time peace nerds ## React Compiler It's Stranger Than You Think - 20240608 some thoughts on react compiler a lot of us have a lot of thoughts on the compiler but coming from Dan I think these will be very useful I briefly skimmed This Thread when it dropped but I haven't had a chance to really sit and digest it and there's some interesting bits in here I think are worth digesting because the react compiler is both really simple and an incredibly complex piece of technology that I think is worth diving into and digging in a bit more on what it is how it works and why we care let's dive in thank you Dan as always for making great content for me it's undoubtedly an impressive piece of engineering that can make people skep like how do you trust something this complex I think it's being received so warmly because its output is easy to understand like almost all YouTube overviews correctly explain the generated code I did not expect to be sub tweeted in the first piece here Fair yeah LOL if you haven't already seen the code I would recommend my videos but honestly Jack Harrington's done an even better job and he has a great video about the compiler where he really Dives in and shows what the output code looks like and why we should care check out his react compiler in depth Beyond react comp video If you want to go real deep on the inner code but that's not what we're going to do here cuz enough videos about that mine has a bit too it's interesting stuff I'm talk about how we think about it I think it's about more than debug ability it's more like you know what the compiler is doing because in principle you could do the same transformation by yourself it's just annoying to think about code this way simple input simple output to double down on this point we've already seen the performance wins you can get when you memorize everything properly we've seen the benchmarks in things like that one JS Benchmark everybody loves the site where all the roads moving around a bunch the one solid wins accidentally the interesting piece here is that when you run that same code through the compiler it doesn't end up being meaningfully faster than the memorized version because it's the perfect simple memorized solution the issue with building that way is as the code changes and scales gets bigger more things are added things are removed all of that that model gets worse it turns out when you're thinking a lot about references and memory and how things are allocated and updated that building it the first time correctly in a simple example isn't too bad but as soon as the complexity starts to ramp up as the requirements of the application grow and things start to change it gets way worse which is why I think rust is a bad decision for a lot of projects because if the projects requirements are ironed out perfectly and your goal is to just eek out all the performance absolutely rust will be a huge win but as things change over time as things are maintained over time as requirements shift as expectations shift as the actual things we're building on top of change having code that is flexible and adjustable as a value in the same way that memorizing all your components and all your Hooks and dat sucks managing your memory sucks too just let the garbage collector do its thing just let the compiler compile your memorization for you I like the solutions that acknowledge that there is a best way rather than Force developers to write everything the best way what if you just make it close enough and you do that aggressively that's where we start to see these massive wins and that's what the compiler is doing I think react compiler makes react feel a lot more like go as silly as it is to say because you don't have to manage these things yourself can go code ever be faster than perfect rust code no we don't expect it to be we expect it to be faster to write make changes to Etc and to be close enough performance- wise that we don't care but if you know how that code works if you know what rust is doing then you go to WR go you may be like wow I wish I could see underneath this is the cool part of the react compiler you can go look at the output and if you know how that deeper level works you can actually understand what it's doing but more often than that probably don't even need to another thing that I found interesting was how it treats your existing memorization it will rewrite your component with your use memo but only if the compiler's memorization is guaranteed to cover the same values that you manually memorized otherwise it just skips that component so if you are doing that manual memorization you do think you know better than the compiler it just throws up his hands and says hey cool you do your thing we got you which I love the fact that it doesn't override decisions you did make it just adds better Behavior around decisions you didn't make that's the magic if the compiler was making massive changes to the way that your code ran or the behaviors you would expect from it that would be bad if you write an explicit decision in your code and then it changes that that would be bad too if go let you manage memory and then over Road the memory management decisions you made later on that would suck but if go just doesn't have you do that at all and it just does a good enough job for you under the hood No One Would Care and we've seen that as even developers like Prime who are massive fans of rust and how it works are moving to a language that is worse to write let go because thinking about these problems is just so painful and miserable but this is a genius little piece as Dan says here this in my opinion is pretty ingenious it means that you don't mostly need to worry about regression in your logic like effect dependencies depending on memorization due to the compiler memorizing things differently from how you did the compiler will just stand aside if it can't match your existing code then there's the whole rules of react thing those rules aren't new but they've always been implicit the compiler enforces quite a few of those rules statically which means it's the first time we have something like a linter for react language rules like don't mutate props yes finally it's actually kind of funny that one of the most ated wins from the react compiler has nothing to do with the compiler at all it's the better es lint rules that you can now apply to your project because with react compiler if you're not following the rules of react it's not as easy to optimize it just won't be able to make his performative code so they need to wait for you to more easily see if you are aren't following those rules the existing rules of hooks only covered Hooks and only kind of covered them the new rules of react es lint plugin covers components covers memorization expectations it covers so much more which means that your code is going to be better even if you don't use the compiler if you just follow the lint rules instead there's the whole rules of react thing those rules aren't new but they've always been implicit the compiler enforces quite a few of those rules statically which means it's the first time we have something like a linter for react language yeah like don't mutate props I think people forget that props are mutable they aren't in strict mode kind of it's a mess but the fact that this is a thing you could do hopefully most of us realize like don't do that like if I say function parent and I have const data set data equals sure I'll even give a first here and we return some child which I'll make here function child and this takes in props name String cool child name data zero I can make this a string array I'll make it names props do name zero cool so now we're passing this array of names that we have in this UST State call here which I should import and this is cool and fun we have the parent has this data child names what if I did this onclick equals names. push new name I need to do props that name is cool what does this code do we are now pushing the new name on to this object that we passed in this array that we passed in the fact that you can do this and react is supposed to somehow magically handle it is absurd and this might seem like oh why would anyone write that code I'll show you why they would write that code let's say that we put second then first but I want to render these as a list let's write that list rendering code quick we have a div we have props do names. map we've all seen code like this we have this data second first we pass it to the child the child renders as a list what if we want this list to be backwards that seems nice and inconspicuous right right what's really funny here is that data array here is being modified because we're able to mutate the prop which in and of itself disaster but we also are calling reverse which intuitively doesn't seem like it is modifying the original array it is actually changing the array that you started with the only way to do this code safe would be something like this where we spread props do names and then we reverse it so we have a fresh array instance here but this is where reacts prop passing breaks down it's not even a problem with props itself it's a kind of a problem with JavaScript where there's no way to say hey just because I passed this doesn't mean you can use it however do not mutate the thing I passed in in an Ideal World which believe me I wish I lived in one as a functional programmer arguments would always be immutable there would be no way to pass by reference everything would be passed by value and would not be able to be with in these ways and I cannot tell you how many code bases I found especially before strict mode where bugs like this would cause everything to break down because every time this component renders it's going to flip the lists order which is just insane and it's so easy to do this like so easy somebody said what if we made it as const good luck where would I even put that if you read only the prop here then we get an error that it doesn't exist on readon string array so if I do that but no one's writing code like this nobody's wrapping their props with read only I believe me I wish they were but they're not strict mode helps with this because it throws a bunch of Errors if you try to mutate something that was passed as a prop it just yells at you for it but uh yeah I don't think passing as reference makes any sense in react and I wish it was always pass by value but since we have to pass by reference because it is Javascript we need something to make sure we don't mutate props and with the new lint rules you'll just always get those errors instead it's it's better than a linter because when you fix the rules violations your code just gets faster because the compiler doesn't skip it anymore so we finally have a carrot for writing idiomatic react code which is good for all other features and generally helps avoid bugs great this is another fun underrated fact by saying our code can only be react compiler compiled if we follow the rules means that random people at your company they don't feel like following the react rules because oh I don't really like react that much and I can do this this other way instead those people now have a factual reason they're wrong that isn't just Vibes that is very easy to point and very hard for them to talk on the compiler being a Target that you can dangle a carrot in front of these types of people makes it much easier to pitch these types of things very exciting stuff I love this slide from the introduction talk such a clear proposition same code but faster who doesn't like hearing that python devs because it triggers them because they been promised that and not gotten it so many times but yeah I I love this and I will say from my experience with the compiler all the projects I have it running on I've had to make no code changes too which is really really cool let's talk about the same code bit the of react compiler is that all the information necessary to achieve fine grained reactivity is already in your react code you can see it with your eyes that's why it felt annoying that react isn't taking advantage of it this is a very very fair point it's easy for us to read the code and say hey these filtered songs only change when song changes why do I have to manually tell react hey this only changes when that changes we can read the code and see just from reading it what it's supposed to be obviously it should be memorized why do we have to write that every single time and even with proper fine grained reactivity like exists in other Frameworks like solid they solve this problem differently you're still being explicit when you do it but when you're being explicit as you do it the syntax is a little bit better because you just call the thing that you're trying to b instead because there's no such thing as a traditional data value in the like signals tree that exists in solid you call the signal to get the data out of it but then you lose a lot of the rendering behaviors and things that make react so nice to work with not saying solid is bad to work with is actually very very nice to but the mental model has to shift in order to get those performance benefits what's going on here is that you don't have to make any mental model change at all the thing that you're looking at is going to be compiled into what it obviously should be doing not what it is doing what it should be which is a gap to be clear but I think it's about as big of a gap as jsx is where does the average react Dev know that jsx is just calling a bunch of functions in a chain probably not they probably are just looking at it like HTML will the average reactive in the future know that this is being wrapped with a used memo call probably not but code is faster anyways this is why I'm excited because the average react Dev doesn't have to care about all of these things even if you and I can sit here and nerd out about it in a video like this the average react Dev isn't going to watch this video the average react Dev isn't going to give a the average react Dev is a thing I have a whole video dedicated to if you haven't watched it already I love that video I wish I got more views watch this one if you haven't I think it'll be very clarifying in terms of what react devs do and don't expect on the day-to-day not the types of enthusiasts and lunatics like y'all who watch my videos but the people that you work with at your jobs there's a huge gap between these things and I think it's important that we acknowledge it rather than pretend it's not real as such this is cool because for those people it just works in order to do fine grain re rendering the library needs to be aware of the data flow there's a few ways to do this one way is to wrap the values in the Setters like viewer mobex so that you're not dealing with plain values anymore we really like our raw plain values in react again love this if we look at solid JS again I know I keep using solid as an example with signals in solid this might look a lot like a hook the key is that you don't have to call this in a component you can call it anywhere but to use first first isn't a string first is a function that when called binds a signal to where it was called and Returns the value so the magic here is now in this effect whatever signals were called in this create effect will now trigger when an update happens so if we call set first or set last it's going to rerun create effect because we called first here the issue is that first now isn't a string first is a function so we want to pass that around if we want to transform it and do all these other things we have to plan accordingly we have to build from the place the value was created to the place where it's changed to the place where it's consumed it has to stay a function or be wrapped accordingly because it's not bare values bare values are what you render in solid they're not what you pass around and use in solid whereas in react as I showed here I just pass an array of strings I can put console.log data here and it just does what you expect that won't be the case in solid I could do this in solid and now it will run once and not again unless I all Al wrap it in create effect and if I do this in solid to be very clear this is the difference between solid and react here to console log data in react you do this and now whenever data changes we'll console log to do it in solid or something similar we have to wrap it with create effect we have to call data as a function and pass this an anonymous function that then binds a signal to run this console log when data changes this is nice in a lot of ways because it's very explicit you know exactly how the data is Flowing but it's also hate to say it this way not JavaScript in the traditional sense because we have data and we expect whenever this is reassigned that what's underneath gets run and that's not the case in solid you have to to bind what runs it has a lot of benefits it's the ultimate in performance because you only update when you tell solid itself to trigger an update but is nice as that is and it is nice it also comes with DX hits and react has done their best to find a compromise here and they found a very interesting compromise another way to do this is to do what solid does splitting the code into two phases non-reactive construction and then the reactive template but then you have stuff like when which is yeah a real component in solid because you can't just do what we're used to which is like if data. length is zero return no data this code can't be done in solid to do this in solid I'm going to whiff this because I haven't used solid recently you'd have to do like when condition data link zero data and then another when not or like else type components and yes solid actually has when's fors El's all these things because it's not going to rerun your component ever solid runs your component once and then you force updates separately making the average app faster is a really good thing if the defaults lead you to more success than certain problems disappear or they're delayed significantly so in that sense it does have something in common with signals idiomatic code is the most performant thank you Ryan for being one of the few reasonable people about all this yeah so we have a show element which has when condition and whatever children you pass it it renders and if the when condition isn't met then they don't render but the fact you need a show component in like a four component yeah there's a four component for if you want to do a list so instead of state. list.map you would have to do four each state. list and then the children implies this behavior these things aren't terrible these things are uh interesting different Frameworks and solutions do this differently but I've always been amused people say that react is the ugliest or whatever because react's the only option that's actually JavaScript where you're just using the value and using IF statements and fours and all of these things in your code in the solid example we encode the data flow graph into the structure of our programs at runtime we use Constructors like when or as I showed show and memo blocks all to tell the computer what the data flow graph actually is the data flow graph is already in our react code we can see it songs flows to filtered songs which then gets passed to the playlist we see the flow why should we have to write more code to force the flow what if the flow could just happen we can see the react data flow graph when we look at the code because we have access to the code unlike react itself at runtime so react approach is more similar to spelt three analyze the code ahead of time and restructure the output program to have fine grained reactivity now we're talking also don't we love the acknowledgement from the react team that Rich Harris was actually right all along because I think we'll all slowly realize this over time spelt essentially the following if previous count does not equal count update counter count react compiler is essentially this let jsx if previous count does not count jsx is this new value else it's the previous value it's the same principle but with inverted Direction in react we return stuff yep good question did Dan go back to meta no Dan can be part of the react Team without being at meta only I think it's like 2third or so of the react teams at meta right now but they're spread all over the industry stands at Blue Sky there's some people who are at uh all sorts of random places people at Microsoft contributing to react team now the react team is a much wider set than just people who work at Facebook on react these aren't completely equivalent of course there are many interesting differences that I'm sure folks will dig into for example consider a case where you have the following cost n is list 1. length plus list 2. length suppose item moves from list one to list two so both of their lengths have now changed with spelts default approach as far as I know which could be wrong here changing the list sets off a reactive chain of changes and the stuff using n invalidates however n actually hasn't changed if we're going from 2 plus 2 to 3 + 1 their sum is still four react compiler bails out here because it compares the result n this has benefits and negatives and leans into the react thing of we like values if a shallow comparison of these values be it strings numbers those types of things that are easy to shallow compare confirms that this thing hasn't changed it bails out then anyway that's the details the other thing I wanted to highlight is how projects like this really need the right set of people at a right point in time there were multiple attempts at building something like this before but it just didn't happen one interesting piece here that I learned some insight info is that Joe uh Joe saona ian. JS the other JS at meta he's a wizard he got real deep on the react team because he was trying to get relay stuff working properly and getting relay working the new react model was so painful that he was ready to rip it all out and like upset about it then he had enough sitd Downs with react team people that eventually convinced him that this way was the right way but he was still upset enough about performance that he ended up building the compiler but Joe went from frustrated with react for not making it easy to build something like relay into react which is the best way to do graphql probably ever where actually at like a low level triggers what things should render as a single query it's nuts and it's super performant but to get the performance characteristics he wanted react had to let him hook in from outside they stopped doing that and things like a usick external store suck and don't support transitions it's a mess and he hated that so much that he started arguing with the react team eventually understood and understood so well that he realized the problem wasn't how he was hooking into react it's that he had to in the first place and a lot of compiler and a lot of his efforts on compiler came from his frustration building data libraries that integrated deeply within react I know that the compiler was in the thoughts of react team sits before hooks but Joe taking over and being the one to really push it was the result of his really rough experience doing these things in the past some of the early react compilation experiments were done by true ADM who yeah is Dominic by the way now working on spelt at versell which is funny for so many reasons because yes versell poached somebody from meta again but not even to work on react stuff to work on spelt with Rich but how crazy is it that he was working on the compiler for react for a bit and then ended up going to work on solid anyways prepack was part of the work he was doing and prepack didn't work out but it did lead to two things it led to because prepack showed how hard it is to optimize classes it became clearer what an optimizable API would look like and also resulted in rsc's which is kind of nuts that their attempts to build a compiler for react LED them to building both Hooks and server components just a wild quote Sebastian had a vision for an optimizing compiler for hooks pretty early on but it was just an idea nobody on the react team had real compiler expertise and usually compiler people tend to not be deep into UI so it's hard to find someone who would be a good bridge between those two worlds this is an interesting and valuable point like we've already seen how hard it is to get back in and front of people to get along much less be the same compiler people are like a new extreme of backend people it's like the next couple steps back the distance between being a compiler nerd and being a web dev person is just so large the likelihood that they would be the same person is near zero so finding these people was really difficult one of the original Legends on this was uh Zan hang hopefully I pronounced his name right he used to be part of the react team he was working on forget he gave the original Legend presentation showing how magical forget could be but eventually ended up leaving to do his own thing he's actually he's yeah he's on he's at bite dance now and good for him I'm sure he is super happy it seemed like he wanted to be working on like platform and application code more again happy for him but he kickstarted the compiler and is a big part of how we got where we did with it so huge shout out to him for that but to go back to what we were saying here he was the first one to pick up the project he was excited both about the UI part as well as the compilation part and his work led to a prototype that showed the promise of the approach the model still wasn't quite right though and it needed some rethinking the current iteration of the compiler was done by Joe I mentioned before as well as M Zen who is a wizard Saia who also presented did a really good job and his knowledge of compilers and everything related to them is nuts also Lauren who I had a lot of good combos with actually both mfet and Lauren were fantastic to talk to and their understanding of these things was nuts Legends and cassin I'm not as familiar with John I didn't get to talk with him at all at react conf but I've only heard great things but this is like one of those rare wizard teams usually when you have teams like this they're for building the whole thing like react to have a team of people this talented this dedicated and focused not building react but building an optional compiler for it is nuts and these people all have both UI experience and compiler expertise we didn't have that years ago but these people come together and at the point of their careers they were able to solve this problem yep I don't think this part will get enough attention and I hope it does more this is as much a miracle of team building and Alignment as it is of technology I would possibly make the argument that assembling this team and leading them to build this is as impressive a achievement as the actual implementation details themselves this is so cool love these guys for doing this it's an incredible project one more quick quote cuz I thought this was interesting some people say the react compilers are in Mission that Ed memo sucks and that we pivoted in response to the feedback in reality we had a sufficiently smart compiler in mind the whole time when we were on hooks in the dependency array pattern never would have shipped otherwise yeah as Dan said before hooks came out of the research on a compiler we've always been Believers in compilers react started as just JS for pragmatic reasons so you can just start using it without rewriting your existing stack this is also why the compiler doesn't rely on any non-js syntax or even static types it's ruthless pragmatism this I'll say is kind of crazy to me we saw with flow how powerful it could be to have new like Primitives in your language for things like components and hooks and those obviously make optimization easier in flow than in other things but they wrote the compiler to not need that because they wanted the compiler to work on all projects especially just JavaScript once the very first hooks implementation included some extra runtime methods for a compiler to implement conditional hooks like hooks inside of ifs Loops blocks Etc obviously we didn't ship this but it's another example of how future features influence our current designs this is also how they justify the used server versus Ed server action thing so as much as I I love this mindset I wish they didn't use it to name poorly we're big spelt fans it's they said uh Dominic now works on solid and is previously working on the compiler but it's simply untrue that we' never considered a compiler before then indeed before the react compiler there were several failed compiler efforts like prepack sometimes your first second or third attempts just don't work out when the idea is good there's no other option but to try harder love this picture also this version where you're this guy you're scared of this person who's so close and you end up going through utter for an unknown amount of time in hopes of making your way to the end best compliment I've ever gotten on the team was while failing at least you try hard by Sebastian markich the Legend This is where the compiler stuff gets so nerdy that I don't know what this is so if you're actually really into compiler stuff follow Dan reading the stuff he's talked about here I'm not paid enough for this I just write JavaScript man but I don't want to call out how cool it is that threads like this are happening there's been this weird vibe that the react team exists in a box somewhere and they just occasionally come out and show us what they're building when it's ready and they don't really talk to us or involve us at all it's so far from my experience it's absurd the transparency both talking to them in person and online as well as threads like this kind of just unfurl everything I can't imagine another team that has this many people depending on what they do that's this transparent about not just what they're building but how they got there the people that led them there the things that worked the things that didn't the mindset that got them here in the first place react communicates so much that it arguably is a failure of itself because if you have enough communication out there people can take any little piece of it and flip it in a way that is misleading at best and that sucks but rather than just be scared of that and go and hide and never say anything they show everything all of their notes are public even things like the broken super early rust reite of the react compiler they're just in the branch waiting there for anyone to touch if you go to the Facebook react repo on GitHub this PR is massive 358,000 lines but there's a bunch of rust code in here we have the compiler which has its own JavaScript packages including the new esent plugin and all that we also have this crates folder because they were actually working on building this in Rust as well so for the first time now there's actually a good pile of rust code inside of the react repo that's so cool almost every other project company whatever the would have just hid this part cuz it's so early like could someone correct me if I'm wrong it is my understanding that there's no way for us to actually use vapor in view yet that is kind of just like they're working on it but it's not like a thing that I can go find and like grab the source code for oh no a few Vapor here I'll shut my mouth this is public now really good stuff the reason I bring this point up is that I find a lot of developers be it open source maintainers even like companies working on things they tend to talk about the thing before they're ready to share it it's very rare you see what I see with react where they share it before even talking about it they just don't hide these things and then we can figure this out and have conversations oursel ask them questions they'll partake it's not like they're trying to hide that they tried this with with rust it's just that they don't want that to be the focus of the messaging so they just left it in the repo and went back to talk about the important bits they're killing it with comms and honestly kind of breaks my heart that people don't see this as positive because it absolutely is I think the way would be better if more teams operated the way the react team currently does they're trying so hard to be part of the community to talk about these things and to help us understand not just what they're doing but who's doing it and why they're doing it it's so so cool and again I have massive respect for everyone involved in these projects and obviously the compilers let me know what you guys think does this make you more excited about the compiler are you more trusting the react team now let me know and until next time peace nerds ## React Doesn't Scale - 20241020 I saw this post in r/ experience devs and immediately realized that I had to talk about it I didn't have a chance to last week but I do now so let's sit down and read the chaos of react in medium to large web apps has anyone experienced it differently this is a post in r/ experienc devs and I obviously have a lot of thoughts I've been working with react code bases exclusively since 2016 and the quality of the code I've inherited was always atrocious when dealing with medium to large apps if you're just making a to-do list sure it's all fun in games but I've yet to see a real commercial or Enterprise grade react app that doesn't become a disorganized mess there has not been a single exception I kid you not I worked on a few angular projects back in the day that were easier to manage as they grew compared to most react ones as many things other Frameworks handle for you under the hood or make straightforward to handle manually will require boiler plate in react and because the react model is open and not standardized most developers won't do it as the react team intended compared to what the doc suggest I already have opinions not only do I have opinions I also have a sponsor so let's hear from them really quick hey man I need you to make a new dashboard for me I need you to know every time a user searches for oranges I also need to be able to upload pictures of dogs in order to tag them to the People based on the oranges they searched for so I have a UI where I can see this all and it has to update live I can't have this lagging at all I need to know immediately which oranges are being searched for this is crucial man we got to get this right when do you think you can have done it's already done what do you mean it would have taken the other Dev weeks your last Dev wasn't using convex what's convex conx is the only decision you have to make about your backend they built a new way to think about full stack State and it's awesome you write the code in your project and they generate both the data model and the API for it you can then call your functions directly in your front end it even auto updates when changes happen oh and if you're making big code changes on your end you don't have to worry about making mistakes because it's fully type safe just like trpc thank you convex for sponsoring today's video as a rough estimate I've probably worked with 50 different Engineers mostly senior doing react code across six to seven companies I would estimate that at most five to 10 of them truly knew how react worked and how to use it properly over time like the last 2 to 3 years it began to dawn on me that the problem might be react itself and not the devs the other 40 to 45 Engineers who didn't have much idea of what they were doing included X PayPal and X Twitter Engineers many of these Engineers were smart in other areas of computer science and software engineering but somehow that knowledge didn't translate to react okay I like that they're asking this question here of has anyone here actually worked with senior devs who truly understood react I'm not talking about knowing its internals and how the library's codebase is written necessarily just how about using the library as the library author is intended there's a couple layers here I want to go into the first one because it's a really quick own is implying that X PayPal and X Twitter means the engineers are good every company has hired engineers and if they're not at PayPal or Twitter anymore either they quit because they got a better opportunity or they quit because they couldn't do well at the company humanoid just said there's potentially a really good reason why they're ex Engineers from these places that the fact that they used to work there means effectively nothing so I don't like this appeal specifically and also Engineers that were smart in other areas of Cs in software engineering somehow fail to translate that knowledge to react how much of this failure is not knowing react well versus not knowing how to structure a large code base Well because most people who are experts in CS Don't Know Jack about how to organize a code base and I've seen this a lot I've worked with hundreds of Cs grads and the worst programmer I ever came across as far as the readability of their code had a master's degree in CS from Stanford the reply that I I this will haunt me until I stop talking about code Forever it could be that they're working at a higher level than you understand not being snarky but the elite schools are significantly Advanced I don't mean to say the author here is doing the same thing but the implication is similar where somebody being experienced in computer science and even being experienced in software engineering doesn't mean they know how to scale a code base and a lot of the things that we're talking about here are just about the problems inherent to scaling a code basee over time so those are the first two things I wanted to jump on but there's more in here as well I'll start with some sympathizing the react model being open absolutely means that chaos can occur you can have chaos in basically any solution but the potential for chaos and react is a good bit higher because it doesn't prescribe solutions to things this contradicts another Point that's being made in here which is that most developers won't do it as the react team intended the react team doesn't have that strong of intentions on how to do things even at meta there's a lot of different ways they use react it's been largely decided by the react core team that the library mobex is not very reacy and they highly recommend against using mobex especially if you want to use things like the react compiler because the level of abstraction that mobex works at can't be compiled out anywhere near as well despite that the creator of mobex actually works at Facebook so the person who made this library that adamantly disagrees with the rules of react and the way the react team thinks things should be done they still work at meta they still use react every day in ways that the core team does not agree with they're doing all sorts of crazy Michael Wester is a legend but this is part of what makes react so powerful it's as misus as a language is like imagine if we rewrote this post to be about go the chaos of go in medium to large apps has anyone experienced it differently I've been working with go code bases exclusively since 2016 and the quality of the code I've inherited has always been atrocious when dealing with medium to large apps you can write this about a language the same way and is it fair to say that react is more like a language than a framework yeah people are going to be upset that I'm saying that but it's kind of the design goal of react is to make it behave more like a language so that we can build our expectations around it over time and that's part of the magic of react is the amount of complexity can be expanded or collapsed based on your specific needs which is really really cool there's one more piece I want to touch on here though that I think is really important the code I've inherited especially when you combine that with the fact that since 2016 they've worked across 6 to seven companies my assumption here that might be corrected as I scroll further is that this developer spent a lot of time working as almost like a contractor role coming in to fix up code bases that is a really underappreciated role and the people who do that work are incredibly talented and hardworking it's nuts to take an old code base from a bunch of burnt out Engineers that's falling apart and then come in as a third party to fix it that sucks and I have massive respect for this person for going through that and I'm certain that they have a lot of experience that I can't possibly relate to that all said the quality of code they are experiencing is inherently lower than the average large code base because the average large code base isn't calling in third party help to come in and fix it another person I saw this problem with a lot was Alex Russell Alex Russell for those who don't know his handle is slightly late he was with a person who pushed really hard to have things like blink added to the browser standards but specifically was the biggest Pusher of progressive web apps in web compon on he hates react him and I had a debate way way back I think it would have been like end of 2022 if I recall at the Dolby office specifically talking about how much damage has react done he has concluded that react is the the thing destroying the internet and all of the stuff that it's doing is why the web is getting so slow one of my favorite examples from him was when a CO site produced by the like LA City County government came out to track Co spread and the site was super slow and it was using react so he went on Twitter blasting them saying look this is why react is so bad it's resulting in all of these terrible code bases existing look at how slow the site is imagine how fast it would be if they didn't use react Ken wheeler profiled it turned out it was downloading a 5 megabyte Json file and parsing it on client that's why it was slow had nothing to do with react at all but since Alex's job is helping teams both when he was at Google and now that he's at Microsoft who are having specific problems with their code Bas is being really slow and their applications being since it's his job to help them he disproportionately these really really rough code bases if it's your job to unfuck things everything starts to look a little more in your life if you're surrounding yourself with the worst possible code bases because that's how you make money because you fix the bad code bases for a living you're going to have massive biases when you talk about these things and I find that these people despite having such useful insights and knowledge often have a perspective like this one where they feel like everything sucks and it must be the technology because if you look at six apps you know or if you are working in seven shitty code bases across eight years and all seven use react that seems like react's the problem but if there's also good react code bases too you're not seeing those because it's not your job to work in a good code base it's your job to unfuck a bad one so if that is what this person's job is that's a really important bias to understand because they're coming into unfuck things and chances are the people who knew how these things worked to touch on another point he made here the question at the bottom uh have we ever seen or have we ever worked with senior devs to truly understand react yes if the code g gets bad enough they don't have the ability to fix it they quit and go somewhere else instead there are more good react code bases that need help than there are good react Engineers so the ones who are good enough at these things can go find those code bases in those companies and work there so that's these are all the massive bias I want to make sure that we account for as we read and go through this because I've worked in a lot of big react code bases too nowhere near as many as this person has but enough to know that some were really good and some weren't and that largely depended on the leadership of the team and the way they wanted to architect things I will say on the angular point they specified they worked on angular JS projects I would love to see how they would feel on a code base that started on angularjs and then upgraded to angular 2 and had to rewrite everything but then refuse to rewrite a bunch of things I'd be really curious to see how they would feel about one of those code bases CU those are some of the worst nightmares I've seen in my life like it's bad to avoid being too vague I'll give a non-exhaustive list of the biggest problems I've seen currently see and probably will continue to see in the future wrong usage of hooks everywhere yep I'll take the L here hooks made it so much easier to interface with ADD and use state to your components that people just started throwing them everywhere it's such a powerful primitive that it has resulted in people doing really really dumb things it's kind of nuts use effect use effect deserves a rant even longer than this one uh yeah most people use use effect wrong as he pointed out here the react docs have a whole section you might not need an effect because you might not how do we remove unnecessary effects well you don't need effects to transform data for rendering very important piece there's a lot of things I've seen people use effects for so many dumb things like this is a really common one you want to have a full name variable so you get first name and last name from these other things and then you set full name to be first name plus empty string plus last name and you do this to get this other state variable you want up to date you could also just do con full name equals first name plus last name right here and not Define another state variable I find that this pattern in particular comes from people who are coming from other Solutions or old class-based react stuff that assume every variable that's Dynamic needs to be put inside of a hook like a UST State this is a very specific type of brain rot that I've seen a lot of the time and I think this has to be stomped out via code review I think one of the important things in react is having a good enough engineer to do code reviews to slowly get these pieces of knowledge distributed across the team this is the case for almost any technology but since react itself is so open you need to have people who have strong enough opinions and enough control over the code base to enforce these types of things over time who taught me that is a great question I learned react because we were moving twitch from Ember to react we had a bunch of Engineers that were really excited about react and I was hating working on back into of the tank because I just moved to a go team and I was not enjoying working in go some of those Engineers saw how excited I was about react stuff and pulled me under their wing gave me really thorough code reviews and asked me questions like why did you think that was the right decision to make here I would link them docs they would go change the docs make it easier for the next person and that culture that involvement helped me level up not just as a react engineer but as a quality engineer overall especially in front end but react provides a lot of opportunities for us to have these conversations and make these types of good decisions because react code is super code reviewable which is a thing that we don't talk about enough especially when we think about things like jQuery where it's really hard to know what files are affected by a change that you made so if you make a change that targets a random element based on its ID and then updates it where is that element where is it being created that control flow means that code reviews for any of these other Solutions especially things like angular and jQuery where this is all split across many files the reviewing process is significantly worse and actually being able to find mistakes much less give useful feedback to the developers building with those things is way harder I was around when twitch investigated Elm but I wasn't deep enough on the front end side to seriously explore it the point I'm trying to make here is that code review process is so essential for leveling up your engineers and having a good code base and one of the things reactors really well with the way it isolates collocation and lets you really have files and components that describe exactly what they do makes it way easier to identify these things in code review the failures are more likely to happen due to the open model but the structure makes it easier to catch due to that same model and that's the thing I don't think is being acknowledged here because we're already past that point in this author's perspective since they're fixing code bases the bad code had to already go through review and merge and deploy so the code review process has failed and if the code riew process has failed I don't know how much a framework change is going to help it might lower it might raise your floor a little bit but your ceiling is going to be still and your ability to level up Engineers is going to be as well I will say if you're adopting react at a decent sized company that as he said you have like 50 different Engineers working on a given code base if you're working at a company like that and you're adopting react please have at least one react expert making a lot of the decisions around that they can trickle the knowledge down to other people over time but if you don't have some react experts leading these decisions for a whole team you're kind of if there is no expertise on a given framework and you want to build a tool with that framework find something that somebody has expertise in or hire an expert if you're betting lots of people and lots of time and money onto a tool that you didn't make please make sure someone understands it I think that's another point that I'm going to really emphasize throughout this it's not so much that react results in bad engineering but react has become the default thing Engineers pick really good Engineers will look at different options understand them make a decision really bad Engineers use whatever they're told to use on Twitter or on YouTube or wherever else sorry for my contributions there the average bad engineer probably picked react it sucks to think of it that way as a huge react Advocate but when something becomes that Universal that popular it gets used by more people and at a certain point the average person joining into the react hype cycle is not a good engineer anymore because all the good engineers have already either started using react or made their decision on something else so all of these bad Engineers are the ones still making decisions that are kind of Clueless and don't know about these things so if there is a bad code base that was built in The Last 5 Years it's disproportionately likely to be written in react because code bases that have no oversight are also disproportionately likely to be written in react so I don't think of this so much as react equals bad code base but I would absolutely agree bad codebase probably equals react because react is allowed for so many more developers to build so many more things and so many people reach for it not understanding it that all checks out I'm tanging to fire let's go back to these hooks because I agree use effect stuff is when we're confusing than it should be and most people shouldn't be writing use effects almost ever the call back past use effect is usually unnamed and has no comments and you can have several effects doing completely unrelated things additionally event listeners and the like are often not cleaned up and few people seem to know about the use effect return value for unmounting or synchronizing with a previous render I'm just going to pull chat CU I want to see how bad this is did you know use effect return funks run on unmount yes no IDK I don't write react I'm curious how many of y'all do and don't know that yeah use callbacks a weird one to describe it's meant to be a a memorization thing I I I really really wish use event I think it was merged okay this is why I'm starting to get skeptical of this thing on Reddit because when we look at the poll here yes we're a bunch of nerds this is not the average developer here but that ratio where only 8% of people who use react of this like like a 62 to8 ratio here is kind of nuts like that's that's pretty nuts sure view has on mounted or on unmounted but what if I want that functionality in a custom hook that you're applying now you have to apply that to a component and you have to embed your hook like 15 places in your component it sucks there's a reason view is moving towards this model because it's better the cool thing about hooks is it lets you abstract your state the same way you would abstract components and then you can hook that state machine into a component directly so yeah the the core point I'm trying to make here is that use effect is hard but even decent developers are going to understand that you can use use effect to clean things up and that you can use the use effect return value for unmounting or synchronizing with a previous render if you have bunch of developers that don't write react don't learn the tool they're using and are just copy pasting code because it seems to work yeah they suck but to go to the earlier question of like is react the problem or the engineers these Engineers are smart with computer science stuff have they learned other Frameworks what other tools do they like the average react dev has never written in another framework before so it's not fair to say that they're incompetence comes from react so much as their incompetence comes from being incompetent and I'm positive that this person's experience is real I am almost certain that they're being truthful that in their experience few people seem to know about the use effect return values but that's cuz it's their job to unfuck these terrible code bases and help fix these poorly aligned teams I'll be straight up if you're this clueless like if your company doesn't have any experts in any Frameworks just go use laravel just just go use it it's fine laravel will will coddle you and carry you gently to something that mostly works and costs too much money on the server side and that's fine that's totally fine if you don't know how to use the tool don't use the tool anyways let's see what other state he has issues with and what other hooks CU I'm very curious use State developers often add things to the state when they should be using variables derived from other actual state or they create multiple different states for related data that should be an object when co-locating data there's also State duplication when it's pass Downstream is props with some developers thinking the state of State almost like a variable yep as I said massive incompetence if they're coming from something else like I don't know classes and o stuff when you pass values down you can't just use the value you have to do a bunch of to it this is actually one of the things where react is simpler but people are applying the wrong mental model so I would say that this point here is actually an argument in favor of react because this is simpler in react they're making it more complex than it should be when they add these additional layers that they don't need because they're assuming they need these layers because they come from other technologies that are more complex and do actually need these layers but I would imagine these devs would have a similar issue moving to something like felt or solid because they're thinking of these things in a fundamentally wrong way but they're they're adding more things than they need if more developers approach things by writing the most minimal possible solution seeing if it works or not and if it doesn't making changes from there awesome A+ I love that but if you're just copy pasting a bunch of things falls apart really quickly use memo and use call back actually one more thing on this though I've never had an autocomplete co-pilot type thing do this wrong I've never had in my memory at least either super Maven which is what I use and I'm invested in or co-pilot which I don't use but I'm also invested in as a Microsoft investor I've never had either of those tools generate an unnecessary use state or use effect in memory because a very basic level of competence suggests that this example here first name then last name you know what let's go try this let's see what happens if I go to vs code I open up some random uh test component. TSX we'll paste this in I'll import that Define full name look at that look at that any even vaguely competent auto complete knows to do that and not to do this so if really basic to the point of being bad autocomplete AI is that much better than your team I think that says more about the team is Theo code interviewing co-pilot effectively yes like why did co-pilot do this right first try if it's that hard because it's not a problem with the way the framework works it's a problem with the way these people's brains work and again because people don't choose to use react I saw a bunch of this when I had to onboard a bunch of C Engineers onto a react code base and those C Engineers wrote a lot of like this and I would say over time when I gave them more code reviews and I had another person who really understood these things doing even more code reviews for that team about half the engineers picked up on the patterns and got way better at these things I know a few that have fully moved off of c and the unity stuff they used to work on to go all in on react cuz they liked it so much but a few didn't a few just could not comprehend the idea that state flowed top to bottom they expected everything to have all of these crazy behaviors going on behind the scenes these weird cyclical graphs and that they expect with all their crazy object the cool thing about react is if you write it correctly you can just read the file top to bottom there are not many Frameworks that you could do that with to this day and the ones that try like view tried with the um composition API view realized that they had this problem where everything was getting mixed into each other with options API which is the way people used to like writing View and now they hate it supposedly I think con is way better but these their own you had to intermix all of these different concerns every couple lines if we were to move to the old react model where we had you know what we'll do it I'm going to go to co-pilot or chat gbt rewrite this react component in class components or I'll do as a class component I'll make a new file cool so that's fun going mad about any um I guess we'll just kill the super because we don't have any props who cares is that really that mad about that has to contain a super call are you kidding I God I hate classes so much so you might notice some things here beyond the red squigglies that I've been desperately trying to clean up this is so much worse the fact that you have to start with a Constructor which is a component concern the idea of a Constructor doesn't matter to the first name or the last name the of a Constructor only matters to this component and we have the handle first name change and handle last name change as separate functions we had to Define ourselves in here that do specific things that we called out ourselves because the ability to change the first name isn't a concern of the first name it's a concern of the component this is why class components sucked and it kind of reads top to bottom but not really because first we have to construct the component we have no idea what first name and last name are we are binding the first name and last name changes before we' even read the definitions for them and then we have a separate render function that is unrelated to everything else where we have first name and last name is this. State full name is first name last name split like this still and then we do what we want to with it but we have to call these onchange this dot values that are entirely type ons safe because again all of these behaviors are really deeply tied to the component this is why hooks are magical let's say we want to reuse this somewhere else we'll make a custom hook function use name and this guy will have first name and last name let's say you don't even want to use the first name though you just want the full name okay actually looks like we need that for this input here now we can return all of these things first name last name full name set first and set last now this behavior and all of the things it does are to find it one place and I can do that and now I can reuse this state anywhere else I can separate these things how I do or don't want to and let's say we want to trigger an analytics call whenever your name changes we could have a use effect in here that does that so uh fire and analytics event whenever name the full name changes cool look at that it even notice to use post hog so here we have a use effect that on full name changing will fire a full name changed event to our analytics and all of this is successfully encapsulated in this used name thing if we wanted to add this functionality over here we have to make a whole separate thing which is component should update and in here we get like the old and the new state and then in here we can do this manual diff ourselves but we don't even have these defining we have to go Define the state for this ourselves we haven't defined a type for it so we have to do all of that ourselves none of this is inferred or logical you have to write a 100 times more type definitions and if they ever change you're just to hopefully know if this component should or shouldn't update by the way it always should update so we're going to return true here we're going to say uh or const is named if equals this chaotic thing if is named if then we can fire the post hog capture event which by the way if this is blocking this will block the component render this sucks this sucks so hard and this is how basically every other framework worked before react and it's how half of them still work to this day your concerns the flow of updating the name setting the changes triggering an update and then showing you the result this all sucked to do before hooks like really badly and is this simpler solution bad if you write it the old way sure if you use new tools like their old tools you'll always have problems I already seeing in chat people fully agreeing component should update always felt so janky like a Band-Aid fix for Mis proper state in props management yep and now these things are so much easier to do look at how simple this code is even if you don't know what use effect is the first time you look it up you'll see oh when this changes this runs okay that makes sense but the fact that I could Define all of this Behavior without writing any react component code and now I can just call this in a component and everything works as expected that's a really good thing it's a really good thing and while it does mean people who don't know how any of this works are going to write bad code they would have written bad code anyways let's go through the other hooks he has issues with cuz I'm curious use memo and use callback these are often misused either by not being used at all leading to Performance problems or by being overused leading to ironically poor performance for example not seldom do I see developers think there's a difference between used callback like this and button on event equals this when in reality both allocate new functions every time the render process runs the difference is that with used call back react discards the function if the dependencies haven't changed but there's still a function call internally by react thus it's more expensive which I know is rather negligible in most situations but the point is that when trying to optimize a Dev ended up with worse results had they not done anything yeah the new react compiler will absolutely help here I don't agree the damage is done already I think the react compiler actually helps a lot here but this is like these are all issues that okay other than use effect I'll say I'll admit use effect I at this point would add a lint roll to my code bases that only let you use a use effect in a custom hook use effect in components is almost always being used wrong use effect in a custom hook with a named specific purpose can be really useful if you're not already familiar deeply with react if you haven't read through the entirety of react. deev like if you haven't read these docs you should not be writing use effects and I think that's fair I understand why people get scared because they read some react code they just copy paste it not knowing it so yeah use effect should be in a custom hook and you should know what the you're doing if you're using use effect use States is phenomenal and the reason people have issues with UST state is they somehow think react works the way o things do when they don't so this is oo brain rot is what the US state problem is and then use memo and use callback brain rot is premature optimization so the first thing I agree we need better practice around this but people shouldn't use this without experience the second thing o brain rot third thing Prem optimization brain rot look at the last one use WRA although to a lesser extent I've also seen widespread misuse of use ref with developers using it to hold values that should be in state or props leading to hard to follow code again brain rot people assume they can't Define a variable in a component and because of that they throw them wherever else if you're used to things that require you to bind every useful value inside of some crazy like a this dot handle first if you see react use state or use ref as the same as doing this you fundamentally misunderstand both class components and use ref and I agree there's a lot of people who don't understand either of these things but that's not a failure in the framework the framework's actually doing the simpler than it's ever been done so that that that's my issue with those things so far let's see the summary oh that's actually really funny he brought this here in summary I find it hard to believe that moving away from methods like component will receive props component did update Etc to hooks was truly beneficial repeating myself some angularjs apps in the past had better separation of concerns than most react apps I encounter oh boy we have the disagreement we found it ding ding ding I have just flipped my tone and I no longer like this author I don't think the appeal to separation of concerns is ever meaningful at all if if your argument for why something is bad is the use of the term separation of concerns that that's like saying this is the clean code argument if you say code is bad because it's not clean and you can't actually explain why I don't care what you have to say and it sucks I was actually vibing with this until this moment and I'm going to do my best to not let this bias me throughout the rest but separation of concerns is such a misused term that it disgusts me I've tried my best to stop using it because of how badly misused it is it's absolute any real code doesn't separate concerns because as soon as you start separating the concerns you have less control over them separated concerns make your code reviews worse make your feature ship slower make debugging things way harder and make your code base miserable to work with they're like unit tests but only the negative Parts it's a argument for architecture yeah this this is a fair point sub be this this like has to be an age thing like the only way you can sincerely make the argument for separation of concerns in a front-end Library by the way like this isn't the separation between back end and front end we can talk about that all day we all have different opinions that's fine this is the separation of your components your state and your UI it makes no sense to separate those things let's go back to the example we have here even if I delete this use effect hell even if I delete the rest here and just put this in here in line the way it was before does anybody sincerely think this is worse than this how can you possibly believe that and I know they said well that the to do examples don't exist guess what if you can have exponentially less complexity and you have any process to push for the less complexity then you're going to have less complex apps and if your app has to be complex because you're doing real things the thing that guarantees a minimum level of complexity for every element in your application is going to have more complexity hooks were not controversial and they still really aren't it's weird to see an argument against react that's against hooks CU there's a reason they took over popularity like hooks just won server components might not win I'm realistic about that I love them I think they're great but I understand that server components due to the separation of concerns of running reac on the back and all those things have people reasonably concerned nobody thinks class components are better this is bad this is just worse this is and like component should update is such a cursed thing and again it's weird that going to keep pulling up the view docs but this describes it perfectly one of these things is separation of concerns the other one is readable code one of these things is really fun to write when you don't know what you're doing the other one is actually reviewable in PO requests I just cannot believe like like the the issue with this isn't just it's harder to read here the issue is that in code review you have to now look at so many different things changing to figure out what's actually going on like if we wanted to add full name here how do we do it where does it go how many places do I have to assign it if we want to add another variable here how many places do I have to go how many subcomponents I have to pass weird things to and then Super them in the props and get them to the right place it's so awful it's actually funny that the initial point was reacts great for what was it to-do lists yeah if you're just making a to-do list sure it's all fun and games yeah but as soon as your components do two things not one the mess that is class components and patterns like it immediately falls apart there's a reason this that there's a reason this doesn't work and a reason we as an ecosystem moved off it and a reason that we have all these awesome Hooks and awesome new patterns that are being built by better devs to make react easier I would also wonder how many of the problems that you're describing here especially with like Ed State being misused and use effect especially could have been solved just by using react query T query react query whatever you want to call it makes it so easy to just call something and have it and have good behaviors and you can't do do this in other Frameworks anywhere near as easily because other Frameworks don't have a state model that could inject this trivially into your component body because react doesn't have component level behaviors anymore they have hook level behaviors and the state Works around the the state instead of working on the components the issue here is that you're you have to deeply understand how class components work before you can do anything because every change you make has to hook into every single one of these parts and if you don't understand the difference between should component update and component did update your code's going to break terribly and if you change should component update to do something different that some other person did it before you might add a massive performance issue to your application which is hilariously common hooks one for a reason it's the composability the Simplicity the scalability so many hooks are just better and it's crazy to think someone would argue against that it makes it harder for me to read the rest of this in good faith everything is crammed into the render okay this is okay I think I found the problem this author is trying to think about react in terms of the component life cycle instead of the life cycle of the things the component is doing if I go back to the example I made before where I broke this out into a custom hook function use name that's not what I wanted to do we'll paste that don't need this this is the magic of hooks I know I showed this before but but I really want to emphasize this point you don't need to have all of the behaviors in your component because these behaviors aren't specific to my component these behaviors are specific to the state and when the state changes and the things I want to do when the state changes you can have all of your stateful stuff exist outside of the component and then hook them in but that's the magic of hooks it's not that you're dumping all the weird things you used to do in your components into hooks the magic is that your state can be separate from your hooks same with server components where your Dom structure and your data flows can also be separate from your components you can fetch data in the component and then pass it somewhere else but the component shouldn't have all of these things we have to hook into because this is still hooks but for every piece of State we have to hook like five things we have to hook handle first name we have to hook handle last name we have to bind both of these with this we then in render have to dump them from this. state by the way we also have to Define them in this. state which we didn't do so that's broken now we have full name which we have to Define here and now if we make changes we have to make sure this is persisted all of these things are only possible because react forced you to do them react by having these life cycle hooks made you force all of your state into the exact shape of a react component and if you had state that didn't fit this well or you had State you wanted to use in three places you're kind of just and we invented so many patterns to fix this who remembers the good old days of render props render props are in the Legacy docs telling you don't use these anymore the way render props worked is if we had data that we wanted access to in a component we would write a custom component like a data provider that had a custom render function that it would trigger once it got the data and then it would trigger with that data so then you could render an inline component here this is how we handled hooks before this is the stuff that we had to do to make these patterns work because if every single component had to have 15 different component bindings just to get some data from graphql it just doesn't work this pattern sucked and everybody saying in chat don't bring up the bad memories oh render props and prop validation yeah this is horrible it was not good and there's a reason that hooks were made because they saw all these things we were doing and realized oh we should fix that if you really want separation of concerns do what I did here take the concern which is used name and separate it into a custom hook named to use name you could separate your concerns how you choose to and if you have a decent code reviewer pointing these things out or lint rules enforcing them comes very easy there are a few lint rules you could add that would probably solve all your problems lint rule one never allow more than two hooks in a component if you need more make a custom hook rule two never allow use effects in a component now every use effect has a name for what it's doing that's the biggest issue I've seen with use effect is you don't actually say what it's doing you just do some but if your use effect exists in a custom hook at least the custom hook has a name so it's a little clearer as to what your goal was there careful saying concerns too loudly rails nearly imploded over that yep yep does it suck that you need an engineer like me to to make your react codebase good kind of but that's why we have so many awesome resources about this and I'm going to drop one of my spiciest takes I know a couple of you watching right now are junior Engineers I know that because I've talked to a bunch of you I know that this type of stuff seems way out of your league that you're just the new guy on the team there's no way they're going to listen to you as you push back on these things you're in a code base where everything's falling apart and you know you see it happening and it's breaking your heart to see people using react hooks the same way they think class components should have worked just because you're a newer developer just because you're a newer on the team doesn't mean you can't be the advocate I was still a junior engineer at twitch when I pushed twitch towards hooks I got promoted a bunch afterwards but I was able to have this impact not because I'm some super senior engineer with all this experience because I was excited about it early and since I was excited since I watched all the ways these were being used since I learned what did and didn't work made mistakes and pushed to figure these things out I became the hooks guy even though I was a junior engineer at the time if you're here if you're watching these videos and the things I'm saying resonate with you I don't care what your title is you can have this impact at your job start bringing these things up in code reviews do a ton of code reviews if you're the type of person watching the stuff here dealing with the problems that I just showed here you should be spending twice as much time doing code reviews as you're spending writing code because you can guide the whole company in the right direction in the worst cases they push back and now you have a great story to tell when you interview somewhere better so seriously take advantage of the opportunity that's been graced gracefully given to us by these terrible code bases if you care enough to watch this video you care enough to fix this and that's a great opportunity to grow yourself grow your impact be remembered well and expand the number of opportunities you have exponentially you don't need to be a great experienced engineer to make better react code out of a react code base but you need to be willing to do it and if you're willing to do it you can do some awesome thank you Al for this comment it's actually really good I consider myself a junior react Dev but I'm senior and a tech lead so I'm the exact opposite I'm not afraid to learn from people who know better the number of super talented like even when I was at react conf recently I was talking to the guy who taught me react who built the code base and the documentation everything I needed to start learning it and I still look up to him immensely he told me he just didn't get server components and use server just didn't work for him and after talking for a little bit and he watched one of my videos he realized oh use servers not for Server components use servers for Server actions and that was the like oh moment for me of like wow just cuz he knows react way better than me just because he knows webd as a whole better than me doesn't mean my knowledge of these new things isn't better and potentially useful to him it was cool to see a Dev that experience who runs the core react code base at twitch able to Humble themselves by watching somebody he trained in react explaining these new things to him great developers will take these opportunities and if the people you're working with don't take them they're not great developers and that's a great thing to know if you are so push for these things to be better so that poor uh R said Mundo poor Mundo here doesn't have to come in later to fix all the damage if you can catch these things early if you can leave code review saying Hey would it be better if we bumped this out and put it in a custom hook so we can at least have a name for what it's doing those little pieces of feedback build up really quickly and then those developers make those recommendations to other people in the future too I want to keep reading about this cuz we're getting into Redux this is going to trigger me I can already tell I've dealt with some nasty Redux and I know I'm going to get mad so early warning with Redux being considered bad in recent years okay Redux not terrible Redux toolkit quite good Redux Saga horrifying and I already see this here many things that would at least be in separate thunk and Saga files are now in the render body too do you know how awful thunk and Saga files were I I cannot imagine anyone sincerely defending Saga it suggests that the code bases he used to work in were newer and smaller and these ones are bigger and older I recall that back then react was initially said to be just the V part of the MVC framework perhaps even by the official team itself but this has been long forgotten with everything coming or comingled in one place react never said that react said that MVC was a bad abstraction and we should be focused on making the things that actually matter to our UI much closer tied the promise was never we're the V bring your own model and controller the promise was MVC might not be the right way to break things up what if your view could do everything and now you can abstract as you please then they realized that having all the state stuff baked in deeply to their component like it was here where everything a state could do everything first name can do has to be baked into the component through an updat function like this through should component update will component update all of those things every additional piece of State needs to touch all of the parts of the component they realize that doesn't work for their goal of letting you write the simplest possible thing to describe the behavior you're trying to write and then spelt happened and even further proved that this is the wrong way which is why hooks are such a valuable thing I will say Bel does this as well and it's a big part of why I like spelt so much but even then they caught onto these similar issues where instead of having hooks they changed what equal means in order to fix that they invented runes which are basically just hooks inside of spelt so the the same way all things either die out or become a crab all good UI libraries either die out or become hooks so there's a reason we've as a community coalesced on this pattern it is so much easier to write and scale because MVC is an arbitrary abstraction that doesn't work great for so many things yeah so you can make MVC if you want to in react as I said before totally fine if you want to do that if you like that abstraction but again this is the benefit and the negative of the react open model is any three react code bases can be entirely different but ideally you're writing things in the simplest way and you're making them more complex as you need to rather than copy pasting existing complexity this is part of what makes react so magical is the right solution is usually the simplest one and if it's not they try to fix that over time like with the sty on here with use memo and use callback these are absolutely misused and the fact that these are so complex to work with properly is a problem that's why they made react compiler not to unfuck Old code but to let the simplest react code be the right react code and that's the goal that's always been the goal of react how can we make the simplest code also correct and they've done a great job at that and there's so many other benefits that aren't being acknowledged here like the again it's a big code riew benefit but the fact that all the things this component does are in the component or can be command clicked to the place that they came from that just makes code review way simpler the fact that you can write top to bottom exactly what the component is doing not behaviors the component calls but the things the component does top to bottom makes everything easier and thinking otherwise is just not doing code review I I do find that these takes tend to come more from people who people who come from backgrounds where they're rewriting code more than they're reviewing code code reviewers and code rewriters have very different perspectives in very different opinions I find that very few code reviewers hate react code rewriters do because they're being handed code code reviewers are handed a much wider pallette of different types of code so they have a much different perspective and I to this day do a lot more code reviewing than code writing that's a huge part of why I liked react that's why I got into it initially is when I saw the diffs when I saw people were writing in the new react codebase at twitch it was exciting because it made sense and then when hooks happened it made even more sense yeah I I want to rant more about the NBC and and the stunk thing here he brought up server components so I have to talk about this and with the introduction of server components the database calls and whatnot are also in the render which means things will surely become even more cluttered so his push here is that everything in render is bad let me push an alternative we go back here having components that have all of these specific things related to how a component works that every value has to be passed through at every step and having the data not control the behavior having the component control Behavior and the data just has to be stuffed in in the right spots that is significantly worse having to use component did update component should update component will Mount component will unmount for every piece of data in a given component is significantly worse than doing it in render the reason that the render function mattered is because the component owned the world the component was the life cycle the component had the shelves in it that your state had to be stuffed into with hooks the HTML jsx whatever you want to consider it output of a component is just the thing gets resulted at the end now it's not one of the many built-in functions a component has to have it's one not one of those built-in shelves you have to stuff things into it's the result and if you stop thinking of render as this one function in your class and start thinking of render as the return because that's what I think of when I think of render it's the thing that's being returned from the component not the specific binding in this object now when you think of it that way you realize oh the state is what controls the life cycle not the component I'm not stuffing State into the component I'm rendering a component out of the state and when you flip that model data in component out instead of component in data stuffed in component render out render reruns should update happens all that instead it's just you read the code you see what's return and you're good that did not exist before and it makes life so much easier it's insane I want to read more of what he has to say CU this keeps going and there's a bit more yeah I'm even going to touch on the server component part because yeah large compon comp files with excessive composability sometimes I browse a page in my app and then I go to the code and I have to go three to five component levels up to find the actual definition of a prop like a handle event call back due to prop drilling eh yeah this can happen this was copy from somebody else's so your parent with props and then multiple things being passed down this way I just don't find this happening too often but when it does I actually find prop drilling to be pretty nice because it makes a very explicit relationship for what each component expects let's say some props is needed in something if some props has key user information and I need that in something what if I go remount something somewhere else prop dring is great because I can pass something the value and something can now as a component say I need this value or you cannot render me that ability to isolate a component if you want to talk about separation of concerns isn't it great to be able to separate our components if you're going to use the term separation of concerns you need to at least acknowledge the fact that the browser has elements and those should probably be separated if you're using other Frameworks especially older ones like jQuery the separation is HTML JS and CSS there's no separation between your buttons there's just buttons and then JavaScript that binds to them separation of concerns doesn't just mean different arbitrary technology pieces it also means the the things that you're concerned about in your app different components have different needs you should be able to separate them I know people keep saying prop drilling versus context now and you can pass things with context yes cool awesome I find that for things like this where prop drilling would have worked context is often not the best call because context won't work if you mount something outside context is really good for specific things but I try to not recommend it because if you need context you'll usually know but you don't always also a good point from Alchemist sometimes separation of concern means separation of the people in the team yes absolutely last I checked I don't have a team a VI team and a controller team I have a chat team I have a safety team I have a design team building things that all of these teams use I have a Blog and media team that does the marketing tools I have a player team that manages the player component like at twitch there's a team of 20 people that make one component the player and if I have to integrate the player and all these other things in a chaotic way you just made that team's life significantly harder because of separation of concerns meaning something that it doesn't actually mean to you it's absurdity so don't like those arguments at all but as for the prop drilling thing like if you're wrapping your components this aggressively at the very least pass these things down as children sometimes so let's say we actually have this code I'm going to throw this in here and it's going to get really mad because I have type script so it's actually going to be type safe function weird nesting example so if I have this in here const sum props equals cool so if parent has some props how do I get that down to something well if I'm rendering this here it's pretty easy now something has some props but that's not what they meant with this example what they meant was that parent is here and this has props some props any it's going matter me for the any so we'll say it's a string and I'm going to kill parent because we don't have that anymore if this is the tree that we're returning cool now parent can pass props some DRS directly here but what if it's not what if these are being rendered by other things well that's pretty easy too you take the things that it's rendering so if we have thing and this renders sub we can make this jsx to and as long as the child that you're trying to pass these props to exists at the same level as where the props came from you can just pass jsx down obviously here the right pattern would be children which is funny cu the example he gave here was meant to be other thing returns small thing small thing returns even smaller thing even smaller thing returns tiny thing tiny thing returns really tiny thing but if these just took children instead and you just pass the child the problem goes away entirely this is like basic composition rules this is not knowing how functions work I can see going to like four levels Max like Max Max yep yep it's just Insanity like if you're writing this in a way where each of these components is a nested layer but this is the one with the useful data and this is the one that needs the data that means everything between these two points is useless this should just be one component then there is basically no instance in which this level of prop drilling makes sense unless you are using react to abstract every single little thing as a component and it's funny CU he also complained above about large component files with excessive composability large component files solve this problem if all of this stuff was done in one component you wouldn't have a prop drilling problem large components in prop drilling are opposite problems these are two different extremes both are bad but they're two different extremes and if you live a reasonable life in the middle you'll have a great time but yes if you overuse any pattern in anything it'll probably be bad apparently they don't like jsx now developers move business logic to the render with loops and turnar even worse if nested everywhere making it hard to follow if you all you want to see is the HTML template structure of a component I I'm not even going to engage with that one I like the first half of this too I'm sad this is falling apart so fast okay dozens of react contexts sure but how many of these context are a thing you wrote or that your team wrote versus a thing you're getting from somewhere else like most of the contexts I'm mounting are like my analytics provider my off provider my error management provider not things like the user state or which page we're on type stuff so sure this isn't great but if you're shoving everything into context it's again you're like brute forcing globals into a framework that's anti- globals so sure if you are in insisting that globals are a necessary pattern and you're nesting 15 of them at the top of your app yeah I agree you're a shitty developer you we making mobbs at that point how can this possibly be better than a single Global store it's not it's be the problem here is that you try to force a global store into a framework that doesn't have a global store if you're misusing context as a pattern that you're used to from somewhere else it is bad yes this is the recurring theme is you have a problem that exists because you are thinking in a way that is different because you use other tools that work in an old way and obviously that's not going to apply to this different way of thinking the the best I can steal man what's happening here is that most devs aren't good devs most devs have experience with other things so react being the default is bad because most devs adopting react are going to be used to things that work differently that's the only way I can good faith interpret this is the nature of how bad most developers are and the fact that their experience is with things that work differently worse but different from react means that people are going to force patterns that aren't very react into react and then have a bad time but even then most of these weren't that bad like if we go through this list one last time before I read the conclusion I'll see the problems that he's found the first one was use effect which I agree but you can command F across a codebase find all the use effects annotate them export them delete them whatever and then with one pass and like one message to the front end team saying hey read this page we're using use effect wrong okay that problem's gone that was a real problem but it's gone now you State this was a really basic misunderstanding of how values work not even like o versus FP or whatever this is just not understanding how assignment Works fundamentally learn what closures are it will help you use memo and use call back this one's largely been fixed by react compiler was it over adopted sure solve problem use ref if you don't know what you're doing don't use use ref like if you don't have a very specific thing that you know use ref well enough to use it you probably shouldn't use it the number of us refs if I I'm G to do the thing that I always stress out my CTO when I do it we're going to open up the upload thing code base the upload thing codebase is not small this is for the web app by the way we have a single use ref in here for assigning the image element so that when you click it we can trigger an input but that's the only instance of a use ref in our entire code base you don't need it and I agree use effect isn't intuitive but on one hand it's a hard thing to make intuitive but they could have made some changes that make it more intuitive but on the other hand they didn't want it to be intuitive because they don't want you using it you probably shouldn't be using use effect if you're not sure how to use use effect you probably don't need it so we went through the hooks the use Effect one kind of a fair point audit them be strictured about them use state is use use callback is solved use rough is going back down here large components large components are good and counteract the prop drilling problem that you discussed here so this is two opposite extremes solve problem jsx is so good that everyone's moving to it even asra which is largely positioned as like the anti- react but react compatible thing they wrote their own like markup solution realized how miserable it was to maintain realized jsx was better and they moved jsx jsx won it's like over it's actually one of the things that has made it hardest for me to leave reacted solid is that jsx is so good and it is just JavaScript which is magical yeah even back in folks are trying to mimic the syntax now also the dozens of react contexts yeah if you force a global into a thing that's not a global it's going to be bad yeah cool so we went through all of the things most of them are skill issue not even big skill issues but small skill issues that are solvable usually with basic lint rules these aren't why react Cod bases get messy react Cod bases get messy because you wrap things 15 times you don't need to you have an old class component that everybody's scared to touch because it does a hundred things like I remember there was a a class component for chat at twitch that was like 2,000 something lines and it had so many intermingled again I'm going to keep pulling up this composition thing from The View dos it was this but a thousand lines plus of just weird State bindings and another 500 plus lines of random returns and another 500 plus lines of unnecessary like this dot binding is getting it all orchestrated this mess of your concerns all intermingling because they all have to be shoved into your component in different places this was the everyday experience in angularjs in view in react and hooks proved it didn't have to be hooks gave us this where each concern can be its own Chunk in the code and then the return is what happens when it's all done that is a significantly simpler model but if you're stuck with old things like this and new things like the thing on the right that could be kind of not great I could go on but I'll stop to not make this post even longer I'm really curious to hear other experienced Engineers perspectives and general takes on this being honest I seriously believe or at least hope that react won't be the end game for webdev either one of the existing Alternatives view felt solid quick Etc or a new one should emerge and fix this model at this stage I think it's impossible for react itself to do this unless they release something as significant as the shift from angularjs to angular 2 but then we might as well not call it react anymore just as it happened with angular almost all of these problems exist in all of these Frameworks the only thing here that doesn't is use effect the rest all does yeah I'm confused want to read the comments I'm curious this is actually an interesting counter perspective here my main struggle with it isn't that it's difficult or anything or that you can't develop some standards around organizing your components is the fact that every time you do get some stability in that area my team will see a new trick or a new Plugin or tool has become available and insists that we have to refactor literally everything to use that thing then it becomes an even more bug-ridden mess because edge cases and previous bug fixes get lost and the new tool is nicer to use but only covers 75% of the functionality to the thing we're replacing and ultimately the collective online Dev mind will shift to another shiny new toy in 3 months we'll be back to square one with strands of all these new tools and Frameworks all over the place half agree I think the modular nature of react makes it easier to adopt things but isn't the issue here that everybody's mad about react code basis from 2016 it sounds like as jk fsda just said the react is pretty mature you can use old react code all of us are using we're not using new Frameworks all over the app we're still using react still compatible with all the old stuff you can move to a new trick or Plugin or tool and the old code still works you don't have to delete it I agree that we have a lot more shiny object syndrome in react because we can make better Solutions but you keep using the old solution you keep using the old thing no one's forcing you to use the new thing if you don't like the new thing that's fine and if you're the the tech lead making these decisions maybe insist that these new tools or Technologies are isolated to specific like smaller code bases or parts of the app and they've been proven out but this is just basic engineering culture the fact that there are potential ways to improve your codebase being developed by the community isn't a bad thing unless your culture means they're going to adopt all of those things the fact that we're constantly finding new ways to improve stuff is great because it means your ancient old code base written in react of 2016 can have sections of it that are really modern and nice to work with and you can slowly move over to those new patterns these are strengths of react but if you let every Dev add every tool they find vaguely interesting without justifying it you're going to have a mess like you would in any other code base also here yeah there are pain in the ass to update I get it this is talking about jQuery to be clear yeah if you have a react codebase where nothing is changing it's going to keep working if you have an old jQuery codebase that nothing's changed and it keeps working the reason the old jQuery code bases are associated with being more stable is because nobody wants to touch them because they're so fragile they'll break if you change anything but the react code bases the separation of concerns being at a component level means that when you change something in a component the effects of that are isolated to that component that's part of the magic of react is you can have these Junior Engineers contributing small components to your code base making small changes and the likelihood they break the entire app is exponentially lower than any tool or technology that existed before it stability in a code base is underrated I agree if your team owns three projects and they have slightly different depths because they were created at different times I can't understand how developer brains seem to implode at the idea of context switching between sagas or rtk middleware as an example if you're that lost when switching from one to another it's you and not the tool that's the problem yeah I agree with this fully I like this a lot if you have one codebase that's using old things one code base is using new things you don't have to move the old code based to the new thing this is a great point and this feels like it contradicts what he said above here I just don't get why you would say this is a react problem when you just stated the solution that only react is capable of the other cool thing that's not being touched on here is you can have those three different code bases these three different projects at your company that are all on different versions of react using different live libraries for their state and all these other things but if you have a component library that your design team made in react that can be used in all of those code bases you can use that component library in the class component based react 16 project in the Deep on saga's react code base from a couple years ago and it's something using server components all this fancy new right now you can share a lot of this logic these Primitives these pieces across things intercomp intermingle and just do no other framework before react even thought of and like module Federation module feder is a thing that react largely enabled which is so cool and this is why I get frustrated when I read these points is so many of them just feel like contradictions welcome to business programming it ain't pretty but it pays the bills Yep this is not a react specific thing most code bases are messy and get more messy over time I used to work in large frontend code bases that utilize jQuery and Java server Pages still gives me nightmares yep our codebase has been around for six years the Engineers know what they're doing pretty great place to work yep yep here's a good one the fundamental problem is that most developers can't evolve past localized imperative thinking and thus cannot reason properly about State leading to the problems that you've described to break this down into slightly more understandable things the way things change people don't expect to understand they expect to be told to them and with the class component model the way things updated and when they updated was all defined in the code directly but with hooks it's defined around to the data indirectly so you choose what updates happen rather than the component is updating and you choose when to opt out instead you're opting in but you have to understand enough to do that and that is great because it means your code can be significantly simpler but it's bad if you don't know what you're doing because there aren't three shelves in each component telling you stuff these here stuff these here stuff these here it's way more composable but if you haven't evolved past the idea that the component is State you're and as they say this problem is not specific to react but a problem for larger applications in general my focus as a lead of a 200 plus contributor app is to contain the bad patterns and ensure the horizontal concerns are built correctly as there will always be weaker teams yep A++ this was quite quite the journey I knew diving into this was going to be fun I did not expect it to be this long a video let me know what resonated with you the most and the least in the comments until next time peace ## React Is A Backend Framework Now - 20230307 if I told you you didn't have to write apis anymore would you believe me no probably not I mean come on but if Dan abramov told you you didn't have to write apis anymore then we'd have something to talk about wouldn't we well the new react version and all the hike around react server components starting to look like we might not need apis anymore sorry for the outfit I didn't feel like ironing a shirt anyways Daniel in quite the set of rants on Twitter and honestly it's reinvigorated a lot of my excitement about react server components as I've been playing with react server components more I've been starting to see the benefits but also struggling to wrap my head around the mental model thankfully Dan's tweets have helped me a lot and I'm starting to feel like I understand the ways server components benefit us as we build applications and react the animated thread collecting different ways to try and Pitch server components because he thinks it feels a lot like the old days of react and some of these analogies are really interesting I love this second one here including the server in the unidirectional data flow of react this one was a bit mind-blowing for me the beauty of react is you get to choose from here down this data exists and you can't really go up the tree without explicitly passing Setters down to lower components to update things higher up in the tree but you couldn't just mutate the data and expect the thing to change this unit directional flow is a huge part of why react scale so well it is so simple to work with and the thought of including the server in it it makes so much sense other Frameworks have tried this like remix or even next itself but the unidirectional flow there starts with the route so if your route isn't the place where you need the data it's somewhere else like a component you want to reuse that unidirectional nature of the flow kind of gets broken up in weird arbitrary ways react server components your component says what it needs and now it has it and honestly it's been really nice to work with all these other Frameworks have weird data loading patterns where the thing appears or use a hook to access it but in server components you just await the data it really does feel like you don't need apis this is an example I've been working on for a different video I think it really helps show the power of server components though this is an interface where tweets will be actual tweets it's Emoji only tweets this data is fetched on the server it's not on the client the client receives effectively HTML you have to worry about serialization of the data things like date times all that type of stuff how am I actually getting it there let's take a look at the code quick so in here I have a database connection that I'm executing that is firing SQL this is a component export default async function tweets and this component is executing a SQL query to get data I happen to know the type of this data it's tweet type but if I was using something like a Prisma or an orm that's aware of the different types of the things I'm fetching and when you have to assign the data type here I would just have it and now I can map against this and return these view components that's it I just await the data in this case a SQL call and I return the contents and now I have a component that I can mount anywhere in my application it is that simple Geo is even easier than fetching data in a server component subscribing to the channel the little buttons right there we talk about react typescript all sorts of stuff like this and less than half El are subscribed so please hit the button help us out a ton so what are the pain points in this example we are using state so theoretically this component would rerun whenever the state changes which means it would have to execute this which is why when we try and do this it's going to fail and if we take a look quick here we see the use State call isn't allowed because we haven't marked this as a use client file we mark this as use client file we'll no longer be able to do the database connection we'd have to put that in somewhere else this model is weird rather than an API what you kind of would want here is a component that wraps your component that interacts on the client so if I wanted a component here that had an input I'd have to create a separate file I can do that quickly input dot TSX and Export const input component I can paste that here return my copilot do its thing I don't need that it's an input component you silly goose here we go and M4 is state from react and all I have to do to make sure react notes this is client only is we put a quick use client on top and now rather than using that I can put on top here input component and since we marked this as use client it will now be safe for us to use what's cool here is I can pass props to input component so if I fetched some data here like I want input components to know how many tweets there are here I can pass count equals rows.number and then on input instead of having this be a string input I could have it be a you know I'll leave it to the string but let's say we want to put the current count here so Dev current count and crops count number any props.count we will wrap that bend it off we literally could just pass props okay it's rows at length sorry brain fart anyways the magic here is very specifically we can fetch data on the server and then pass that data to the client we normally read an API for this data to be accessible on the client the data flows from the component on the server including through HTML now that only exists on the server this code doesn't run on client this just is HTML as far as the client is concerned but on the server you can get the data and then for components that need to update you can pass that data from the server to the client just by passing props it's kind of magical and when that flow clicks I get it and remixes had a decent bit of this for a while I can admit that but there's something magical about with any given component awaiting data and then passing it to another component this component here this server async component it's kind of an API and that's the mind-blowing aha moment I had that and you get much more excited about server components the same way I used to wrap components in Hawks to give them data we can now write server components that are apis that wrap another component with data what about when data changes like this helps for the first paint but from there what about everything else this is actually built in to react as well in this example we have an iterator that encodes content sleeps then yields that again this is a generator which means a function that returns multiple things as like a stream the magic here is we can as an API return on this route an iterator that will change the contents of what it returns after 200 milliseconds that's insane that's so cool that a single function can send multiple things down and the client without needing to know anything else can render and do stuff with it it's possible that this will be exactly how we do this with components as well uh to be determined keep an eye out for that I couldn't be more excited for what these new apis entail and in reality the possibility that we might not need apis at all I was skeptical going in but I'm really starting to see the patterns still not sure how I feel about the file separation but I am certain there are things here that work and they work really well genuinely excited about the app directory I hope that you guys are too keep an eye out for the tutorial I have coming I am super hyped on that and check out the videos that are on the side here I think they're pretty good I worked my butt off on them and I'm wearing nicer clothes on them so ## React Is the last framework. - 20250519 I need you guys to hear me out on this one more than usual. I know the title just seems fake, right? Like there have been so many frameworks since React. How is it the last one? This is a complex topic and it's a thing I've been thinking about for a while. When I say React's last framework, I don't mean that there aren't other tools that have come out since. I mean something a little bit deeper and a little more confusing. I think it's important for us all to understand how our tools are changing and importantly what AI does to this whole ecosystem. Things are different from how they've ever been and the way we think about the abstractions, the frameworks and the libraries we use needs to change as a result. When I say React is the last framework, I mean it. But what I mean is React is the last framework that will reach a certain level of adoption. And I think React might even be hurting from this too. Things in the software dev world are about to get very, very weird and I want to make sure we understand what the impacts of these things are and how AI represents a weird change that we can't really walk back from. It's time to talk about why React is the last framework. But first, a quick word from today's sponsor. I have a lot of brands that email me about potentially sponsoring. And if I'm honest, most of them are kind of crap. I got things like VPNs and wallets and all these other things you see on other channels that might not be the best fit here. But every once in a while, one hits me up that blows me away. A company that's like so useful that I've tried to build things like it in the past before burning out and giving up. Today's one of those days. Image Kit.io is one of those things I wish I was using forever ago. I've even tried building it myself before, not knowing it existed. The TLDDR, what they've built, it's an all-in-one shop for everything you need to do to serve images properly. That means everything from CDN hosting, transformations for different resolutions and image types for different platforms, background removal, overlays, all the annoying things you have to do to use images at scale for a business or even just on a small project, it solves. This has to be super complex though, right? Well, their API, it makes me envious because it's so beautiful. take their URL, you add your identifier for your account, you add a transform as properties as part of the URL, and then you put the asset at the end. But Theo, my assets aren't on image kit yet. Well, thankfully, you can connect whatever storage you want. My favorite option here though is the web proxy where you can literally pass the URL to the file being stored somewhere else as part of the URL. Yes, you can use this with upload thing. Everyone who's been asking, how do I optimize the images for uploading? Here you go. Use image kit. And if you want to do more complex transformations, they have an incredible SDK for it. Look at how nice this is. You can create a transformation string, which you just append right into the URL with all these type helpers to describe how you want this new updated image to work. Or you can generate the entire source URL by just passing this as properties. Almost forgot the best part. It works with video, too. What? What? I am going to start using this for a lot of things. Before I forget, super generous free tier and pay as you go pricing when you hit high limits. So, you don't have to worry about being locked out and priced a super high amount when you hit a certain tier like uh a lot of the other image optimization services tend to do. Yeah, these guys are great. Check them out today at swayv.link/imagekit. Okay, this one's going to be controversial, so I need to do my best to try and explain how I think about this. We're going to start with something that has nothing to do with code at all. As hard as it is to imagine, there was a world before cars. It feels impossible because when you go outside, you immediately see streets, parking spots, and driveways, and garages, and a whole system built around cars and how cars work. Before then, there were horses, and things were built around that. I know that because I'm from Boston and navigating the city sucks because the streets were made too thin. Why the hell am I talking about cars then? I'm talking about them because once a certain level of adoption hit, the format of a car and the format of the streets the car goes on kind of were locked in. There's a certain width that a street or lane is expected to be. If you make a car that is narrower than is needed for that street, you don't get much benefit because if the street is this wide, and most cars are like that, obviously they're longer. But if this is your car, and this is the street lines, making a car like this isn't super beneficial. Making a car like this makes no sense at all. There's a whole bunch of optimizations that you could theoretically make that would meaningfully improve parts of how a car operates that literally do not matter because the streets are how they are. And even if all modern cars were suddenly manufactured in a way where they were 30% narrower with no negative, the streets aren't going to change because there are too many cars out already that people already own that are expecting streets to be a certain size. You cannot change the way that cars operate on a fundamental level. What you can change is things inside of the car. You can change how it's powered. You can change how it's laid out. You can change how certain aspects of the car experience work. But you cannot change the way the car operates with the world around it because there are too many cars to do that. There is a threshold that has been met with the number of cars in the streets that fundamentally changes our ability to innovate where we no longer can make changes to the car itself. We can only make changes inside of it. The car is React. Hear me out. We need to agree with a couple core points before we go forward. One, React one. When I say this, I don't mean every single app ever is using React. What I mean is when new tools and solutions come out, they usually support React. When new projects are being spun up, they're usually spun up in React. When teams are investigating solutions, React is an option. And when a third of developers start a project for the first time, that is a third of devs are starting their coding journey not with HTML, not with JavaScript, not with Python, with React. Even if you don't agree React one, the compromise I hope we can all agree on is there is a shitload of React code on the web. an absolute nearly impossible to fathom amount of React code exists. And because of that, there's a ton of data that the AIS can train on. We'll get to that in a minute because there's a couple more parts we have to consider. React has a very strong ecosystem. There are so many solutions to pretty much every problem you can run into with React. I won't say they're all great. They certainly vary a lot in quality. And the fact that React needs these tools has resulted in disasters now like Webpack. But it is reality that there is now a strong ecosystem with countless solutions to most of the problems that you could possibly run into. Generally speaking, ignoring all of the AI stuff, if you're building something with React and you're running into a problem, you're two Google searches max away from finding a solution. Now, imagine you're an AI and you've already indexed all these solutions. This is where the magic kicks in that makes this feel very real. The AI has already decided for us since there is such an absurd amount of data to train AI on that is React code and because there's a whole ecosystem of solutions and there's most importantly endless Stack Overflow posts. There are almost certainly more posts on Stack Overflow asking how to solve a problem in React than there are asking how to solve a problem in Laravel or Rails because Laravel and Rails provide solutions. You don't need to Google search for them. You go to the Laravel docs and there's a solution right there which means there is less data and data is what determines what an AI recommends not the quality of the answer not the happiness of the user simply the number of examples the AI has in its training data set so whether or not you think these are good things or bad things or something in between they do represent a reality that we live in today which is that AI will regularly randomly jump on React syntax in the React way of doing things, even if you're not using React. And if you've worked in a codebase using Solid, using any of these AI tools, you know exactly what I'm talking about. Hell, if you've worked in an Elixir codebase using any of these tools, you know what I'm talking about. They have this uncanny ability to just default back to React TypeScript. It's just how they think because it's what so much of the data they're trained on is. So, how are you supposed to make something better? You can only do like a marginal improvement, even solid. Like I'm not going to sit here and pretend Solid's a worse framework. In so many ways, Solid is a genuinely better framework than React. It takes the right lessons from React and applies them in a way that is more performant, super ergonomic, and incredibly, incredibly powerful. The fact that it feels like an incremental improvement to React at the very least in the syntax. Like if you haven't seen SolidJS syntax, look at this counting component count set count equals create signal interval set interval. It increases the count every second. On cleanup, it clears it. You return count value is count. If you weren't looking closely, you could mistake this for React. And that is part of the problem because it looks so much like React AI can't distinguish the two. And when there is solid code that they have maybe a hundred examples of and React code that conservatively they have a 100,000 examples of, you can see why it would look at solid code and assume it's React before it answers the question. This makes it nearly impossible to compete because you're no longer just trying to make an incremental improvement. To go back to the car example, you're not trying to compete with other cars anymore. You're now trying to compete with the street. And if you make a car that is 20% better than other cars, but it isn't compatible with the streets that we use today, no one's going to touch it. React is the car. The data is the street. The sheer volume of AI training data that is already in existence that these models have been trained on means that even the React team can't improve React. Now, adding new features to React will make things harder for React devs, not just because, oh, there's so many things I have to keep track of, makes things harder because the AI models we use and ask questions to about these things, aren't going to know the answers. I already run into this a lot. Hell, when I was doing all my Stripe stuff, I asked every AI model, "How do I keep a user from subscribing twice?" And they all gave really bad recommendations on how to do it in my codebase. After going to Google instead, I found that somewhat recently they added a switch to turn off the ability for one customer to subscribe two times. And none of the models had been updated recently enough to have that data in them. And even if they were, that data existing doesn't trump the massive amount of data with the old solution. making new solutions isn't going to be an immediate guaranteed win the way it used to be because the resources we go to are so much more baked and the way that if you go to an old Stack Overflow post and you're like, "Oh, that's from 2009. Maybe it's not accurate." You don't get that with these AI tools. They don't tell you how old the data they're referencing is because they're not referencing one thing. They're referencing 100 thousand things they don't even keep track of anymore because it's all just weird neural paths that they've built. So you don't have the ability to filter out old data or recognize when the thing that you're using might be the old way of solving the problem. Which means improving the way to solve the problem doesn't benefit us the way it used to. If theoretically React was to fundamentally change their syntax, if they made it, I don't know, I can't think of a good example, but if React was to make a real syntactical change to how we structure our components, it would not be used by most React devs simply because most of them are now using these tools. They're asking ChatGpt for help and none of that stuff's going to know about the new features and all the data it's been trained on already exists. When the streets are already laid, you can't really propose a new type of car that requires a different type of street. It just it makes obvious sense. You can't make a car that is wider than the streets we have. It's hard to justify a car that's narrower than the streets we have. And it's hard to make a car that is a shape that doesn't fit the streets we have. It's just obvious. But with the AI data, it's less obvious, but it's the same problem. We have too much reference to the current way of doing things for a new way to really catch on. And that is terrifying to me. The thought that the React code we're writing today looks identical to the React code we'll probably be writing in 10 years, I don't love that thought. I like watching these tools improve and grow. I saw that Ryan Carneato, the creator of Solid, is in chat. He's one of my favorite human beings. He called out the Foundation TV adaptation where the emperor clones himself to the point of stagnation. Yeah, that's what we're talking about here. We are just going to be copy pasting what we have forever. The AI tools have in some ways doomed us to a world where we are never writing code better than the code we used to write. It might be simpler and we could remove parts, but it's a lot harder to add a new thing when the toolbox has kind of been like solidified by the AI data and the AI models that have been trained on that data. So, how do we move forward? How can a framework like React improve if the AI tools won't understand the improvements? The React team has actually planned for this and not in a way any of us could have predicted. The React compiler guarantees that React syntax isn't going to meaningfully change again. The React compiler, for those who aren't familiar, is effectively in its current state an automemoizer. Instead of having to write code where you memoize every element by hand, where you memoize and fire use callback wrappers around all the things that could change in order to prevent React from rerendering when it doesn't need to. The compiler statically analyzes each file, finds the places where things can be memoized, and does all of it for you. It lets you write less code and simpler code, not different code, just worse code pre-ompiler, where you can just go through and delete all the used memos and callbacks. And now the compiler will output the optimized version. This is cool because most of these AI models aren't going to add a used memo call until you tell them to anyways. But why do we care? Why does an automemorization layer come up in a video, but React being the last framework? The output of React compiler isn't even as fast as Solid. Solid is still faster than what Compiler can do at its best. What it can do now is much more interesting. We need to think about the layers of our tools. At the very very bottom in this chaotic pile of stuff, we have assembly instructions. Obviously, it goes deeper. So, I don't go insane. We'll say assembly instructions are at the bottom. Then we have languages that don't suck like C, C++, languages that compile to assembly. Then we have all sorts of ergonomic tools and things built on it. We can ignore all of that though. I want to be simpler. We then have tools that are built with those things that are things like runtimes. So something like the JS runtime is an abstraction that lives on top there. And then we have above that our JS code. But that JS code isn't the code that we're writing anymore. We've added more levels of abstraction over time. We actually added a bundler and a build step so that we can write more ergonomic code. I'll just call this React JSX TypeScript. We have abstracted from assembly all the way up to this React JavaScript TypeScript thing. And we live in this level of abstraction. Sometimes we'll dive into the bundler. Very rarely, but sometimes we'll look at the JS code. But most JS devs don't know anything about V8. I know that for a fact. I've talked to a lot of them about it and they get very confused very quickly. We live in this abstraction layer. Do you know who else does? AI tools. Ask an AI tool to help you with an obscure bundle thing that happened because of a code change they made here. Every time it will itself. I have had zero luck debugging hard build problems, hard bundle problems, and generally speaking, the things around my JS code. Generally speaking, very, very generally speaking, as you go down here, you get paid more and AI gets worse. The AI gets worse at solving problems the further down you go. But as we've already established, this block can't really change anymore. If you improve this block in meaningful ways, the AI isn't going to catch on to it. It's not going to want to change the syntax. And on top of it, rather than just thinking about all the data the AI is trained on, think about the size of the code bases that are using React. Facebook can't make a real change to React syntax because they have too much React code at Facebook to justify the change. it would be nearly impossible for them to make a meaningful syntax change to React that would benefit the whole codebase for all the different products at Facebook. So they don't they've effectively stumbled onto the AI problem independently just by having a ton of code and not wanting to ever change it, which is why they added an additional layer between the React compiler. What's cool here is this layer is where all of the innovation can happen. Now, if React wants to introduce signals, if React wants to introduce new ways for context to behave and trigger updates, if React wants to introduce fundamental new features in the React runtime that allow it to run way simpler and faster. Previously, we would expect syntax changes and behavior changes in the code up here in order to enable that. But the React compiler is now the place where change will happen in React. That is the ultimate win that the React compiler introduces is instead of the innovation happening here, instead of the React team spending their time here, they can kind of treat React itself like the library in the syntax in particular. That can now be treated as complete and the innovation and the changes that make React continue to improve can happen in this other layer instead. This is awesome because a new version of React introducing awesome new functionality and behaviors and performance wins does not require any change to this layer at all. Magical, but also kind of terrifying. We never got JSX 2.0. There's a lot of things JSX doesn't do right that I would like to change. Why do we still write class name? We can write class. Our bundlers can handle it. Solid proves that you don't do class name in Solid. You do class in Solid. The React compiler allows for things that aren't just like ergonomic in our code wins, but our actual deeper winds to change. But the syntax we use today and React, not the framework, but React, the language, is effectively complete. And I'm not sure anything else can come in and win simply because of the staying power that AI has now solidified. Do you know what made me start thinking about this? because it had nothing to do with React. The reason I started thinking about this is something else kind of AI, Python. Python is a bad language and a worse ecosystem. The state of Python tools is atrocious. I cannot believe it is the default language for as many things as it is. Every time I do anything in Python, I quickly regret it and regret even being an engineer at times. It is horrifying how bad things like virtual environments are. It is depressing how hard it is to take working Python code and put it in a bundle that I could send to a user and have it execute on their machine. It is a shitow. And I don't know how anyone can talk on the JS ecosystem having too many solutions for problems when they don't have a way to install a package that makes sense. It's insanity. Yet, Python continues to grow every year. The thing I had to accept the more I thought about Python's continued success is that being good doesn't matter anymore. And I hate that. I genuinely hate this. This makes me feel horrible. The fact that Python can beat out so many significantly better languages just by being first in having staying power. Hell, Python staying power is so strong that it took 10 years for Python 2 to not be the default anymore after Python 3 came out. Python has so much staying power despite being that they can't even upgrade Python correctly. That's insane. The hot take here that I think is really important is Python 2 to Python 3 will never happen again. It can't. The AI will not allow this. If a syntax change as big as Python 2 to 3 happens, we'll never move to the new thing. It can't happen. That's why projects like Mojo are so interesting because instead of trying to make a new syntax, they're trying to take the existing syntax and make it run in a way that isn't hellish. These types of moves for established tools cannot happen anymore. They just straight up cannot happen because like the move from two to three only ultimately happened because enough wins happened in Python 3 and enough of the ecosystem moved over that you'll begrudgingly made the change. But if Python 2 code was easier to write than Python 3 code and the AI tools could AI autocomplete the Python 2 code and would hallucinate Python 2 syntax when you wrote Python 3 all the time, we would never have made the move to Python 3. It actually would not have happened. This realization has haunted me for about a year now. that things like the Angular red wedding or the Python 2 to3 move, they can't happen now. And rather than eat that cost and deal with it when they get there with React, they kind of accepted that React hooks and function components are the language and the language can no longer change. That sucks in a lot of ways. And it does genuinely make me sad that the code that we write today won't look meaningfully different from the code we write in 10 years. Because if you look at even just web code from 3 years ago, it looks so different from the code we write today. But I think we're at the end of that and that's a sad thing to realize. I am thankful that React has architected itself in a way where it can continue to innovate and improve without needing to change the language because now they can keep making React better. But it's sad that if someone made something that was 10 times better syntactically and ergonomically than React, it effectively can't win. There are other ways we can win though. To go back once again to the car example, we can change how things work in the car. And that's what the React compiler is doing. It allows them to change how things work inside of React. We can't change how we write React, but we can change how it works on the inside. This would be things like the move to electric. A move to electric can absolutely happen because it doesn't change how the car interfaces with the street around it. The React runtime and the React reconciler can improve because it affect the code that we write directly. While I agree with Ryan's sentiment here that people will only eat so much I think good enough is a real place that we have gotten to. And while React could be improved in so many ways, many of which the React team themselves will even admit, if it's not a 10x win, no one's going to bite. And I don't think anything offers a 10x win. In fact, my conversations with you, Ryan, have helped push me over here where it almost feels like the closer that React gets to right, the more frustrated you are with it. Where when React was 70% correct, 30% wrong, it's like, yeah, they suck. they're making a bunch of mistakes. We can go make something better. When I got closer to 90% right and 10% wrong, that 10% wrong gets so much more frustrating when you see how close they are to doing things right. But at the same time, it's so close to right that nobody cares anymore. And even if they did care, if the AI will write the part that is tedious and annoying and the compiler will compile out the parts that are buggy and slow, how much of that 10% even affects the average React dev anymore? And if the convenience of the AI generating half of this layer for you is greater than the frustrations you have with that layer, meh, it it's hard to see a path out here. When I was at Twitch, they used to call me the spelt guy because I was so excited about spelt 3. My break into the scene was working with Ryan on cooljs stuff. My second ever actual video was me rewriting an app in Solid because I was so excited about the potential of the framework. I love all these new tools and technologies. I genuinely love to see how the ecosystem improves and changes over time. I don't think we're ever going to get another TRPC. I don't think we're going to get another Solid. I don't think we're going to get another React Hooks moment. I think the future of innovation in the way we work with our dev tools is over. And the innovation is how we command the systems and orchestrate the code itself. But since we now have this abstraction layer that's slightly higher of the AI tools generating the code, it is harder than ever to change this layer. And I hope you guys understand why I this has given me this controversial take that I don't believe there will be another framework that really meaningfully catches on. I genuinely hope this is one of those videos that I'm just wrong in. Similar to the AI it won't advance anymore one that I was just totally off on. It happens. I'm not presenting this because I want to be right. I'm presenting this because I dread that I might be right here. And I hope people like Ryan can win. But I am not positive the world is set up in a way where they can. And thinking on how hard it was to make Python 3 happen, the fact that there is more friction than ever and more holding us to the things we use today, I'm not sure that there will be a tool of tomorrow. And I hope y'all could prove me wrong. I don't have much else here. I'm curious how y'all feel about this theory, though. Are we at the end of frameworks? Is this the end of innovation as we know it? Or am I overblowing this thinking AI tools are too relevant? Genuinely want to know what you guys think. Please don't stop making new tools and solutions and frameworks, certainly not from this video. The thought of somebody who might have been the creator of a future framework not doing it because of me is terrifying. I just want to express how I'm feeling as I think about this stuff more and more. Curious how y'all feel though, so let me know. And until next time, peace nerds. ## React Just Changed Forever - 20240515 we just got through the keynote for react conf and I had to run up to my hotel room so we could quickly talk about it because it was really really cool I think there's a lot here to dig into and I want to take the time to do it as quickly as possible so without further Ado let's talk all about the big things that just shipped in react the first half was focused on react 19 which if you want to know more about you can go check out my video that I already posted about it it's a long deep dive on all the cool things react 19 is changing the big one that got the most attention for sure was the removal of forward ref in favor of passing refs the crowd went nuts the one big B thing that got announced around react 19 is the fact that it is now an RC and the react 19 stable version should be shipping within the next couple weeks I'm super hyped about that react 19 is not the reason I Rush up to make this video though because as I said I already have one I'm here because another big announcement was dropped react compiler remember react forget at the last react conf we've been waiting for almost 3 years now for an update and boy did we get one react compiler just went open source and when I say just went open source I mean I was bugging the team to open source it so we could quickly read through the code before doing this video because I think it's important to understand what this thing is and how it works that said turns out it was 1900 commits like 1 190 commits and over 300,000 lines of code including both a JavaScript version and even a rust version that's still in progress so there's a lot to dig into here I want to take the time to do it so uh let's get cooking before we look at the code I think it's important to understand a little bit of what react compiler is and it's trying to do if you've worked with react you've had an experience before where something would update and it would trigger a bunch of things you didn't expect to update and the result is the website feels really slow sluggish and just not great to use this is one of those common tropes in react that's gone as far as people making whole new Frameworks trying to fight it obviously signals are blowing up too people are really hyped about these new Solutions the react team went a different direction they wanted to try and keep react code AS elegant as possible the react code that we always see in demos without all of the memorization junk that we had to do in order to make it performant they gave a bunch of examples of how painful it is to memorize which is fun if you think about it that The Primitives that the react team made are being made fun of now by the react team but I totally get it doing this stuff right sucked it sucked hard which is why they're rethinking this whole thing from scratch and I'm so thankful they're doing that the results speak for themselves the numbers they dropped are crazy for a few months now Hall of instagram.com has been using react compiler as a part of their build process and even though this is instagram.com you know by the company that makes react despite the fact that they had already optimized the code pretty well they still saw a 2.5x improve Improvement in the responsiveness of the app for certain interactions and a significant Improvement in the time to load pages as well we're not even talking about the code savings they're able to remove up to 177% of the code from some of the more memoized components and they haven't went through and stripped at all yet which is another important detail you're already using memo and using all these fancy optimizations in your app right now you can leave them in you don't have to delete them the same way you don't have to delete your class components to use hooks you don't have to delete your use memos to use the react compiler but this gets a lot more interesting as we dive into the details so I think it's time to do that the react compiler docs finally out so crazy to see this on the react site by the way if you want to get to this quickly they have a short URL facebook. me/ react compiler this is the link they also just merged the pr and uh getting through this is going to be fun even just opening the files change tab is enough to cause GitHub to lag immensely so we're doing some research we're going to have a lot to talk about with the source code in the near future but for now this is meant to be an overview of what this is and how we benefit so let's take a quick look here react compiler is a new experimental compiler that we've open sourced to get early feedback from the community it is a build time only tool that automatically optimizes your react app I want to emphasize how big of a change this is for the react team react has never really thought about build tools too much obviously they've made Integrations for them so things will work but historically react has just been the runtime with server components they move to the server but with this they're moving to build that said the benefit here isn't just in the builds it's actually not in the build at all your builds might be slower because this is a babble plugin the benefit comes in on the client side because now your apps are going to behave so much faster and the code you write to make it that fast is going to be even simpler it's a really cool change and a nice alternative to the other Solutions we've been seeing with things like signals it works with plain JavaScript and understands the rules of react so you don't need to rewrite any code to use it the rules of react thing is going to be coming up a lot so make sure you're noting that the compiler also includes an eslint plugin that surfaces the analysis from the compiler right in your editor the plugin runs independently of the compiler and can be used even if you aren't using the compiler in your app we recommend all react developers to use this eslint plugin to help improve the quality of your code base this was an interesting thing I learned from talking with the react core team they ended up as a company at meta getting better at the rules of react because of react compiler despite the fact that this is the company that made react there were so plenty of places where they weren't fully following react's rules and in order for the compiler to work its magic it expects you to follow those rules well and it will ignore files where it doesn't see those rules being followed properly this eslint plugin is like the rules of hooks plugin Plus+ it's like a pushed up and stricter version but I think it's going to help all of us write better react code anyways and I'm excited to see how it behaves in stuff like this and also how well we can optimize our code so what does the compiler do the compiler understands your code at a deep level through its understanding of plain JS semantics as well as the rules of react one thing it doesn't do is go between files though the react compiler is focused on the file itself and the contents of it so it can't optimize things that are over file boundaries turns out you don't need to do that in order to have crazy performance wins but I thought it was an interesting detail you may be familiar today with manual memoization using use memo use callback and react. memo the compiler can automatically do this for you if your code follows the rules of react if it detects breakage of the rules it will automatically skip over just those components or Hooks and continue safely compiling other code again huge makes starting to adopt this significantly easier and unlike a lot of the recent things react has shipped like specifically server components this is something that most of us can throw into our apps and see a benefit from already which is so cool to be clear might not be ready for production usage yet although they're using it in production already even in react native apps like the Oculus store for the sorry Quest store for the VR headset so they're using this for react native and react web and obviously the react com app too it doesn't mean it's ready for everyone to use in production but it does mean it works which is really exciting stuff speaking of which should you try out the compiler please note the compiler is still experimental and has many rough edges while it has been used in production at companies like meta rolling the compiler out to production for your app will depend on the health of your codebase and how well you're following the react rules you don't have to rush into the using the compiler now it's okay to wait until it reaches a stable release before adopting it however we do appreciate trying it out in smaller experiments in your apps so that you can provide feedback to us to help make the compiler better really cool stuff here's a bit of info on that rust Port we have a work in progress rust Port of react compiler the code here is unused it was developed to help understand the feasibility and path to porting to rust and integrating with various rust or non-js build systems such as s swc oxc es build Etc we're currently in the process of changing the data representation used in parts of the compiler to both improve compilation which will also have the benefit of making it even easier to port to rust we'll re-evaluate where to go the rust Port once the refactoring is complete cool to see that they're already considering faster Solutions there's no promise any of this will ever ship but they're not just waiting for a future where they might revite it in Rust they're making sure that this path exists from day one personally I think something like goang might have madeit more sense here just in terms of how much easier it would be to contribute to and how much faster they can get a working version but rust would be the ultimate in terms of performance it's cool to see that they're considering these things day one because making a Jank JavaScript Babble plugin to be this important a dependency is going to be a huge change especially if you're trying to use this in Dev to make sure the behavior is exactly the same in both production and in Dev I have concerns that the build times in Dev are going to get a lot longer here I'll be sure to play with that in just a second actually let's give that a shot okay turns out this is a little harder to set up than I thought I missed a bunch of things including but not limited to forgetting to install the Babel plugin installing the esin plugin thinking it's the Babel plugin when it isn't installing or using 18.3 version of react which is not the right version for this and then even when I updated react forgetting to update react Dom which threw some very strange unexpected errors anyways all of that is handled I now have an environment in V that can use the react compiler you might notice I have a commented out because I want to showcase how this works right now here I have a function block sync that blocks synchronously for two seconds this is meant to simulate a slow component obviously this should be async but this is meant to show what it looks like if you have a component that happens to be really slow let's say it's a component that has a ton of other components that it's mounting I have slow component which blocks for 2 seconds and then it Returns the div this component is slow here I have the count set count the usual super simple demo I have the images here yada yada but I have our button here where we set count and also have the count component and we also have slow component here because of that every time this component renders it has to reender a slow component to make sure nothing has changed and because of that this is going to take a lot of time when you click the button so when I click count we're waiting we're waiting we're waiting we're actually waiting for up to 4 seconds because it's rendering it twice to double check in Dev mode and if even if I click again same deal waiting waiting waiting and then we see count as two normally we would memorize this component I can show you what that would look like if you really want to see uh const memo slow equals react. memo slow component cool we have to import react and I can swap this over to memo slow refresh the page technically you should have to refresh because H reloading is cool and all but I'm doing it just to make sure everything is fine this component is slow count zero click it and now this immediately because this is no longer blocking the magic is not having to do this though so I'm going to comment this actually before I show you that I'm going to show you what the actual source code looks like once this is output so we hop into sources when you're in the sources you have the source map this is like the actual code but what we care about here is the code that is being used so here is the code that's actually generated here we have all these little indicators like pure whatnot I have the memo call the little comments being inserted by the compiler here to make things slightly easier for it but this isn't the compiler yet this is just standard build stuff and then turning jsx into JavaScript code but nothing here should stand out as particularly exceptional this is just mounting components and doing things the normal way it's like a jankier version of react code we have like the Hut reloading stuff built in here we have all the Imports for all the assets and things but this is pretty boring code and it's calling things the way you would expect like the uate call is done directly here nothing super special this is where things get interesting though I'm going to comment that out I'm going to switch this back to slow component so now it's going to be slow again but I'm going to uncomment the Babel plugin react compiler now I'm going to refresh the page to make sure everything's in a fresh State wait for the page finished and now I'm going to click the button and it's still fast even without the memorization I want to look at the code though because this is where things get really interesting so again we have the op TSX the actual code with Source Maps but here's the real generated output so this is the part we are interested in and you see in here things look a little bit different we have this Con dollar sign equals C2 obviously this isn't jQuery crazy I know this is their Syntax for memorizing things internally this is crazy nonsense you should never have to look at but the compiler is effectively generating a bunch of references inside of the components in order to handle these things for you so all of this stuff is built in here it can handle memorization if you passive props Etc and then an app similar utter chaos going on here we still have the UST State call but above it we're having all of these react memo cache Sentinel things happening first and then down here we see this crazy additional check where we reference the second value index one of the dollar sign array in order to see if this is a symbol for the cash entity which means do we have a cash entity for the thing we want to do right now if so we can yank things from that cash to render them otherwise we don't so this is effectively caching the the render state so it can pull from it directly we have a couple additional lets here you'll see a lot of let going on in this because we're assigning values through the render and we're pulling from a cache when we can instead of having to rely on our own memoization to do that caching effectively every single variable you're defining is getting put in a cache so it can reference and check if it can pull from that basically always which is almost always going to be faster than recalculating the value so checking for all of the different values that exist here to see if they exist yet or not even pulling things out of the jsx and seeing if these can be made pure and cached or not but of course when you make this change and you have as you see here significantly more code optimizing to make sure that these states aren't being rendered for no reason is now trivial obviously this was not easy for them to implement but the results really cool one more thing I wanted to try quick though is to see how the performance has changed in Dev mode so specifically when I make a change here how long does it take to see it in the browser how much is Babble slowing us down so we'll do something simple which is just delete this paragraph at the bottom I am saving in just a second you'll see the little thing in the corner there change from the dot to not a DOT when I save so let's see how long it takes still pretty Snappy all things considered when it already has it in the cach for the build and it doesn't have to check to make sure there's nothing different with the build so like right there where I had two different states that it's already compiled it can pull from the cash for that I make a new state by adding a new div hi and save now that's still really Snappy you know what maybe my concerns aren't Justified obviously this is a really small component and a really small demo app but I would have expected to see a much more significant build time penalty by running things through Babel it's technically only running this one file so it's not too big a deal that said I was expecting much worse here so I'm pretty pumped I obviously have limited time to go through all of this as much as I would love to dig into it more I will obviously be doing that in the future if you want to see how these things work and play with them now you can go play with the react compiler playground which will show you these outputs but I have another recommendation that I think is really good Jack Harrington actually got early access to the compiler which I'm hyped about because he was able to do a really cool video breaking down how it works and what the value is of it but it mainly is meant to Showcase different examples and use cases where compiler makes things better sometimes even makes them worse definitely check out his video if you want a deep dive on what this looks like to use and make sure you subscribe to the channel here if you're not already in order to keep up with how these things change over time and what people are actually doing with it I'm really hyped about react compiler this is a huge change and a fundamental shift in how we think about writing react and other web applications I couldn't be more hyped to play with this let me know what you guys think in the comments because I I think the future is very very exciting until next time peace nerds ## React Native Is MORE Popular Than You Think - 20250426 i am regularly surprised with just how popular React Native has gotten why am I talking about this right now though well when I was out on my trip to React Miami a video came out a very interesting video about how React Native isn't as popular as you might think this is created by Tastemaker Design it's his third ever video and considering how new he is to YouTube he did a phenomenal job i'm genuinely impressed and he brings up some really important things in this video a surprising number of which I agree on but there are a couple fundamental flaws in the things he research and the way he presents them that I feel like I have to call out i really hate doing a response like this to a smaller YouTuber i'm going to go out of my way to make sure all of you go watch the original because there's a lot of good information there and it's good to get different perspectives from different developers but just know not everything in this video is 100% accurate and there are more layers of depth to these things that are worth considering but that's why you're here instead of watching a nine-minute long video from a new creator you're watching this is going to be an hour i have a feeling yeah we have a lot to talk about here from how these big companies actually use React Native to the popularity of the tools across the entire ecosystem i have contacted a ton of people from both inside and outside of the React Native world i even scraped the app store with a friend in order to get the most up-to-date realistic data we possibly can for this but nobody's paying me for any of that time so we need to get a quick word in from today's sponsor so I can make sure the team gets fed and then we'll go straight to it today's sponsor is the best AI chat app ever made Deep AI oh god what is this is that a dolphin yeah I thought building a rapper for chat GPT was easy and making it look good was Yeah this is so cringe this is actually our competition i'm sorry my channel manager told me his sister uses this and I feel like I'm going insane if you want an AI chat app that isn't whatever the heck's going on here you should check out T3 Chat it's 8 bucks a month it is way less cringe it has access to all of the models instead of pretending the models don't exist like the other sites do yes like all of them we even have 4.1 which chat GBT doesn't have yet hilariously enough the amount of SS you get a month is insane our free tier is super generous 20 messages a day with the cheaper models it's hilariously fast just you'll understand when you see it it flies it's way faster than all the other apps navigating around it is way less painful than the other apps and if you want to get it for free for a month use code deep the code's only valid for the first redemptions and it's for new users only so if you're already subscribed or you subscribed in the past it's not going to work i'm sorry if you get an error when you use it it's cuz it was already used up we might do another discount though so check the pen comments just in case we did thank you guys for supporting this by the way it's been unreal the level of support we've gotten with T3 chat and it's so cool being able to justify an ad spot in a video for my own product back to whatever that nur was talking about if you haven't already watched this video again I highly recommend you go watch the original first rather than just me playing the whole thing reacting throughout I'm going to take clips of the parts that I think are most important for us to discuss and then go dive into those so if you feel like you're missing context it's cuz you are watch the original anyways not even going to bother with a clip for this first part just know I totally agree with the starting section here it's absurd how much just slop content there is about React Native good why everyone is using it i agree it's all slop i hate that these posts exist and that they misunderstand things as much as they do there's a point where I start to disagree though finally the React Native showcase hosted by Meta Open Source clearly states that Walmart uses React Native for iOS and Android the only problem is the Walmart app doesn't use React Native what's going on here okay and here is where the disagreements start i will first and foremost say the current state of the showcase for React Native on like the React Native docs it's not great it's not very up to-date it's somewhat misleading and I don't like that they link to individual apps especially when the whole app might not be in React Native but there are some nuances here that we need to understand first nuance is the distinction between the whole app being React Native versus part of the app being React Native react Native integrates with native apps so a lot of this video we'll get to this multiple points throughout seems to imply that an app has to be entirely React Native or not at all React Native despite the fact that the React Native project was started as a way to integrate things into existing native apps the point was that if you had a team that needed to be able to update things more quickly or didn't have mobile devs that wanted to embed a simple UI into an existing application like you know the ads UI in the mobile apps for Facebook the React Native would allow for the ads team to have a simple integration layer that works very similar to what they're used to on web that they can embed into different platforms like mobile without having to hire a bunch of iOS and Android engineers just to do that one thing companies like Facebook have more and more so been focused on vertically slicing their teams so instead of having a back-end team and a front-end team at your big company you would have a ads team or a feed team or a messages team that own the backend the front end the UI design and all the different pieces and React Native makes it way easier for vertical slicing simply because you can have a smaller front-end section that has more control over the different platforms that doesn't mean Facebook doesn't have an iOS team but they're a platforms team that's trying to make it so all the different people building with all their different stuff can throw it into the same Facebook app and have it all work together another nuance here is that companies have multiple apps while it is definitely misleading to say a company is using React Native when their main app isn't in particular I think the Skype case is relatively brutal here where it says Skype uses React Native but as far as I know the native Skype app on iOS and Android doesn't so I get why they would be upset about that definitely seems misleading what you have to realize is these companies are building a lot of things for a lot of platforms and React Native has benefited them all greatly no one's trying to intentionally mislead when they include Skype or Microsoft in the list of companies using React Native they're putting that there because they have friends who work there on React Native stuff the most egregious case of this is Amazon which we'll get to in a little bit but know that this is a very important thing to consider the Walmart example I admit is particularly brutal especially if the docs link to the Walmart app on iOS cuz as far as I know it does not use React Native that doesn't mean they don't though they are currently actively hiring for a ton of different React Native positions so I don't know why they'd be hiring for this if they weren't using it it is Jamon's understanding that they are using it for things like their internal global integrative fulfillment app and stuff like that companies like Walmart building small specific tools as mobile apps because so many of these companies have people working on the ground previously they'd have these crazy chaotic PDA systems that I I used to work retail at Staples i'm way too familiar with all this stuff it sucks most of these companies have moved over to using iPhones and iPads as their method of on the floor employees doing things like scanning a code on a shelf before they put the thing in a box or trying to do shrinkage tracking and figuring out where items are in their stores or just managing the fleet of drivers or managing your own routes as with an iPad mounted in your car just all these types of things at the scale of Walmart you build custom software to solve these problems and React Native made it way easier for these companies to do that walmart's not just hiring React Native engineers to let them sit and do nothing to say Walmart isn't using React Native because you couldn't find the little file you're looking for in their main app is just blatantly misleading as much so if not more so than what we're accusing the React Native docs of doing there should they have linked the official iOS app no but can you now say that Walmart doesn't use React Native simply because they don't use it in their main app absolutely not why would they be hiring these people otherwise this next section is where things start to really fall apart and I'll be honest before we even start it i have a bias here that I talk with a lot of the people who work on React Native directly and build with it at meta so I have insidefo not everybody has so I get how you could see this page is misleading but you should ask questions before confidently making this content this part has a lot of errors let's just go through it the problems begin in the first section with the meta apps by the way if you didn't know Meta is the company that created React Native the first link they show the Facebook iOS app is not built with React Native again we need to explain this key first part react Native integrates with native apps the way that Facebook uses React Native isn't as the root for the whole experience on the app that's not realistic with the amount of effort that's gone into this app like the Facebook app is one of the biggest most complex code bases in the world the goal of adding React Native was to reduce complexity in certain areas that needed to move faster that didn't need to benefit from having a dedicated like native team working on it and there are a handful of things in the Facebook app that are entirely built in React Native the biggest by far is marketplace on the Facebook app the entire marketplace section on both the iOS and Android apps was built with React Native and that's one of the biggest products that Facebook has right now marketplace is one of the only reasons I personally open Facebook and the marketplace experience on mobile is great one of the reasons why you don't know the Facebook apps using React Native is because the marketplace works really well you can't tell when you hop between the different sections because React Native is native it feels great obviously they have a huge benefit of being the company that makes React Native so if they do something wrong they can nudge the team have them come in and help and all of that i'm not saying everyone can make a React Native experience as good as Facebook can but just because it's good doesn't mean it's not React Native this isn't even some big secret facebook literally says it in one of their engineering blog posts they use another framework they developed called Component Kit component Kit is the higher level structuring they use for the apps but components in component kit can be React Native component kit was the higher level change they made in order to allow for different teams to pick different technologies and a lot of those teams pick weird stuff one of my personal favorites is project light speeded i'm going to ask chat quick what do you think the Facebook Messenger app is written in if you know don't people already are saying it yeah someone got to before I could even start fun fact the entire No worries at all you did your thing Ziko thank you for being you project Lightseed was a project at Facebook to rewrite the entire messenger code base primarily through using SQLite because SQLite was a really performant cross-platform layer they could use to control the app they used the native OS wherever possible using the UI with dynamic templates powered by SQLite using SQLite as a universal system and building a server broker to operate as a universal gateway between Messenger and its server features you know how hilarious that is that they are powering the UI and the templating through SQLite they try chaotic stuff at Facebook and the architecture of the apps isn't to bet allin on React Native it's to allow the flexibility to try different things in different places but we're talking about a company that for one of its most important apps ships a literal SQL migration to update your UI like this is kind of chaotic i wouldn't be so harsh on this point but the next thing he says is really really really wrong so I have to call it out the Facebook app might be using React Native in some indirect way like embedding a React Native web application in a web view for a subset of the pages i I might be wrong on this and if there if I am a meta engineer will contact me and I will pin it is a comment on the top of the video here meta does not use RN for web anywhere react Native for web is a chaotic project that is incredibly hard for me to recommend react Native for web is also something I've never seen anyone use on mobile at any point for any reason do I have to do like the top level like what makes React special thing i'm going to do it quick i'm going to go as fast as I can blasting through like how React works so if I have a React app and it's something like app body div sub nerds don't forget to sub only 50% of you are subbed sub to taste maker as well hopefully this code all makes sense to everybody we have an app it has a body and it has a div we could split it a little more so I'll put like a button hi button cool very complex code we have here if we were to architect this as a tree these squares we'd have app at the top here app has one child which is body and then body has two children it has that div and it has the button this all hopefully makes sense to you guys if you've been around a while you can see how this JSX HTML like tree becomes this actual node graph on the side apps the root has body as a child body has div and button as its children these can have their own children too you get the idea but what's the HTML that comes out of this well HTML in this case is going to be very similar because app doesn't exist it's just a JSX abstraction here's the actual DOM content when this is all done if you were to put like an inline function or whatever there you can understand how that would all work but the way that this becomes that is a coupleart process so you write this JSX code it then becomes this tree here we'll call this the virtual DOM that's what it is this is the VDOM and then the VDOM puts out the actual graph of what the real page content is technically what it does is it maps this to a node tree of its own that is what should actually be on the page and then turns that into the HTML content so we have our JSX code it creates the VDOM with all the nodes it then calculates what the real DOM will look like as a result of that and then it applies that to the UI and then when a change happens it checks to see what changed in the VDOM and then it only applies the changes to the corresponding elements what's really cool about React Native is that you can draw a line here and change what turns this virtual DOM into real elements react Native is a different translation layer here instead of translating from a virtual DOM to traditional HTML it will translate from a virtual DOM to something else that's the native part of React Native it can be whatever you want by default they support iOS and Android native applications so instead of having body div and button you would have text opacity or view like the different react native elements each of those is bound to a native primitive in the native OS code so that you can render a native tab bar a native touchable all these native elements that you would expect from these platforms react Native for web is reimplementing the traditional virtual DOM to React DOM with React Native primitives instead it's an additional layer that isn't necessary but if you want to use React Native code on native and on web with just one codebase RN for web is pretty cool the reason RN for web is its own crazy complex story i I talk about a lot of videos i don't have one dedicated to it but RN for web was originally built by Twitter because the lead engineer running web wanted to restrict what access the devs had to different DOM primitives they didn't want the devs to have access to all the different elements all the different styles and all the different things you can do in the browser and they built RN for web as a way to abstract just the parts they wanted the devs to have access to it's intentionally a limited set of web primitives through React Native you need a really good reason to use React Native for web and Facebook isn't doing that facebook is using React Native for different parts of the native app and I think this is the fundamental confusion that exists throughout this video that Tastemaker did apps can use React Native for some things they can use Cordova and all these other web tools for other things and they can use native and jetack and all the fancy cool tools for other parts too just because an app isn't using React Native for its initial load doesn't mean it's not using React Native and it doesn't mean they don't have more React Native engineers than traditional native engineers working on it but the the point of this here is to showcase the difference between React Native and React web and React Native for web you're effectively doing one additional translation to get it into the DOM when you use RN for web to once again agree with Tastemaker though they should be way more specific about how they are using React Native in these things if we are betting on React Native because we trust Facebook because they use it there they should tell us a little more about how they use it they do in things like React Comp but they don't in these docs so if you're an external person who's not part of the React community you haven't seen these talks you haven't had conversations with these people you don't know that and the docs are not doing a good enough job explaining that to people next up are the Facebook and Instagram MetaQuest apps i didn't actually check whether these use React Native but I wanted to include them because of their uniquely abysmal ratings in the MetaQuest store we need to talk about the MetaQuest if you're somehow not familiar the MetaQuest is a VR headset that was originally by Oculus a company that Meta acquired and now it is the MetaQuest instead they've mostly killed the Oculus branding the Quest is a very very good headset i'm a VR nerd i'll admit to that i am what I am i'm sorry i love VR i actually still like my Vision Pro as cringe as it might be and as absurdly expensive as it is the Oculus series has always broken my brain in terms of what it's capable of i've seen things I could never have imagined before inside of Oculus and I want to give credit where it's due to that the MetaQuest team works really hard to make groundbreaking experiences and the reason for that isn't because they're making a bunch of money on VR i think they've realized that chip sailed long ago they seem to genuinely love it it's pretty obvious that Zuck has some weird obsession with VR AR stuff not like I'm going to take over the world with it obsession but just genuinely cares too much about it like I see a excitement in him when he talks about it that he only has in certain things the reason we're talking about Quest is because a significant portion of the Quest experience is built in React Native there is so much React Native in the Quest it's actually insane from the actual platform for building 3D Quest first experiences which is a desktop app they built in React Native to the shop in the entirety of like the UI for it all React Native a bunch of different apps in the app store for Quest React Native the settings page vary calls React Native a ton of the UI and OS level stuff is React Native they use React Native a ton for Quest and a huge part of why they've been so focused on performance for React Native has been to make the Quest experience better and the results are pretty damn cool i have been really impressed both with the experience developing for Quest with React Native and the experience in these apps i know that the reviews for the Instagram and Facebook app for Quest are bad yeah 99 reviews on the app who's going to be more motivated to leave a review on a half completed app for Quest someone who's really excited it can exist or somebody who's frustrated doesn't do all the niche things they specifically want it to do i hate to pull the like popularity card but you'll learn this quick taste maker most comments are inherently negative because negativity pushes you through the boundary of no contact much faster than positivity it takes a much stronger positive feeling for somebody to be urged to leave a comment it takes a very small negative feeling for most people to bother doing it so that's the main reason the reviews are so bad it's also cuz to be frank the apps don't have all the features people are expecting that doesn't mean they're bad in fact my experience with these apps was very different because when I was talking with the React Native team about the Quest and all the work they were doing they like they didn't beg but they were very close to it to try and get me to go try the Facebook and Instagram apps because they were so proud of them they were genuinely so hyped on what they had built and it was very small teams under a very small timeline trying to reimplement from scratch these huge chaotic experiences like the amount of engineering work that went into the entirety of Facebook is hard to fathom the number of features the chaos of their API the fact that a small team could get together a mostly working version of it as quickly as they did and it feels awesome to use it's super fast and snappy the UI is stunning it's just missing a bunch of features and it crashes sometimes when you go to a comment thread that's using one of the features they haven't implemented yet it's also clear they haven't seen much usage of these apps so they are divesting from them they're not putting a lot of time into them because they have not gotten the popularity or the sentiment they were hoping for but they are well-built apps and I think they are good showcases of what React Native can do in weird environments because again React Native renders natively the React Native Facebook app isn't some web UI the React Native Facebook app for Quest is using native Quest primitives it's really really cool it's genuinely so cool and like seeing the 3D experience when you're going through Facebook and like going to an album and having the photos layered it felt awesome and the fact they did that all in React Native is genuinely hype scrolling down to the Amazon section we see more problems with the showcase when you follow the Amazon App Store link it tells you that the Amazon App Store is about to be discontinued on Android okay it's funny linking to something that's about to be discontinued that was a good dig the rest we have more to say about though next we have the Amazon Kindle app this one's a little tricky there are references to React Native and the Android app but only as related to com/azon/identity/off however there are 20,000 references to Android X/Compose which indicates the use of the Jetack Compose UI framework my guess is that the Kindle app uses React Native for a login screen but the rest of the app is built with Jetack Compose and now we have to go back to the core points from the list once again I need to remind you guys React Native integrates with native apps you can build something with Jetack Compose and have a bunch of React Native views you can even make an app that's entirely React Native but uses Jetack Compose as build pipeline totally fine people do that really cool stuff and companies have multiple apps this part hurt me particularly deeply because of the depth of Amazon's investment into React Native the only way you could think that Amazon isn't using React Native is if you pay no attention to what's going on in React Native taste maker brings up Hermes the JavaScript runtime much earlier in the video what he never brings up is static herase staticase is an attempt to rethink how JavaScript becomes code that runs on your phone by recompiling your type- safe JS code either through Flow or TypeScript to assembly not to Rust not to C to straight assembly in order to make insanely fast stuff and this presentation on static Hermes was from Svetan who works at Meta but a significant portion of the investment in this project has been coming from Amazon so Meta made this work with Flow amazon came in and added TypeScript support to a JS to assembly compiler do you understand the size of that lift do you think they're doing it for fun no they're doing this because they want React Native to be so good that they can default to it for everything and they are already using it for a ton of different things infinite Red which is a company that is cited in this video is a React Native expertise consulting group that I have worked with they sponsored me in the past they still sponsor videos here and there so account for biases there jamon's a good friend of mine he was a friend for years before I was ever officially affiliated with them he's invited me to keynote events i've been hanging out with him and the crew at Infinite Red forever and I've had plenty of disagreements with them i was really on the expo side when initially there was Ignite versus Expo and since then Infinite Reds went all in on the expo stuff too but yeah I do not always agree with Infinite Red but yeah I love these guys dearly i trust them super closely it's heartbreaking to see them accused as like the sponsor paying to bias me when they're one of the sponsors I am the closest of friends with like those guys are homies i would talk about them without the sponsorship they are almost doing us a favor at the channel by sponsoring us the reason I bring all of them up is because Infinite Red hosts a conference in Portland called Chain React it's the biggest US React Native conference the reason I'm bringing this conference up is because Jamon hosted a panel at it last year that included a bunch of very important people one of which is an Amazon employee and they talk all about the different places that they are using React Native at Amazon as well as Chiara from Microsoft who's again talking about the places they're using it Microsoft this is an awesome crew of people sharing very useful insights about how React Native is being used different places I'll let Chris from Amazon say how they're using React Native so can you tell me what what does Amazon use React Native for working with Eli to update the showcase for React Native's web uh the docs for website like and and the question was like how many how many different projects at Amazon use React Native so I started first going through like our code repos and then I started talking to some different teams and realized like independently all these different consumer product lines across the company have been using React Native for years so first off you obviously have the shopping app like there's aspects of the shopping app that are native and there's many many views inside the shopping app that are fully React native um then we saw some interesting use cases like for sure like Amazon music Amazon photos like those experiences across iOS and Android those are react native um but then you start walking into some of the wild uses of React Native so Kindle like if you use Kindle like how many has the the e- in device yeah so that like that's an implementation of React Native straight on top of C and so like I think the more that I dug in my mind was blown of like you know here we are thinking oh we're really you know in app store and devices were starting to you know ramp up into uh React Native because of demand and you're like no no this has been since 2017 like it's been used throughout all these different groups um and we just weren't all talking so it's been pretty fun to have like we have this React Native interest group internally like 600 plus engineers all trying to share modules like um projects we're working on it's pretty wild did you guys hear that not only are they using React Native all over the company not only do they have a 600 plus engineer interest group working to make React Native more common not only are they independently picking React Native different places throughout the company because Amazon's really big on like letting different teams pick their own stack they built their own react native rendering engine for raw C for the Kindle e- in display devices what but they're not using it in the store app yet they are using it in the store app but they're also building their own rendering engines for React Native for different platforms because they like it that much the reason Kindle is listed here isn't because they are lying about it it's there because the engineers at Amazon asked for it to be because the Kindle itself is using React Native i think that's super cool and to yeah no like they are heavily using it would it be nice if they gave more info on this page yes absolutely would it be nice if they at least linked to that stream to that recording yeah but one of the accusations that is le levying this video is that this whole page is biased because Infinite Red made it how would it look if they linked to their own YouTube channel as the source for something it's a tough balance and I think this page is not in a great state but it's really hard to find the balance for things like that like how much do you explain without being overwhelming or annoying how much can you explain without violating different agreements with other companies like it's it's a hard balance to do something like this like how cool is Amazon with you advertising your framework using their tools that is no longer just you clear somebody go give a talk that's now a marketing back and forth that takes months to resolve i'm going to be honest guys i don't even know how to include this section because it's full of a lot of reaches we're just going to go through it piece by piece rather than like play the clip and talk i'm just going to go through it with you guys first he says like all these apps aren't using React Native hard to verify for any given one of them but I'll take his word for it this list is not great i agree there they're overhauling it as we speak at this point you might be questioning the value of going through the React Native showcase since it's all anecdotal evidence about the popularity of React Native i have a lot to respond to there but we're going to skip that for a sec cuz I have something else I can use instead that is a lot less anecdotal this next part is largely thanks to Bacon Bricks Evan Bacon if you're not already familiar with him he's a legend over at the expo team who has been a wizard in everything from Lego to React to now React Native especially for a while now he's actually hanging out in chat answering questions incredibly helpful human being one of the best justifications of using React Native is that Evan Bacon is somebody who can now help you out on stuff like legitimately he's his knowledge of weird niche build stuff on iOS and Android combined with his knowledge of crazy React performance stuff he's he knows what he's talking about one of the many crazy things he has done is he built a tool to automate the process of reverse engineering bundles similar to what the video that we just watched was doing rather than manually downloading each one and trying to grab a given like file name in your decompiled binary he automated it for the top 100 apps of every single category on the app store he runs a check every couple weeks to see what the trends are in the marketplace and here is his most recent run apparently Apple made a change is making it hard again i'm sure I'll have it fixed soon but this run was on March 21st so just about a month ago the sports category of the top 100 apps 29 of them were using React Native one less than before of the shopping category 28 of them were using React Native entertainment 26 food 26 business 24 medical 24 this is all out of a hundred so in these very prominent categories about a fourth give or take are using React Native and you'll notice most of this is green because more and more new apps that are getting into these top hundreds are React Native because the React Native teams historically can move much faster ship updates quicker and build into the hype machine more effectively there are exceptions like two React Native apps fell out of the food category but then you have a huge one like the Burger King app which is largely React Native we also see indeed job search here which is a very important piece we'll be referencing in a second hopefully this helps emphasize the point I'm trying to drive here which is React Native is actually quite popular it isn't popular in things like games because games shouldn't be built in React Native the same way apps should be built in Flutter because Flutter is a game engine games shouldn't be built in React Native because React Native is an app engine apparently Indeed is migrating towards React Native they're not entirely React Native just yet dice would disagree oh dice okay people are missing the Flutter is a game engine joke and I don't care enough to explain it just if you don't know how Flutter works go look into it it's not using native anything at all this is a really good call out from check here it's also worth noting that we're talking about public apps right now publicly available things you go download from the app store not private apps for businesses things that aren't released in the app store things that are distributed through test flight and other distribution methods those are disproportionately React Native which is something we cannot see in any of these charts where we can see this is indeed job listings i know a lot of people are picking frameworks not necessarily based on how many installs they get rather they are picking them based on the popularity of hiring for those so if your goal is to get a job in one of the options React Native seems to be one of your best bets here because according to Indeed there are over 300 jobs open right now for React Native versus Swift UI with 25 and Jetack Compose with around 25 as well so yeah we could look at all sorts of other numbers and theorize all we want but React Native is very popular even if as we see in this video coming up you make the right subset and it looks like Jetack Compose is really famous before we get there there's one other part here I want to respond to which is about Infinite Red i think there are two key takeaways from what we've seen here the first takeaway is that there are corporate interests involved in the marketing of mobile app frameworks although the React Native showcase website is hosted by Meta the actual list of apps is maintained by a company called Infinite Red a React Native consulting company you may have encountered on YouTube at some point consulting companies are extremely prevalent in the mobile app space yes they are because mobile apps are hard to build and it requires a team of specialized people to get it right and React Native is one of the better tools for these specialized developers to help teams be able to maintain a quality app without requiring a bunch of native engineers to work for them the next part here is what really frustrates me though with React Native and Flutter consultants constantly writing puff pieces about their respective frameworks what's going on here the puff pieces being cited here are React Native Radio which is Jamon's podcast where he talks to other React Native devs about React Native stuff that's a podcast where he talks about the thing he's interested in it's not pretending React Native is huge the examples here it's static Hermes which we just talked about the JavaScript compiler that benefits people well of the React ecosystem he talks with a company that migrated to Expo from not using Expo with React Native none of this is a puff piece this is like real deep in the weeds discussion about how React Native is used i don't know how you could frame it that way i can see how you'd frame the things on the right this way with Base Flow because they did puff pieces on Flutter but that is Flutter not React Native and as you might see from the screenshot here all of those posts are from 2023 or older the puff pieces problem is real i'm not going to sit here and pretend that all the weird crappy Dev.2 posts that were AI generated about how popular React Native is are good they're not they're terrible but you cannot accuse the consultancies that are betting their business's livelihoods on React Native because they see very clearly how it benefits the companies they work with i I know it's a crazy thing to say but maybe the people who worked in other technologies and said "No React Native is the one that makes the most sense for our clients we're going to throw away our huge history with elixir a language that I deeply love and care about," which is what Infinite Red originally started doing they were an elixir consultancy that moved to React Native because they saw more success with their customers with it also on the topic of hiring if you're really interested in these things Expo you know Evan Bacon and crew they are currently hiring for ES Build Expo Router and the Expo web experience because React Native is doing so well and growing so fast speaking of which Evan have you seen this video because there's a part coming up that you're going to hate we'll get there in a sec it's the npm download section but let's keep blasting through this ui kit and Swift UI shouldn't be grouped together they're very different and there's a lot of handwavy acting as though Swift UI is more popular than it is throughout it we're about to get to another section of that in a second the newest AI apps including Copilot Perplexity CatchBT Claude Deepseek Gemini and Grock are all built with native code this makes a lot of sense when you realize how these things tend to happen at the big companies that are doing a lot of these oh we need a mobile app we should hire a mobile team to build our mobile app that's how these happen that's not how the real world works it is very rare that this happens and also you'll see like this is a very small subset swift UI is less than a tenth the popularity of React Native right now i I almost feel insane that this video is about pretending React Native is more popular than it is when you are picking an arbitrary category to showcase how Swift UI is more popular than it is swift UI is not that popular at all speaking of numbers I I take a couple issues with this next section too there's this report from Statista that shows mobile app framework adoption but it only considers cross-platform frameworks and not native ones we could also look at the Stack Overflow 2024 developer survey which includes this beautiful chart showing overlapping developer interest for React Native and Rabbit MQ for some reason or instead of looking at all of these random surveys we could look at the actual thing that matters which is how much success are React Native apps finding and how many jobs would you have available to you as a React Native developer i already showed the numbers but I'll show them once more as a reminder roughly 25% of the top 100 apps in any given category in the app store are using React Native and there are 10 times the number of jobs available for React Native devs than there are for devs using Swift UI and Jetack so sure the Stack Overflow survey says React Native isn't that popular the Stack Overflow survey is for a bunch of unemployed students it's not relevant it just isn't we should be looking at where the money is going if we want to know the success of the tools and technologies and the reason there is so much money going into React Native is because companies are pulling a lot of money out of React Native because it's going well for them we're not all just investing in this things we think it's funny and silly and we can trick people into using it we're doing it because it's been helping us with our businesses my background was originally mobile dev i used to contribute to like crazy Android ROM hacks when I was getting started i did that because it was easier to contribute to Android than it was to build an app at the time regardless of that I was deep in the mobile world for a long time and I was blown away when I saw how far React Native had come in like the 2021 2022 era that it's hard for me to really care anymore like about native technologies they're just it's cool when new features come in but I'm more excited to see them adopted and ready for React Native than I am to just see them thrown in and React Native is winning because it's benefiting all of us there is one other much worse way to measure the success of a tool in the JS world though but wait React Native downloads on npm are skyrocketing right now doesn't this mean React Native is taking over the world well if you look a little closer you'll see that the curve has an inflection point around January 2022 soon after the announcement of Expo application services there's a lot to say here but uh one thing that we can get out of the EAS versus Expo numbers we see Expo's peak is at like 140K a week versus React Natives which is around 3 million a week so if your accusation is that these numbers are artificially boosted because of EAS why is there a three-digit difference between the numbers what are you saying you can't plot the chart and say "Look these graphs change the same time therefore this is a number being faked by Expo when you show there is a three-digit difference between the two numbers on top of that they cash the install so they're not hitting npm half the time." Anyways Evan's in here he built a ton of this they mostly cash wherever possible so if EAS in the autob building tools that Expo made are the reason that we spiked from a million downloads a week to three million a week why is their CLI only spiking to 100K a week what if crazy thought React Native is getting more popular because people are realizing it's good and tools like EAS are coming out because more and more people want to ship with React Native what if all of these things are correlated because of the external reality that React Native is benefiting a lot of us in our businesses crazy absurd I know but it's very real the other big gap between these two charts I'm not seeing the correlation on these charts i'm sorry but like if the the point you're trying to make is that this blue line is causing this red line to triple I don't know what the heck you're talking about there there's one other thing I want to show here see the like slight spike at the start of 2025 let's compare that to EAS's spike wait what eas doubled almost in the past three months there's a reason for that too a lot of these AI app builder tools are picking React Native and Expo and despite the fact that this is enough to double Expo's numbers it's barely a blip in React Natives it's like a 15 to 20% bump so React Native is getting more popular because it's way better for these AI tools to build with because unlike all the native tools that we're talking about and shilling here like Swift UI and Jetack Compose it's actually open source and all of the tooling around it is open source too even if a lot of Android is open source a lot isn't in the current state of like Android Studio it's rough and Apple's tools are entirely closed source yes Swift itself is open source swift UI not at all the UI layer for Swift is the thing that's most important when you're building with it good luck finding the things you need to train your AI to do it well it's one of the many things Apple is doing terribly with with AI right now and I'm saying this as an Apple fanboy the AI assisted dev experience for Apple is slightly worse than Apple's existing dev experience both of those are really bad it's one of the other reasons people are moving to React Native even Apple fanboys like myself because this ecosystem has significantly better tools for developing good applications than Apple does can Apple's theoretically be slightly better when you slug through all the crap to get there perhaps the React Native apps have gotten incredibly good too and there's a reason why we're going to be betting on it for T3 Chat cuz it's good it benefits us i'm not betting on it because I think it's funny to do or cuz I'm trying to sell you guys some crap i am i'm trying to sell you guys T3 Chat yeah and if this was just me and others who are being paid by Infinite Red I would understand the biases and frustrations there but let's look at the top expo apps right now we got the shop app from Shopify Discord Microsoft Authenticator Capital One Chime Rocket Money Character AI Blue Sky blue Sky is also fully open source if you want a huge open- source React Native app to look at that's a good one it even showcas some of the problems that I have with React Native that I've talked about in other videos there is so much stuff using React Native here it's insane god I I could I've hinted at it for so long the depth of Sony's use of React Native is insane pretty much the entire UI for the PlayStation 5's operating system is in React Native i wish I could say more i probably will in the future but they bet hard and we haven't even really talked about Microsoft yet sure they're using it for authenticator but Microsoft's doing a lot more than that with React Native i mentioned that React Native's like official support is for iOS and Android obviously Meta has their own build for Quest as well react Native Windows here largely maintained by Kiara and crew actually is Kiara even that high up there no she's not good to know but the React Native for Windows port is maintained by Microsoft very closely with Meta but React Native for Windows is by Microsoft themselves it's not Meta or some other company trying to trick people into using React Native to charge more for consulting microsoft is doing it because they recognize the quality of their developer tools is not high enough and React Native provides a better experience for UI focused developers they are now using React Native for Windows in a ton of different things including really important stuff like the start menu or the Excel app i'm not saying the whole Excel app is in React Native but there's a bunch of stuff in it that is and what's even funnier people already caught on in chat react Native Mac OS also by Microsoft because they want to be able to write code with this quality developer experience and ship it to Mac and Windows desktop platforms at the same time so they built React Native Mac OS to do that and it's a fork because it's based on the iOS version of React Native there are no major versions of React Native but it'll probably be up to date again pretty soon i will say the React Native Windows and Mac versions tend to lag behind a little bit because they are huge complex projects and also because Microsoft's interest isn't necessarily being on the latest and greatest version it's building an actual platform that their developers can rely on to build UIs in some of the most important things that Microsoft sells and I will once again ask why would they use React Native for important things like the Start menu and Excel some of their most important key surfaces if it wasn't benefiting them are we just saying all of these companies are dumb i mean they are here and there but are they all falling for the same trap somehow magically are all of the companies hiring for React Native falling for the same misleading thing are they all listening to YouTube ads and being tricked into thinking React Native is good when it's not or do they have agency and they're making the decision because it benefits them crazy crazy I know but let's think this one through a little bit more seriously here guys it's also particularly funny that Copilot was an example of a native app using Jetack Compose in Swift UI because they're using Copilot on desktop in React Native almost entirely and again from Kira at Microsoft here sorry for mispronouncing her name i need to be better about this regative isn't just chosen for its crossplatform features which obviously is kind of like the killer feature but it's increasingly being chosen for its developer experience that's a big deal and on Microsoft's official React Native for Windows showcase we have the Xbox app also the Microsoft Store on Xbox so if you're on the Xbox you're going through the store React Native and as someone who's bought a lot of games on different consoles Xboxes is the least store the Switch store is unacceptably bad i don't know how it is that bad the PlayStation one kind of sucks too but it's also React Native so I'm not going to say it's React Native's fault there yeah oh one more real fun example kick moved off of X1 React Native claiming React Native was why their app was slow then they moved right back to it because it benefited them so much yeah react Native you can make a bad app with React Native you can do it really quickly too you can also make a good app with React Native it's slower than making a bad one but you can make really good apps with React Native and you can do it faster than you can with native technologies if you already know React especially okay I have one last thing I have to say about the Expo thing i'll just let Tastemakaker statement go first and all of the content and influencer marketing the Expo does on YouTube telling you that React Native is the best way to build mobile apps am I not allowed to have friends seriously though I have never received a scent from Expo i have been paying them monthly for 5 years now they have never paid me a scent they are in my content a lot because I like them they're building things that I'm excited as hell about my YouTube channel's only three years old i've been working with Expo and hyped on what they're building for twice as long as I have been doing this content stuff myself i'm not talking about them because they're paying me or their marketing and I sincerely doubt they're paying somebody whose YouTube channel is named Evening Kid to do influencer marketing and the reason they were on DevTools FM is because Evan has so much really interesting stuff to talk about it's also it's a podcast and notice that he cut off the view counts on all of these 1.7k views i'm sure that is really pushing React Native and making it way bigger than it would be otherwise like what i I just I I hate this particular appeal it's popular because they are buying the popularity you cannot buy popularity oh yeah the last one here is a conference he spoke at the conference because he goes to conferences and they invite him to speak because he has interesting things to talk about some of my favorite talks are Evan just geeking out about the thing he's working on yeah Evan here uh Theo dunking on my content now yeah cuz you're not a content creator Evan you're a Lego guy that happens to be good at web dev and mobile dev for some reason mostly mobile your web code sucks but uh yeah I dunk on you cuz you're a friend of mine and I love giving you this is my crew and that's why I'm so upset here is like sure call me biased all you want i'm defending my friends i made these friends because they're building things I was excited about and I reached out and they wanted to talk about it and sure I have a lot of subscribers on YouTube now but the reason people came to my channel is they found value in the things I was talking about and the conversations I was having and I've been fighting all of this misin as long as I can remember it all started way back when when I was working at Twitch and this blog post investigating React Native was published and what's really funny is people still cite this one against me as proof that React Native isn't good because a blog post from 8 years ago where actually by the time this video is published this will be at the 8year mark for when it came out this blog post was when React Native was nowhere near as good as it is today and it's still wrong in 2021 I rebuilt the Twitch app from scratch in React Native as a hackathon project and Alec here the author of this article was so impressed with that and his own explorations that he tried to publish a redo of this article saying that React Native is actually now ready for Twitch and they wouldn't let him he also was so frustrated with the mobile team that he moved to the web teams because he was getting so React build so yeah he ended up quitting right around the same time I did the author of this article is a huge fan of React Native now so yeah I've been fighting this fight for as long as I can remember and do you know how annoying it is having people cite an article that was written by a friend of yours saying "Look see your company doesn't even think React Native is ready." I'm like "Yeah I'm friends with the guy who wrote it he says that the article is wrong now." And it was half wrong when he wrote it you're the one who's wrong here and Twitch is too lazy to unpublish it or even put anything on it cuz the mobile team at Twitch does not want React Native to happen and now they're forcing the web teams to embed crappy web app experiences inside of the native app because they refuse to let React Native near their codebase this is the problem and when you spread misinfo the way this video does despite the fact the video is bringing up really important things that we should talk about this misinformation has weaved its way through it such that the conversation becomes inherently toxic and no longer about reality reality is React Native helps a lot of businesses reality is there's a lot of companies hiring for React Native devs reality is there's all of these React Native consultancies because more and more people want to adopt React Native as an ecosystem and a technical solution to the problems that they are having reality is that React Native is benefiting a lot of people and companies and you have to go to some crazy leaps in order to pretend it's not so yeah sorry for my frustrations i just I'm heartbroken that me talking about the people I like working with and the cool things they are doing is seen as some scop marketing ploy paying me off to talk about React Native because they want to make money how does Facebook make money if React Native gets more popular they don't something I do actually help with here and there is forming the pitch from the React Native team to the higherups so they can continue getting the funding they need to build the framework because believe it or not the biggest React Native haters work at Facebook and Meta there are so many people there that want React Native to die that are convinced it's a scourge that are constantly fighting the team internally before any of this even goes public facebook and Meta are investing in React Native because the React Native team has made a compelling pitch for the technology and they've seen a surprising amount of success with the things adopting React Native it's also worth noting the React Native team at Meta is like multiplicatively larger like at least 5x larger than the core React team at Facebook react web and React Native are massively different at meta because React Native is such an important technology for them now and it's also an incredibly difficult thing to build building a layer that lets you write code once and compile it to such different platforms requires industryleading experts in both iOS and Android code and they've hired a ton of them to build it i wish we could spend more time admiring the technical achievement that is React Native because it's so cool and I wish more mobile devs could just look at how cool it was instead of being annoyed because they're scared of JavaScript i want to end on one last piece of agreement here because Tastemaker does have good points for this especially the like weird fodder blog posts bits so next time you see one of these clickbait SEO articles about which mobile app framework to choose at least take it with a grain of salt yes take it with a ton of grains of salt these articles especially now in a world where half of them are freaking AI generated if you don't know the person who wrote it and you can't find other relevant work of theirs the author matters as much as the content nowadays so check who they are what they have done how are they relevant to you and I'll self-own a bit here i haven't published any particularly prominent mobile apps i've built a handful of them especially internal tool stuff but I don't have good showcases of my work on mobile you should be more skeptical of me because of that when I talk about web especially web performance stuff you better shut your mouth up when I'm talking about it because I know what I'm doing and there's plenty of evidence all over the web of me being an industryleading expert in web performance application stuff go try T3 chat if you don't believe me there's a reason it's so much faster and it's not cuz it's lower in features or I hit some magic button it's cuz I care a lot about performance on the web i also care a lot about mobile but I don't have enough evidence so I understand if you want to doubt me there but you should take a look at the industry experts and what they have to say about this stuff because there are so many incredibly talented people in the mobile space building absurdly complex and intricate applications and more and more of them are coming around the power of React Native and what it enables for their teams thank you Tastemaker for making this i know I was harsh throughout but the point still stands there are some real problems especially around these like AI generated crap articles floating around the web half the time I get a dev article I find searching it's absolute garbage but that doesn't mean we can respond with similarly misleading things i understand the frustration i am with you there the fact that when you try to figure out how to pick a framework you get a crappy article somebody spit out a chat GPT it's unacceptable and it's going to lead to new devs making bad decisions there are two important things to understand here though one is that these articles suck no matter what and we should be steering people away from these sources and the other is that beginners are going to screw up anyways we need to let people make the wrong decision and learn from it one of the reasons I stopped talking about Flutter is I like to think it's apparent once you've built a Flutter app especially on iOS that it's a crap framework for building crap applications and if you can't tell I don't know if you can ever build a great app we need to let the kids make the wrong decisions ideally they're not doing it because a crappy article told them to they're doing it because they thought the thing would solve a real problem for them but it's just the reality of learning how to code you have to make bad decisions in order to then go make good ones if you accidentally make the right decision when you start you're worse off than if you made the wrong one because now you don't know why it's right or how to learn from it so as hard as it is and this is something I struggled with a lot myself we need to let the kids pick wrong let them go build a Twitter clone with HTMX let them go try to build a super complex video encoding app with PHP let them try and build a fancy YouTube clone using Flutter they need to learn the errors in their ways and if you are this confident that React Native is a terrible technology that is going down not up let the market do its thing it's going to and rather than confidently stating things that are wrong try to talk to the people building it you might be surprised especially now that you put out a video that's viral you'll be amazed at who will respond if you hit them up asking questions if you see things on the React Native showcase that are confusing to you post about it ask reach out you'll be amazed who will respond i guarantee if you had sent a DM to someone like Jamon or Evan Bacon about your thoughts on all of this you would have gotten the same response I did a super fancy breakdown of what's going on in the space and how people are actually using these things if you're like "Hey I unbundled the Amazon app where's the React Native?" You could have been linked to the talk and learned where the React Native is but that's the biggest issue I had with the video is it's it started on a focus of a real problem which is garbage content being shared as a way of making decisions about what framework to use and it then slowly becomes one of those garbage sources itself and it breaks my heart because I see so much potential here tastemaker made an awesome video and if I didn't have one of the best editors in the world I would legitimately be hitting him up to help me with editing he can make compelling content i would encourage him to take the opportunity now that he has a platform to reach out to others in the space when you have questions about these things rather than making bad assumptions and only going one layer deeper than the surface there is so much depth to all these things i often joke that the React Native community is 10 times deeper than the React community despite being a hundth the size but it's true the amount of thought and care these devs put into these things is hard to put into words and I know this all in contrast seems like marketing fluff and I don't care this is how I really feel about it i am so blown away with the amount of just focus and effort going on in the React Native community some of the smartest and most thoughtful people I know I met through this ecosystem and I would highly encourage you Tastemaker to take the opportunity to talk to these devs i would almost feel bad if you didn't get to because there are some awesome people that you could meet and befriend to boost your career and do such cool things with and maybe just maybe you'll end up seeing the magic in React Native that we all see too and it's totally fine if you don't it's really nice to have friends that disagree with your stances on things one of my closest dev friends is a huge Flutter fanboy but he knows how to talk crap on the thing and point out its flaws and I love having him around because we can compare and contrast notes you got to have your crew of people who understand the thing you don't like well enough to have the conversation and this video feels like it could only happen in isolation from anyone who understood React Native and again to be very clear this isn't some fundamental failure of Tastemaker this is expected as a person who had under 300 subs and three YouTube videos at the time but now you have a platform now you have access to all of these awesome people take advantage of it is the coolest part about having this platform is the people you can meet and the things you can learn from them you no longer have an excuse to publish something underressearched and unfactual like this it is a totally acceptable thing that you made these mistakes but now it's time to make corrections and do the best you possibly can to correctly report on the things that you cover as part of your platform and if you ever want any help on this hit me up my DMs are open emails inside of my description on YouTube you can get a hold of me there's a lot of ways to do it i would love to help out however I can i'm genuinely impressed with the quality of content you create and with a little bit of change to how you do research and comms with other people in the space you could easily be one of the biggest people on this platform so thank you Tastemaker for bringing this topic up again and giving me an excuse to talk about one of my favorite things I don't get to enough anymore nowadays let me know what you guys think about this is React Native overrated underrated too popular not popular enough or am I just insane let me know in the comments until next time peace nerds ## React Native Just Got 550% Faster - 20241026 to everyone who likes to complain about how slow react native is I have some terrible news for you react native just got way faster and the way they did it is really really cool the new architecture is finally here I've talked about it a bit before but it's time to dive in because not only is it here it's here as the default for everyone installing react native today if you're on the latest version you can now use the new architecture and you almost certainly will be in the next couple weeks so what does this mean what is it doing why should you care great questions but first quick word for today's sponsor if you're a react native Dev statistically speaking you're probably a Firebase user and that hurts me I'm here to beg with you to plead with you please stop using Firebase there are so many great Alternatives one of which is today's sponsor convex convex is the only decision you need to make for your backend and I understand mobile devs want to focus on building great applications not all of the complexity of building infrastructure and convex is here to solve that for you you define a query with literally five lines of code and then all you have to do to use it is is call the hook use Query the API call that you defined and now you have the data it's that easy and you're not giving up all the ownership like you do with a model like Firebase where you're hitting their backend and their apis that you have no control over the logic the code the important part lives in your directory and this isn't some crazy nextjs backend deployed thing I'm showing you here this is from the Expo example you make an expo app you install convex and now you can do the backend side the off side file uploading and all of the things that you would use something like Firebase for in a much more react and types scripty way and by the way they do all the Live Sync stuff too no longer do you have to deal with crazy event management you just query some data and it will automatically update when the data's been changed it's never been easier to build a full stack application stop being scared of servers stop being afraid of backend stop worrying about all those decisions when you can just use convex anyways the new architecture is finally here react native 0.76 1.01 where are we getting our 1.0 how long has it been I had to I had to I know we're saving 1.0 for 2100 thanks for the free dunk anyways as we were saying react native is still not 1.0 they're holding that is a real high bar but at the very least we get the new architecture now and that's going to produce some really fun things including full support for modern react features like suspense transitions automatic batching as well as Ed layout effect the new architecture also includes new native modules as well as native components and these allow you to write types safe code with direct access to Native interfaces without a bridge this is a really really big deal I emphasize this whenever I talk about react native but I really want to emphasize this here react native is native and I think people often miss that you're not running a web view inside of your mobile app your JavaScript code is telling the native platform what to render a button in react native is a native button a tab bar in react native is using the tab bar that's built into the operating system that your platform has and if it doesn't then one will be built that behaves roughly how you would expect on that platform react native is a way of telling the native platform using its native Primitives what it should natively do the issue here is that a bridge was created to bind between those two things and that bridge got us really far and it was honestly pretty good but the thing that is new here is that you no longer need a bridge to call those things from the Native World calling the native C or C++ code calling the native Colin or whatever's going on an Android world all of that no longer requires that you use this bridge to copy values and pass messages back and forth you can even basically share memory between the two sides it's really powerful what this enables and when you combine this with a future with something like static Hermes where your JS code is being compiled to assembly the way this all comes together is that you make really fast apps using The Primitives that we're used to building simple web apps and that's a really cool really promising future I also think use layout effect finally working is huge if you're not familiar with the difference between use effect and use layout effect use effect runs after the render so if you were to I'll just do a quick demo of this I want to make sure we understand the difference between these effect types in order to make it clear why layout effect is so cool to now have in react native I made a quick demo to show it I have this console log when the ref gets mounted on the page so when this div gets put on the page the ref gets bound and it will call this log so we'll see when it loads we get D how us multiple times react doing things multiple times in Dev it is what it is ignore that part let's say I put a log here we have C render and we have D which is the raft binding hopefully we all know the order that's going to happen obviously the render code is going to run in the JavaScript before the element appears on the browser what about this use effect though where will that run it comes first so it should happen before because it runs on Mount right that's what happens when you do an empty array use effect not quite it runs on Mount but it runs on Mount after the first render so you have the render then you have the binding then you have use effect which is cool because if you bind a ref in this stage you'd have access to it in the use effect so if I actually bound this ref to a use ref call I could access the data that's in there so what does use layout effect do we have a b c d A's use effect B's layout effect C is render and D is ref what order do you expect this to be in where does use layout effect go this would even unintuitive for me a little bit because I I just didn't know how the ref ref binding would work but think this will be useful to know when I run this again we get C then D then B then a so what is the actual difference between use layout effect and use effect it seems like use effect comes first well there's a specific step in the rendering process that Ed layout effect lets you get in front of which is when the layout actually becomes part of the page the user sees so when the order of events here is that the component runs it calls all the logs it creates this it puts it in the Dom but it doesn't let the browser paint it just yet so the the content is there the browser is ready to show it to you but it hasn't yet in order for it to show it use layout effect has to run first I'll show you what I mean quick I added a ref to the title and here I set the color to red and the size to be much bigger I also threw a transition on it so that you'll see that it was actually different before so if we load this page quick you'll see the hello world comes in in the corner in white and then it expands and turns red the reason that it does that is there is a flash there is a moment where the browser sees that content in that way before the use effect runs and changes it if I just take this code and move it down here the use layout effect now it will run before the user gets to see the result which means any transitions those types of things don't happen because the wrong state is never shown so I go back here and refresh again it just starts in the right State that's the key hopefully this helps you understand why this is cool but how the hell do you get that working on react native because react native doesn't have this concept of a Dom that knows how big things will be so you don't get access to the same stuff I'm very curious to see how they handle that in here oh God this is how we did it before I was mostly able to avoid these things when I was working react native but seeing how you were supposed to do it is terrifying you had an on layout function you would bind the ref separately and then on layout is when you would trigger things like measure the size of the thing in the window and do things there use layout effect gives you that synchronous access that we all so crave and desire now a use layout effect lets you get the bounding client Rex and use it for whatever you want to do to make sure that your tool tip is rendered in the right place in the UI before the user sees it in the old architecture layout was read synchronously in on layout which caus the position of the tool tip to be delayed oh God yeah that sucks so the tool tip needs to know what room is available on the page it tries to go on top but if there's a room on top it goes on bottom instead the old way this would move after because it doesn't Trier the recalculation until after now it blocks before it shows it to the user so both can move together that's really cool to see good demo here too anyways let's go through all of the fun things and what the new architecture actually is this is the groundup rewrite of react native that they've been working on since 2018 and we've taken Extra Care to make sure that the new architecture is a gradual migration for most apps in 2021 we created the new architecture working group to collaborate with the community on ensuring a smooth upgrade experience for the entire react ecosystem most apps will be able to adopt react native 0.76 with the same level of effort as any other release to be fair upgrading and react native is never fun so the same level of effort isn't fun but it's doable which is nice I've succeeded before although most of my success is starting a new react native project moving all the code over and it just works it is what it is thankfully the most popular react native libraries are already supporting the new architecture and it also includes an automatic interoperability layer which enables backwards compatibility with libraries that are still targeting the old architecture over the past several years of Dev our team has publicly shared our vision for this new architecture if you missed any of the talks check them out below covered these here and there all really good stuff check it out if you haven't but I'll do my best to give you the overview that you need to hear the new architecture is a complete rewrite of the major systems that underpin react native including how components are rendered how JS abstractions communicate with the native abstractions and how work is scheduled across those different threats although most users should not have to think about how these new systems work work the change does bring improvements and new capabilities in the old architecture react native communicated with the native platform using an asynchronous bridge and this is the key I was talking about before yes react native told the native code what to do what to include what to put where but you had to block and wait on each side it wasn't synchronous it wasn't immediate you had to send a message and then wait for a response to render a component or call a native function react native needed to serialize and inq Native function calls with that bridge that they had built which would be processed asynchronously the benefit of this architecture is that the main thread was never blocked for rendering updates or handling native module function calls since all that work was done on a background thread and again that's the intuitive way to do things with JavaScript since the main thread isn't blocked it can keep doing things while in the background the native layer is doing its rendering but this comes with its own issues as well specifically that users are expecting immediate feedback to interactions and that those should feel like a native app remember this video I just did controlled inputs where I showed how bad controlled inputs were in react native where if you type quickly when you're using a controlled input it lags like that and if you're not familiar what the term means it means on change you set it in state and then whatever the value ends up being you show here this was asynchronous which means every key press had to send a message to the JavaScript code the message had to be processed then it would have to send another message to the native code telling it hey update this value to be this other letter and that all had to happen in the time between key presses in order to prevent tearing and all the weirdness that could exist the new architecture doesn't magically make this problem go away but it will make it a lot easier to avoid these types of problems and honestly I would bet if you just flip this over to new architecture it will be significantly less bad than it is in the demo here it is what it is I still don't think they should be recommending this pattern react native ever but since the new bridge isn't a bridge it's a native binding between the two it should handle this much better as they say here users expect immediate feedback and that means that some updates need to render synchronously in response to the user input potentially interrupting an in progress Rend since the old architecture was only asynchronous we needed to rewrite it to allow for both asynchronous and synchronous updates additionally in the old architecture serializing function calls over the bridge quickly became a bottleneck especially for frequent updates or large objects again what I'm saying when you're typing really fast not great when you have to serialize each of those changes each Direction this made it hard for apps to achieve 60 plus FPS reliably there were also synchronization issues when the JS and Native layers got out of sync it was impossible to reconcile them synchronously result in with in bugs like lists showing frames of empty space and visual UI jumps due to intermediate States rendering one more call out here 60fps is I would say table Stakes nowadays if you drop frames on mobile it makes your app feel a bit slower sure but if you drop frames in VR or ar especially frames that are interpreting like the environment you're in or the space in front of you it can make you very motion sick it can actually make you ill if I'm in a VR headset and I have a react native app right there and I'm my head and it doesn't stay here when I move it like follows a little and goes back and like jutters that tearing between the movement I'm experiencing and the thing that I am seeing will trigger sickness it is a huge issue and with things like VR and AR having a really stable frame rate that meets the expectations that our vision and most importantly our peripheral vision have is super super important and now that they're using react native so heavily inside of meta inside of all of the stuff they're doing in VR they care more than ever about performance finally since the old architecture kept a single copy of the UI using the native hierarchy and it would mutate that copy in place layout code could only be computed on a single thread so all of the computation for the layout had to happen one thread because there was only one instance that was being mutated and copied as an immutable boy someone who loves to not change values but make new values that's terrifying I never thought of it that way but that's really scary it makes a lot of sense why complex rea native apps were inherently slower because you couldn't paralize the work at all when it came to the rendering and as they call out here this made it impossible to process urgent updates like user inputs and layout could not be read synchronously such as reading in a layout effect to update the position of a tool tip huge deal because if you have a key press and you want to interrupt the other things going on you can't because there's only one thread doing that update in the first place really good changes it's amazing react native was this good without all of these things I so excited to see where it ends up now poor flutter devs also of note because this was single threaded it meant they couldn't support all the fun new concurrent stuff happening in react with all the transition work all the suspense work use layout effect these things that require concurrency weren't possible before and now they are trivial mind you implenting new architecture not trivial at all but enables all of these things to be built the react way the new module system is also really cool as it allows for react native's renderer to have synchronous access to the native layer directly which allows it to handle events schedule updates and read layouts both async and sync the new native modules are also lazily loaded by default which give apps a significant performance gain that's really cool too that you don't have to wait for all the native modules to spin up and tell you that they're ready before you can start getting the UI ready really nice change the new render can also handle multiple in progress trees across multiple threads which allows react to process multiple concurrent update priorities either on the main thread or a background thread update priorities means that different things you're doing in the UI have a different priority when I am typing I need to make sure that the text I'm typing is visible instantaneously that's more important than if I have when I type it autofills a search underneath it if I press another key I don't care what's going on with that search load and the spinning underneath it all I care about is seeing that result of the key I just pressed there was no concept of this update matters more than this update before because there's only one thread there could only be one update you could interrupt now you can really nice and it means things again like that Jank with the controlled input are much much easier to solve it also supports reading layouts for multiple threads synchronously or asynchronously in order to support more responsive uis without Jank the new event Loop can process tasks on the JavaScript thread in a well- defined order this allows react to interrupt the rendering to process events that are Urgent enough that they should take priority as I said before like when you're typing and that should take priority over any lower priority UI transitions it's also cool that they support all the fun web spec stuff like microtasks mutation observers and intersection observers CU these are not easy to implement having these working and Native is really really powerful and quite exciting and of course removing the bridge allows for faster startup between the JS and Native runtime now that you're not building this huge thing between them so the cost of switching work between native and JS is now minimized it also allows for better error rep oh boy I had even thought of that part the debugging and error reporting side here it's going to be a lot better oh man that that's if anything is the problem with react native it's the the quality of the debugging and error management experience it was not fun it was one of the few things I actually was impressed with with flutter this makes it a lot easier to catch up in the react native World exciting why would we ever so they say the new architecture is now ready to be used in production it's 0.76 you're using things that aren't a major version in production it's not even 1.0 yet is Facebook really shipping Tech that isn't 1.0 thought you were a real company what the hell joking obviously it's already used at scale and meta in the Facebook app and in other products like all of their VR stuff we successfully used react native in the new Arch in the Facebook and Instagram app that they develop for their Quest devices yeah the quest version of Instagram and Facebook is entirely built with this react native and new architecture stuff I've been told by many people I need to try them specifically the Instagram app and Quest because it's really good I have not had a moment to because I've been far too busy but I do actually plan to do that very soon our partners have also been using the new architecture in production for months now have a look at the successful stories that exist with companies like expensify and Kraken and also Blue Sky new release is using the new architecture too new native modules the native module system is a major rewrite of how JS and the native platform communicate it's written entirely in C++ which unlocks many new capabilities fun fact about multiplat that a lot of people don't know if you want to write native code that works on IOS and Android the language you write that in is C++ you don't know this about twitch the chat color of your name is fully customizable as in you can pick any hex code that you want there's an issue with this though twitch has dark mode and light mode that means if you pick a color that isn't compatible in the contrast sense with the color scheme user using like if I pick straight white or something that's white enough that in light mode it doesn't have enough contrast it sucks so switch out a fun feature here readable colors and if you turn this on and off you might not see much a difference here but if somebody had a name with a color didn't have enough contrast this would change the color in order to make sure it contrasts the right amount something that was really important to the team working on this is that chat colors looked the same on every platform so the iOS version the Android version and the web version if all three were in dark mode your username should be the exact same color in all three which means that the code written to make the colors readable to do that hex code transformation is in C++ because that is the best language to make something that is truly multiplat and doesn't have massive potential performance issues spending on how that platform handles the performance for it so all of the code that handles the color hex code transformations for twitch for chat is in C++ there we go cool see that since I'm not a mod Co unreadable that is by default if I switch the switch on it becomes readable the code that does that even in the browser version is C++ and wasum because we wanted to be sure the math would be identical on every platform so yet again we have a wonderful example of using C++ for uis which is one of my favorite things so as I was saying here if you want have fast code that runs exactly the same on all platforms and IOS and Android are your concerns C++ is probably your solution thank you Chatters for helping me with that anyways by writing this binding layer in C++ they've unlocked a lot of fun things from synchronous access to and from the Native runtime so again you can just call in and out without having to block and wait for Io type safety between the JS and native code also very fun because they're the same environment so to speak now code sharing across platforms because again C++ code share is now an option previously the bridge was written in different things for the different platforms now there's one Bridge it's almost like like you can think of this almost like the jvm if it was more native and built around JavaScript and for Native applications it's kind of nuts and obviously the lazy module loading I mentioned before it's now in and it's a default it's really cool in the new native module system JS and the native layer can now synchronously communicate with each other through the JS interface the JSI and that means that they no longer need to use an async Bridge your custom native modules can now synchronously call a function return a value and pass that value back to another native module previously if you called native modules you'd have to have like a call back when the value was returned yeah syn call backs from native module so you'd have to use this get value to get your call back and that would have to be async and then do something here and value cannot reference a native object so it has to be a clone of it so if you get something from the Native layer it has to be serialized it's almost like the native layer is backend and your react code was front end but the front- end code is telling the backend code what UI should exist fun stuff now you can just say value equals native module that get value and that can be a reference to something native huge huge change yeah this is an async callback not sync call back thanks for catching that Ricky a lot of people tend to catch typos in these things no worries at all I'm happy you guys got this out anyways you can now finally leverage the full power of the C++ native implementation while still accessing it from JS and TS API so cool remember earlier when I was talking about static Hermes starting to see how powerful that might end up being there is some fun stuff Happening Here the new module system supports modules that are written in C++ so you can write your module once and it will work across all platforms including Android iOS Windows and Mac what about Xbox and Playstation my favorite react native platforms implementing modules in C++ allows for more fine grin memory management as well as performance optimizations additionally with some code gen your modules can define a strongly typed contract between the JS layer and the native layer from our experience cross boundary type errors are one of the most common sources of crashes in crossplatform apps yep not knowing the type of the thing you're accessing tends to be the problem this is also the case with the bugs between backends and front ends most of them are because the front end expects something the back end doesn't or the back end expects something the front end doesn't if you have type safety between these layers life gets much better and as I said before the native layers kind of a backend so to speak having safety between those layers is really powerful I am curious about this code gen so code gen is a big new thing in the modern react native version where you can generate code when IOS and Android apps are being built can also manually call it what does it actually do though tightly coupled with a react native app it lives inside the react native npm package and it crawls the folders in your project starting from a directory that you specify in the package Json looking for some specific JS files that contain the specification or specs for your custom modules as well as components spec files are Js files written in a type dialect react native currently supports flow and typescript so now the code gen will generate boiler code and it uses the type definitions to make sure it's right on the other side and it uses the definitions on the native side to make sure the types match what is expected it means your types and your native code are now much more in sync very nice modules are also now lazily loaded as I've said a bunch of times now reduces startup times and keeps the complexity low if you go to different views that have really heavy modules those modules don't get loaded until then and you can have your homepage on your app start immediately even if other things in the app are slower react native MKV is a phenomenal Library it's a key Value Store that you can use in react native that is really really fast like hilariously so yeah and as of their V3 which requires the newest react native in the newest architecture it is now a pure C++ turbo module that's why it is so fast it is a C++ code base that is really cool does that mean that the react native ecosystem is going to have more truly native devs than like the Swift ecosystem because Swift is a bigger abstraction on the native behaviors than C++ is that's kind of funny regardless this is cool the new architecture doesn't just make it faster though it also allows it to be fully type safe which fixes a long-standing null point of reference issue because now they can enforce null safety which they couldn't before because there was no safety on these other sides good stuff they also completely rewrote the native renderer the thing that actually puts the native elements on the native application layer that means that updates can be rendered on different threads as I mentioned before they can be read synchronously across all different threads and the renderer itself was written in C++ and now can be shared across plat forms the amount of platform specific code that's probably killed by these changes is really cool to think about especially now that react native isn't just IOS and Android it's supporting so many other things it's a significant step towards their many platform Vision view flattening was an Android only optimization in order to avoid deep layout trees but the new renderer with the shared C++ core also brings that feature to iOS this optimization is automatic and does not require setup it comes for free with the shared renderer good stuff the new renderer also is why the concurrent stuff works we've talked about that already but we haven't talked what is the libraries that support it like reanimated if you're not familiar reanimated is a wonderful wonderful library because it shows just how we are in the web world because reanimated makes it so easy to do good animations for things including entry and exit animations like proper enter and exit see this we'll never have this our beautiful JavaScript web world will never get a proper entering and exiting because when you remove the element from the browser it's gone you can't run animations on a thing that isn't there so you have to abstract the removal of it in the react code can't just remove the div you have to have the div in a state where it fades and then after that is done trigger the removal and that multi-step thing is just the reality of building for the web but since react native is a different abstraction they don't give a they can just give you access to that rendering layer and Define an exit function and Define something that allows it to break out yes the view transitions API is a thing the view transitions API is much more focused on navigation when the whole HTML works and more on how things move when they shift around not on animating things being removed it does allow for it but I haven't seen anybody with a good demo of like a list where when I click X on an item in the to-do list it goes away with a nice animation without having to do everything with some heavy JS layers it's it's a huge thing and it when you're working react native a lot and then you go to web for a bit you end up missing reanimated a ton and now it's way faster as they say they have a new animation engine that works directly with the new renderer which allows it to handle animations and manage layouts across different threads the new renderer design is what truly enables these features to be built without relying on numerous workarounds since it's implemented in C++ and shared across platforms large portions of reanimated can now be written once reducing platform specific issues minimizing the code base and streamlining adoption for out ofree platforms huge stuff and everyone's favorite the event Loop there is finally a well-defined event Loop in react native they're trying to get it as close to how web and HTML works as possible and they're pretty damn close to it this closes the gaps between the react Dom Library which if you're not familiar react is the thing that you write your jsx in and build your virtual Dom your tree of what's going on with react Dom is how you then put that in the browser how you have a div or an H1 or all of those react native is the renderer to do it on platforms why you have a view component instead of a div and all of those things there was a pretty big gap between these and how they worked that Gap has been significantly close to this architecture react Nave is closer to react Dom than it's ever been which helps deliver on the original promise of learn once right anywhere the event Loop also brings some fun benefits like interrupting rendering closer alignment with web and a foundation for more browser features to be supported and react native now we're getting into the fun what I'm here for the removal of the bridge old layer we have the react render the async bridge the native renderer the RCT view Tada now the react renderer triggers the native render directly and synchronously with the direct bindings to the C++ functions tada this is a fun example this is using a native timer so that you can trigger a timeout correctly using the native timer previously to instantiate this you would have had to do some weird importing set timeouts on the global to Define this and then you could call it but you had to interrupt startup of the app to do it now you just call runtime. global. setproperty and it runs when it's ready to you don't have to worry about it oh JS crashes at startup is such a problem it's so hard to debug if the app doesn't even open this does make that a lot easier in the new react native Dev tools will simplify debugging and support new Dev tools how new are these that's a lot better already it's all based on the Chrome Dev tools it lets you connect what this does is you create a Bridge from the Native application either on a real phone or in a simulator on your computer and then you can connect that in the JS instance there to the Chrome Dev tools it's good stuff got the pro tip to look at this other blog post that brings much more info about the new Dev tools up you want the tooling you use to debug react across all platforms to be reliable familiar simple and cohesive the react native Dev tools deliver on these principles they're browser aligned developer tools that are deeply integrated with react native finally this is the thing I'm most hyped about so far actually I uh I've wanted this so bad for so long this is the like the biggest missing piece for EXC me this is the biggest missing piece for react native and it's like finally being fixed oh boy finally yay fix oh the reconnections it was so unstable that's such a good change yay the react native Dev tools are fundamentally a different experience from our previous debugging options including being different from the experimental debugger experience that they first shipped in 0.73 it switches to a new new backend debugging stack that they've rebuilt over the last year that means compatibility with previous tooling has changed and you should expect a much more reliable experience end to end finally this should have been there long ago I'm hyped they have a whole section here about gradual migration really useful for all of you guys building real applications I'm not one of those people I would be building a new app with this so I don't care so there if you want to read it but here we have the new features a lot of these are new reacting features so if you've kept up with that you're probably kept up already but if you haven't quick overview you have transitions that allow you to distinguish between urgent and non-urgent updates so that things like typing can be prioritized over switching UI States I like the example here they specifically call out that a user input should probably result in both urgent updates as well as non- urgent ones similar to react Dom events like a press or a change are handled urgent and rendered immediately and you can use start transition inside of one of those input events in order to tell react which updates are and aren't important imagine a slider that generates tiles depending on what the value is you slide it left to right from one to whatever you would want the number and the state of the UI like when I drag it you'd want the input to move immediately but you wouldn't want the tiles being rendered to block me moving that thing left to right so we call set count before the start transition and that is telling react hey by the way this is a priority this isn't so if I do another one of these soon after throw away the work you were doing here ignore it the priority is here soting to see why this release took so long as people are saying here this is the biggest launch of react native since it originally came out and Rick from the team agrees yeah this is very nice to have inside of react native so here what you'll see is you get a loading State and you can move the bar around and show an Old State here without the bar being blocked by it here it gets blocked you have to render these things so if you're sliding you'll see the slider stop and go a bit further yeah very nice very cool to have that finally ALS automatic batching previously you'd get this weird flowing in now with the automatic batching the updates will come in chunks instead so the UI updates won't be as weird and jarring they get batched very nice the count here doesn't update but the slider position does since the slider's uncontrolled that's a detail I didn't notice here okay I I actually misread this entirely okay yeah so the difference here is actually more subtle than I thought notice that here the number stops until the rest can render and here the number constantly goes up as you're sliding it around because updating the number there is cheap rendering the tiles isn't necessarily and that means there's going to be points where this shows a number that is different from the number ofes actually being shown because they are separating those behaviors really cool I already discussed use layout effect really useful for things like tool tips suspense finally I have so much content about suspense I hope you guys are already familiar with that at this point so I could skip that we now have proper full suspense support in react native and finally the how to upgrade section as I mentioned before I'm not upgrading I'm starting from scratch you have it here if you need it so on a high-end device like a pixel 4 the difference here is not that great also Android being Android means there's a pretty large abstraction there but if you compare that to iOS you'll see a good size bigger nicer bumpier with 5,000 images 33% faster pretty good what I would like to see is more of the like perf on interactions and such I'd imagine a lot of that especially with like bad enough apps could possibly be 5x plus better but this also more importantly enables us to build in ways that we couldn't before I have my clickbait one of the screens is 5.3 times faster for the kraken app because of the new react native architecture huge the automatic matching for things like this oh it's so good this is actually a great example of an app that benefits a ton from it good thank you for this that's all I got I couldn't be more excited for react native I might even go start working on a new app what about you are you going to try react native in the future or are you sticking with flutter let me know and until next time peace nerds ## React Native Just Made A Long Overdue Change - 20240703 using a react native framework such as Expo is now the recommended way to create new react native apps you can read more about our Official Guidelines and our latest blog post or you watch this video we're going to break it all down because this is a huge huge change for those who don't know react native was not easy to set up back in the day and by back in the day I mean honestly up until everyone started using Expo and even then the people who weren't it was a rough time setting up react native involves not just setting up a JavaScript project but setting up a JavaScript project using an obscure bundle called Metro and also setting up an iOS project and an Android project using the native tools for both and then creating the bindings and the relationship between all of those things it's it's miserable and I've had enough of a rough time throughout my career getting that working that I gave up long ago and moved to Expo and it's been a great thing there's a reason that when we support upload thing with react native we do it almost entirely through Expo because anything else seemed like suicide which by the way if you're react native Dev and you want to add file up to your service upload thing is the best way to do it if somehow this isn't the best way to do file upload your mobile app hit us up and we'll fix that anyways sorry for the self-plug we're here to talk about react native so what's going on here why are they recommending a framework at react comp we updated our guidance on the best tool to get started building react native apps a react native framework a toolbox with all the necessary apis to let you build production ready apps using react native Frameworks such as Expo is now the recommended approach to create new apps I love that they said such as expo here they're not hiding it if you're not familiar with the drama that we've already had with react for web create react app went through something similar if we go to the react dodev site for the actual react docs we search for framework they have a whole section here for how they recommend starting a new react project if you want to build a new app or a new website fully with react we recommend picking one of the react powered Frameworks popular in the community you can use react without a framework however we found that most apps and sites eventually build solutions to common problems like code splitting routing data fetching and generating HTML these problems are common to all UI libraries not just react they recommend you start with a framework because create react app was not it was a mess and especially with new things like server components and deep routing data loading patterns becoming more and more common in react having a framework that can support those things without your team having to build them yourself is effectively essential I heard somebody earlier in chat mentioned that they had multiple employees at their company that's job is just dealing with parcel the bundler these Frameworks all handle those things for you you don't have to think about bundlers anywhere near as much if you're using next or remix or V or any of these other tools they just kind of take this problem away so they recommend on react that you look at nextjs or remix they need to remove Gatsby from this because it's like formally dead at this point but also they have Expo in here for Native apps and they don't put V in here sadly because it's not a full stack framework it's just a bundler but you get the point I'm just happy that create react app isn't in here anymore because it shouldn't be and the equivalent is happening with react native where create react native is no longer recommended at all they tell you explicitly that you should use a framework such as Expo as the recommended approach so why do they care why are we doing this well first we need to answer what is a react native framework which might be a good question for a lot of y'all I mean us deep Expo devs know but if you don't why would we need a framework we don't need a server we don't need all these fancy bundlers and things what's the importance of a framework in react native well if you've been building production apps for long enough you almost certainly know that there's a set of common problems that we need to solve sooner than later when building any application on either web or native you probably want your users to navigate through different screens fetch data store the state of your user and more but for Native apps there's even more to deal with you need tools to upgrade the native code between react native versions you need to manage compatible versions of all your dependencies and you even need to deal with the na of build tools don't get me started on xcode or Android Studio please it's it's rough it's real rough in these days even I I was talking to some people who are deeper in the xcode world and the way it was described to me is xcode is still based on the next step code base if you don't know too much Apple history Next Step was the operating system that Steve Jobs built at his company next after he got fired from Apple because he knew that apple had a operating system and needed something better and the only way they could get that is if they bought him so he built the whole computer company just to build the operating system that Apple needed so that Apple would be forced by him so that they could have the operating system genius move one of those like 4D chess things that jobs always did and yeah xcode is still based on the dev tools for next step and they've just kept adding things on top like xcode is not a tool where they deprecate which is why it's a massive bundle it's why it's so slow and miserable and the the chaos of that world is where it's at G yeah no xcode is miserable oh that's a great chat from YouTube crazy enough xcode is so user friendly if you hate your users and you want to make them suffer totally agree anyways it takes a village to bring an app from idea to production without the right tools I mean it takes a lot of work to do it with the right tools too but the village is just supporting the tools we want you to focus on writing beautiful applications and features for your use and not just solving those common problems over and over again that's why we believe that the best way for you to experience react native is through a framework that offers a toolbox with all the necessary tools you need to build production ready applications we found that you're either using a framework or you're building your own framework I love this line This has become part of like the react ethos and generally the web dev ecosystem is embracing this too even places like solid have acknowledge that yeah if you don't have something like solid star or in spel you don't have something like spelt kit you end up Reinventing all those things yourself anyways so what if we had a good enough common solution so we're not Reinventing everything we can just build it's like almost the PHP ification of JavaScript where we're realizing these tools are valuable they shouldn't provide everything but they should provide the common things so that you can get back to work and plug the right Legos and on top later on there's nothing wrong with building your own framework though by crafting your own solutions for routing navigation deployment and so on major corporations like meta and Microsoft build their own Frameworks internally to integrate deeply into their existing Brownfield applications but we believe believe that most people will be better off by using an existing framework this is an important Point too cuz a lot of react native apps aren't starting as react native apps they're starting as existing old ancient Native apps I've heard crazy things like the Instagram app from a cold start takes like a day to build like over 24 hours actual insanity if you also have to add a bunch of additional things to plug react native in as a shim in there that's rough if you can get that working with Expo awesome you should do that but for those who don't have those opportunities God it can be miserable it can be real real miserable and that's why these things are so important because for those who are Green Field we need a happy path but also those who aren't Greenfield they're kind of and the fact that new apps and ancient apps had the same Dev experience with react native meant everyone was suffering but at the very least starting new apps is way better now be nice to have happier pths for integrating into existing apps because a lot of companies want to make it so certain teams can move faster and if you have a web team that's doing a great job on like the store for something like Instagram you want to add that to the native apps but you don't want to hire a bunch of IOS and Android Engineers to just do those two features and keep them all in sync well if you could have the react devs contribute that feature in react native that's really beneficial that's why these companies have teams building both react native itself and all the tools around it which by the way if you don't know this Microsoft is actually building react native for both Windows and Mac OS and they use it heavily in Windows 11 for things like the start menu and most of the Xbox UI is react native as well just crazy anyways if you've been using react on the web you're probably familiar with the similar concept of production grade react Frameworks that's the article we just pulled out pre-read clearly as of today the only recommended Community framework for react native is Expo Folks at Expo have been investing in the react native ecosystem since the early days of react native and as of today we believe the developer experience offered by Expo is Best in Class Expo the framework is and will always remain free and open source while the Expo application service is an optional paid service which by the way EAS so good remember earlier I was talking about how miserable xcode is to deal with what if you didn't have to e is Expo hosting a bunch of mac build machines for you so you just hand them your react native project give them the credentials for your Apple developer stuff and they just generate the app they just give you the file to install and have a button to Auto send it to the App Store the amount of I have dealt with in my life that Expo has turned into two clicks is unbelievable it feels just like when they first use verel after you lived an FTP deployments for your whole life you just click two buttons and it builds it's so good you can actually build an IOS app without having an xcode installation on your computer hell you can build an IOS app now on Windows it's so good I see people in chat saying that they actually rent a Mac only to build their iOS Progressive web app shell in xcode because they don't own a Mac and Es or E would be so much cheaper yep it's so good I know people who aren't even on react native that are using e just because it's one of the best ways to build mobile apps Katie did a great talk at react comp this year all about why Expo is so good for react native devs they also have a getting started page too for those who are interested links in the description you can find all these from there so how will Frameworks actually affect you well if you're already using a recommended framework like Expo you're good to go if you'd like to migrate your existing app to Expo you can find instructions on the official Expo website they offer many benefits such as an easier way to upgrade your react native versions better developer experience and much more react data version upgrades are still hell not going to pretend otherwise I will continue to talk very posit POS L about react native as it enables both a great developer experience and a platform for developers to do awesome things for their users but man upgrading react native versions as hell like actual one of the most miserable things I've had to do half the time I'll just initialize a new project copy over all of the actual source code and then fix whatever's broken from there because trying to bump things has been so miserable for me especially when you're dealing with IOS and Android dependency that are entirely different their own separate chains miserable they also say though that if you can't or don't want to migrate Expo you're fine use react native without an official framework will continue to be supported the tools that you've been using like react native Community CLI template and the upgrade helper will all continue to work as usual the react native init command though has moved out of core and is now accessible via react native Community CLI latest init yeah they don't want react native the package to have an opinion on how to initialize so now you can just go do that they have a bunch of further reading here for those who are curious and want to better understand these things one more thing I'll recommend that you check out if you're into react native and you even vaguely know what server driven UI means you should watch this and if you don't know what server driven UI is you should go watch my other server component videos and then go watch this because Evan Bacon's Universal react server component stuff is so mindblowing it's so cool the idea of native uis being driven from the server is not just like cool and exciting it fundamentally changes how most software devs can build mobile apps right now big companies like Facebook and Google have crazy systems they've built to allow the server to describe not just what data the UI will use but what shape the UI should present that data in and all of these companies have invented their own crazy syntaxes to send UI structures effectively like HTML from the server to your phone so that if the new type of post appears on Facebook you don't have to update your app just to see this new shape of a post that type of server driven stuff has been essential in Mobile Dev forever now because you don't know which version of the app a user might be on if they're on an old version you can't just not ship your new feature so the server being able to tell any version of the app hey this looks like this is essential and server components make that trivial server components make it so that type of really complex architecture is now generally available to any Dev even a solo Dev working on a side project where previously absolute chaos so that's exciting check this out it'll be linked in the description I'm so hyped with what XO is doing I'm really excited for the future of react native and I hope you are too let me know in the comments what you're feeling until next time peace nerds ## React Native is kind of broken (they NEED to fix this) - 20241012 I think react native should discourage using controlled inputs because they are currently deeply broken and I have no confidence they will ever get fixed proposal PR oh boy you know it's going to be a big one when Darren aamv brings back his Twitter account to talk crap on the framework that he is most associated with we even kept up with what Dan's been doing lately he works on Blue Sky which is funny enough a competitor to Twitter but as such he is deep in Mobile development he has been living in react native and his whole perspective on react has been shifting over the last two years as he has gotten deeper and deeper in the weeds of building applications and what's fun with this issue is it kind of confirms the thing everyone loves to complain about with react native which is that it lets you build really shitty apps we have to talk about this both what is wrong how wrong is it and how can we fix it before we can do that let's quickly hear from our sponsor yo oh good man I thought you just got a ton of users at your startup yeah but our analytics provider charged us over 20k and now we're kind of going out of business ah the ramen and the lack of furniture make more sense now n i just like Ramen I you know what fair you should check out post hog though they're an all- inone Suite of product tools they handle everything from your analytics to session replay to feature Flags wow that's cheap what if they raise prices though I don't want to lose my whole business again totally get the worry but they have two things that are important to know first they're fully open source so you can self host if you want to the second is that you can export your data anywhere you might want to put it instead that sounds too good to be true there's got to be a catch they're uh a little obsessed with hedgehogs oh thank you post hog for sponsoring today's video in order to understand what's going on here it's important to understand the difference between controlled and uncontrolled inputs I Just Whipped up a quick demo to show the difference here we have a controlled input we have the input type is next value is the value which is a variable here and we have an on change where we update the value in react before we render the change this is fine if your app is simple enough so if we go to Local Host and take a look at these inputs I am typing and you can't see it because we're in dark mode LOL okay let's fix the font color quick um text black cool now you can see it and as I type everything's fine where things can get bad is if we block or if this is slow or if anything causes this value to not get there faster let's give an example function block 4 and this by default is going to be a promise but we don't want this to be a promise we want this to use a while loop to block main thread and now if we call this for 100 milliseconds and I type fast enough we get those wonderful laggy Keys isn't this great the whole thing just froze so I'm going to type the quick brown dog wonderful we love it and if the way that your update layer is triggered is inconsistent enough this will feel terrible but it doesn't really matter if we put something like this in the uncontrolled input I can type totally fine even though this comp component is really slow the reason is the actual contents of this input are not determined by react or my JavaScript code they're determined by the browser in the input field itself if I want to get the content of this like let's say we want to use this for a submission of some form we have like a button onclick equals let's alert the current text with the example above it's pretty easy because we have the value in JavaScript already so when I click the button quick brown dog works as expected so this is slow it's still slow but when I alert really easy to get the text when you have an uncontrolled input you have to get the text when you want it instead of it just always being there because it is owned by react the state here is owned by the browser not by react that's why it's uncontrolled because react isn't controlling what the input has in it the input's controlling itself and we have to grab from it so we would do that by calling input ref. current. Val and now this is fast AF and alert works but we have to pull the data out from the form instead of the classic on change update the value this is bad but it can work if your app is fast enough and most apps probably are and I'm sure everyone here that is writing rea has written this code before I've even written code like it in the last few weeks doesn't mean it's good historically we've recommended using libraries that handle this for you like react hook form react hook form is an uncontrolled input manager that allows you to pull the updated state after all of the things have been done so the state lives inside of the input still or inside of the form and you can pull it out when you're ready or you can just have it update with a debounce that's it's just this is the right way to do things it's funny they're even giving the example here a mobile site with a simulator but you can also use it with react native and generally speaking you should probably use something like react hook form if you have user controlled inputs I just got some bad news it looks like even react hook form might have this problem I haven't confirmed this yet and once again look for pinned comments to see if there's more information that has been discovered or not but it looks like the way of using react hook form with react native is to use it with a controller and the controller has a render function that still passes the value to the text input it is possible they are doing some magic to bind this on a layer where it is not overriding the actual text input that you're getting but I find that really hard to believe my gut feel looking at this is that the exact same issue will exist I could very well be wrong but it seems like this is just the case and that is terrifying to me [Music] [Laughter] and here is where we get to Dan's issues the poll request makes this quite clear discourage using controlled inputs in react native because they are broken you know as a banger when Dan aov's poll request starts with the text I don't know what else to do basic controlled text editing is broken in react native here's his example it's basically the exact same thing I just wrote value set value is Ed State text input placeholder edit me onchange set value to the new text value is value this seems like the most innocent code in the world m is using let instead of const I don't know when that happened to him yeah anyways simplest code in the world this should be totally fine but it's not if you type at even somewhat reasonably fast speed do you see that I've had that happen in so many apps where I'm typing and the cursor gets moved to before the text another one I have that's similar is my autocomplete will recommend like two words where I've type the first word and I press it if the apps implemented correctly it'll override the first word and replace it with the two but sometimes it'll just append the same word after it and then put the next word after it's awful and a lot of these happen from the logic code that was written admittedly often react native but not just react native I've seen this in Native apps too where the control of that input is owned by something that isn't the operating system or the browser and it does the wrong thing when using the keyboard in certain ways this is really bad the cursor should not lag behind typing because it causes incorrect user input this is not a theoretical bug we have it in production it's embarrassing many kinds of bugs are tolerable but this is a Hello World example and it's broken this is contributing to the perception that react native is incapable of producing highquality native apps I haven't figured out a way to convince the team to prioritize this so maybe it should just be deprecated why put it in the docs we need to out all controlled inputs from the app and I think other teams using react native or choosing to adopt it should be aware of this issue we previously reported it back in April it's not a fun thing to discover when you already have a lot of existing code it's much better to know early and this is far from the only bug related to controlled inputs here's another one I just ran into today this is actually what pushed me over the line to file this issue the typical workaround is to use default value and avoid controlled inputs completely it should be a recommendation if this cannot get prioritized I know there's been a focus on the team on getting things fixed with the new architecture and that's understandable however it's still broken in the new architecture here's when using Fabric and it still happens I want to see this other bug that he mentioned multi-line controlled inputs enter an infinite loop on I God damn it ah this code enters an infinite Loop app equals render Outlet set Outlet use State Outlet child the child is a text input and we're portaling it to the outlet multi-line on changes yada yada the outlet is a memorized Outlet the portals portal if they remove the multi-line prop it's fine but with this as it is a multi-line input that's values controlled by react infinite loops and fails terrifying they have an example here oh look at that you're typing and it just oh God what is this flutter we're better than this I know it takes a lot to develop the framework and this issue May simply not be enough of a priority but I think it's important to communicate honestly when one of the most fundamental features is broken at the Hello World level hence this PR thanks for consideration I want to see the pr docs text input the value field implementation is broken in many subtle ways and is not recommended for use until the bugs are fixed we recommend sticking with default value and using uncontrolled inputs C link is the comment here which I think is a good idea I think this is good at the very least this should be done ASAP ideally the value prop would give a warning in your actual editor too for people who are doing this that is I knew it was bad I did not know it was this absurdly bad Jesus Christ that this straight up is the most skeptical and concerned I've ever been about react native I know people the team are watching the people on the team know how much I love and respect them and all of the hard work they've done this is one of those rare opportunities that yall have to jump on something hard make it really high priority and over time this will help the whole ecosystem be more successful and I totally agree with Dan that these types of things are massive contributions to this weird perception that react native is bad or slow the reality is that react native uses native and if you lean into the native platform with react native it is just a simpler way to build native interfaces but the problem with the controlled inputs is that you're no longer using the native part the input is native the value is not and if you have to leave the native layer to type that is not a good thing I don't care how optimized they get their JavaScript having to leave native to do the inputs is bad and they should never ever ever recommend it I want to check the react native docs quick handling text inut no the handling text input on the basics isn't I I am upset I am in pain I hate that I'm giving points to flutter but I am sry begrudgingly I am I feel sick apparently we have now heard from joose saona that this doesn't live up to their standards in they'll be looking into it ASAP that is very good news also this thread's full of gems tommo would get this prioritized I absolutely agree tommo is the glue that held together the original react team I don't know how to write this in a non-mean way but inputs must not drop keystrokes or lose carrot position not in the common case it's easy to lose sight of something like this with multi-year projects but this stuff doesn't matter if you can't trust the framework with the basics absolutely agree and I also argue something that react historically is done really well that the the default way to use react is usually for the most part setting you up for Success the exception being use effect but we've all been there getting these things right is a matter of Pride for the react project I know and remember this is not flutter this is an expectation of Baseline levels of platform Fidelity even if this doesn't reproduce super often on device it is a big no no I feel silly pointing to this with this is important right right but like I don't know someone has to do it we used to care about the Baseline react native at meta is far from fighting for Survival anymore surely the more ambitious stuff can we put aside for a few weeks this would be a few days to fix at the very least to just Market is deprecated or the wrong way if it's really completely unfixable in both paper and fabric or if no one is willing to spend a couple of weeks deeply investigating the code or if the team is just too scared to touch the existing text input code surely control inputs can be explicitly warned against yeah absolutely that said the default Expo react native template was like forgetting to run the eslint rules of hooks and stuff it seems like the focus with react native has been making these giant react native projects more maintainable where react's focus is still on everything be it big companies or getting started react natives getting started story hasn't really been owned by the react team for a while it's kind of been punted to Expo who are underwater deep on everything from infra to Native debugging stuff to deployment platforms to fighting apple and Google's policies they don't have time to make sure the right lint rules are being applied on an app by default when most of the apps they're using have been built for five plus years very important points and that said the focus needs to be there like someone's job on the react native team should be making sure the onboarding path and getting started stays really really good and that sounds insane to have a person whose job is just keeping the happy path happy for getting started but I think react native deserves that level of focus I can empathize with a hundred different excuses and I I feel for the team but like hey inputs are broken the most basic example this should be a SE with like a severity like a severe issue that's being treated seriously I I come from Amazon this would be called a s one or a s zero and I should it should be that losing user inputs and yes cursor glitches cause lost user inputs is a bad bug and we have it here at the framework level react native is supposed to Faithfully wrap native components it should not degrade their default Behavior if this is not a priority then maybe these sentences need to be edited I'm sure there are reasons why it isn't a priority but it doesn't change the outcome I think this should be a Sev both because the actual Behavior and the fact that has not been prioritized are severe issues again I'm sure that there are reasons why it hasn't been but I think it is genuinely worth spending some time reflecting on original project ethos and whether it's still relevant PS I like react native a lot it's been great to use and the team is doing a lot of great work if there's something to suggest here from my perspective is to establish some baseline where Native control should not degrade platform ux in common cases and treat that as a high severity issue absolutely agree I've missed spicy Dan it's been a while since we got a spicy Dan rant like this and I'm more than happy to cover it for yall let me know what you guys think hopefully they'll get this fixed keep an eye out on the pin comment to see if they have until next time peace nerds ## React Native vs Flutter vs Native - Let's Talk Engines - 20220710 yeah it's a rant about reality and i think that's the problem with flutter flutter devs don't live in reality they live in their own abstract skya world i is a developer of an application can push code that changes that application without apple or google reviewing it they don't even let you go to the site it's just a showcase cool this isn't a showcase for flutter for web because nobody ever wants to show off their flutter for web flutter is a mistake in almost every sense still and it's sad that it's as bad as it is it genuinely is a little sad but i want to take it a step further unless you really know what you're doing it is irresponsible to ship flutter it is actually harmful not just like as an elitist developer that has opinions but to your users in so many ways not using react native specifically is choosing to prioritize your beliefs over your users for one simple reason so clutter is harming your users not using rn when you can is ah i'm gonna reword this not shipping react native when you could is choosing to harm your users i am prepared to die on this hill now i know that's a bold way of putting this i don't care anymore i've talked to enough people working in enough other solutions that i am certain of this fact for one particular reason code push for those that don't know this the idea of code push is i is a developer of an application can push code that changes that application without apple or google reviewing it if i am building the twitch app and we ship a new chat feature and we screw it up we hit the wrong endpoint or something's wrong in the ui we formatted it incorrectly the process is i hit up apple i tell them to pull the update any users who have installed the update in that time they're on the bad version sucks but that's their lives now i go hack out the update send it to apple who has to re-review it realizes there's some other thing inside of the app that they don't like that they block on even though this update isn't a feature ad it's a bug fix but they happen to see a feature they don't like during the bug fix and now they block your update you can't get that update out to users then a week later you convince them to let you you finally get the update out and then after a month or two about two-thirds of your users have installed that update but for whatever reason that 100 to 5 000 users who happen to install the bad version don't have automatic updates on and never end up getting that update they're stuck on a legacy version and you can't do anything other than maybe lock them out on server side if you build that in yourself there is no way to trigger and update even a small bug fix on a user on their device without apple or google approving your app this is the problem with swift and kotlin native apps this is also the problem with flutter this is absolutely a problem with flutter you are wrong codemaster i've talked to a lot of flutter developers and every single one ships the entire flutter runtime and all of their flutter code inside of their app binaries there is not a meaningful code push solution in flutter right now that is false expo is the solution to this problem expo has solved this very well in react native land the reason why is important to understand so we're going to draw out how do i want to draw this the we're going to call this app ui at the top and bare metal at the bottom this guy will call it render land this is the stack of from the metal that is like the cpu and gpu on your phone to the app ui how things get rendered we have this the first level that's like the kernel or something just like a communication layer where software can access bare metal there's actually a render engine funny enough called metal by apple that is the next layer this is how you access the like gpu abstractions if you want to do native rendering as performant as possible then there is i'll say this is the ios render stack just to make it a little easier so i have to multiply it here is uikit which is the ui layer built on top of render engine that lets you render user interfaces this is where you say hey put a button at this point in the screen and then it renders in ios a button there in the screen this is the i guess i should put like uh objective c swift dev code so this code tells ui kit what to render which then in metal renders things using the computer in this case phone's hardware to then generate a ui that the user sees so this is the ios render stack as it's existed for a long time so let's draw out the react native stack which is a little different oh it's a little lower make this box a little longer so this is objective c swift bindings to ui kit i'll just call it objective c swift bindings and then up here javascript js that calls so this layer here is 95 plus of your rn code is this layer here whereas these objective-c swift bindings are mostly provided by rn you could argue that what react native is is these bindings directly to ui kit that you can call in javascript the important thing to note here is we are still rendering ui kit components we're still rendering native ui the react native bindings allow us to in javascript tell ui kit what to render this objective c swift bindings layer is very thin and is most of the native code that you ship i think it's incredibly important to understand this detail here the objective-c switch their swift bindings are what your js calls that then render a native button which means since this section doesn't change a whole lot you ship this in your app binary and if you swap out the js bundle here like let's say this is hosted on your server and you change it that is an update for the majority of what's happening on the mobile app you're able to change almost anything in that app remotely other than specific swift and objective-c bindings like if you want to add spotify native supporter you want to add a camera binding and you didn't have camera permission before you can't do those types of things but anything you have the objective-c or swift binding included in your binary for you can change so if you have a button that's not visible on small iphones it's a bug i've run into a billion times you can make that change fix it and ship it without making a native change because you're just in javascript land telling the phone where to put that button slightly differently so let's talk about flutter so in flutter we have to blow out a lot of this ui kit doesn't get used we have skya engine the skya rendering engine is an alternative to objectives or to the ui kit layer on ios this is a full abstraction almost like a game engine you can think of this like unity more like unity where this alternative engine has to emulate a lot of what ui kit does which means things like touch gestures things like scrolling things like screen reader things like image rasterization aren't using the os primitives anymore they're not using the things that apple or android provides they have been abstracted into their own engine in order for this to be performant the dart flutter runtime code has to be compiled in order to optimally control the skya engine there so this has to be compiled can't be server hosted and this is the selling point and the problem flutter has chosen to fully reject the native platform while eating all of the native problems because this abstraction isn't a separation and honestly what i'm going to do here to make this clearer is a separate box for this because these are abstracted this js binding layer is not as strongly attached to the objective c layer as these two are the because these are so directly tied it is impossible to swap out the meaningful code without shipping a new binary which means it's irresponsible to use this simply because app store reviews are going to slow down your process enough that if you make a mistake you can't meaningfully fix that i saw a comment along the lines of isn't this a rant about approval processes eh it's a rant about reality and i think that's the problem with flutter flutter devs don't live in reality they live in their own abstract skya world that doesn't embrace the importance of solving problems that users are going to have and solving the problems that developers experience every day as creators of applications and i can count actually sorry i cannot count how many times expo push and expo publish have saved my butt because we had a dumb mistake just got approved on apple and i had to go fix something quick it is essential to be able to do that if apple and google snap their fingers and let user developers just immediately ship updates that kind of helps but again since that code is on a device rather than on your server it is now impossible for you to guarantee a user's on the right version it is trivial for me to lock users out who are on old versions and update them if reasonably possible it is not that simple in flutterland you have to build your own version system in order to assert people aren't on old versions and we're just talking about the abstract like the harm this has to your ability to serve users through the app publication process let's go a step deeper which is skaia is a bad abstraction there there's a lot to dig into here but i'm gonna start with the things i have linked in my faq did you all know that since february last year there has been terrible stutter in flutter apps for ios that puts it below at 5 fps consistently because their sky abstraction is not actually metal compliant yet it does not work good on metal and the result is hilarious amounts of jank oh my god it's so bad it's so bad so an important thing to know about how flutter architecturally works is due to being a full new rendering engine they have to recreate all of the patterns and behaviors that we expect from applications one of which is every feature in ui kit so in flutter you have the option to use the material ui skin or the i think they call it cupertino or something for the ios skin and those skins for flutter are obsessive screen shotting of every piece of ui in ios and attempt to recreate that with the right pngs in their render engine you've effectively been forced to recreate all of ui kit to make anything work and that's why we have the like cringy fake pop-ups and [ __ ] that are so common in flutter apps i have a tweet so the app that inspired this is very specific it is the vidcon app was absolute trash uh this this god this is one of my best tweets this is uh i i don't think i'll ever top this tweet honestly anyways the vidcon app the amount of different ways this app broke was impressive what happened here was a keyboard reveal event got postponed while the sidenav came in the keyboard came out after and shifted the side nav into a state where you couldn't actually see what each of those menu items was it unrendered the text just entirely broken other really fun flutter things in a flutter scroll view due to how they implemented touch gestures if you use one finger it'll scroll normal speed if you use two fingers it scrolls double speed if you use three fingers it scrolls triple speed because it detects each finger and each touch event as a transformation and they had to write all of that code themselves and it's full of dumb bugs as a result because they threw away the two plus decades and thousands of man hours of work put into ui kit to make it so somebody who's blind can use their phone to make it so somebody who has like physical disabilities can use their phone somebody can manage their phone with a mouse can do all these things on a device reasonably and due to how much the flutter devs hate javascript they decided to throw it all away to make a point and it was a bad decision and it sucks because skya theoretically could be good for video games if you want to make a mobile game or you wanted to make some really fancy 3d animations and [ __ ] but their choice to re-implement everything is hilarious somebody in chat just said it's like re-implementing the dom and webgl it's time to talk about flutter for web is there an example showcase cool not much here there's no way this site is oh this isn't the site this is they don't even let you go to the site it's just a showcase cool this isn't a showcase for flutter for web because nobody ever wants to show off their flutter for web tldr on flutter for web it uses a canvas it doesn't use the dom it renders a single canvas and then it recreates the whole dom inside of it the minimum of scene for a flutter web like hello world is like five megabytes of [ __ ] it's i have not talked to a flutter dev who actually thinks flutter for web is shippable thankfully but it is an embarrassment it is not real technology much less usable it's like meme to your bad it's actually harmful flutter for if anybody tells you that they should that like flutter is a great thing compared to react you can use flutter for web it's fine you can now ignore their opinion forever because they are lying they just do not understand how bad things are it is i even think react native for web is too far in abstraction like give me my dom and let me manipulate it but this is this is the thing i really like about react native react native is not trying to abstract away the platform they are trying to build the best abstraction to the platform the actually a different way of doing this so the gap is between the js and the objective-c swift bindings there the gap here is that arrow wrong the gap here is much scarier it's between the native layer and skya it it's a mistake i i get the desire i understand why people wanted to move away because theoretically if you can rewrite the section here for other platforms so like for android or for web this is a nice abstraction it seems but this will never use the platform is the problem so because it has to be re-implemented on something relatively raw for the browser we have to reimplement this on canvas because it doesn't have a way to talk to a dom where in react native i can move this react native js layer to xbox to web to whatever and call a different native platform and it will render the different native thing react native is using the platform which is what's so funny about flutter to me is so many people recommend flutter because react native is slow it's an unnecessary abstraction flutter unless you have the abstraction and performance it gives you neither it's a lie the promise flutter is built on is a lie it is an abstraction from the native platform that is slower heavier and incomplete and that abstraction doesn't give you any meaningful wins other than a vague sense of multi-platform support for ios and android that is a half truth because of how bad the ios experience is flutter is a different way of building android apps with a lackluster render story deploy story development story user story on every other platform on android it's whatever and on every other platform it is a regression it is harmful to your users to bet on flutter yeah and rant the abstraction is bad and code push is huge code push is super important don't block users on apple google and the native platform is actually good rewriting ui kit is probably bad cool so these two points are the core if you want to be able to fix user problems without weeks of potential runtime blocking because of apple and google and you want to use the things that make the native platform great you should not use flutter you should probably use react native like yeah please use react native it's very good dart is pretty bad we'll don't even need to do that rant with everything else i just talked about thank you for watching that one i know y'all were not all fond of my last flutter rant and there were some things that i focused on too much for not great reasons and there was things i didn't focus on enough because i didn't realize how bad they were i think it's important to understand that code push is not something you should compromise on if you don't have to and the native platform is good and you should probably use it flutter's failure to embrace either of those points makes it a really bad bet and react native giving you a really good solution for both of those points makes it relatively safe to bet on right now for those reasons i do not recommend flutter and i do recommend react native native solutions are cool too but you don't have a good code push solution there make sure you check out how other companies are doing these things as well even meta has a crazy like sql light layer they use to command the or the messenger app for facebook and that seems to work really well for them there's a cool blog post if you google search for that generally it's important to understand the compromises that your technologies are making and i don't think flutter's compromises are understood well enough by its users react natives compromises are that you need that native binding layer to do things and javascript's not the fastest way to animate move things around etc but if you understand those reasons you can make some really cool things with react native all that said really appreciate y'all for watching the video make sure you subscribe if you haven't under 40 of y'all are subscribed to the channel so please fix that hopefully i'll grow them a ton leave a comment let me know what i should talk about in future videos shout out to dez for the awesome work editing keeping this channel alive for me thank you guys again peace ## React Native’s Secret Superpower - 20231020 a lot of people seem to think the value of react native is that you're writing JavaScript in your mobile apps so your web devs can write apps too that's not the strength of react native others seem to think that it's one codebase can Target both IOS and Android and sometimes other platforms like Xbox or Apple TV or even Windows and Mac themselves that's not the secret power either there is some really cool stuff that you can do with react native due to the abstraction in the design that it represents that I don't think we talk about enough the simplest way I can put it is over the air updates because because by Design react native has a separation from the stuff that actually renders on your device be it a native button on iOS or Android or a native picture view on any platform at all that abstraction separates the thing that renders from the thing that says what to render and that thing that says what to render that's JavaScript it doesn't need to be compiled well yeah technically we're compiling a JavaScript but once you've pulled in all your dependencies through Babel or whatever you can just drop it in the runtime and it does what it's supposed to hopefully you understand where we're going here you can change what UI renders on a device by swapping out the JS without having to update the application itself if you wanted to change what UI renders on an app built with swift UI or with Objective C and the old appkit stuff or on Android with the craziness that is the current cotlin system you would have to have native code on the device ready to go to do that different thing and yes technically that native code's already there with react native2 the difference is important though the difference is that the JavaScript is saying where to render which element where on cotlin or on iOS with swift UI you have to Define all of the views ahead of time you can't dynamically create new views unless you encode that behavior in the native application ahead of time when you have this abstraction between the native layer and the commanding layer like we do with react native you don't have to pre-plan all of the native code for all of the different uis you might need to render a common example you want to change the background color on one part of your app for a holiday if you don't ahead of time put that in the native code get that through app review often weeks in advance and then have a server side flag to flip that on and off that's really hard to do do where with react native you can quickly update the JavaScript say hey change the background color on there and when a user opens the app FES the newest JavaScript renders the different color and then after that push a new binary that removes that when you want that behavior to go away if you have small UI bugs or you realize that on some phones a button gets scrolled out of view because the screen isn't big enough or all the types of crazy things you'll encounter as a mobile Dev similar to what we encounter as web devs having the over-the-air capabilities to change the JavaScript and make these adjustments in order to render the right thing on the user's device is essential especially at large scale like imagine you're at Facebook you made a change it gets the app review you ship it and then it breaks some number of users experience with a feature or maybe the new feature you added isn't in view because it's like on some devices it's too small and you can't see it well now you have to make a new native app update to change that you have to wait however long it takes for Apple to review it you have to ship it out and you have to hope users actually update to the new version which often they won't this is where things get really painful if you're bound to what your native binary can do you can't do much because so many users will be on really old versions of their apps and just never upgrade for many different reasons most of which are dumb all of which are real problems it's really hard to be on an old version of a website that's more than like a few minutes old but it's very very common to be on an old version of a native app because of that every major company that builds native applications has invented crazy solutions to these problems even at Facebook they didn't just do react native they had a crazy project called project lighted where they rewrote the Facebook Messenger app using sqlite as a commanding layer so instead of using something like react native or traditional Native code to Define all the views they Define in a SQL structure using a local SQL light database on your phone what youi should go where and then the native layer renders whatever SQL tells them so if they need to ship a change they can send a SQL migration out to users that gets applied in the sqlite cluster on their phone to restructure the UI that is insane but it's really cool but also the fact that we have to do this in the first place is absurd and I sincerely hope not many of you have had to run into these problems in production but when you do you need a solution for it and react native just supporting this is how it works is so so powerful but it doesn't just stop with OTA because server components promise an even brighter future coming soon right now when you're using a react native app it has JavaScript on it that is taking whatever data you're fetching from apis and then telling the native layer what to render where but it's taking Json from a server What If instead of having to update the JS to change what rendered the Json wasn't Json it was actually structured markup that told the mobile device what to render exactly so your API Quest wouldn't just show you what data it would show you the shape that data should be rendered in this might sound like something you've heard about server components server components on mobile are going to be groundbreaking I gave a whole talk about this at chain react they let me keynote it for some reason but the thing I was excited about is that we could now have a payload the server sends to the client that is really simple to write CU it's just react but on the client it will now change what renders it's not just what data renders you don't have to write custom logic that's like if user render this if date is pasted here render blue you would just write the code on the server that returns whatever and now on the client it just does it you don't have to worry about shipping the right code to the client if the server can describe the shape the client should render it in this is one of those huge promises that comes with the server component model when Json isn't the Primitive we ship from server to client the shape of what should be rendered is what we're shipping instead really really powerful Things become possible where you could render entirely different layouts for your app depending on specific user characteristics without having to ship different JavaScript to those users or ship all of the JavaScript to all of the users that's so cool and I think we miss these benefits when we look at react native because we're just comparing the performance or the text specs or how much we hate JavaScript developers we're not actually talking about the ergonomic wins and the potential user facing wins of having a dynamic layer controlling the native UI react native is so powerful because it controls what Native does with a really powerful abstraction in the future of that abstraction gets brighter every day do you work on Native apps can you update them without going through the App Store what does your process for that look like and what was your favorite thing about what we just talked about here I know that react native is a sore spot for a lot of people but it's important that we acknowledge the things it does better than anything else and a lot of this is why react native was created in the first place these abstractions are powerful it's important that we understand why they're powerful and why so many people find them necessary thank you guys as always I'll pin a video in the corner where I talk all about the benefits of these patterns and hell i'll pin my talk underneath it too thank you guys again see you soon peace NS ## React Query Is (Still) Essential - My Favorite React Library - 20240123 data fetching is hard it involves all the worst parts of JavaScript validation asynchronous behaviors and error management as such getting data fetching right is really important and I've seen a lot of people do it in a lot of different ways that let's be frank vary a ton in quality one of the pieces I've seen the most is react query and there's some really good reasons for that whenever react query comes up I always see the same response why would I use that when I could just fetch in a use effect and throw it in state well you can but the reality is isn't that simple so I want to take some time to dive into why you actually should use something like react query and the benefits you get from having a good core data fetching solution for your applications without further Ado let's take a look at this awesome blog post by TK dodo why you want no why you need react query I want to be clear even though I'm using server components now I still agree with almost everything TK is about to say so let's break down what he's saying and why TK doo. if you're already using react query and you haven't read practical react query get on that there will be a link in the description really good stuff it's no secret that I heart react query for it simplifies the way we're interacting with a synchronous state in our react applications I know a lot of devs feel the same important piece here a synchronous State notice how the word fetching hasn't come up yet sometimes though I come across posts claiming that you don't need it to do something as simple as fetching data from a server we don't need all these extra features that react query has to offer so we don't want to add a third party Library when we can just as easily fire a fetch in a use effect to some degree I think that's a valid point react query gives you a lot of features like cash retries polling data sync pre fetching and more and about a million more actually I'll go Way Beyond the scope of this article it's totally fine if you don't need them but I still think this shouldn't stop you from using react query actually this is possibly the first point I disagree with if you're using a framework that is built in solutions for data fetching mutations you might not need react query you might not yes hopefully he dives into why you might because I obviously use these Frameworks very heavily a big nextjs user and I still find a ton of use cases for react query around other things that are asynchronous we'll dive into all that in a bit though so let's instead look at the standard Fetch and use effect example that came up on Twitter lately and dive into why it might be a good idea to use react query for these situations too Fetch and use effect con data set datas use State error set error use State use effect fetch endpoint category then Jon it then set data catch put the error there categories the input now we have theoretically everything we need to return this data think this code is fine for simple use cases where you don't need additional features let me tell you that I immediately spotted five bugs hiding in these 10 lines of code let's take a look here and see if y'all can catch any of those before we continue the first one that's jumping out at me is order of events if this fetch call hasn't responded before we change category so we change what we're fetching and then that second one comes back before the first one whichever resolves last is the state you're going to have so if we have category a initially and before it responds we go for category B category B responds immediately and then a responds after we get back the data for a even though we're asking for the data for B that's just the immediate one that comes to mind here I'm as I said there's at least four more hint is that the dependency array that's fine race condition woo guess the first one right there are reasons why the official react docs recommend using either a framework or a library like react query for data fetching while making the actual fetcher Quest could be pretty trivial making that state available predictably is certainly not the effect is set up in a way that it refetch whenever category changes which is correct however Network responses can arrive in a different order than when you send them so if you change the category from books to movies and the response for movies Ares before the response for books you end up with the wrong data in your component here we are ra if books is requested first movies are requested second this set data gets called before this one and you end up with the wrong data an inist and state the react doc say we can fix this with a cleanup function and an ignore Boolean so let's do that this is a fun one you have an ignore then you can escape if you're not supposed to ignore and then this return if you're familiar with effect and the behavior of return for a cleanup when category changes this runs category changes and then this all runs again for the new C category so if you've set ignore to true you change the category now when this responds later it effectively is tossed out what happens now is the effect cleanup runs when category changes setting the local ignore flag to True fetch response comes in after that it will not call the set State anymore awesome loading State it's not there at all you have no way to show a pending UI while the requests are happening not for the first and not for the future requests so let's add that SLE loading set is loading true finally set is loading false at the end there not too bad but again with the ignore gets a little bit more complex now empty State initializing data with an empty array seems like a good idea to avoid having to check for undefined all the time what if we fetch data for a category that has no entries yet we actually get back an empty array we have no way to distinguish between no data yet and no data at all this helps if we initialize with undefined instead data and error are not reset when the category changes that's also important if you change the category the previous data and error shouldn't still be there we should wipe those out and it even be possible to have an error for one thing and data for a different thing at the same time if you're not wiping them out at the very least in this we should be wiping the current error we should probably doing a lot more than that so here's where this is added set error undefined or in this catch set data undefined but this still isn't handling when the category changes we should have in this return set both the undefined also fires twice in strict mode it's more of an annoyance it's definely something that catches new react developers off guard if your op is wrapped in strict mode it will potentially call the effect twice y y we've complained about that enough times on the channel yeah anyways bonus error handling didn't includes in the original list of bugs because you'd have the same problem with react query fetch doesn't reject on HTP error so you'd have to check for res. and throw an error yourself yeah it's annoying this is the case with web but I get why I might make a custom fetch I do that in a lot of code bases where it throws if res is not okay fetch do then if not okay throw a new error fail to fetch otherwise we return rest Json and we have the then and catch notice how much code we now have for what was supposed to be really simple we're at 38 lines of code apparently there's a whole article about why fetch doesn't throw that might be worth making some content about in the future let me know in the comments if I should do a video All About fetch not throwing and the weirdness about errors in Fetch anyways our little we just want to fetch data how hard can it be news effect hook just became a giant mess of spaghetti code as soon as we had to consider edge cases and State Management so what's the takeaway data fetching is simple Asing State Management is not Tada very very well put this is where react query comes in because react query is not a data fetching Library it's an async State manager I've been saying this forever it's really nice that the core react query team is too because it's so important to understand the beauty of react query isn't just fetching data from a server I remember way back like way way back possibly even four years ago I was watching Jason langdorf have Tanner on to talk about react query and having my mind blown when I learned not only is react query not just for graphql stuff it's actually not just for fetch it's for anything async so if you need to async await for some I don't know AV devices like my webcam which we do a lot for our web services like pay the video call app react quer is a really good way to handle the loading case the error case and all of those things wrapping the complexity of your AV devices by just dropping the promise and use Query we'll show that off in a bit but I want to showcase the examples here first as he said when you say that you don't want it for doing something as simple as fetching data from an endpoint you're actually right even with react query you still need to write the same fetch code as before you still need it to make the state predictably available in your app as easily as possible because let's be honest I haven't written that ignore Boolean code before I use react query and likely neither of you I actually had but it was noxious and I'm so happy I don't have to anymore with react query the code above becomes this cost is loading data error equals use Query we have a query key which allows it to be uniquely cached we have a query function which is just this function nice simple to the point really clean only 11 lines handles all of the edge cases de bounces has really good caching behaviors you can call it multiple places phenomenal it's about 50% of the spaghetti coat above and just about as long as the original buggy snippet and yes this addresses all of the bugs we found automatically no race conditions to handle that you get all the loading error in all those States empty states are cleared separately whenever you change the inputs you will not get data or error from a previous category unless you opt into it and multiple fetches are efficiently D duped including those fired by strict mode so if yourself thinking that you don't want react query i' like to challenge you to try it out your next project that you'll not only wind up with code that is more resilient to edge cases but also easier to maintain and extend and once you get a taste of all the features that it brings you'll probably never look back I totally agree lot of you mentioned missing request cancellation the original I don't think it's necessarily a bug just a missing feature of course react query has you covered here as well with a straightforward change o signal you actually pass the signal from react query and it will terminate this for you your signal you get query function for it to fetch and request will be automatically aborted I didn't even know that that's dope I do want to quickly showcase using react query for something that isn't fetch here are some real code from the Ping code base you see here we're importing use Query and use Query client from react query so what are we doing with that they got a couple fun things so this is an interesting hook I built in order to invalidate the existing cach values whenever your devices change so if if you plug in a new webcam or you unplug a microphone this will invalidate all of your devices because we only know that a device changed so I invalidate all of these queries so now react query will automatically refetch the data for all of them and it will rerun the functions it has to in my case I'm using the aora web RTC provider and it doesn't have a great react binding I think it is better now but at the time it was awful so I have used query string cameras is the key it's an async function that Returns the result of Agora RTC doget cameras and now I have all of the camera devices here can also have a loading State and an error state if I don't have permissions I could throw an error here there's a lot of cool stuff I can do but you'll notice this is not fetch code this is client side specific code that is a weird asynchronous thing you'll also see this trpc do usequery the Syntax for this has changed a little bit since where before you would have to pass the endpoint as a string now it's part of the trpc proxy object but the result is still very similar in react trpc uses react query to give you a really good asynchronous flow to get this data from your endpoints so now I can use use the same syntax and the same behaviors to get things from my API endpoints and from your device it's so cool that this primitive is powerful enough that it's not just useful for data fetching it's useful for so much additional stuff and this is why it's hard for me to take people seriously when they say you don't really use react query but this is all why it's so hard for me to take people seriously when they say you don't need react query because you certainly don't need it but a lot of the problems that we have every day as web devs benefit greatly from a pattern like what react query introduces if you're not doing anything complex with asynchronous code at all yeah buddy if you're not doing anything complex with your asynchronous code then sure you probably don't need it but the amount it benefits you and the amount it simplifies the experience working in your code base for everything from data fetching to weird local acing functions is just so powerful that it's hard for me to work in a code base where I can't reach for react query when I need it hope this was helpful rant my cat clearly wants my attention so I guess I'm signing off now you want to hear more about cool data fetching stuff pin a video in the corner all about that I'll see you in the next one peace NS ## React Removes `fetch` - 20240505 when next version 13 originally released with server components one of the biggest controversies was something that was honestly a little bit silly it was the fact that they overrode fetch on the server I use the quotes for a reason overriding fetch is kind of a hard thing to do because especially on the server fetch doesn't really exist somewhat recently there is kind of fetch built into node but that's because they took a DC and bundled it in as such the idea of fetch as this golden standard that nobody can screw with has always felt a little weird to me but at the same time your framework taking over fetch is kind of weird too they had a good reason for this which we'll get into in a bit we're not here to talk about the good parts of why this exists we're here to talk about the removal of this yes believe it or not the react team changed their mind and has now removed the automatic overriding of fetch in order to cach all things that occur inside of react using fetch calls in order to understand why this is important we should go over what this did in the first place let's say we did this and we're just rendering this data in our component now we'll render one user profile totally fine normal this does what you expect this data is coming from the GitHub API we're calling it we have it here and we're stringifying it and putting it in the page content what happens if I do this multiple times now I have four instances of this component or let's say instead of this being here I have a function that's like async function oh look at that it already was smart enough and now I have this get GitHub profile function and I call this in here but I also call it in here con user profile equals wait get get a profile this need to be async 2 let's I have it here because I want to have div info for user.name and then I have all of these if we let fetch work the way it traditionally does then we do the first call to the GitHub API here so now we've done one call and then for all four of these components we're now doing four more of the same call even though the URL is the same the arguments are the same everything's the same when the user goes to our web page which is just slash like the homepage for our app we now are doing five calls to the GitHub API that's not great especially since they're all going to return the exact same things they're all happening roughly at the exact same time it's just massively increasing the amount of load necessary to actually load the data you want what the react cache did and what the overriding effect did was make it so that in a given request so when I'm going to this web page as it generates the response for this one page it would patch the fetch call so once the call is identified to be identical as previous calls it only uses the data from the cache it's effectively duping by letting you make the call one time and then using that same data in all future calls within the same request so if you refresh the page it's going to update the data but if you don't on the first load or whichever load you're doing it only has to make an identical API call once this is one of those things that just made obvious sense and that's why it was baked into next and also react we don't know if it's going to be removed from next or not but I can say with relative certainty it will be because they're following the react team's decisions very closely the reason I concerned is that this is kind of the obvious way to write something like this in the obvious way now has performance implications generally speaking I like it when the obvious solution is also a performant one and now the obvious solution isn't if we go back to this poll request that was made by ecd light you'll see that they have removed the automatic patching of global fetch functions in server component environments to DD requests using the react cache a behavior that some RC framework retainers have objected to interesting that other framework maintainers haven't liked this Behavior we may revisit this decision in the future but for now it's not worth the controversy yeah this is my issue here too is it feels like this isn't necessarily the right decision for react developers but due to the controversy they're making this decision annoying Frameworks that have already shipped this Behavior like next can reimplement it in user space I considered keeping the implementation in the code base and disabling it by setting enable fetch instrumentation to false everywhere but since that also disables the tests it doesn't seem worth it because without test coverage this behavior is likely to drift regardless we can just revert this PR later if desired yeah so now if you want to cach things you would call react. yourself there's a lot of ways to do this honestly the way I would do this is const GH profile equals react. cach do I have the react space there cool I forgot this is get get have a profile cool so now with this wrapping of the react cach helper this will now be cached the same way it is quite annoying that we have to do this ourselves but it's not the worst thing in the world could have a profile at Json called twice oh yeah I'll just json. stringify I don't need towait that anymore I just put the GH profile in here cool good fix thank you chat IO touching standard JS function that implicitly is not good DX the issue is fetch on the server isn't standard it's not like like it might feel standard as a JavaScript Dev but fetch on the server has been a very controversial thing for a long time the other annoying part here is that this patch didn't just affect when you called Fetch in your own code imagine instead of await fetch this was await GitHub sdk. getet user and that there was some other code somewhere else I'll just make a fake GitHub sdk. TSX so like Pretend This code isn't in your code base we just have export async function get user username cool or I'll just Define this asnc function export default get user cool so now if I import GitHub SDK GitHub sdk. get user since I have this wrapped in react cache it's fine but wouldn't it be nice if the GitHub SDK itself could take advantage of this caching this is what I'm annoyed about is that every time I call anything that has an obvious cache Behavior which is in this case I think pretty clear that the async function get user always fetches the same shape with the same inputs we shouldn't really have to worry about caching this at the higher level the fact that everything that might be called twice or more in your react server side app now needs to be wrapped in Cache so sucks so that's why I am frustrated because it would have been really nice if whatever SDK you pulled in just worked because redundant fetch calls were made cashed and would DD automatically it's obnoxious that we're now going to have to see like an insane number of these react. cash calls in our code bases but it does seem like the only way to keep everybody happy while also providing this functionality I'm just upset because the defaults were more than good enough here and got us through a ton of stuff everybody's saying things like there's a lot of chatter saying like why don't they rename it why don't they provide their own fetch why don't they do all these other things again imagine this GitHub SDK code doesn't exist in your code base and here it does because it's the demo but imagine this is a package you installed you can't change which fetch call a package is making on your behalf and I also want to remind everybody this is only on the server side it even says here that this is function in server component environments so this only occurs during a given request so if I request the website and you request the website at the same time when I make the request all the things that are dup in that request get done once instead of end times they're not going to hit my cash when you make your request they're not going to hit my cash when I make my next request either per request to duplicated work is deduped it just makes a lot of sense and it's really weird to me that people push back as hard as they did here SDK cannot tell the access pattern and cashing strategy around your app sdks cannot do it for you unless they definitely know the cashing strategy at this point and they would put the right HTP headers calling current user in a bunch of places and it only calls DB once is the best part of the new apis yes sadly you have to wrap this yourself now but to be fair if you were using something like a database or something that isn't traditional fetch based calls you probably had to wrap this in cash already it's just sad because I'm you know I'll ask chat one's if you've used react cash before two is if you haven't one if you've used this before two if you haven't three if you've never even heard of it before this see all those threes most of you didn't even know about this API I think this is an important point to make not many people know about react cash yet should they probably did they need to not before but this is why I'm annoyed because it feels like we're caving to the Mob to make slower apps yeah it's a really good API especially when you combine with things like the unstable cash in next where you can cash per Keys it's super powerful Fetch and next was the problem most people had no the problem they had was that fetch is this Golden Child you allowed to touch like nobody who was mad about the fetch thing knew what it was actually doing they just knew fetch behaved differently and react and next and behaved other places therefore angry but like every framework author that does serers side stuff already knew very clearly so that you had to implement fetch some amount yourself in every other framework like even n has done some crazy stuff to make fetch work in the first place so I just I fundamentally disagree yeah all of a sudden everybody cares about what's happening under the hood you're using an SDK so you're giving up an abstraction caching is good yes you can't make it an optional toggle though that's the thing like it's not that simple because it fundamentally changes how you write the code next caching being weird and fetch caching being useful are two different unrelated things it's not annoying though now it's just like a data loader from graphql so data loaders in graphql are very annoying for a billion reasons I shouldn't have to explain that to yall like data loaders and graphql are an obnoxious pattern that requires so much boiler plate that makes no sense for most applications the reason I'm concerned is the simple demo of a user profile component that calls fetch went from using nothing that really looks specific to react to requiring that you deeply understand this new primitive and that you wrap everything with it religiously the thing that you can't do anymore the thing that I liked to do a lot and I expect many apps to do in the future is simple it's this you can't do this anymore you can't just await a fetch call you have to wrap that some way or another that sucks this is much worse pattern than anything we've talked about with fetch here the idea that a get could result in changes occurring on your infrastructure level gets shouldn't have side effects yeah this isn't cashing it's D duping this is a very fair point from ziko and honestly I actually fully agree the react. cach should not have been cashed it should have been DD because the point here isn't that this gets cashed between requests or that this call can't be invalidated or any of those things it's that when you make this call multiple times in one render it all happens at once it's just it's the context where this cash lives is so small that it feels annoying and the the problem that I think people had when they were all freaking out over the next cashing and fetch stuff is they combined different problems in their head they acted as though and I'll admit I know like this video is explicitly not sponsored by for sale they're going to give me for it later that's fine the roll out of next's cashing behaviors was garbage I fully understand why people would be upset after how obnoxious it was to identify what was and wasn't being cashed in next applications with server components it was really obnoxious to know if a page would be cached why it was being cached why it wasn't being cached when the cash should be invalidated all of those things specifically the fact that they use magic variables like export const Dynamic equals whatever and the only way you can know this as typesafe is if you manually change your workspace environment to use the typescript version for the workspace because vs code won use that by default and now we get the typescript autocomplete for this where we could force Dynamic for the page the fact that this was kind of necessary to have your page actually reun every time you go to it is dumb and annoying and they didn't do a good enough job explaining this to you at all they should have like if they wanted to make a behavior as complex as like route level caching that is dependent on which headers you consume in which places this cache should have been communicated way better with Dev tools where if I was like running this uh Bun Run Dev and here we have my profile information on GitHub too many times we don't know if this page is being cashed or not anywhere near easily enough and if we make changes to it or if I like comment this out this page should technically be static but we don't really see here if it is or isn't it's hard to know what Behavior this page does and doesn't have and that's what's annoying to me is that it's way too hard with next's cash to know what isn't isn't being cashed that's a problem we should give them some for it they are working on it I'm excited to see what they do but the fact that next's Global route level cache was hard to understand and had edge cases and not necessarily the best defaults that is again a different problem from dding Fetch calls on the server side per request this is my frustration though and one more thing I didn't like about the original implementation they explicitly cashed post requests not just get so it wasn't just I'm fetching things from a server it was also I'm posting things to a server the reason that they allowed posts to be cached is because all graphql calls go through post which is yet another anti pattern that graphql enables so if you were instead of doing a traditional fetch you were fetching from a graphql endpoint here that call would have to be a post call so they had to cash that too which was really dumb the counterargument there is that you shouldn't be doing post calls per render which I think is fair an anti pattern I'm surprised I haven't seen more and I would expect to see more in the future would be something like do logging where we have like a separate endpoint that's like log and we put in here like method post body user info um timestamp whatever else we want to put because we want to log that this user went to this page this sucks and I'm expecting a lot of people to do stuff like this in the future and if you were doing something here that wasn't a log that was a fetch call instead it's hard for them to know if you intend to get data or if you intend to do something stupid here like posting for all of these Reasons I'm not entirely against removing this but I do think that this significantly increases the educational burden for explaining these changes explaining these new patterns and making sure people do things the right way I have a lot of concerns that people are going to write really suboptimal code and not wrap the right things in cash yeah it just the default of like having three different components that make the same fetch call now requires that you abstract that fetch call into a loader that they're all calling from and I don't think that is better for a lot of cases I think it is slightly more standard but it's more standard in a space where there never really was one which is server side fetch so uh yeah those are my Hut takes my concern with react cache is now how would a beginner differentiate between it and used memo yeah all these things are named terribly and should be rethought oh get's not explicitly allowed to a body and therefore folks like cloudfront will error if you pass it okay that's fair I guess graphql not being able to use get isn't graphql fault Rell is going to charge for cash reads and writes in the future it's free now for a while in beta not for this cash again you guys are mixing up the dynamic route level behaviors with fetch calls being duped this should not be named react cach it should be named react DD I wish they did this shout out to zika for proposing this name cuz this would have been much better I actually much prefer this and it's going to make people more confused but this isn't a memory cash this isn't memoization this is one specific thing this is making it so on a given request to your page fetch calls are duped or in this case GitHub profile calls are D duped so you only have to make this call once this code only has to run one time I'll show you in the demo react cach here we'll let count equal one okay we'll start at zero cool so we're going to log every time this gets called you know what I should move this code to the SDK and quotes and theoretically this call should only happen once because the cash instance shouldn't change get her profile get get her profile cool so now I lo this page go to terminal it's getting hit twice still why is it getting hit twice still oh no it's cuz the page instance was still or the um server site instance was still up and it persisted the state yeah it only calls it once per request yeah that was just a dumb like State being persisted between attempts thing yeah that makes sense yeah again like this is why this is good because we're only calling this get user Thing Once if I was to delete this rapper we just call this directly and I was to change this to be uh next I don't remember what the uh cash rule is here is it Cash Cash no cash cool now when I lo this page it should call it each time so for all of the components that are using get User it's now getting called if I go back to the Fetch and I comment that out and I reload the page again I'm going to kill the server so I clear the value did this change already go through I think this change already must have went through then if that's happening there yeah guess this change already made it through because it's not letting me cach this can I manually cach it Force cache interesting seems like that just doesn't work how I would have expected it to good to know then if I wrap this again with the react cach primitive here no caching going on there now it only gets hit once again this should be the default hopefully this emphasizes my point properly like getting this stuff right is annoying and if you're using the same data in multiple places you shouldn't have to put a lot of work into doing that you should be able to do the obvious thing of calling the same Fetch and have it behave properly it is also worth noting that the next cach gets invalidated if you passed any unique headers so if you had like headers here and you had like a cookie passed in it just would not cash this anymore they're pretty good about these things and if you do want things to be cached between requests the link that Gabriel just shared to the unstable cach is very very handy this lets you cach things between requests so if I go to a web page I get some data and I don't have to get it again the next time so if I go back to here and I refresh this like five times this got requested each of those times if I don't want that to happen I can use the next unstable cache instead it's actually annoying so I want to use the username in the input here so I'm going to keep doing that the same way instead I'm going to use this in the page cool so I'll throw this here we're going to wrap this in unstable cache instead I'm manually passing this t3g so I'm just going to pass that here as the key but now when I load this we get the zero call and now future loads don't have to call get user at all see all these new page loads I'm doing and none of these have resulted in new get user that's because the next unstable cach Cates things between requests which is really really handy if you don't want to have to like go over an API limit that you have for your service if you're getting rate limited you don't have to fetch duplicate data if you do something like this super super super handy but again this is a new unstable cash entity from next and this is very different from the react cach we were just talking about again react cach be renamed react dup almost certainly the unstable cach is a different thing in next that allows between requests to have cashing going on Lee has a great video breaking down caching as a whole so yeah hopefully this is a helpful overview of all of the different ways you can cash things inside of react and next and also why these things are so controversial I liked this override I get why it exists I also see why people don't like this override and don't want it to exist I'm happy with we're moving forward but I am a little bit scared we're caving to the people who are upset not the ones who are actually using the things anyways let me know what you guys think am I just being silly and fetch is this golden thing we shouldn't touch or is there actually value in what react did here originally let me know in the comments and Flame me all you want I'm excited to read them in the future till next time peace nerds ## React Router V7 just dropped, here's why you should care - 20241214 over the years I've had a kind of complex relationship with react router in a lot of ways I owe it so much for my success I spent a lot of time at twitch using it to architect our routes and our systems for making great experiences for our users and it was a huge part of my day-to-day work especially when I was working on internal tools and there's a lot of things it did great on the other hand query pams I I could literally sit here and rant so long about the way that it's Miss used terms and caused us to think about search prams wrong and uh I'm not going to do that though because today is not about my personal past frustrations with react router or its previous lack of type safety or its lack of real ways to do server rendering because a lot but not all of these problems have been fixed and I genuinely think react router V7 is one of the most important releases in react history because this is the path for the average react Dev to finally get the benefits of server components and much more and this includes but isn't limited to the effective murder of remix and scrapping it for parts to bring the best things into react router with hopes of remix V2 happening in the future there's a lot to talk about here and I'm so excited to cover it all but first we have to pay some bills so listen to our sponsor real fast epic react by keny dods today's sponsor is a tutorial and I know that that's not usually my thing but I promise this one is even more different than me first off Kent dods made it he's a legend he's a huge part of How I Learned react and he's going to help you get really really good at it everything new for react 19 and everything you ever had to learn before doesn't matter if you're new to react or you've used it for years there's cool stuff here but this isn't your usual tutorial it's not like a page you go through and copy paste code it from nor is it some built-in crappy editor in your browser when you get started you actually clone a repo and run it locally in your editor and the whole Workshop is done through Local Host through that code base you're running on your system and it's not like you're alone in this either you can see all the other people who are currently doing these lessons with you as well as join Discord and chat with them ask them questions ask them how they're solving things all the code that is for the workshop is in my editor so I'm using my tools of choice I don't have to learn a bunch of weird new janky stuff it's very very different and I am blown away with the quality of what Kent is created here it feels much more like a real work environment where we're pushing each other to learn instead of the usual wall of text telling me how I should do the thing by the way if you work at a company that uses react you probably shouldn't pay for this course yourself get them to pay for it for you Kent even wrote a letter that you can copy paste to your boss asking them for it we'll be sure to link this in the description too so what are you waiting for level up your react skills today with epic react check them out now at soy. Link epic react let's dive in today we're happy to announce the stable release of react router V7 V7 brings everything you love about remix back into react router proper we encourage all remix V2 users upgrade to react router V7 I misspoke earlier remix V3 is what we're waiting for not V2 regardless if you're on remix right now now you should probably just be using react router it's funny they call that out in the future of remix is going to be something very very different for the majority of the react ecosystem that's been around for the last 10 years we believe react router V7 will be the smoothest way to bridge the gap between react 18 and 19 i as someone who's known for not loving remix and having a lot of gripes with react router I fully agree with this statement I couldn't be more on board and I am very very hyped that react router recognizes the important role it has as the routing methodology that most react apps use today yes react router is still used by the majority of react apps awesome to see them acknowledge that and be the path to bring the best things from the new react building to every other codebase using react I'll be realistic here there is no world in which twitch could have realistically moved to nextjs after all of the work that's gone into the current website this lets benefits of react 19 reach the twitch code base and other giant ones like it so what does upgrading look like for V6 users the release brings a of features from remix back into router in the form of framework mode take a look at that in a bit in addition to the handful of components and hooks that you already use you now have access to a compiler with broad support for dependencies based on vit server rendering bundle splitting and optimization vastly improved type safety a worldclass development environment with HMR and much more you can read the V6 upgrade guide for more information on how we've made the upgrade path as smooth as possible for you and what you have to look forward to in V7 something I want to check in here is to see how much they help you you get off of webpack and onto vit the word v does not appear on this page so they do not this is just about how you actually integrate react router in your typescript code not how you do any of the bundling stuff they also have some help for You remix users if you want to move off and upgrade to the latest which is react rer V7 kind of weird that they wrote a guide on how to get off of remix but they're being realistic about this react router is the right place for these wins to go even if it means killing their framework I I think I need to do a timeline at some point the crazy history of remix it started as a paid template for Server rendering your react and react router applications moved to a framework that you had to pay for a license for moved to an open source framework that was free and then got killed in order to make react router better it's a wild history and it's worth a video of its own but we're not focused on that we're focused on react rer V7 let me know in the comments if a full breakdown of how we got to remix and then to here is something you're interested in but if you're not one of those people maintaining an old app what does this mean for new apps well if you're starting a new app with react router you have a choice you want to use react router just as a library and bring the rest of the pieces yourself or do you want a full framework similar to remix really depends on how much of your stack you'd like to invent yourself and how much leverage you'd like to get out of react router oh bars thank you this is a problem I have with next next does so many things really well and there's a few things it does that I absolutely hate with Pages router it was relatively ly easy to get out of those things and use next as like a a pre-rendering webpack config to just generate routes for you and then do everything else Your Own Way remix was a little heavier with like here is how you do things and if you don't like doing it their way you're kind of s so nextjs app router leans into that direction The Primitives are much more minimal and composable which makes me happy and I find myself wanting to reach for other things less but the DIY path isn't as valid in really viable in the new way of building with next seeing them take this opportunity to make react router the most modular solution that is really cool to see and I would normally say it's unrealistic but after seeing how quick they moved remix from being its own crazy pile of es build configs to a based on V plugin blew me away and yes the devs who did this are wizards but if the Wizards could do that that quickly now we have the source code that we can reference and we can now ourselves build something way better for our specific needs using all of the resources and efforts they've put in to build their own parts so you can use the ones you like you can ignore the ones you don't and you can build your own solution this is not for everyone to be clear if you're watching this trying to figure out what stack to use for your next project and you're confused and scared between different options I still think you should probably just use next right now it's a really good choice if you don't know what choice to make and there are solutions to the problems you'll run into but if you're working on a big code face with a lot of people with different opinions and various problems like I had to do with an Enterprise when I was working at twitch and Amazon this level of control is essential and it will make your life so much better when you need to opt out of some decision the framework made that makes your life harder this is awesome for the react apps the majority of react Engineers are working on it's not the best for the majority of apps but for the apps that have the most contributors that make the most money that are paying your salaries this is a huge huge win they have two different guys for getting started you can use it as a framework with create react router and as a library using Create V all our templates come with built-in deployment pipelines as well whether you're using Docker and hosting on a VPS or you're deploying to a cloud like Cloud flare workers also I know that it already supports for cell I haven't double checked but I know it already supports for sell as well as netfi and all those other providers have been pretty good about that historically I want to play I'm so happy the CLI for all these things have gotten so much better they were garbage when create T3 app started and I think we inadvertently push the whole industry to care more which is something I think is really cool interesting it spits out three different Docker files if you want to use bun or pnpm because they're weird enough they need their own and none for yarn cuz who the uses yarn you'd think since it knew I used pnpm it would be smarter about that but it is what it is let's see it's using the default V Port too it's really just leaning into V that's cool and here we have our layout there a scroll restoration component so that when you go back and forward it can get scroll back to the right place as a scripts component which is from react router for scripts at different pages use in need and children which um I don't know where these are actually being consumed no export default index routes home satisfies route config just routes I was trying to see if there's like a top level thing where I can see how these things are all being called because that's one my favorite things about react router in the past if I go to my one at five Stacks project I actually was surprised how much I enjoyed and kind of missed the config based routing in react router cuz I obviously I used that for this part cuz this was meant to be the like similar to my twitch stack piece and the Order of like events was really clear and I like that I like having a clear entry point that describes exactly where you go from there so here we have the create route which gets the element by ID route and if we go to the index HTML you see div ID root so we start in the HTML we see it loads this script and it has this div we go to this script I think it's entry is that what I named it yeah we go to entry and in entry we see that it creates a route based on the element ID and it renders in that strict mode Apollo provider use graph k for this and then the app router this doesn't me next app router this is the router for this specific app which I export here after creating it using the create browser router helper from react router Dom this is react router V6 and then I use that as the prop for the router provider so there's a very clear path from the index HTML over to the entry TSX over to the router TSX and now every route has a clear element that it resolves which is a react component apparently root TSX is the entry that's what I thought but where does this get rendered to the HTML there is no index HTML in here there is no Clarity in like how this becomes our app like if I name this something else it just works and if I change that it breaks why do changing this not break anything I don't know where this is used or if it's even used yeah this is what I don't like and to be clear next does this a bit too but next relies largely on the default exports resolving to that level but these help was like error boundary this isn't something that I think we're using somewhere this is a thing that we defined here and by exporting it it is now magically the error boundary for this whole thing if it was just the default export here that would be okay I would still like to know how it's being bound this part being a magic export is scary this being a magic export is scary I'm assuming it's a magic export is this used somewhere else it is not this is lowercase links that's capital links yeah this is also why they have the framework export versus the non-framework export to be fair so if I go back to their docs here and go through this recommendation you'll see here they just do what I showed before which is Mount this in the reactdom creat root call so if you're like me and you really want for a complex code based a lot of people contributing in it to have a very clear path from where the HTML starts to where everything else gets handled you can still do that which is cool I can't do this with next and I love they gave me the flexibility but I still feel weird when I first spin this up and have no idea what any of this does especially if I'm a a seasoned react router user this is very different let's keep going though there's more fun to be had here for sure they have templates that you can choose from let's pick one of these okay I'm going to use the versel template because I want the server rendering also Pro tip for those who don't know this pnpx is kind of deprecated so the trick is pnpm create space react router so if it's a if there's a create Dash command you can delete the create dash at the start and do the command pnpm create and it will turn this create space react router into create D react-router very useful I do that all of the time we'll call this uh rv7 SSR let's see what's different here so look at that it looks like it's generating these types here so they don't exist yet now that I'm running the dev server they do though so I can go here and this is the generated types it is cool that it puts this as a real directory here that you can see and debug from instead of it all being magic hidden behind the scenes in a compiler I do actually really like that and it's I don't love that it means your types are wrong until you run the dev server which means like if I kill this and I make changes the types are wrong if I look at this in a browser IDE like stack Blitz the types are wrong you have to be running the code in order for your types to update as you do Dev and if you have a change you haven't saved yet you can't rely on like the vs code intellisense instance to know across files because it can't because the file that it's referencing doesn't exist until you save so it has negatives but it's very transparent about what it is doing which is something I personally think is really important cool this all looks the same so far so how does the server rendering part work let's just run this first it's on local close 3000 hello from versell but is this SSR let's take a look at the network request to see Local Host that looks ssard to me yep look at that oh it's even streaming in updates look at that window react router context stream control or close huge huge I didn't know if they'd have that working already that's actually really cool to see but this is the HTML that react router sent to the browser and as a result you're not going to get an empty HTML that then you have to wait to get the rest from Once the client loads you can get the whole thing and you can even stream down Parts later I want to play with that though how can I oh context value from versell loader um where is that value coming from though server appts can get load context B async okay we're going to close and reopen paste enter one okay you have to wait the whole second so that by default isn't sending down as a promise so we're going to do instead tell that that it's a promise now now we get an error here because the types all get hoisted dope that now expects the promise how do they recommend doing this let me look at their docks aha here's what I was looking for oh wait okay it's not doing what I expected to it's still waiting for the promise to be resolved because the whole page takes a second to load still how do I get it to not do that oh it has to be wrapped in suspense okay that's that's my my l hopefully once and for all yeah there we go that's actually really cool if you don't know why this is so cool you need to watch more of my videos it's important when you're building an app that has parts that are slower than other parts that you can get the fast parts to the user fast and the slow Parts can come in when they're ready what I'm doing here that's really cool is I'm taking some data it's fake data from this fake timeout that I made that takes longer to respond than other things on the page everything else in this case is static this is all just being served through a basic Express server by the way this isn't some crazy magic going on with their implementation of all of this this is react router the react router Express request Handler and express all being used the basic boring way and now I can set a load context which is data that I want to have access to in the components in this case in every route as far as I know and now that I've created this get load context for the route component in this case for home we get loader data from the component props and this loader data comes from the loader function which has the context which in this case is this value from forell if I wanted the way that you'd probably actually want to do this is this wouldn't be part of your get load context this is a thing that you would have in your loader here so I can paste that there now message is loader dat. message and it's pretty clearly defined as it returns a string there we go now that I've moved this here it doesn't really matter what I do here I can just probably even delete the whole get load context and be fine now for the loader for this route we have this data that takes a second to load I could even bump this make it 5 Seconds to load this data is for this route so there are things on this route we want to use it for at this point in time though it is still a promise you see that the promise string so we're not passing welcome a string we're passing it a promise that is being resolved by the server that promise gets passed to our welcome component which is a client component this runs on the user's device this component runs the first time on the server but since it sees that this promise is a promise when it gets to the suspense boundary above it and it sees oh I have to await things in here puts this in the HTML that it sends to the user in the background it waits for this promise and when the promise is resolved it takes whatever you generate here as a result and streams that down as part of the same request which is huge because now the server can generate HTML for all the parts that don't have a suspense boundary on them instantly get that response to the user way quicker and the rest comes in when it's ready this let you have the static Parts be as fast as they can be and the slow Parts be as slow as they need to be this is the whole dynamic static war that we've been fighting in the react World now for like 8 to 10 years it's awesome to see this come to react router previously you had to use remix or next for these patterns now they are way more accessible as long as you're willing to serve your react app through Express you can set this up in your code base right now which is really really cool these features were nowhere near this accessible before there are catches though here is what I would consider one of the biggest catches in comparison to to something like nextjs and server components add a console log here very very important this console log exists in this home component where do you think this console log will run think about it come to an answer have it in your head let's see if your guess was correct here it is logging on the client and here it is again logging on the server this part is traditional SSR this code runs on the server and the client because this component exists on the server and the client what about this loader though now if we load this again the loader ran here and it didn't run on the client this is a thing that I didn't realize how much I hated until server components this file has parts that only run on the server as well as parts that run on both that feels weird I like the idea of different files being client side or server side to be fair client side files run on both and serers side files only run on the server but the idea of a file that is code that runs on client and server as well as code that only runs on server it leads to weird things like when you import a server only dependency like let's say you import Prisma or drizzle or some type of omm to get data you now have to rely on the tree shaking in the compiler to correctly identify that the backend dependencies you imported here are only for the backend thankfully these tools and these compilers have gotten really good at this and I haven't ran into too many times this was a problem but the mental model of not worrying about it is really nice and it feels weird coming back to a loader pattern like this and to be clear next had this problem even worse with page components and get server s side props it was the worst implementation of these patterns by a lot this is way better than that was but I still feel myself missing the serveron file nature of server components I want to fix this weird bug I'm getting now though it said it was timing out if I bump the time down will it still time out okay it doesn't so it has a default timeout if you have 5 Seconds it gives up is that a thing that's configured somewhere give me a hint on how to get around that anywhere let me just check the docks I suppose um they have an open issue server timeout after 5 Seconds how did I guess the number you should export K stream timeout from your entry. server. TSX while not in the main docs it is in the API reference do I still have access to the entry. server. TSX is that a file that still exists it does not okay so how do I do that here then um MPX rect R A reveal okay oh oh it's hiding files from me that makes sense quick context there's a pattern that was pioneered by create react app which was to take the things that were usually generic and the same for like 80% of cases put those into a different part of the npm package that you would never have to see but the moment you need to configure them you'd have to run the npm eject command that would take all those files and dump them in your code base and make them your problem that meant you could no longer do version upgrades because you had to deal with all the diffs between your code and their code and you couldn't just PM install the latest version it is what it is it also means a lot of the code in your code base isn't your code it's the code from your dependency that it dumped into your code base we've largely moved away from this pattern of ejecting because the Frameworks do more of the things correctly and it sucked but that doesn't mean we have fully escaped and a lot of why the things remember at the beginning I was saying like I want to follow top to bottom how this is happening the reason I couldn't is they're hiding a bunch of the files I to be clear I think this is probably the right call because most people should never need to touch any of these things when you have a default like aort delay suddenly I have to care and for the docs to not include that or the path for it and to have to have somebody in my chat show me the thing to solve it that's a little scary these will all be resolved problems in the near future I am sure but in the moment that was unexpected and a little bit painful but now that I bump that to a 7-second timeout my 5-second timeout will resolve without a giant scary error or not the I okay so this abort delay is just not used so okay this is where my skepticism starts the point of ejecting is that we now have the actual code that is running and theoretically we should have just removed the magic instead of having this why are there still magic exports now that I've ejected ah so all I had to do was remove the Magic by getting react router to give me back my entry server file and then go back to magic with this magic export that I can't actually see what it does or how it's used I don't like that I don't want to die on this hill alone so I'm going to hop into chat and so that other people feel similar it is what it is to be clear I can't imagine many people are going to even be using the streaming stuff much less using it in a way where it takes longer than 5 seconds but the fact that I had to go through that to do that is a a bit scary and I hope they make good changes apparently aort delay which is the other thing here is deprea God damn it I I sympathize with the react router and remix teams I genuinely do a lift like this is Monumental and the amount of work that they had to put in to make all of this possible especially when you consider all of the different paths they have to support they have to support people who are on a react router V4 app that they've slowly upgraded for the past 5 years they people who on remix V2 that need a happy path to escape and build the new stuff these were people who are starting from scratch with vit and deploying to versel and Cloud Flor Pages sometimes they have a lot of different paths in features and functionality and people they have to support more than almost any other project for context somewhere around 50% of react apps are using react router there's been a pretty big spike in nextjs apps especially recently it seems that's allowed this number to drift a bit but to support half of react apps means you have to do a lot of weird maintenance crap and they' have done the majority of the work I am blown away at how smooth the path is for most people to upgrade here and to start getting these benefits and features but as I just showed here not everything is smooth yet that doesn't mean you shouldn't upgrade today if you're on an older version of react router I really think you need to upgrade don't let the things I just ran into make you hesitate in the slightest because the things I just ran into are all new features and functionality that I'm excited about on the server side aspect of what react router now enables if you have an existing client side react app using react router do the upgrade it will enable so many awesome things in the future it will fix some weird bugs and features and problems that have existed in the past and it sets you up for more success long term with that code base you no longer need to feel that obligation to rewrite everything with next or spelt kit or whatever else react router is here to stay and I am genuinely really hyped about this release even if some of the features were a bit weird to stumble around just now let me know what you think until next time maintain those old apps ## React Server Components A Comprehensive Breakdown - 20231005 you all have a lot of questions about server components and I get it it's a really different model especially if you're already familiar with react and obviously if you're not I think it's important that we break down the very core of how they work and how they differ from the existing react model thankfully Josh comeo wrote an article doing this and I spent the last hour going through it piece by piece recreating a bunch of the examples and breaking down how server components work on a fundamental level while also answering tons of questions from people in chat so hopefully you can find some value in this long rant cuz I put a lot of work into it I think it's a pretty good one so without further Ado let's dive in thank you Josh comeo and thank you agore for sharing this earlier making sense of react server components so here's something that makes me feel old react celebrated its 10th birthday this year this is also interesting on my behalf because react started in 2013 but I started writing react in 2018 so I'm now square at the halfway point for react I have now been around for exactly half of react's Journey in the decade since react was first introduced to a bewildered Dev Community it's gone through several Evolutions the react team has not been sh shy when it comes to radical change if they discover a better solution to a problem they'll run with it a couple months ago the react team unveiled react server components the latest paradigm shift for the first time ever react components can run exclusively on the server this word exclusively is important here because this is a part of thing people seem to miss a lot I know I did initially with things like remix or next your code would run on the server so you'd send HTML down to the user but you would also send the JavaScript to for all of the same content so you were required to then also run that JavaScript on the client to recreate the Dom to link the virtual Dom to the real Dom and because of that any code in your component that runs on the server is also running on the client the beauty of the new model is a component by default only runs on the server and doesn't send JavaScript to the client anymore which is really interesting there's been so much fraking confusion about this online lots of folks have lots of questions around what this is how it works what the benefits are and how it fits together with things like serers side rendering I've been doing a lot of experimentation with server components and I've answered a lot of of my own questions I have to admit I'm way more excited about this stuff than I expected it to be it's really cool so my goal today is to help demystify the stuff for you to answer a lot of questions you might have about server components to put react server components in context is helpful to understand how SSR works if you're already familiar with SSR feel free to skip to the next heading this is what I described before user would receive this is the good old empty HTML file that I talk about a lot with just the script tag and then the script loads runs and then you finally get page content and this just explains the bundle gets mounted includes react and other dependencies once the JS has been downloaded and parse react brings into action but this all happens when you're staring at a blank white screen or if you put some default Styles in here which almost no one does you have a tiny bit of additional content some sites like twitch have a crappy skeleton that is the default HTML and then the script comes in to take over but this is all the user sees for a while and this is usually not the content you want the user to see and depending on if they have JavaScript enabled or not how fast their internet connection is how fast their device is and so many other things that might be a long time they have to sit there and wait for what SSR does is it does that first run of the JavaScript on the server so that you get sent more useful HTML content it is not the HTML that includes just that JavaScript tag and nothing else it's instead the HTML after react does its first render and update but then you have to get the JavaScript to work and that's hydration which Dan Rob describes as watering dry HTML with the water of interactivity and event handlers so you have your static HTML with a bunch of elements in it and react has to run the way it always does to figure out which elements bind to which components so that it can continue to own and update that HTML page once the JS bundle has been downloaded react will quickly run through our entire app building up a virtual sketch of the UI and fitting it to the real Dom attaching event handlers firing off effects Etc that's AAR in a nutshell we talk about Cesar we typically imagine a flow looking like this user visits a site no JS or something like that receives the request renders the react application generating HTML sends that HTML to the client and then the clientes over from their hydrating and rendering but there are other ones where what are they specifically explaining here when we build the app yeah so you can also at build time generate different HTML files for every route and then load JavaScript to take over once the page has been fetched but usually what we're talking about with SSR is the server side part this would be more like using the next export function which I've argued against many of time next export should not exist because most of next's features especially now in the server component world require next's server and its relationship with the client and if you throw that all away for static HTML files it's no longer really nextjs the way I see it serers side rendering is an umbrella term that includes several rendering strategies they all have one thing in common the initial render happens in a server runtime like node using the react Dom server apis Yep this is very fair server side rering always means running something like react Dom server on something that isn't the client but usually what we're referring to is this pattern bouncing back and forth this is about data fetching using something like react query or SWR Apollo the client will make an equ work request which would then grab data and send it back so this is just what happens if you use fetch at all but with these tools you can cash those calls better prevent having to dup them and a lot of other useful important things yeah server sends files to the client well it sends an HTML file to the client which then us to download the JavaScript render the shell request more data which goes to the database well it goes to the server that then goes to the database and then that comes back to the user as Json which then can be rendered by the JavaScript to make HTML there's actually a lot more steps here I like that he simplified it but this really like like he went out of his way to simplify it here there's like seven steps uh where each of those arrows are Reas an imaginary madeup timeline everybody gets so mad at me when I do stuff like this them it's really helpful I think this is a good thing to do it makes it way easier to read and parse first graph shows the flow using a client side rendering Strat starts with a client receiving HTML then it's a download with a script tag run y we've explained that enough times you've seen this for a lot Airbnb starts rendering a shell or one I was mentioning before we'll turn my network speed down to slow 3G we're going to go to Twitch see all of that with the loading spinner and this stuff all here that's all happening while the JavaScript gets fetched and then runs so in some amount of time once the like 20 Megs of JS finish fetching I pick slow 3G for a reason we'll finally have some js running in the next couple minutes yep now the JavaScript is started to run but you see there specifically before the JavaScript is here it has this state because right here it's fetching all of the JavaScript so this is just the static HTML anyways the user will see the loading State until the network request resolves and react reenders replacing the loading UI with the real content as we just saw with twitch let's look at another way we could architect This Server client yeah server renders the shell so there's some work being done here so there's more time until the client gets their first response but less time until they see something valuable but then they still have to do the same download JS step the same hydrate step the same database query and the same content render a shell is better than a blank white page but ultimately doesn't really move the needle in signific way yep totally agree this isn't useful because it makes your site faster this is useful because it allows you to have a better loading state and better like default templates depending on how much of your shell you choose to render so here is where he puts flags for time to First paint and content painted these are the flags that you'll see in things like Lighthouse and other performance testing tools where it labels different points in the user's Journey when the page loads if we render a blank HTML page that then loads JavaScript to trigger loading States and then get data once the JavaScript loads the loading States and has rendered those on the page we hit first paint cuz that's the first time content of meaning is and painted on the page once the server has sent back the Json response and we've parsed that and made that into HTML with react then the content is painted and we hit that flag so the difference with SSR is that first paint happens much earlier we get some content way earlier and the page interaction still has to happen like after the fact and then the database query and then the content is painted but we get something to the user earlier at the cost of a slightly later page interactive depending on if this render shell is statically cashed on the CDM or not but it's fair to say it's basically the same thing and just first paint is moving I I can agree with that doesn't this feel a bit silly when I look at the SSR graph I can't help but notice the request start on the server instead of requiring a second round trip why not do the database work during that initial request so why not fetch these things immediately and then the page will become interactive later so you have content painted before you have page interactive this is what like deep SSR does when you fly SSR the page and its content you're able to send the correct page down first try with none of these additional States at the cost of additional time until the user sees anything I was hoping you'd have the interactive chart again because the catch here is that your first paint gets delayed based on how long it takes to do these things so if your database query takes five of his imaginary unit you just delayed the first thing the user sees by that five amount so if you want the user to see something and you're okay with the right thing the right content coming a bit later it is very nice to do this later but if you want the user to get the correct content first try as fast as possible then you would do the database call on the server the problem is depending on the SSR model you're using this can be really easy or really hard it gets difficult to say hey I actually want this section to be loaded on client and this section to be loaded on server and if you change your mind down the road it can be really painful this is the beauty of the new model which I'm sure we'll go into in a bit especially when streaming gets involved first paint content painted pag interactive yep yep yep instead of bouncing back and forth we do our database query as part of the initial request sending fully populated UI straight to the user how we do this we need to be able to give react a chunk of code that runs exclusively on the server to do a database query so this hasn't been an option even with SSR kind of with something like trpc you could actually specify that a query is SSR ready and when it does the server side render with that hook it can block get that data and Pull It in on that first render so there are solutions before server components that let you on server's Pass Run server code and on the client's pass fetch data from server this has been figured out we have had Solutions I'm not going to say they're anywhere near as good as RC but we did have this option in react because yes components render on both but you can have the code that they run trigger differently depending on which environment the code is running in but oh I'm going say this we've come up with lots of solutions next and gats you have created their own ways to run code exclusively on the server I should have just scrolled down get serers side props this code only runs on the server and then when you access it on the client it's data that exists in the top level props route I will say get serverside props is one of like the worst patterns I've ever used and I'm so happy it is dead because this encourages terrible things it's like that awful pattern of wrapping your app with context but 10 times worse because there's no type safety there's no inference for anything and you have no guarantees that the props you return here actually make it to a component anywhere in your application because this is defined route level and things have to be passed through so your components underneath don't actually know if they have access to this regardless it worked but rappers like trpc doing this at a different level ended up being a much better experience in my opinion I have a whole article on my blog that I never plug one of my first articles that did really well and I'm proud as hell of this one and Inc consistent truth nextjs in type safety this article is not the case with server components but if you're still using page router is specifically if you're using get server side props it's so bad uh yeah next can be a type safety risk we have this get server side props that returns user and then we call props do user.name but if we do anything between these two which there's a lot of room to do do this data might not make it here in particular if the document or app TS or jsx files don't pass props properly to the page component this won't come through if these are in different files you have no guarantees and this doesn't actually have a type definition at all this is all coming off of any as I said here there's a number of type errors this silently allows if you modify the schema you select different values in that Prisma call you change the key erroneously delete something for some reason they use implicit any for all of this stuff we can manually type the props but then they can still drift so here I only select ID even though we think we have the whole type that fails their INF ferget servide props casts a bunch of to any yeah it just it's overrides to key string any which is awful it also INF first to props never and we've thankfully moved on so yeah I have a whole article about that if you want to learn more about the the type level failures within gets overside props there's also structural issues for how it gets called and where data goes there's a reason that next has moved on to something much better yeah gssp was a mess the r is super ahead of its time let's see if we agree on the problems only works at Route level yep meta framework came with approach GS be yeah all react components will always hide the client says nothing about the misery that is the type safety story regardless it was awesome that we had a solution caught on for a reason next blew up before rsc's were even a thought and that's because of how much better these patterns were than having to touch everything on client but here's where stuff gets interesting server components the thing you click the deal for at a high level react server components is the name for a brand new paradigm in this new world we can create components that run exclusively on the server so all us to do things like write database queries right inside our components I remember the first time someone posted an example like this everybody was freaking out like oh my God you're going to allow so many sequel inject sending that code to the users because it was so hard for us to comprehend that this code only runs on the server this is the equivalent of in something like rails defining a template this only runs on the server this file effectively is an HTML template generator that is the magic of rsc's is you have an HTML template generator intering with react the client library and you can move between the two as you please yep he even said as I was saying before this code looked absolutely wild at first and it did it took me a bit to process that this only ran on the server function components can't be async we're not allowing them to have side effects and render like that this is an important piece server components never render this code breaks the traditional react model in that sense like this code will not rerun when you render on client and if you have a client component that was past the server component as a prop that it renders inside of it and then that client component reenders that child won't reender that's a huge win and if you do get an update from the server with new markup for those server components it can render those through react with something like router. refresh in next which allows you to directly update those static non-updating components when the server sends updated HTML this means a big chunk of API incompatible server components you can't use State you can't really use react context you aren't going to run something like a use effect as a side effect there really aren't side effects in server components which is nice too CU I found a lot of the time we're bringing in things like use effect and other side effects it's to get data to our components which is a whole like a significant portion of why we have side effects in our apps so if we have a different way to get that data without needing side effects that is a win even though if you when you first look at it it might feel like a cost because now we have part of react where we can use the solutions we're used to that's cuz it lets us not reach for those Solutions when we don't need them yet so components themselves are surprisingly straightforward but the react server components Paradigm is significantly more complex this is because we still have regular old components and the way they fit together can be pretty confusing this new paradigm the traditional react components we're familiar with are called client components yep I've been on this name forever should have been interactive components server components only run on server client components render on both here's how I summarize it RSC is the name for the Paradigm the standard re components we know and love have been re branded as client components it's a new name for an old thing it works just like client components worked in next and remix before where they run on both server and on client new paradigm has a new component type called server components these only run on the server the code isn't included in the JS and they never hydrate or re-render yes this is the distinction going to just hold and let yall look at this and read it a few times if you don't get it yet pause and think a little bit longer on it this is the core of server components it's important that we understand the way things worked before that is client components and server components are this new thing that doesn't follow the model we're used to they don't run in your client and we can interrupt between these things the way we would before with a a template that runs in a server that then triggers JavaScript on the client but with a much happier story relating these pieces react Ser components are not a replacement for server side rendering it's SSR version 2 two separate puzzle pieces yeah we still have server side rendering to generate the initial HTML it still runs your client components once to make that proper scaffolding but a lot of the content can be fetched as server components and you don't need a lot of those behaviors on the client you don't need to make those API request you don't need to do a lot of those things they even have RSC examples without SSR which means similar to with SSR where you could use it as a build step you can build the react server components ahead of time and have those be fetched effectively from a CDN to hydrate your app it's just a weird pattern I haven't seen a compelling use case for it yet but I could see them in the future for sure compatible environments traditionally you could just install the latest react version to try out a new feature server components are not that simple because it has to be integrated with a lot of things it's the bundler the server runtime the relationship between those there's a lot of pieces that have to be assembled just right for this to work he says here the only recommended way to start with rs's right now is to use the newest version of NEX 13 hopefully in the future more react Bas Frameworks will start to incorporate server components feels awkward that a core react feature is only available to one particular tool the react docks have a bleeding edge framework section where they list the Frameworks that support server components actually curious what's on it right now not recommended for production as a March 2023 I wonder how salty the team is on that they don't have anything else under here yet that's not surprising but interesting regardless I'm excited to see more Frameworks using server components I Know Remix is working on it I believe Astro was for a B I don't know how much of a priority that is at the moment but there's a lot of places trying to to make good server component Integrations in their Frameworks in the new react server components Paradigm all components are assumed to be server components by default this was a controversial decision that I think was the right decision and as he says here if you want the old Behavior you want a traditional client component use client if you move all of your code from Pages directory over to app router and you want to just have everything work the way it did before you can code mod go add use client onto every TSX file and it will behave the exact same way as it used to which is really powerful but the server components don't have those behaviors and you can fetch directly within them really really powerful the standal Ling at the top use client is how we tell react this component is client components we don't need to specify use server in our server components use server is used for other things which we'll get to in a while but for now use client it's similar to use strict for strict mode JavaScript but it's they're trying to follow the way these things have been done before so which components should be client components I like this framing if a component can be a server component it should be a server component and that's why it's the default because server components are much simpler and easier to reason about because they don't rerun you don't have to mentally keep track of logic updates and state it just renders the right stuff it's almost like previously with function components before hooks you always wanted function components if you could because they were sfc's stateless functional components and when you don't have state in a thing that you don't need it becomes much simpler this is also why HTM X is so dope because it significantly reduces the amount of State you're thinking about managing and interacting with in the client and in your code less state is good and I think that's a theme you're going to see with a lot of the technologies that we'll be talking about and building over the next few years this is the the anti-state and kind of the anti- API wave that we're seeing happen they're talking about like page interactive time and stuff here it is cool the sunless JavaScript like less state is good because less state is less surface area for problems shouldn't make it our mission to eradicate as many client CES as possible we shouldn't try to optimize for smallest number of client components it's worth remind that until now every component in every app has been a client component it absolutely makes sense to have a lot of client components still and if you have something where like you have one client component and you could break it up into two to make it easier you should and if you have a server component and it needs some behavior that is better to do on client you should move it there yep that's all stuff I agree with boundaries one of the first questions I had when I was getting familiar with rsc's was what happens when the props change for example suppose we had a server component like this suppose initial render hit was Zero component will produce the following markup what happens when hits change it would need to reender but it can't server components don't make sense in isolation this is I think the part that is making it harder to digest server components with hooks you could start at any point in your app you be like okay I'm going to add this component here and we're going to use hook for it and it would just work in an old react app as long as you update the react version with server components it only works from the root so that top level mounted component the thing at the very very top of your Dom that has to be ready for and support server components and as you add rsc's and these patterns throughout your app it has to start from the route down so it's not anywhere near as easy to adopt or even think about because we're not just thinking about an isolated component and a different way to do things within it anywhere in your tree we're thinking about the root of your app and how it sends data and updates through your entire application it's a fundamental change in how we do the stuff let's say we have the following component Tre app header article hit counter discussion comment comment if all of these were server components it would make sense but let's say article component owns the hits State article is used client and this has the used State call in it and then hit counter is a sub component see the issue when article renders any owned components will also render including Hit And discussion you server components though they can't the react team has added a rule client components can only render other client components unless you pass a server component is a prop which we'll get into in a bit for now assume this is true there are catches but but this is true one of the biggest aha moments I had with server components was the realization that the new paradigm is all about creating client server boundaries yeah I push this really hard it's all about the boundaries and the relationships between components it lets you control the boundaries of your components similar to how hooks let you control the boundaries of your state so here is a client boundary because this is a used client component so all of these are client components because they're mounted by a used client component when you add the use client directive to the article component we create a client boundary yep yep yep when I first learned that client components can't render server components it felt pretty restrictive to me what if I need to use State high up in my application does that mean everything needs to become a client component turns out in many cases we can work around this limitation by restructuring our app so that the owner changes I'm going to do a quick demo because this doesn't show some of the things I want to show here's our hello world make a component in here in this components folder we'll do counter. TSX first thing use client use client because it's going to have state in it next export cons to counter give it some hints there we go so now we need to mount this in the server component so I will pass this here and import and we have this and it works as expected we click it and it goes up but let's make another component quick we'll do a server only. TSX Sport async function Su server component and in here we want to do something async what I'll do is make a text file text.txt make sure it's actually in the root and I'm going to put hello world from file in here so I'm going to prompt first read from text.txt with node FS well sure return div text cool this should work I could just import FS the normal way import FS from FS it's not even async whatever this will do what it needs to so if I throw this in here we would all expect this to work and it does this is now reading from a file and this is happening on my machine because this text file isn't being bundled so if this can be accessed that is happening on the server so it could be a database call it could be anything else but here I'm mounting that there let's say I want this in this component though like I have div class name equals Flex Flex call BG gray 400 or 300 cool I'm just going to wrap this like this for now html's hard cool so now this is gray where's that semicolon coming from oh here and I'm going to give the button some class names click too cool so here's the button but let's say we want more space around it and we want this text above in there P6 so let's say we want the text instead of there inside here let's try it let just mount it some server component okay cool we're mounting this in here oh no can't resolve FS What's Happening Here well it's trying to render This Server component on the client it's trying to bundle this in the and send that as JavaScript to the user that they can run and they can't but I want this here how do I get this here well I'll show you we will pass it a child the smart enough come on react Element Make It optional this can't run on the client we can't Mount this directly in a client component the key word there though is directly so I can render any react node as a child or it could be another prop I don't even need to name this children could be anything else but I can pass that node as a child so let's do that counter and now it works because this server component is still being rendered on the server when you pass this as a child it's still being rendered here but react is now smart enough to know if you're rendering a server component as a prop to a client component that it should run that on the server and serialize the thing it's passing so this component doesn't get another JavaScript component to mount this component is receiving a property of some server component I found this can sometimes be easier to understand if I change it to something like some sub component so this is just named whatever you want the reason I'm changing this so I can show it this way CU I think this helps people understand the difference a little bit better I forgot to save there we go the the point I'm trying to make here is as long as the thing that does this call that actually puts the brackets around your server component if that happens any server component you're good even if you're passing that as a property to a client component and this allows for some really powerful weaving of these things without compromising on the core value of server components which is nothing comes from a used State call nothing comes from a hook there cannot be a hook above a server component that passes props to a server component every server component has to be renderable on server in that first pass so every piece of data it needs needs to be there as part of the request so it can come from your cookies it can come from the URL headers and parameters it can come from parts of the request and characteristics of it it cannot come from a component in the State on the client side specifically this pattern is really cool I see why he didn't include it as early cuz this is where like the Mind exploding stuff starts to happen but it is so powerful it's so powerful let's go back to the article cuz I'm almost certain he's going to touch on all of this peing under the hood let's look at this at a bit of a lower level when we use a server component what does this output look like what actually gets generated we run this function in the react server component Paradigm all components are server components by default since we haven't explicitly marked this as a client component it will only render on the server so when we visit the page we receive HTML that looks like this has hello world and then a baked in script tag that basically tells react where all of these things are so it knows how to update it if it gets new changes in the future it's restructured things here the true generated JS inside of an RSC us a stringify Json is an optimization to reduce the file size of HTML yeah he also say stripped out noncritical parts of HTML yeah this is a really good sample of effectively what you get back from that really simple example we see that our HTML document includes the UI generated by a react app the hello world paragraph below that we have the script tag that loads the JS that's so it can hydrate and other client components can run on the client side and then we have the script with this inline JS what we're doing here is telling react hey so I know you're missing the homepage component code but don't worry here's what it rendered this allows for react to hydrate and and know what is where without having to actually have that code to rerun and full so this is what each of those server components returned in its props so that react's traditional virtual Dom model can still have what it needs to Mark each component and where it's from and what it has without having to send you all of the JavaScript to rerun that on your own side we send along the rendered value the virtual representation that was generated on the server when react loads the client it reuses the description instead of regenerating it very handy a fun comparison for this is something like if you do a use a effect that has a fetch call and you theoretically got that to run on server in order for the client to hydrate it would have to make that same call and you have to wait for that additional network round trip in order to have the same state on the client as the server another problem that I'm sure we've all had the the dreaded hydration error HTML doesn't match one of the most common cases I have for that is date times if we render on the server and when we render on the server the date time it renders is UTC and when I render it on client it's PST then we get two different strings out it might be 4 p.m. in one time zone and 6 p.m. in the other so if we run the same JavaScript on the server and the client the output might be different which causes a hydration error but if we don't run that JavaScript on the client we just pass the returned value to the JavaScript it prevents those types of hydration errors and desynchronizations because the code only have asked to run once yep okay let's see what the advantages that he lists are for ACT server components this should be R is the first official way to run server exclusive code in react so I mentioned earlier though this isn't really a new thing in the Bro react ecosystem we've been doing things like this since 2016 the big difference is we' never had a way to run the server exclusive code inside our components this is the magic being able to await a data datase call or a file read from the server or just calling something like reddis directly it's really powerful oh he does have the before and after for this so yeah here he shows the page interactive time goes down a good bit this maybe less exciting because most next steps are already fast enough with page interactive timing here's something I find really cool though we no longer have to make the same compromis in terms of features versus bundle size it's a very fair point your bundle size is no longer going to be as affected by what you're including in a lot of places here's a fun one in upload thing we have different patterns that are not generated but we have a a set of SVG patterns and colors that are randomly selected based on the name that you chose for your app so that you can have a visual distinction between your apps we just thought it was a cute thing to make your dashboard a little clear which app is which if we were to bundle all of those svgs that file would be like 500 kiloby and we put them in the JF because we want to be able to dynamically affect values like the fill color so if we were to have done this traditionally with client components we would have ended up fetching so much JavaScript we didn't need because we would have had every single SVG that could be rendered on the client as part of that bundle but since these svgs are actually server components you only get the ones that are rendering on your page we would have had to do some crazy stuff to get this to render correctly so that when you first load the page it comes through and doesn't have to fetch these images in the background or something because we include them in the markup because we can do that without exploding our bundle with server components that's just one of many examples of things that were surprisingly easy for us because we're using the new model somebody said react's had lazy loading for years that's not lazy loading can I ask you sincerely like what's not clear so I can clarify it this isn't lazy loading there's nothing lazy I'm command shift ring right now this is a full refresh with no cash and this content is here this is in the HTML this is an embedded SVG G this isn't lazy loading this is there on the first render without having to fill up the JavaScript with a bunch of stuff the SVG this one is there as Json but I have 50 svgs I have a bunch of svgs can I explain this more sure I'll explain this more okay let me pull up the code quick here's the thing that you couldn't do before see this function get random pattern Styles this function is in a 500 line of code file full of these different svgs all is Json this is a shitload of code that I would ideally not ever have to send to my users this one's even string escaped in a way that um my editor doesn't seem to like much whatever this file is huge and it sucks but I don't need the content of this file all this file does is defines this SVG that's all it does so now instead of having to load this whole file or people keep saying what about code split what about breaking it up cool I could have made a different file for every one of these svgs I could have made a dynamic import structure that will import just the ones that are rendering right now and then when the page loads on the client what I'm going to have to do is load the page with no svgs load the JavaScript that determines which svgs to load that JavaScript goes and dynamically fetches the however many svgs I need and then finally 5 to 10 steps later I can finally render the SVG or I know this this is crazy thought absurd what if it was just there in the HTML what if I didn't have to have 15 Steps between the JavaScript rendering the SVG and the HTML having the SVG what if I didn't have to build a new import solution what if I didn't need 15 layers and instead the server code which the server has a lot of code it can have as much code as it needs cuz it's a server I don't give a crap the server runs this huge file it picks the pieces from that file that are needed puts those in the markup and now it's done it doesn't need this code file it just needs two of the values from this code file thank you prime I'm very happy you're here because this is one of those crazy like horseshoe Theory things where like the heavy front end people and heavy backend people we all get why this makes sense I think I've been very clear with this it seems like svgs are triggering people so I I'm going to be very clear about something svgs are text based markup like this is HTML you shouldn't have to re-encode this like okay somebody's upset because this means you have to reload the SVG yes you have to reload the 50 bytes correct it's a really simple example but let's say you have a heavy component there a lot of stuff for UI but only renders like a little bit of it I I'll make a really simple example let's make a component named heavy. TSX export async function some heavy component and this takes in a prop if not props do is signed in return div please sign sign in first and then after here we return div pretend this component has a bunch of stuff that is megabytes of JS bad so in this component if the user not signed in we get this tiny bit of HTML back if the user is signed in we could get like a bunch of subcomponents that are really heavy we could get any of many different things could even be like we do a a long waiting async call here there's a lot of things you might want to do later somebody said why not code split that because then you have to load another JavaScript bundle okay I think this is where things are breaking down Let's Pretend This was lazy loaded so we have some const fake lazy equals react. La doesn't exist pretend it does so let's say we do this here is how this would work on server to client so step one server sends client empty HTML with JS tag step two client parses HTML and fetches JS three client runs JS to determine what to render step four client fetches additional data JS or whatever else it needs to complete render five your page is rendered so in the case of lazy loading what happens here step one we get the empty HTML with the JavaScript step two we load the JavaScript we load a small bundle of just the things that are above lazy loads that the root JavaScript the client runs that JavaScript including running this check in some heavy component if you're not signed in then we render this if you are signed in we return fake lazy so here's where things get problematic because now there's a break here where I now have to specify 4.1 load lazy JS 4.2 run lazy JS 4.3 hope it doesn't depend on more lazy JS 4.4 realize it does load even more js on and on and on until eventually you have everything you need to to finish your page render because of this what you'll usually end up doing is putting a suspense around it with a loading state so as we wait for all of that additional JavaScript to come in we have a fallback equals div loading for the import suspense so now we get significantly more back and forth between the server and client we have to have an additional loading state to wrap the thing being loaded in lazily or it's going to block render entirely and we have to fetch all of this additional Java script and pars it just to put a thing there with server components you don't have to do any of this let's redraw this with server components now step one server gets request runs react code to generate HTML client renders HTML with correct content fetches JS to hydrate three before we had a whole bunch of steps when we broke out a lazy loaded thing with loading States and all these other p pie in order to make sure we're not sending a bunch of JavaScript to the client that they don't need now if they don't need the client JavaScript they just don't get it we just render the right thing on the server and just send the correct markup if you only need the JavaScript to render the right markup that doesn't happen anymore we don't have JavaScript that includes 500 svgs in it we just include the svgs in the HTML it's really cool for most projects it's fine if it takes a few seconds for react to hydrate yes and again to the point I was making before if we're waiting the few seconds for react to hydrate that time where we're not seeing the SVG if we lazy loaded it anything that's under a lazy load doesn't appear until the project has hydrated that's a huge cost and if you're willing to block every asset in all of your pages sure but the point here is I didn't have to write any special code I wrote the obvious code when I did this for the upload thing code base we took all of our svgs we put them in a file we added a function on the bottom that randomly selects one and a color based on the name of your um project like this doesn't get included in the bundle because it doesn't need to it's really nice but here's something I find really cool we no longer have to make the same compromise in terms of features versus bundle size yeah you just you don't think about this it's a server rendered component you don't have to worry about these things you just render it on the server prism is a fantastic example prism is a massive library and if you're using this in pre- react server component land on like nextjs you're going to end up in a slightly rough spot where you have to wait for all of prism to load on every page even if you lazy load it you still have to wait for it to load on pages that use it in order for the hydration to be completed proper syntax highlighting library with support for all popular languages would be several megabytes far too large to Tak ajs bundle in order to make this work we to trim out languages and features that aren't Mission critical or critical oh that's really cool somebody made a new code syntax highlighter just for this I'm sold this is the sort of thing that gets me excited about serving compon yeah absolutely something we're excited for in the future with upload thing is the ability to get all of the traits of an upload so like what types of files does it allow how big of files does it allow all baked in in that first server render so your upload button appears immediately with the correct expectations and behaviors all data that it fetches from the server based on your API keys this is all stuff that's entirely doable using these new models this is a really cool Library it's one of my favorite examples so far of like why this model is so powerful because you don't have to worry about how big the serers side bundle is you just render it on the server it's not about performance in uxi after working with RSS for a while I've come to really appreciate how easy breezy server components are Yep this is the thing I think people Miss we do have more things in the new model this is the problem space of a react application I'm going to call this use effect we'll say this is context a much smaller one here and I'll call this one use State and other simple hooks so this is obviously not all of the complexity of react there's a lot of other things you have to be considered of so let's say horizontal is complexity to understand and vertical is complexity to debug I'll even call this like foot gun iness with core react features how hard is it to understand the thing and how much can it foot gun you this is with the old react model the foot gun index yes I think this is where people get frustrated on one hand all of these things still exist but we're going to say Asing components as like the first piece these are still complex to understand if you're used to the old model but they're not too complex to understand but where things get really magical is how hard they are to debug and how foot gunny they are there's still the foot gun that if you render them on client it can do some weird but generally the foot gunness is significantly lower but we don't just have Asing components we also now have to deal with the concept of a server component as a whole and server components again like take a bit to understand I'd say about as long as took me to understand the basic hooks like you state the foot gunness on this is even lower I you can do client component which will be like the same but slightly bigger because this is the thing that we're used to but the the use of the word client and the breakdown of the relationship there is not the most intuitive thing passing rsc's to client components this I'd say like it's complex to understand but there really isn't too much foot gunness with it so what's happened here is we have spread out horizontally to the point where we have slightly more things to understand but there is so much less foot gunness now this is the the difference I really have been trying to highlight is the likelihood you blow your foot off with the new model is significantly lower and even if the amount of complexity you have to understand to jive with this model is higher you can compose these pieces in a way that ends up being less complex almost always because chances are you're not touching all four of these things in a given feature if I'm adding a new component that renders user data I'm probably just using these two and then if I want to have a button that has an onclick behavior that requires me understand some of this but probably not even all of it and I probably don't need to touch this part at all the result is that for most features most changes most of the work that you're doing with this model the amount of complexity you're facing every day and more importantly the complexity of debugging and identifying and fixing issues is exponentially smaller and that's why this model is so cool once it clicks because things are so much easier to reason about yes there are more parts and people don't like when this horizontal gets longer because it makes them feel left out it makes them feel like have to work harder to be where they were yesterday and people don't like when the bar gets raised without their permission especially if they don't see the benefit but they're so focused on this horizontal complexity of just the number of things they have to know that they're forgetting about the vertical complexity of how much it sucks when the thing doesn't do what it's supposed to this is the magic of the new model I'm pretty much entirely agreeing with Josh it's that about performance in ux along with yep ultimately so very early days only emerged from beta a couple months ago so really excited to see how things evolve over the next couple years Community continues to innovate Solutions like bright take advantage of the new paradigm Etc this is what I was waiting for this is when the new model gets way cooler if we go back to the lazy stuff from earlier this kind of is like this is a replacement for the lazy loading patterns that is comically more performant because we don't have to do multiple trips to the server to get data so we get the first paint as soon as we send something so we can render the shell send that and then start the query after sending it how can we do that we already sent this don't we have to do a new request no HTML streaming comes in clutch here get into that in a bit it's beyond the scope of the tutorial but you can learn more about the stuff on his GitHub oh he doesn't actually show it in here so here is the diagram Josh Drew and we're going to make it a lot worse first we're going to do the lazy loading model so here server sends HTML and client renders HTML fetches JS and this part can be an unknown amount of time depending on how fast their Network in their devices and then after we've done that we have to parse the JS run JS DET turn DET what else is needed and let's say at this point we determine that we need one more JS file and one more API call that then requires another JS file so let's say we'll just do the lazy load then API we determined we need another file so go to the server again return lazy JS file and there's some time between these cuz there's Network time and then run query determine what else is needed and we realize we actually need to make an API call we do this API call just actual work that has to be done and the server respond to API call with data which might take a bit or we'll even we'll we'll do a query here so par request and then we have a separate like database query step we'll make it blue just using blue as work DB query and then parse response render correct HTML this is an example with a waterfall if you're not familiar with the term waterfall means something that takes time triggers completes and then something else that takes time triggers from the completion so in this case we ran the js on the client once it fetched we realized that it mounts a component that needs more JS that's lazy loaded so we get that lazy loaded JS it comes in we realize that we actually need to make an API call using that JS so we make the API call we parse the request we get the DB query run we get our response and then we send that to the client which then has to parse it and then render the correct HTML using react so the code for this would be pretty simple that's some component does a query fetches some stuff I forgot a string close there and we return div data. we don't want to load all the JS for this so instead we grab it lazily so the page loads it renders lazy some component which then triggers the JS fetch so the HTML was sent to the user it has nothing but a JavaScript tag in it so we load the JavaScript tag which has this in it we run the JS we determine that we need to lazily load this so we go to the server say hey we need this additional file the server sends us that additional file we now have this JavaScript to run so we run it we realize that it's missing this data because of this use Query call so we run that fetch call after we loaded that additional Javascript file and then we return the HTML then but we have to wait for the server to parse our request run that query and then send the response so I don't think that's ideal let's look at the new model quick this is where streaming comes in first off this determine what else is needed that's not a thing anymore most of that doesn't exist anymore the return lazy file doesn't exist the par request doesn't exist I mean I guess it kind of does CU it might be data from the cookie so let's say we immediately respond with some static HTML or whatever our like top level is and then we stream in additional stuff after we can identify user here that's just JS I should say renders HTML skeleton and it we'll say send HTML skeleton here and while that happens this is all happening in the background as the user renders this content and then when this query is complete we even say it takes longer than it does it will then stream down the additional data is part of the same request that is render complete page so we get that skeleton almost immediately the same way we did before after sending that response we can keep running these things in that same server node in the background and once that's done we send a new response with the additional data it's so much easier to manage I can show what this looks like if you're curious it's actually pretty easy to do instead of counter let's render some slow component so we have some server component we're going to change this or I'll just export async function some low component perfect if I mount this component and pretend again that this promise is something that work that your server is doing it's a query that you're doing it's data you're fetching it's something meaningful I'm just doing this cuz I'm lazy and we go in here and we render this in fact we can even leave some server component here so we render that and then we render the slow component if we go my Local Host what you'll see is the page is taking 5 Seconds to load but it has all of the data in it immediately but what if I wanted the user to get get Hello World from a file before they got the slow component what if I wanted you to get this first have a loading state for this and then this comes in that is now trivial because we can use suspense for much cooler things than lazy loading I can yoink this fall back equals div doing work and now the page loads immediately I refresh page loads instantaneously you can see the loading spinner still going because the main HTML response is still streaming down but we have content rendered that's meaningful and if we look at the network tab so you can see that response initially has different content that it ends up with because with HTTP streaming we're able to send part of the response and then send the rest later this means if you have a bunch of react components on your app most of which load very quickly but you have one that you notice the data takes a while you just wrap that in suspense and you're done this was never this easy to structure before where the Thing You Do by default is really simple and works really well and as soon as you notice something is slow you wrap it in suspense and you're done it's so clean and simple and easy to work around and the result is significantly more performant because you're not waiting and doing a bunch more back and forths I saw the question coming up a few times isn't this more work for the server though no it's absolutely not because previously I'd respond from a server to send the HTML the client would run some stuff it would go back to the server and say hey I need more JavaScript the server would process that request and respond with more JavaScript then the client would run that JavaScript realiz he needs to make an API call and go back to the Ser say hey I'm sorry last time I promise just give me my Json the server processes your request again generates a new response and then sends that new response and then now the client has the response with this model you process one request you don't parse additional headers you don't need to you don't terminate more responses than you need to you don't spin up more lambdas than you need to this is a DB call too and if we assume that these DB queries are the same size which like let's be fair the one for the API is probably bigger because it's over fetching do you see how much less work has to be done on the server then has to be done here yes any one of these blocks is smaller than the block here but we're not talking about the number of blocks we're talking about how much work is done total and if you look all of these certainly add up to be a lot more than the one request response process here the only reason this would be slower is if for some reason HTTP streaming was significantly slower which it isn't or the code that turns your Json into HTML is particularly slower compute heavy which it isn't doing one pass with something like react to take a bunch of data and turn that into HTML is really fast those aren't real costs yeah I just I I don't buy the argument that this is more expensive it just it isn't you end up making so many fewer API calls that this ends up being significantly cheaper and I can promise you as someone who's built apps on both the amount of time of compute that each of these is using per user way less server comput is running on the new model almost always for me I think this makes it very clear how much better the new model is I should draw some arrows to make it clear that that response becomes the content but specifically the server can send a response keep doing work and then send more response later and all you have to do as a Dev to consume that is wrap the slow thing in suspense this doesn't change when this code runs the slow component still runs as soon as the page load starts so it's just better that ended up being a lot more than I expected but I think it communicates a lot of the stuff I've been trying to server components are a fantastic model and I think if you take the time to dive in and understand you'll be really impressed with what you can do with them thank you Josh for the wonderful article thank you agore for recommending it to me on stream and if you want to learn more about why I love this so much I'll pin a bunch of videos on the side here all about my favorite Parts about server components and some of the cool things they change about my thinking thank you guys as always really appreciate it peace nerds ## React Wasn't Built For The Web - 20230927 react has quickly become the most popular framework on the web there's no disputing its dominance there while other Frameworks from the past present and future are all doing pretty well react is the default what if I told you the web isn't actually what react was built for in fact the react package that you install to start your projects has no web code in it at all what the hell am I talking about let's dive in it's important to understand as you get deeper into react that react itself isn't the thing that renders your application in the web react is the virtual Dom layer the hierarchy of components in state that tells something else what to render the vast majority of the time somebody's using react they're using it with a package called react Dom which allows the virtual Dom that react manages to tell the real Dom what to render when to render it and when to change it when it needs to change but react Dom is just one of many different packages that react can render to and while react native allows you to render to a lot of places like Android iOS different video game consoles Windows and Mac I think you guys are going to enjoy a lot of these different use cases for react especially the ones at the end and while many have web theming with them very few of them are actually focused on the web itself so let's take a look at some of these fun places I've seen people use react that aren't the browser remotion is a super exciting project using react to make video I haven't had a chance to play with this as much as I'm hoping to and I might even make a video in the future all about remotion let me know in the comments if that's an interesting idea for you the value of remotion is you can use reusable react components as elements in a video so in this example you can have an image that scales itself over time as part of your video you can use the Frame data you can use they interpolation helpers and now when you run the code for this project it will generate a video that scales the image over time and it exports a real MP4 it's not like this is a thing that renders in your browser and you have to like screen capture it or some stuff it's actually using FMP and other tools under the hood to render out an actual video file react is just the method of defining and composing the elements within your video they also now have like a paid license and a proper video editor you can also just npm in it video it build really cool things using this technology today it's surreal to use your knowledge as a react developer to build a video but it works really well especially for things like animations and movement behaviors within a video I'm actually hoping to try this soon to add some nice animations and effects to some of my videos so I'll be sure to report back once I do that this is just one of the many crazy examples of things people have used react for another one that I've been talking about recently is react email this is a little closer to traditional react because it's still rendering HTML in the but the difference between real HTML and email HTML is if you don't already know about it I envy you HTML for emails is miserable it is really bad and with react email an abstraction has been made to simplify the annoying parts of email templating in HTML and a bunch of components have been provided the same way you would use something like material UI instead you use their HTML component their button component all of these other things and they even have a huge pile of examples where they remade common email UI using using react email so here's the famous versel invite user super simple join the team page and here's the source code they use to make it it's actually pretty readable as a react Dev you import all of their components because again this isn't rendering HTML you can't just use a div or a span you use their components but their components all build the right HTML underneath and this allows you to trivially write something that's way more readable even using Tailwind some amount of Tailwind it's interesting how that all works regardless this feels just like writing a react app but now an actual email comes out instead of the HTML chaos that we used to have to deal with I have been blown away with react email and we are absolutely going to be using it for pretty much every email we send going forward and the people who made react email just started a company resend that I was so hyped about I actually invested in them so I yes am biased because I'm invested but I made the investment because I'm that hyped on what they're doing and it's so cool seeing react developers using the strengths of react the framework not react the rendering library to make hard problems easier to solve I'm genuinely hyped for these guys I love what they're doing they have some cool stuff coming in the future so what else do we have this one people have some mixed feelings about but I think it's a really really important package react PDF sometimes you just need a PDF and programmatically generating one it's not the most fun thing I personally spent a lot of time using latch in college CU it was fun making those fancy overly margined well-formatted research looking documents but sometimes you just need to make an invoice or update some values inside of a document that can be saved and printed trivially I would often find myself making an HTML page and printing that as a PDF in order to do work like this but that doesn't use any of the Native PDF features interactions at all react PDF is a solution to use react and again you import from their components and their rendering solution but now you can create a PDF using react components that's so powerful you can make reusable pieces structure them and do the things you need to do as a document writer and you could even use this to build like your own DIY alternative to something like latc or even something like Adobe in design I haven't played with this too much I know my CTO has and he has very mixed feelings but at the same time there's nothing as accessible in the web ecosystem as this for generating PDFs programmatically I think this library is awesome I'm really pumped that it exists and it's cool to see developers using react for things that aren't just the dumb react is good for all sorts of different interfaces not just ones that you use on the web one fun example of this is react for CIS specifically the package Inc lets you make react components as interactive elements for a CLI application so obviously yes you have to run a C app with JavaScript but you can use the knowledge and State Management Solutions you're used to in the react ecosystem to help manage the behaviors in your CLI from my experience this is a really good solution for simple CLI applications once you get into more complex behaviors and longer running things might not be the best solution but it's so cool it exists and it makes it really easy for a react developer to start building a CLI tool quicker than you'd ever expect one more similarly fun one where text input and output is the primary use case is reord by Maple I'll be sure that we put a link somewhere for this the deal drr of this is it lets a react developer create elements inside of Discord for doing reactions to messages and such it's a basic interface for creating reusable Parts in a Discord bot and if we look at the examples here you can create a component like this uptime component and client. on ready re accord. send to this channel ID this component so damn cool I yeah I've had to do crazy stuff to get messages working within Discord and having a consistent reliable syntax that where I can use react to define the stuff is dope if I already have a nextjs application for example where we're using react and we have to send a message to Discord on an action on our server being able to Define that as a component and just render it with reord on our server and send that to Discord that's so powerful and I'm genuinely hyped to see more and more solutions like this cropping up because people recognize the strength of react is more than just a solution for the browser we're going to dive now into my favorite Corner which is the poy Manders crew po Manders is well known for creating zustand and Jodi both of which I'm pronouncing incorrectly as well as probably po Manders honestly Paul henel and Dai are two of the best react developers in in the world let's be real and they have both been pushing the possibilities of react for a long time a big part of why both zust stand and Jodi were made was to make simple modular performant State solutions for updating things inside and outside of react and a big part of the inspiration to build those came from a library that Paul henell and crew have been working on for a while react 3 fiber if you're not already familiar with react 3 fiber might be helpful to start with 3js the goal of 3js was to make webgl more accessible in JavaScript Land by giving you direct direct access to The Primitives lighting behaviors and all the cool things you can do in webgl it's far from a game engine it's very very primitive by Design but what it allows is for full-on webg control from JavaScript land with decent Primitives for things like animations audio embedding cameras and Camera behaviors Shadows lighting a lot of the Annoying Primitives to implement and 3GS has done a great job of implementing them but if you're not already a 3D or game engineer learning 3js well enough to take advantage of all of these pieces can be to be frank a challenge and once you get into reusing pieces State Management within a 3js application and all of that you're basically relearning how to program if you're not coming from this Game Dev World already if you are 3D is a phenomenal solution but if you're coming from react and you want to play with 3D stuff like 3js it's really hard to beat react 3 fiber instead of rendering to the Dom like react traditionally would react 3 fiber renders to 3js which renders to a webgl canvas so you're able to create 3D assets elements behaviors lighting whatever you need in components which I think is so cool I have a whole video about 3js already I'll be sure to link that in the description but the simple example here has a box component which is a reusable box element has a ref it has State all in it it has use frame which is one of their custom hooks for doing updates without having to trigger react itself and then it returns a mesh with all of these properties and now if I click it's going to do the things that the UST state says it should and if we scroll down here we see the actual app which has a canvas which is the parent element that renders all of this and then all of the these different elements including two of this custom box component and if I wanted more of these I can just copy paste I can put it somewhere else we'll put it at like 2.4 it's going to be even further to the side now we see that extra box over there it's just react I think this is the coolest ever and if you're already a react developer you probably can read this code and roughly understand what's going on which is awesome because now react is being used as a lens and as a framing for some other more complex thing in this case 3D rendering the strength of something like react when it comes to building these Solutions is that a developer who really well knows the platform being rendered to can take the best parts build good Primitives around them and then expose those in react so you have to deal with all the weird parts around it you just use the component they provide and it does what it's supposed to and that's exactly what we see inside of react free fiber and with the cool stuff people are doing with it the funny example that I said I would save to the end here is another Library by our friends at panders called react nil of the things we talked about today this is going to be the least production ready I don't think it's meant to be used in production at all has it been touched for over a year this was mostly an experiment by Paul Paul made this because he really enjoyed the power of react State Management in terms of composable architecture having something like an effect or a memo that triggers when certain things occur is valuable outside of UI programming and he wanted to see what it would look like using react's life cycle to manage code on a server so the goal here with react nil was to give you a package that lets you render null in react so you can just use it as a backend you can use it as a state management solution in an app that isn't react act you can use it as a serers side solution for managing things like websockets or just backend API calls and it's pretty dang cool I've never actually played with this I just think it's a cool concept but the idea of just not rendering anything at all in react so that you can still run the life cycles and run the code and use the react model that you may be familiar with without having a UI come out the other side at all I want to emphasize I don't think you should use this I think it's a really cool demonstration of just how well abstracted react is from the rendering engine itself and this is why something like react native happened in the first place this is a fun fact a lot of people don't know the Twitter web app is written with react native for web in fact the Twitter web app is the first ever use case of react data for web because it was built for Twitter the team leading the rewrite was concerned that giving the devs access to everything the browser could do every element in every behavior in order to prevent developers from using the parts they didn't think they should use in order to guarantee consistency across their web app in their solution they built react native for web to use react and react native as the custom layer making sure only certain things could be rendered in certain ways if the component wasn't provided through react native and the react native for web binding couldn't be used because the devs weren't using react Dom they weren't just rendering Dom elements they were using this abstraction that was custom made for Twitter's use case and this solution eventually became react native for web I know that seems like three layers when previously it seemed like one reality is it was already two layers it's just react Dom the in between of your Dom and react gave you full access to everything in the Dom and these other Solutions like react native for web pick a subset of what the Dom has to expose to you I'm sure sure a handful of y'all already knew about this abstraction but many don't and I think it's important to understand that react Dom is not react and there's a difference between these parts that doesn't mean you shouldn't use react with react on most of the time it just means that you should understand the difference there because it might help you appreciate the power of these other tools top of that everything I showed today is pretty damn cool and I think is worth playing with in your own time if you haven't already so what do you think have you had the time to play with react 3 fiber react email yet how does it feel using react outside of the Dom I'm so curious about all the crazy things y'all have used react for and I'd love to hear more about it and maybe just maybe I'll get to talk about react on Playstation someday thank you guys as always if you want to hear all about react 3 fiber specifically I'll pin a video about that in the corner here really appreciate y'all as always peace NS ## React and TypeScript Stopped Fighting___ - 20230420 react server components are coming in hot but sadly using them kind of sucks if you're a typescript Dev because all of the typescript benefits with mounting and rendering components of even just basic things like checking the types of your props hasn't worked now for over eight months because these fixes have taken so long a lot of the code I'm writing right now isn't type safe and I am in constant pain seeing dumb errors that a red squiggly line could have saved which is crazy to think that just mounting a component in the new react model isn't typesafe it's scary and it sucks but that just got fixed with the newest typescript beta and I cannot wait for 5.1 to drop because of the stuff they're changing with jsx so first I want to show off the problem let's say we have this random Asic component using the new react model it's not doing anything in async but we're just going to go along with it okay still is technically async but it's not doing anything that's blocking so let's go render this I'm going to delete all the junk in here because we don't need it for this example we're gonna drop this guy in here we're getting a type error what's going on if we hover this you'll see with our new favorite plugin some async component cannot be used as a jsx element it's return type promise element is not a valid jsx element but it is jsx is just a way to call functions and react is chosen to allow it to call async functions this type is incorrect react can do this and can handle this so as such the current expectation on how we deal with this is to tell typescript to expect an error and this sucks this is really bad and you'll see across pretty much every server component code base that's using typescript a bunch of these types of things which cool great solves the problem right it gets worse let's go back in here and give this component some props we'll say this has message string see where this problem gets bad so when we go back here nothing because we're telling typescript to expect an error so not passing the prop that it needs the message prop is erroring quietly and we don't see it so we just forgot to put a prop here and this code breaks now or let's say we gave it something wrong like message equals seven and we wanted to have dot length here so now I'm passing a string here as far as this component is concerned and we go here we're passing it something that is not that type it thinks messages string but we're passing it seven it is not erroring because we told it to expect an error this just breaks typescript in the react experience and now when I hide that we get the two errors we see this numbers outside about the string cool we can fix that but that doesn't fix this which sucks it sucks really hard and I I have been annoyed for a long time now this is the case so what happened what changed well if we take a look at the release notes for the typescript 5.1 beta and more importantly this particular PR the new jsx element type for Valor jsx elements the specific goal of this PR was to make it so that Frameworks using jsx like react can redefine the jsx element type in order to expect something else so rather than just expecting additional jsx elements you can expect a string a number a promise or any of these other cool things that a framework like react might expect you to return in jsx and the result is dope because now we have way more cool things we can do with react I think they talk about it a bit more here yeah the j6 elements and jsx tags so specifically the jsex element which is the brackets and the way of calling a thing is typed separately from the inside piece that it returns which allows us to expect different jsx element types in a jsx element so weird separation it's not something that we as the developers consuming jsx should expect to understand or care about but it is the details that allowed for this change to happen and the end result is that we can now use better type definitions in react so if we come back to this file after Maple's changes we'll see that we are getting an error what's going on there oh that one's familiar property subscribed to Theo is missing in type message string well we'll have to fix that maybe if y'all had subscribed we wouldn't still be getting these type errors get on that helps us out a ton subscriptions are free hit that button anyways now we have all of the things we expect when we create and use components even though this component is async I'm able to have properties I'm able to make changes here I can change message to content and immediately get a type error over here and here all the the things you expect from typescript fixed with one simple pile of hacks for now and again you won't need this in the near future it is here now if you want it though and I'll probably be throwing this in all my code bases for the next few weeks because I need this anyways I couldn't be more hyped it's so cool to finally have async components and all the cool things that come with them like suspense the ability to render different UI here when this async component is going and now this thing will load and Stream in the response while showing the loading State whatever component or text I put here and I have type safety the whole way through as far as I know this is the first time ever we have had a fully type safe streamed data to client solution with markup and fetching and everything else we expect in the same code base with inferred type safety from one side to the other the result is magical it is so nice working with these tools to build and my one remaining gripe the type safety has now been resolved from here on we just have some more features to add things like pagination server actions and a bit more fun stuff coming soon but this is one of the biggest blockers for me in pushing server components harder and I am certainly going to be using them more after these changes I hope this video was helpful if you want to learn more about how important server components are I have a video about it right there I think it's a really good one you don't need to write apis anymore so give that a shot if you haven't thank you guys as always peace nerds ## React isn't PHP (and that's a good thing) - 20241120 react on the server is not PHP as soon as I was linked to this one I knew I had to cover it we always talk about how react is just PHP now or PHP did it right and we're copying it from there and all these things with the new server component stuff and while there is a lot of really interesting things that react is learning or copying however you want to frame it from the PHP world there's a lot of things it does very differently and it's important to acknowledge both as we have these conversations are server components going back in time some amount yes are they meaningful advancement on how we used to do things that learned lessons from how we do them now also yes this seems really exciting and I hope this article goes into all these details before we can read it quick word from today's sponsor notice this on my shirt might heard it before tan stack it's the way you should probably be fetching data in your react apps if you're not go fix that when you're back you might want to know where you get that data from obviously if you already have a backend cool good for you but for those who don't convex is here to solve all your problems if you're not already familiar convex is the only decision you need to make for your backend everything from file storage to off to your data database and most importantly Live Sync you might think it's going to be complex but I want to show you how simple the code is this is an actual chat interface that you can go generate using their CLI and it's very simple here's all of the logic we have use Query API messages list use mutation API messages send and then a handle submit when you hit the submit button and if we take a quick look at this what's good immediately appears in both tabs what what there's no custom sync code no setting up websockets none of that nope when you're ready to set up the data all you have to do if you want to see where this comes from you can just command click and here is the backend query that you wrote you write the backend code in a convex folder in your codebase they deploy it they handle the database they handle everything and the code can be really simple like this we're just grabbing the most recent 100 messages or we're cre creating a new message if you've used trpc this might look familiar you know yeah it's like trpc but for your whole back end already built for you really exciting stuff you haven't tried it already go give him a shot today tell them theoa soy dev. l/c convex if server side JavaScript just PHP all over again not so fast dive into the evolution of web development from PHP to Modern fullstack JS Frameworks discover why it isn't a step backwards but a Leap Forward in building powerful and efficient web applications today today I wanted to talk about a topic that's been buzzing around Twitter in Dev circles lately you've probably heard people say now that we're serers side rendering JS it's just PHP all over again well buckle up because I'm about to explain why that's not quite the case and why it's actually pretty darn exciting remember when Internet Explorer was still a thing I know I'm aging myself I most of us probably remember iie I would hope we're we're young but we're not we're not that young we're all writing PHP to our heart's content and life seemed simpler here's the twist we weren't building complex ambitious apps that we are today we were solving smaller problems and that's what people often miss when they get nostalgic I'm gon to love this article okay okay I am so happy they said this and they put it this clearly because when I say this people get mad at me but it is correct the things we build today are significantly more complex than the bulletin boards we were posting on in the 90s and early 2000s and to pretend that things were easier because the tools were better is to fundamentally miss the fact that the things we're building are more complex are there more websites that are static than there are really Dynamic on the web absolutely but the devs that are working on these things every day the majority of devs who are being paid full-time salaries are working on things that are more complex than a static blog from the early 2000s so the people who are working getting jobs and spending their time and money on these things are using these modern tools so much because they make their lives so much easier in these big companies that employ thousands of people aren't building basic crud apps that PHP handled well a lot of the time sometimes they are and it's valuable for these tools to exist especially for things like internal dashboards and whatnot huge for all of that stuff but these complex Dynamic apps are a very different use case but that doesn't mean we can't benefit from things on the server too and finding the balance is really important but in order to find the balance we have to acknowledge that today's problems are often harder than what the previous Technologies were built to solve if you need proof of that watch my video where I tear apart the hey.com calendar the rails one cuz it was oh God it was so bad great example of how old Tech doesn't solve these problems well I will say before we go further laravel is a huge exception here because they have things like inertia deeply baked in so you can use the best parts of client side JavaScript and the serers side PHP ecosystem to bridge the gap meaningfully but the Gap exists they're just building bridges over it and server components are another type of bridge here somebody in chat just said that they started working in a 15-year-old rails code base recently and they're really missing modern tools someone who's playing with rails a lot the last few days it's bad it's actually insane anyways back in the day we'd use server side langues like PHP or Java or if you were really living on the edge Pearl we'd follow the MVC model popularized by Frameworks like rails or code igniter our controllers would fetch data from the database pass it to a view and voila you would render the page I will say it's not quite that simple when you call the like generator function in rails to make a new model or add changes literally saw it add like 15 files for one model creation which is insane yeah when you visited a URL you'd get a bunch of HTML the browser would render it and everything was hunky dory what about interactivity well that's where JavaScript came into play we'd use it to enhance the existing elements rendered on the server remember unobtrusive JavaScript it was all about making the UI work with Native browser Primitives and then sprinkle some js magic in on top looking back I think it might have been an excuse to avoid writing too much Js yes and honestly who could blame us especially then JS was garbage my experience with early JS was a bit of a mixed bag jQuery made it easy to add functionality but the language much like PHP wasn't pleasant to work with before es6 it was pretty terrible to work with raise your hand if you remember ve self two equals the oh God that that just that that aged me that comment if that hurt you as much as it hurt me cuz I I'm in pain and don't even get me started on browser compatibility we tried our best to write as little JS as possible using it in places where it was absolutely necessary but here's the thing we wanted to build more stuff more impressive apps we need better functions for our users and as our apps got more and more ambitious we couldn't escape JS it's the language of the web after all as we built larger and more complex apps in the browser we started running into some serious headaches for starters creating your UI on the server and then editing it at runtime with JS was like trying to Pat your head head and rub your belly simultaneously possible but not exactly graceful especially if sometimes when you're patting your head and rubbing your belly one of those things disappears magically for no reason like imagine you're patting your head and then your head goes undefined or your summit goes Nan reality man imagine having a blog post like this one with a comment system you would Loop over all the comments in your template and create the HTML structure on the server what happens when the user posts a new comment you need to create a Dom element in the browser you'd either have to recreate the comment structure with the same tags and classes in Js hello Payton is Nightmare yeah this is hellish I've seen this so often where you're recreating the server like layout on the client and hoping it all works and then you miss one CSS class or you don't Define the HTML structure just right and it all falls apart the other solution is you would create a hidden template element and clone it and populate the right divs with the correct data and hopefully no one's changed the class name in the template it was not ideal to say the absolute least yeah this if you haven't dealt with this hell then you better not talk about modern JavaScript because you don't know how bad it was and how much better these things are like do not talk on react until you understand how bad things were before we also realized that using imperative code for building UI was as fun as trying to h cats hurting cats can be fun to be fair it's a lot of work and not particularly viable but running around as a bunch of cats is fun we wanted our uis to be declarative and based on state we wanted reusable components that way we could always render the UI correctly without worrying about things getting out of sync so we moved everything to the client single page applications became all the rage and we had Rich interactivity at our fingertips it was amazing until it wasn't we can now build amazing uis and user experiences but that came with a new set of challenges first off we had to reinvent navigation no more go to URL HTML returns now we need to have routing Frameworks to handle page loads and transitions we gained superpowers with this like keeping State between pages but with great power comes great responsibility I've lost count of how many links I've seen in spas that are just buttons with click handlers yeah yeah I don't blame JavaScript to react for that I blame people for being dumb but it does suck that there's so many buttons that are being used as links nowadays now we're loading our data from our API so we can show and modify data with ease we have to figure out how to deal with loading States in waterfalls then came the performance when your entire app lives on the client it's now up to your device to cre the whole UI it's not exactly speedy and having the server render an empty div in a script tag for each page isn't great for SEO either I've talked about this so much I don't want to like beat it in more but when I was at twitch we had to build a separate service to on a Kon regenerate the HTML for every person's stream page so that we could have the right metadata when you shared it on social media and when you indexed it on Google because the whole app was rendered with JavaScript so you have a separate go service just trying to embed the right metadata in the HTML and it was usually out of date because it would cash it so long and then update it on Aon the fact that we had to invent our own service just to make sure the right metadata existed in the HTML is horrifying and nextjs was invented to solve those types of problems however perhaps the biggest drawback was how it solidified The Divide between front end and backend developers oo hot take that I absolutely agree with Spas drew a hard line between these two and people became less flexible and now with server components and the new nextjs stuff they're being asked to bridge the gap again and it's people have been so used to it for so long now that they're uncomfortable with it back in the day we were all just web developers sure you might have preferred centering divs to writing database queries but working across the stack was common this division created communication barriers and I believe led to worse products overall after all how can you create a unified experience when your teams are not unified absolutely agree with this I've this is part of why I push the full stack way of building as hard as I do it shouldn't be hard to hop between these things and to do the right thing for what you're trying to build doesn't mean you shouldn't have Specialties it doesn't mean every JS Dev needs to be a SQL expert it means you should know how your applications work well enough from Back to Front to meaningfully improve them for your users this actually a really cute little graphic I love the art in this huge shout out to Christopher for writing this and making this so good this is my favorite blog post I've read this year I'm loving this now here's where it gets exciting we're not going back to PHP we're moving forward with full stack Frameworks like next remix and spelt kit and solid start and tan stack start there's a lot of cool ones these Frameworks give us a unified stack with JS all the way we can handle routing and data loading on the server we can build our uis using state-of-the-art declarative components and create amazing user experiences using the Best of Both Worlds I know what you're thinking aren't server components with SQL queries just like the old PHP code we all hated what happened to the separation of concerns well not quite sure at first glance it might look like the crazy PHP code where we would mix SQL HTML and CSS stick it index PHP and call it a day but here's the difference we've developed solid principles for building uis and now we have a unified language and toolkit to create great user experiences utilizing both what the server is good at and what the browser excels at really like this framing here the fact that the pieces can be reused where you can have a component that is rendered exactly the same on the client and the server the server can trigger updates the client can fetch new data to update itself that you can write the same Syntax for the server code and the client code and Bridge and meld them together in this way is very different from PHP where you would have to defer to jQuery and clone templates to do client site updates the fact the client in the server code are written with the same Primitives and can be shared and interrupted in such a powerful way makes this a fundamentally different better way of building we're not going backward we're taking all the lessons we've learned and created something even better it's like we've taken the best parts of our PHP days and supercharged them with everything we love about modern JS we can now build really ambitious applications and Frameworks like NEX and remix allow us to utilize the server for more than just serializing Json it's sad to think that the average Network request nowadays is turning returning Json not HTML but it almost certainly is and these tools allow us to to do more which is really exciting speaking of exciting here's where it gets really exciting these full stack JS Frameworks are helping us close close the gap between front and and back and devs I will give the spicy additional take of this is part of why people are getting really frustrated right now there's a lot of devs who liked the fact that they could Fully live on front end and never think about servers anymore a lot of the bigger JavaScript side graphql Advocates loved it because it put a huge wall between them and the back end so they no longer to think about the server and I think a lot of the push back came from really influential people who were influential because they were really deep on this thing which was and Dev the spicy way of putting this is the people who we looked up to and listened to for good advice on frontend best practices the influencers who were leading the charge on education around react those people were the ones who were the most excited about it and the ones who were the most excited about it are inherently the ones who are the most likely to go all in on front end and ignore backend now that react is saying wait you should know a bit more about backend those devs feel betrayed because react allowed them to go all in on the front end side and stop thinking about the back end and they became influential because of their focus in on front end stuff and that's why we saw many influential people saying that they felt left behind by react it's cuz they fell behind because they were so obsessed with front end they stopped paying attention to back end at all and that's why it's hard for me to sympathize with those people because as much as I looked up to them I cared more about building the right thing for the user than I did about how my Js runs in the browser and even though those people know way more about CSS and browser performance optimization their inability to comprehend what a server is is and how it works means they are a much worse overall developer than the types of people who are hanging out here and that breaks my heart because those people should be able to level up and should be really excited but the opportunity to do more backend and Bridge this Gap but they like the Gap they don't want it to go away and they're mad they're being challenged to bridge this Gap and they are upset that people like me are showing up who hate the Gap and are trying to bridge it ourselves and we are finding success I honestly think a big reason why I am more popular than previous react influenc or whatever you want to call them is because I'm not just a react Andy in the browser I'm trying to build great things and talk about all of the parts and that is the future the future isn't somebody specializing in performance threads in the browser the future is people who can build real solutions to real problems but that's also why this push back got so visible at the time because a lot of the last generation of react influencers felt betrayed that they had to learn about servers again and I love Christopher for pointing out how big this Gap was and how this is being bridged so I can go on this tangent about why the sentiment was so bad anyways remember that artificial divide that we created well it's starting to crumble and that's a good thing depends on who you ask but absolutely that's a good thing with a unified language and tool set it's becoming easier for a single Dev to build an end to-end feature no more awkward handoffs between teams or Lost in Translation moments you can now handle everything from the DB query to UI interactions in one seamless flow it's like being a web dev superhero with powers on both sides of the stack I don't just think it's going to make Dev more efficient I think it's going to lead to more cohesive products after all when you understand both the server and the client side you can make smarter decisions about where to put logic and how to optimize for performance it's bringing us back to the OG full stack developer ideal with way cooler tools and without the spaghetti code Nightmares of the past so if you've been feeling pigeon hold as a front end or backend Dev now is your chance to break free and embrace the full spectrum of web development it's a fantastic time to be in our field you haven't doved modern JS Frameworks yet what are you waiting for today the day come a long way from nesting PHP and HTML and while it might look similar on the surface we're building on years of UI development principles and best practices I love this call out here an idea I've had for a video for a while now is Dev is getting better we always see people complaining about how things are going backwards and it's getting worse and everything's getting harder all the time if someone who's been coding for a while when I go back and look at my old code bases and compare it to now it's not just like oh I'm better at code it's holy the way I was building before was so miserable it's hard to put into words and now it's much much more pleasant and I don't think that gets enough credit and I want to start pushing it I think software is in one of the best states it's ever been despite all the AI tools despite JS framework of the week I think we're in a great place right now and I love this article for calling that out too I'll let him have the last word I'd love to hear your thoughts on all of this have you made the switch to fullstack JS are you still holding on to PHP for dear life please drop a comment below let's chat I loved this give Chris a follow check out his blog this is one my favorite posts I've read this year I'm not exaggerating at all that was awesome that thank you so much for writing that thank you all for sticking by let me know what you think and until next time peace nerds ## React just got WAY cooler - 20250425 It's been a bit since we heard from the React team in particular about new features and things they're building. That changed today with an update from React Labs. This is where they showcase all the cool experimental stuff they're working on. Most of it makes it into React. Some of it doesn't. What matters isn't whether or not it's going to make it. It's what they're working on and how relevant it is. If you're tired of the server component stuff, I get it. None of this is server components. This is really useful stuff for all React developers. from an overhaul of everything to do with animations and transitions. Oh, there's so much cool stuff there. To an IDE extension, yes, the React team is shipping an extension for VS Code now. So cool. They're shipping fast and there's a lot to cover here, but we're shipping, too. And I need to pay my team. So, a quick word from today's sponsor, then we're going to dive right in. Today's sponsor is a bit different because it's a company that sponsored me before. You've seen them, but it's also a product you might not have seen before because I bullied them into making it. Yes, really. I convinced Convex to make their own AI app builder and I'm so happy I did because it can do things I didn't think AI app builders could do at all. I have a whole dedicated video on if you want to check it out. But to just give you the highlights, here's a Slack clone that it built. This Slack clone has fully working off channels that you can create the way you would in traditional Slack test channel. Oh, I mistyped it. If I go here, I can send a message. I can create a second preview environment, sign in anonymously there, and see whenever I send a message, it automatically appears in the other preview. What's even cooler though, the database tab. We hop in here. I go to the messages. I can go to this hey message, change it to what's good. And just changing in the database updates it in the UI because you're still getting all the benefits of convex. The ability to automatically live sync whatever a change happens somewhere goes everywhere else. You can run real serverside code. You can set up O with literally three lines of code, add file upload, and all these other annoying things that normally take forever to do. It just does. So, how long did it take for me to get this built? Believe it or not, this was a oneshot. Yes, literally one prompt got it to generate all of this. No issues. It took a minute or so to build it. And it has a fully working back end and a deploy button that you can oneclick and ship this production ready app backend to front end. I'm not exaggerating when I say Chef is the only AI app builder I have ever used that actually understands backend and builds it in a way I would comfortably ship. Every other one of these tools is a mess of integrations and I usually use them to generate a nice front end and then exit and go build the backend myself. Holy hell, it is so cool to finally have a platform that I don't need to do the backend myself for. It does it right. And the reason it does it right is because Convex has one of the best backend as a service solutions for writing code and having it just work. So if you want to build an actual app with an AI app builder, Chef's the only one I can recommend. Check it out today at soyb.link/chef. I'm fighting the urge to skip to the extension. I'll understand if you fast forward to that part of the video, but there's a lot of important things we need to talk about here. As of today, the React experimental branch now has view transitions and activity. I've been waiting for this for so long. If you're not familiar with few transitions, it might be because you're on a Firefox-based browser and that means that they don't work in your browser. One of my favorite sites to showcase them is Nean's blog. Nean is an engineer that used to work at Meta. He's now at OpenAI. He built some crazy style stuff, specifically Stylex to power most of Meta's styling. His blog is an incredible showcase of view transitions if you're using a browser that isn't Firefox based like I am right now. So, let's hop over to a Chromebased browser. And now when I go to different pages, do you see the animation there? How the neon moved to the top? That wasn't some crazy JavaScript and CSS doing that. That was view transitions, a browser API where you can tell the browser, hey, this element might still exist on the next page. If it does, animate it on its way there. And now when I click the title for this blog post, did you see how cool that is? That is so awesome. The view transition is on navigation. If an element moves or changes, it lets you define the way the element moves and changes. And that's why this all looks so cool. And it's not particularly hard to do. If we go to my blog, I can show you what this looks like. So, I'll click a random post. And this is still has a nice fancy little animation. It doesn't move anything around because there isn't really anything for it to move around. But that animation was so simple to add. It's also worth noting that that site has zerojs on it. It's entirely Astro. I think it might have a tiny little like router in order to trigger some things, but the code for that hilariously simple. Blog index view transitions from Astro transitions. And if we find the view transitions component, it's just in the head because it's just mounting some JS. And then from there, all I have to do if I want to move something from one page to another is tag it to identify it. You can literally just add this CSS snippet and now the navigation between different routes on your app is going to feel significantly better. It's so cool. You can do crazy stuff with it. But it's not just for navigation. You can also trigger view transitions, update the DOM, and then the animations will happen, which works great for single page apps. Here's an example with cards that when you delete them, there's an animation for them to leave, which is one of the hardest things to do in the browser because when you remove something from the DOM, it's not there. You can't animate it anymore. But if it's a view transition, all of a sudden you can animate it. You can do things to it because the removal of the thing from the DOM is now an event that occurs that you could do things with. As long as you're not targeting Firefox, hopefully it catches up in the near future. React now supports view transitions, which I am so so hyped for. No more crazy chaotic libraries just to make something fade out when you click delete. To opt in to animating an element, wrap it in the new view transition component. The component lets you declaratively define what to animate when an animation is activated. You can define when to animate by using one of the three triggers for a view transition. You can call start transition, you can call deferred, or you can use suspense. And all of these things now will trigger transitions, which is so cool. By default, they're using the default CSS animations for view transitions, which is a smooth crossfade, but you can use the view transition pseudo selectors to define how the animation runs. So here we have view transition old star animation 300 fade out and then new fade in. When the DOM updates due to an animation trigger like start transition use deferred value or suspense fallback switching to content. React will now use declarative heruristics to automatically determine which view transitions should actually be activated for this animation. So it's using the DOM the virtual DOM specifically to see which things wrapped in which transitions changed between those states and triggers the animations for those at that point. What's cool with uh what's cool with a feature like this is I'm sure under the hood there is a ton of work and this is really complex to build into React this way, but when you work with it, it just feels like a native browser API cuz it is reacted to change a bunch of things to let it play that nice with the native browser APIs. But they did it and it works and it's great. Yep, there we go. See that nice fade? You click and the thing doesn't just switch. It doesn't just instantly go to the next content. it fades to the next page. And you did this by very simply wrapping view transition around the main body component. URL is slash then we do home. Otherwise, we're under details. That's it. That's the complexity of adding view transitions to your app. Wrap a thing in your VDOM that can transform and change and now it will transition between the elements. I am so excited to add this to T3 chat. You guys have no idea. I hate animations normally, but this is the right way to do it. There's a good call out here about where to place the view transitions. There's some complexity to it, similar to where to place suspense rappers, but this is much easier to figure out than suspense rappers cuz you'll see your app transitioning wrong if you navigate in a way where you put the view transition in the wrong place. Thankfully, there's a default none you can add to any given view transition so that you can customize it conditionally instead. Very good stuff to see. You can also set a given string name for the view transition and then target that through CSS. So good. And now with that change, the crossfade is slower. Yes, that takes a lot longer to run now because they added the animation CSS bumping it to 500. Can I change this? Can I change it to 50? You can. And that works. That's so cool. Is a little too low to see. I'm going to do 150. So you can get a little bit. I actually quite like that. It's subtle, but it makes the switch not as jarring. Honestly, on a video at 30 fps is going to be hard to see. The links in the description if you want to go play with all this. It's pretty cool. If it was just transitioning, the content of the page would be one thing, but where view transitions get really cool is shared elements. Similar to what we saw in Neman's blog, where the title moves somewhere else because the element is still there. It's just a different place on the page. And with view transitions, you can do this too. You give one a unique name. I don't love name for this. I think it's should be identifier or ID or something. So that's what this is. But now that we've established that this view transition is for something with this identifier, if the next view also has the same identifier, I'll just I'll show you the results because it's so cool. Watch what happens now when I click a video. Tell me that's not the coolest Do you know how annoying it was to write code to do this before? Do you know how annoying it was to have an element move when you navigate? Here is all the code you have to write for that. Now, we have the thumbnail component that has a view transition wrapping it with an identifier. We have video controls and video and video uses the thumbnail component. And we have the list view which also uses the same thumbnail component. Now the identifier is always the same. There's no custom JS being written. There is just a wrapper component with an ID. And that's all it takes to get awesome transitions like this in your apps now. It's so cool. And it handles like very different things too. Like here where the video is roughly the same height, it does the right thing and subtly expands to fill the space. But if you click one near the bottom, it moves up too, which is not easy to set up. I'm so happy with this. It looks so cool. By default, React will automatically generate a unique name for each element activated for a transition. When React sees a transition where a view transition with a name is removed and a new view transition with the same name is added, it'll activate a shared element transition. They even have causes for animations so that you can control the type of transition. So if you want a different transition for navigating forward or backwards, you can call the add transition type helper and then have different cases here. So with share on nav forward, we want to slide forward, but on back we want to slide back. Now we'll have different animations depending on which transition type we triggered. And then obviously we can go apply that with the view transition target in CSS. Old is for the state of things before the transition and new is for the state after. you can target a specific class of a share here with a given identifier like that. It's so simple and this is just in CSS. Like we're using actual browser standards to do all of this. And I'm so thankful that instead of the React team building some crazy new animation system, they leaned so heavily into browser standards instead. And now with that change, you can see the topnav slide to the left when we go to a thing and then slide to the right when we leave it. It's so cool. It's so cool. This is this easy. Now, as long as you're on a browser that supports them, like Safari or Chrome, but yeah, Firefox, get your together. Animating suspense boundaries. As they mentioned before, suspense will also activate view transitions, which is so cool. So, if you have a fallback for something before the content comes in, now you can animate it. You just wrap the suspense in a view transition. And now, when we do a thing like go to this We get that fancy animation with the placeholder and then the content. And it even stays rendered because of how suspense works. But look at that. Do you see how simple but nice that little animation is? And they have to put a lot of work into it either. There's CSS. You just add the new key frames and it works. It's so cool. It's so cool. I am really hyped about this stuff. You can also provide custom animations using an exit on the fallback and enter on the content. So here you can specify on exit you want it to slide down and on enter you want it to slide up. Write the CSS and now it will handle those two different cases. And if we once again play with the sandbox see the content slid up. So cool. And the exit is the fade goes down. like the weird fade gray out when we're waiting for the loading goes down and then the new content goes up to replace it. You can also use your transitions to animate lists of items as they reorder. So good. You just put a key in the same way you always do with a list in React. So let's type in third. Are you kidding? Are you kidding? I didn't even know about that. That's so cool. Like nothing special being written here. This isn't some crazy JS code to handle things being removed from the list. We just added a single view transition wrapper to the video component. And now as we filter using the deferred value helper here so that it can hook in at the right time. That's it. That's it. I finally am seeing the value of deferred value here. We pass search text to this component. It uses whatever it was before on the first render and then when it changes, it now knows the change is coming. So, it triggers the view transition. It then renders the new state and transitions to that. It's so good. But this deferred value wrapper here tells React, hey, when this value changes, you now have two states. You have the deferred version and you have the new version. Go trigger your transitions. That's it. is literally a two line of code change to add something that used to take a PhD in browser performance chaos and also screwing up the way your codebase works too. It's so good. I'm so hyped on this. This was Seb Markb's like baby, which is crazy cuz he's the server components guy, but he just really wanted to make view transitions happen and he went ham to do it. I'm pumped for him. This is such a cool thing. And that was all they were talking about here. I'd be hyped, but it goes way further. So, we need to talk about activity. In past updates, we shared that we are researching an API that would allow for components to be visually hidden and deprioritized, preserving UI state with reduced performance costs relative to unmounting or hiding with CSS. I have done so many hacks for this in the past. The level of depth of went to with portals just to keep an element's state around when it was being removed from the DOM is obnoxious. Now there's a built-in component for it. Activity is a new component to hide and show parts of the UI. When activity is visible, it's rendered as normal. When it is hidden, it's unmounted, but it will still save its state and continue to render at a lower priority than anything visible on the screen. Do you know how useful this is? Now, if you have an input box and you switch to a different place in the UI, you go to a different like page and you go back, the state of that input box will be persisted. Now, if you have a counter component and you navigate to the wrong tab where you click something you thought was a button, but it's actually a link and you go back, it's still there. I see chats catching on already. Classic reverse portal. Basically, got visibility. Oh my, is it Christmas or something, right? This is so good. It's so good. Now you can render an element and have it own its state without having to deal with all the chaos from like local storage to conditional rendering to hiding via CSS to having the VDOM caring about it and taking priority from other things. If you have some slow thing you want to kick off the render for as soon as possible without blocking the main UI, you can just do it now. And as others are catching on to, React Router is going to have so much fun with this. Absolutely agree. Routers are going to be able to do crazy stuff with this for pre-rendering different routes so that not only do we know what HTML will be on the next page, we actually have the React structure for it done, too. This makes routing, you can do crazy stuff with routing with this. I'm so excited. One major note they call out here before we go deeper, effects don't mount when an activity is hidden. So, if you have a use effect in a component wrapped in an activity that's hidden, the use effect won't run. It state will persist, but the effect will not run. If you switch an activity from visible to hidden, the effect will clean up. So you will still get that return cleanup function, but you will not have it run when it is inside of the activity. This is part of why it's so performant, why you can render giant things that are super heavy in activities, leave them hidden, and it won't meaningfully affect your performance. I love chat catching on to this. Perfect for transitions. God damn it, I have to start using React again. Not even pre-rendering, just instant browsing history stuff. Yes, it's so cool. So cool. So let's take a look at the examples they have. Restoring state with activity. When a user navigates away from a page, it's common to stop rendering the old page. Yes, this is how pretty much every router works in React. It's one of the reasons why we tell people to put their state in the URL cuz they're going to lose it when you navigate otherwise. But as they say here, if the user goes back to the old page, the previous state is lost. So if home has an input field, the user leaves the page and the input gets unmounted. Now the text they typed is gone. Activity lets you change the visibility of other things like that. So now home is visible if you're on slash otherwise it's hidden. So it's not rendered at all but it does exist still. So it state is persisted. And here's the example. Let's search for a video. Let's type f. We go to fourth and we go back and it's still in this state. Do you know how annoying it was to do like this before? I see chat catching on. All caps from Cooper here. Persistent filters on dashboard without query params or sporto my hack for caching images in roundest. Oh god. Yeah, that is so much easier. You can just fetch the next image. God, that's so good. Damn, it's so good. Yet people are getting hyped. Like this is an awesome change. They called out hiding via CSS at the top. The problem with hiding the CSS is your browser still has to do a bunch of work to generate the HTML, put it in the page, then hide it. And it will affect other elements too. Not only is activity not using all of the browser stuff you would be using if you hid via CSS instead, it's also not even using all of React because it's disabling a bunch of things that don't need to be running if the component isn't actually there. So, it's Yeah, this doesn't run hooks until it's visible. It's so good. It's huge. You can just render all of your UI in activities and when you activate it, it will come up way faster. The state will be throughout all of it. I would love to see somebody do a shim on React Router that just wraps everything in activity just to see how it performs. I would be so curious to see RAM usage go bur I got all this RAM I got to use it for something I don't work with a lot of front end even I know this is OP you you're the ones I'm trying to win by the way if you guys don't know my history is backend I'm just trying to get you guys as excited about front end stuff as I am because I have my my whole history is back end I got into React relatively late and I fell in love with all these cool things they were doing and I'm just trying to share that love and excitement and I'm pumped you guys are seeing it and getting it too. Do you see how elegantly this all combines? The transition between the different pages, the state being persisted, the animation as you type, and this isn't crazy customjs like it would have had to be otherwise. This is just using built-in browser primitives and built-in core React stuff that's just simple component wrappers. It's so cool. Other frameworks previously did animation better than React. I won't pretend otherwise. It took them way too long to catch up, but I feel like they're leaprogging. As long as you're not a Firefox user, cries and zen. Yeah, it is what it is. Anyways, as I was hinting at, you can also pre-render using this too. So, here we are pre-rendering certain pages like details one in order to have it render quicker to read what they had to say. Sometimes you might want to prepare the next part of the UI that a user is likely to use ahead of time so it's ready by the time they are ready to use it. It's especially useful if the next route needs to suspend on data that it needs for render because you can help ensure the data is already fetched before the user even navigates. For example, our app currently needs to suspend to load the data for each video when you select one. We can improve this by rendering all the pages in a hidden activity until the user navigates. Here we're mapping over all the videos and rendering them all in hidden activities. So now they can all fetch. So now when I go to one, it already has its data here. It doesn't have to wait because it can just do all that and there's no crazy custom code being written here. Again, we hop into the details here. We still have the suspense. The suspense can be resolved during an activity. So cool. Effects don't run, but data fetching through suspense boundaries does run. So here we have a use call for fetch video to get the video data. This triggers suspense when it's going. So the suspenseful activity can happen. the component can render and be ready without having to do anything in the DOM yet. And then you just render it. It's unreal. It's this simple. Like there's no crazy transition or animation code anywhere in here. You just wrap things in view transition and you're pretty much done. This is Facebook loves relay all over again. It is Facebook spends a lot of time trying to filter the best parts out of what makes Relay work for them so that we don't have to have a PhD in graph theory in order to get better performance of our web apps. It's like this is three layers of distillation past relay. We find these small benefits that we can then stack up with browser standards to make something everyone could benefit from. Okay, I know I said this isn't server components, but they do call them out here. SSR with activity. When using activity on a page that uses SSR, there are additional optimizations as well. If part of the page is rendered with mode hidden, then it will not be included in the SSR response. Instead, React will schedule a client render for the component inside that activity while the rest of the page hydrates, prioritizing the visible content on the screen. We have quick at home now, guys. We did it. We can now tell React to not do something on the server, not block the initial render, and then prioritize rerendering it on client. This is so cool. It's so cool. And it's using the same primitive. You don't have some special do hydrate, don't hydrate. You just use activity the way you would intuitively do it for client side stuff. And it works on the server, too. This is why I like, does React move slower than other frameworks? Yes. It's cuz they're trying to find the right core primitives that they can use to solve multiple problems at once when the problems are similar enough. And the problem of how to unblock the first bite on a server render, the problem of how to prioritize what to render on client, and the problem of how to render things in the background on client when they're not visible yet. These are all complex problems that intuitively you'd expect to do different things for. But the genius of this team is they'll fight to find the overlap and build something that solves all these problems in one elegant way. And it's actually really cool. It's not always elegant. I mean, look at all the weird arguments for use effect, but sometimes it is. And this looks really elegant. I'm so excited to play with it. One of the coolest parts here, React D prioritizes hydration of content within an activity, similar to how suspense content is hydrated at a lower priority. If the user interacts with the page, we'll prioritize hydration within the boundary if needed. We have quick at home. Future modes for activity. In the future, we may add more modes to activity. For example, a common use case is rendering a modal where the previous inactive page is visible behind the active modal view. The hidden mode does not work for this use case because it's not visible and it's not included in SSR. Instead, we're considering a new mode that would keep the content visible and included in SSR, but keep it unmounted and deprioritized for updates. This makes a lot of sense. When you have full screen modal open, you don't need the background updating in full. I don't know how common this case is that it needs its own mode, but it's awesome. They're thinking about real use cases like modals that block the content underneath. It took Chrome decades to start considering these things. So that's the end of the now ready to go experimental features that will almost certainly make it into the main React version in the near future. Possibly React 20, possibly sooner. You never know with them. I'm going to play with them a bunch, but there's more here too that we need to dink into, including that IDE plugin. Again, they call out that they often change or remove solutions after trying them out. When the solutions that they're working on are shared too early, it can create churn and confusion in the community. To balance being transparent and limiting confusion, we're sharing the problems we're currently developing solutions for without sharing a particular solution that we have in mind. So, these aren't things we can play with just yet. And they're not trying to promise a specific solution because they don't get too hyped. We don't want concurrent mode again. God, that was a disaster. So, I don't think this will automatically start 150 fetches because it dep prioritizes activity when there isn't availability. That's like the whole point is it's optional. If there are too many things in activity, I'm sure the React scheduleuler is smart enough to dep prioritize all the things in a hidden activity. It might pick the wrong ones, but it will dep prioritize them for sure. Curious to see how this looks at scale, though. It'll be very fun to play with. Deprioritization means that if it doesn't do the thing and you just navigate there normally, it just behaves the way it did before. So, if you have the RAM, the CPU, and network, and all the things necessary to do that, cool. You can do it. You can render those things, but if you have too much and other things take priority, like inputs, all the other content on the page that isn't under an activity or isn't an activity that's visible, that will take it. More on this here. Uh, another mode they're considering is the ability to automatically destroy state for hidden activities if there's too much memory being used. Since the components already unmounted, it may be preferable to just destroy the state for the least recently used hidden parts of the app rather than consume too much resource. Yep, super cool. Anyways, let's go to these performance tools because we we need more ways to identify performance. Our friend Aiden, you guys might know, creator of same, but mostly known for millionjs in React Scan. You've seen React Scan in a bunch of my stuff. If you go to my like like is React really slow video, one of my best videos I've done recently, you can see in depth the power of React Scan. He knows what he's doing. He has been building a lot of very useful performance tools for React. Now, the React team is starting to catch up, which is very overdue and very exciting to see. We're working on a new set of custom tracks to performance profilers using browser APIs that allow adding custom tracks to provide more information about the performance of your app. Feature is still in progress. We're not ready to publish docs to fully release it as an experimental feature yet. You get a sneak preview when using experimental versions of React, which will automatically see the performance tracks added to profiles. So here we see custom tracks that you can define in the react code to say hey this is when this render starts and it makes using the react like performance stuff both in the react chrome extension and in the normal performance tab significantly easier. This is work being done in parallel with the chrome team to make the performance tab more useful which is very needed because I've been spending a lot of time in this tab lately and it is rough. It's It's so useful and it's so bad and we need all the help we can get. It has some bugs so it's not quite ready yet and they're still collecting feedback. So if you do end up using this and you have feedback for them, definitely let them know. That's the whole point. That's why they're doing this. Another that I am so excited for. Hi SolidJS. We're catching up finally. It only took us what 8 years. Automatic effect dependencies. We released hooks. We had three motivations. Sharing code between components. thinking in terms of function, not in life cycle, and supporting ahead of time compilation. The first two it did great with. The third it did not help with. Since their release, hooks have been successful at helping people share code between components. Hooks are now the favorite way to share logic between components, and there are less use cases for render props and higher order components than there ever were before. Hooks have also been successful at supporting features like fast refresh that were not possible with traditional class components because of how deep the life cycle was embedded in those components. Now it's a lot easier to do those types of things. I cannot imagine life without fast refresh anymore. It's so good just saving and seeing the change immediately without your state going away. Effects can be hard. No Unfortunately, some hooks are still hard to think in terms of function instead of life cycles. Effects are a function that triggers on different things, but those things are the life cycle of your data rather than the life cycle of the component. Even though it does still trigger on the component life cycle, like an unmounted one, it's it's confusing. It genuinely is. As they say here, effects specifically are still hard to understand and it's one of the most common pain points that we hear from devs. Last year, we spent a significant amount of time researching how effects were actually being used and how those use cases could be simplified as well as made easier to understand. We found that often the confusion is from using an effect when you don't actually need to. That you might not need an effect guide covers many cases where effects are not the right solution. And this is a great, if you haven't already read this blog post and you're a React dev, you're doing yourself a disservice, read this post. It's phenomenal and it will help you so much with learning the places that you shouldn't actually be doing an effect for. This is a really common one. Combining something like first name and last name and an effect whenever either change you set it to a new state, just inline it. It's so cheap to calculate this. Just do it during render. Who cares? And this plus compiler means there's a lot of partial states you shouldn't be storing. As I say here though, even when an effect is the right fit for a problem, effects can still be harder to understand than class component life cycles were in the past. We believe one of the reasons for confusion is that developers tend to think of effects from the components perspective like a life cycle instead of the effects point of view, which is the data and what the effect is actually doing. Here's an example. We create a connection and then we connect the connection on room ID and we return a disconnect when room ID changes because the room ID changes we want to disconnect from that room and connect to a new one. Many users would read this code as on mount connect to the room ID. Whenever room ID changes disconnect the old room and recreate the connection but now you're still thinking from the components perspective which means you'll need to think of every component life cycle state to write the effect correctly. This can be difficult. So, it's understandable that effects seem harder than class life cycles when you're viewing it from the components perspective. I totally agree with this framing. By the way, I think one of the biggest problems people have with the React model is they're thinking about components too much and data flow too little. The beauty of hooks is that the life cycle is no longer around the component. The life cycle is instead now around the data being passed to the hook. I didn't think of this as functions versus components. I thought of this as data life cycles versus component life cycles, but I'm curious to see how they pitch it here. effects without dependencies. Instead, it's better to think from the effects perspective. The effect doesn't know about the component life cycles. It only describes how to start synchronization and how to stop it. When users think of effects in this way, their effects tend to be easier to write and more resilient to being started and stopped as many times as are needed. We spent some time researching why effects are thought of from the component perspective, and we think one of the reasons is the dependency array. Since you have to write it, it's right there and in your face, reminding you of what you're reacting to and baiting you into the mental model of do this when the value changes. When we released hooks, we knew we could make them easier to use with ahead of time compilation. The React compiler, you're now able to avoid writing use callback and use memo yourself in most cases. For effects, the compiler can insert dependencies for you. So finally, for the first time ever, there will be a real use case for not passing an array to an effect because right now it makes no sense at all. But in the future, finally, it might actually make some sense. With this code, the React compiler can infer the dependencies for you and insert them automatically, so you don't need to see or write them. With features like the IDE extension and use event effect, we can provide a code lens to show you when the compiler inserted for times that you need to debug or to optimize by removing a dependency. This helps reinforce the correct mental model for writing effects which can run at any time to synchronize your component or hook state when something else. Think of event effect similar to use callback, but it never changes. It's effectively the same thing as stuffing a function into a ref. You don't want the onvisit binding to change because if it does, the effect will run again and you don't want it to. This lets you bind a function to whatever data the component has access to without having to trigger updates when you don't intend to. Super super nice and will allow you to avoid a lot of the depths being passed into the effect that shouldn't actually trigger the effect changing. Like here, we don't want number of items to trigger the effect. We only want the URL to. So we break out the effect event to use the visited URL and number of items. So we have this all here and then we pass on visit to use effect just by calling it in there. No passing. It's just in the same closure. And now this doesn't run on number of items changes like it might have otherwise. Very nice. This took way too long to ship. I totally agree with you guys. It's been it's still not even out properly yet, but I am so hyped that it's not going away. They are actually shipping it. There was another use effect thing they were considering doing that I saw them add and then remove. Use resource effect. The legend Lauren was working on this one. Use resource effect was going to be similar, but it would give you an object or data with a cleanup, which I've needed forever. I have an ancient thread of me going back and forth with Dan Abramov trying to explain to him that sometimes I need to instantiate a thing and have a cleanup for it that doesn't run twice always. And it just it was so hard to communicate that with them. It's like here are the four hooks I have to write right now. Here's the one I should have to. They kind of got it, never happened, but they're moving in that direction. They are adding the missing pieces to make effects simpler so that they're easier for us to understand and they are less likely to go rogue and destroy our code. And when you combine that with the ID extension that we're about to get to and it says, "Hey, you might not want this thing right here because this thing is going to cause this effect to run all the time. You might want to move this out to an event effect so that it is a function that gets called in the effect instead. So much better. As they say in the post, our hope is that automatically inserting dependencies is not only easier to write, but that it makes them easier to understand by forcing you to think in terms of what the effect does and not in the component life cycles. I am so hyped for this change. I've been dancing around it for so long. We need to look into the ID extension. The React compiler is now in RC. It's kind of funny the RCRC, but React compiler is pretty ready to go. They're using it for basically everything now at Meta and Facebook. I'm using it for T3 chat. It's been a lifesaver for us and they're working hard towards shipping the first Semverse stable version of the compiler in coming months. Huge. So hyped that compiler is going to officially be 10 SEver stable. Their bar for stable is really high. So know that. But it's I'm using it on everything I build right now and it's been so good. But part of the compiler efforts isn't just, oh, it can make your React code faster. It's how it integrates the whole ecosystem in a better way. One of those ways is your ID. We've begun exploring ways to use the React compiler to provide information that can improve understanding and debugging of your code. One idea we started exploring is a new experimental LSPbased React ID extension powered by the React compiler, similar to the one used in Lauren's talk at React Comp, but this essentially shows you what the compiler has compiled. So, one way to tell if a component or hook was optimized by the compiler is to look for this little uh dollar sign variable up top. Um, and don't worry about how to use this. It's not meant to be used directly. It's really just for the compiler. So, one way you can think about this is it's just a big array of values that the compiler can use to cache and retrieve values efficiently. This is so cool. One of the biggest concerns I saw people have with compiler is that it makes it so people don't understand the code going out. I think most devs don't even understand the code going in. They're just autocompleting anyways and they don't understand React well enough to have understood how to optimize and memorize properly anyways. So for them it's a noop. They just spit out better code. But for those who care deeply, the people who watch a channel like this and are trying to teach the teams they work with how to actually use React, this is huge for us because we can see what comes out of the React component. And it becomes way easier to understand how the compiler works and see how it interfaces with the other things you're doing if you can just hover over and see the compiler output. But the extension is going to go so much further than what we're seeing here. I don't remember if there's other deeper examples of it in here or not. Oh, here's a fun one. The React compiler eslint rules are way better. The current property on a ref cannot be accessed during the render body. This is an early preview of what Lauren's been working on. She is an absolute wizard, by the way. If you guys aren't familiar with her work, also one of the funniest people you could follow on Twitter, potatoes, spelled like that. Yeah, super underrated. Forgive and forget is such a good pun with React compiler cuz he used to be react forget. RC is release candidate. This is not the React compiler RC. She can't help herself. She's a memer. We love Lauren. Anyways, back to the ID extensions. We talked a bit about what she has in mind here and it's really cool. Our idea is that we can use the compiler static analysis to provide more info suggestions and optimization opportunities directly in your IDE. For example, we can provide diagnostics for code breaking the rules of React. Hover to show if a component and hook are optimized by the compiler or not, or even a code lens to see automatically inserted effect dependencies. The ID extension is still in early exploration, but we'll share our progress in future updates. The code lens for the automatic effect dependencies is so cool. Like similar to what languages do this? I I know Rust does this with the LSP where you type something and it like has like the gray text behind showing you what it actually is and does or like with uh GitHub and the git lens plugin here. You can see the gray text there showing this is when I tried to fix Gemini's behaviors. Having that to show you what dependencies an effect has instead of you writing them all. That's so cool. I'm hyped. It's going to be a huge win for all the changes going into React. And it's awesome to see the React team thinking more holistically more and more. Like React went from a JS library you'd add to change how you update your UI to a suite of tools to build giant applications for teams of all sizes. And the IDE integration is another great example of that where the code we're writing isn't going to change a whole lot, but the quality of experience we have writing it is just increasing constantly. And I think more and more we're going to see this is the focus of React, not what new APIs can we introduce, what new ways of writing React can we think of. I don't think we'll ever have another hooks moment where they fundamentally change the syntax of React itself. Instead, we're going to see things that remove syntax that probably shouldn't have been there in the first place to make the code as simple as possible so humans and AI can work together in tandem to ship things more effectively. Yes, you I had to mention AI somewhere here. I made it this far. Okay. Anyways, couple more cool things they have before we wrap up. Fragment refs. Many DOM APIs like those for things like event management, positioning, and focus are difficult to compose when writing with React. This often leads to devs reaching for effects, managing multiple refs, or using APIs like find DOM node. Been there, done that. Please never make me do it again. We're exploring adding refs to fragments that would point to a group of DOM elements rather than just a single element. Our hope is that this will simplify managing multiple children and make it easier to write composable React code without having to call a bunch of random DOM APIs. Fragment refs are still being researched. We'll share more info when we're closer to having a final API. Very exciting. I can use that a lot in T3 chat for managing input fields. Speaking of things I can use for T3 chat, gesture animations. Finally, researching ways to enhance view transitions to support gesture animations, like swiping to open a menu or scrolling through a photo carousel. Shout out Ken Wheeler. If you know, you know. Gestures present a new challenge for a few reasons. Gestures are continuous. As you swipe, the animation is tied to your fingers placement in time rather than triggering and running to completion. React isn't good at this. React isn't good at partials. React takes a before and after and handles the in between for you efficiently. It's not as good at things that change every frame. That's not what React does. React says go use CSS for that. But gestures require that. And finding the right balance here is going to be really challenging. And I like that they're not pretending it isn't. As they said, they're continuous. They don't complete. It's not as simple as it's starting and it's done. When you release your finger, gesture animations can run to completion or revert to their original state, like when you only partially open a menu depending on how far you go. That's complex and React's model does not map well to that. There's also gestures inverting old and new. When you're animating, you want the page you are animating from to stay alive and interactive. This inverts the browser view transition model where the old state is a snapshot and the new state is the live DOM. Having an old state that's still alive makes this way more complex. Sympathy to them. I hope they can figure out how to do this. We believe we found an approach that works well and may introduce a new API for triggering gesture transitions. For now, we're focused on shipping view transition and we'll revisit gestures afterwards. Speaking of transitions, hi Miles. He's been extra needy. I just did two trips, so he's not gotten the attention he wants. So, he's just asking for it constantly. Shoulder turn. I just trimmed his nails, so they're a little shorter than usual. He's a little nervous climbing me right now. But shoulder's his favorite spot Hey, buddy. I know. I know. We'll hang more soon. I promise. But I need to finish filming. Is that okay? Okay, we'll finish the video with him on my shoulder. What's left? Concurrent stores. When we released React 18 with concurrent rendering, we also released use sync external store, one of the coolest and also most broken APIs in React. It does not handle concurrent rendering at all. They can support it, but they do it by forcing a sync render whenever the store updates. This is cool except for the fact that it breaks things like transitions entirely. So, if you're using a library heavily relying on Sync external store, good luck. Have fun. Okay, Cat is leaving. Be right back. As we were saying, sing external store breaks suspense and a bunch of the other fun new concurrent features. So if you're using a library with it, it breaks other things. And it's one of the biggest frustrations of people like Tanner Lindsley have with React in its current state. And they're finally revisiting the problem space to create a primitive to fully support concurrent external stores with the use API. So you can call use store and implement a store in a way that is friendly to React's concurrency, suspense, and all these other cool things that the third party devs making React so cool. all really want access to. This might be the shortest, simplest section here, but it's one of the most important and shows to a lot of like the core people building around React that we will have the missing pieces to do the next era of dev tools very soon and things like React Query are going to get so much better when this all finally ships. I am so hyped with all the cool things coming to React. I missed these labs posts so much and it's incredible having them back. Shout out to Ricky for letting me know this was coming a little bit early so I could prepare accordingly. By a little early, I mean yesterday, literally just one day. But so nice. Every day I feel more like the React team is trying to bridge the gap between it and the community despite the community growing to unbelievable sizes. And I still think as I tend to that the future of React's incredibly bright. Let me know what you guys think. Until next time, peace nerds. ## React vs HTMX - A Fascinating War - 20240412 react solid and HTM X this is an interesting blog post that I knew I had to talk about as soon as I saw it it's a pretty good Deep dive comparing react solid and HDMX in terms of how they render and work and relate to the server all things that we should concern ourselves with and think about more often so let's do just that react how far can components go saves it not a single day passes without someone on Twitter wondering what rsc's are really about I've made my own attempt at cracking it he has a blog post RSC is react server plus component arguing that react server components are best understood in the context of the new react architecture not in isolation this I fully fully agree with I didn't read the sentence before reading like skimming the post before yeah I already know I'm going to like this guy so the biggest failure of the new react stuff is that we don't have a term for all of the things that are changing with other Frameworks we have like vue3 where everything's different from vue2 or we have angular 2 which is different from angularjs the difference here is that everything being added still supports the old stuff and everything's fully backwards compatible so the idea of this version number change doesn't properly represent things we don't have a term for this movement because server components are just one piece of the new react architecture he refers to it as the new react architecture which is a very good way to put it because people try to learn server components the concept not server components and how they affect react's architecture so really important call out here I think it's important to not conflate react server components with the new way we do react and think about react architecture which again is entirely optional and opt in you can still use your old react code so let's see how he frames this cuz I'm already excited what we have here is not some new magic kind of components but a server client architecture that speaks react on both ends and grants components if placed on the server side direct access to new Computing environments and their resources this is one of the best summaries of what server components actually are okay already huge shout out to Boba Kang hopefully I pronounce your name correctly because this is phenomenal after another month of closely following the RSC discourse I still stand by it and personally I think react might be making mistakes by picking RSC as an umbrella term I promise I didn't pre-ad I skimmed to make sure it was what I thought it was I like this person a lot nonetheless I appreciate the new react architecture is a unified model for UI development that brings both ends under a single coherent Paradigm a true oneapp architecture this is a significant departure from most JS Centric web Frameworks including those built on top of react that provide various server sites features like server side props in next as well as loader and action in remix things like that it's doubtless that these things are useful but they fundamentally are external to the core UI application placed squarely on the client side speaking my language so hard when your mind is already separating server and client this strictly where you have these specific points that are inputs and outputs to the server the new model doesn't map to that because the new model is as he said a true onea architecture combined with composability of all of these Primitives instead of defining a loader that affects this URL you define a function that your component calls wherever the component is yeah I'm going to like this in practice the new react architecture isn't without pitfalls without careful planning react components with access to server resources still suffer from the same waterfall issues even though they're Now hidden from the network tab on the browser Dev tools locking this new architecture also comes at the cost of increased bundle size in server components support in tooling which is still at an early stage mostly Fair one important Point here is that waterfalls are fundamentally different when they happen on the server versus the client because when a waterfall happens on the client you have to redo a bunch of things like you have to reauthenticate the user you have to call an external server from the user's device you have to process things with JavaScript you have to do a lot of different things in order to make each of those waterfall requests rather than on the server where you've already authenticated the user you can just do all of those things and stream the results serers side waterfalls are so much less bad that it's almost not worth talking about as much anymore previously we ignored waterfalls which caused a bunch of problems when they happen on client now it's a little more valuable for us to ignore which is interesting that it's changed that much you want to know more about waterfalls and why I think these things I have 15 videos where I talk about it so just search server components or data with my name and you'll find it on YouTube that said I believe these are more Growing Pains rather than critical deficiencies inherent to the new model if react can successfully address these pain points via improved tooling and messaging 2024 shall be the year where everything finally clicks for the mainstream audience versel Can you hire this person they understand this so well as I noted in an earlier blog post react versus the world react has a proud history of challenging the Contemporary norms and conventions of UI development including the ones it helped to popularize and winning over the world despite all the noise and confusion in the ongoing server component discourse react appears confident that it can repeat the history again relax it's react I don't know if I've read this blog post I am saving this for later for sure I I'm liking this a lot oh boy now we're just going straight in solid how far can primitive go if anyone asked me I'd say solid one the JS front end in 2023 not because it overtook reaction usage not even close but because it's ideas one saying solid won the JS front end in 2023 is really funny to me because I opened 2023 with the T3 Awards one of my most underappreciated things I we put a lot of work into this poor Mir spent so much time editing down this 4-Hour stream into a 2-hour video and adding nice overlays and such but the web framework of the year was of course solid I compared all of the different ones here but the winner oh I I even pulled chat to see if they could guess which one it would be and they actually successfully guessed it it was solid which uh I think is pretty cool at the time solid was really pushing these ideas and Ryan carniato in particular was becoming more and more involved in the greater web development discourse and yeah it was pretty clear to me that solid's ideas were doing well the solid framework and Community were going places no one had ever imagined before and it felt important to call that out and give them a literal award at my award show no we're not doing one this year some more fun things for the developer Awards coming soon anyways as the author was saying pretty much every framework but react has implemented signals in some form and even react adopted the language of reactivity to describe its optimizing compiler under development this is the uh reactivity compiler react forget blog post but this begs a question what's next for solid will the success of fine grain reactivity lead to the fall of solid which can no longer stand out from from the crowd solid's answer is no in 2024 solid will reach 2.0 with a renewed reactivity implementation as well as solid start the official solid web framework which will reach 1.0 as I follow the ongoing development it's getting clearer to me that I like many others have been missing the point of solid the point of solid is not signals or fine grain reactivity that's more a happy accident the real point is about The Primitives over abstractions explicit over implicit in Simplicity over ease of use I take back what I said about versell Ryan you need to make sure this guy doesn't end up at versell because you need him anyways this is this is so well put specifically the idea of Simplicity over ease of use this is something I didn't realize I fight constantly but I absolutely fight constantly where I'm always looking for Simplicity and people pretend these two things are the same and they show me something that's easier that is less simple this is one of my favorite examples of what we're talking about here with Simplicity versus ease of use spelt solution here is objectively easier to use let count equal zero and now if you want to change count you set it to something else later on react solution is less easy to use because you're calling all these other things you're importing things you're doing all this stuff react solution here unintuitively is actually quite a bit simpler like significantly so because react solution is using JavaScript is Javascript it's not adding new things on top the same way spelt is using a compiler to change this so much so that spelt actually went in this Direction with their recent changes with runes if you look at spelt runes you'll realize oh these are actually quite a bit more complex than the previous solution because instead of let count equals zero it's let count equals dollar sign state zero this is less easy to use but the result is simpler because it's not compile step generating these things in a spelt file it's actually using Primitives that are reusable and composable across things and as they said here it doesn't even feel felt like but as they say here the reality is that as applications grow in complexity figuring out which values are reactive and which ones aren't can get tricky and the heris stics only work for let declarations at the top level of a component which can cause confusion so even though the other way was easier to use it becomes significantly less simple especially as your code base gets bigger and you have more and more complex things ease of use makes it easier to do a snippet for a sample but it doesn't help you solve hard problems over time Simplicity might be harder to adopt but it means these problems hurt you less over time which is why there are so many big react code bases that are getting bigger every day that are doing just fine that are shipping major updates without issues because react Primitives even the more complex to learn end up being simpler at scale so yeah this blog post is giving me realizations which is a really really good sign and the Simplicity over ease of use point is a huge one here this also fits with The Primitives over abstractions and explicit over implicit doing these things explicitly makes things more sustainable and that's how solid remains a standout to the crowded JS framework space where others often seek to attract developers with easy to use abstractions that feel magical I'm actually curious what he linked there for the feel magical good reference magical not magic there subtle line between something feeling magical and something feeling like magic we want spelt to feel magical want you to feel like a wizard when you're writing spelt code historically I think felt went too far into magic territory where it's not 100% clear why things work a certain way and that's something we're rectifying with spelt 5 yeah really good reference in solid to is eyeing on solving the server side of the equation with a new set of Primitives albeit from a different angle instead of creating its own version of server component solid is betting on streamline support for Server functions solid's server function looks similar to server actions in react they're both marked with the US server directive and with a bundler help they get turned into RPC calls this is actually one of the interesting things I think Ryan's done a great job with is recognizing The Primitives that exist within the react ecosystem that aren't specific to react solid is the first popular jsx based framework that isn't react which is kind of crazy when you think about it that other Frameworks didn't take advantage of this open primitive standard that anyone could use they chose to which made it way easier for me to transition to solid from react and vice versa they're also taking advantage of new things that react is introducing like you server since this is now a bundler feature that many bundlers are implementing they can hijack the syntax and the feature use those same pipes that were built for react but instead using them for the things solid wants to do differently which is super cool to take these Concepts these Primitives these supported ecosystem pieces and use them to assemble something entirely different really cool stuff when combined with solid's official router and its data API which has action cache create async somewhere hybrid between what react's doing now and what remix did before solid server functions can offer pretty much everything that you'd want from a data fetching SLS server State Management Solution Direct access to server resources via flexible RPC interfaces with caching and Route level parallel fetching the best of relay tanet query trpc and remix all in a single package the fact that you're calling out relay suggests you're way deeper than almost anyone watching this video let me know in the comments if you've actually shipped relay because I'm convinced the only people who have are employees of meta or people with multiple phds so let me know in the comments also recall that a solid component is more like a setup function that runs once to wire up the reactivity graph then a render function that continually reruns the produce the latest UI I just talked about this a bunch in the video I did earlier today which hopefully is out before this talking about how the new Vue Vapor compiler Works comparing how these render strategies work so if you want a deep dive on this I'll link that video in the description this means that the potential gain for moving components to server is much smaller for solid than it is for react plus solid already has a minimal bundle size and its hydration cost is relatively cheap so it's understandable why solid doesn't consider server component to be a critical piece of its take on the onea architecture I'm trying to decide if I want to go deeper into the virtual Dom thing here cuz I just just talked about it so much but it's a different video can I need to repeat the context I'm going to repeat it I'm sorry I I know I just said watch my other video but I'm going to dive a little bit into this because it's important react has a virtual Dom which is a full representation of all of your components that exists in your memory in JavaScript and when you make a change it reenders all of those things in the virtual Dom to compare the difference before and after to see if it's different and if it is then it updates the web page accordingly but in order for those components to know which element they're bound to on the page it has to run in your browser so even if you generate an HTML page on the server using react and using the virtual Dom over there once it shows up in your browser in order for react to run and update things it doesn't know which component goes where until it's run all your components again which means react has to rerun the same client side JavaScript code in order to hydrate to bind those components to the right places in the HTML and that takes enough compute that whole Frameworks have been built arguing about it quick exists exclusively because of that hydration problem the fact that you have to rerun the same JavaScript on the client in order to match it up with the HTML solid skips that because as I mentioned in the view video that I referenced earlier solid doesn't create a tree of components it creates a tree of state and every time you use a stateful element in different places it creates a tree of updates for all of those things which means as long as it knows where those stateful bindings are you don't have to rerun your components you just have those values and when they change they change that means you don't have to ship as much JavaScript it means you don't have to run as much JavaScript and it means a lot of the issues that would make you want to server render aren't as present but it's still very nice to get good HTML down from your server so there's a balance here for sure notably solid's approach does not require any radical shift in mental model it still feels very much client Centric but with additional Primitives that can be combined to bring the server closer it's modular incremental familiar and practical potentially a winning combination I agree and I'm very excited to see where it goes speaking of where things are going let's go to HTM X and see how far hyper media goes with it 2023 saw an unexpected entrance to the JS framework War HTM x a simple Library consisting only of a single JS file came to the scene seemingly out of nowhere and took the web developer Community by storm adding 15,000 new GitHub Stars HDMX earned the second place in the 2023 JavaScript Rising Stars for the front-end framework category which puts them just behind react and pretty close in terms of new stars gained that year when you think about it that's pretty nuts JavaScript framework for people who hate JavaScript is number two for most stars in the year while hmx is not a new library in fact it came out in late 2020 and its predecessor by the same author intercooler reached 1.0 back in 2016 its increased awareness and adoption means that 2024 will be the first year for HTM X to really shine and also its robustness to be tested HTM X presents an approach that is fundamentally at odds with what has been the mainstream for over a decade in this case a single page application entirely controlled by a react likee JavaScript framework directly manipulating Dom and exchanging data with mostly Json apis instead HTM X extends HTML as hyper media with HTM X we can encode sophisticated behaviors directly into HTML as attributes this is the exact opposite of jsx which is an XML like syntax extension to JavaScript itself for templating purposes it lets the JavaScript write the template rather than the HTML write the behaviors previously in like the OG world of like the jQuery days your HTML was your template and your JavaScript was your logic your update layer and you would start with some HTML that you wrote in HTML file and then the JavaScript would make changes as needed jsx was what if we just put the template in the HTML in the JS HTM X is what if we put the logic in the things that change in the HTML an HTM X app is server Centric like the web one dayss but it's able to match most single page apps in its ability to support Advanced interactivity and modern ux all with little to no client side scripting very good points and that is largely its goal what's particularly intriguing to me is that HTM X shows us a different route to the one app architecture by the way of killing the client side entirely it's important to note that HDMX is not a 100% solution it shouldn't be controversial to state that interactivity ceilings are much lower for HDMX than something like reactor solid I hate that this is controversial cuz I've gotten in trouble for saying this even though the HDMX team agrees in an old world and by old I mean when I worked at twitch a few years ago back in in front we're pretty separate and we had a thing in between that was almost the translation layer between the two for us it was graphql this was a way that we could make rules and agreements where the back end could go do its thing the front end could do its thing it would all come together something that started to happen is we saw more and more react devs realizing that they could benefit from running some things on the server maybe they don't want to manage the whole database themselves but they want to render their page on the server maybe they need an API endpoint quickly and they don't want to wait for the backend team to do it maybe they need to hit three different things at once once you're authenticated and massage that into the right shape for the data maybe they just want to do everything quick what nextjs enabled is for this line between the back end and the front end to be crossed by react previously there was a hard wall between these things that you would Bridge with another tool like graphql or even just Json apis with nextjs with mix with the stuff that we're talking about with solid and solid start with all these other tools and solutions react now has the option to go towards the server some amount this is great if you don't need to make a really complex back end if you were building a Twitter clone you don't need to reinvent the data layer you don't need to do really powerful optimized things there you can throw it on something like Planet scale attach it and hook it up via versel serve it via next and you're good and done is it as optimal as somebody writing a quality rust or go backend that's autoscaled with kubernetes no but it's pretty damn close and it's good enough for a lot of developers that exist on this side that want to do enough on the other side and they'll fill out the gaps with sasses like as I just said versel Planet scale clerk up stash axium all the things that I talk about sponsored by Etc here the magic of next in these new patterns is how much further we can get over the line here without having to call on a backend person or team to do that eventually you might want to move off of these sasses and hire a backend Dev or a team of backend devs to build this site for you but you shouldn't have to hire a backend Dev just to deploy your web app and have apis this is where I think HTM X is really interesting because if you're a backend developer and you want to make a Twitter clone previously your options were either to learn something like react so you could have good client side behaviors or don't and every time you do anything the whole page has to refresh when I make a new tweet I don't see it until the page reloads and then I lose whatever tweets were below it building something like Twitter entirely on the back end where you're just shipping HTML would be a terrible experience but in order to have a better experience on the client you would have to adopt react the same way in the past in order to have a backend for your react code that fetch the right data you would need go or node or any other set of Technologies as well as an API layer like graphql next lets you skip that if you don't need those details you just need the capability and with HTM X you can do a lot more of the client side stuff than you could previously if you want to have a tweet show up right below it once you post it without having to reload the page HTM X gives that to you if you want to have a search field that you don't have to reload the whole page when you change the inputs HTM X gives that to you a lot of the core behaviors that previously required you to opt into a JavaScript framework no longer do if you want to build a heavy canvas app or 3D rendering or a super interactive UI or figma HTM X is not going to help you at all the same way if I wanted to build a distributed system next isn't going to help me at all but if I'm not trying to build a distributed system I'm trying to build a web app next means I can skip the backend team if I'm not trying to build figma I'm trying to build Twitter HTM X lets me skip the front end team that's the value of HTM X it's not that it can do everything react can do is that if I only need to do this part of what react can do I don't need to use react anymore and that's a huge win but part of this win is acknowledging the chunk here of things HTM X cannot and will not help with because HTM X does not do this area it cannot do this area and it's not interested in doing this area and it shouldn't be the same way that next shouldn't be interested in competing with kubernetes check out my truth about htx video if you want a much longer rant about this yeah I got in trouble for that take I hope this author doesn't because they are correct the same way I was correct and as they say here even though it only gets you 80% of the way there it gets you there with radically less complexity no extra dependencies no more build steps no more advanced tooling now Rewritten and rust no complicated State Management no double data problems no hydration mismatches just write your HTTP server and return HTML in a way htx is not a solution but a question what are you really building does it really need more than HTM X which way to cross though most all web Frameworks aim to bridge the network Chasm I'm learning that this Chasm cannot be closed it can only be crossed so which way do you want to cross it react solid and HDMX all present distinct answers here with react we see an attempt to cover the full spectrum at once within the same component model with solid we see a focus on the client side with New Primitives to bring the server closer to it and with HTM X we see a good old server Centric approach but with a Twist that is supercharged hyper media maybe too early to predict which way will wi out maybe such a prediction is mere nonsense there is no Silver Bullet remember different approaches with different trade-offs will benefit different use cases differently nonetheless I believe that react solid of this video because this post is actually one of the best I've read ever especially for a video thank you for this awesome blog post and for everyone watching which horse are you betting on do you think that solid's focus on client is the win do you think HTM X going back to the server is the best call or do you think that the weird chaotic react compositional hybrid approach has the Merit that we all seem to love let me know in the comments and I'll see you guys next time peace NS ## React's Billion Dollar Problem - 20230827 my favorite pieces of programming lore has always been the Tony horror billion dollar mistake if you're not already familiar but TL DR is that Tony horror invented null references which let you have a pointer to something that's null it's an interesting decision and he added it because in his words it was really easy to add and it felt bad not to but since then he's referred to it as his billion dollar mistake specifically saying that code using this pattern and not expecting these behaviors has cost at least a billion dollars in errors outages and debugging pain for developers and users alike I have to say I admire this level of reflection we've also seen it in the JavaScript side with Ryan Dahl the creator of both node and Dino saying specifically that if you have a cute thing you can add to your language or framework don't do it the cute things are the ones you'll always regret and I love this mindset and I've realized as I've been building my own apis and solutions that the cute simple seeming things that it's just so easy to add are often where the most pain comes from down the road whether it's an index.js file or it's a null reference there's a lot of these simple cute Stakes that can result in really expensive problems down the road and I think react has one of those too I want to talk about what I consider to be the billion dollar problem in react and yes this is going to be about use effect so let's dive in this is meant to be an intentionally very very very simple example I have the example component which is just an empty wrapper just rendering example core I have the example core which is a component but on render we want to run a tracking event so if we're going to use effect quick we're not actually doing anything in this tracking event right now but imagine that this was hitting a database or pushing code to somewhere anywhere in the world this could possibly be very very heavy code it's probably not regardless we probably don't want to run this thousands upon thousands of times in the user client so what's the problem here this seems to work fine it runs twice which isn't great but doesn't use effect just do that well the more astute code reviewers in the audience have probably already caught a mistake I'm not going to point it out just yet but I'm going to show you where the problem starts to occur let's say you make some changes in the example component and it has some State we'll do the classic after I'm trying to get co-pilot to do its thing come on set count that's fine and I will yoink this guy out kill that extra return we don't need import these Stakes I forgot to cool so now we have a basic button that says increase as well as high the example component underneath so if you're already familiar with all of the strange use effect behaviors in react you might know the weird thing is about to happen which is when I click this the analytics runs again why is that happening well the thing we forgot here is an empty array with use effect if you're not already familiar this array determines when the use effect runs specifically when the values inside of this change so if something caused this to be a different value than it was on the previous render the code in here runs if nothing in here changes the code here doesn't run so if you want this to not run on every single render you want to put an empty array in here this is such an easy thing to miss in a code review and it can cause all sorts of problems down the road one of the most common ones is if we actually were to move the state in here so I'll just move this here and we'll have a separate State we'll have analytics count and we'll say that in here we increase analytics count by one notice how we're getting in nearly infinite number of Errors right now to the point where my computer is going to freeze up if I don't close that that's because nothing prevents this from re-running and if we just follow what react tells us to do here like putting the things that are missing what this is going to show if we hover over is that analytics count isn't being used here so we put that there and then we run it should be all good right nope so why is that still infinite looping and causing all sorts of problems well the dependency here is being updated by this function so this is a very innocent looking infinite Loop where I'm updating analytics count and then the use effect depends on analytics count so it re-runs when the analytics count changes so if you just follow eslint and do what it tells you to you're going to write the same exact bug again the solution to this one if you actually wanted to increase the analytics count by one if and only if this component was just rendered the thing you want to do delete this pass this an anonymous function instead which we'll just do current count and we'll current count plus one now we're not even using this so I'll just console log it here so stop complaining and now finally things aren't running infinitely and when I click this the analytics count is going to re-logs I just put this in here so it doesn't really matter I can comment that out and it's whatever but you'll see it's no longer rerunning a whole bunch when it's not supposed to this is not intuitive if you're not coming from react obviously the react developers in the room are going to see this and be like yeah obviously but it's not that obvious and I've even missed this in code review myself a couple times in fact in the Ping video code base we actually had a problem where really deep down we had a use effect making sure you had a mic device selected and way above we had a default that would reset when you change things in very rare cases where your default mic device doesn't work primarily we noticed this was a thing on Linux users there was a very small but possible chance that would trigger an infinite Loop sending our websocket provider thousands upon thousands of messages per second causing us to get random thousand dollar bills it would happen once every couple months to a Linux user who would almost always have ad blocks so we wouldn't get good analytics and specifically log and crash reports so this was one of the most difficult things we've ever had to debug and this is with a small two-person web app company I can't imagine what this looks like at scale I say that but I can because I did this at twitch too and I have a video coming out eventually we're talking about the worst bug I ever saw where twitch had code that was triggering ad runs that shouldn't have because they were using a use effect to trigger an action instead of just figuring it when you click the button these foot guns are a huge part of why use effect is so scary to developers both inside and outside of the react ecosystem and why when you use it you need to use it with care we might not yet be at a billion dollars of costs from Bugs caused by use effect but I would be surprised if we're not getting there pretty quick I think it's important to understand the behaviors here if you are using react and use effect and while the foot guns are real I still defend it overall I'll pin a video in the corner all about why I still think use effect is overall a good pattern even if these syntactical decisions and behaviors aren't intuitive at first this isn't a reason to not use react it's just a reason to think a bit more about why you're using an effect when you use react and be careful because these infinite Loops can cost you a lot of money thank you guys as always really appreciate it and again check out the video in the corner all about why I think use effects actually for them most part a good thing because I don't want to seem like I'm just here to crap on it thank you as always peace nerds ## React's Magic Compiler You Can't Use (Yet) - 20240112 I'll be honest I kind of forgot about react forget it's silly to say that but it kind of disappeared it was announced all the way back in 2021 as part of react comp and I've only heard about it once or twice since in fact the dev that was leading the project originally has since left meta this had me pretty scared that react forget might have truly been forgotten thankfully it hasn't been and some of the stuff I've seen recently has me really excited specifically this tweet from Sebastian that spotted it on Instagram yes the react team is actually using forget in production now this single fact makes me so excited about forget again because I don't have any inside info for once I'm actually going to do a little more speculation than usual and we're going to try to dig into how react forgets being used and what a future looks like where we don't have to memorize everything ourselves without further Ado let's see what we've discovered and what exists because all we have are a few conference talks let's dive in first I think it's important that we build some context from the original presentation once again this was in December of 2021 over 2 years ago but it's very important context I want to make sure we don't forget the original promise of react with without memo if you want to watch the whole video I'll make sure it's linked in the description we're just going to skim through the important [Music] bits looks reasonable Jean hopefully I'm pronouncing his name correctly phenomenal developer really sad that he's no longer working on react forget because he clearly knew what he was talking about with this project it does seem to be in good hands though so hey what's up folks I'm Shin I'm a software engineer at meta so today I want to talk about react and memorization here I have yet another to-do list you know as JavaScript developers we just really really love to-do list who here love to-do list I want to see some ones in chat who here has built a to-do list to demo something On's in chat if you built a to-do list to demo something before this everyone's goto yeah I feel like there for every developer there's at least two to-do list apps so we enjoy the simplicity of the react code here on two when we open up the daa tools and we realize weever we add it to do or tle it to do all the add to-do is actually getting rendered as well this is the thing most people complain about with react in case you're not already familiar because react aggressively renders things whenever a parent node changes anything you end up with rendering occurring on a lot of things so in this case when you add a new to-do all of the other to-dos are getting rendered and even when you toggle one they're all getting rendered they're not reappearing on the Dom it's not recreating the node on the Dom but the virtual Dom which binds things between the react World and the the real world in your browser that has to validate at every step hey did these things change and if you want to opt out of that that's a thing you have to do manually through processes like memoization I'm going to skip a little bit again I highly recommend watching this whole video if you haven't already it's incredible it's a great 12-minute watch what we see here is a more complex example where you also have have a Color Picker where you can pick a color in the same window and whenever you drag your mouse around this it causes everything to render if you don't want that to happen if you want those elements to stay static I'll play it a bit feels much more Snappy 200 times is in pick a color to theme the user interface if we try this code out it works but the app feels pretty laggy and slow when we're picking colors and the reason is that changing theme color will reender the Blazing to leas and to lease which will eventually call a get a fer function again and again if we pay attention to the zoomed in number here it's been executed about 200 times yeah so what you do instead is you throw get filtered into a memo so you don't have to recall the specific function over and over again just because something else changed so long as to-dos and visibility haven't changed your filtered elements are going to stay the same fix this we can wrap the getter call with so this is the user experience we won y it shows that this get filtered gets called way less but it still has to render all of these elements if we skim in a little bit further this is but where things start to get chaotic with react even with this relatively simple example the relationship between all of these things and I love how the arrows are used here to show it once you're doing all of this memorization the very like top to bottom readable nature of react code gets a little bit lost and I I feel like that sucks it's one of the things that makes react code painful and this is when you stop losing a lot of the value of react when you run into these crazy memorization cases there are ways to architect things where it's not as bad like memorizing at different levels and such but it does kind of suck and it makes the control flow of your react components way more complex' be really nice if you could write your react components in the simple linear way that the first example was written without having the performance issues that are inherent to that style of writing and this is the compromise that they're talking about here where if you don't use memo the developer experience is great but you're going to start running into lag that my face is covering the word ux in the corner there so if you we're curious the DX is great without memo but once you're optimizing all the time it gets a little more painful and then ux quickly can get slow if you're not optimizing but the user experience way better if you do turn that this economics versus performance issue it's just so intrinsic to the model of react and doesn't look like we can optimize maybe we should use template rather than jsx but we just really like the expressivity of jsx or maybe we should go back to class or start with mutating stuff so it's easier to track what we think is there something that has been missing here today I want to give you you a sneak peek of some research that we've been doing that we think could solve this problem for the future of react to talk about this we need to rethink How We Do memorization like he says for the future he me when he said for the future of react he me when he said for the future of react tier he meant it because this took over 2 years for us to even start seeing it in the wild much less have access to it and look at this code again without aut memorization hook oh it's so pretty why can't code always be this simple the end of the day the to-do list is just a function that takes inputs from props and states and generate outputs such as UI and effects and the need to create intermediate value such as fter and handle change to do that to help with understanding we can also visual visualiz the dependency graph this way of visualizing what variables affect what things in the chain of dependencies here is such a good visualization and ideally your code should be as simple as this but once you have complex back and forth things get a lot more complex skipping a little bit again watch the whole video if you want to better understand the depth of this stuff the core Point here that I want to focus in on is the use of these magic variables that get updated using this memo cache the goal here is to automatically via a compiler wrap any code that could take time to execute and only execute it when its dependencies update it's kind of like signals such as what we see in solid and recently in angular but it's happening at a compiler level so the code you write is still very simple and procedural but the output is really performant and well optimized and the magic piece here is this memo cache where every value where it's defined gets a key in your cache and falls back on that when none of the dependent values have changed this can get even more complex once you have sub elements in children that do or don't need to be rendered and this lets you avoid memoizing components entirely by breaking out those children and referencing them from the memo cache if things haven't changed and also updating the cache if they have this lets you skip a lot of steps in just return an existing result instead of having to instead of having to recreate that result every time something changes this is really exciting stuff but where has it gone since like why haven't we heard about this for 2 years well we just recently have this is from react Advance London awesome that our good friend Jack Harrington was the one who streamed this which is dope all right so I'm Joe I'm an engineer on the react team at meta and in this talk we'd like to share our vision for client side react development specifically I'm talking about react forget uh forget is a compiler that we've built at meta that automatically memorizes your components and hooks so if you were hoping for us to be open sourcing forget today I am sorry already to disappoint you uh but we've made a lot of progress and we're excited to share more about that with you today uh so I'm going to be talking about what our vision is what forget is and how it fits into that Vision uh and then mof is going to come up and talk about our progress shipping forget at meta so to understand our vision for react it helps to look at some code here I'm showing a simplified version of an internal component from meta this component takes a heading a list of video vide and a filter and then it renders The Heading and list of videos that match that filter you can imagine the real component is more complicated the you know the filters actually State Etc you know but it's kind of simplified version so personally I think there's a lot to like about this code it's a small clear concise component it uses plain JavaScript values arrays uh we use standard JavaScript syntax if else for conditionals a for Loop for iteration no if else we're a fan of that is just an if with an early return if else isn't great just standard if statements a plus right we don't need to learn something new this is just the JavaScript that we already know use the platform so in a lot of ways this is react at its best UI as a simple function of data there's really only one potential problem with this code if we were to ship this as is we might see that parts of our app uh rerender unnecessarily and that can affect performance slowing things down so let's see an example of how that can happen imagine that our component rerenders but only the heading has actually changed when the component rerenders it passes that new heading down to The Heading component which updates as we'd expect my cat is screaming so much that I'm like getting a headache from it so I know you guys can't hear him but it is stressing me out I will be back in less than 2 minutes I am so sorry I will let the video keep playing so you have something to watch while I am gone but that's all that that's not all that happens by default when our component rerenders the entire component reruns this entire function reruns that means we create a new filtered videos uh list and then we pass that to video list which then also rerenders all the way down the tree and this will happen all the way down the tree even though nothing meaningfully changed about the videos to address this we can use two react apis use memo and react. memo so here I've applied use memo to the logic for filtering the videos the array at the bottom here tells react to only recompute filtered videos if the videos or filter values have actually changed so now if only the heading changes we don't recompute the list of filtered videos great but that's not quite enough because even though we're passing the same filtered videos down to the the video list component by default react will still rerender a component even if its props Chang important to opt out of that we wrap the component with react. memo so now we get the expected performance with these two changes now when heading changes we won't have to update the video list component great and if you judiciously apply react uh use memo use callback which I is for kind of the the call back version of used memo uh and then react. memo if you use them consistently throughout your code base you can achieve really good performance with react and a lot of other presenters have talked about that earlier we found that generally when applications do have a performance problem it's because of this kind of missing memorization and it can be fixed by just you know adding add add adding this back but this memorization has made our original code a lot less concise and clear I probably should have called this out a few places by now but I I want to really emphasize this point there are not many projects asides of react that will just come out and say something this bold where they have a solution to the problem but it's not a good enough developer experience so they're going to put years of work into working around it this is a bold statement and I wish we saw more of this from developers I think spelt for example does a really good job of this too rich Harris has come out and said outright that the way they did state in spelt was not good enough for large applications in complex State Management and as such the rethought state from scratch is a more hybrid signals based approach in order to make scalable State Management in felt possible and I love when big projects are down to be this type of honest and say yeah our solution just wasn't good enough yet we're no longer simply describing what the UI should be showing we're having to tell react how to process our code that's kind of losing some of the original idea of react right to Clara of rendering but now we're having to go into the the how and then our code reviews become about whether we've memorized correctly whether we memorize too little too much we get blog posts arguing that you should memorize everything blog posts saying that you shouldn't memorize it all you don't need memorization and the thing is that both of them are kind of right because it all depends on the context this code the original code here might be fine in a lot of apps but for other apps they might run into a performance problem but really with this memorization our code gets cluttered up with extra logic we're not just focusing on the core product experience we're focused on again how to achieve it it makes our code harder to read and harder to change so in a sense use memo is a compromise we sacrifice some of the clean concise original logic in exchange for better performance but why do we need to make this compromise at all well let's go back to the code the reason we started down this whole path was that we needed to use use memo to tell react that the video list doesn't depend upon heading but we're all developers we know JavaScript right we've already hold react that video list doesn't depend upon the heading in fact we've used a very well specified format of instructions that computers already understand to tell react that information it's called JavaScript you already know it I love that I was wondering what he was going to say there because there's a lot of things that specify this but because video list isn't a child of Heading Video list is not dependent on heading like it's obvious to us but the compiler doesn't know that and as such when one changes it has to render both and that's like a a pretty obvious design flaw that has allowed us to WR react as efficiently as we have and made it such a simple Paradigm but it also causes these types of problems that react forgets hoping to solve so why do we have to tell react again why do we have to also add in our used memo to tell react oh this doesn't depend upon these values what if react could figure that out automatically and better yet what if react could figure this out at build time when you compile your app and didn't you didn't need to pay a runtime cost this is a recurring theme of notice with recent react and meta JavaScript tools both stylex and react forget have leaned heavily into this idea of build steps to prevent user experience regressions even server components and server actions some amount are using build steps to create better user experiences really cool stuff and I like the idea of using compilers and build steps to make better outputs for a while react avoided this because react is just JavaScript and while I do think it's important in the sense that the code you're writing is just JavaScript this also comes at a cost that cost is that these more complex behaviors and finding solutions to these performance issues is difficult and they're trying to find a balance here where it is still JavaScript and more importantly you can still import any existing JavaScript code or JavaScript library and it behaves as expected but react can compile a better path out of it it's a really interesting idea rather than do some fancy Dynamic tracking of values at run runtime we could just figure this out ahead of time and avoid the runtime overhead so that's the goal of react forget it's the code name for this compiler that we built at meta to automatically memorize react Hooks and components let's let's developers write code without needing to manually memorize while achieving the same performance as a well memorized uh app and in some cases even faster so to make that really concrete react forget lets you write the original code I started with with no memorization while getting performance at least as good as the manually memorized version here moving this so you can see again that manually version is exporting the default react. memo wrapper of video list so forget really helps in two ways it simplifies the developer experience because developers don't need to think about memoization and it helps ensure that we're achieving Optimal Performance by default so let's take a look let's see will the swiping actually work all right hey okay uh oh wait hang on I forgot I got to grab the code let's grab that code where was it it's here somewhere I'm exit out let me grab the code got to make sure we get the right code that actually grabbing the code from the slide that's great over here so what I'm showing you here is our uh internal compiler playground I got some example code in there I I'll swap that out for anyone who's really curious about forget you might want to look at that code but we we'll go we'll look at this code nope oh I messed up I might want to go back and dig into that in a bit live demos gotta love it all right there we go so this is our internal compiler playround this is meant for us to use when we're developing the compiler you don't need to understand you know this this is a tool for us not for the typical react developer I'm just showing it here just as a way to demonstrate the compiler so again I pasted in the original code we started with right um and so this on the this is the input and then the this JS panel over here is showing the output from the compiler so let me zoom in a little bit to make sure youall can read that all right I like the dollar sign is use memo cache I'm sure that's not going to have conflict in any code base the output from the compiler so let me zoom in a little bit to make sure you all can read that all right that's probably good enough all right okay let me scroll sorry I'm like it's hard for me to see exactly way you can see all right yeah all right okay cool so uh forget now remember there was no memorization here but forget has figured out that it should memorize filtered videos uh this block is equivalent to a used memo so highlight all this this section here is all about memorizing uh filtered videos so what does it do so first it checks to see if videos or filter have changed forget figured out the dependencies automatically for this for for this value and then it takes the code that we wrote and just moves it inside right it's not reformatting our code it's keeping the the same code that we wrote um with a for Loop and an if statement and just moving it inside this memorization we call it a memorization block um and you know we have Source maps to preserve you know the source locations for this so so that all works uh so then after Computing the new value forget saves what the inputs were so we can compare them next time and then it saves the output right it saves the videos so now imagine that we render and and only the heading has changed well we check have videos and filter changed no they haven't so we go to the else block and we grab the the previously computed value so the net result is just like use memo right it's it's the same exact Behavior just a slightly more efficient implementation um instead of having to create a function expression which allocates memory not great um we can avoid that and just do a regular if statement uh instead of allocating an array for the dependencies and dynamically iterating them we're using static JavaScript code which can be optimized by the JavaScript engine but forget is actually memorizing even more right this is this is more memorization than we thought to do uh so you can see a bunch of stuff here let me scroll down and pick just one example so here's uh the video list so forget is actually memorizing the jsx element itself as long as filter videos hasn't changed we don't recreate the element and what this allows react to do is basically the same thing as as a react. memo so as long as filtered vide doesn't change we'll we'll uh put this exact same jsx element into our output and re when react gets to it it sees oh the jsx element at this spot was exactly the same I can skip rendering obviously if there's a state change it has to re render but uh in general just like react. memo uh and so this is where forget can memoize even wait I I just had to notice T3 spotted I think it's fair to say that react forgets officially supporting T3 more than a developer would typically think to do so okay so let's go back over to the presentation pick up here presenter view I wanted to see more of the code those are my notes all right and I gotta find my where was I okay uh yeah yeah okay that's all the other stuff all right okay so so that's kind of looks pretty magical forget just figured out what to memorize how does it actually work so if you're not familiar with programming language Theory or compiler Design This may feel pretty magical um but it's not magic it's computer science uh forget is a low-level compiler for react it's really specifically designed for react um and by low level I'm referring to the fact that forget builds a detailed you know internal representation of your code it understands the rules of JavaScript and it understands the rules of react and it can use those to figure out what parts of your of your application to memorize uh and these type these optimizations are things that are typically done by you know traditional uh you know compilers for languages like C++ or rust um in addition to some novel analysis that we came up with so that kind of together with understanding the rules of JavaScript and react we can kind of carve out a safe space for us to apply these optim one of the main reasons react native is so much better than any other solution is that they poured an absolute shitload of effort into making it possible by building all necessary bindings for both Android and iOS and in the future building them for other platforms and working with other companies to do it they positioned react native so well that Alternatives built for other languages like the I forgot the name of the Vue one but there was a Vue react native equivalent it was literally just calling react native components under the hood because it was so powerful if they're doing what I think they're doing here and it comes out in a good enough State I would expect to see a lot of other people copying this homework so by earlier this year we'd established a solid foundation for the compiler Okay so so this is in 2023 so by the beginning of 2023 they had a solid idea of what the compiler would do but it took over a year for them to get to that point from the first presentation about it that's actually a really interesting detail to have just snagged and we began a series of production experiments we used forget on increasingly complex and high traffic surfaces to tell you more about that part of the story I'll hand things over to [Applause] mang hey everyone uh wow I'm M Zen I'm I will say the little bit of inside info I have on react forget everything I've heard is that m is incredible in an absolute Legend This is my first time hearing anything from her so I'm actually really excited engineer on reacts and I've been working on forget since last June it is so exciting to be here and finally be able to talk about this project this year we took the forget compiler from an ambitious proof of concept to something that is now running on two major meta products that's right one of which is Instagram by the way you can now find this project out in the wild I mean some folks in the audience may have already used forget compiled apps our work is not quite done but I'm so proud of how far we've come and I'd really like to share with you our journey so far so about eight months ago we felt that forget was finally complete enough to start tripping at meta we had painstakingly walked over every Edge we could find in JavaScript and you know there's a lot of them um our GitHub repo held over half a thousand tests and each test checked that we were correctly analyzing and memorizing every permutation of valid react functions we could think of we had really crafted this compiler with Care iterating on its design with a lot of code samples from complex meta products and we were finally ready for our next step understanding how this compiler performs on real apps written by real engineers and on real devices does fret actually do what it's set out to do make any react app it touches better introducing our first collaborator Quest Store the app store for Quest VR devices Quest store has a large code base written in react native our primary goal was to free its developers from needing to worry about menu memorization I don't know if it was public info that the quest store was in react native until this I'm actually not sure so that's a detail I've known for a little bit and thought I couldn't talk about but that's really cool that that's now out there there's a lot of stuff in the quest ecosystem and in VR from The Meta side that was written with react native and they've used it as a test bed for a ton of really cool and I had no idea they were using forget in that and that is dope that is so cool to hear shout out to all the people working on that there's some really cool people doing cool stuff there while we were hopeful we thought our chances of actually improving performance were low Quest store engineers said had already spent a lot of time profiling in hand optimizing this app with used memo and Ed callback needless to say we also had to move with a lot of caution when integrating foret here during roll out every single test would run twice once using forget compiled code once without forgetting the pipeline at all soone as is the quest store in VR yes the quest store is a VR app you use like in virtual reality but this is actually a really cool point that I had actually thought about this before in terms of the dog fooding of react forget meta's inherently going to have some of the best react developers in the world that's just obvious that they're the creators of react and they have the core react team there to ask any questions if anyone's going to be writing react in a performant way it is meta so seeing if their compiler cannot just beat out an average react Dev or a below average one like myself rather seeing if it can beat out these really talented devs working at meta that's really cool and I'm excited to see how this performs compared to their selfand optimized code we also partnered with QA testers and even data scientists to check that we weren't changing product Behavior this is the product Details page on Quest store it shows uh well all the details of our product on the store this page is pretty complex as you can see there's five or six sections um that you can scroll or click through each section like gallery or about has its own complex UI La logic forget has now been entirely rolled out on this page meaning meaning meaning that every uh react component and hook is compiled by the forget compiler after enabling compulation we thought that page interactions felt a bit more responsive I was skeptical about this I mean that sounds almost too good to be true so to understand if forget actually helped we use the react profiler to record the re-rendering work following a click on the left Naf bar like clicking from gallery to reviews so this is the work done by one react render following the click before we turn on forget for anyone not already familiar with the react profiler this entire diagram shows a react component tree with each individual box representing a react component green boxes show components that were invoked during this reender gray boxes represent components that were not called as you can see many boxes are green here which means that this particular render required a lot of work um but if you remember from earlier a lot of Engineers had already tried to optimize this app so the gray boxes and those sub trees that you see is what they were a the work that they were able to save react now let's take a look at the forget compiled version to see if anything changes as a hint um keep your eyes on the components outlined in red okay ready damn that's a lot less work you have to [Applause] do so half of those over half of those rendered components uh kind of disappeared this means that rendering now requires much less work when using compiler optimized react awesome but I mean what was the difference we compared existing memorization in the code base with forgets output and it turns out compilers can do memorization pretty well often even better than hand optimized code so let's take a look at some simplified code from this page to see how so actually I'm going to full sizee that screen I think it's flashing and I'm going to click through a lot of slides hopefully that's better so this is some logic from an extremely strict down version of the media preview um component on this page it looks like a lot of code still so let's walk through it together media preview receives a media object which it renders if the media object represents a video we return a video card um we also a use call back don't need to go too deep in specific examples forget it by the way our compiler don't need to worry about making mistakes like forgetting a use call back they can just forget it by the way our compiler then if benefit we saw major improvements in interaction responsiveness what in production let's see are these numbers interestingly we also measured loading metrics like visual completion to be faster it turns out that the initial load of this page requires multiple reenders to initialize things like video state by memorizing according to its fine Grand understanding of reactivity forget reduce the amount of done work done during R render with forget R renders completed faster so that means we got our answer right forget is done and we automatically make our react apps better all the time not quite forget success here helped us gain a lot of confidence in its memorization strategy but we know that fast R renders are just one piece of what makes a performant UI fine grain memorization is great for interactivity but if a compiler memorizes too much it may adversely affect other app metrics we had a lot of ideas for how we can improve the compound output but first we needed more data instagram.com is a react app built for the web and presents a different set of challenges from Quest store didn't know that this was actually publicly confirmed already cool wied code translates directly to an increase in bundle size which may in turn increase startup time we also wanted to know if caching value vales created during render negatively affects memory constrained devices like older Android models and of course we hope that forget could make developers lives easier if you have visited instagram.com in the past month you might have used forget that's right forget is on Instagram Pages like profile in production than she was expecting Applause here and this this is Applause worthy like building a new comp piler for something as big as Instagram is pretty dope as you can see here so we're already gaining an early understanding of how forget affects metrics other than rendering speed on the profile page we measured less than a 1% increase in compressed code size and similar changes in retained memory in production we have so far seen no increase in memory related crashes or start out time instead we again saw slight improvements in visual completion okay those numbers are nuts they saw a 1% bump in the size of the like JavaScript output that's being sent to the user and no meaningful change in memory usage or startup times that's huge just like our results from Quest store oh and there's something I forgot to mention about all of this we used forget to achieve these results without needing to make any changes to product code forget can handle almost all JavaScript syntax we actually seen in use it current that's n that no product code was changed they just ran it through the compiler and it worked godamn understands 95% of components on instagram.com and we're working to increase that even further so what's left the performance wins we have seen from forget have exceeded our initial expectations however on the react team we have a really high bar for releasing products forget is not an exception here our Milestones are to First build a minimal proof of concept then a version that has almost all the necessary features carefully roll out to a small number of products getting feedback and iterating on our design we're at this stage now by the way um we're working to understand forgets impact on a pretty set diverse set of real real world apps and we're really confident about major design decisions but might need to make further adjustments and optimizations depending on data our next step is to scale up until forget is used everywhere at meta refining on small details finally when we have stress tested and iterated enough we release while we still have some work ahead of us we strongly believe that forget will help react achieve its Vision an ergonomic developer experience paired with great performance thank you that was huge I'm hyped also that the transparency here like it's nice that they're coming out and saying this directly like we are going to do these steps we're going to make it work internally and then we will release it good to hear this officially let's dig in gotta love that nice low res interesting this is just testing with a hook okay use Fu Con X is an array X push Y is X Y push oh that's a fun Edge case those the same array instance you define X let inputs in on chain use cach value nothing too surprising there I was hoping for some more interesting how it behaves stuff there yeah that was an awesome talk huge shout out to the team both Joe and M you're killing it I'm really Happ the progress on react forget I know this has been quite the journey to get it to this point and I know a lot of y'all are skeptical if it'll ever happen but if they're running it on Instagram's reduction code it's closer than we think and while it has been 2 years I do think we're close in 2024 might be the last year we have to write memos ourselves and react this is a very very exciting change and I this is what do you guys think about react forget this is a bit of a chaotic video but there's some really cool stuff in it and I couldn't be more hyped I'll pin a video in the corner all about performant react code and why you shouldn't use memo if you don't need to and whatever is below it YouTube seems to think you're going to like appreciate youall as always I'll see you in the next one peace nerds ## React's New Controversial Override - 20240508 remember when react patched Fetch and everyone got really mad at them so mad that as of a couple days ago they reverted the change well it looks like they're doing it again and just like last time I think it's a good idea and I hope you guys do too CU this will be a very nice change and this change is to a thing that we all love to hate date why would react patch date one simple reason that we're going to go into insane depth in hydration errors yes hydration errors the thing that everybody loves to complain about but not that many people have tend to have the same root cause and it seems seems like the react teams found a good way to solve it thank you as always to Andrew for tweeting a thread about this so we actually have something to talk about in a future react release it's likely will patch the date API during SSR and hydration to prevent mismatches I expect this to be controversial because people have convinced themselves that patching is automatically bad sharing this now to provoke you rather than later very fair point very fair point people get really mad at the idea of patching he goes a bit more in depth so let's see what he has to say before I go on my rant patching built in apis is fine if the patch behavior is standards compliant nobody finds polyfills controversial for example very fair point not only do we will not find polyfills controversial they often use polyfills for Behavior the browser already supports so like if your browser has like two string on all the stuff that you want or it has array sort methods or string replace all you don't need to polyfill it but a lot of people still do because their build tools do it and they want it to work on Internet Explorer so they just throw everything in we've done this for so long that like Frameworks just do it for you automatically we don't even think about it or talk about it anymore the classic anti- patching Parable is smoosh gate but that was about non-standard methods polluting the global name space the mechanism is the same but the implications are much different we should talk about smoosh gate so people can understand what that is smoosh gate was a classic issue that happened because of a certain Library named moo tools Mo tools was used for a lot of websites back in the day it was in the like jQuery era and one of the things it did was patch array it would adjust the array built in in the browser so that it would have additional behaviors that you might want a proposal for a JavaScript language feature called array.prototype flatten turned out to be web incompatible shiing this feature in Firefox nightly caused at least one popular website to break given that the problematic code is part of the widespread M tools Library it's likely that many more websites are affected so yeah here's the problem The Proposal author jokingly suggested renaming flatten to smoosh to avoid the compatibility issue the joke was not clear to everyone so some people started to incorrectly believe that the new name had already been decided and then things escalated quickly since mols added this on the array object that is a global future implementations and specifically future browser changes can't overuse that name or reuse it because it might break things and one of the big things they push for in the web is to not make changes that break existing websites it's been like the main key part of how the web works and it has its problems like we went through the strict ERA with JavaScript because of how bad old JS behaviors were but we're still going to be running into like this probably forever the patch fetch behavior in next is controversial but that's because the caching Behavior itself is confusing W spoken better than I ever could if you haven't already seen the video where I talk about this it should be out by now check it out not the patching per se if next implemented the same behavior via a service worker it would still be controversial funny enough they have a plan to make this better I'm still very excited to see how they solve the fetch problem in the cashing layer in next the education for next caching is the biggest problem just teaching it and understanding it is so difficult that I struggle to explain it to others they need to figure that out and they probably need much better Dev tools to show you as you're working on it but they don't have that so it sucks I also have the hot take that like fetch on the server is still a very new thing like only recently was UN DC added as the official fetch inside of node projects for a long time we've used a package called node fetch that was an okay implementation that felt a little bit like fetch on the server side there was no server side Fetch and that's also an important note here react's patches aren't to client side JavaScript they're not changing the code that goes to the browser they're not adding these polyfills to the browser they are just adjusting behavior on the server to better meet our expectations as developers and to have better default Behavior that work well for us and dates are one of the worst offenders of this type of problem let me do a quick demo const now equals new date cool it is currently cool and now buev should get us here it is currently 51 2024 23724 p.m. if we go to console no issues because right now the server and the client are running in the same time zone but let's say my server was located somewhere else then these things can start to break actually since this isn't a client component it won't but if I do use client where now this code's going to run on the client side we're going to start getting errors the reason that we're getting these errors is because the client side and the server side are generating different results because the server s side is generating this time and then the client side regenerates it cuz it's calling the new date again but the client side is now going to get a different time the reason is because this code this new date code gets run twice this might a little easier to understand if I do function get time console.log we got a new time now. to local string and then we'll use this instead if we don't have used client here and I run this we don't get anything in the console because this code isn't running on the client it's only running on the server and if we go here we see that we got a new time but if I go add back the use client this code now runs on client and on server so we see we got a new time here as well as here but if I refresh this we're going to get a hydration error because the time this got is 23856 the time this got is 23855 this sucks this sucks for a ton of reasons now imagine that the server and the client are in different time zones and the local time call that you made here generates a time for UTC or a time for East Coast or a time for India and your user is somewhere else the result of this code is going to be different that sucks that sucks really hard and it's really confusing to debug the vast majority of the time I've had or seen others have a hydration issue in react which by the way if you don't know what a hydration issue is I should probably explain that quick hydration is when you have HTML that the server gave you and then your client side framework like react reruns the code it needs to to attach the react JavaScript code to the element so if we also add in a quick like counter component function counter God bless super Maven for making this take literal seconds to do and now I can drop this underneath here we obviously need this code to run on the client but the server is generating this component still it's generating the HTML if we go to the network Tab and we look at the HTML that we got from the server that's not going to be the way to do that I am silly response copy this drop it here here's the HTML we get back from our server it actually includes all of this stuff it has the main it has the time div and then it has this div which is the one that is bound to the click so how does react know which div is the right one here if it's getting this HTML previously before something like next or server components your HTML would just not include these parts it would just be your skeleton and then react would run and add all of those parts on the inside since we now run the react code on the server to generate HTML the hydration step is how the react code gets bound to these elements and it does it by just rerunning the whole thing by recreating the top level main tag and then creating this counter tag it knows what the output look looks like and it's matching that output to the code that is right here the issue is when this HTML is different from what react generates on the client so if this react code generates a different thing than this react code does you get an error this is a problem because date times specifically are going to spit out different results on the server than they do on the client which is surprisingly common this problem exists because we're running this code in both places because we need to run on the server to generate the rate HTML and we need to run on the client to make sure that the code is up to date and all of the elements are attached properly the fix that I have tended to rely on is to not do this code in both places rather than having the get time function run on server and client I would do something like making a counter. TSX component move over this guy move over this too and since this is used client but this isn't this will now work without a hydration error go back to the console no hydration error because this code that generates this is no longer on the client in fact if we were to redefine this part we'll just throw this in counter cuz it's easier export function uh content return div we don't have get time in here and as I said we don't want to run this function here so instead we're going to do props content string and we'll render props do content so now we'll do content import that instead and this will also do the same thing because even though this client component is the one getting the result the server is passing this value this string that is generated to the content element that is a client component which means that that code this get time function only ever runs in This Server component file so you never get a different result on the client because this code only runs once on the server these have been the solutions for a while but wouldn't it be nice if the date helpers in like the date function in your react code didn't have these edge cases where you had to restructure your app a little bit in order to pass the right things around I did see that we got a response from uh somebody from the Marco team who uh love Marco love the guys working on it love Dylan great developers that's the team that Ryan carniato from solid used to work on believe it or not there's a lot of really really good work being done by these guys but their their pushed for resum Ability is a little frustrating if you don't know what resum ability is it's the alternative to hydration where instead of having your HTML get linked to your JavaScript code by rerunning it you'd leave Little Helpers in here like I D equals like index page main 7 do whatever and these IDE identifiers are used in order for the code here to know what it's linking to it's a much more direct way and the result is HTML that has a lot more stuff in it you can check out how quick used to work and even how quick two works if you're curious about how that stuff behaves the goal of this is such that you don't have to rerun the react code on the server and on the client because it just knows how to link things you still end up with a lot of these problems though if any of these links go stale or the expectation that the JavaScript code has is different from what's in the HTML not hydrating gives you a separate set of similar issues I don't think it's fair to say you need resum ability just because date time is confusing when you run date time in two places I I think this is fine I actually am quite fond of the idea of solving this at like the datetime level people are going to be upset what would the patch actually do during hydration instead of returning the browser's current time it would return the time that was used during SSR so that they're the same oh hm dur it's always returning the time from SSR I guess that works but this is doing something I didn't think it was doing that I'm a little scared of which is that it's patching how date works on the client side which is misleading from what was said here they passed thepi during SSR okay and hydration I guess the and hydration part makes sense but that still feels a bit weird yeah I have feelings the the use case I see this fixing would be okay let's go to content instead of this using counter we're going to do something a little different here we're going to have const current Set current props that content is that an aut that's actually good okay not quite we can go with it Set current this would be uh new date. to local string I want to see clicks I want that to say current time and now uh when you click this it's going to update to the the new current time so we get this one from the server and when we click it updates to the new one on the client the issue here is that right now when we past that it's fine but if I change this to be new date. to loal string we're going to get the hydration error again because the server and the client are getting different results because this component is generating HTML on the server and then it gets rerun on the client where the result of this is different H that being fixed is nice but it does feel a bit weird that on the hydration pass date does something different I'm a little scared to see what that polyfill looks like my Hope was that they had done something the other way which is almost like prevent date from being called or using data that they have from the network request in order to bake in date properly so I'm curious how this ends up being implemented in working I happy that they're going after date because I firmly agree that date is where most of the issues people have with hydration errors are coming from I am very curious how they end up implementing this but I do have High Hopes maybe just maybe people will stop complaining about hydration errors when the most common one goes away let me know what you guys think and if you have hydration errors that aren't related to date time let me know because I don't see a lot of those and I'm actually really curious until next time peace nerds ## React's Next Big Change_ - 20240224 we talk a lot about react but we don't talk enough about the package that powers it react Dom if you're not already familiar react Dom is the package that does most of what we think of when we talk about react not the component tree but the actual rendering of it and putting it in your Dom when you use a div inside of a react jsx return that's not part of react at all that's a calling to the react Dom package that has created all of these bindings for all these things that might exist in the browser and we're not even talking about react native yet let's be real the stuff's kind of complex so before we dive into the new package react strict Dom I want to give a brief overview with a couple diagrams so it's a bit easier to digest so if you already know all about the react Dom feel free to skip to the part where we're talking about the new stuff but strict Dom is interesting and complex enough that I want to make sure we have an overview of the fundamentals first so let's get started one of the easiest ways to think of a react app is as a bunch of little nodes so we have app which is our top level node for our application app has some children we'll say that this app has a first child of or we'll call this top nav and it also has another arrow which is another subcomponent here of page content we'll Pretend This is the code for the app pretty common stuff you've all written something like this before at your top level you have the app as the top nav and a page content maybe instead of having these blank tags you have HTML open and closed maybe you wrap page Con in a body lots of different things you can do but for the sake of this example we're going to pretend you a normal HTML page and you don't need those tags top nav we're going to this really boring page content I want to actually draw out here though pretty simple component again this is getting mounted in the app as page content react is thinking about all of these notes within the react virtual Dom which I should specify here this is the react virtual Dom we have this hierarchy this tree we have the app at the top we have the child top nav and the other child page content these are different elements okay technically the top nav should be in the body element I'm going to change this to be main instead of body Fair Point there shush anyways this is a pretty typ iCal react experience but what comes out of this I'll write the code first I think that will make sense I think we can all understand how this react app becomes this HTML in the end this hopefully is somewhat clear to you and if not definitely go check out some deeper react tutorials especially like the react docs I want to make sure we understand at the very least that the result of this diagram and this react application we have here that effectively this becomes that this Java script and react going in results in this HTML going out an important thing to not is that the only elements that actually exist within here are the ones that we have called that are real HTML so these lowercase Main and div and these things these map to real HTML elements whereas everything else is a virtual fake element that only exists within the react World so you can have these open close like fragments you can have named functions and none of these things map to real elements in the Dom there they're just there in our virtual react World so we can compose and compartmentalize and reuse these pieces if we were to try and diagram this the same way it's not too hard here have the HTML have the body and then from body we have two directions we have the nav div and we have the main content and within the main content is where we have everything else so in here we have once again a straight down div and this guy just say text content of hello world hopefully you guys can see how this HTML represents this tree and vice versa the reason this is important is the actual thing that translates from here to here that is the react Dom so if I was to copy this guy paste it there copy this guy paste it here we can draw some important relationships here where first and foremost this kind of ties to here but not real again this doesn't render anything so this isn't a hard tie I'll mark that with the triple Dots here because this could be done via server rendering with next is going to be done via having an existing HTML scaffold and then you just Mount react to a certain node but there's going to be something on here that's like document. getet element by ID or app or whatever and then you call the react render code create root is a function from react Dom note again this is coming from react Dom because the ability for react to update your Dom comes from this package so we create roote using that we find the root element that we want to bind to and we call render on the create route with actual app this is how most react apps are actually started you'll often have this code hidden from you because it exists in something like nextjs but this is where the HTML in the page in the react code that we're talking about get combined into one cohesive thing so whichever element this is being bound to that's how that happens it's probably going to be body not HTML but you get the idea and now for these other elements these are going to be more direct ties this one I'm going to not do the dotted line because this one once the root has been rendered this is a deterministic relationship these things are attached together together the top nav component renders this and the page content component renders that and we know that because if we look back here we see what the page content renders and which react Dom elements it's binding to but react Dom is how app gets bound and then consequently how the relationships between your react components and the HTML elements on your page form here's where things are going to start getting interesting though because react Dom isn't the only way to render things with react I have a whole video about this called react wasn't built for the web where I showcase a lot of the different things you can use one quick example is react 3 fiber if you use react 3 fiber you'll know there aren't too many traditional HTML elements you're calling we still call Mesh but a lot of these other things like box geometry ambient light spotlight all of these different things we're calling instead these come from react 3 fiber bindings Instead This difference is important because react 3 fiber isn't using the traditional reacton package it's an alternative to it it's the thing that turns the react code into what you're trying to render and builds that relationship between the two it's the translation between your react virtual Dom tree of components and what you actually render this is even more so the case with react native here's a pretty standard recently initialized react native application and you'll notice here we don't have divs we don't have spans we don't have any of the things we're used to we're actually importing text in View and yes if I was to write text here it's like hello and I didn't wrap this in a text it would crash at runtime it wouldn't work if you're already reative this probably looks insane to you like why are you importing this custom thing called view why not just use a div why do you need to wrap everything with text it's not even span why not just use span why are we passing Styles as an object to all of these things what's going on here well what's going on here is there isn't a traditional browser Dom on the other side the way the react Dom package works is it binds every single thing you can reasonably do in the browser to a helper in react so every potential lowercase HTML element you might use is accessible within react as long as you're using react Dom but now if you're targeting a platform that isn't a traditional platform targeting the traditional web Dom you can't just dump all of the things the web can do in and expect it to work hopefully you're starting to see where we're going here the interesting piece is that these limited sets here where you have to import the allowed pieces instead of just calling whatever you want wherever you want as scary and big of a change as that is it actually gives you a lot more control over what the developers can and can't do with your application it also means you have really good control over those core Primitives you can build the exact building blocks you want and keep people from using Marquee which crazy enough despite being deprecated they can still use nowadays I'm not saying that's a bad thing I think that react Dom is the way most people use react for a reason in fact if I go to npm Trends you will see the vast vast majority of react users are also using react Dom these things are very very closely knit and there's a reason for that because usually when you're writing react you're targeting the web and usually when you're targeting the web you're using react Dom as the connection between the browser and react if we add in react native for reference big difference re na is nothing to be scoffed at like these numbers are still insane getting 2 million installs a week for anything is nuts when you compare that to the 22 plus million that react and react Dom are getting it's a different world so again why are we talking about this well I have to do one more important tangent which is react native for web this might sound insane if you consider what I just showed here where we can't use divs we have to use views we can't use spans we have to use text we have to use the provided pieces why would we ever want to use this for web wouldn't we want to try our best to avoid this and just use react Dom not everyone believe it or not there's a lot of things you can do in standard HTML and in the standard Dom and browser that are probably not ideal and that you might not want to have especially at a company with a lot of developers that might vary in experience you might want to be sure nobody can make a span you might want to be sure nobody can do a Marquee in 2024 you might want to have a set of custom components that are your core building blocks and not want people to have access to the HTML outside of that so when I'm discussing react virtual Dom imagine a line here this line is the wall separating the react World from the things that actually get rendered this is where react virtual Dom lives and if you wanted to control what things on the other side somebody has access to this is the place for it I think understanding the history of react native web and the goals that they had will make it a lot easier to understand the chaos going on here the history react native for web is fascinating retive for web was started in 2015 by Nicholas Gallagher during the development of Twitter's Progressive web app it has evolved from a framework inspired by react native into a mature and pragmatic compatibility layer between react Dom and react native react native for web is currently used in production web apps by companies including meta Twitter and flip cart one of these is not like the others anyways software Engineers from meta Expo and elsewhere continue to contribute design and patches to the project developing a web compatibility layer for react native involves balancing the needs of highquality web web apps with the value of the react native API compatibility there are instances where parts of the react native API are co-opted to infer information that is necessary or beneficial to products running in web browsers other times there are use cases that are not accommodated by the apis provided even when the information cannot be pragmatically incorporated into the existing react native API design constraints it still helps to inform which API changes are needed over the long term the evolution of react native now involves developers who work on react native for Android iOS web Windows and Mac we aim to help designers and developers with shared platform agnostic react apis that reduce the time to market for highquality multiplatform products so there are a couple pieces here that I really want to dig into first is that this started during development of Twitter's Progressive web app what does this link to how we built Twitter light for what it's worth the Twitter light codebase is now the majority of how Twitter's components work it's become the standard for the Twitter web experience it is my understanding and if anybody has a link to prove this right now it' be very helpful that a huge reason why they chose react native for Twitter even though they're not using react native anywhere else they used it for the web app because they wanted to limit the set of things the developers had access to to give a a more controlled and consistent experience on the developer side and eventually as well on the user side but how does using react native achieve that by giving you a strict subset of what the Dom can do that is defined by a team that puts a lot of effort in to make sure it's exact this is a quote from Nicholas who was the guy who started react native for web at Twitter for their web app despite not using react native anywhere at Twitter at all we just wanted a higher level API than raw Dom and predictable Styles those are huge pieces there so something you might have noticed is how thin this line is between these things when you make the page content component I showed before you render the main directly then you render the div underneath it directly after you don't really have a way to make sure divs always have the things you need like accessibility you have no way to make sure images are handled properly in all the ways you can render them there are lots of different ways to do everything and yes theoretic ially in your code base you could forb using divs or image tags and build your own custom thing that calls the Dom for you we even see this in projects like NEX that have lint rules that nudge you lightly in the direction of hey use our image component because the one built into the browser it's a lot harder to work around the distance between these sides and the size of the react virtual Dom layer very very small with the traditional react package you're effectively calling react Dom which calls the Dom directly there's very little abstraction between these pieces so if you want to have more control of that layering you could build custom components for it but now you have to deal with all the other platforms you might support in the future and developers just working around it and calling a div anyways and doing things wrong the power of this system and once you've built a strong extraction here when you build an actual rather than just a line here a wall a gap between these two where you're picking what each side has access to they might be harder to do something this wall doesn't account for it's also harder to do something wrong if they've built in this way think of it almost like a super super opinionated component library that you have to use for everything there's a ton T of benefits here one of the big ones that got called out as I hinted at earlier is predictable Styles if you've worked with CSS in a big code base you know that CSS is not predictable in fact cascading is often kind of evil a lot of why Styx was made was to help address this if we go to the thinking in Styx page deterministic resolution is a really important piece of why they built this one of the specific goals they had is to keep things from affecting other things don't have a component that has a style that affects its children the last style applied always wins this Mak life significantly easier this combined with things like their focus on modularity and composability it makes sense why having Cascades affect everything underneath them it's not the best behavior when you're building components not Pages this difference is huge a lot of how CSS in the Dom were built was the idea of a page that was static that a server rendered and when you need new data you load a new page these patterns are great in those environments where nothing's being reused but that's not what's going on here once we're building components that are being reused across hundreds of pages and thousand thousands of views you might not be able to think of now those behaviors kind of suck which is why with react native they ignored all of that and went and did their own thing and the thing they did turned out to be in many ways more maintainable on the website too because all of these weird behaviors went away containers are limited to what they're defined to do and if you have a child that you want to have behave a certain way you tell that child to behave that way you don't have a container that Aeros selects certain subclasses to try and Brute Force certain patterns none of that works at scale that barely works in small projects here's where we're starting to get into the new stuff so uh anybody who skipped to this part Hello nice to see you we're going to talk about a new Dom when react native was started the team thought about web the good parts accessibility by default Flex box versus floats and removing cascading from styling we tried to design our own thing to do that that was bespoke and yet another thing to teach now we're looking for The Best of Both Worlds with web compat good stuff and that's what I'm seeing here too I think this is the perfect way to transition to where we're going now which is react strict D meta just open source react back strict Dum which aims to unify apis between web and native to share as much code as possible before I go too much further I want to disclose my personal bias I don't love the idea of one codebase being used for both web and mobile as an application developer the reason for that is simply because web experiences and mobile experiences differ in a lot of ways and I could believe you're writing one codebase to make a good iPhone and Android app but the way the web works and the way we interface with the web even just the aspect ratio of the screen is different enough that one codebase all these targets still not in love with that pattern just yet I'm getting more and more convinced and as resources like this are created I see the value there but I'm not looking into react strict Dom exclusively as a way to write my code once and have it run everywhere as an app developer I'm kind of looking at like that as a package developer if these tools make it easier to write something like a style Library that's reusable across everything awesome A+ really cool but when I look at this as an appdev I don't necessarily see bunch of things that I'm rushing to go do to have one codebase target everything but it's still very interesting so let's dig in react strict Dom is a subset of react Dom imperative Dom and CSS that supports web and Native targets very interesting it sees itself as a subset of all of these things that already exist but we're trying to pick the pieces that we can correctly assemble the most reliable resilient and accessible ways reactdom is an experimental integration of reactdom and stylex that aims to improve and standardize the development of styled react components for web and Native the goal of RSD is to improve the speed and efficiency of react development without compromising on perform performance reliability or quality building with RSD is helping teams at meta ship features faster to more platforms with fewer Engineers to support native platforms RSD Builds on the design goals of the react Dom for Native proposal by poly filling a large number of standard apis and by leveraging new web capabilities coming to react native such as Dom traversal and layout apis as well as a well- defined event Loop processing model react native compatibility is a work in progress please see the compatibility for a detailed breakdown again if you're an experienced existing react Dev this might be stressful to see HTML L.D html. H1 it's a bit different the reason for that is we're importing the HTML tag from react strict Dom because we're not inferring a bunch of random stuff just by having the react Dom package anymore we're explicitly doing the thing react native did here because we explicitly want to make sure that we're calling that set of things that we've defined and allow this is more things to write for sure in the future it's possible we have plugins that just do this part for you but I think it really emphasizes the concept here where HTML is no longer a thing that's inferred because you have react Dom installed now HTML is a thing that's provided by this react package that you can consume adopt wrap do whatever you want with another important part is that CSS is a shorthand for calling stylex as they mentioned before you'll see that CSS and HML both imported from react strict Dom it's a weird thought to import these existing browser standards from a thing named react so we can call a strict subset of them but it gives you way more control again especially at the scale these companies are working at they want to make sure nobody's mounting some weird component or some weird HML element in a way they're not necessarily supposed to here is the original RFC for this proposal written by Nicholas back in 2022 this is the guy who originally made react native for web and now he is working on react fulltime it seems yeah at meta cool he went from Twitter and building react native for web at Twitter to working full-time at Facebook and meta to build the future of how we render our react stuff there a proposal to incrementally reduce the API fragmentation faced by developers using react Target multiple platforms via code shared between native and web the proposed crossplatform user interface apis are a subset of existing web standards for Dom CSS and HTML strict dumb the proposed changes are overwhelmingly additive and do not require migration of existing react native UI code deprecations are optional or follow-up work Neal progress can help to reduce the fragmentation between react native and react Dom components while the ability to run react Dom code with minor modifications on Native is a longer term goal this is a very important piece here as well it seems like one of the strict goals of this is to allow for component libraries to be written in one place and adopted in multiple places is it possible for me to import a package that has components defined in strict Dom into a project that isn't using strict Dom that's using just the standard react Dom can I treat these as components and just render them in there as someone who spent a good bit of time hopping between react for web and react native I can tell you there's a lot of things that just come with the web that are both good and not necessarily good that means that writing code in one place and expecting it to work in the other is far from a guarant and expecting the browser's standards to be applicable and even useful in many cases is also very far from a guarantee something that was learned with react native for web is just how useful an abstraction from the web can be for making more guarantees about how things work and this project is going a little bit further making this strict subset so strict that most of the behaviors you would reasonably want to encode are cross-compatible between not just the web but also these Mobile and other native platforms where when you render a button you're not rendering an HTML button you're actually calling native Primitives to do Native stuff there's a couple things Eli from the react team said in chat that I think are really useful here one is this bit here it's important to remember react native teams principle number one said their top priority for react native is to match the expectations people have for each platform this is why react native renders to platform Primitives as I said before they don't render some magic react thing the same way you would in something like flutter where it's his own engine nor are they just embedding a web browser inside of your app they're actually calling a native button a native touchable native tab bars or all the things that exist in the native platforms and now they're just trying to make web match that a bit better we value native look and feel over crossplatform consistency but in order to make the web a more consistent platform they can restrict parts so that you can transpile one piece of code between the two more reasonably this is why Eli's comment here makes so much sense too do custom what should be custom but don't duplicate what shouldn't I think that philosophy is very apparent the more you read this RFC the more you understand what they've built here that's a weirdly familiar diagram I swear not see this before I was working cool so the react native API first layer it has the element API on the react native side these would all go to the react native findings isn't available yet it's just meant to be an example so I swear I didn't see this diagram until now I'm not copying it it is a little bit different from what I was drawing but the excal drawing is is very much in tune with the channel so re native API has all of these pieces it has the element API the props API the style API the event API and we have to have bindings for these to react native as well as react native for web so the element API has bindings to things like the animated flatlist as well as create element and these all in the react Dom get translated to these specific things that were actually trying to render in specific behavior so we're trying to assign to those things but when you call something from react native it has to be bound in the react native for web package and then point to the actual react Dom Elements which eventually become Dom elements underneath this is a bit chaotic but you get the idea that we call things in react native that are then abstracted and call the right things on either native or web accordingly this is the most complete widely used shim but comes with considerable DX and US costs on the web the existing solution for targeting web with react native is to use react native for web react web is a user space Library built on top of react Dom and Native Dom apis it shims the react native components and apis on the web the tooling for an existing react Dom app simply maps to the react native export to react native web yes as I said this is just a hack you use react native on the web really powerful hack and lets you limit a lot of things but it is also the most complete solution and it's a widely used Chim but it comes with considerable DX and ux costs on the web the shim must Implement a large surface area of fragmented apis and it needs to modify standard apis and objects like events to match the react native's non-standard implementations yeah there's a lot of little things like react native does different like one really dumb example is in react native Flex is a column instead of a row by default which is a really good decision when you think about how Flex would be used on mobile by default but these defaults are different and how events are processed are different how things are queued are different how Styles collapse are different all these things are different the go of react strid is to take the subset of things in the web that can and should work the same way and pull that out so here we have the react strict diagram where again we have the react strict API has all of these pieces and the react strict package for web is hilariously smaller 4 kiloby instead of over 70 where it calls the react Dom set of things we actually want directly and the event API does similar and now we have a similar react strict Dom shim to Native so instead of react native being the direct Target here and having a translation layer to go from react native to web we have the strict subset on top of all of these and on one side it gets translated to react native and on the other side it gets translated to react Dom but by building this abstraction we're able to be stricter about the behaviors on all of these things and write the shims necessary for everything to to behave similarly across all of these places this diagram is really helping it click for me seeing that we now have separate binding layers on both sides to go from the strict Dom abstraction to the right thing on both platforms or all platforms so to speak in contrast implementing a strict Dom subset in react native shifts the the weight of bridging native and web apps onto react native where it can be done most efficiently although react native won't support all the features available on the web it will support a greater expanded feature set relative to react native today on the web we will only need to combine a react Dom with a white label CSS compiler like Styx again the only layer needed now is to deal with Styles because the way Styles work are not how anything works on any other platform CSS has its own weird cursed thing and I know I don't agree with everybody on it but a lot of the things CSS does by default suck and it's cool to see somebody as big as meta committing to building these types of abstractions to try and push away all the problems they deal with there it is actually hilarious how close this code is to what they ended up with being that it's 2 years old but shows they were committed here's an example of a vstack panel component that has events for pointer down and pointer up as well as an html. div with children onclick refs Styles Etc but wait how are we going to render the html. div on something that isn't HTML these are all the elements that exist in HTML that are access accessible in both places but we don't have an article in react native much less in iOS or Android so we just bind that to a view aside we bind to a view block quote we bind a text BR we bind a text button we bind a pressable code we bind to text etc etc we have bindings for all of these default HTML elements we want to support to a corresponding is existing native package for react native this is really really interesting even the Press is animated by default because we export an animated pressible assuming we wrap this somewhere yeah if native component is pressable the native component equals animated pressable export function create strict Dom component component extracted forward ref thought we were done with forward ref guys what happened how do you all start using that I thought we were over with that anyways bunch of crazy abstracted code that's goal is to make sure you render the right component depending on which environment you're in and that it's close enough to the thing you're trying to render so the behavior is roughly the same looks is not all that matters complex interactions matter more than styling that's actually a really good point here something like a tool tip would work really well with this environment where we want things that behave the right way in many places even if they look slightly different in all of them as per usual dance perspective on the new thing is actually really useful this looks like a spiritual successor to react native for web but approach from the other direction web API is one so react native is building support for a strict subset essentially you'll be able to render a div in react native compat table reflecting current state this was the compatibility doc that we were just looking at before the exciting part is that it's almost zero abstraction on the web CX generates real CSS classes at compile time strict tags are single component rappers on the native side there are shims that massage the props but hopefully with time react native will add direct built-in support the non-technical exciting part is the blink and you will miss it acknowledgement in the readme that meta is actually using this which makes this the first crossplatform react solution targeting both web and Native with the same components that meta is directly investing into that's a really big point to call out here previously meta hasn't invested in these specific multi-platform Component Solutions because they build the right component for web right component for mobile the right component for VR and react native is mostly a tool for us to make things using the same mindset but now it's just not just the mindset it's the actual code itself being sharable react native web's approach was to polyfill the react native apis on the web and it has a bunch of flaws that aren't fixable two thick run times are abstractions on the web yeah I understand react STD's approach is to polyfill good web apis on react native instead and to rely on the ongoing effort of actually building those apis into react native so it's rather than taking the bad parts of the web and throwing them away it's more taking the good parts of the web and bringing them to react native by making the subset that fits everything together well I don't envy anyone trying to explain to iOS only or Android only devs that the html. div they're seeing is actually native yeah this has already been a problem ah see people tagging me in all legends for making sure I saw this it's a very very interesting development and as per usual Dan put it way better than I could so hopefully this was helpful in building your understanding of what the hell is going on here because this is one of the most interesting developments in the react World that most people aren't going to touch or play with anytime soon if ever at all is different I'm actually really excited to see where it goes one last check with Naman as well as Eli to make sure I didn't miss anything too important currently react native only makes it easy to share business logic or data loading with web but not UI so much UI is often the same let's work on sharing it react conri Dom is only one part of our Research into this oh boy those are some big promises suppos the form the steps that react native follows to perform tasks on the JavaScript thread and how that work is synchronized with rendering work in the host platform o boy this could be its own video from what I know and what I don't know and what I have to research if you're already familiar with the event Loop in JavaScript you have one thread that does everything if you want to have something that's processing background data that a User submitted but it's also rendering the page component content this model doesn't work great and a lot of why people think react is slow is because the thing that updates the web page is being blocked by things going on elsewhere otherwise and if we build a event Loop processing model that guarantees The View changes are happening in the correct order and is aggressively as they can this is really exciting stuff big part of why this matters is the rendering work being done on each platform is so fundamentally different that making sure events are synced properly and the Order of events is correct when you're using the same code in all these places it sucks it's a silly example but if we go to the jQuery 4.0 blog post I talked about this in my jQuery 4 video just one dumb example jQuery orders the focus events as Focus out first then blur then focus in then Focus the previous w3c standard was Focus out then focus in then blur then Focus but every browser ignored that for some reason went with blur then Focus out then Focus then focus in eventually the w3c caved because everyone was using a different behavior and they overrode the spec in 2023 but the fact that there were these three different orders these events could be in is terrifying the fact that you might have to think about which one happens in which browser for which reason at which time is horrifying now multiply that by itself and add an exponent on top for when you're dealing with Android and iOS and Windows and Mac and virtual reality and the web which event going to hit first good luck have fun having more well- defined processing for all of these things is increasingly essential the core thing to notice here is that this code can run in both react for web and react native this a big deal because me in window and these types of references just don't exist in react native I've went to Hellen back trying to figure out how wide something is on a given platform but these web standard apis not only are now accessible inside of react native where they have to have crazy native shims built but they actually occur and run in the same order with roughly the same experience across these platforms so you can call something like measureing window in a layout effect which is running synchronously instead of asynchronously and know the behaviors are going to be exactly the same across these platforms that's huge you even do stupid things like set the state of the value that you get here and have this come back the same way and roughly the same time instead of having multiple updates triggering flicker this will block and then render once we have it like these types of things were not possible before as silly and simple as they seem you couldn't really write code one time that had anything to do with these behaviors and have it rerun other places if you were just doing axio data fetches with react query this code would have been reusable but as soon as you're doing anything that has to do with the platform itself that's where things start to fall apart and that's why rebuild build the event Loop rebuilding the Dom access layer rebuilding these things is so useful because it's trying to make an abstraction that works for everything not just your Styles and certainly not just your Ed queries but for all of the glue code we spend our time in to try and make these things work properly together if this was some random startup trying this right now I would probably be laughing at them but it's not it's a big company that's shipping this in production already and it's not just any big company it's the company that brought us react and react native already this is a a bold bold old research project and I'm very excited to see where it goes the main motivation for this proposal is to fix a series of problems in react native that prevent it from implementing the react programming model correctly program model defines a series of abstractions and assumptions that developers can rely on to build applications independently of the platform they are targeting if you look at the react documentation everything under the react package not in react Dom should work the same way across platforms but that's not the case for hooks like use layout effect use layout effect is a version of use effect that fires before the browser repaints the screen for giving there mentioned of the browser in react native use layout effect is not guaranteed to run before repainting important call it call use layout effect to reform the layout measurement before the browser repaints the screen react native layout effects can fire before layout information has been computed so accessing layout information can provide stale or even incorrect data these are all the types of things you don't think about until you've had these problems and then they suck and are impossible to work with and use the main goal of this Hook is to allow multi-pass renders without causing UI thrash in this goal is not accomplished in react native with its current semantics another important motivation for this proposal is to increase alignment with the web platform again they're trying to make these things that are useful in the web accessible in these other places oh one more important piece they called out here is by having these reliable event Loop behaviors they're able to make optimizations they couldn't otherwise these things behave differently and people build around those assumptions in these other places they're probably screwed and now trying to optimize that with something like react compiler it's not as viable if these behaviors are so different which is why I'm so excited to see what they're working on here this feels like its own massive Rabbit Hole I could go down for a very long time I want to focus on the strict Dom but yall should let me know in the comments if you want to hear more about the new react event Loop which seems to be increasingly a thing going forward let's give Eli a quick zoom in on this message to make sure it's clear to people that none of this is big things the react team is promising this is not the same tier as something like server components and all the things we heard about in the react Labs post where all of that is work they're committed to not just doing but seeing through to completion this is them trying new things to figure out what does or doesn't work and including us in the process more than usual which is awesome because not only is the react team open sourcing these things sharing their rfc's and bringing us into the process we have the person helping run a lot of the team in my chat giving us tons of useful information as we film that's surreal having this level of involvement from the react team when they're this early on something is really really cool and I wanted to make sure we called that out for what it is because of both how rare it is and how awesome it is this is the equivalent to stage one of TC 38 I TC 39 well cool yeah huge shout out to Eli huge shout out to Nan who I'm sure has sent something somewhat recently yeah here he is correcting me about use a and use lout effect absolute Legends dope to have them here it's so cool to see and learn more about how Facebook and meta are thinking about these Technologies and the things that they've built huge shout out to the team huge shout out to everyone involved building and sharing this cuz it is actually really exciting I know the meme is that we just talk about react all the time but there is no other framework doing this level of research on not just the web but how we build as a whole let me know what you guys think cuz this was a very interesting project and I'm definitely going to be talking about it more in the future but until next time peace nerds ## React's Third Era - 20230209 I think it's fair to say we have entered the third wave of react wave one was the introduction of components and generally the concept of react I'd say jsx was kind of part of wave one because react didn't really take over until it was added but Wave 2 was for sure hooks when hooks were introduced to react the way that we built components architected State and more importantly built libraries and things that worked around react fundamentally changed a lot of react staying power came from that second wave and how hooks brought it back to life and made the thing that could have gotten stale really exciting again instead and react continued to be the framework of choice for a long time it's exciting to see so much Innovation happening in JavaScript Frameworks again but react isn't going to slow down we are now entering the third wave of react the server era of react it's really cool to see because For the Longest Time react has been a client-side framework focused entirely on how to make the experience as good as possible once the JavaScript loads on their device it's been up to third parties like versus salon next JS or remix and other Frameworks as well to try and make the best possible experience for static content and for things that don't have JavaScript loaded yet reacts accepted that these trade-offs are worth investigating and the future of react is server first react is no longer a client-side library react is now a server-side framework that happens to ship a client-side bundle and that is a huge huge change this shift has been highlighted by Andrew leaving the core react team to join versel he said that the new next version felt like the real react 18 release and as controversial as that was I do think it's telling and how the react core team's mindset has changed and in the same way that react now is moving to the server the react core team is moving to the company that provides the servers and the framework that does that rendering next.js and I think this whole shift towards the server is a thing that react is consciously doing both in the framework and in the team and positioning and what's really interesting is how they're not locking others out next and react could merge they could become one framework and it would be possible for versel to Fork react and take control of it that way I don't see that happening versel seems to be interested in being the open source Steward for the react ecosystem and that doesn't mean locking out others from building their own tools it means moving react to the server moving The Primitives moving the standards to the server so other Frameworks can build around them the same way they did on client right now feels like the change that happened with hooks where before hooks there were libraries that built into react most of those libraries were focused around components and component libraries the idea of a state management Library outside of Redux was kind of chaotic and most of your time in Redux was spent binding the state to the component in all sorts of weird ways something like react query only because became possible because of hooks I think we're currently in that same early era for server-side Frameworks I think remix and Gatsby and even to an extent next were built before hooks happened and what react is trying to do now is hooks for the server they're trying to show you how good it could be and build standards around how it should be so that developers can build third-party Solutions they're going to provide ones the same way that use state is provided as a default hook and use reducer exists and they had examples when they first put out hooks next is kind of serving that role obviously it's much deeper and more complex but the opportunity for third parties to take advantage of the changes happening in react that are being applied first and next is massive I am genuinely so excited for the future of react is a server first framework and this direction change should be noticed should be noted and should be commended as scary and exciting as it is so huge shout out to the react core team huge shout out to the Versa folks I should point out that that they are sponsoring me they have no idea I'm doing this video they have nothing to do with this at all I just want to talk about it because I'm personally really excited by these changes and seeing react move to the server hope this was helpful Whatever video YouTube says you should watch there's probably a good one they wouldn't put it there otherwise so give that a watch ## React's most dangerous feature - 20240904 if you care about security for your nextjs app stop using top level use server it's way too easy to leak data top level use server creates endpoints for all exported functions even if they're never used on the client one accidental export can cause a ton of damage oh boy y'all probably expect me to come out here super defensive like I'm the forell guy right they pay me so I'm going to come out and just say this is all fine this video is not sponsored for a sell has no saying what I say here they might even be mad at me for as I'm going to say because I almost entirely agree with Reese this is scary and we should understand what these tools do in a deep way because it's not as obvious as one might think let's dive into this and what's going on because I think it's important for us to understand before we go any further I want to make sure we understand what US server does because us server does some slightly different things in slightly different ways there's some education to be had here so we're going to make a form and in this form we'll have a button type A submit and the form will have an action which this is where actions become useful we're going to go in here we're going to mark this is use server and we're going to console.log I'm on the server my mistake async cool so now we have here I'll open up the console because when I hit this window's not defined because that code ran on the server not on the client so if I go back and delete window and run this again that code runs on the server see I'm on on the server what used server does is it tells the nextjs compiler hey this function isn't a traditional function this isn't just for you to call between different places in the same service use servers effectively a door that enables client side code to hit this serers side function it might make more sense if I break it out a little here so if I was to async function handle submit we can do the same thing in here with the use server and then I pass this handle submit function to the action instead and it does the same thing things can get a little interesting once we're composing stuff though so first off if I Define this function in here let's say there's a variable that's defined when the page renders like con some number equals math. random time 100 now we have this number we want to log it so we put that there and now when we submit and we go to the console code I'm on the server here's the random number since this comp component has context not literally react context but it has the context of this number that's unique to this render because theoretically every time somebody renders this page they're going to get a different number we can prove that by saying console.log rendering with some number so now when I load this page it rendered with 3.9 whatever and then if I submit it's submitting with 3.9 the reason it's able to do that is it's actually embedding that number that value that we have in the closure here inside of the form so that when it calls this function it has access to that data it's almost like we we moved this out here and then in here we have an input that has a default value that is some number the reason that this works this way is so we don't need to know the context of what existed in the component when you call that function at first it wasn't encrypted which made this horrifying but now I actually kind of like it I have these items and I want to be able to list them we've all done this before items. map item thank you super Maven for being based as always so here we have items. map item key item id item cool and if we go back to the page 1 2 3 here's where things get interesting what if I want to be able to delete any one of these if I want a little delete button on the side here this is where I actually think the composition of actions gets really cool submit uh we're going to make this an x button also going to class name flag X Gap 4 just put space between them so I have that little x button nice action equals async use server and since we have the context of what id we have here it's actually quite easy I should also make this a let just to make it easier or items equals items. filter and then revalidate path Che to import cool so what's happening here is since the ID of this item exists in the props being passed to this component it's actually included in the scope of the form so that we can just call the ID we passed to this component it's actually magical in the sense that we have this simple items function this could be a row and a table anything like that this is so so so convenient because now I can just dump you server here I can call props the same way I would in any other function in here and this just behaves so if I go here we can take a look at these items and you'll see each of these forms has some data embedded in it or it should yeah so each of these has this hidden data and that hidden data is just the ID for the thing that's being incl included in the scope there so now if I hit delete on any of these it removes it it's that simple and that is a magical pattern it makes enclosures of concerns and the architecture of your stuff really really clean if you have let's say a table and you want a delete button that you just pass a prop to now that delete button can own Its Behavior the catch is that in order for that to work it has to include the context of what that has whatever is enclosed in that functions like closure inside of the form but it does it encrypted so you can actually see the value so although this might seem scary this actually pretty safe where do I think this problem could actually happen is an important question I should probably have answered earlier so I'm going to answer it now let's say that the sensitive data function isn't actually a do not use it's an internal so we want to use this internally notice that I deleted the export the reason is anything doing stuff internally like this we don't want exported we explicitly don't want this to be accessed other places so the solution here would be to export a different function that calls this so we have export async function user access data and here we grab the headers we check that it's a secured user and then we call the internal sensitive data function anything that has the word export should do a security check like this the thing to look for if you're a code reviewer working in code bases like this is making sure anytime an export in an action file or in something marked you server that everything exported has an authentication check of some form and if it's not exported it doesn't matter this isn't exposed only the exports are exposed the way that this would become a mistake the way this could potentially be an issue is if I'm a Dev working on another file here like other actions. TS and I need this internal sensitive data thing I might blindly go here and Export it so I have access to this in another file and now I've just made that an end Point even if I'm using it internally for something like this that's the scary unintuitive part that is going to cause issues if you're looking for where the problem exists that's where the problem exists if you blindly go export something that shouldn't be exported and then that's missed in code review that's a red flag that can cause problems that's a Thing Worth looking for but that's the only case I can imagine where this would be a problem is doing something is inocent as exporting this function that we're using internally here exposing this so the way I would do this is is I would have something like a utils function so utils TS I might even put a comment on top that's like do not export this file and then import server only now we're sure this file is only on the server and won't be used servered not use server this file now we're certain that won't happen now I can call this internal function in other places and even though it's exported it's not exposed because it's exported from a file that doesn't have us server I hope that makes it clear where the problems could be here and what could cause this but I promise you this is just the graphql problem of security again I just wanted a long tangent because I want to show you guys that this isn't actually what we're talking about today if I wanted to move this out let's say I wanted this delete button in another file because separation of concerns is super important we'll make an actions. TS file and here well I guess I can't really use items because items was in the context of that so let's come up with a different example let's say instead of screwing with items it will just I don't know console.log user was here we'll make this more proper export async function or user visited cool something like that so now you have this export async function we could put the use server here but I don't think we're able to import that I'm actually curious if this works or not okay that does work cool so if you want to put a function different file Market your server this way and Export it that all works fine the other way you can do this though is putting the use server up top like this so now we have this export async function user visited and if we go here and click the buttons user was here user was here that all works the Ed server on the top here is effectively telling the compiler hey any Asing functions in this file should be treated the same way an action is treated in an existing file so when we put the US server up here we are telling react hey these functions can be called like end points these can be post Ed to which is an important detail here I want to be clear though you can't just write this in a client file so I can't like have use client up top and then use server in here because use client is saying we're sending this Javascript file to the client use server is saying we're exposing this function to the client so they're different things entirely I know it seems like they're similar because their names are so similar they're not so where's the danger here well sometimes when you're exporting from a use server file the behaviors aren't very intuitive the first one is let's say that we wanted to do the items thing again so we'll Define items in here and we'll export it too well now we're going to get an error because you can't actually export anything but a promise from a use server tagged file because they don't want you to use this to expose things like data like classes like components they want you to expose this as functionality as endpoints effectively so what is the issue here then if we can't export things we shouldn't and we can't export functions what's the problem well let's say there's a fun function in here we're not ready to export like sensitive data we'll even do uh do not use sensitive data and in here we'll log let's go make a fake environment EnV sensitive data equals I hope this doesn't leak so now we have this sensitive thing in the environment we can even log it here env. sensitive what did I call sensitive data process. sensitive data so if we go here we're not going to like have that get hit or anything like we aren't running that function I'll change this to sensitive do not touch and maybe we even return that sensitive data process. EnV do sensitive data so now we have this we're returning this sensitive data but we're not binding it anywhere we're not calling this we import the the user visited function but we're not importing this so what's the issue well the issue is that the way the compiler works is for every route it goes through all of the imported files to see in order where the U server calls are the way that this effectively works is when the compiler runs it goes through each of the different places that a U server exists in the file tree for that route so if this route has an import to actions and in here we have two things that are use server tagged this would be the equivalent of effectively putting this here and here basically the same thing so now this is id1 this is ID 2 even though this one isn't used it is still exposed and it is still creating an endpoint so to speak for that function anytime you have a use server function that is imported and in the import tree of a given route it is now exposed as an endpoint even if you don't directly bind it because what this is effectively doing is letting you post to that page route and have it run the code that you've bound I wanted to confirm that if you don't import the file on a given page this won't be a problem which is the case so this page demo doesn't import any actions so it doesn't have this the actions that are defined on a route are specific to that route so we did import the actions file here so these actions are included on the root slash route but on the SL demo route they're not included because I didn't import any actions here so what do I mean by included that's a great question and we're going to elaborate on that now so here we have that root route again we have the buttons that don't do anything at the moment and if we take a look at the code for these well actually see if I search that again that we have some stuff here that includes it specifically this page JS file very interesting let's grab the contents of that quick in here if I look for that ID which I'll grab again here remember all of the actions have an ID assigned to them so that the react code on the server knows which action each form is attached to because all of them are just posting to the same endpoint so they're using these IDs to figure out which action you actually want to run and here we see oh no do not use sensitive data it's actually included in here that's scary what's even scarier is that we can hit that you know what let's just do this as a curl why not I'm going to delete the cookie because we almost certainly don't need that what we do need is to identify the action just pasted the curl and here we get a response undefined if we were to go add a response to the action uh return cool data hello world now we get back data hello world as the response from that curl call reminder this curl call is just me going to the browser rightclick copy as curl for that request that I did so what happens if we swap that ID well I already have the command where I swapped it you can see the 6dd here so we're going to run this instead oh subscribe to Theo what happened oh sensitive data got changed hopefully you're already subscribed or you're going to deal with leaks like this in the future make sure yourself secure hit that sub button anyways the issue here is very simple but also easy to miss if you're not paying enough attention when you write these things since us server is effectively saying everything in this file is now exposed as an endpoint this is exposed even if we're not using it we got a good point here from Emmy in chat is it really a bad thing to have someone able to enumerate your end points that's a really good question it depends on how your stuff's architected this is effectively the graphql problem where if you have anything in your graphql schema every user can at least call it the solution to a problem like this is to have an off check of some form we have have data from this call being hit and we can use that data to verify that this user is the right user we have access to headers so if I import headers from next I don't know what do we want to have is the header we'll say that there's a secure header that we'll check for if we won't do X forwarded 4 we'll say secured user does not equal key then we'll immediately throw error not a secured user otherwise we'll pass it so if we do a check like this and I go back here and I call this again we get this error response because this error was thrown to us because we shouldn't have been able to do that and you can see the error in that response of not a secured user but if I instead just return data you're not a secured user same deal data you're not a secured user if I go back to that curl request and we manually happen to know what that header is secured user and now we have that in here if we run this again data subscribed to Theo because we are actually validating that this user has permit in this case using the secured user header but you could use anything like cookies the same way so the lesson here is first off make sure you understand what these things do before you use them use server is turning all of these functions into endpoints that users can hit which emphasizes the importance of one big key thing make sure any action you create verifies the user has permission to do the thing if you don't want users to hit this sensitive data function make sure you check because effectively every user user can hit this function when you're exposing things with us server you have to assume that this function can be run by anybody I think a lot of the issue that's happening here is that web developers aren't used to dealing with Access Control they're used to these functions being automatically handled with off because a backend Dev did it or they're using something like crate T3 app where we handle it for you with secured procedures if you're writing these us server calls yourself that means you're writing API endpoints yourself we are defining an API here the same way we would graphql in fact graphql has these same problems times 10 so we need to make sure in all of these functions that the right people can do them and as a code reviewer as a in the no Dev that's watching videos like this this is kind of your responsibility we're no longer just writing JavaScript for the client if we are using these functions if we're taking advantage of these core features in the new react model it is important for us to go out of our way to make sure anything we're exposing to users is secured and I'll be honest this even bit us before when we first did the early early access of upload thing we weren't authenticating our actions well enough because we assumed if you can't get to the route you can't use the actions which was a mistake we learn these lessons as a community and I really want to push these points so I'm not the only one getting burnt by it if you're not authenticating the functions then anyone can hit them Ryan Florence jumped in with a spicy take and honestly I think I agree this doesn't concern me use server means turn these exported functions into endpoints for the client once you know that you won't export a function with sensitive data I get that when you're new to it you might export a function you didn't intend to be an endpoint yep and and then it's up to the framework to salt and sign the IDS it sends the client just like sign cookies yada yada I think it's cool great abstraction would you really trust a code base with a thousand people working on it for all of them to not make this mistake uh yeah I personally think once you have a code base of that size you're almost certainly doing a really good job of auditing and linting these things like my personal understanding is that these problems always exist in big code bases especially with again I hate to keep poking at graphql but it is so guilty of this problem so the graphql schema like this where we have not only do you have to verify and validate company you have to validate every one of these fields because let's say some users have access to name and address but not offices some users have access to offices some users have access to specific offices now not only does every type every object have to be handled like with authentication every single field needs to be validated this is the reality of backend Dev you always have to check permissions when you do anything and the that's unintuitive for web devs is that use server means that's an endpoint that's an endpoint all of these are new API endpoints being exposed the risk here isn't so much this is a unique problem that doesn't exist in other places and only exists in react and server components and next the problem here is that web developers used to using next purely for frontend stuff and then hitting an API that someone else made with all of these off things already handled they're diving into you server and treating it the same way they would hit an external endpoint like to a Dev that's not familiar and is used to just writing these things with an existing backend this to them feels like the equivalent of I don't know let's say we have an async function here it's not used client and we have some data const data equals await Fetch api. ours.com sdata and they use this data for something to a new Dev using these things this feels the same as calling a server action to get that data they're not used to thinking about about API end points as a thing they have to own manage and authenticate ree is pushing back a little bit saying the focus on auth informs is the wrong takeaway because you can't put off on things you don't know exist half agree I think that the our duty as devs is the same way if we have I don't know here where we're exposing all of these things through the switch statement we're just taing back a bunch so when you use us server you're just doing this but you've deleted that that and that it's still the same thing but it's important to understand that when you do use U server you're exposing all of these things as end points and ideally you're auditing these things as well what a surprise CJ already made an es link plugin which disallows top level use server so if you don't want this feature if you don't want this risk you can use this plugin to guarantee Nobody Does it and even use this plugin and then override it in certain files saying okay these files can do it but others can't these are the issues yeah also 3 minutes ago great job CJ for those who don't want this you now have a lint rule to ban it really cool the same way that this exists with basically any backend technology code review is really important if there's a file that has a used server on top you need to make sure every function exported is also authenticated very very important and it's a common mistake for that to not be the case but I see this more in graph CUO than I do in react just make sure when you're exposing end points that you're making sure the user should be using that endpoint there's a great blog post by Sebastian markb the wizard who came up with a lot of the server component patterns over at for sell how to think about Security in next and I feel like I reference this blog post far too often so it's important to bring it up again the data access layer is a really important concept that they push here where we have a bunch of things in a folder let's say data that are the things we want to have be secured data that can be accessed on the client so here we have this off TSX function should have just been TS but that's fine exports con get current user which is cached uses the off token cookie decodes it and now we have this user info now we have these functions can see username viewer user this is public info so we always return true we have can see phone number viewer is admin or the team that they're asking for is the viewers team get profile dto now we want to make sure that we don't pass back values they shouldn't have access to so we do this select we uh set user data to the first row here we grab the current user and if they can see this username then we call user data. username and we return that otherwise we return null and then same with phone number we're using these check functions that we wrote before we return and since we have this all in a specific folder that is indicated to our teams as this is our API this is our endpoints this is important and secure and needs to be treated carefully in code review we're much less likely to have issues because we've established a pattern of how data is exposed on our server so as is the case with any technology that is linking to your database and is exposing data it's important to make sure you have patterns for how you want to do that for how you want to expose that data and it might not be intuitive that putting used server at the top of the file means every export is now exposed once you know that you can treat these files properly so it's important that whenever you use a use server on top that you make sure each of these functions is checking to make sure the user should be doing the thing that they're doing one more quick thing I should have covered this a while ago you can use server actions with trpc so if you really want to lock this down set up trpc use all the things I showed earlier and now you can just expose those with actions the same way you could otherwise so we have here create post protected action. input yada yada mutation create post and now we can import this the same way we would any other server action and it just works you even bind it in a form the same way we were showing earlier so you get all of the authentication and standardization benefits of what exists within something like trpc while also getting the ergonomics the zero JS necessary all the other benefits that we get from server actions it's a really nice hybrid solution so if you want to have a good standard for the way you're doing this on the server side there you go the request that I've seen from Ree and others is that these be Tre shook so if this is exposed and this isn't because this isn't actually being used in the import ideally the ID for this isn't included that would be nice I would have concerns about how it's actually architected and set up but I think that should be fine the concern I would have is that just not exposing the ID doesn't solve the problem because theoretically if we only expose user visited in this route what's the point of this even existing it almost certainly is exposed somewhere so if we imported that one I don't know in here even if we don't actually use it we're just importing it I I guess the reason I'm hesitant to agree with the like tree shaking bit is if you're exporting something in one of these it's going to get used eventually so if we were to hide the ID of this function in the pages that don't have access to it so to speak it's going to leak eventually we're effectively just delaying the problem so the only actual solution is that we are good with you server means this thing needs to be authenticated and the solution for that isn't a lter it isn't a change to the way the compiler works the solution is very specific it's a code review thing and I find a lot of the problems that I've been hearing recently are assuming that anyone can commit any code the solution here is we have a data folder we put actions in here and you make sure anytime someone changes anything in the data folder that you have a code owner rule on the repo on GitHub making sure someone who actually knows what the is going on reviewed that that's the only way you can use anything that exposes data to users at scale make strict rules about who has to review things and now whenever I'm doing a code review even if I can't see the US server on top for some reason because the file's massive at the very very least I see that this file is in the data folder which means I need to treat it more carefully it needs to be more thoroughly reviewed and we need to make sure anything in here is exposing data in a way that is safe but that is the solution here it is put these things in a place where we know those are endpoints and then in COD R viiew make sure any endpoint that you're exporting here is treated accordingly otherwise you're doing the same thing I showed earlier with Express where we're just exporting functions within like the post calls without checking you always need to check things that a user can hit and if you're exporting asnc functions in a use server file please please please make sure that users are being authenticated one more simple solution that has been touched on don't export it as long as you're not exporting good let me know what you think and until next time peace nerds ## Reddit Betrayed Developers, Of Course It's Dying - 20230616 so uh I guess reddit's over it's weird the last couple days of Google searching things clicking links and having a subreddit is private response come up has been strange but it's really helped me reflect on how important Reddit is to my everyday work and life everything from debugging code stuff to fixing weird artifacts in my video edits to just getting opinions on some new thing that shipped or even old things the amount I rely on Reddit to find information and get humans opinions on things is massive and it seems like the AI companies felt the same way because the vast majority of AI is trained on Reddit some amount it seems like they want to try and make money off that sadly as with most of the things Reddit does they had no idea what they were doing Reddit recently announced changes to the API application protocol interface the shorthand for how external things access reddit's API is essential for a lot of things obviously it's being used to train robots for AI stuff but it's also used to make Reddit usable be it accessibility tools for people who do need screen reader support or just a good mobile app that actually works and obviously safety tools and mass the Reddit API is essential for the work that many do and for just using Reddit I personally when I browse Reddit never do it on a computer I use the Narwhal app on my phone narwhal and Apollo are the two go-to mobile apps for Reddit I know reddit is fun is also pretty popular and it seems like all three will have to shut their doors down because reddit's pricing for their API is absurd Apollo was well within the limits of what Reddit recommended for their API usage and the lead developer was actually in touch with Reddit and did a great job communicating with them letting them know when there were bugs when things were getting hit too much and just keeping the Reddit API in a good State his reward for this work was getting accused of blackmail seriously as a fellow CEO I will never understand how spez has responded to all of this God I just I'm horrified truly it is just disgusting to see a CEO choosing to go after individual community members who are working hard to make his product better Apollo wasn't made because the developer hates Reddit Paula wasn't made because the developer wanted to make money off Reddit Paula was made because a developer wanted to get better at iOS loved Reddit and wanted a better Reddit experience and he made an app that's one countless Design Awards even from Apple directly in fact right before the shutdown he got mentioned in WWDC Apple's conference so I can see my Apollo for Reddit it is surreal to within the same 24-hour window get shown off at Apple's conference for making an incredible app and then immediately get accused of blackmail by the CEO of the company you made the app for it's insane I've never seen this level of cope from a leadership position just yesterday the CEO of Reddit sent an email out to all of the staff that are still there and obviously it leaked and it's full of stupid comments like calling out that their revenue isn't down that much since the blackout well yeah you don't make any money that's the whole problem obviously when you don't make money if we will stop using your thing you're still gonna make no money the difference between zero and zero is zero so yeah congrats you're good at math you figured out that Revenue doesn't go down when you don't have Revenue but if you want an IPO spes you better get on that because holy hell this is a disaster I have never seen sentiment flip so hard and strong for a company most of reddit's currently blacked out the vast majority of subreddits shut down they are locked and they will not unlock until these API changes are walked back and it's not like the demands are crazy the creator of Apollo didn't think they should prevent charging on the API he just wanted more than 30 days to plan and ideally a more reasonable rate and instead of getting either of those things he got accused of blackmail which is absurd I truly cannot believe that Reddit leadership would allow this to happen but at the same time with the way Ellen Powell got thrown out it doesn't surprise me too much I think Reddit was kind of doomed from the start but now more than ever Ellen wouldn't have done this I don't think she gets enough credit she did actually try to make Reddit better but she never would have done something this absurd spez consistently has failed to understand read the room and is very quick to accuse other people of being the problem when in reality he doesn't know how to make a company that makes money and it's really sad to see because Reddit is one of the most important resources on the internet and on this path it is certainly going to die I will misread it I really will and I hope we've done a good enough job archiving the Decades of knowledge that are on there because I don't think the company that owns Reddit is going to do a good job maintaining it in the future what do you guys think do you expect Reddit to survive this or do you think it's going to go out and die like it currently is if you want to hear a bit more about platforms killing themselves like twitch I'll pin a video here all about that thank you guys as always peace notes ## Reflecting on React Server Components - 20231026 it's no secret that I love server components the new react model has taken a bit to click in my head but once it did I couldn't go back that hasn't stopped us from constantly debating whether or not they're actually ready for production though and I want to have this conversation as sincerely as I can yes versell does sponsor the channel but they're not sponsoring this video and I don't know how much they'll even agree with my stances so please ignore that part as much as you can with this obviously take everything I say with the grain of salt but do that with everybody you're listening to opinions about this from before we can talk about whether or not server components are ready we have to Define two things the first is production ready and the second is server components production ready means a different thing to almost everybody for some people production ready means that it's stable has been marked as 1.0 and nothing's ever going to change about it for other people production ready means the behaviors are reliable and will always behave the way that they are right now for some people production ready just means is not going to crash and it solves the problem they have in production I like to think of production ready as solving a problem reliably for a set or subset of developers and for me server components absolutely meet that definition I've had a great experience shipping server components since way back in March of this year we've been shipping them for upload thing from day one and it's been an incredible experience yes there are bugs with server components but I don't find those bugs in production I find them when I'm writing the actual code and in that sense I've actually had a much better experience with server components than with react before because we'd have stuff like a use effect that works totally fine in Dev seems totally fine for a while and then suddenly is causing all sorts of issues before we go any further with the definition of production ready though I want to draw some lines around server components themselves because it is a term that includes a lot in it the issue I run into a lot is that most of the time when people say server components they're not just talking about a react component that exclusively runs on server this is what a server component is however server components have a lot of other things that we associate with them and do with them we usually think of when they hear a server component so by definition a server component itself is a react component that only runs on the server such that it can send HTML like syntax directly from server to client for it to render no longer just sending Json updates that the client has to rerun and it also doesn't need to be hydrated the same way that traditional react components do so I want to draw a pretty clear line here between what a server component is and things that we use with them that aren't necessarily server components themselves so usually when people are talking about rsc's they're kind of including these other things in them like server actions for updating server component contents on client they're also usually talking about routing for Server what do I want to call this I'll say routing honestly those people associate some type of routing with server components which honestly makes sense because traditionally with a single page app the actual route you're on doesn't matter to the server the server just sends some empty HTML and a JavaScript blob that determines what gets run and then the client side looks at the URL and renders the right page based on what the URL is in order for Server components to render different content for different routes now the server components have to be aware of routes which means you need some type of router in order to use server components fully for a proper website that said these things are not server components these are things that we are building thinking about and working on outside of server components in order to complete the model and I want to draw a distinction between server components and the server component model because these get grouped together as one thing and they're not I know you are going to be complaining saying getting super pedantic about this but I think it's really important to understand the difference here because server components themselves as this little box here not including the rest these are pretty damn close to stable they might not be in the stable react release yet because they're trying to smooth out all the edges and make it as close to perfect as possible but the developer experience here the syntax the apis almost everything that matters around server component experience has been done for quite a bit of time and if we go to the tweet that led to me doing this today I've had this video on my to-do for a while but after I saw this Ryan tweet today I realized I had to do it sooner than later as he says here RSC is farther from production ready than he thought time to get back to work on current remix apis he's excited about rsc's it gives him a clearer vision of migration paths they're still going to do it they were just expecting it to be their next API iteration to be based on it going to let others be the canaries dying in the minds and we'll do a quick iteration on remix without it and Lee responds here gets ratioed pretty hard again that's why we had a different definition you set it best yourself if production ready means customers are using it in production and there's about 8,000 of the top 1 million sites on the web using react server components right now I like this tweet a lot think people are stressing too much about RSC implementation details PHP Echo example the major do understand what makes that work when a request comes in just dump a file in a public HTML and it works if next remix are successful you won't notice rsc's and he says here you don't notice rails you won't notice RSC and that's really how it should get to and I'm increasingly excited for us to get there they had a little back and forth as Ryan said put it in a stable react release and here's some say you're still ignoring action responses outside of client components app router stability from server actions and here's the other problem so once again let's separate this into three parts three layers of depth to this depth level one RSC is this much app router is this much and the new react model is this much so yes depending and this is what's so annoying to me is people talk about all three of these like they're the same thing but they're different combinations of these pieces the server components exclusively run on server to take strong advantage of them you you need routing but to have a great experience with all of the parts we also need server actions too it doesn't mean these other parts aren't valuable by themselves in fact the app router even if you use client components everywhere is still a better experience than the pages router and server components even if you don't have routing have a lot of potential as a part of your build process to have better templates for your HTML before you send that to the user initially there are benefits to all of these pieces without them all being together but the amount of them that you're combining is what determines the term we use on the left here and I can say say outright server components are really stable app router is pretty stable the new react model and specifically server actions we got some work to do there you can swap out any of these pieces like instead of using App router for routing you can use Astro I don't know how far along that story is but it works instead of using server actions for your relationship between the server and client postload you can use trpc which is what we've been doing a lot at ping you don't have to adopt the whole model to get benefits from it and while yes the bottom chunk here is not super stable the top Parts here are super stable this part at least it feels incredibly stable almost nothing has changed in the server component model since it was initially proposed an app router has made a ton of progress to the point where I don't really have issues with it it's really good there are problems that exist outside of its stability like the developer experience being slower than other Frameworks even than Pages router used to be that doesn't mean it's unstable it means that it has rough edges to smooth out and thankfully none of those rough edges hurt users they hurt our experience as devs and they're all being worked on really actively I see people linking this Sam thread let me check that quick inde d ch's latest keynote he says even react is coming back around to the benefits of sending HD mail to the browser rather than Json with the aous server components Comm misconception RC actually can't render HTML how to best communicate the RC architecture and clear this is actually something I think I agreed with Ryan on with that quote tweet here I think what Sam's discussing here is this problem like the majority of devs don't understand how the PHP file works I don't think they have to I don't think devs need to understand that they're not actually sending HTML to the client I think it's a really powerful metaphor for how it works and that's why I'm not sure I fully agree with Sam here there are interesting powerful intricacies that he's touching on here but I don't think it's as important as he's pushing I don't even know if this should go in the video yeah I don't think this level of detail is super important I don't agree with him that it's the onus is onreact I think we're just as valuable as like spokes people for this and deeply invested developers who understand how the model works I think it's up to us to make it as digestible as possible these trees can be pre-rendered into HTML the thing that's hugely different though is that the pre-rendered HTML can come after the first bite and it doesn't have to be sent as the JavaScript as well I think that's the part he's missing here like how do I okay never mind this does go in the video here is old SSR far his request it runs gssp it runs react code to generate HTML for Route it sends HTML to user user fetches JS this is the important part same Js from SSR runs on client to hide rate page now works so this piece here this is massive while yes we did run the JavaScript on the server once to generate the HTML that exact same JavaScript has to run on the client and while get server side props let us embed a minimal amount of like the data that is needed by that stuff if one of these components does a fetch it has to fetch on the server and on the client in order to hydrate properly if one of these gssp things is different on the client than it is on the server everything's going to break if you're running this code in a different time zone on the server than on the client it's going to break we are running the react code on the server once but and it is sending the HTML to the client once but despite that it's not actually running wording this is Harden this is the problem here is that I wouldn't consider this react sending HTML I would consider this running react on the server as a starting point for react to pick up on when it hits the client the new model is very different because it doesn't have to run get server side props once it's part of the request is to create the react tree and when it creates that react tree it's going to mount the top node it's going to see what that mounts and it's going to go down and render everything if it hits a suspense boundary respond with all non suspense components this is step three as soon as we've created the react tree if there's any asent components do what they need to if any of them are in suspense we don't have to wait and block on that so we send a response when things update on the client when stuff has changed or in this case when the suspend stuff comes through stream in additional HTML from suspended components so this is the big difference is once you've hit this line the server code has stopped running in the old model and this server is no longer sending HTML to the client it is now sending props or API calls and then the rest all runs on the client gets Json and runs the react code there with the new model this whole thing runs on the server and sends HTML to the client until you specify that you don't want that in fact you can actually pass a server component to a client component this is where things get really fun so in this example I block the page until this file is read let's pretend that this takes longer to read async function get file contents I'll return this here more importantly I'm going to sleep for a th000 I'll do 2,000 so it's more exaggerated const file content equals await get file contents cool this is pretty standard stuff my function home gets file content which is reading from the file system and it renders that it's just a number that I have saved in there for now so if I Bun Run Dev this current count 23 cool so this is the count rendering from there you'll notice that if I command shift R Network tab it disable cache this going to take 2 seconds to run because I have that blocking call so in the old react server side rendering model you'd either have to do this or you'd have to expose this as an API so the client could render it there was no world before where doing this call wouldn't either block the entire page from sending any HTML or have to go into an API endpoint that then sends Json that the client then renders that world did not exist with the new model that world doesn't just exist it's become the default so if I want to send other content while this is waiting I'll do async function count component I will yoink this we'll return div with the current count instead and now I'll just put hello here as the default and we'll add the count component this is async so we can delete that this doesn't change anything yet but this is where again the new model becomes so powerful if we add a suspense wrapper here now this is going to pop in once it's done fall back goes here and now when I refresh this it's going to say loading until it's done I put this in div it will behave exactly the same Tada really dope that that's that convenient and if you look at the network Tab while this happens you'll see the additional content is actually coming in through this first request because it's streamed in as part of that first request we get additional data as part of the HTML embedded over time and yes it does have some JavaScript that runs to put that HTML in the right place but it is serialized HTML that it is effectively sending to the client after the fact and the important part here is that the JavaScript this needs to run isn't there let's say we wanted to have multiple different components that were like various amounts of complexity here's a more realistic example that just ripped from the upload thing code we have this generate pattern file that is massive it's like half a megabyte of just patterns that we grabbed from the hero patterns open source project because we want to render different patterns based on your app just to make it look nice in the dashboard that's a lot of code and we don't want to send all of this code to the user what we want to send is the HTML that represents the output of this code so if I in Here style equals get random pattern styles for file content you'll see we have this pattern here now and it will always be the same pattern when I load the page and if I go change the content of that file quick let's change this to 30 I reload the pattern's different now none of these patterns are going to the client what the client is getting is updated HTML that represents the contents of this and that's why I don't think it's fair to say this isn't really HTML cuz like sure the way it's serialized might not be standard HTML you render the standard way but we're not sending JavaScript to run on the client anymore the actual JS that runs for this component never touches the client so this gigantic file that otherwise would have had to go to the client doesn't in this model we just get the style from the function's output that is very different while you theoretically could kind of have done this in the past by calling that function and get server side props and then passing that data all the way down to the component that needs it nobody does that nobody does and if few who try to end up with really unmaintainable miserable applications and they're still rerunning that same code on the client in the server and God forbid you up One Import now it just breaks entirely this is the first time I've not had to worry about the size of a file because get random pattern Styles this file is not something I would have put in an old model react project because this is a ton of JavaScript and yes it's JavaScript that has HTML inside of it but it sucks and now with the new model we don't send the JavaScript we don't send the component we might send where the component's mounted so that it could be updated correctly but we're not sending the component itself we're not sending the JavaScript for this component we are sending a structure that tells the client where the component is but we're also just sending the HTML for it to update somebody said this in chat I very much agree it's effectively serializable react outputs it's the thing that this returns serialized and subcomponents in it can still be client components like if I took this part here and I went and put this in another file that was a client component then it would also send all of that JavaScript so like something I can do just to to demonstrate this is I'll export something random at the top of the file export const something random equals something random and unique if I was to go through the JavaScript the client gets here internals here's the main app you'll see something random does not appear in this file but if I was to quickly make pattern bg. TSX use client so now I have a client component that does the same thing and if I hop in here and I return this instead import it cool now that I've done that the JS should no longer be cached something something yeah here it is so in the page JS file for this page something random and unique made it in and see how much content is in here how much snuck in with this seemingly innocent change this is how react always worked before this is why I choose to say react sends HTML now because yes that does gloss over some details I don't think those details are that important in fact I'm actually concerned this video is going to do more damage than good because people are going to be way overthinking this now if you effectively treat this like it sends HTML that happens to have the ability to mount client side react components it's much easier to understand and it does still run these client components on the server but it has to send all of the content on the client side too so everything that BG div needs to render has to be both on the server and on the client but if I just kill that all I've done is remove the used client there look do you see how much less JavaScript is in here now are you kidding I put used client back here here's all the content here is what I'm sending and if I delete this this is what I'm sending do you understand the difference now we're not sending JavaScript to the client in the same sense anymore we're in a different world now this is why I say we're sending HTML because it's way easier to understand the benefits that way sorry I'm getting annoyed by these things but I'm just like I love you Sam I understand what you're going for I'm excited for you to be at next comp so we can talk about this because I don't think this is the right thing to be communicating here and I also think this is our responsibility to figure out how to communicate because the react team talks to us the influencers who are really nerdy about the and then we figure out how to communicate it to everybody else that's our job and I am really excited to do that job and I know you are too and I hope we can work together to make this model easier to understand the way we're communicating it now isn't misconceptions it's simplifying the model so people can better understand how these things work and I think it's really important that we communicate this meaningfully so yeah it's a cool thread I don't agree I think we are effectively sending HTML to the user with this new model and it's way easier to explain it in that way but the the point I'm trying to make is again with the Escala draw everything we did here has to be sent to the client to be done there as well with the new model that's not true anymore with the new model you send HTML and effectively like scaffolded serialized HTML to the client initially and when new things stream in you send that too and if you use the revalidate with server actions you're sending again serialized HTML it keeps track of where components are but it doesn't keep track of what the components are just the output of the component it's moving HTML around one more example that might actually be helpful for people new boring old create next app project I'm going to do two things first thing is I'm going to make a. text this is the content of a on the server and we're going to do b. text B's content is a bit different cool so we now have a. text and b. text let's grab both quick delete all of this and let's render both so const content of a equals I'll import a quick content of a equals fs. read file. two string I have to wrap this for that this is be async should I be doing these parallel yes I'm lazy and let say we have two divs div content of a div content of a content of a this is the content of a on server now let's do content of B so this is pretty simple so you have content of a and content of B what if we want to just show a and have a tab bar where we switch between A and B previously we would have had to expose this as an API have people fetch the Json content for each of them and render it on the client or we'd be encoding it in the URL and probably not caching it properly because I'll be honest next query programs have never been great but what we can do with the new model that's so powerful I'll make components we'll throw in here tab. TSX in this file I have a used client component so this runs on the client it gets past to react nodes and on the client side we can set state to change if we want A or B selected so now we need to use this component so we'll hop back here it's going to error CU we don't have a or b in here yet so we'll do a equals yoink and b equals yoink this is where I think things get really really cool so when I click here it changes the content on the client even though the code for this doesn't run on the client the magic of this pattern is that I'm passing here serialized HTML if these two things needed the background code again which I can just go grab really quick let's grab this file and I'll paste this in here and I will style equals generate pattern get rom p s my bad content of a and I'll do the same thing here for content of B and now when I switch between these they have different patterns this is the JavaScript that gets sent to the user for this page there's a bunch of stuff that gets compressed from webpack there is the license so this is mostly just the strings for the different errors and stuff because this is running in Dev mode there'd be a lot less stuff in here otherwise but most of this is just one big serialized object with all the different key values for which HTML to render in different cases what isn't in here again if I go here and we grab my something random and unique it's not going to appear in this file what will appear in this file is the content of B so if I actually go to b. text again and I search for this in here probably going to be serialized they going to have that no that's not where they put it I actually don't know where they would have stuffed this but it will be referenced somewhere in here let's figure out which file this is in hm it might just be in the HTML yeah that's a fair point yeah okay this actually kind of makes my point the content that is Switched between these two when you click them so when I go from A to B here it's not even encoded in the JS file it's encoded in the script tag at the bottom of the HTML file so yes it's JavaScript in the sense that it's exists in the JS but it's not Javas in the sense that the component isn't there it's just the reference to which HTML gets rendered there and if you read this it's not the actual JavaScript it's literally just the HTML output serialized so that it can be changed conditionally so yes it's not just sending the HTML that magically switches between these two things what it is doing that I think is much cooler is it is sending a representation of the HTML that we passed to that component we passed it this server component and This Server component we sent it two different HTML props and it doesn't need the JavaScript to run these on the client side it just needs the syntax and the HTML that gets rendered at the end it's very different and this is what makes this model so cool is that I am running this on the server I'm generating HTML that gets embedded into the JavaScript the client gets and now the client can choose which set of that HTML it's rendering or using at any given time but despite having this Dynamic behavior is not actually sending the JavaScript for these components for the conditions and for the rendering it's passing the HTML as a prop so yes it is not just HTML in the sense that there's things running on the client so it knows which HTML is where but it's passing HTML around now which is even cooler this was not possible in the previous model at all and this makes it feel so much more HTML like because I'm effectively just passing these different HTML elements as props but it just feels like passing components do anyways it's dope it's really cool and I think calling this HTML simplifies the understanding for the vast vast majority of people so yeah now that we've finished this tangent I want to go back to the original point of the video which is our server components production ready server components themselves absolutely this new model is really dope and it works great when it has problems you run into them immediately they don't pop up weeks if not months later because a user hid an edge case you run into the problems immediately it works really well and it's exponentially simplified so much code that I write even just 2 or 3 days ago I was updating one of my routes for my image management tool to make it easier for people who weren't signed in to get access to some of the images and it was like five lines of code to make a whole new route and just make an entirely different experience for my users because the back end and the front end are no longer this arbitrary split that I have to work on both sides of it's now kind of a bar that I can move between the two as I need for my applications and it's made so much of what I'm building so much simpler app router has its quirks I don't love file based routing still but I see why it's so valuable especially with these new patterns and server actions as the piece to close out the new react model they're still very early they have a lot of gotas but I do think it's going to continue improving and eventually get to a point where it's great but that doesn't mean these things aren't stable doesn't mean that they're not production ready and depending on which access you're cutting on as well as depending on what your definition of production ready is either all of server components model is not production ready or most of it is very production ready specifically the RSC part this top piece here it's in a great state we've been shipping it for a while and I've had a great time with it I think for most people server components are totally production ready that said there is still a lot to be done with the new react model and we're still working on it learning from it and improving it every single day but with the new next release coming soon with more and more people adopting these patterns and eventually with react merging this to the react main release with 1920 whatever they decided to call the new version this is going to go from a debate to reality I think we are a little pedantic when we talk about production ready I think we can Fleet a lot of different things when we talk about server components but my experience is more than production ready and I wouldn't hold back if you see the benefits of these tools right now there is nothing you can adop stop right now that will meaningfully change to the point where it will fall apart in the near future all the syntax all the behaviors all the patterns they're all stable it's a matter of smoothing out the way they work together so the next generation of developers can have a Next Generation experience so that's my thoughts don't hold back if you're excited feel free to hold back if you want to wait for these things to get ironed out page router is still great but app router has changed the way I built do you want to learn more about why server components are so different or just go in depth on all these things I have a video pinned here where I go really in depth on server components YouTube seems to think you're going to like the video below that so check that out tooo if you haven't thank you guys as always really appreciate yall peace NS ## Remix Got Acquired__! The Buyer May Surprise You... - 20221031 wow remix has been acquired and not just by anybody but a very interesting choice remix is now part of Shopify what does this mean for open source web dev let's chat about it quick remix is a react-based meta framework created by the react router team to make it easier to load data into your components in react apps on the server it is really powerful framework that has a strong hold on semi-interactive websites with mostly form-based inputs things like blogs and e-commerce sites which is why it makes so much sense for Shopify of all companies to be the one acquiring remix this is a super interesting development both because Shopify isn't a traditional software Dev Tool company they are focused entirely obviously on creating e-commerce sites on the web and they see remix as a great solution to continue iterating there one of the most interesting pieces in here is where on the Shopify announcement they discuss react server components specifically saying that while they're excited for the future of react server components long term as a critical dependency it presented a number of challenges that became performance risks for their Developers specifically around how data loading happens with server components data loading occurs at a component level but with remix data loading occurs at a route level which makes it a lot easier to optimize the ways in which your data is fetched and used to create your application in the initial page load I think this is a combination that makes a ton of sense and I am super hyped to see all of the things that will come out from here Shopify is a really good owner for a project Like Remix and the way that it will relate with hydrogen should be interesting I'm just excited that remix now is at a place where they can get out of the like deployment in Infowars and focus much more so on delivering the best possible developer experience I'm hyped on this acquisition I think it makes a ton of sense I am just generally hyped to see the web moving forward and I want to send a huge shout out to the remix team I know this was hard work and super scary especially with all the other stuff going on in react land but you all have my best wishes and I'm super hyped to see what comes next it's also probably a good time to announce that on Friday the 4th at around 1pm Pacific time I'll be having chance on from the remix team to chat a bit about remix data loading patterns and most importantly for me type safety should be really good convo I am super hyped this is huge if there's never been a better time to check out remix and yeah hype form keep an eye on that thank you for watching this sub if you haven't already let me know if you like this and I'll do more of these like newsy type announcement things when news happens and make sure you hit the sub button if you haven't should be over here and the like button over wherever that is now and also might be getting a recommended video right here too that you can check out thank you for the time good seeing you guys as always peace notes ## Remix is ditching React (and I think that's a good thing) - 20250531 Do you guys remember Remix? You know that alternative to Nex.js that everybody was hyped about that nobody used, but then suddenly OpenAI started using it, but then they killed it, but then Shopify bought it and it's now kind of in limbo. It's been a weird journey with Remix. It started as a wrapper for React Router that was meant to be a template you would pay for. It then slowly became a framework and it's since spiraled into all sorts of different things. It was put to sleep for a little bit, taking a nap, as they like to say. And now after almost what a year and a half or so, it's back. And it's back in a really interesting way. The most interesting detail is that they are leaving behind React. Yes, really. Remix v3 will not be built on React. This is a massive shift not just for the Remix team, not just for Shopify, but potentially for how we should be thinking about building for the web as a whole. And I know a lot of you are going to think, "Oh, Theo is going to hate on this a ton because I'm a huge React fanboy and I've never been a big Remix fan." I actually think there's a lot of good stuff in this plan, and I am genuinely genuinely really excited to see where this goes. But since none of these people are paying me, not even Big React, we got to pay the bills somehow. So, quick word from today's sponsor and then we'll dive right in. Stop me if you've been here before. You're working on a new side project or app. You have a thing that you really want to get out there and then you have to set up off. Now you're stuck in some weird old Google dashboard trying to set up Ooth. You're 15 steps in and nothing's working and you just want to die. Today's sponsor is here to make all of that way easier. Clark's made my life managing O so much better that it significantly increased the number of projects that I was actually getting out there. It was a few days ago I was working on an alternative to Pocket was going through hell and back trying to get off working. Said screw it, spun up Clerk and had it done in minutes instead of days. It's so nice. The dev experience is nuts because they have all of the keys already set up for you. So, you don't even have to set things up in those different dashboards. You just install the package and you're good to go. One of my favorite things they recently added is this copy prompt button. So, it's even easier to get started. You copy the prompt, you go to your ID of choice that has AI integrations. You open this up, you hit paste, you hit enter, and then it will set up Clerk for you. It's really that easy. Now, I've tried pretty much every solution for O, and Clerk is still the best developer experience by far, especially for us Next.js JS devs, they make things so easy. And one last little thing that I really like, they bill per monthly active users, but they don't count users the way that other services do. A user isn't somebody who went to your site once and left like it is everywhere else. You're never charged for users who sign up and don't come back. So, a user doesn't count unless they've shown up twice in a 24-hour window. This is so generous, and it also helps a lot for people like me who build dev tools that people sign into once, get their API key, and then don't go back to the dashboard. You can keep your numbers hilariously low depending on how you build your stuff. Theo, are you really sitting here telling people how to abuse the sponsor of today's episode? Yes, I am because they get it and they don't care. If you want to see how good Oth can feel as a developer, check them out today at soyv.link/clark. First and foremost, we need to understand the relationship between Remix and React Router. As I mentioned before, Remix largely stemmed out of React Router. React Router happened because as great as React was when it dropped, there were a lot of like fundamental pieces that were missing. It didn't really have recommendations for state management beyond the basic like state key existing inside of components. As such, Redux happened as a way of thinking about state in your React applications. They had no concept of processing a URL and rendering different components for different pages. As such, React Router was made. React Router was made by two important characters, Michael Jackson. Yes, really. And Ryan Florence. These two came from the Ember community. Ember.JS was a JavaScript framework that was more cohesive all-in-one recommending a full stack way of building. Not as much on the back end, but the more Angulary like they recommended all the parts. And when these two came to React, funny enough, the main reason was actually performance because it was really hard to make performant things in Ember, like a search that would update whenever you pressed a new key. Basically impossible to do concisely with Ember at the time. Apparently, the framework's improved since. I don't know because all the people I talk to who use Ember only use Ember and most of them don't even like it. I haven't heard anybody from outside of the Ember community heavily pitch it for a bit. So, it's just it's not a thing I think too much about. And all the best Ember people I knew moved off into other communities. Michael Jackson and Ryan Florence were two of those people. They came from the Ember community and embraced React relatively early for the performance improvements, but they saw that there were many things missing. One of which was a router. So they built it. They made React Router to be the missing piece for turning a URL into the correct components in your application. As such, they expected it to blow up and it did. If I recall, six out of 10 React apps use React Router. At the very very least, six out of 10 npm install React calls would be mirrored with a install React router. So for every 10 React installs from npm, six React Router installs would happen. It was massive. But there was an important thing. The React team never officially recommended React Router. At no point did the React team make React Router an official recommendation. It was never included in create React app. It was never mentioned in the docs. React Router despite being universal, despite being incredibly popular, despite being pretty effectively ubiquitous for a while, it never became the official recommendation. And there is definitely some resentment sitting deeply as a result of that. And I understand it too. Imagine making something that popular, that well regarded, that essential and not recommending it as React. I can absolutely feel the pain they felt and I understand it and I don't fault them for it at all. For a combination of reasons, the fact that they were regularly consulting with different companies, a lot of the money that they made at the time was doing workshops with businesses to help them make their React code bases less shitty. We actually did one of those at Twitch and I didn't get to do it because I was already on boarded on React and they wanted to like not spend more money on seats. So they sent people who needed more help learning React to go to the camp. But I didn't even really know who Ryan Florence was at the time. I probably wouldn't have benefited as much from it. But it was really cool that they would go to these different companies to give boot camps to get people using React correctly. They ended up seeing all the ways you could use React wrong as they did these tours across these many different companies and they wanted to rethink it. They wanted to rethink what building with React looks like. You could say they wanted to remix it. I'm sorry I had to do the pun. That's what Remix was built for. Remix was the best possible starting point for building your big React project. They had seen all the pain points that these companies were having from massive compilation times, hut reloads that barely worked, giant waterfalls of data preventing things from actually loading properly in the browser. They saw all these pain points and decided it was time to make a better starting point. But that's all Remix was originally. Michael and Ryan built Remix with the very specific goal of being the ultimate create react app alternative both because they saw all the mistakes these companies were making but also because they felt a little burned that react router wasn't part of create react app. So remix was originally a paid template alternative to create react app. You would pay a yearly fee for access to it. They'd give you the GitHub repo and you could use that to start your new project. And they made a couple crazy bets. They bet really heavily on ESB build, which was super new at the time. ES build was the first of these modern bundler tools. It was written in Go by the CTO of Figma at the time to try and make their build times less And it was really, really fast. But it didn't really have a plug-in architecture at all, which meant they had to build a ton of pieces in order to get ESB build to properly bundle and create your React app. They built a crazy serverside loader pattern so that your components could run on the server once, generate a page, and then send that HTML down to the client so you'd have something before the JavaScript picked up. So you could have better SEO, better overall performance, and also much more logical data loading patterns. They went really hard on their data loaders at a route level because again they built the router and they saw people fetching data in components knew that was wrong and wanted to move as much as possible up from the components into the router. So in some ways remix was like what if React Router took over your whole stack. In other ways Remix was what if we rethought your starting point for React to be as good as possible. But a huge portion of it is how can we set companies up to be more likely to succeed and also make some money for our contributions. And it happened and a lot of people, myself included, had their critiques. The thing I was most frustrated about is that since it was a paid thing and it was closed source, I couldn't properly review it and critique it because I'd have to buy a license. And then if I wanted to share what was good and bad about it, I would have to either share the source code, which would potentially violate the license that I'm paying for, or I would have to tell people to go look at it and they'd have to pay for it to even verify my claims. So, it made it really hard to critique. When you put things behind pay walls, they are much much harder to have a community conversation about. They expanded the team a bit. They brought on Kent Dods to be like their head of education in DX. They ramped up on the documentation. They ramped up on everything. They then took some investment money from OSS fund which is an open- source focused investing firm and then they open sourced it and that was the point where I and many others started to look more actively into remix but it is also of note that during this time react router wasn't really being iterated on. So while they were building remix router kind of sat a lot of the things they did in Remix could be beneficial even without the server side rendering parts even without the ES build parts even without all that. So they started making adjustments to React Router to bring in more of those features and they succeeded. React Router 7 was a phenomenal release. Genuinely really really good router and I was pumped to see the progress that they had made after letting it stagnate for so long. They also realized they didn't really have a way to make money with this and they were quickly losing the war to Nex.js which had exploded at the time. When they started Remix, Nex.js was barely being used. When they got acquired by Shopify, Nex.js JS was massive. As such, when they were given the offer to join Shopify, they took it. The reason Shopify bought them is because they were working on their own thing in parallel. Hydrogen, Shopify's React meta framework. Fun fact, Hydrogen was the first one to really bet heavily on serverside rendering using React server components. And they bet on a really early version of server components way before they were ready to be used. got burnt really bad by that and since then like backed away from the react standard stuff entirely. It is worth noting that at the time with the three options being Remix, Hydrogen and Next, Hydrogen was the one building most closely along the lines of what the React team wanted. Next.js was kind of but not as much so and Remix Remix was kind of building away from React. So you had building along React, building alongside React but not directly with it, and then building the opposite way. Those were like the three options. Hydrogen felt burnt because server components were not ready. And Hydrogen slowly just fell apart. They felt so burned at Shopify, they decided to put their money where their mouth was and acquire Remix, which was the opposite direction. And then Nex.js went off and worked much more closely with the React team. We all know that story hopefully by now. Remix, now part of Shopify, didn't have to worry about winning the whole market with Remix anymore. But they didn't have to worry about making the things that people were using survive because a lot of companies, including Shopify, had bet heavily on React Router. So after Shopify acquired them, they started working more heavily on React Router again. That's when they brought in all these features. That's when they brought in some people to heavily work on moving away from their ESB build plug-in hell in favor of building on top of Vit, which didn't exist when Remix started. Vit had happened in the interim while all this chaos was being stored on the server rendering side. So they ended up effectively rethinking Remix as a VIT plugin for React Router and that went really well. There was a very happy path for Remix users to move off of Remix v2 onto React Router V7 with VIT that a lot of people took and that's how the codebase at OpenAI is currently structured. But by doing that, they effectively killed Remix. And the goal was to do that in order to give them the the room to rethink of what Remix was, to remix it once again. They added a ton of features to React Router. It got way better. I'm very happy with the result. And then they started exploring server components. Ryan Florence even gave a talk at the last React conference about the server component stuff they were doing. That was super super cool. And then they started going deeper on the implementation. They started to get more and more frustrated. And it seems like as a result they've decided to exit entirely. And that's how we get to the article that they just dropped. Wake up Remix. At React Comp last summer, we announced that Remix was going to take a nap. Remix v2 had become such a thin wrapper around React Router that an artificial separation developed between the two projects. We simplified the project by moving the bundler and the server runtime code from Remix directly into React Router V7, merging everything that made Remix great into React Router V7's framework mode. We also announced that we'd be adding limited support for server components into React Router. We finished that work releasing V7 last November in previewing RSC support last week. This provides a stable platform with long-term support for anyone who built on Remix V1 or V2 or on any previous version of React Router. I can confirm that because I'm using React Router for T3 chat and I originally wrote it the way that I wrote React Router back when I was at Twitch in 2018 and it worked exactly the same and it was great. You could use the old React Router syntax all the same. So now it's time to go wake up Remix first header. React Router is really good. When we set out to evolve Remix, we expected it to become a full stack RSC first React framework. Fresh take on the full stack React architecture. But something unexpected happened along the way. React Router V7 became really, really good. As I mentioned before, they had kind of stopped focusing on React Router because they felt like it wasn't getting the respect and attention it deserved. But when they let the rest of the people come in after the Shopify acquisition, they ran so far with React Router V7 that it became everything Remix was and more. And as such, they didn't really want to do what React Router was doing with Remix. They wanted to let it be its own thing. And that's why we're here now. Thanks to the work on server component support in React Router, we now have a smooth incremental adoption path that supports returning server components directly from loaders and actions. We even built a first class story for server only routes, something we originally imagined to be part of the new Remix chapter. Of all your routes or server routes, React Router V7 already feels a lot like where Remix was headed. The differences are subtle, not structural, and is not just technically solid. It's battle tested. React Router now powers apps at Shopify, X.com, GitHub, JGBT, Linear, G3 Chat, countless others. That's an awesome set of companies, isn't it? I Okay, I I did give feedback on this article before it was published. I did do a pass on the draft when Ryan sent it to me. T3 Chat was in it before he even knew I knew this was happening. So, that was there already. I didn't ask to put that in even though I did a proofing pass on it. Anyways, it's just one minor release away from fully supporting the complete React architecture. It's a dedicated team, long-term backing, an open governance model to keep it growing for years to come. That's another big thing they just announced. Since React Router is so important to the community as it stands today, they don't want it to be fully owned by Ryan and Michael. They want to let the community run it. So, they're moving it to an open governance model, which is awesome. Really exciting to see. I've definitely felt as if they wanted to take a step away from React Router for a while. And this is them formalizing it in a way that keeps it from dying, which is really, really good. What does this all mean for Remix? Means they're free. Specifically, it means they're free to build what they want to build next. A new path. Over the past few years, the web has made remarkable progress and so have the tools that we use to build on it. But as much as we've gained, we've also seen complexity grow in ways that feel heavy. At times, modern web development can feel more like navigating a tool chain than building for the web. I have spent way too much time in Webpack configs and weird build hell. Couldn't agree more. We've had ideas that felt too disruptive to pursue in the past. But with Remix no longer tied to a specific paradigm, we have the freedom to explore them now. Remix V3 is a reimagining of what a web framework can be. A fresh foundation shaped by decades of experience building for the web. Our focus is on simplicity, clarity, and performance without giving up the power developers need. The modular toolkit that works well together, but it can also stand on its own. From first class database drivers to a built-in component library, turns out they're bringing back reach UI. This isn't just a new version. It's a new direction. One that's faster, simpler, and closer to the web itself. In order to do this, we need to own the full stack without leaning on layers of abstraction that we don't control. That means no critical dependencies, not even React. We're starting with a fork of Pact, which is a mature virtual DOM library already used heavily at Shopify, Google, and countless others. You're not already familiar with Pact. It was built to be like minimal React, open source way back. Funny enough, the guy who made it worked at Meta for a while. He might still, but it was always meant to be like mini React. They have really strict rules in the codebase where if you ever add things, you have to remove enough to keep it under its like 3 kilobyte threshold. If I recall, Pact is fascinating. Cool to see them using that as a building block. But the important piece here isn't Pact. It's Fork. They want everything to be owned by this one piece. You ever wish for a development experience that feels lighter, faster, and more aligned with how the web actually works? Remix V3 is going to be built for you. This is another one of the things I think Remix did really well. If you've ever seen one of Ryan Florence's talks, you understand. He cares so deeply about how the web and the browser interact and the nature of how data is loaded into the web page and how interfacing with the web works. He deeply cares about it. He doesn't have a strong positive or negative stance on web standards. He just thinks we should follow them because they exist. And he has given some of my favorite talks ever. Of my top five talks ever, he did two of them. I Ryan cares very very deeply about doing that type of thing, right? And every time a change happens in one of the dependencies he relies on, he has to obsess over the details to make sure it doesn't break the delicate relationship between the server, the browser, and the user. But if he owns the whole thing, his obsession over the details can be turned into ownership of the details, which is something he's wanted for a long time. Where this gets really interesting, though, is the principles. They are doing things different in a way that I've theorized, but I haven't seen anyone commit to. That's very exciting. The first point here, you'll understand why I am excited. Model first development. AI fundamentally shifts the human computer interaction model for both user experience and developer workflows. Optimize the source code, documentation, tooling, and abstractions for LLMs and not just humans. Additionally, develop abstractions for applications to use models in the product itself, not just as a tool to develop it. Do you know how rough all of these frameworks are when you want to stream a generated response or you want to update the UI whenever a new token comes in? All of them suck. I have had to fight React Router. I've had to fight Nex.js. I even had to fight Solid in Spelt when I tried. The slowest and worst performing AI chatup I ever used was written in spelt. So, none of these tools do this well. None of them provide the primitives that make building an AI product good. And few of them provide the pieces that make building with AI good either. As such, we kind of just use React because it's what there's the most source of available, which is why all the models can do it better. But if the framework was built to be simple, concise, and follow either web standards or really simple single path like solutions, LMS could theoretically get really good at these more minimal frameworks as long as they provide a solution to every problem and they don't pull in random all of the time. The idea of a framework built around models, both to make products for LLMs better and also to make developing against it with LLMs better is actually really exciting. It's why I think Convex is really good now more than ever because they're proper infrastructure code. So everything you'd want to do is just source code, which means the LM can generate stuff much more effectively. It's interesting to see someone building with that in mind from the start, and I'm excited to see where they go with it. The next point is building on web APIs. I already talked about this, but they really like these standards. Not that they think that they are great, but they think it is great. They exist and they want to use them as much as they can. So rather than doing different patterns on the server versus the client, they want to use web APIs as much as possible. So you don't have to remember there's a different version of this thing when you're in the node file versus when you're in the client file. Another point I think is really cool is the religiously runtime piece. They don't want to use a bunch of compiler tricks to make stuff work. As incredible and elegant and powerful as server components are, they require very delicate intervention from the bundler to split things up properly and turn it into this weird machine that calls web APIs to fetch data from the server and embed in the right place in the browser. They don't want any of that. They want the code you write to be very very close to the code you run. Ideally, the only difference is you remove the type definitions and you turn the JSX into real functions. That's about it. They also, as I mentioned before, really want to avoid dependencies. They are tired of dealing with other people's road maps. Choose them wisely, wrap them completely, and expect to replace most of them with your own package eventually. The goal is zero. Fascinating. Excited to see where that goes for them. Point five is that they demand composition. Abstraction should be single purpose and replaceable. A composition abstraction is easy to add and remove from an existing program. Every package must be useful and documented independent of any other context. New features should first be attempted as a new package. If impossible, attempt to break up the existing packages to make it more composable. However, tightly coupled modules that almost always change together in both directions should be moved to the same package. And the last point, distribute cohesively. Extremely composable ecosystems are difficult to learn and use. Therefore, the package will be wrapped up in a single package as dependencies and then reexported as a single toolbox which will be remix. Exciting. This is a very very promising future. As I hinted at throughout, I had a long chat with Ryan about this and he got me pretty hyped about the way he's thinking about things. The framing I gave that he ended up really agreeing with was nobody's really rethought Express since React and Typescript happened. We have thought a lot about what does it look like to run React on the server. We've thought a lot about the shape of the API using things like TRRPC, but the idea of a route hasn't been challenged meaningfully in the idea of a serverside framework that is focused not just on responding with JSON or HTML files, but is focused on responding with unique useful context depending on the need of the application. There hasn't really been an application first express that has all the stuff that we need. And that's one of the parts that they're thinking of here. And then when you do that, if you start from the server that takes in the request to the URL and you rethink everything from there to the user's response to the thing that renders in their browser, you realize you need to rethink a lot of layers along the way there. And I already people in chat, what about Fastify? Fastify has basically the exact same API as Express. I love Fastify. I really do. I use it for a ton of stuff, but it isn't a replacement or a rethinking of Express. It is just a faster version of Express. We haven't rethought these things at their core. And that's what's exciting here is after the last decade of building this way using this huge pile of tools across the ecosystem to build awesome stuff. No one sat down and tried to pick the best parts. We've had things like bun that did this to node, but they're as focused on compatibility as they are on like new features. No one's done this for the set of tools we build applications with. And no, your favorite random serverside thing like Allegia or Hano is not this either. All of these are rough abstractions on serving routes. None of these are rethinkings. None of these are attempts to change how a URL becomes an experience. And I really like the idea of starting from first principles to make building good applications easier and not just for humans, but for LLMs, too. Now is one of the last moments this can happen and I am very excited to see what they end up doing with it and I'm even more excited to see how the market responds to it. Someone in chat just said the key piece new Rails that is how Ryan framed it with me. What if we built something like Rails but instead of it trying really hard to look like English and run like it instead tried to use web standards to make great experiences. If instead of pretending the browser was useless and ignoring it, it built using the browser standards as a shared language between the server and the client. What if we really deeply rethought how we build the web with JavaScript using everything we've learned over the last 10 years? And I am so excited to see if they can pull it off. Genuinely, this is not meant to be a slight in even the littlest bits towards Tanstack start and the Tanstack stuff that Tanner is doing. I love all of his work. Tanstack router is super promising and it's one of our top picks for where we'll end up with for T3 chat. Nor is it a slight Nex.js, which funny enough for T3 Chat, we're using Nex.js alongside React Router. It's a hilarious stack, but we're doing it. It works great. I'm excited to see where all of these things go. But I am really excited to see people who know what is great and terrible about both the web and the tools we use to build for it taking everything they've learned and trying to distill it into a single solution. And even if it ends up failing, which statistically speaking it probably will, we will still learn so much from it. Yeah, I'm excited as hell to see where this goes. So my message to Ryan and Michael and everyone else working on this is that you have my full backing. I am so excited to see where this goes and I hope you'll continue to keep me in the loop as the project develops. The future of the web is brighter than ever and I am so excited to see people who have been shephering it for the last 10 years take the opportunity to look forward and figure out what the next 10 years look like. Let me know what you guys think in the comments. Am I way overhyping this thing that doesn't exist? Or is there a real cool opportunity here? Curious what you all think. Until next time. ## Remix is starting to excite me - 20231220 it's no secret that I haven't been the biggest fan of remix I saw the patterns and was excited by what they were doing but there was a lot of implementation details and just overall developer experience stuff I didn't love that said over the last 2 years they' have made a ton of progress and I am genuinely really hyped to some of the things that they have coming going forward with the amount that nextjs has changed and moved into its own crazy Direction it's nice to have other Frameworks focused on a more minimal approach while still getting some of those same benefits from react and more importantly server components so so what does remix have in store and why am I getting so much more excited about it again well let's take a look so the first big change I want to talk about is what Mark dalish has been working on vit this is a huge change previously remix was built on top of es build itself so when you were using remix you didn't have access to much of the plug-in ecosystem that already existed in communities like vit and webpack and rollup and all these other places even when V was made they went out of their way to use es build during Dev but to use rollup for production so you can still have access to to that huge plug-in ecosystem because Rix didn't use an existing bundler that had a plugin architecture like V or rollup or webpack most of the implementations for things like SVG loading had to be custom rolled into remix itself to be fair when remix was started V wasn't really a thing so it makes sense that it took a bit to get there but this is an effort that was largely led by Mark dalish for those who don't know Mark he was one of the creators of CSS modules and he also made vanilla extract which is the first typescript focused style system for building typesafe CSS and styles in your applications really cool stuff Mark being part of remix has restored a ton of my excitement for the project and I couldn't be more hyped to see the impact that he has over time so vit now works it's in a surprisingly good and stable State and if I was to ever use remix I would certainly be using it with vit but that's not the main thing we're here to talk about as exciting as it is what we're here to talk about is server components server components are a big change for remix because remix is very focused on rout level data loading which means that if I need data in a component I don't specify in the component hey I need this data instead I specify at the route so when I need data for a product that I'm showing on a e-commerce page rather than the component saying what data it needs the route of SL product/ ID and brackets would have a loader specified on it that gets the data that anything on that page would need the problem with this is there's now a non-deterministic attachment between the components that need the data and the route that actually loads it so you have a component that needs data like the comment section on a video or the details for a product those types of things required that every page that mounted the component also had the loader present or you would just go back to doing it the old school react way where you have a use effect or react query to do the data fetching this pattern is not particularly composable and that composability is the beauty of react the ability to have a component that has everything it needs in it you just mount it with whatever props it expects and things behave how you would expect them to the problem with this approach was that if you compos these things on client and you had a component that needed data that once it got the data it mounted another component that needed data once it got it mounted you get the idea waterfalls were a real problem and if your user has to connect to the server get authenticated the server then has to go get the data and then send it back to the user and you do that 3 to five times it's real bad this waterfall problem is very real and remix was built to fight back hard the focus of remix on Route level loading was to make sure each route has one place the data comes from one time and if a component needs data then it better be mounted on the right route that has that data but that's the dangerous part a component could say I need this data but remix isn't necessarily going to give it there and as a result there has been a lot of weird design decisions I didn't love in remix like the outright refusal to support type saafe data loading for a long time because they knew that the relationship wasn't deterministic enough and if you use the type of your loader in a component that didn't actually have that loader CU it was on a different route everything fell apart the result of this was remix looked really good in these single file examples where you have your backend loader and your front end components all in one file but as soon as you have an actual Dynamic code base with lots of components that have lots of differing data requirements this model starts to fall apart the remix team had a lot of concerns with server components because they kind of go back to that waterfall model where each component can request data itself and that can result in another component that needs to request data etc etc and they hate waterfalls but there's a huge difference between the waterfalls of old react and new react old reacts waterfalls happen on the client so every time a component mounted a component that needed more data that component had to talk to the server and that Gap was a huge part of why waterfalls were so bad serers side waterfalls however significantly less bad if a database query blocks the next database query you go from 2 milliseconds to three and a half not when it blocks on the client and you go from half a second to 1 second huge huge huge huge difference as such the composability of server components makes the waterfall trade-off not as big of a deal more importantly it is is a really really good developer experience and it took a bit but it seems like the remix team is coming around to it they previously said they were unsure and likely not going to do server components for a while but this proposal on GitHub as well as the tweet that Ryan announced it in is that they are officially committed to getting server components into remix I am so hyped about this genuinely for me the strengths of remix are the super minimal nature of the framework combined with the focus on performance and web standards a lot of the latter has happened in nextjs now but next is not minimal I will never pretend that next is minimal framework it does a lot of crazy and I see an exciting future where remix becomes the go-to minimal framework to Showcase what V plus server components looks like I really want that I want a good simple focused minimal implementation of server components that uses standard Technologies like V that I can use to showcase the server component patterns Deep dive into how they work and all these types of things as long as NEX is the only way to really use server components it is really hard for me to teach what server components are and how they differ from next J s itself I really hope remix team makes progress on this and I'm excited to see where it goes because the combination of this with v makes it a much more compelling framework that I'm excited to take a look at that said probably not going to use their actions or data loader stuff anytime soon it just I don't care about rout level data fetching it doesn't matter that much anymore making your DX that much worse just to guarantee every request to your server has all of the data responded immediately it doesn't feel like a worthwhile trade-off to me and the new model is just so compelling that I don't care anymore I'm excited for Server components in remix I think you guys should be too if you want to hear more about how the different data fetching and data loading patterns work in all these Frameworks I'll pin a video in the corner all about SSR and how this stuff works you already seen that there's one below you might like instead appreciate you all a ton I'll see you guys in the next one peace NS ## Responding To The Tailwind Conspiracy - 20240303 the Tailwind marketing and misinformation engine been hearing a lot about this post and I had to take a look myself so uh let's see what about Tailwind is misinformation and I'm sure I'm being accused of some things in here cuz that's the way when people are talking about tailin marketing so let's take a look tell when CSS was born out of this sentence the most reusable components are those with the class names that are independent of the content yeah that's true this is part of his keynote speech at tail and connect last year the sentence is from Nicholas Gallagher's article about HTML semantics and front end architecture it was a turning point for Adam the Creator and front man of Tailwind after reading the article he was quote fully convinced that optimizing for reusable CSS was going to be the right choice there an interesting way of framing the goal of Tailwind in the idea of reusability within CSS because the more things you add to a CSS class the less reusable it inherently is and the way Tailwind Works where every class is just one line that binds to one concept and you assemble those in the components instead that CSS is being entirely reused in that sense this is an interesting framing CL pointed out that Nicholas Gallagher is the creator of react native for web he built the mobile Twitter platform for web he built so many different things in this world including the react strict stuff that I talked about earlier on stream today now he's popping up here about HTML semantics in frontend architecture seems like this dude knows what he's doing good stuff let's take a look at the rest of this article though phase one the origins of Tailwind Nicholas points out in the article that scalable HTML and CSS must quote rely on classes within the HTML to allow for the creation of reusable components so instead of using a Content dependent class name like news one should use content independent names like UI list or UI list item I I'm already predicting where we're going semantic HTML is going to be the thing everybody's mad about the more generic the name the more reusable it is he used the famous media object as a prime example of reusable CSS very simple object but it's very powerful we can eliminate a lot of lines go by starting this repeating pattern the hard part is making sure the image can be any with so the elements reusable cool so this an example of making a custom media class that could be applied on anything with like an image and it'll be handled correctly oh look at that Stella Got shouted out here you guys don't know Stella is Nicole she is one of the core people within the world of browser standards and is also one of the people who invented one of the earliest utility CSS Solutions she used to work at Google on the Chrome team trying to bridge the gap between Frameworks and chrome and she somewhat recently went over to Apple so absolute Legend not surprised to see her popping up in things like this oh yeah this is all Nicole stuff did she just write this yeah this is Nicole's blog stubborn .org godamn it I need to pay more attention to these things anyways good example but that's not how Adam understood the sentence instead of moving towards more reusable class names he introduced a custom grammar to inline styling rules directly to HTML yeah oh boy here's where things start to fall apart this is going to be a a wonderful mess sticky top zero yeah your usual Tailwind spam class yep cool this was quite a big step away from what Nicole was saying who resisted the idea of coupling visual information to elements like everyone else in the industry back then however in his keynote speech Adam makes us believe that the language he created was a prime example of Nicholas's thinking and because Nicholas was working at Twitter Adam's take on CSS should work for sites small and large there are like 15 reaches in here at once and I'm sad because this guy clearly has a good history of where these things came from and rather than using that to share with us it feels like he's weaponizing it against something he doesn't like oh boy on August 7th 2017 Adam wrote an article about CS utility claes and separation of concerns it demonstrates with cleverly chosen examples how his new creation leads to more maintainable CSS architecture but there was a challenge to make such a statement he needed to reshape the established CSS best practices so he introduced new terms to back his contradictory idea the new terms and phrases T and devs are familiar with this feels like a bit of a reach but we'll we'll continue going as we need to the new approach can be summarized as follows semantic class names are the reason CSS is hard to maintain it is a thing Adam says here it's one of the many many pieces and he also com something here that I think's important you're never going to believe me until you actually try it this was me I have made a couple videos where I talk about this before but I did not think I would ever like tailwind and then I had to use it because a cooworker had selected it for a project and I was probably like 3 days in or so before I fell in love and now I'm all in on Tailwind to the point where I'm probably going to be stereotyped as the marketing machine this article was built to [ __ ] all over so yeah I agree with Adam 100% here on top of that I don't think this article has even kind of acknowledged the idea of a component yet okay the creation of reusable components is touched on here a bit about Catalyst and then component there does not seem like this author really wants to acknowledge components and how they've changed things that's going to be an important tone going forward this is the part that I feel like is a gap between Adam's understanding and this author's understanding that's going to be really hard to cover the concept of reusability exists at different scales here the goal Adam had was to make the classes even more reusable where different types of elements could reuse the same classes and the types of elements in their reusability would be abstracted by components so the way that the media example worked earlier was you would apply that class to anything that contained media which means it solves that type of problem this contrasts with how most U guys are being built now that have component models where I don't need a media element to exist outside of my react World I need a media component that will render things correctly similar to like the image component inside of next these Solutions are where those abstractions happen the reusability within your user interface comes from a component the reusability of the core pieces comes from tailwind and those core pieces are much much lower level they're individual lines being applied the ability to copy paste things between stuff was just brought up by chat there are so many little Powers you get when you build in this way it is so much more flexible it's so much easier to debug it's insanely reusable I would argue Adam actually took the thing that Nicholas was saying and pushed it even further by letting you figure out where the reusability should live in your project but by by default everything you write is using these reusable Primitives Adam said semantic class names are the reason CSS is hard to maintain it's not the reason but a certainly a reason and it's actually a pretty big one the relief you feel when you realize you don't have to write names for things anymore once you get deep into Tailwind is insane and I was working in a project that was still using BM recently and just trying to figure out which classes were weren't being applied what goes where all of that those challenges are so crazy that multiple new Frameworks have been built just to work around how hard it is to manage lots of named things in your CSS Solutions and again he's saying these weird bold statements like it contradicts with all prior work and studies about CSS he better justify that statement rather than just saying it the problem I've had with a lot of the CSS and specifically the Tailwind fear uncertainty and doubt is that they're saying this is bad because standards but they're not saying why the standards are good so let's hear what he has to site here as we go in his keynote speech Adam uses harsh words to describe the traditional way of structuring CSS as opposed to how Tailwind is described Hispanic CSS doesn't scale it's unmaintainable and it's [ __ ] [ __ ] yeah those are all accurate words on the other side Tailwind is thoughtfully designed well engineered and meticulously balanced it's impossible to argue the first part there is a lot of thought in tailin his design like a truly disgusting amount that is hard to comprehend which really clicked for me when I read the book by Adam refactoring UI which was written before Tailwind even existed and it kind of gives you the idea of the things that led him to making Tailwind well engineered maybe debatable I would say it's hard to debate that the engineering efforts put into Tailwind aren't incredible think that as an industry we have a lot of respect for the engineering that's gone on in Tailwind crazy things like the jit in the way that the compiler Works to generate the most minimal subset of CSS possible for the things your pages are building in the size of the bundles that come out both on the HTML and the CSS side being as small as they are it's really hard to write CSS in any way that is more optimal than the natural output of using Tailwind like it is very hard no matter how talented you are to build something where the actual code being shipped to the user is less code than what tailand would have produced instead so I would say well engineered is pretty hard to argue against meticulously balanced sure you can have your opinions on but five of the six points here I'm in full agreement on in the sixth one you can debate but it would be a long debate let's see what he has to say about these statements old best practices like semantic separation of concerns or clean are usually quoted which is a common way to question the validity of the word oh boy here we go unfair or not this marketing scheme worked developers took the new terms and practice for granted and started tweeting and blogging about them it was a gold mine for Twin's commercial business model oh no it just clicked what this is he thinks Tailwind is a scop to sell the book he thinks they're trying to trick us all into not using CSS so they can sell us things he's delusional this is going to be very fun also tallwind nice utility first workflow once they started caching Tailwind wanted to make sure users were properly onboarded and locked into their system they introduced the utility first workflow tailin encourages a utility first workflow where designs are implemented using only low-level utility classes this is a powerful way to avoid premature abstraction and the pain points that come with it here's how the flow Works step one onboarding in the utility first approach the idea is to build everything out of utilities and later extract repeating patterns as they emerge didn't you just say putting things in quotes is a way to pretend the words don't mean anything anyways you're encouraged to try the system Adam says if you give it a chance I really think you'll wonder how you ever worked with CSS any other way oh boy once installed you'll quickly start to see why people enjoy Tailwind you can write your styling in the same place as your markup and never think about semantic class names you feel productive with all the handy shortcuts coming together with hot module Replacements not touching on the component part here at all seems to really avoid that step two premature abstraction at some point hundreds of utilities later the code you've written doesn't look pretty you start wondering what comes next after the utility first step how do you clean things up turns out there is no next step or it kind of exists but it's called premature abstraction you can start extracting classes with out apply but the documentation for reusing Styles describes it as bad practice whatever you do don't use out apply just to make things look cleaner why should I use out apply for if not for cleaning up documentation does not say it only tells me why it shouldn't be used sometimes it's best to tell you what not to use something for so you don't and then when you hit one of those rare edge cases where you need it you can one example would be an article where you have a bunch of content that's being streamed in from something you don't have control of where you're not controlling what the H1 has on it but if you want to apply to all H1s under an article a certain set of styles from Tailwind ad applies a great way to do that maybe you're using web components or some third party thing that is still using semantic class names to describe sub elements and you want to apply specific styles to them ad apply is great for that the point of AD apply is kind of similar to use effect if you can get away without using it you probably should but once you need to glue Tailwind to something that you don't have control of that exists outside of what Tailwind understands add apply makes a ton of sense but you should only be using it in those cases when you're trying to app apply styles to things you don't have control of that's why it's at apply not at use Tailwind or something like that it's meant to be an escape hatch to things you don't have ownership or control of and rather than understand that this author is really excited to say they don't like clean so they're bad and also they didn't tell me how to use it so I should guess that this is negative okay we'll see where this goes there are some really good points in the reusing Styles page that I really like that he just did not touch on including the word component which appears 18 times on this page even though in the article you're just reading it appears five and only in context two times there's one core point a lot of these older HTML standards devs just don't like to acknowledge and honestly huge huge credit to Nicole specifically for being good about this and helping bridge the gap between the Chrome team and the rest of the world most devs aren't reusing their styles by applying the same CSS to five different things most devs are reusing styles by rendering the same component in seven different places the point of tailwind and a lot of the new things like it including stylex who this author would hate just as much based on their current points is that it lets you contain the behaviors to a reusable piece that lives in JavaScript because we're reusing things in react not in Styles if I have a bunch of different elements in my project that are using the same Styles and they're all applying the same class name and I delete four of them and I think oh I'm good I can go delete the CSS now nope what ends up happening is we have a bunch of these CSS classes that we think are being used in places that they're not and now we're scared to delete or improve or do anything the maintain ability of these code bases where you have reusable components and reusable CSS intermingled in the most chaotic possible fashion results in actual maintenance hell and while I could honestly almost agree that if we were still in static HTML land Tailwind would feel like a weird way to abstract as soon as you recognize that components are the abstraction for reusability and CSS just kind of gets in the way Tailwind makes infinitely more sense infinitely more so I would recommend checking out the reusing page on the Tailwind site if you haven't already there's a lot of good stuff in here one of my favorites is where they call out using editor and language features a lot of the time duplication like this isn't even a real problem because it's all together in one place the example they give is multic cursor editing let's say I want to change from Bold to medium for my top nav here instead of having one reusable place that I change one time I could just use my Editor to select all of the instances of font bold here just pressing a hotkey and then change them all at once it seems silly like why wouldn't you put that somewhere else isn't not repeating yourself super important well hopefully we all agree that dry was a not the right way to think about all your code and this is much easier because this is much clearer easier to fix and maintain and the most important part when there's something wrong with our styles on our website and I need to go fix it it's easier than ever to find the specific element that has the wrong style and fix it that's the magic of this system it's not just easier to write it's way easier to fix debug and maintain and if you really wanted just one class for all of these just go quickly to find a component on top called topnav link and apply these there and then have a list that iterates through them all it's not hard to do you choose where and how abstracted things are because you're abstracting them in your JavaScript and in your framework yourself if you can't abstract things because your life is static HTML not only should you not be using tail and you shouldn't be talking about it cuz it wasn't made for you and that's fine and it's also funny because communities that I would argue lean that way where it is a static HTML response you're getting like I don't know the Elixir Community or the rails Community or the PHP Community all of those places all of them have embraced Tailwind surprisingly hard especially The Elixir community that seems to love tailwind and how it lets you reuse pieces across things and have to deal with yet another programming language they don't want to touch so you need to not just contest with in your little bubble how Tailwind doesn't necessarily help you you need to contest with the rest of the world everyone from freaking laravel to Elixir why they're all wrong too because we all have grown to fall in love with this pattern anyways step three is vender lockin oh boy so I keep coming back to the first step resulting in more and more utility class classes I'm locked inside of a loop don't make things look cleaner so we have the tail and mockup we have the semantic markup equivalent of class equals primary so we don't make them cleaner we just keep going back in here yeah and I find this is a rather clever way to lock people into using Tailwind resulting in more retention loyalty and money this is a straightup conspiracy I am being [ __ ] sced into reading a conspiracy to all of my viewers right now you know what credit to the author I would stick to the tinf foil hats and Aliens if I were you but to each their own obligatory before I forget if I see any single one of you guys harassing this author regardless of how we feel about the article perab ban from everything related my community I do not want to associate with you this person does not need to be harassed you not need to be talked to I'm using this post as an opportunity to share with y'all why these arguments are stupid so if other people in your life make them you can reference this argument not go after this guy and give him a bunch of [ __ ] for what he wrote that's not the goal here clearly his mind can't be changed and we shouldn't be interested in that but there are people who read this and assume because it's stated so confidently from somebody with experience that it has to be true and my job here is to tell you it is not anyways phase three Catalyst UI kit December of 2023 Tailwind introduced Catalyst with a richer set of language expressions and a react based uui Library this is where he's going to start saying this whole thing for money oh boy the DSL to keep up with ever evolving CSS standards tayen introduced another set of language literals over the years tailand has grown from a simple set of atoms to a vendor specific language with Expressions operators and Method calls let's look at the source code of the first button on the Catalyst demo the black button source code expressions are sorted alphabetically button BG theme I have many questions about this well yeah the same way I'd have a lot of questions if I was reading a CSS class that had this many lines I would have just as many questions but most importantly how is this W text more maintainable than class name like primary this can't be good faith I have to be getting trolled right now you're joking right because adding the the word primary instead means all of this just gets deleted like if you just used semantic CSS none of this code would have to exist you're joking right this just gets moved to a different file hiding code in a different file does not make things simpler it makes them harder to find and debug you're just putting it somewhere else and pretending that makes it better funny enough if you want to do that you can in fact that's what Catalyst does the difference is the file ends in jsx instead of CSS that's the only difference here actually there's another difference when you have this in your jsx instead of in your CSS you can also bind behaviors next to this stuff so if you want your button to do something specific or you want to enforce that this button has an AO label or those types of things you put this in a component and then you use the component across your code base the same way you think primary should be reusable across your code base I think button should be the difference is one of these things is maintainable the other is hiding the Styles in a different file and then calling it maintainable Insanity have you just not worked in a codebase that has JavaScript in it that's the the only reason I could think someone would talk in this way the only way you would feel this way is if you already have a CSS file you already have an HTML file and you don't have anything else but as soon as JavaScript is involved in the puzzle here this argument makes literally no sense anyways also are there any limits to the utility first workflow when can I use ad apply to clean things up after 50 Expressions 100 Expressions 1,000 oh my God modeled after HTML another major feature in Catalyst was a new markup language that separates all the language literals behind the react components here's a dialogue example using Catalyst components cool it's a component Library component libraries are the most normal thing in the [ __ ] world have you used a component liary before yes no I'm lying no actually I haven't I'll do one more no I don't do front end I don't know about you guys but I usually handroll my own markup language each project not even that you're hand rolling your your own bindings between the style system and your components when you come up with your own naming syntax every single time that knowledge is not transferable even between files in your existing project much less between projects much less between teams cic component Library it's a Shaden UI style of templates even funnier so of my audience who has answered thus far 133% total have not used a component Library component libraries are the most normal thing in the goddamn world and for this author to just pretend this is some new magical DSL that the Tailwind team made to sell us something is actual conspiracy theory level chaos I can't believe he's doing this in good faith button button primary Kaa yall get this I don't need to be yelling at my chat about this this isn't for you guys I I could see why Prime got heated enough reading this I yeah this is a hard article to read and also make a video about because I don't want to be as negative as it's making me be it's just so egregiously wrong in bad faith the market feels surprisingly similar to semantic HTML yes because we are using components for our semantics the semantics of the HTML doesn't matter when it's a compiled output of our page content when we are running code to generate the page and update the page our ergonomics around the reusable pieces is way more important than this vague concept of semantic HTML that you keep wielding as though it's a magic power that makes all the clean stuff happen and all the dirty stuff go away this is how components work it's not vendor specific markup it's literally how components work let's see how often the word standards comes up in this page six times and components comes up four times says a lot this raises more questions most importantly how is button class equals plane different from button plane isn't this semantic the root of all bad in CSS I don't have words does this person not know what JavaScript is that's the only conclusion I can come to here from this sentence here chat can you guys tell me how an HTML button with the class plane differs from a component name button with the prop plane let's see it in chat how are these different I'll give you guys a hint there's no one answer there's like a thousand HTML is not a component button plane is actually that possibly underneath different file jsx vers HTML props our data which is not CSS needs JavaScript one is HTM plus CSS the other is JS that generates the same thing yes but one important piece you guys aren't mentioning quite enough here yeah one has code behind it very very useful the difference is I control the behavior of button I control its inputs its outputs its behaviors it's everything I Define button not just as a way things look but as a way things work the way it looks it's St its behaviors are things I get to decide when I Define the button but when I Define plane I could use plane in 15 places that all have different behaviors and expectations and now when I change what plane does it might break four other things but when your components are encapsulated containing the Styles the logic the data and the behaviors all that being contained is so good that we've now built dozens of Frameworks around it the reason that we have this huge surge of Frameworks that everybody loves to talk [ __ ] about is because components re revolutionized How We Do development it's so much better that whole new Frameworks outside of the web have been built like Swift UI like if CSS was so good why does Swift UI code look exactly like react their body equals some view it's a vstack that has these properties an image that's resizable aspect ratio frame clip all that you define a thing you want to use you define how it looks and what you pass to and from it and then you reuse this component in other places this is how the world decided uis are built in scale because it's how uis areed that are scalable we as an industry have moved towards this because it is so much more maintainable even new projects like the rust work being done for Zed the text editor they built everything on top of their new Tailwind equivalent that is built into their rust runtime and rendering engine where all the components are defined like this because this worked better the industry is standardizing on a component model because it lets you scale in ways you couldn't before because you can have different teams maintaining different components and everything works together because the relationship between these parts is a contract that is finded through the framework itself but my CSS looks worse [ __ ] off and the standard HTML dialogue is bad but dialogue with uppercase is legit no lowercase dialogue has no guarantee over how it behaves uppercase dialogue is a thing that my team reviewed with specific behaviors that we encoded or didn't encode because this is something we built and that's the difference if I was a solo Dev that knew exactly how I wanted to use every single thing and all of my pages were static and I was already a CSS expert sure these two things probably aren't that different but if I have a team if I have a framework if I have scaling if I have anything to worry about other than my shitty blog post all of a sudden I'm going to want a component Jesus Christ why introduce so many different versions of the P if your issue is with react just say that if your issue is with components just say that Tailwind shouldn't be catching Strays because you don't like Frameworks sir because this article has almost nothing to do with Tailwind now that I've gotten this far this whole article is this guy not liking components we just such a weird Hill to die on holy [ __ ] why is content aware naming okay in element names but bad in class he's so close to realizing in this moment if he had just said the word component here he might have had the realization of how dumb what he was saying is but the fact that he can't tell the difference between an element and a component says everything I need to see about this author is separation of concerns suddenly okay with catalst but bad with vanilla HML and TSS yes because separating by markup Styles and beh behavior is dumb when you could instead separate by a piece that is being reused that includes all of those things the same way that model view controller is dumb unless your problem happens to split up well into model view and controller HTML CSS JS is dumb unless your specific problem happens to split well between HTML CSS and JS but as soon as your team is architected differently that doesn't work at all a component being able to own all of those parts will always be better than inherently treating them separate and just dealing with the walls as they are already exist it's clear you're confused you don't have to specify that anyways I love CSS he loves CSS so much that he doesn't want anything else going near it it's very clear I started web development at the age of a blink tag and CSS has always been my favorite part of the web dev stack particularly fascinated about the crossing between the design and front of the front end oh boy does he think front end now has multiple parts and should be separated by those pieces not by how our components are architected oh boy you also check out my full Stack video if you want an idea of why I think this is dumb I think most devs should understand how things on most sides work if you are working primarily on the web you should be very familiar with your design team as well as your backend devs that you're building the bridge between if I've learned anything reading this is that this particular author would be a miserable coworker heart goes out to anybody who's stuck working with this guy because I cannot imagine what a disagreement looks like okay I can kind of imagine what a disagreement looks like it looks like you giving up because it's not worth it with this [ __ ] anyways when Microsoft released Internet Explorer 4 with solid support for both both external SC sheets and dhtml it nailed me to the separation of concerns pattern I see it as the most important component for software scalability and is particularly important with HTML CSS he's so close the word component it's right here he's so close but he's not even using it as a component as like the thing we use on the web he's right there it's really funny to be that one of the four times he referen components in this article it has nothing to do with components the way of organizing design has been around for centuries there are element types and contexts the nuanced relationship between four Form and Function CSS is the missing tool to bring foundational design thinking to front end development these are just words these don't mean anything he's just saying things now again he said there was all these studies and things where are the studies show me them don't just vaguely allude to you knowing better than us this appeal to Authority isn't working when you don't even cite the authority fast forward to this date and the solid foundation has almost disappeared styling is inlined and CSS is written with JavaScript there are no element types nor contexts styling is flat and not cascading Global is feared instead of used we're using maybe 30% of the full potential I'm not a fan of any of that this guy still uses double equals I'm calling it I recommend everyone to take a closer look to what has happened to CSS there in the past 10 years regardless of your current stance it's a powerful language that far surpasses the capabilities of Tailwind learn to build scalable architectures and see how Atomic class names and inline styling fit into the bigger picture the author seems to think we should learn CSS first which yeah sure for a hot take I got way better at CSS when I started learning Tailwind because it gave me the opportunity to deeper dig into the parts and also the subset of tailwind and CSS that should actually be used the amount of things in CSS that should never be used for any reason that are just there and documented exactly the same as other things results in so many absurd foot guns being hit constantly whereas with Tailwind it's easier than ever to see the classes that they provided hover over it and see exactly what CSS they're applying and why this also comes alongside their documentation which is one of the best resources I've ever found for CSS even on the projects where I'm not using Tailwind I often reference their docs so I can get the exact line of CSS I need to do the thing I'm actually trying to do this is a message from Haman if you don't know him he created stylex which is really interesting because it's a little more traditional cssy than Tailwind but it's built to be entirely scalable and modular to work well in something like a giant codebase like Facebooks and he's pointing out here there's a difference between learning styling and learning selectors I learned a lot about styling from tailwind and I'm able to ignore all of the [ __ ] around selectors I suck at selectors now because selectors are a bad unscalable pattern and I can finally avoid it first thing he says is to start from Nicholas's post and learn the benefits of semantic naming understand how Adam Cherry Picked one sentence and misuse it to validate the contrasting practices of Tailwind this post is really good and it does not show an example of being cherry-picked in fact this article has done a phenomenal job of cherry-picking random unrelated things ignoring reality and then writing its own narrative cherry picking can go both ways cherry picking can be you take one thing and misuse it can also be you entirely ignore 95% of things you get the point number two study mdn documentation on web standards there's a lot so start with the most important aspects of CSS the Cascade and specificity someone who's been writing a lot of web for a very long time I promise you Cascades and specificity are two of the most painful things you'll ever learn as a software developer and I don't think we should Stockholm syndrome new developers into feeling like they need to understand the inner workings of every single one of these things turns out not worrying about these things can often make us a bit more efficient the same way components making us not have to think about the difference between a model of you and a controller has made a lot of things more efficient as somebody said in chat I definitely miss exclamation report important everywhere don't we all I want to see if somebody can analyze his blog and find how many exclamation point importance exist on it just for a quick dunk I'd appreciate that point three take inspiration learn how the best developers in the game like Ryan migan Amed Shahed and Josh comeo use CSS in more stylish and creative ways isn't Josh pretty cool with Talent it's interesting to site him here anyways content first here's a better workflow it has many names standards first content first or Progressive enhancement make clean things class primary primary color white this would have been text white the equivalent of this would have been text white you start with a pure semantic layout and figure out all the reusable pieces of CSS at times especially when building new components you might want to prototype quickly with inline styling but that's okay in part of the system you can clean things up later this dude's delusional I I have no other no other way of interpreting this as soon as you work in a job you learn this is the most unreal thing that just doesn't happen once code is merged it doesn't get cleaned up it sometimes happens in very small circumstances but it almost never does what if hear me out crazy insane thought what if the default was clean enough that we didn't have to worry about it and what if our arbitrary thought of what clean meant was kind of [ __ ] clean code is easier to Main maintain is does he not see the contradiction here does he not see how these contradict you can clean it up later clean cod's easier to maintain how does the code get clean who did this who makes the code clean and where's the work you lunatics here's a diagram I made a long time ago about potential code quality zero is bad 10 is good I made this because Ryan carniato the creator of solid who is one of the most talented web developers in the world didn't like typescript that much don't me B to understand why and this is how I understand why because Ryan's capabilities are such that he can do things greater than what the typescript system allows the catch here though is that typescript has a pretty high floor as well as a reasonably high ceiling can you argue it would be nice if we had more code that was out here that was this good yes that would be nice if we could but as soon as there's a single person on your team that isn't above that bar you're [ __ ] because code will always default to whatever the lowest quality contributor is period so if you have something like typescript that sets these boundaries it significantly increases the quality of what a dumber developer like a Theo might be capable of the beauty of typescript isn't that it allows for all your code to be perfect and anybody saying that is not to be trusted the point of typescript is that it raised the floor so much higher that most of the code you write in it is inherently less error prone because so many classes of problems you normally run into have been thrown out just by adopting Tailwind now replace Ryan with the author of this post typescript with tailwind and leave me here in a theoretically perfect world could this author write CSS that's ideal and slightly better than what Tail's capable of yes what he's refusing to acknowledge is that most CSS that's been written today exists here most CSS is awful and impossible to maintain and a terrible experience for everyone involved what Tailwind did for me is it helped me do better where previously my CSS probably lived in like this range tailent has given me the opportunity to shift this up because the Baseline the floor when when you're using Tailwind is so much higher is the theoretical ceiling slightly lower sure but when I have a team of people contributing from all over the place like hundreds of developers working in my code base with me I'm no longer talking about what the best possible code looks like and to think you are is to never work in a real team we're no longer thinking about how good can things be we're thinking about how do we prevent things from getting worse What walls and bars and things can we introduce to prevent the quality from slipping below this wall what is our floor and how do we maintain it and literally nothing in this article even acknowledges that that floor exists in fact right here he's saying write code that's below the floor eventually you can move it back up that's not how it happens once you do things wrong that first time even if you deal with it later it's already been copy pasted to 15 places there are no pain points in clean code only benefits this is the system I want to teach to my kids I want them to understand how web standards work and where all the trends come from cool these are cool things to like share and talk about not fundamental parts of your education I analogize to skateboarding a lot and I feel bad falling back on that here but whatever you don't need to know the history of Ronney Mullen to land your first kickflip you need to know what a kickflip looks like and roughly where your feet go if it turns out you actually like that thing if it turns out you enjoyed the kickflip and you enjoyed skateboarding you want to get more into it eventually you'll get to the point where you care about the history of these things but those are not necessary blockers for getting into the thing and being productive in the thing tailent has risen the floor such that people who aren't super hardcore nerds about CSS can write good Optimal Solutions for their things that they're building and this article's refusal to see how the floor has been raised because it's too focused on the ceiling right now is genuinely hilarious because Trends are temporary and standards are forever I you know what I'll propose a bet I will personally make the bet that we will see the way we do styling in the browser at a browser standard level fundamentally change to the point where it's unrecognizable before we will see the industry move off the component model components are a trend that is here to stay and is more established than Styles and more established than CSS and you've actually kid yourself into thinking CSS is permanent and components are temporary Trends you fully lost the plot like entirely lost the plot stay relevant my guess it's only a matter of time before Tailwind collapses the vendor specific language in the misleading communication cannot hold water very long the utility soup produced today will eventually turn into technical debt you mean the technical debt that you literally advertised as a way to build two sentences earlier you're joking right anyways the Next Generation looks back and asks you actually wrote that learn to write clean HTML and CSS and stay relevant for years to come is okay please tell me his his ending example that his final slide is the same exact dishonest example where he took the thing and put it in a different file and then said it was simpler I had to make a meme out of this because this is just so insultingly bad faith which is why I did make clean things yeah one more important piece that I want to call out because the chat has called it out is that this isn't some dude's blog this is a Content first web framework it's very clear this individual doesn't think components are a good idea and has decided to instead of acknowledging that components aren't a good idea do really awful click baity [ __ ] to try and get us to give him free marketing so uh yeah here's your free marketing new read the FAQ oh boy let's see this build a perfect web framework content first alternative crazy how the word Aster doesn't come up at all on a framework about content first web pages endorses semantic HTML and separation of concerns principles oh look he said the word component how hard was that they're tightly coupled containers of html's JavaScript and CSS in content which violates separation of concerns principle yes it does it's why it's so popular it's way better to not worry about that Jared Jared Jared Jared be funny if I could blame bun for this somebody in chat summarize this better than me does this not all stem from the inability to let go of the separation of concerns bit I honestly can't think of another expl yep there you go soap cake I think that's where we end the only reason all of this exists is this author's straight up inability to let go of this weird abstract concept of separation of concerns that the entire industry around him has recognized was bad and moved on from and despite his ability to move on I'll take advantage of mine right now and cut the video now peace nerds ## Responding to Prime's take about frontend frameworks - 20250223 so I like most of you have this particular Tech YouTuber I watch uh The Prime Time agen or something I think yeah I guess he used to work at Hulu or something this video was really really interesting though I've already watched it I think twice now but I wanted to go through it with you guys because there's a lot of things Prime says about building with Frameworks that I think we can learn a lot from but I don't fully agree with the conclusion because I think there are important details he is missing as he discusses it this video is going to be a little different than usual because we'll be going piece by piece through this admittedly quite short video 4 minutes and 20 seconds and I will likely be diagramming my thoughts I have no idea how we're going to orchestrate this but I still have to pay my team quick word from our sponsor then we'll get right to it you're watching this video you're probably a pretty good engineer what about the engineers around you though do you want to hire the best do you want to have a team full of people that are as talented as they could be we all do but it's getting harder and harder especially as we get flooded with these terrible useless AI resumes that's why I partner with with today's sponsor g2i these guys get it they will make it way easier for you to hire the best engineers and you'll know what you're getting as you go in when I say these guys get it I mean it they run react Miami which is my favorite react event sorry react com seriously you should check out react Miami if you can go next year it's super fun they also help giant companies like webflow and meta with their hiring so they're not just helping random small startups but they will help yours if you're interested what really makes these guys different is the pool of talent they have ready and available to go we're talking 8,000 Engineers that can start literally under a week you're not just reading a resume and hitting a check box they have full remote video interviews that you don't even have to show up for where they do the video interview and show you the results you can even pitch your own questions that will be asked and get a video response back so you actually get to know the human who you're going to be working with and they can help hire pretty much anywhere from US and Canada Latin America and even Europe and it's not just full-time Engineers either you can have part-time contracts through this as well when you start working with g2i they'll form a slack Channel with you with almost immediate updates these guys are on the ball they're one of my most responsive sponsors I know they'll be even more responsive with you guys if you're trying to hire grade engineers and get them shipping fast it's hard to beat g2i their goal is 7 Days from interview to the first poll request being filed and I've seen them hit this I think they will for you too check them out today at soyd dev. link gtii let's hear what prime said first and foremost and bro why we move from PHP and jqu to react to the client side rendering when it comes to web development nowadays we're trying to again to move everything to the server next CH server actions thear I don't know because life would be a tragedy if it wasn't a comedy what do you want me to say we just keep we we're going to keep running this wheel honestly in two years people are going to say my gosh move everything to the client and then we're going to do the client again and then everyone's going to be like no let's move it to the this one's particularly funny for me because I'm in the process of moving everything back to the client with T3 chat as one of the biggest proponents of server components so I feel it this this is going to be a fun one let's hear what he has to say a bit more first cuz I I agree with more than you probably expect but the details are where the killers are server and they're going to move it on the server again no one's going to be happy can I tell you a secret to life why you see this kind of repetitive nature of Thin Client thick client and all this it's actually really really simple first you start building something when you build this seems really nice seems really great the new way of doing things let's just call J querious for now is really awesome so much better than what was before you can actually do like CSS selectors with Sizzle it's fantastic so you start building and it gets great but then you cross like 20,000 lines of code and it just kind of sucks on the front end so what do you do next at some point you get into this new library called uh freea and free act man HTML it's so good it's so much better man there's like life cycles and then you go once it gets big it gets really bad and you're like oh why is this so bad and so the next thing happens and it's bad and then the next thing it happens and when it gets big it's bad and then the next thing happens it gets big and it gets bad and like you know you know what the secret is coding always kind of sucks it's always hard it's like eventually everything just sucks and that's where the fun is is just building the thing and here's where I need to jump in first and foremost I agree most things get bad at a certain size when code bases get large DX tends to go to if we were to chart this we have our Green Line we'll say this green line is the amount of code and we'll say this red line is the quality of experience so the quality of experience might be pretty consistent for a while but you'll hit a threshold where suddenly it starts to go down and then you might hit another where it gets worse and worse until you've bottomed out and everybody on your team is waiting 5 minutes for HMR your build pipeline takes two hours to compile your JavaScript into other JavaScript and you're questioning if you should quit and become a farmer this is real I'll just call it DX for developer experience and here we'll say green is amount of code this is effectively what prime is saying and I totally agree whenever you try something new this is really really crucial because when you're working on a code base that is many years old you are inherently here and when you're trying out something for the first time you're starting here if your first experience with react is in a code base that is here you're going to hate it and that's a sad reality is that react is so popular a lot of people's first react experience is when the code base that they're working in is already so far gone that the experience can't be good but if you're trying out something new like spelt all of the felt code in the world probably gets to like here Max just cuz the projects people use felt for are inherently smaller and they've optimized the hell out of how they're building them and the teams working on those projects tend to be smaller too there just aren't that many giant felt code bases so even if you're hopping into an existing one chances are the DX is going to feel much better simply because the size of the surface area you're covering is way smaller but chances are you're starting here and slowly ramping here and it takes a while before you start to feel the pain of the developer experience getting worse because you need a ton of code to get there but this is only one aspect it's only one dimension so to speak of this we are just comparing DX here to amount of code I want to compare this to something else because this is short selling like significantly short selling the benefits of a lot of these tools and Technologies let's change this from amount of code to amount of functionality in our code what I mean by this is think of like a Blog most blogs have way less functionality than an app like Twitter does or an app like T3 chat does the amount of functionality that your codebase provides its users is a very important metric to consider relative to the experience you have developing it just a heads up here's where the hot takes are going to start if this green line is the amount of functionality in the code base let's compare this for different Technologies for vanilla HTML Ajax I'd say it's something like this the amount of functionality you get working with something like um vanilla HTML and Ajax is limited effectively to Gmail Gmail was one of the first really big popular successful Ajax apps you're not familiar with Ajax it's asynchronous JavaScript and XML it was the ability for the browser to request more data and update the page without having to load a new page it was kind of the start of the web we know think about all the stuff I can do on this page without changing the URL the URL always be the same but I can rule the world from here or scrolling through Twitter it'll just be on the homepage but you can do so much from there the problem here is with vanilla HTML and Ajax actually getting the data from the server updating the HTML and giving the user the result is easy for a short quick example but the more complex the app gets the more relations there are between different elements on the page once you're at the point where there's a button on the bottom right that triggers something in the top left to update something on the center of the screen fetching from these four different places you have to create and manage all of those bindings and relationships yourself the relationship between an element of HTML some data from the server and the JavaScript that does the triggering and the updating you have to Define that relationship yourself and doing it with vanilla browser apis was hell which is why a wonderful technology named jQuery was invented jQuery was so much better I would argue that compared to like the vanilla hm Alternatives it was an exponential increase in the capabilities of what your applications could do before you started hitting these DX walls the important line to imagine here is how far can you go before you feel like using the thing before the quality starts to dip and if we look down you'll see the vanilla HTML did not get you anywhere near as far as jQuery did I know this is not real metrics but hopefully it'll communicate the actual experience I and many have had using these tools and Technologies and to be clear a big jQuery code base and a similarly sized react code base will probably provide a similarly bad developer experience if we're just comparing lines of code but we're not we're comparing the functionality that those code bases provide to their users and if we look at react this way you'll see how Monumental a win it is react lets you build significantly more complex applications with significantly less code it doesn't mean a big react codebase is Pleasant in many ways a big react codebase is even harder to work in than certain jQuery ones especially depending on which libraries you chose and how it's architected but react makes building relationships in the functionality in your application significantly easier and it does that by modeling those relationships differently they model it top down with the state and that modeling makes a ton of stuff way easier it also and this is probably the most controversial thing I'll say it makes the maintainability of larger code bases significantly better too it is inarguable that it is easier to build a complex web application with react than it was with jQuery you could make an argument against the maintainability of a larger code BAS and the maintainability of an experience with a shitload of react devs working in the same project together but the reality is a codebase with a thousand devs using jQuery where they're all changing where the state's coming from how the UI updates all that the amount of hell you're going to run into the amount of random problems you'll hit constantly is absurd because you don't know when you document or like dollar sign do get element by ID some element you don't know this element exists you can check once you've gotten it if it does or not but you're not controlling it rendering this element exists because it was in the HTML already or some other jQuery code put it there so if you're writing code that fetches data like we dollar sign. Ajax slpi userinfo do then now you have to update wherever we want this code to go we'll say we'll call this I don't know there user Pro element equals what ever we'll change this over to the code mode cool we have our Ajax call and this guy will user Pro element.in HTML equals div data data. username you get the idea this is super pseudo Cody I haven't written jQuery in so long it's going to get roasted I don't care yeah okay this was do callback not then whatever you get the idea if these things are right above each other like this and you know that this element always exists fine but as soon as any variability exists here as soon as these are in different files as soon as some element is rendered by something else as soon as this call gets fired in a different place that it might not belong as soon as this get put in a button somewhere good luck have fun especially if you have a lot of people contributing to this code base this is just as good as react for something like a counter or a basic table that shows a bunch of data but as soon as the complexity of what users expect from the app goes up as soon as the complexity of the team goes up as soon as the complexity of the expectations of this code base go up this model falls apart and the thing react aloud is for us to get way further before we hit that DX Cliff instead of two developers and a month of work putting us in Hell 10 developers in three months of work can now put us in hell but in those three months with those 10 devs you can build like times the functionality and the problems are also more solvable too because we've worked together as an ecosystem to identify as many of these problems and solve them funny enough server components are one of those things the goal with server components is specifically to reduce the complexity both for the browser and for the developers in loading data properly to our users doing good data loading patterns in a single page app is not easy especially if you're rolling it yourself you'll very quickly fall into waterfall hell where you're doing a request it renders something it does another request and it renders something not good the goal of server components is to reduce the likelihood that you get yourself into one of those scenarios thereby reducing the complexity necessary to achieve a certain level of functionality and that's another way to view this if we have a certain amount of functionality we want our users to have access to so let's put this arbitrary bar here for our app we'll call it I don't know T5 chat no idea where I up with that name let's say this axis here is code base complexity and this Arrow up here or this direction here is code base functionality if we wanted to build something like T5 chat and we wanted to do this in jQuery the amount of complexity necessary to get there is not pleasant so this is jquery's complexity for jQuery to get this level of functionality you have to build something pretty complex for react though it's less bad and this is the most important thing I want to draw the distinction of you could vaguely map codebase complexity to lines of code I'll even do that to entertain the point Prime was making the reality is if we look at a line here both jQuery and react are probably similarly miserable to maintain at this level of complexity the difference is how much functionality do you get at that level of complexity and with react you get a hell of a lot more since react allows for much more complex things to be modeled in a much similar more maintainable way something as complex as T3 chat and jQuery could be something as complex as figma in react not literally but you get the point the level of complexity you can build into your apps and the level of functionality you can build into your apps before you hit these complex walls is significantly higher and that shows in the maintainability too I've worked in a lot of big code bases that are using a lot of different tech and as hellish just a big react code base is it's not as hellish is a bigger jQuery one and the functionality you get out of that codebase is way higher this is probably where the biggest change has happened when jQuery was popular user expectations were much lower the expectation wasn't the world's fastest AI chat app the expectation was slightly slower Outlook alternative and when this is what people were expecting jQuery was a Monumental win because previously that would have taken like the same level of complexity that something like T5 chat would without jQuery react makes it comically easy though now there are teams of two or three people building Gmail Alternatives that feel just as good as Gmail because that's all it takes now if you had a codebase the size of Gmail's react with suck to work with the same way that Gmail's codebase sucks to work with but it's unfair to paint all of the progress in new tools and solutions as complexity we haven't hit yet when you don't also acknowledge the fact that the functionality we can provide at a certain certain level of complexity is so much higher and we also haven't talked about the most important Edition here which is typescript hell I would even say pre- typescript the benefits of jQuery versus react are not as big I would say react maybe here just by itself but react plus typescript and the relationships that now let you confidently change code in one place and know the other places it breaks oh God I the amount of crazy refact I've done more crazy refactors in any given month since typescript was a prominent thing in the code bases I worked in than I did in my entire life before then simply because typescript makes you much more capable of making a scary change without making sure every single element somewhere that uses this ID is rendered on the page before you try and write to it yeah yeah the level of complexity that I can own before my brain breaks has gone up the amount of functionality my apps can provide per line of code has gone up the expectations of users has gone up the quality of the tools we use to pull this all together has gone up everything is improving sure we're going from server to client to server back and forth we're looking at PHP and learning from it 20 years later if only we just stuck with it no no stop all of this we need to be able to acknowledge when certain Solutions go too far and we need to walk back a bit without saying that we were entirely wrong and that there is no benefit of these new tools we need to be able to say that a big react code base is bad in ways similar to a big jQuery code base without pretending that those two code bases did the same thing and met expectations the same way with expectations Rising with the quality of applications we use in the browser Rising with the size of the average team working on these things going up and now finally in layoff AI World starting to go down a bit you have to talk about all those things as well and as much as I agree with Prim and I absolutely agree that a large complex code base sucks regardless of the tools you're using you need to acknowledge the fact that a company the size of Netflix would not have had a good time if they had built that on jQuery instead the functionality in the users expectations are way more important than any quality of developer experience and react one for those reasons it lets us ship what our users expect at scales that were previously unimaginable without fully ruining our lives only kind of I think I made my point here chat how are you guys feeling am I insane or yeah I agree with this statement dogpaw had new tech enables reinvention of old businesses way easier every 10 years funny enough I heard this quote First from Luke from LT and he couldn't find the original stor I've been hunting for it any piece of software gets around 3x easier to build every 3 years it's a really rough estimate and I'm sure AI has accelerated this in ways we could never have imagined but I absolutely believe it me and my team were able to build a very compelling Zoom alternative with ping like a fullon zoom Doom clone effectively for creators to do good highquality HD live collaborations I had the working version of this myself in a week years before even like a year or two prior that would have been unimaginable and I did this before AI tools too these new tools allow for things to be so much easier to build that the results inherently less complexity per feature less complexity per thing the app can do and with that apps can be more complex too and that's awesome that's a really good thing the fact that it's so easy to build things that we build today that a small team can build stuff that used to take 30 Engineers that's not because react is bad and to pretend that is absolutely delusional that's because these tools are showing actual meaningful wins we need to be able to talk about the move from client to server we need to be able to talk about complex code bases sucking to work in we need be able to talk about all of these things without blindly pretending it was just as good back in the day it wasn't the tools are keeping up with user expectations and user expectations are keeping up with the wins we get from those tools as it gets easier to build great software users expect better and better software this all needs to keep moving up we're not on a pendulum we're on a spiral staircase headed towards better software and we need to be fighting together to prevent the AI slop from putting us in a buggy hellish landscape and if we can't acknowledge that tools like react are a win then the AI Bots that are using them to take over the world with crap software going to win instead you got to pick a side and as sad as it is jQuery is not not the side you want to be on right now I have a lot of other videos talking about things like jQuery and HTM X and where I think they fit in a modern landscape and Eco system I just wish people would stop pretending those tools were good enough for everything like when I'm building the sync engine for T3 chat I don't pretend that serverless works great for that I know that if I want to build that properly with live updating when things change that's going to require a dedicated server in websockets the way I prefer to build doesn't map well to that I am shortcutting around it in the ways that I can that make sense but that's a shortcoming of the way I choose to build I wish more of these antj people would acknowledge the fact that the same way I know serverless doesn't work for certain complex use cases jQuery works even worse and if you think throwing a websocket in a serverless environment is bad wait till you try using jQuery to build a Twitter clone you'll understand pain at that point also think about the functionality and the expectations of users because if we don't work together to make the tooling better for the problems that we want solved the AI will win and we'll be sitting in a corner playing with our emac configs pretending it matters and we don't want that we really don't want that Video Killed the Radio Star and AI is going to slaughter the jQuery Fanboy into teeny tiny pieces please please be responsible when we talk about these things let me know what you guys think about this I know it's a different take for me in a very different structure of video I'm curious how yall feel and until next time peace nerds ## Rethinking React - 20240108 react has changed a lot over the last 2 years not in the sense that the old react code you have won't work in the modern era but there's kind of a whole new react Paradigm that we can work with now server components fundamentally change how react works so much so that you could fairly describe it as two reacts what do I mean by that I know you guys are asking me but I'm actually asking the same question to Dan abramof who wrote an awesome article we're going to go through today two reacts by Dan first and foremost so good to see Dan writing again I've always loved the overreacted blog and I am hyped there's a new post this one's been a long time coming the two reacts suppose I want to display something on your screen whether I want to display a web page like this blog post or an interactive web app or even a native app that you might download from some app store at least two devices must be involved your device and mine it starts with some code and data on my device for example I'm editing this blog post as a file on my laptop if you see it on your screen it must have already traveled from my device to yours at some point somewhere my code and data turned into the HTML and JavaScript instructing your device to display this so how does this relate to react react is a UI programming Paradigm that lets me break break down what to display such as a blog post a signup form or even a whole app into independent pieces called components and compose them like Lego blocks I'll assume you already know and like components check out react. deev for an intro if somehow you don't and by the way quick plug for react. deev it is so cool that the react docs are in the state they're in shout out to Rachel neighbors as well as Dan and everyone else who contributed this is one of the best ways to learn not just react and in my opinion it's the highest bar of modern education materials for learning anything in the programming world I teared up the first time I read these docs and I know that sounds silly but just knowing how much better off the next generation of developers were and how many people would find success that might not have otherwise through the quality of these resources just it hit me really hard speaking of quality resources let's continue this blog post components are code and that code has to run somewhere but wait whose computer should they run on should they run on your computer or on mine let's make a case for each side first I'll argue the component should run on your computer to be clear you is the user in this case not the developer but the person who opened the application up here's a little counter button to demonstrate interactivity click it a few times everyone's favorite the counter assuming the JavaScript code for this component is already loaded the number will increase notice that it increases instantly on press there is no delay no need to wait for the server no need to download any additional data this is possible because the component's code is running on your computer which we see here everyone's favorite simple example I love that he's using Tailwind now even if it makes this half to scroll it was really cool watching Dan learn Tailwind that's a h aside anyways really nice simple component I'm sure that not only have we all written this we've also seen co-pilot try to write it for us here count is a piece of client State a bit of information in your computer's memory that updates every time you press a button I don't know how many times you're going to press that button so I can't predict and prepare all of its possible outputs on my computer the most I'll dare to prepare on my computer is the initial rendering output which is you clicked zero times and send it as HTML but from that point on your computer had to take over running the code you could argue that it's still not necessary to run run this code on your computer maybe I could have it running on my server instead when you press the button your computer could ask my server for the next rendering output isn't that how websites work before all of this client side JavaScript stuff yeah and I'm sure as he about to touch on it's not always great I was just on GitHub yesterday when I pressed the thumbs up button it took about 5 Seconds to actually see the number increase and to light up the correct State because I was waiting on the server to let the client know yeah we accepted that here you go you need to run more code on the client in order to have a good experience for a lot of these types of things and I'm excited for him to talk about it asking the server for fresh UI works well when the user expects a little delay for example when clicking a link when the user knows they're navigating to some different place in your app they'll wait however any direct manipulation such as dragging a slider switching a tab typing into a post composer clicking a like button swiping a card hovering a menu dragging a chart and so on would feel broken it didn't reliably provide at least some instant feedback if you want to see what these behaviors look like in action you might notice below this video there are a couple buttons you can click one's a thumbs up button if you click it as a test you'll see that it responds almost almost immediately to show you that like State even if the server hasn't picked up on the like yet the Subscribe button works the same way so feel free to hammer that if you haven't already we appreciate it a ton anyways this principle isn't strictly technical it's an intuition from the everyday life for example you wouldn't expect an elevator button to take you to the next floor in an instant when you're pushing a door handle you do expect it to follow your hands movement directly or it would feel stuck in fact even with an elevator button you'd expect at least some instant feedback it should yield to the pressure of your hand and then it should light up to acknowledge that you pressed it again similar to the like button below this video even if the server takes some time to receive that like and actually process it when you click it it should show you that you clicked it immediately maybe even lie about what the backend state is because it's optimistic when you build a user interface you need to be able to respond to at least some interactions with guaranteed low latency and with zero network round trips you might have seen the react mental model being described as a sort of equation UI is a function of state or UI equals F State I love this Simplicity it isn't that simple but I do love it this doesn't mean that your UI code has to literally be a single function taking State as an argument it only means that the current state determines the UI when the state changes the UI needs to be recomputed since the state lives on your computer the code to compute the UI your components must also run on your computer or so the argument goes here's where things get interesting remember we just spent all that time arguing why the code should run on the user's device now we're going to describe why it should run on the other computer the developer device the server whatever you want to call it next I'll argue the opposite the components should run on my computer we'll call this the HTM X chapter here's a preview card for a different post from this blog post preview slug equals a chain reaction here's the post has 20 2452 words cool how does a component from this page know the number of words on that page if you check the network tab you'll see no extra requests I'm not downloading that entire blog post from GitHub just to count the number of words on it I'm not embedding the contents of that blog post on this page either not calling any apis to count the words and I sure did not count all those words by myself so how does this component work this looks interesting to me we have a read file call we have a matter call if you're not familiar with matter it's used to grab headers from markdown so if you have a little section before you start writing your markdown that describes like a title a date those types of things matter lets you rip them really quick so here we grab the file content we just read the file from file system using the name that we pass as a prop we then grab the data and the content by putting it through matter which again will strip the data metadata stuff from the top as well as the markdown page content below and now we can take the content chunk split it by space filter out things that aren't valid and then get the length through that really nice simple way to get word count and now we have pretty simple section has a header has the title which it ripped from data here and it also has the word count which it got via this compute this is really cool code that you absolutely cannot run on a user's device because it needs to have access to the file system to read this file and as he specifies here this component runs on his computer when I want to read a file I read a file with fs. read file when I want to parse the markdown header I parse it with gr matter when I want to count the words I split its text and count them there is nothing extra I need to do because my code runs right where the data is this is going to be important theme I have a feeling suppose I want to list all the posts on my blog along with their word counts that's easy here's the post list component which does that even Scrolls all I needed to do was to render a post preview for every post folder which we see here we have redirect post preview and then this async post list reads all of the posts grabs all the directories and then renders all the previews nice simple readable you already written JavaScript that runs on a server or in a CLI you're familiar with all this code pretty cool you can do that in react now though right I think so none of this code needed to run on your computer and indeed it couldn't because your computer doesn't have my files let's check when this code ran that's actually a cool idea by putting the new date. two string here we get the point at which this code was run which notably this is not right now actually is it let's refresh and see I refreshed and that is the time this page was last built my guess is that if he was to push an update to his website this would update too cuz all the pages get rebuilt but this is not code that is showing my current date time because it's not running on my computer oh look he even says the same thing aha that's exactly when I last deployed my blog to my stat I web hosting my components ran during the build process so they had full access to my posts o this part isn't bold he doesn't do that often running my components close to their data source lets them read their own data and pre-process it before sending any of that information to your device hopefully this is starting to click but I have a feeling he's going to make the lesson even clearer as we go by the time you loaded this page there was no more post list no more post preview no file content no dur no fs and certainly no great matter instead there's only a div with a few sections with A's and eyes and the other tags you need to rent inside of each of them your device only received the UI it actually needs to display which in this case is the rendered post titles the link URLs and the post word counts rather than the full raw data I've talked about this in a few of my videos specifically my airplane proof website vid there's a lot of things that used to scare me if they were done in react because if you are passing a ton of big props like a bunch of svgs for background images that are part of your JavaScript code that's now a giant bundle you have to send to your user but if that only needs to be on the server you can do a lot more with react without worrying about how it affects the size of the client bundle and that's what he's touching on here you can use the data from all the blog posts without having to send all the blog posts to the user previously building something like this would have required making a separate API or data layer of some form to get the data those components need that's not the case anymore which is really cool with this mental model the UI is a function of server data or UI equals F data that data only exists on my device so that's where the components should run or so the argument goes and so the HTM X people would push but this new reality somewhere between let's see how he frames it UI is made up of components but we argued for two very different Visions one is that UI is function of state where state is client side and F runs on the client this approach allows writing instantly interactive components like counter here F may also run on the server to get the initial HTML this is the traditional SSR we're used to from old nextjs page router stuff from catp from remix from all these other Solutions point two is where things get interesting though UI equals F of data where data is server side and F runs on the server only this approach allows writing data processing components like post preview in that case f runs categorically on the server only build time counts as server I think it's a important distinction to make this is why he said my computer in your computer throughout because when people think of servers they don't necessarily think of a build step but the concept is that a computer that isn't the users is the one generating this content be it during build or on request via a server if we set aside the familiarity bias both of these approaches are compelling at what they do best unfortunately these Visions seem mutually incompatible if we want to allow instant interactivity like needed by counter we have to run the components on the client but components like post preview can't run on the client in principle because they use serveron apis like read file that's the whole point otherwise we might as well run them on the client okay what if we run all components on the server instead but on the server components like counter can only render their initial State the server doesn't know their current state and passing the state between the server and the client is too slow unless it's something tiny like the URL and it's also not always possible like the blog only runs on deploy so you can't pass stuff to it since this is generated via a build step we can't tell after it's been built hey server I want different content you can give a different URL that leads to some different pregenerated content but I couldn't click the counter and expect all of the different values to have already been built and sent to me again it seems like we have to choose between two different reacts one is the client react UI equals function of state that lets you write the counter and the other is the server which is UI is a function of data that lets you write post preview but in practice the real formula is closer to UI equals F of data comma state if you had no data or no state it would generalize to those cases but ideally I prefer my programming Paradigm to be able to handle both cases without having to pick another abstraction and I know at least a few of you would like that too the problem to solve then is how to split our F value across two very different programming environments is that even possible recall we're not talking about some actual function called f here F represents all our components is there some way we could split components between your computer and mine in a way that preserves what's great about react could we combine and Nest components from two different environments how would that work how should that work give it some thought and next time we'll compare our notes what a goddamn Cliffhanger to end on Dan I love it wow what a post I had High Hopes but this did a really good job of distilling the mindset of why the new component model is so powerful if you're ready for that second part of what it would look like for these things to interop I'll pin a video in the corner where I break down the new model and how it perfectly encapsulates the ideas that Dan was describing here letting you meaningfully switch between server and client components when it makes the most sense for what you're building this is a great post thank you so much Dan for writing it see you guys in the next one peace nerds ## Rethinking The Linter - 20240317 million lint this is a very interesting project and no it's not just another alternative to biome or ES lint or all those things it's very different from your usual lter in order to understand why million L's interesting I think you need to understand million a little bit first the goal of million is to make an alternative compiler for react kind of similar to the react compiler work going on but this is way earlier originally by a high school kid that's now a white combinator founder who's absolutely killing it it was an alternative to react Dom that could be up to 70% faster and people have been using it and getting insane performance there's a bunch of companies listed here that have actually shipped million in production and the speed you can get is pretty nuts it's a cool project but why do we care about their linter well unlike every other lter I've seen before theirs is focused on performance what the hell does performance in a lter mean let's talk about it million lint is in public beta it's launch time after 3 months and hundreds of commits we invite you to try out million lint the experience is not finished there are a few known bugs and several missing features we are really happy with how it's shaping up and couldn't wait to share it with you you can get started in one command by running this in any react app npx million latest a little guide for if it doesn't work too I also love these having these little commands that you run in a project that are like a CLI that scaffolds it for you instead of instructions of put this here put this here put this here put this here then do this then sign up here and then maybe it works just a CLI that does it all something I've actually been looking into doing for upload thing so you just run a command and it sets set up for you so what is million lint million lint is a vs code extension that keeps your re act website fast we identify slow code and provide suggestions to fix it it's like eslint but for performance now do you see what I mean by performance many developers try to use tools like react Dev tools to find unnecessary renders unfortunately most lack the knowledge to properly manage this complexity see the difference between react Dev tools and million lint yeah I'm a react Dev tools fan and I can defend a lot of it this is not easy to parse uh we we see our favorite good old styled components and a popper wrapper on top yeah that doesn't surprise me in the slightest but if we compare this to million L output you get the profile in vs code itself function node button you hover over it renders 2,154 times takes 22 milliseconds with children takes 400 and 1,500 instances are rendered copies actual feedback in your editor really interesting complicated tools mean developers give up every developer knows his experience we insert a console log everywhere catch some promising leads but nothing happens before the time Runs Out eventually the slow and buggy code never gets fixed problems pile up on a backlog and our end users get hurt by the performance issues you're sure there's no better way to surface these performance issues though you versus profilers existing instrumentation tools like Sentry data dog highlights cool 2 lots of those tools these show you the entire universe of web data that includes a lot of annoying things like a Chrome extension crashing to this day I think I've gotten more Sentry reports about honey the Chrome extension than my own code because honey the Chrome extension does all sorts of weird with your Dom and breaks the sites that I've built many many times it just throws errors in the console and those get sent to me even though I'm not the one who built honey I built the website that you're going to with honey installed yeah having this be at your codebase level makes it significantly easier to deal with this can include every function call Network request user interface core web vital screenshot memory and a dizzying amount of information to process yeah if you ever opened up Sentry on like a big project with a lot of users chaos as such these tools have interfaces that are overwhelming as for react and chrome Dev tools they are simply unusable if you don't know what you're doing and even if you do it's hard to tell which part of the component rendered or which hook or prop caused that change in the first place a flame graph doesn't give you cause and effect a flame graph just gives you stats unless you're an expert the current experience of performance debugging is hostile to most developers let be real you're probably not an expert because if you were an expert you'd already have subscribed to my channel I don't know if you know this but subscriptions are actually free so if you hit that button we'd appreciate it anyways compiler or runtime JavaScript compilers enable us to perform static analysis on source code for performance optimizations static analysis is great for Breath by writing rules developers can Surface problems across the entire code base this is why es lint is so great the trade-off is that we can't predict how slow an operation will be without actually running it making it impossible to implement million lint solely as a compiler this is a really interesting call out and I'm going to call back to something a little bit weird which is the typescript performance tools that I referenced in another video in this video I actually Benchmark typescript but since typescript the type part lives in that type layer the runtime is the typescript compiler in the type layer so you can get really good performance numbers by analyzing the types which is interesting because the compiler is actually doing performance but the only thing that your compiler can measure the performance of is the compiler itself and what this measures when you check the depth of a type and the instantiations necessary to resolve a type you're checking how many steps the types scpt compiler goes through to get the result so in this case the runtime you care about is the compiler so you can test that through the compiler and get numbers through the compiler but if we're running that code somewhere else that isn't the compiler itself the compiler can't tell how it will perform it can apply rules and checks to guess about certain performance issues but you'll never actually know what the performance looks like just through the compiler so you have to do some amount of measurement at runtime which is what they call it here another approach is thus instrumenting at runtime the advantage here is that we can directly run the app and get rendering information via the react fber so many of the complexity challenges with static analysis are solved instantly however the tradeoff with runtime is that you don't have the original source unless you use Source Maps which are very painful and slow God I I could do a long video about Source Maps which hook or prop caused this change which part of the component rendered we couldn't answer these questions without the source code itself it's a hard balance to find which is why they search for a better way so we went back to the drawing board for million lint we asked ourselves how can we have the best of both worlds we needed to create a profiling experience that didn't hog build time or runtime then support for a debugging flow that helped developers find performance problems and fast our answer is dynamic analysis using both static analysis and runtime analysis where it makes sense instead of filtering top down we follow the necessary data flow to understand each component render and build up from there this resulted in our custom instrumentation Library designed specifically for react apps import million compiler from million L the million lint experience starts with a compiler running Dynamic analysis on individual react components first the compiler interjects handlers we'll start with the raw Source your typical count set count use State use effect yada yada can't really do much with this though so the compiler sneaks in these million. capture calls that wrap everything so that it can measure at runtime what the performance actually looks like during runtime these inject handlers capture rendering timing and metadata information as you interact with your web app in Dev mode with this approach we can get runtime profiling data from running the app itself while keeping access to the source code thanks to the JavaScript compiler step itself makes sense pseudo code of the collected data so this is what the data it collects would end up looking like after capturing the renders we extend the compiler to asynchronously collect bundle Network and state manager information without build time overhead these realtime insights are then fed into the vs code extension where you can see the collected information and suggestions to fix it I think one of the most interesting insights here is this relationship between the vs code extension the compiler and the runtime where these three parts aren't necessarily tied together great in any other experience where like the react Dev tools can tell you a lot about what the react code looks like once it's in the browser and how it's behaving there but it won't bring bring that info back to vs code it doesn't know anything about your compiler as such none of the tools that exist for solving these problems really give you the the Insight on each part and the idea of running code in my browser and then getting the feedback back in my editor that's really exciting and I'm excited to play with it so here we see the render information let's play the snippet you're getting all of this feedback built into your editor of all the times it's running in the browser as well as bundle size too where you see how big the bundle impact is for each of these Imports there have been other extensions that do this and most of them are wrong since this actually relies on the compiler itself it's a lot more performant and capable an important call out I could never miss this igore is actually the creator of the theme that they used for all of these million screencasts in this here which is really cool because igore makes really cool color themes I should probably consider using his but uh I my my loyalty will always stick with the point Manders crew I love them too much but yeah aor theme is also very good I'll leave a link to that in the description if you want it these guys know what they're doing and they're deep in this stuff so lastly we made lint plus plus which fees the collected information into a language model to discover optimization opportunities so even if you don't know what you're doing million lint will show you how okay I like this a lot because if most current startups wrote this article here's what they would have written AI fixes react Dev buy it now this is what everyone does with these AI startups but AI isn't the thing they're selling here it might actually be the thing they're charging for I haven't gotten far enough yet but AI is just an implementation detail to them it's just a thing that they used to provide a good experience but the focus is on the experience they're providing not on the fact that Ai and language models happen to be a small part of the tooling because it's not even the interesting part of the tooling here and as a y combinator 2024 company in the current YC batch you would think they'd lean all into the look at how we're using AI but I'm going to see when AI up on the page it's going to be annoying cuz Aiden's name it doesn't I put a space in front nope the word AI does not appear on this page other than me inserting it here which I love so let's hear how they're actually using that language model though CU I'm curious sent Plus+ fees the collected information into a language model to discover optimization opportunities so even if you don't know what you're doing million lint shows you how they have another one of these snippet videos here consider wrapping the react markdown component in use memo hey I want to see more about that cool and use memo to prevent unnecessary renders when the props haven't changed think I would that in not useo but each their own consider using react virtuoso for virtualizing the notes list to improve performance with large lists is react virtuoso the go to now I haven't done a virtualized list in react for a bit yeah it seems like it's in a really good State I used to use the react virtual react virtualized whatever the tan stack one was but this seems to be in a better State overall still getting releases of last week cool what other examples do they have here debouncing filter input for smoother performance especially with large data sets or expensive operation ations consider debouncing the filter input use two states one for the immediate input control and another for debounced updates more good advice instead of creting a new function for on Note activated every render pass the note ID directly to the note button and let it handle the activation not as big a deal but fine use the past note ID prop to create a stable unnote activated call back within note button yeah I guess if you combine those that is a nice win this is reminding me specifically though I cannot wait for the react compiler to handle all of those things for us there are still performance wins that an external compiler can't do for you but having a tool like this that suggests better practice to you is awesome as like a a guided hey you can do this better I'm actually really excited about AI tools like this because they're not trying to replace your developers or convince you that developers aren't necessary or any of the other things AI tools are trying to replace they're trying to help you level up they're trying to help you be a better more efficient developer writing better code this fits a lot closer to co-pilot and a lot less close to like Devon or these other crazy WR and out from scratch AI tools but how good is this actually how good is lint Plus+ measuring the objective quality of lint Plus+ requires a non-trivial data set so we're working on an open source react web app optimization Benchmark for code gen models which is coming soon interesting they're making a benchmark for react web app optimization for AI tools that want to optimize stuff this also I'm assuming would be good for testing the react compiler react forget whatever you want to call it now when it eventually comes out for now we've tested lint Plus+ on a dozen in production products between our friends for a public example lint Plus+ was able to identify and suggest the correct fix to every problem in a slow educational react app our friend Ivon had built different Avon from the one I mentioned earlier this Avon he works at framer he actually is a web perf engineer at framer which makes him finding with this even cooler so here is an example app that he had built it's a performance Workshop that's meant to Showcase things that are slow to see if you can figure out how to fix them and it seems like lint Plus+ configured out so once they ran this on Avon's Notes app it labeled the following problems across six components unstable references as prop optimizations memorizing expensive components caching inline functions suggesting virtualization suggesting use context selector for use context I could do long video about this one let me know in the comments if you want to hear about all the right and wrong ways to use context especially as it changes over time CU context is about to get weird they also have the point of moving Contex providers up the tree interesting I'm curious I'll have to am I going to dig into this and look I'm curious now I search provider in this code base see all the places that they're being mounted not Saga so uh they missed the most important performance Improvement they could do light Redux Saga on fcking fire yeah I don't want to read a saga code base we're stopping here so to be clear my issue isn't Redux it's Redux Saga Redux is fine especially Redux toolkit rtk is dope Redux Saga is a disaster and no one recommends it anymore that the code base is actually dead like it's like Redux Saga was an awful generator syntax and way of architecting async so if I understood correctly is that this dark mode context is mounted to low so I'm guessing it has to rerun oh it's pron it's past the value what value is it past why is all of this at the root of app yeah okay I'm seeing the issues here that there's all of these other things that exist above the actual provider yeah duh Fair call out I know a lot of devs would have totally missed this but like you shouldn't have all of this state on top of a provider that injects things into your whole app you in this out wrap everything and then dump this so like the real quick fix here would be literally just rename app to internal app or like contents or something make app literally just this dark mode provider and its child be those contents probably worth memorizing it too and then you fix that apparently it's the mode set mode in that provider that is the issue it's not a stable value those should be stable they're coming straight from the react state do they become unstable when this has to render unnecessarily those should be stable values I see no reason why these wouldn't be stable value is a new object oh oh good catch I totally missed that okay you're making the point the thing I missed and cool you caught me con value equals use memo mode set mode mode set mode and pass this instead yeah that's a decent optimization good call it especially if this provider is re-rendering unnecessarily this is necessary to not be unstable good call I'll take the L let's hear more about million lint we invited an engineer who's never seen the code base before to try and speed up the notes out using million lint he 3xs the performance of the main page after around 15 minutes of work that's pretty cool having an engineer that had a never seen the code base before just spend 15 minutes and make it three times faster oh God yeah you can you can see the Chug there you ever seen the classic react keyboard lag when your input states are poorly synced with renders oh God it's awful of course notes is a small app and million lint wouldn't always find the best fix for every problem working hard to improve its quality try and please let us know about your experience important question I'm pumped to see the addressing this head-on in the next few weeks we'll open source the million link compiler and the vs code extension both the compiler and the in editor annotations are free to use forever our focus is to build a great developer tool and we believe that the best way to build a great developer tool is to build it in the open to earn a living we'll be charging for the lint Plus+ service at $20 per month for 100 lints for more frequent users we are still working on the details but the idea is to charge based on the number of lints you translate to code you believe this aligns our incentives with yours you only make money when we make your app faster I love this and call out for those who haven't made a startup before pricing sucks specifically like usage based pricing is really really hard to figure out both like the economics in a way that doesn't like bankrupt you but also Marketing in a way that people see the number and don't freak out because I know that $20 per 100 lint might sound terrible but when you think about this in terms of 100 changes to your code base gets a lot less terrible 20 bucks for 100 changes that make your code better is actually a pretty good deal and I know twitch would spend thousands of dollars for example if they could make the code faster for every single dollar spent just to think about so the road to million lint 1.0 we are still in the very early days of experimentation million lint focuses on solving unnecessary rerenders right now we understand this is not a problem for long yeah uh this is a link to I'm assuming the react compiler yep they know what's going on they're not going to let themselves fall behind million lint focuses on solving unnecessary renders right now and we will move to handling slowdowns arising from the react ecosystem State managers animations bundle sizes waterfalls Etc our eventual goal is to create a tool chain which keeps your whole web infrastructure fast automatically front end to backend one change I'd recommend making if you guys are hard coding anything here it's a a really simple change uh I'll pseudo code it quick if package.json do includes Redux Saga throw new error come on man it's 2024 yeah this will help a lot especially in the example that we just went through yeah anyways we'd like to invite you on this journey with us to make the best possible web performance developer tool million lint is our very first step try it out and let us know what pieces are missing how can I help like me or the viewer either or we're looking for talented front end and plml Engineers to join us in the Bay Area o Aiden are you fully moved to the Bay is this the Dropout announcement are you actually dropping out of school for this now you full-time here living in my city you're in the bay then why the aren't you guys hanging out with me how has Aiden been in this batch now for 3 months and you haven't been to my place once yeah we'll talk later anyways especially I'm investing in you at million we have a simple thesis for software performance we can build tools that make anyone a performance expert developers should think only of shipping features and fixing bugs not keeping their code fast we plan to start with react then extend to the broader front end backend and other platforms you feel like you missed the beginning of million. JS get in on this the fun of the beginning is how much you get to shape everything yeah it this is the real benefit of getting into something early isn't the competitive Advantage you get it isn't that you can get a job really easy is that you have to help shape the direction of that thing and you can actually help shape this because they're still very very early anyways Aiden my bad I'll visit you damn right both of you guys we'll figure it out next week if you're not in utter hell with the investor convo stuff the million team congrats to all of y'all on getting through y combinator not through just yet but getting to the end of Y combinator which is both the most stressful part and also the most fun in many ways this has been a wild ride I will admit I was more skeptical of this before going in but uh the more I read the more you sold me I see a future not only where I would use this but I could actually see myself paying for it because it caught a mistake I would have missed and that's pretty cool we love to know what you guys think I know another lter might not seem super exciting but this isn't competition with the other lter this is something fundamentally new and that's why I'm hyped about it so let me know what you think in the comments cuz I'm excited for this future until next time peace nerds ## Rethinking the Technical Interview - 20230515 Tech interviews aren't great I've learned anything from my time in the hundreds of interviews I've done both as an engineer looking for a job and as a technical manager running a team and making hiring decisions I found that almost every company is doing interviews pretty egregiously incorrect it's so important to have a goal going into an interview if that goal isn't setting up the engineer for a success to figure out just how successful they can be at your company then you're probably failing as an interviewer the goal of this video isn't to shame a bunch of people for doing interviews wrong and it's not to tell you as an interviewee to only interview at companies that do things right it's to generally talk about what the current state of things is and propose a new model for interviews I hope this video was useful if you're an engineering manager as well as a new grad looking for your first job even if you're just exploring the idea of programming as a job I hope we can find something valuable in this video to start we should talk about what most technical interviews look like today the harsh reality is until you hit principal level interviews you're usually going to show up in a call or an office have some engineer that's been there for one two seven plus years pull up a random technical question from a book of questions they've already wrote at the company all random code questions that are usually very algorithm-y and the code heavy half or more of them boil down to do you know what algorithm this problem is based on and can you apply it correctly in the language of choice and that doesn't teach you a whole lot about the people the reason this method of interviewing has lasted so long isn't necessarily that it's a good way to identify Engineers who are of quality it's more that anyone willing to learn that leak code grindy crap is willing to sit there and grind through things that make no sense and for most companies most things don't make a lot of sense so it's a perfect alignment with how a company like Google has a bunch of services from 20 years ago that someone has to maintain and no one wants to doesn't that sounded a little bit like Lee code the relationship there is no mistake the vast majority of companies are doing leak code because it's the easy default that's existed forever that's also why they're running too many servers and making Tech that's too hard to work in and maintain and I often find that the interview culture says a lot about the type of company you'll be working at if you get that job so what do I propose instead the big thing that I really want to push for is giving more agency to the interviewee during the interview I firmly believe it's my role as a leader and manager in the companies I work at to set up my teams and set up my Engineers to be as successful as possible and if the interview process is not built around that goal then I don't think those Engineers are going to be as comfortable as they could be and more importantly as they should be when they work for you so the first thing I set out to change with my interview process is the level of comfort trust and more importantly agency that I give the people I am interviewing so how do I do that I usually will send out a document to the candidate a few weeks before the interview if possible that details multiple different options on how this interview can go as well as going in depth on the shape of the interview and what they can expect I don't want anyone to show up feeling like they're being caught off guard by a like a curveball or something that wasn't expected obviously that's part of the job some amount the types of bugs you're going to find on the job are probably going to be similar to the types of bugs you'll find in a good interview question that is Technical and thoughtful enough so what does this document look like I actually publicly shared the one that I sent to Dan abramov when I did an interview with him all the way back in 2021 because Dan wanted to show people what it looked like for a more senior person that might not practice lead code a lot to do a technical interview and he did a few of these he did a fake interview with benawad and a handful of her creators and I like to think mine was the one that highlighted the strengths of Dan the best the goal of my interview wasn't to challenge him with a really strong hard leak code problem it was specifically to throw him in the ringer for what it would look like to code every day inside of the stack inside of the types of things we work on and obviously Dan being the creator of react he's pretty good at it he ran into some problems but he did a great job overall and when you compare his performance in my interview to the other ones it's kind of sad to see that the only one of those interviews he would have passed in the traditional sense was mine and I like to think Dan abramov would be a good hire for a lot of companies so what did this interview look like what did I send him ahead before my interview with Dan I signed in this document and honestly since Dan is such a strong open source contributor I probably wouldn't have done a technical interview at all if this was real life because Dan's goal here was to show what it looks like to interview someone who's on the core team of react and is the creator of Redux we decided to do a more technical interview but you don't have to do technical interviews if you know the person's technical like this is a not an essential step in the process if you have other ways to validate their abilities let's break down what these options look like the link to this is in the Dan abramov interview if you want to take a look at that the Link's there so the options I give are based around the different styles of interview I have found to be good ways for technical people to Showcase their skills the first one is the traditionalist which is the everyday Elite code problems that you get a lot I don't mind this being an option because it can showcase somebody is Technical and capable and if this is what they've been training for and this is the interviews they've been doing a bunch of I genuinely don't mind giving them what they're comfortable with because again the goal of the interview is to set the interviewee up for Success if this is what you're comfortable with then this is what you should do in the interview I have no problem with that at all it's a great way to Showcase your skills it's just not the way that is best aligned with what we build at most of the companies that I've worked at which is why I offer other options including option two the pragmatist which is a realistic code problem rather than some weird algorithm you have to solve I'm going to give you a more literal straightforward here's the thing you're building let's do it step by step the example I have here is the Pokedex problem which I gave for a lot of interviews but I've probably interviewed with this problem over 100 times which is why it sucks I put it in here because now I can't use it anymore the goal of the Pokedex problem is to see how well somebody understands the Core Concepts of react and building applications so I start with a JavaScript blob just a JavaScript object with some info about a Pokemon I tell you to create a reusable component that takes this as props and renders it with the this information and then I give you an array and I ask you to put them all on a table and then I provide you a selection component this is where it gets interesting so you can start integrating different things and understand State Management in the relationship between components better this exists it has this type for its props how do you use this to actually filter the table and I think this problem is really strong because it lets me as the interviewer gauge your understanding of react Core Concepts piece by piece by expanding on them throughout but this is also great as an interviewee because it's the kind of work you would be doing every day anyways and you don't have to practice for this type of interview the same way you would for a fleet code you can just go build things and you're practicing this every day already but if you want to do that you want to do something that's literally the work you're already doing every day I made an option for that too the realist I love this option the goal of this one is to let you show off how you like to work already hit us up ahead of time let us know there's a project you want to work on and a bug you want to fix a feature you want to add anything at all ideally let us see the repo ahead so we know what we're getting into and we'll do a pair session just sit down for an hour and a half two hours and you can show me how you work and solve the problem with me as a pairing exercise since this is a huge part of what we'll be doing anyways there are a few better ways to understand how capable Technical and most importantly how somebody is to work with is one of the best options to understand how an engineer works and it's amazing to me how few places offer something like it I love this option I've been surprised a few people take it but generally the goal here is to set people up for Success the way that they are used to and that's why I have this final option here the specialist if you have a better way to Showcase your skills that doesn't fit into these options tell me about it I would love to try new interview techniques and styles it's genuinely fun for me and if you think there's a better way to Showcase your skills than what I've listed here show me tell me about it let me see it I am so down and if it doesn't work it doesn't work we can do another interview one of the other styles that's fine too it's not a big deal to waste an hour and a half of my time if the thing on the other end is an incredible hire but the the decision to Force One method so you spend as little time as possible in those interviews is just not great I really don't like it I also didn't put any take home type stuff here because I am still not sure how I feel about take-homes I personally actually like doing them when I'm interviewing but when I'm the interviewer I feel bad knowing that certain types of employees in certain positions won't be able to justify spending that level of free time working on a thing without being paid it also just kind of feels wrong to not pay someone for work that theoretically could be used but yeah take homes I'm not sure about yet but again if someone here said hey I'd prefer a take home we would make one up for you it's not that hard to make of a problem and again whatever makes you the most confident in how you can showcase your technical abilities is what we want to do I have some notes at the bottom here the what do I do now this is the again like I wrote this as though I'm doing a real interview because I want you to see the documents that get sent to our actual Inc recruits and potential new hires when we send these things out and I'm really proud of this document I hope it's helpful for those of you who are both looking for places to work as well as those who are doing interviews in the first place I do have one more important tip I want to bring up here though and I wish I started doing this earlier and I've seen an insane amount of growth from those who have picked this tip up too do more interviews and do them on each side if you were qualified enough to get a job you're also qualified enough to interview for that job you might not be as good of an interviewer as other people on the team but you still bring a lot of value to the hiring process please if you're able talk to your manager no matter how new you are to the role and try to get on track to start doing interviews as soon as you can because there's no better way to understand where you fit on the team where new people could fit on the team how interviews go good or bad most importantly when you're on the team if the people you're looking at are going to be a good fit or not being involved in the interview process is one of the best things you can do to better understand your role your team your impact and most importantly how valuable you are and the more interviews you've done as the interview Giver the better your performance will be as an interviewee and when you start to go interview at other companies to get a promotion a new role whatever you'll be better at interviews if you've given more interviews I thought that would be obvious but I'm amazed at how many people don't realize that and don't take advantage of the incredible free resource most companies give in letting you do interviews so do them and do as many as you can like it helps so much I even got in a little bit of heat at a point in my career because I was doing six interviews a week sometimes because I thought it was so important to be involved in that process and also smooth it out for the ones that were rougher I quickly became the person recruiting would pull in when interviews were going poorly to be like the lunch buddy to help cheer someone up and get a good feel for if this interview process is failing them or not and I I was able to save a few people that would have fallen through the cracks with that and also confidently figure out if some people just weren't quite ready yet in terms of where they were at in their career and their abilities which is also totally fine a good interview shouldn't be scared to give the candidate feedback on how to improve for future interviews you're not giving them cheat codes by telling them what they did wrong you're giving them a growth opportunity and giving them some value back for the time they spent interviewing please for the love of God if you reject someone in the interview process tell them why there's no reason to not let them know I think that's all I have here sorry for the weird rant and how long it has been since I talked about interviews but I'll be honest I haven't done a whole lot of them recently just due to the nature of the market and where we're at at ping that doesn't mean I don't think about them a lot though and that I'm not super concerned about the types of interviews I'm seeing and the experiences many Engineers I've referred have if you do good interviews that word will spread people like me will hear about it and we will be more excited to recommend Engineers to work for you your best engineer is only as good as your interview process and if you have a process that makes good Engineers not feel respected and they drop out your team is now limited by that process so seriously if you care at all about the quality of engineering at your company step up and think through your interview process if thesis were helpful let me know if you want to check out the video of me using this to interview Dan I'll pin that right there early apologies for the audio quality video quality and everything else I that was my second ever YouTube video I had no idea what I was doing but made a lot of progress since thank you guys as always peace notes ## Reviewing Hot Takes From Legendary Web Devs - 20230817 y'all know me you know I love Hot Cakes which is why I asked webdev Twitter to give me their spiciest takes about the state of web dev I thought this tweet would do okay but I did not expect it to be seen over 4 million times and to get almost a thousand hot takes as replies to it let's go through those hot takes and take a look at some of my favorites my least favorites and generally what's going on in the web deaf world this is my tweet but we're not here for my tweet we're here for the things people replied so we're gonna go through the biggest but that does not necessarily mean these are the best ones this is one of the first ones that I really had to think about if you don't know dkp already he's the creator of act state which is one of the most thorough State Management libraries in react it works with other Frameworks too and it's really focused on like diagramming things out so you have a proper flow chart for your state machines as such he cares a lot about State especially Global State and how it relates to your application which is why his take here makes sense UI components are the wrong place to put your app logic most of the time sure it's easy and convenient at first but in the long run baking logic into UI makes it really difficult to understand what's going on in your app much less maintain it I largely agree with this tweet but I think it's missing one of the important nuances which is most of the time especially if your application gets really big you don't need to know how everything works I don't know how every piece of even ping works and I built a lot of those complex pieces well I need to I can figure it out ensure that takes a little bit more time than it would if everything was done with a good Global State manager like x-state however the amount of work it takes to implement any given new feature as well as maintain a small piece that I might already understand is much higher when everything is within the global state so in the context of knowing how your whole application works absolutely David's correct here but in the context of what makes me more effective as a developer contributing to a growing code base to solve the problems that my users have this isn't necessarily true it depends a lot more overall good take but it's important to think a lot about when Global does and doesn't make sense for you your application your team and your users I think I said largely this year the clarity and compartmentalization of component level logic is hard to beat if you use it responsibly it's really nice obviously things that should be global should be Global like if you have 15 of those like context providers wrapping your app we need to rethink some things but it's not that common in a use case I think there's an opportunity here this one's fun Tailwind wouldn't be nearly as popular if react made it easy to author style Scopes to your component I understand where this is coming from the problem is if you're building an application with react and you want to have some styles that are specific to your component that are only there when your component's imported that aren't there when your component isn't imported can get a little messy I see people mentioning CSS modules in the chat yeah that helps sum them out but when you look at something like Astro review where the style is part of the component architecture that is fundamentally different that said I still use Tailwind when I use those Technologies I couldn't imagine using even Astro without Tailwind not because it doesn't have ways to solve those problems myself but because Tailwind isn't just a way to style within a component it's a way to write Styles more effectively it makes me enjoy CSS in a way I never have before it's so much much quicker to make a change and not have to worry about the relationship that change has in your entire system and I know we get the inline Styles joke a lot where like Tailwind is just op versions of inline Styles and I like that I think inline Styles get more [ __ ] than they deserve and the benefit of something like Tailwind is how much easier and more efficient it makes it to write high quality style system for your components that just happens to live within the components HTML it's effectively the pieces for a design system built through utility classes and I like that a lot I think Tailwind caught on better because react needed a solution to this problem which is why we saw so many different solutions come up in the react ecosystem from Stitches to styled components to all the weird libraries like material UI we needed a better way to compartmentalize and component ties our Styles in react and Tailwind has won because it's the best solution for componentizing your Styles however Tailwind still was the best solution without react and I still think Talon would have found a decent bit of success otherwise although yes I agree react absolutely catapulted the success of talent and someone else has made a good point of even if you currently consider Talent unreadable the fact that it's the same between projects is a really underrated benefit which it absolutely is not having to relearn our style system or like make a library that's shared across things we just copy and paste our tail and config and everything works the exact same way it's really nice it's kind of like a prettier moment in that way where this thing that used to take a lot of your brain suddenly doesn't and I like that a lot here's a good one from Devon if you don't already know Devin he works at Adobe he works on react Aria which is a library for doing good accessibility for your components it's one of those like headless component libraries kind of like Radix and his point here is very good despite a huge portion of web traffic being mobile and tablet and a lot of laptops even having touch screens we're not thinking about the touch experience when we build stuff a simple example of this is how often we use hover behaviors there's no such thing as hover on a mobile device you can't hover with touch I mean yeah you can put your finger like slightly over the screen but doesn't do anything most devices don't have a way to detect that as an input and a lot of us love to have things like if I type you see this gets darker when I hover over it and this has the tool tip of what it is when I hover over it none of those behaviors work on mobile and that's a really important thing to understand when you're building your applications especially web applications that mobile and tablet users will use is that a lot of the behaviors that you work on aren't going to work if they're expecting a mouse so being more considerate of this as you build is very important he also links a Blog here about building good buttons with accessible behaviors and one literally just dedicated to hover interactions so if you want to learn more about this definitely check out the Tweet but man we need to be better to touch users as they begin to take up a higher and higher percentage of our traffic otherwise they're going to despise web and web devs because we're not providing good enough experience for them so I really liked this take and something I needed myself do more of I love this dkp came back for another spicy take because he didn't think his original one was spicy enough and by the Numbers here looks like he was right an enormous amount of capital talent and effort is being spent on making web dev apps just a little faster performance is important but we're pretty far into the diminishing returns curve at this point I totally agree I feel like the conversations we're having of a performance on Twitter are less about when you have a big application how do we make sure it continues to run well rather they feel like they're more about how few kilobytes can we ship in our hello world and that doesn't benefit anybody obviously when something like wasm has a multi-megabyte hello world that's a problem we need to solve but when we go to a more sane place like react or the other new libraries forming around it the difference between an 80 kilobyte JavaScript bundle and a 20 kilobyte JavaScript bundle isn't that significant because any application is going to be writing more than 100 kilobytes JavaScript of its own so if you're bickering over those small differences you've kind of missed the plot I think we wasted too much time talking about performance in fact I even have a video planned about why we need to end the performance Wars for this particular reason while yes we don't see devices getting better every year the way we used to we also don't see code getting slower at the same rate either I think we have a good opportunity now take a step back and appreciate where we are without continuing to re the performance Wars here's a fun one from parasocial next JS is not that great yes and no I'd say that next was incredible when it dropped simply for pushing the idea that web devs need to care more about servers so many react devs had gone so deep into single page app land that if they didn't have a graphql API they didn't use the thing when front and Dev stopped thinking about back end front end Dev started doing really stupid things with back end and one of the things next did that hadn't been done before it was really challenge front end devs to think a lot about their back end in the relationship it had with their front end I wouldn't have gone back to back end as hard as I did if it wasn't for an xjs and I owe it a ton for that on top of that app router is one of the best developer experiences I've ever had having that deep close relationship between the back end and the front end has made it so much more fun to build and create incredible things and I don't think we would have built either marker thing or upload thing anywhere near as quickly as if it wasn't for the benefits that nexjs offered through through the app router and server components that all said next is just a framework around react which is just a library and it's not the only solution and I think that I'm even guilty of the sum amount treating next like the only realistic solution is downplaying how much good work is being done in other places so in the sense that there are other solutions that are comparably great in terms of their feature set and developer experience I can agree there are other tools that are in a really good place and if we treat next like the only one that's a problem however next is very unique in that it has this quality of experience while also being very well adopted and supported by many many companies and many many developers let's say theoretically svelt kit was perfect and it was a 10 out of 10 framework and next.js was an 8 out of 10 framework while that does means felt kit is greater than next next is still I would argue a better bet simply because of how much better adopted it is and that's what's cool is by next.js supporting these things it allows for more developers to have a good enough almost great if not great experience and he said not that great so we'll say it is great there are parts that are great and bringing those to most developers is incredible and with tools like spell kit Like Remix and other Frameworks finding what greatness looks like in modern times it's awesome we have Frameworks like next to bring that to the everyday Dev and then we have Frameworks like angular to 10 years later bring that to the IBM devs it's really cool that we have this cycle of influence and creativity trickling its way through the ecosystem so that everybody has a better experience so in that sense I agree there are greater things but next is still so important for the ecosystem I like this one a lot Jack Harrington dropped two takes that I fully agree with I wouldn't say you should never ever roll your own off but you should be very cautious when you do it and display grid is absolutely overrated I've had very few problems that grid actually made easier it's taken a lot of things and made them harder than they should be I'd have never actually had grid code I wrote work is expected the first try that's not because grid is bad it's because grid is a little bit obtuse and requires more effort to get just right it's very specific API I'm going to hold the auth thing for a little bit because we have more off takes coming up soon oh Dax he couldn't help himself this one went way too viral and he had an alternative to it that I'm gonna have to scroll for the reason the JS ecosystem is janky has nothing to do with tech it's a lack of talent JS historically attracted mediocre Engineers good Engineers are finally showing up to the JS world and fix it but previous generations of leadership couldn't even get a package manager right this is the part I disagree with that I replied pre-npm there were no package managers for programming languages that had a better experience than npm did period on top of that nougat sucks Pac-Man is not a developer thing it's for managing things in like arches ecosystem and Nyx is a mess it's a beautiful mess it does a lot of cool things but none of these were great tools for developers building applications and none of them provided a good experience for building an open source application with dependencies when Pete hunt and I fully agree you know you're [ __ ] up a bit and I full fully agree with this it's npm changed everything and it's important to understand that just because other things are better now does not mean npm wasn't revolutionary at the time and they're still continuing to improve it meaningfully obviously there are now package Management Solutions like crate i o and whatever that are in a really good state in other ecosystems but it took npm to get us there and we've learned a ton from what npm has tried tested learned and failed from as for the rest I have an alternative framing of this which is rather than JS attracted mediocre Engineers JS and the tools around it lowered the bar for how good an engineer you had to be to ship something that worked to users and in doing that we have enabled a much larger number of developers to make applications that work and if you want there to be fewer applications if you want there to be fewer experiences that users can benefit from in the world one of the best things you can do is kill JavaScript just destroy it make it go away but if you want there to be more applications that serve users needs better they might load slower they might have weird dependency issues they might be harder to work in after years of work working on them the fact that we can make them in the first place and the fact that so many developers can build incredible things regardless of how much experience they have it's actually one of the strengths of JavaScript it's also one of the things that I think react gets a lot of [ __ ] for because so many developers can and will continue building things in react that the average developer who picks rust likes rust and is an Enthusiast that's really into programming languages and is probably better than your average engineer the average developer working in JavaScript probably below average simply because there are so many JavaScript devs the majority didn't even pick the language they're just there working on it at their job and as such the average quality of Dev is going to be lower because the reason that they're using it is fundamentally different and the number of users is exponentially larger so while sure the massive number of Engineers that aren't as experienced being part of the JavaScript ecosystem means that some tools are created that are lackluster it also means infinitely more things are being built and I think it's important to not downplay that part this one got nowhere near as many likes because people love when you [ __ ] on JavaScript but they don't like when you point out out the truth as Zach said here I wouldn't trust the majority of people who repeat the cliche JS sucks with any language there's nothing about it that's critically broken it's missing things that are table Stakes but they're fixing it it has a bunch of stuff you can't get elsewhere absolutely agree is the reason JavaScript will continue winning and is not because it's taken over the world because it's bad it's because there's a lot of things only JavaScript does in JavaScript isn't the best language but it's more than a good enough language and what we've created with it as a ecosystem is truly special and while it's fun to [ __ ] on it's also incredible what we've done with it and we should acknowledge that it will be here for a very very very long time now I got a fun one from rocks 99 of software is Trivial building most things is not hard getting people to care and pay for what you make is hard I think there is difficulty in weird places for a lot of things and up until recently making something that scales was really hard but building overall has gotten significantly easier and the future I see isn't one where there's a small number of hundred thousand person companies is a large number of five to ten person companies that are building the perfect solution for their user base which is smaller than Amazon's but it's big enough to pay those people's salaries I think as building things gets easier the people who are building get better at promoting and showing the thing they built as well as users become more familiar with the pattern of using a large number of small Team Tools rather than a small number of big Team Tools we're going to see more and more Market shift around this but overall yeah building things isn't as hard as a lot seem to think one point I think about a lot when I brought up that I wrote a mobile app at Twitch in a few days to try and show what it would look like for us to use react native I got a surprising number of replies that were along the lines of do you still have the code you should sell it to Kik that code must be so good and useful still I wrote it in three days I can write better code now it was four years ago the code is not why that was valuable it was what it demonstrated to the company which is in this short a window we can make something incredible code is cheap most code Canon should be thrown away at some point it's the experience users have and if we can do things to make that experience better we need to be willing to throw away the thing we had before because building things is not the hard part understand ending users and what they need us and if your tools are making it harder for you to do that do that effectively your tools are bad very much agree with this one most web apps should not use an auth service yes and no I understand this is a direct contrast to what Harrington said earlier of never roll your own off there's a spectrum here for sure where on like one side you have a self-rolled authentication library with your own email server and everything on the other side you have an off service and then in the middle you have open source libraries those libraries aren't doing a great job of keeping up I don't want to call out next off because I know ballast and the crew are working incredibly hard on it but ballast also works at Purcell it is working incredibly hard on next.js itself next auth still doesn't support app router well it doesn't they're working on it it will get there but right now to have the best experience using the new tools Clark is pretty much the only option I'm hyped on what's happening with Lucia auth I'm hyped on seeing the open source ecosystem take these challenges more seriously but I have lost so much time and energy to fixing weird off-edge cases that I am thankful to not be thinking about it anymore there are so many one-off things that I didn't realize I was doing wrong until suddenly I had a service doing them right and there is so much stress that I have had building good application authentication practice without using a service one silly example we put off building a mobile app for so long because the authentication Solutions we were using around next off did not even have a viable path for mobile getting something working decently that let you share an oauth account between our web app and our mobile app was so impossible that we just never ship the mobile app with something like clerk it's exponentially easier to do that and there are so many of those types of problems where whole platforms are harder to support than they should be because the authentication solution you built doesn't have a path there and while yes I could go work really hard on building a good mobile auth solution for us and for our use case I'd be spending days if not weeks working on that when we could just be shipping to our users and that's why I I now very much off service build funny enough I used to get in fights with the CEO of Clark about why it seemed so silly to me to build yet another off company when they're open source libraries that do it just fine it kind of Snickers like yeah sure we'll see and slowly I came around and here I am now huge clerk shell not because they paid me to but quite the opposite because I asked them to pay me I flip hard on this no offense to Kent I just don't see this take from anybody who's building real software right now like if you're building big scalable applications that need to support more than one platform you're probably going to run a third party service at this point there are so many things to consider when you make these decisions it's hard to justify not using an auth service right now I would struggle starting a new application without one simply because of how uneasy I would be as soon as I run into a problem that isn't supported if we had better libraries and they were further along this would be a different conversation but it turns out it takes a lot of Engineers a lot of effort to make a good authentication solution with jwt's handled with Edge runtime times handle with mobile handles all these things that's not something you can do rolling yourself unless it's your job full time with three other engineers and having a company that does that well and charges me like 50 bucks a month for it that's pretty good off is hard if you think auth is easy then your off is bad this is actually a really interesting one because I think it skirts around the conversation I see a lot which is don't use a framework when you get started use HTML CSS and JavaScript you got to learn the basics my problem with the learn the basics argument is you don't know when you're done learning them I could literally spend the next year just obsessively studying CSS and everything about it and still not have learned all of CSS there is so much to any of those three parts at the beginning with HTML CSS and JavaScript and I don't like that we recommend people spend a ton of time in that without giving them clear boundaries for when that needs to change when have you learned enough with HTML to move on to the next step really hard to know when you've hit that threshold as a new developer and that's why I usually recommend not starting by learning a specific thing so you don't when you're done learning rather start by building a specific thing because then you know if it's working or not if you're not a developer yet your intuition of enough isn't good but you are a user we all use things on the web we all use applications if you have a usable application as the bar you've set it becomes much easier to know if your thing is good enough or not and as you're learning to create things as a software Dev making sure you know exactly enough JavaScript is stressful making sure you know how to build an application is fun and that's why I do like recommendations like learning spelled or react early because they help you build an application that you can understand faster and yes it doesn't make you as deep in the fundamentals of JavaScript HTML and CSS but you can learn those fundamentals when you need to and ideally you're not worrying about those things until you have a good footing in software Dev once you're confident you can build a thing the things you're less confident in you can go address and I do actually think svelt's a good option here because felt kind of shows you the HTML CSS and JS yes they're all in a file with a weird syntax and has its own rules and [ __ ] but I do actually think spelled is a powerful learning tool and this way and I would absolutely not be opposed to somebody starting with svelt is one of the places they go to to build their first applications and if they have a friend who's really in this felt that can help them throughout it's absolutely a good call I still lean react even though it's probably a harder learning curve and won't teach you as much of the fundamentals simply because it's what the industry uses and there's so many good resources that you can build something incredible quickly but I absolutely agree with the sentiment here I think spelled really good recommendation for beginners and I am tired of the you have to learn the basics before you start learning Frameworks take because it misses what makes development great which is building things for users also just before I first mention Lee agreed with this take which says a lot as the next guy the Dom should be replaced with webgl no flutter is a mistake and this would be a mistake too this is I'm having this one came up because I I was talking about this a bit earlier and I really don't agree the take is that 90 of the web development industry could disappear in the average quality of life would go up not down I I do not agree at all at all the benefit of the web development industry's growth is not that big companies are making things that are significantly more complex although that has happened and we love to point at that and complain that all these things are using react when they could just be HTML the benefit of the way the web dev ecosystem has grown is that it allows for smaller teams to build bigger things yes a five-person team building a Twitter clone is going to be a bit more Jank than a 100 person team that's been building it over five years but the fact that a five-person team can build a solution to the problem that they perceive and that their users have means that we can build better solutions for people much more effectively and I think the same way we moved from 15 famous people to 15 minutes of fame to famous to 15 people we're moving from 15 companies to companies being famous for 15 minutes or a few years to companies that have 15 to 500 users because we can build more specialized quality solutions for people because it's easier to build them and yes the industry has gotten much bigger as a result but the quality of life I have is much better because there are specialized tools like what I talked about earlier so I built it I needed a way to chop my streams faster and I built marker thing on top of the Twitch API and Clerk and the new Next app router stuff to make it trivial for me to go to a stream rip the timestamps from it export these as a CSV you can't see the button because of how my screen layout is but I have a download CSV button right here and once you download CSV I can drop it into another open source app called bossless cut and lossless Cut Is An Open Source electron based video editor this whole thing is written in JavaScript and it makes ffmpeg calls and I'm able to use the CSV for my web app a giant like 200 gig video file and a bunch of JavaScript on both sides and do something I couldn't do before if it wasn't for these tools I would not be able to make the amount of videos I make and my team wouldn't be as efficient as they are we would be worse off if 90 of the industry disappeared because these types of quality specialized Solutions go from the norm to non-existing and while you think 90 of the industry means 75 of the meta team working on react what it actually means is people building these specialized solutions that allow for people with Niche problems to live Better Lives so no you're wrong the average person has some amount of Niche interest and all of those Niche interests are exponentially better served by the current state of the web dev industry it is incredible where we've come and I would never ever go back to the way things were knowing how many more quality applications I have that solve my specific problems I think this is a good ending point I appreciate each and every one of you for dropping your spicy takes I hope that you enjoyed us going over them if you want to learn more about how much webdev has improved or I guess gotten worse over the last few years we'll pin a video here all about that thank you guys as always appreciate you a ton he starts ## Rolldown is here, can it save Vite_ - 20241230 2024 was a crazy year for the bundler wars from RS pack to farm to bun things just kind of got wild but instead of slowing down as we approach 2025 it looks like we're going to be going even faster like as fast as rust because roll down 1.0 is finally in beta and this is very exciting especially for yall vit users because roll down is going to fundamentally change how vit works and with that we should get some really big performance wins you know what else I hope performs well this spor today's sponsor is single store and if you're dealing with an old database or are tired of trying to figure out Vector stuff this one's for you when they say they're the only database you'll ever need they actually mean it on a single query you can do everything from crazy Vector lookups to keyword matches to sums and Dot products all the crazy stuff you have to do for analytics in the same query and it's super super fast it's so fast that if you use them as a drop in replacement for yes you can just drop it in an existing project it is a 100 times faster no changes needed in your code you just switch the connection string to single store and it works their free tier is free for life and you can selfhosted in Docker it's fully compatible with the MySQL wire protocol so anything that works with mySQL will work with single store same with anything using which is kind of nuts crazy to have all of that support all of that functionality in a single highquality database like what they built here thank you single store for sponsoring check them out today at. l/ single store so roll down is possibly the new bundler I've been the most excited about out both because it has the most obvious path for adoption but also it's taking one of the biggest bets there's a couple bundler projects going on right now and we should probably talk about them all in order to understand what makes roll down so interesting for a long time there was one bundler webpack you've been around for almost any amount of time you're probably relatively familiar my original webd Journey kind of started with webpack it was my first real deep dive into modern web it was trying to upgrade some projects to the latest version of webpack I think it was the 1 to three upgrade which was I learned a lot let's just say that much there are things before then the good old browsery days browserify right yeah browserify is like the OG OG but webpack was the one that like really took over there have been other notable efforts though the big ones I would say are parcel and rollup parcel is largely by Devon govette he works at Adobe and the goal was almost like it fit alongside like yarn if that makes sense where it looked at things webpack was doing and it was like I see you bro but there are some opportunities here to make things suck a lot less and that's the direction parcel is trying to do is almost like a webp pack but finer tuned type thing rollup however was created by someone y'all might be familiar with if you're here a lot Rich Harris the creator of spelt and rollup was a fundamental rethinking of what a bundler should be with the goal of being way simpler and way less config I still remember the the first time I like dove into rollup and was trying to configure all of my like bundled chunks and outputs and then I realized rollup if I gave it no config actually did a better job bundling because it's semantics around all that is it's it's a great bundler rollup is awesome personally of these rollup is the thing I liked the most but webpack is the thing that was the best supported so it's what most of us ended up on especially us react devs especially us nextjs devs but this was you know what I'm going to break this up we'll have gen zero which was browserify and gen one web pack and eventually parcel en rollup I'm counting these all is the same generation people might be mad at me whatever because we're here today to talk about Gen 2 Gen 2 was kicked off by a really cool project named es build es build was created by Evan Wallace who was the CTO of figma at the time his goal is to make a really fast Builder and bundler for our JavaScript code imagine a code base the size of figmas and how slow things must be in that world es build was from scratch written in go which at the time almost all of these bundlers were written in JavaScript so it's a big deal to write it in something else and we can see the performance win here webpack was at like 41 seconds for this test build roll up four was at 35 seconds parcel 2 was closer to like 15 still way too slow and then es build comes in at 0.39 the important thing to know about es build is that it's not a bundler in the traditional sense where it bundles everything into one JS file or the right subset of JS files that you're looking for ES build is more a Transformer it takes all the fancy syntax and things we write in our JavaScript like you know typescript or you know react code with jsx and it transforms all of that into JS that the browser can run but when you look at what es build outputs it's not a small number of big files it's a giant number of small files and if you have a big enough codebase and you're using ES build it might just not work for you because the browser can't load that many files so es build despite being revolutionary which it absolutely was it wasn't quite production ready in the traditional sense but for things like Dev builds incredible I'm going to move this lower and you'll understand why in a second another project that you might have heard about on and off depending on how often you're here turbo pack turbo pack is actually created by the original creator of webpack who now works at verell working on turbo pack full-time the goal of Turbo pack is to make a from scratch rust bbased rewrite of webpack that is as close to fully compatible with the webpack API as possible the goal being allowing us to take all of our old webpack code bases move them over to Turbo pack with zero or near zero changes and just have faster builds it has taken a while I have no idea if it will ever happen maybe someday but we're going to have to hope and hopefully all of this helps a little more with the context for roll down if turbo pack is the rust rewrite of web pack roll down is the rust rewrite of rollup you might be thinking some weird thoughts right now like why are we rewriting both of these why aren't we making something new why does anyone care about rollup especially the creator of V because evu created V if you're not familiar somehow watch more of this content and yes RP snow pack it deserves a shout out here I don't know where I'll even fit that though V is very interesting because vit's not a bundler in the sense that it actually is the thing that turns your JavaScript into other JavaScript V is a bundler that doesn't do the bunding itself V's actually two pieces V is using a different bundler in Dev and in prod because in Dev it's okay to have the huge pile of those JS files but in production you want an actual minified set of files so with Dev we have es build but in production V uses rollup this is great because you get insane like literally instantaneous hot reloads when you're using vit in Dev so when you make changes you see the change super super fast but in production rollup is used instead so we still get all the fancy bundling characteristics and optimizations that rollup has baked in there's a couple problems though first and foremost you now have different bundlers for these different environments which can make trying to match behaviors across them annoying a lot of work has been put in for vit plugin authors and people building Frameworks around vit to make sure that both Dev mode and prod Mode work properly because these things are so different it also means that you don't get the incredible performance that you expect from V once you actually start shipping the code to a server to be built the building and the bundling of an app with V for production does not see the massive performance wins that you see in Dev mode it also means once your code base is big enough that the dev mode starts to have problems because you have too many files going to the browser because it's not taking them all and putting them into one JS file it's creating a new Js file for every single thing in your codebase for the most part you saw this as a challenge this stack worked great to get V where it is today this is still how you're using V right now almost certainly depending on how long this video gets viewership for to be determined but today things change because if roll down is successful we're going to have one bundler for both of these we're going to be using roll down for both this is dope for a bunch of reasons first off we now have the same thing in Devon prod second off the entire V ecosystem should continue to work as expected because if roll down is properly API compatible with rollup then all the plugins can just use their production mode and it works in Dev 2 this is a very promising development and all the numbers that I've seen so far are very promising overall if we look at their benchmarks which I actually took the time to run we'll see if we compare roll down with RS pack es build and rollup all in a code base that has I think 10,000 files is what I ran this on you have a 10,000 file app rollup took 22 is seconds to run es build took 800 m milliseconds a bit under a second RS pack took 2 seconds which is still really good roll down took 600 milliseconds this is what's so cool about roll down is we're getting numbers slightly better than es build but with all of the bundling characteristics and behaviors that we would expect from a true fully fledged out bundler like rollup what does this mean in reality well sadly for my experience so far reality is not quite as shiny as these numbers look they're are places that I'm seeing a performance win already but I want us to be as realistic as possible about where this is today because this is the 1.0 beta and I'm excitedly trying to adopt it so I have this quick code base I threw together that is meant to test this it's a really simple create V app this is using the standard version of V I have a branch that is using the roll down version I'll show you in a sec but I also got some help from Claude to generate 5,000 components myself so this creates these 5,000 basic examples of a react component with State Management just a use State on the all it creates one for each of those 5,000 and then generates a file for all of them so I have this folder that has 5,000 components in it to keep them from tree shaking out I have this one file that Imports all of them and then mounts them all this file is uh not small 30,000 lines to mount all of these in it but it works and it lets us have them all in one spot I thought this would be a really good test so I ran it get check out roll down right now roll down isn't officially in V so there's actually a fork of V that has roll down support that I'm using a package PR new build of admittedly this slows things down a bit because it can't be npm cach the traditional way but not enough to justify the lack of performance when I experienced so I the thing I care about here is how does this affect the time for when I trigger the build to when it's actually in production because that's what I'm really excited about this is the first really production ready path for a lot of apps to stop using JavaScript to build their JavaScript we use awesome tools right now like turbo pack we're written and rust and yes build and go for Dev but none of these tools are recommended for production yet so I was really hoping really hoping to see some big wins here this is the first build I ran this one was using standard vit everything configured the basic boring way the build time about 11.5 seconds and it created this big file this 2.8 megabyte file and this is all the JS in that single file if we compare this to the roll down version it built in 7.47 seconds which is better it's just not as much better as I was hoping there is a concern though the bundle came out significantly larger there's a lot of potential reasons this would happen I don't feel like theorizing about them because I will make a fool of myself but it does not seem unlikely that this here is something that needs to be fixed I'm not sure if fixing the output size is going to also fix the speed at which it is doing the building but I was a bit disappointed this was a a 10sec total win which after I did more builds here this one was roll down it was 46 seconds this one was main which was standard V and that was 48 seconds there isn't a huge difference here at least for this example with a giant react code basee yeah again 7.5 seconds for this one versus 10.19 seconds to be very clear there's a couple impressive things here first off that a JavaScript based bundler can bundle 5,000 files in 10 seconds rollup is goated that's impressive the other thing though is that performance isn't the only win here the very least performance on your build server isn't the standardization between the dev mode and the production mode is massive you might see that one of these builds is really fast this 9-second build the reason why is I went from 5,000 components to 50 this isn't using roll down this is just using V which in turn would be using roll up the original version in JavaScript the reason I want to do this test is to see if I'm actually impacting build Times by including all of this stuff and clearly the answer is yes and it's not just that 7 to 10c difference anymore this says built in 881 milliseconds but there's a lot of other pieces in the build process that aren't included in this number and the goal here of doing these different tests in these different ways was to try and show all of those different numbers so if your code base has 50 components instead of 5,000 the difference doesn't matter you're already in this crazy fast build range but as your build times crawl up because you have so many files so many packages and all of these different things that's when you start to see the wins from something like roll down or like RS pack or Turbo pack or any of these other options and as I was experimenting if we hop back here I actually have this code open make sure we're on the latest pmpm run Dev cool now we are running this giant 5,000 file Dev server and if all goes well I should be able to hop in here edit component 23 change this sup nerds I am saving now and it appeared almost immediately like within under half a second I'm saving again right now if it's falling back on old thing it seems to be instant Please Subscribe saving now effectively instant and this is using the exact same bundling technique that's going to be used for production so getting that type of performance in Dev with the same tooling that you're going to use in prod is huge what's the call it you have for me here apparently I don't have a minifier yeah so the reason my Js is so much bigger it might just be because there is no rollup minifier yet they actually recommend you bring in your own it's recommended to use an external minifi minifier roll down is compatible with all roll up minifier plugins like rollup plugin es build s swc Etc good to know as I was hinting at before though the performance for Builds on the server is not the only really fun exciting thing going on here one of the things I am most hyped about is performance in WM why would anyone care about their bundler or running in wasm like you're not shipping the code to users to have them bundle it well you're not but companies like stack Blitz are companies like GitHub are companies that are trying to make good environments in the browser are and being able to use roll down in wasm mode to have a fully featured editor experience in the browser taking advantage of those performance wins is really cool and after they made some changes to make this work better with roll down the performance they're seeing is insane es builds and go which historically doesn't compile great to wasum because it doesn't really handle memory that well it expects to have garbage collection which you don't have in wasum so you have to bring all that in it's chaos rust can compile to wasm bit better which is why roll down sees insane performance wins compared to even es build once you're running it in Wasa mode super super cool to see and the things they're coming up with to make this happen specifically creating thread pooling for workers in the nappy RS apis is huge this is so cool I'm really excited even in a theoretical world where roll down fails entirely it has built so many cool foundational things and taught us so many cool foundational wins that we can make meaningful changes to our entire Dev ego system as a whole which is probably why they formed void zero the new company by evue focused on making the next generation of Dev tools for JS and typescript devs roll Down's only part of it the oxc ecosystem in vit and everything around this as a whole is the future so they call out here V vest roll down and oxc are the core things that if built correctly and properly can all combine together and make a set of tools that is significantly better for us to use as devs just to quickly reinforce the thing I was saying earlier about es builds transpilation not being ready for real production workflows this is a nice little piece in the roll down docks about it we can't skip the build step you know build people I I don't know what code basis you're working in it's I wish it was realistic it sounds great but it just isn't with the general availability of native es modules and httv 2 in modern browsers some developers are advocating for an unbundled approach for shipping web apps even in production while this approach works for smaller apps in our opinion bundling is still very much necessary if you're shipping anything non-trivial and you care about performance even in a polished unbundled Dev Model A build step is still often unavoidable take rails 8's default import map based approach for example all JS assets still go through a build step in order to fingerprint the assets and generate the import map and module pre-load directives it's just handled via this import map rails package in prop shaft instead of a JS bundler moreover the unbundled approach will hit its limits if you have any of the following requirements you need modern JS like es6 Plus typescript or jsx you need to leverage bundler specific optimizations like tree shaking code splitting or minification you use any libraries or Frameworks that depend on a build step or you utilize npm dependencies that ship unbundled source code if any of these things are true you need a bundler not would benefit from it but need it going with unbundled means locking yourself out of a big part of the JS ecosystem and giving up on many possible performance optimizations that could benefit your end users the main argument of avoiding JS bundlers is adding complexity and slowing down the dev feedback loop however modern JS tools have improved a lot on this front over the past few years our goal with v and roll down is to improve these aspects further and make the build step feel invisible I really hope they can get there they call out these three things that you can't get with without bundlers which are the reducing the amount of network requests in waterfalls because one JS bundle loads processes then realize it needs 15 more that'll have to go load and process or can ship the one bundle instead reduces total byes scent hopefully that's obvious why and it improves JS execution performance that part might be unintuitive but the tldr is when you send less code to the jit compiler it has to do less work as they call out here there's a non-trivial cost involved in parsing and compiling JS so if you send less JS it has to do less work and some bundlers and minifiers can even perform optimizations like folding and ahead of time evaluation to varying extents which makes the bundled code even more efficient than their handwritten Source bundlers are effectively necessary I can't take people seriously that say otherwise it just feels like they're not working on real software with real teams like it's cool if you can get it working in examples I'm not saying it isn't cool I'm just saying it's not realistic and what I'm excited about with roll down is it feels like it's getting more and more realistic writing rollup in Rust didn't feel realistic at the time but they're getting there they're getting there a lot faster than I expected and I see a very bright future for roll down ## Russia, North Korea, Iran and more caught abusing OpenAI - 20240216 benefit since we had big open a news to talk about but uh seems like we have one of the biggest stories to date because open AI just disrupted malicious uses of AI by state Affiliated threat actors seems like these State Affiliated threats have been escalating a bit lately we even saw Cloud flare getting hacked and people doing nasty stuff there not with Cloud Flare's data thankfully just their internal jera stuff so employee stuff got hacked but external things didn't in that case thankfully but as these things continue to happen in AI it becomes more and more powerful it's important that companies like open AI have a plan to address it so let's see what happened and how they addressed it we terminated accounts associated with State Affiliated threat actors our findings show our models offer only limited incremental capabilities for malicious cyber security tasks these to specify specific authors they almost never do that anymore just a small interesting detail we build AI tools that improve lives and help solve complex challenges but we know that malicious actors will sometimes try to abuse our tools to harm others including in furtherance of cyber security operations among those malicious actors State Affiliated groups which may have access to Advanced Technologies large financial resources and skilled Personnel can pose unique risks to the digital ecosystem and human welfare in partnership with Microsoft's threat intelligence we have disrupted five State Affiliated actors that sought to use AI services in support of malicious cyber activities we've also outlined our approach to detect and disrupt such actors in order to promote information sharing and transparency regarding their activities huge shout out to overall for scooping me on this and also linking me here there is a whole project that Microsoft has on GitHub for the Microsoft threat intelligence he even found here that in the threat actor naming they have named these actors and we can also probably see the most recent commits here this seems to be formatting primarily but we did have new threats added here Cadet blizzard which is Russia canvas Cyclone which is Viet Vietnam this is already one that existed caramel tsunami which appears to be new doesn't seem to have a location known very interesting it's cool that we could just read this here oh Emerald SS another new one from North Korea Fox typhoon which is from China Forest Blizzard from Russia interesting cool to be able to read through this and see all of the recent additions that are likely relevant here back to the update though see how they disrupted them based on collaboration and information sharing with Microsoft we disrupted five State affiliate milous actors oh they actually called us all out here cool I could have just scrolled two China Affiliated threat actors known as the charcoal typhoon and salmon typhoon the Iran Affiliated third actor known as the Crimson Sandstorm and the North Korea Affiliated actors known as Emerald sleed oh oh and of course Russia snuck in here their actor known as the forest blizzard the identified open AI accounts associated with these actors have all been terminated crazy that there was five of them all from different regions these actors generally saw to use open AI services for querying open source information translating finding coding errors and running basic coding tasks specifically charcoal typhoon used our services to research various companies and cyber security tools debug code and generate scripts and create content likely for use in Vision campaigns salmon typhoon used the services to translate technical papers retrieve publicly available information on multiple intelligence agencies and Regional threat actors assist with coding and research common ways processes could be hidden on a system D those terrorists using co-pilot the rest of this is actually kind of scary Crimson Sandstorm use our services for scripting support related to app and web development generating content likely for spear fishing campaigns and researching common ways malware could evade detection case you don't know what spear fishing is you probably know what fishing is when you send things that look like emails that are official but aren't like a fake your password got changed Google email spear fishing is when you specifically Target individuals knowing that their accounts or whatever you're trying to hack is of higher value so it's more precise and pointed you're targeting this individual usually with a bunch of different fishing things so hopefully they'll click through one of them sign into your thing and then they have access to your account this actually was happening to me a ton with my Chrome extensions because I have a Chrome extension that's very popular you have been trying to steal my Google account from me for a solid decade now so painfully familiar Emerald sleep used our services to identify experts and organizations focused on defense issues in the Asia Pacific region understand publicly available vulnerabilities help with basic scripting tasks and draft content that could be used in fing campaigns interesting there a lot of these seem to be like they're using chat GPT as better Google to get access to other data but now we're getting to the Russia one let's see what Russia's up to Forest blizzard used our services primarily for open source Research into Satellite Communication protocols and radar imaging technology as well as support with scripting tasks okay yeah that one's a little bit scarier that's yeah additional technical details on the nature of these threats and their activities can be found in the Microsoft blog post published today quick things from this Microsoft article this is the summary on their side the threat ecosystem over the last several years has revealed a consistent theme of threat actors following Trends and technology in parallel with their def Defender counterparts threat actors like Defenders are looking into AI including llms to enhance their productivity take advantage of accessible platforms that could Advance their objectives and attack techniques cyber crime groups nation state threat actors and other adversaries are exploring and testing different AI Technologies as they emerge in an attempt to understand potential value to their operations and the security controls they may need to circumvent on the defender side hardening these same security controls from attacks and implementing equally sophisticated monitoring that anticipates and blocks mous activity is vital while different thread actors motives and complexity varies they have common tasks to perform in the course of targeting and attacks this includes reconnaissance such as learning about potential victims Industries locations and relationships help with coding including improving things like software scripts and malware development and assistance with learning and using native languages this is actually really good points it it sounds silly but the native language thing like think of the stereotypical like the Nigerian prince email where most of the words aren't spelled properly and the English isn't close to proper so out of that is so it can skip through the spam filters but a lot of that is because it's the people writing that spam don't know English very well they can but once you've developed good English skills like really good English skills when you already are speaking another language and you know enough about code at that point you're going to start doing more traditional work to take advantage of that skill set but if you're not good at English and you're okay at code and you don't have a moral system all of a sudden AI helps you skip a lot of those gaps and I like how this calls that out being able to do research on your victims there locations Industries and relationships being being able to write code more effectively because the AI does it for you and being able to have what to us reads like much better English because the AI is writing it for you those are real risks that obviously help these scammers spammers attackers Bad actors whatever you want to call them do more effective work language support is a natural feature of llms and it's attractive to thread actors with continuous focus on social engineering and other techniques relying on false deceptive Communications tailored to their targets jobs professional networks and other relationships this is very real specifically the call out of social engineering this is where most of the scary hacks happen nowadays it's not they found some vulnerability in your system and got access to your servers and took over everything is usually social engineering even all the crazy GTA hacks that have been happening recently most of that was a person pretending to be an employee getting access to their slack account by calling it constantly to get them to reset his credentials pretending to be his employee and now he had access to their slack that's how the GTA hack happened most modern hacks are coming from the social side not from the system side even though both are incredibly flawed importantly our research with open AI has not identified significant attacks employing the llms that we monitor closely at the same time we feel this is important research to publish to expose early stage incremental moves that we observe well-known threat actors attempting and share information on how we are blocking and countering them with the defender Community while attackers will remain interested in Ai and probe Technology's current capabilities and security controls it's important to keep these risks in context as always hygiene practices such as as multiactor authentication and zero trust defenses are essential because detectors may use AI based tools to improve their existing cyber attacks that rely on social engineering and finding unsecured devices and accounts I've had to worry about this myself I have had multiple conversations with my family now saying Hey There is hundreds of hours of my voice on the internet it would be trivial to train an AI that sounds exactly like me so if you get a phone call from me asking for a specific information or anything even kind of potentially suspicious if you got a call from me pretend the voice your hearing is robot not me is the thing they're saying still something you should do if you're unsure instantly hang up and call me back or contact me on any of the privately verified ways we have determined to make sure the person who called you is actually me because we have to worry about these things and now that I'm at risk as a popular individual this scary and becoming popular in the era where AI can fake most of me is actually terrifying it's no longer a matter of if I get hacked or my family gets spammed with some it's a matter of when and I'm not excited for when this happens principled approach the protecting and blocking threat actors the progress of Technology creates a demand for strong cyber security and safety measures for example the White House's executive order on AI requires rigorous safety testing and government supervision for AI systems that have major impacts on National and economic security or public health and safety our actions enhancing the safeguards of raia models and partnering with our ecosystem on the safe creation implementation and use of these models aligns with the executive orders request for comprehensive AI Safety and Security standards it's an interesting thought that a significant part of why this blog post exists is so the White House order is being followed and if they're ever questioned in court in the future either Microsoft or open AI they have all these things to link back to be like hey look proof we're doing this we have proof we're putting effort into safety can you just let us do this which honestly like I don't know how much more you can do at this point especially now there's like open models out like if the government just said nope no more what ends up happening is China has all those open models and they can do all the things we can't this is a hard hard problem for us to solve and I think we're we're in roughly the best place we can be in line with Microsoft's leadership across Ai and cyber security today we're announcing principles shaping Microsoft's policy and actions mitigating the risks associated with the use of our AI tools and apis by nation states advanced persistent threats advanced persistent manipulators and cyber criminal syndicates that we track these principles are nearly identical to what is listed in the opena article so we're going to go back to that now a multipronged approach to AI safety this is them explaining how they're going to try and prevent this going forward probably things already doing too although the capabilities of our current model from cyber security tasks are limited we believe it's important to stay ahead of significant and evolving threats to respond to the threat we are taking a multi-pronged approach to combating malicious State affiliate actors use of our technology and platform point one monitoring and disrupting malicious State Affiliated actors we invest in technology and teams to identify IND disrupt sophisticated threat actors activities our intelligence and investigations safety security and integrity teams investigate malicious actors in a variety of ways including using our models to pursue leads analyze how adversaries are interacting with our platform and assess their broader intentions upon detection open AI takes appropriate action to disrupt their activities such as disabling their accounts terminating services or limiting access to resources I am 50/50 on this solution I find that it's easy to detect when something's disabled and then go open a new one I'm much bigger a fan of Shadow Banning and doing things to keep them from noticing that they've been put into this realm where the info is not useful but certainly way way better than nothing I just personally think letting them shout into the void and get back useless stuff is more likely to keep them from causing more problems personal belief I should also say before I go any further that open has made some safety hires recently of people I really trust and I I can say with 100% certainty some of the best security people in the world currently work at open aai and I trust them more than I trust myself I should probably hit up some of them to make sure I cover this all correctly regardless they have the right Engineers to solve these problems they know what they're doing point two work working together with the AI ecosystem open AI collaborates with industry partners and other stakeholders to regularly exchange information about malicious State Affiliated actors detected use of AI this collaboration reflects our voluntary commitment to promote the safe secure and transparent development and use of AI Tech and aims to promote Collective responses to ecosystem-wide risks via information sharing good stuff I'm happy they're not keeping this all to themselves and that it's so much of its open source and shared point three is that they're iterating on safety mitigations learning from Real World uses and misuses is a key component of creating and releasing increasingly safe AI systems over time we take lessons learned from these actors abuse and use them to inform our iterative approach to safety understanding how the most sophisticated malicious actors seek to use our systems for harm gives us a signal into practices that may become more widespread in the future and allows us to continuously evolve our safeguards good to hear and then the final Point here for their multi-prong approach is public transparency which seems like doing a good job here we have long sought to highlight potential misuses of AI see what these links are the system cards this is a breakdown in gp4 and how they want to handle inappropriate things first we highlight the safety challenges presented by the models limitations the capabilities providing illicit advice performance and dual use capabilities and risky emergent Behavior then they give an over a high level overview of the safety processes pretty cool they're publishing these very very latte white papers all about how they're dealing with these Safety and Security issues it's crazy seeing sexual hateful vient called out in the content warning for latch I even want to think how few times the word sexual has been written in latch docs but half of those instances are probably here and article they published before forecasting potential misuses of language models for disinformation campaigns and how to reduce risk they have a lot of Articles like this have been publishing since this one's early this year as well and they've shared what they've learned through additional research and things that they're publishing here including blog posts for Best Practices deploying language models as well as safety Miss use research they linked here separately they've been good about publishing all these things I've been working for a while now on a documentary about open a it's been a lot there's a lot of info there and their blog is very good check it out if you have it there's a lot of interesting info there anyways vast majority of people use our systems to help improve their daily lives from virtual tutors for students to apps that can transcribe the world for people who are seeing impaired as is the case with many other ecosystems there are a handful of malicious actors that require sustained attention so that everyone else can continue to enjoy the benefits although we work to minimize potential misuse by such actors we will not be able to stop every instance but by continuing to innovate investigate collaborate and share we make it harder for these malicious actors to remain undetected across the digital ecosystem and improve the experience for everyone else so this is a bit scary but also they're handling it pretty well the combination of the current tools not providing too much value as well as the effort that both Microsoft and openi are putting in to make sure we don't make a mistake here is good to see I hopeful that we'll handle the security and prevent external nation state threat actors from being able to do scarier things but when you make speaking English easier when you make writing code easier and you make getting info easier you're also inherently making scamming threatening causing problems easier too so I have no idea where we're going to end up with this but I do hope we're on the right track let me know what you guys think in the comments I am genuinely curious good seeing youall as always sure to see you in the next one peace right ## S3 Is A Security Nightmare (Common Exploit Showcase) - 20240617 I wanted to do a video about the security issues with S3 for a while if you're using it yourself right now there's a good chance you've made some configuration issues that could cause some massive security flaws in February I found this blog post and I immediately added it to my to-do for video content because I want to talk about S3 and all the things people do wrong with it and how easy it is to find like an account ID since then though Our Community member Eva has done a lot of crazy with S3 and other people's implementations on top of it and honestly this is a much much better post and a much better video and I can't not take the opportunity to read it and share with you guys the hack and the craziness that is how badly most people set up and secure their S3 if you recognize this blog post and this website it might be because of my earlier video 900 sites 125 million accounts and one vulnerability they're the ones who did the Firebase exploit that compromised a ton of websites and found $4 billion of potential Bank credentials just crazy anyways we're talking about S3 specifically how most people suck at securing it and some of the things that can result if you don't set it up correctly tldr S3 pre-sign posts or other ways of uploading files can easily be abused with cross-site scripting or unwanted paths for uploads yep if you're not familiar with a presign post URL it's an important concept that'll tldr for you maybe this is going to be more than a tldr excal draw my beloved let's get diagramming you have a server we'll call this your server your server is a box that does things one of those things is make sure a user is the right user so if you have a user we'll have the user be a circle let's say this user wants to upload there's a couple different ways they could do it they could literally just send the file straight to your service which is a file upload where the user just immediately posts the file maybe it's part of some form data maybe they're just sending it as a post there in is some way in which this user that's on your service is sending this file to your server usually this has more steps though usually it's more like this where the user will send some type of like permission request to make sure they have permission to actually do this thing so which the server applies yes you can upload and then and only then do we actually send the file to your server in order for this to work you have to have authentication checks at all of these steps and once this permission has been granted you probably have to REO too because you want to make sure that this is actually the person doing the upload but you have to have some level of back and forth here on top of that it's important to recognize the size of of these requests the permission request is probably going to be like literally 1 kilobyte the response will probably also be 1 kilobyte the file upload might be 50 megabytes so now your service is eating 50 megabytes of egress where you're passing this to your server we even talked about the other side though which uh honestly probably better to have a different shape I'll use uh our good old Diamond to represent external services in this case S3 this is the file storage on Amazon that most people are using for actually storing their files once this file has been uploaded you you probably want to pass it to S3 so it's there forever so we're uploading the file and then we have to Route this through your service and then over to S3 so we have to eat the cost of ingesting the file as well as passing it over we have to wait till the whole file has uploaded have it on our server and then pass it if this file is too big good luck there's a lot of things you have to think about when you do this wouldn't it be really nice if instead of the file upload happening here you could just have it go straight to S3 wouldn't that solve a lot of these problems it introduces own problems too which is that your server needs to know when the upload is done so once S3 is done ideally it's going to call your service and say by the way upload completed because something has to tell your server when the upload is done believe it or not the way most Services work is they'll actually have the user tell the server hey I just finished uploading because getting S3 to tell your server that the uploads complete is way more annoying than it should be the main thing I want to talk about here though is this skipping the step straight to S3 usually what will happen here is you'll contact us three or do your own things to sign to create what's called a pre-sign poost URL which is what gets sent back here you signed post sent the pre-sign post URL is a URL that was generated by your server that allows for a user within a specific window with specific permissions and like file delimiters to then upload that file straight to S3 so you'd request to your server hey I want to upload a thing I want to upload an image up to 4 megabytes your server then responds to that user with the presign post URL that they then post the image to to send it to S3 pre-sign post is just the way we do this for a bunch of reasons largely because skipping your server means the Ingress and the egress costs in and out get entirely eliminated and the latency is much better too because the user is posting straight to S3 instead of going through a middleman that said pre-sign post URLs leave a lot of places to make mistakes which is probably what this post is focused on back to said post so you might have recently seen Eva's tweets about S3 upload and how many companies can't stop messing it up believe it or not this a much more widespread issue than even my tweets made it out to be check out Eva's Twitter if you haven't already XYZ Eva absolute Legend killing it with these xpls and security discoveries I've learned a lot from watching them so check them out anyways this article covers two common vulnerabilities that they found within S3 uploads specifically within pre-signed posts who doesn't love a good cross-site script xss everyone's favorite you probably saw this one coming companies make a files. some company.com or CDN Doom company.com subdomain for S3 and when you combine that with poor handling of content types of an uploaded endpoint we can upload HTML files and if their cookies are set in properly we can use this to take over accounts this is scary the piece you need to know in order for this to make sense is that HTML and JavaScript tags that are served from a specific URL have access to the cookies from that domain so if you set a cookie on google.com and you serve some HTML on google.com/ whatever that HTML when it runs in the browser has access to the cookies that are on that base URL if you set your cookies in correctly you might also have those on all your subdomains so if you set your cookies where they work on files. google.com as well as on google.com like the root domain now if you put an HTML page on files. google.com and someone can open it you have access to things that you shouldn't have access to that is very very scary for security reasons it's one of the first things that people look for when they're trying to exploit Services because now if you are able to upload files somewhere you shouldn't and they can be HTML Pages you can send one of those links like files. google.com/ my page. HTML if in here I'm doing some nasty stuff with cookies and Google's cookies aren't configured correctly I now have access to all of your off credentials and I can now take over your account cross- site scripting is one of the scariest ways to exploit things and now we're seeing just why well soon we will see just why and what is possible when you use these exploits the first example Eva gave was a website called tally Tally's a modern Google forms alternative which allows form Creation with images for this reason they also have profile pictures they need to store files that makes sense if you have a form that has images you need able to store images they chose a custom is endpoint that uploads a file for you to their S3 after performing checks sounds good right not so fast here's what the request for uploading something looks like so here's the request API TSO upload block asset you get back a response you have the pixel image the name the URL storage. T.O and here's the image pink pixel. PNG image. PNG size 83 I'm sure it's like just 83 bytes cool looks interesting but what if we tried an HTML file instead hello image source X on error alert one cool and now if we see this she was able to post xss HTML as an asset to this endpoint and get back xss HTML with the MIM type being correct this is a big deal because the MIM type being correct means that you can go to this page and your browser will treat it as HTML and potentially exploit it EV just pointed out that browsers will actually try to MIM sniff even if content type is set to something else so if you don't manually set your headers is the host of the service it's possible that your browser will assume it's HTML and try to run it anyways even if you set some other M type elsewhere so yeah be careful of that cool so now that it's uploaded let's see what she does here you can see Hello empty image tag that is broken but it didn't alert which means that something's getting trimmed it looks like it didn't work let's look at the Dom hm looks like tally sanitized our xss payload out so they kind of thought of this but it's likely not foolproof that's very interesting that they let you upload HTML they just try to sanitize it before it gets to the user to remove things like JS tags fun let's see how this works or more importantly how this gets exploited looks like it got sanitized so they thought of this yada yada on error fetch attacker URL script. then a text then doing some vals cool and then the xmlns is W3 .org this is forcing the XML parsing mode ooh this actually works this allows me or bad actor to get cross-site scripting on files. T.O which has the session cookie in scope but it's HTTP only how can we get the cookie when it's HTTP only very interesting oh ha thank you Eva for pointing that out it's not an HTML Doc it's an XML doc because they're uploading this as SVG XML very clever very clever these are the things where like if your service isn't accounting for it you're SC and if you're trying to DIY all these Solutions they're not going to work we'll talk about the easiest ways to work around these things in a bit and early warning this will include a couple self plugs so know that but for now XML SVG XML specifically seems like a good way to hack some JavaScript into a place where it doesn't belong and according to chat both Eva and neotherm a lot of places don't actually secure SVG uploads which is terrifying but sadly doesn't surprise me so how do we deal with the fact they files endpoint is only HTTP not https turns out that tally has an endpoint for us that lets us get an authentication token from a refresh cookie and its web app also needs this token for the API so this is intentional here's my final payload served by my web server refret this page with credentials included and then a. json. then await fetch attack or call back method post body headers content type window location replace to.so very interesting and here's what my silly little web server gets when someone clicks this link so here they get the full dump of this user's information when somebody goes to the page so if they send them that SVG and they open it they get all of this sent over afterwards the do replace is just a cleanup so that it looks like you just went to the T homepage it's not actually important very good to know authorization token no oh Eva organization id never change never change love this full pwned cool one click full pone of your t account isn't that just really good well no Bounty was awarded for this I can't blame them they're a startup and they still fix the issue very quickly but as you can see these exploits are very powerful so obviously Eva continued S3 paths are tasty some Services allow the user to control the path and key of the file to upload while uploading common libraries also do this next S3 upload oh boy don't tell me the next S3 upload library is this easily compromised interesting this is a problem when the server doesn't check if the file already exists allowing the client to override other people's files I see where this one's going and this is again something that people every service I've seen gets wrong do I do the upload thing plug now or do I wait a little bit it's very tempting to plug upload thing right now but I'm going to wait for the time being we'll get to it in a bit I am sure exhibit B P yes I did choose the specific example to make it rhyme with t never change Eva anyways p is a way for streamers to set up a donation page and split it across their team such as their mods they have Channel banners and channel profile pictures so they need a way to store that data they chose to use S3 to do this here's what a request to upload an image would look like API p g V10 upload sign ACL public read key is the key for the file and then file types image PNG I already am seeing the problem here my assumption before we go any further is that this key is something you're setting which means you can set this key to something that you shouldn't be able to upload and then override it then this returns a pre-sign post URL the key is randomly generated by the client so what happens if I change the key into something that's already used by another user well that's exactly what I did and it worked so for an entire minute Thor's profile picture on P was a gnome while watching pirate software for the Apex situation stream found this donation link with P found a way to override it basically it was just a classic case of insecured three uploads can I say on four yep but then here alternatively use something like upload thing to do the file uploads for you I'm going to take the opportunity here cuz you mentioned it first upload thing was built to solve a lot of these problems the number of places that I seen that are doing file uploads just like entirely incorrectly be it things like this be it eating egress cost and Ingress costs they shouldn't be eating be it just not authenticating on their servers properly be it allowing uploads that they shouldn't there are so many things I've seen like everyone get wrong including the naming of these things something that we do when we go to upload thing files or when you're uploading it in the first place if I just go to my T3 Gallery tutorials files all of these files have a key that we set and if you look at the URL you'll see the URL has this key in front front and then it has the PNG at the end when you save this file we're actually using other things to get the name that aren't included and this URL for the file is generated by us so there's no world in which you can override someone's file here it's just not viable you can't do it which is again really important and most people configure these things incorrectly that's why we did it so yeah if you want to set up these things correctly upload things really easy really cheap we have a guide on how to get started takes literal minutes to do some people it actually takes literal seconds to do we had a speedrun Content people were setting up upload thing in literally under 10 seconds on a new service while also being fully authenticated which is an important part we actually require with upload thing that you manage everything on your own service so if we see here this file router this is where you authenticate a user to upload this code runs on your server because we so strongly believe that you need to authenticate the users not us all of these patterns are things that we're strictly enforcing because most people do these things wrong so we just made them the default we made doing them correctly the default and as long as you scroll through and copy paste all this code it is very very hard to set up upload thing in a way that is unsafe by Design I also see some of the upload things speedrun winners hanging out in chat and bed set some insane scores on that speedrun embed just link their records upload thing speedrun of 9 seconds and 245 milliseconds absolute Insanity there's a couple cheats here that let them do it so fast specifically that they use their bash history to fill out most of the back end code here but uh yeah that allowed them to set this up and get it working in literally seconds drag and drop the file go here and then you see it already uploaded actual Insanity so it should be that easy anyways setting this on the client is a terrible idea and I hope that by now you guys can understand why also allowing the user to set ACL is terrifying the results are not surprising either when you leave things like this accessible to the users terrifying they also didn't offer a bug but they're also a smaller startup so that's fair especially if they fixed it since like you're getting your value out of this blog post and again check out Eva if you haven't already she's good at this stuff you can probably pay her to pone your stuff and make sure you pay her for her efforts because she knows what she's doing and she deserves some money for it so how do we fix this we could simply avoid the examples above set your cookies properly and not allow people to control the key important stuff in conclusion S3 is pretty hard to do because of the common pitfalls people come across while using third party libraries specifically ignorance if you're using third- partyy libraries to manage your actual uploads it is pretty easy to do it wrong this is something that we've extensively covered in the past and S3's lack of good docs amplifies the issue I absolutely agree that's too hard though can somebody do it for me there's many products available to simplify S3 or redo it entirely here's a few pumped to be the first one in the list the B scale file upload API from what I've heard is pretty solid file stack I've heard a little bit about but I'm less familiar with uh simple file uploader and Powerful apis to upload transform and deliver things in your app cool haven't used this one so I don't know how good it is to recommend also their competition so I'm not going to linger on it too much but yes this is why we built upload thing we put a lot of work into it and I hope this video helps you understand exactly why managing your files is a scary thing and I see way too many people doing it wrong hopefully this incentivizes you to do it right and until next time peace nerds ## SO MUCH NEW STUFF!!! Next 13.4, Server Actions, Qwik 1.0, UploadThing, Vercel Ship & More - 20230508 what a week remember last week when I said I was gonna have a video every day uh yeah that didn't happen at all it was a chaotic week from Versailles ship to my keynote at reactathon to the quick release to the hackathon with clerk to all of the chaos in person and online it was just a lot and I didn't have time to film the videos I wanted to film I'm gonna do my best to summarize the week now and I want you all to let me know what the most interesting parts are so I can do deep Dives on all of those throughout this coming week thank you guys for the patience sorry that this is about to be a shotgun blast of new content but uh yeah we have a lot to talk about first and foremost verselle storage I already kind of have a video on this stuff I'm not going to talk about it too much more here the TL DR is that for sale added postgres KV and kind of a file upload thing it can only do up to four megabytes and it's very very early which is kind of funny because we have our own upload thing that we also shipped the same day so definitely check out the two videos we have for those I'll put them in the description click also shipped their 1.0 release the same day which is a little bold but super nice to see there's a lot of charts talking all about the benefits of resumability over hydration I haven't talked about quick too much but I've been talking with mishko a lot if y'all want to hear more about quick let me know on Tuesday two big things happened one was the versel firewall and secure compute products these are kind of enterprisey but they're focused on helping Developers integrate versel with private Network things like a database that they don't want to have exposed over https over the Internet it's good for a lot of security compliance type stuff and it's awesome to see for cell beginning to embrace that not super exciting for what we talk about here but cool to see regardless might help you push things over the edge at work what I'm more excited about is the keynote that I did for reactathon I will put a link to the timestamp in the description I'm sure there'll be an actual video of it out soon the tldr of that is I wanted to talk about the relationship between react and the react community and how it's going to push the whole new model forward I love the talk I'm really proud of it and honored I got to speak at reactathon especially uh it's a lot as important as the keynote and I had a great time at the event it was super cool to be there and talk with everybody that I did Wednesday had a bunch more awesome react-a-thon talks as well as two cool products from versall one was visual editing in the previews which is a beautiful hack they don't detail in the blog post exactly how they do it but it is really really silly the tldr is they put hidden white spaces at the end of all the text so that they can detect which text element is come coming from the CMS and which ones aren't and by doing that they're now able to have a dynamic edit button on all your preview builds where you can edit the content of the page and that gets changed in your headless CMS like sanity which was their day one partner the team was so excited to show this off to me early I know they're going to be working really hard on continuing to iterate on this flow and this might be the thing that pushes your content team over the edge if you work at a place that likes WordPress because of the marketing pages and the ability to edit things on their dashboards really cool to see Purcell understanding those work cases as well as the more developer focused ones and trying to find a balance between the two what I'm more excited about though is Versa spaces the goal of spaces is to make it easier to adopt and use all of these new technologies as your companies grow not just for five person teams but for 500 person companies as someone who helped maintain a giant repo back when I worked at twitch the old code owners patterns just weren't good enough if you need this you all you know you need this and as soon as you saw what they were doing allowing for lint rule level code ownership yeah I am very excited this is honestly the first I've seen someone really challenging github's code workflow Monopoly and it's time that we rethink conformance and how we operate around big code bases with bigger teams really hyped on that release but I have to talk about the big one we should talk about next JS 13.4 funny enough I actually already recorded a video on next 13.4 and I really wanted to demo server actions but due to a combination of one small mistake I made and the compiler making a big fuss out of it I bombed really hard and now I can click run server action getting 500 internal server error did they break this right before my demo this demo just pretend it worked okay it'll make you feel a lot better because I need to get this video out today so I've been talking a lot with the team funny enough chatting with Sebastian a ton and there's so much cool stuff going on in this release obviously app router is now stable I have been shipping it for everything we've built for a few months now it is so much nicer to work with I I can't go back to the old model turbo pack is still early enough that I've yet to get it working on any of the projects I build but it does seem incredibly promising and just from seeing the difference in start times when I removed all the things that I needed that kept it from working yeah it's really fast and the future with turbo pack is bright but server actions is the big thing in here y'all watch my streams or keep an eye on my Twitter you know I've wanted to talk about server actions for a really goddamn long time you no longer need to write an API endpoint for your client to mutate things on your server so before if you wanted to create posts for your blog posts entries you'd have to have an endpoint where you could post the Json to it or a form data blob to it you'd get that as a request on the server parse it do whatever you need to in your database after authenticating and then send a signal to the user saying hey we're good and then the user would have to refresh to see the new content the old model was better in a lot of ways where you just hit a button on a forum it would post that endpoint and that would send you back either a redirect or new content that's why I'm excited about what's going on in this example specifically it kind of goes back to that old model of you write a server action here where you increment something you say use server which tells react and the compiler hey this needs to be treated kind of like an endpoint and when people call this function it needs to behave in a specific way in this case it's not being treated like traditional function it's actually generating a post endpoint that this form action will post to the way old traditional forms worked this allows you to do Progressive enhancement to the more traditional way Something Like Remix would you can even write functions outside of your bodies in fact I wouldn't recommend putting them in here there's some really scary gotchas I'll make a video about that that goes really in depth soon because I'm I'm terrified but you can Define them outside of your server components and you can even Define them in different files and import them in your client components at which point they become a more traditional fetch endpoint which is really really nice and so nice that we actually built a package around it at ping because we were using this stuff early and the way this package works is kind of similar to trpc to Define an action using our package zact you have a file that calls you server at the top which tells the react compiler hey everything in here that's exported needs to be an async function that I can convert into a fetch call so you you server you export an async function in this case you actually wrap the async function in our zact helper it takes one argument initially which is z dot object which is your validator for what data you want that endpoint to receive and this defines a helper that you then call an async function with the type here gets inferred from your validator here and you do whatever you need to in here as a mutation I also wrote a custom hook but it's entirely optional because again you can just import the action and call it like a promise it's really nice really fun workflow we're going to add a bunch of stuff to this in the future like like middleware authentication and a lot of the other stuff you might need to make real production software using these patterns but the server actions are still very very early there are a ton of weird gotchas that package helps with the sum of them but not all of them they're Alpha for a reason and I'm excited to talk more about them in the future let me know what's the most exciting and the most confusing about the server action stuff and I'll be sure to cover that in future videos where we go in depth on it clerk also had a small update for their next JS app router stuff they had a stable support for all of their Integrations in the app router we've been using this for a while both for upload thing as well as marker thing it's been really nice to work with the new middleware syntax is also great where you can just wrap anything with their new off middleware Helper and kind of be done as well as exposing public routes this way previously it was like 20 to 30 lines of code now it's literally four it's a nice change excited to see that Clerk's been really nice to work with and I've been super impressed with the product silver component is coming soon from what I know I also have to shout out orij Dev he's from the solid side of things but man in literally four to five days after we shipped upload thing without any document of the internal workings he was able to get it fully functioning inside of solid.js and put out an open source package for solid upload thing really cool to see somebody already get this working I'm pumped we're going to go out of our way to make sure that this is accessible to everybody and we might even be open sourcing some stuff in the near future so keep an eye on us fun stuff coming with upload thing yeah I hope that's everything I mean I know it's not I'm positive I missed some stuff it was an absolutely chaotic week but I loved it I got so much out of the last week I'm sorry I didn't have almost any videos about it then but hopefully we can make up for that in the coming week with all the awesome content we have planned thank you all so much for checking this out I couldn't be more hyped to build with all the things we talked about here I have a feeling it's going to be an awesome year for web dev and we're just getting started if you want to hear more about any of what we talked about check the description if you want to go in depth on the upload thing stuff I'll pin the video for that in the corner really hyped what we built there we made it for a reason thank you as always peace