Syntax Video
React Conf 2024 Recap
- 0:00 Hello!
- 0:31 React 19 RC
- 1:45 React Compiler Released
- 3:23 React Compiler is more than just auto memo
- 4:58 What's new in React 19
- 5:29 Remix and React Router are Merging
- 7:11 React Party Kit
- 8:57 Will React get Signals?
- 12:38 React Native + React Server Components
- 15:00 React Conf Day 2
- 15:10 React Native New Architecture in Beta
- 15:59 React Native Frameworks
- 17:36 Continuous Native Generation (CNG)
- 18:31 Pigment CSS
- 20:04 React Native for Apple Vision Pro
- 20:59 React Strict DOM
- 23:16 React Conf 2024 Trends and Takeaways
- 24:18 Write Once Run Anywhere
- 25:20 Sentry Runs Everywhere
- 26:48 Thanks!
Hello!
what's up CJ here uh it's been a while since my last video here on the syntax Channel and a lot has happened since I last made a video so this video and the next two videos that I make are actually going to be recapping some of the new and interesting things that are happening in the world of JavaScript and this video is all about react comp which happened about two weeks ago at this point and it was a two-day conference so let's Jump Right In I'm going to talk about all of the interesting things that happened all of the announcements and and everything in between so day one there were quite a few announcements regarding react itself and you probably saw a blog post a few weeks ago announcing react 19 beta they talked about all the new features coming in react 19 and basically announced that the library was now in beta but at react comp there was another announcement and so far the feedback on the beta has been pretty good so as a result today we are upgrading the beta to an RC release candidate right and so what that me
React 19 RC
means is now that it's RC or release candidate you can expect that if you upgrade your app to react 19 there likely will not be any breaking changes and you're you're basically at a point where if you upgrade when they release the official version you should be in a good spot to use all of those features now if you want to learn more about the RC it's at the exact same link as before so they basically took the react 19 beta announcement and they did a find and replace for the word beta and just put RC on it but uh all those features are coming and if you want to learn more about them definitely check out episode 768 of syntax so Wes and Scott dive deep into all the new features that are coming they talk about what they like they talk about some of the features that they've already tried using so definitely give that episode a listen if you want to learn more about react 19 now there also was another big announcement in the world of react we've tested and shipped react compiler at meta and at this point we need your feedback to help get it ready for widespread adoption so I'm excited to
React Compiler Released
share that today we are open sourcing react compiler and Publishing yep so you can check out that link there you can take a look at the react compiler and also the docs on it and what it is what it does etc and uh at react comp there was a talk that kind of dove into what happens when you use the react compiler and so essentially you can take a code base that required a lot of manual optimization so things like using memo to memoize components or use memo to memoize complex calculations and instead of having to do all of that manually you can just run the compiler and your code is just as perform it without needing to write all of that yourself delete all the memorization that I added restart the server but with the new tool that we just built and going back to our app there's there's no rendering of playlist our app is performant even
without manual memorization so it's pretty slick and it's a pretty cool thing that in the future you'll be able to re write react code that you don't have to manually optimize and the react compiler will do that for you um but there are more things that can be done than just autom memorization and at the end of day one there was a Q&A session and Joe kind of talked about some of the things that would be possible now that we have a compiler it is not only about automization it is a compiler that deeply understands react so one thing we've talked about is uh shipping in ability to call context or hooks from inside use memo callbacks where you could have you know more fine grained access so that for example today if if a component accesses accesses context well whenever that context changes the component will rerender with the compiler we are going to you know if that piece hasn't changed we'll quick it will quickly bail out and de get you know an optimization but we could go
React Compiler is more than just auto memo
further and actually figure out you know what the context change but we can just figure out we don't need to do anything in this component at all which would obviously be even better uh and so that's that's a case where we can start to say does this even need to be an API or could this just be an optimization that you never have to think about react just works faster out of the box so it's a it's a new way to even think about react code bases with the introduction of the compiler so like like Joe was saying you might reach a point where you no longer have to use these functions that are exposed by react like use memo or or memo or use callback or whatever else everything everything is just handled for you and you don't even have to think about a code at that level and and especially this idea like it's it's it doesn't exist yet which Joe talks about right after this but just the fact that it could be possible to automatically uh optimize your code that's using context instead of rendering an entire tree when anything in the context changes it can be smarter about what it decides to rerender so that is an exciting future for react and the compiler now another talk that
happened was Lydia H's what's new in react 19 so she just detailed all of the new features in react 19 but with some really good diagrams and uh animations and illustrations so if you have not heard of Lydia hi she has a YouTube channel where uh she has some really good visualizations that describe some some complex topics so things like promise promise execution the event Loop uh and also execution context and different things like that so Lydia's got some really good visualizations for talking about and explaining some of the newer features in react 19 so definitely check that talk out now another thing that happened was the announcement of the merging of remix and react router so you can check out this blog post that kind of details what's happening but essentially the remix team saw themselves gradually refactoring things out of remix into react router because they were useful for react router and they essentially reached a point where it didn't make sense to have remix be a separate Library so they are
What's new in React 19
Remix and React Router are Merging
merging so that's exactly what we're going to do we're going to bring the V plugin from remix over to react router um and now you'll have easier access to all the features react router already has but V just makes it more convenient um so we're it's it's not out yet but it will be in react router V7 um so essentially with this release now you can just have a v plugin and get the benefits that you would have gotten by potentially migrating your code to to remix but instead of just using your existing code with react router so it's a pretty exciting Feature Future and uh you might also be wondering though what going to happen to remix and Ryan talks about that here as well remix is going to just take a little nap uh we got some ideas for what remix the project the code is in the future um but for the time being uh all all the code we've been doing this the whole time we've been moving remix features over to react router ever since we started building remix and we're just at the point now where it's like yeah the last thing is just this V plugin so let's just bring it over so remix is going to take a
little nap um the brand the swag we've got some go get it uh the team we're the remix team we have remix meet ups we have remix Community we're not we're not getting rid of any of that stuff so remix will still exist you just won't install it anymore it's just going to be basically a community and a brand but you will install react router now another interesting talk that happened was by Sunil pi and they talked about a new framework that they're working on and first up they talked about one of the pain points of working with nextjs and uh server react server components uh the thing that bothers me about server components ever since IED started trying them out and folks here who might have tried it out in nextjs or somewhere else will know that you can't use State and context with server components it just says NOP those are client side things you might have a component a very simple counter and you say hey counter set counter you state and on button uh you increment it by one uh this won't work
React Party Kit
like the compiler will throw and say nope you cannot import youate inside a server component so uh we probably all run into this especially if we've tried to uh learn about react server components and start to use them but what Sunil mentioned is there is this thing that was created at Cloud flare called uh durable objects and this idea that you could have servoless workers that maintain state in some way so they thought what if you combine this idea of ser serverless functions with state with the idea of react server components and essentially react party was born and it looks great it's exactly the API that I told you it uses the seress compute model to maintain state that lives and it exposes it with hooks that just look like they're from react itself so you can see here like use State use reducer create context all of these things imported from react party but you can use them in react server components so this will be an interesting library to keep an eye on to
see kind of where this heads and and uh it's also cool to see that libraries like this are popping up now that react server components are being used more and more now another thing that came up was signals and if you haven't heard of signals they are essentially a way of managing state in your JavaScript apps where you have uh some place where state is defined and then you have somewhere else where that state is potentially accessed and anytime the state is change that those locations where it's accessed will be updated in A fine grain way and a lot of Frameworks have used this idea even all the way back to the to 2010 solid JS probably popular popularized it the most these days but but uh most other Frameworks aside from react are using signals and so a question was asked during the Q&A uh at react comp day 1 of will we ever see signals inside of react uh and especially because if you have not seen it there is this proposal here it's currently stage one
Will React get Signals?
but it is a proposal to the ecmascript standard that would potentially bring signals as a primitive to JavaScript itself so instead of needing to exist within libraries and Frameworks it could exist directly inside of JavaScript and then these libraries and Frameworks uh could take advantage of that so you potentially would get this capital S signal object that can create State create computed State and then you would have effect that uh anywhere in any library or any framework that needs to use a signal could have this effect here and take advantage of the stuff with like native optimizations and everything else if signals were actually running in JavaScript itself so uh signals are interesting and they're kind of all over JavaScript right now so the question is will we ever see signals in the world of react and it was mentioned that if this is ever adopted into the language like I said it's stage one it's not actually in the JavaScript language yet but if it was it's possible that things like the react compiler would take advantage of it uh but Joe also dives into why you potentially won't see
signals in the world of react simply because of this simpler model of not having to think about where the State updates and just thinking about okay I have a view I have my state it renders everything updates from there so Joe will talk about that we think that is a lot easier as developers to write first order programs where you you just write your UI right you just write a function that describes the state of your UI and then from that we can extract out that computation graph and use that to optimize your application so signals you know if we were to explore them it would be an implementation detail we're not even sure that's actually the most optimal implementation detail um really so it's great that other Frameworks are exploring it genuinely genuinely mean that like it's really great that there's so much exploration of different approaches in the ecosystem um but we don't think it's really the right fit for react as a programming model we don't think it's a great fit for the implementation um and
in particular just that that ability to write code that describes the current state of the UI and think in that way is just so simple and I think that's what's made react so approachable to so many developers and the key thing is as we showed in the compiler section we just can take that information and optimize it under you know under the hood so so yeah it's it's super interesting to hear from the react team that they're not exactly considering signals because they can potentially introduce these optimizations and it's a different way to think about the problem because signals are a way for programmers to to basically uh create sections of the W that are creating State and then other sections that are accessing the state but they do have to manage that but the whole thought process here is if developers don't have to think about that and the compiler can do it instead then that's potentially a better way to go which it's interesting it's interesting to hear different perspectives um aside from all the react stuff there was also react talk of react
React Native + React Server Components
native and so Evan gave a talk on using universal server components uh with react native and he gave a really great demo that basically showed a completely native app that was using react server components and server rendering got the Expo AI app here so we can open it up and this is an end to end react native app running server components this is the like as far as I know the first server rendered react native app and uh let's go ahead and hit list new movies and we got our trending movies here we can scroll through them look pretty good we can long press to see the to see that you know casting crew one thing you'll notice is actually when I do that long press there's going to be a little loading indicator what that is is a server action fetching more data and rendering down more UI menu elements and then pulling them in so we can search for an actor just like we did before um we could maybe select a movie create an event create an event will stream down a calendar card so it's
fascinating to see that all of this stuff actually is server rendered and in the world of building native apps this is something that you really haven't seen before typically when you're building a native app you're always interfacing with some kind of like Json API and then rebuilding the UI on the client but this is using the react server component spec so you can actually render from the server which is fascinating and if you check out Evans talk he shows some code examples he shows some other scenarios where you can use it it is pretty slick um and also talked about when and where you can use this stuff everything that I just showed you that app is Expo SDK 51 app sets out today with react 19 and new architecture the parts that are are still work in progress are going to be the concurrent router the server actions the the the server render part and we move fast we can have that out later this year so we'll have maybe all the pieces or uh or maybe sometime next year I don't know so consider this in RFC is so basically what he's saying is he showed what's possible uh but now we want to hear from the community in terms of is this interesting is this something you would
want to do how would you want to use it um before it gets into a more like stable API that that gets adopted into uh react native and Expo uh so you can check out this blog post that talks about Expo SDK 51 and a lot of this was also talked about on day two as as well so day one was all about uh new features in react a few new features in react native but day two was definitely heavy heavy react native and so let's talk about that there was a big release of something as well and that's why I'm very excited and very proud of the team today to announce that we are considering the Iraq native New architecture officially in beta so you can tell there's a theme Here lots of stuff uh getting either RC or beta tags basically as a signal that these are things that you can start to use yourself and uh you can expect that there will be less breaking changes when the when the official things are
React Conf Day 2
React Native New Architecture in Beta
announced but the the react native New architecture if you want to learn about it there is a discussion over on GitHub that uh talks about the newer features um also there's a section in the react native docs that talk about the new things like synchronous layouts and effects support for concurrent rendering and then also fast JavaScript or interfacing now another interesting announcement that came from uh day two was this idea of react native Frameworks we've actually seen a very similar thing happen in the world of react if you remember when the react docs were updated there's a section talking about you should use a framework when you're working with react and uh they mentioned you should probably use something like nextjs or something like remix and the world of react native is having a a very similar thing happen happen where basically they're saying that if you are using react native you probably should be using a framework and so this this RFC was back from February this details
React Native Frameworks
why they talk about this why they made this kind of decision and they announced what they believe is the official framework that you should use when you're working with react native so that's why starting from react native 075 the recommendation from the re native team for newly created up is for you to use a reactnative framework and our framework of choice is Expo so yes you should be using Expo for your newly created up we've and like I said I'm not plugged into the react native ecosystem and the Expo ecosystem I don't think this is going to get as much pushback as uh as potentially what we saw depending on where you were what what circles you were in uh as we saw in the world of react when they essentially said you should be using something like nextjs um I do think that most people were already using something like using something like Expo uh but it is interesting to note that now it is is an official uh thing that you should be using Expo if you're working with react native now an interesting thing that was covered that
Continuous Native Generation (CNG)
exists in Expo is this thing called continuous native generation and if you've ever worked in a crossplatform codebase or or like a react native codebase you're probably familiar with the idea that you have to have some native code in that code base you might have a folder for your iOS native code your Android native code but with continuous native generation you potentially will no longer need that and not a native folder in site and that's because this project is using CNG continuous native generation to generate these folders the idea behind CG is that native code can be generated from a set of inputs making it a FAL so in a similar way you can run MPX expert pre-build to generate the native projects based off of your app Json and package Json so uh your code bases will get smaller and simpler and you won't have to have those native projects in the codebase itself now another interesting announcement was the introduction of this thing called pigment CSS and this actually comes from
Pigment CSS
the material UI team and if you've kept an eye on material UI or you've used it in your react apps you know that they have had a lot of different ways of working with CSS through the years and now they're introducing a new way of doing it but for good reason uh basically most of the CSS and JS solutions that exist out there need the react context API and if you're using react server components you can't use the context API in those server components so some solutions need need to exist that would allow us to have a similar style of API but be able to use it with react server components and so when you look at the code it looks very familiar it looks like styled components or like emotion uh but ultimately one of the nice things about it is it actually can run on the server side if you start from emotion which I think a good Che of the commity is at you effectively have two possible direction to take you can either go into the CSS modules or the 10 win CSS path at the cost of a a costly migration and you have to give up on some of the properties I talked about
before so either sty cocation or granular sty loading or you can go the other direction and go with the more recent Library like Styx or P CSS and more older Lara um but then you still have these cust migrations and they usually also don't go as much as they could into like a deep bendler integration so basically with pi M you'll be able to more easily adopt it into your codebase so that way you can use it with react server components now another interesting thing that was talked about is using react native with apple Vision Pro now this isn't a new announcement uh about a year ago it was announced that you could use react native to build Vision Pro projects uh but uh it was demoed and so they talked about how you could get started with it start with this today you can create your next react native uh next apple Vision Pro uh app with react n using a single command you can scan
React Native for Apple Vision Pro
this code it will um direct you to the uh to the project repository of course it's open source we working uh in the open from the from the very very first interactions that that so uh it was interesting to see and especially if you have a Vision Pro and you want to start building with it it was interesting to see that you can use react native and if you check out this talk they show a demo of it they show what the code looks like so so it's pretty slick now something that was announced a while back from Facebook is this framework called stylex which is basically like a CSS njs Library uh but from The Meta team and uh an interesting announcement and thing that was demoed is that stylex can now be used with react native and uh in this talk they were talking about this introduction of react strictum which basically allows you to have a react native code base that's a bit more agnostic to react native so that the same code can run in both the web and on
React Strict DOM
Native and so react native Dom is kind of like shimming all of the apis that you're used to from the web and just bringing them to react native and it's built on two pillars first there's a unified styling model powered by stylex if you don't know we open source stylex back in December it started off as an an API inspired by stylesheet from react native and we took it to the web and we added all the features that you need on the web such as media queries and pseudo classes it turns out that the web has more constraints we need to server render we need more declarative apis on the web and now we're bringing that back to react native so you'll be able to use media queries and pseudo classes and you won't have to run write a whole bunch of custom JavaScript code to do that so basically you can use the same Styx code in both react and also in in react native and another thing that was talked
about is this idea of being able to use elements within react native that traditionally you would only be able to use on the web so if you're familiar with react native you can't use a div or an H1 or any of these HTML elements that you're used to because it needs to be rendered on Native devices and those elements don't exist there but with the introduction introduction of react strict they basically provide those elements for you so that way you could take the same code base and render it both on the web and on Native on the other hand we have a unified markup model so divs spans image tags they're coming to react native now they're not rendering web Primitives they're still going to render the native Primitives behind the scenes but you don't have to learn a whole new API to do the same UI development so with all of this uh basically there there are some Trends over all of the things that were announced and the things that were talked about with day one and day two of react comp there's definitely a push towards the server with react server
React Conf 2024 Trends and Takeaways
components there's a push towards more automatic optimization with the compiler and also a push towards like universal code bases where you could have a react native codebase that runs on desktop and Native and web and Vision Pro and uh I think it was summed up best on day one in Evan's talk so that's what it looks like when we take the modern state of server rendering and Ai and bring them universally to every single platform seamlessly gliding between server and client in a fully typed file-based framework we only have to configure apis for a single platform which is the server and it works uh you know better than ever before to build things that work across different platforms waterfalls and parallel requests are all handled for us automatically because this isn't just some random server rendering system I stood up for Native this is react server components running on Native it's like the best that there is right now so imagine a world where everything is react um and and obviously it's not everything is react but that is definitely a theme over over the two
Write Once Run Anywhere
days all the stuff that was talked about uh basically we're reaching a point where react's running on the server it's running on the client it's running everywhere and so we're we're potentially getting closer to the dream of uh WR once Run Anywhere which was has been around for a very long time uh almost 30 years ago that that slogan was was coined by Sun Microsystems for Java um and it is an interesting thing to see I mean now these days there are so many uh Legacy and uh Legacy Java code bases that were written a long time ago because of this promise but now they need to be maintained and is that where we're headed are we I mean these days there are even some nextjs applications that are technically Legacy software that needs to be maintained um but yeah it's just an interesting historical perspective to think about like there's always been this want to go towards right once run everywhere that's kind of where react is headed is it a good thing is it a bad thing I don't know we'll see but one thing I know is if you're writing react code you're probably running into bugs and for that we have centry so if you haven't heard of centry
Sentry Runs Everywhere
it is error monitoring software and a whole lot more basically you can add it into your codebase and then anytime an error happens in production you can get alerted of that error it groups those errors together so you can see how often they're happening when and where they're happening and there's a whole lot more that it can do as well including performance monitoring and profiling session replay you can see exactly what a user was doing whenever they came across a specific error uh they also have uh custom alerting there's just a ton you can do and no matter where your crappy react code is running Sentry supports it so if you're just running like react with create react app or vit they have a plugin you simply just call cry. init it instruments your whole codebase and now you have error monitoring they also have a plug-in for nextjs you can run this command from the command line you'll answer a few questions boom your nextjs app is instrumented as well they also support remix uh they also support react native there are some docs in the Expo dos that talk about how to integrate Century as well um so yeah wherever your your react
code is running you can use sry and I won't just dog on react you can write crappy code in any language and centry supports it so uh no matter where your code is running cry has an SDK that you can use to report errors so definitely check it out if you visit sentry.io syntax you can get your first two months free if you use code tasty treat so definitely check it out all right that's all I have for you in this video hopefully you enjoyed this recap I'd love to know is there anything that I didn't talk about that was announced at react comp either day one or two let me know know down in the comments and also if there's anything you're excited about for react if there's anything you're excited about that I mentioned let me know down in the comments I'd love to hear from you and I'll see you in the next one
Thanks!
Quote it with credit and a link. Quoting Syntax