They made React great again?

Fireship · Intermediate ·🌐 Frontend Engineering ·2y ago

Key Takeaways

The video discusses the new features and improvements in React 19, including a compiler, simplified code, and improved developer experience, as well as comparisons to other JavaScript frameworks like Svelte, Vue, and Angular.

Full Transcript

a few days ago a shocking new blog post from the reactjs team dropped as a react hater I hate to say it but they fixed react I tried to let the hate flow through me but the react team made some brilliant moves that will dramatically improve the developer experience just when you thought react had become the new jQuery and the JavaScript framework wars were coming to an end the react team has Unleashed their secret weapon a compiler and in today's video we'll find out what that word means it is February 26 2024 and you're watching the code report speaking of jQuery one thing that you may have missed is that after nearly a decade of anticipation jQuery just announced version 4.0 it got rid of a bunch of stuff made obsolete by the JavaScript language itself dropped ie1 support and migrated to es modules most frontend developers nowadays are too smug and arrogant to use jQuery but this is great news for the millions of websites out there that still use it the big news though is that reactjs is getting a compiler meta is already using this compiler in production to power Instagram and will likely bring solid performance improvements but most importantly it will simplify the code we write as developers Developers L react code is pretty ridiculous compared to Frameworks like view felt and solid like imagine we have some state that needs to be computed into another value we can do it like this in react but that value will be unnecessarily recomputed every time the component reeners it's inefficient to address this react provides a hook called use memo memo means memoization which itself means remember it wraps the computation in another function which will only run when the state that it's dependent on changes which has to be explicitly put in this array if we look at all the other Frameworks though they don't do stuff like this like in view we have this computed function but there's no need to include that dependency array and in spell 3 it's even more simple with the dollar sign syntax although it's being replaced with a rune in spel 5 the reason these Frameworks can let you write more simplified code is because they have a compiler unlike react which is purely runtime based they look at your code in advance to figure out where the reactivity is and bundle that into the final product that goes to the browser but now that react is getting its own compiler it means hooks like use memo and use callback are a thing of the past and that's huge because not only is the code ugly as as hell but it also removes the mental boiler plate of asking the question to memoize or not to memoize and they confirmed my conspiracy theory that react intentionally adds bad apis like this just to look like Geniuses when they remove them later on but use memo is not the only bad feature going away another thing you won't need in the future is forward ref which creates a higher order component when you need to expose a Dom node to the parent instead ref will just be a prop so you can easily access it without having to wrap another function that's an easy win but a more controversial feature is server actions you can already use actions in nextjs and many have described the developer experience as being like PHP but without Lambos the general idea though is that react handles the data submission cycle for you from client to server and then back again what's cool about this is react provides hooks like use form status or use form state to easily handle the data in a form but then alongside that you have hooks like use optimistic to get that Ultra fast Firebase like feel on any backend database the UI updates instantly based on the expected change then in the rare case it fails it reverts back but another thing that sucks about react is working with promises in react server components like in nextjs you can use async await to fetch data directly in a component that's awesome but you can't do it in a client side component and you still can't in react 19 but you can use the use hook which is the next best thing it works on both promises and react context which means it makes the Ed context hook obsolete because unlike used context use can also be used inside of loops and conditionals but using use allows you to use the value of a resolved promise directly in the UI now a promis is asynchronous and its value is initially pending so you can handle the loading state by wrapping it in a suspense boundary and it might also reject and throw an error in which case you can wrap it in an error boundary I don't really love this code myself but it's way better than the common approach of resolving a promise with the use effect hook bottom line is that these are some huge improvements for react what's funny though is that if we take a step back all the major Frameworks are starting to look identical and have all copied each other's abstractions leading to nearly identical apis just with things named slightly different as a civilized society it's about time we decide on the one true framework then we build that framework into the browser to put an end to this Bloodshed once and for all this has been the code report thanks for watching and I will see you in the next JS one

Original Description

Let's take a first look at React 19 and a variety of changes will improve the developer experience. We compare React's changes to other JavaScript frameworks like Svelte, Vue, and Angular. #webdevelopment #programming #thecodereport 💬 Chat with Me on Discord https://discord.gg/fireship 🔗 Resources React Blog Post https://react.dev/blog/2024/02/15/react-labs-what-we-have-been-working-on-february-2024 React for the Haters https://youtu.be/HyWYpM_S-2c Fireship Next.JS course https://fireship.io/courses/nextjs/ 🔥 Get More Content - Upgrade to PRO Upgrade at https://fireship.io/pro Use code YT25 for 25% off PRO access 🎨 My Editor Settings - Atom One Dark - vscode-icons - Fira Code Font 🔖 Topics Covered - What's new in react version 19 - React vs Vue - React vs Svelte - React 19 compiler
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Fireship · Fireship · 0 of 60

← Previous Next →
1 Angular 4 Development and Production Environments with Firebase
Angular 4 Development and Production Environments with Firebase
Fireship
2 OAuth with Angular and Firebase Tutorial
OAuth with Angular and Firebase Tutorial
Fireship
3 Anonymous Authentication with Angular and Firebase - Lazy Registration
Anonymous Authentication with Angular and Firebase - Lazy Registration
Fireship
4 Angular Router Guards for Firebase Users
Angular Router Guards for Firebase Users
Fireship
5 Angular Firebase CRUD App with NoSQL Database Tutorial
Angular Firebase CRUD App with NoSQL Database Tutorial
Fireship
6 Upload Files from Angular to Firebase Storage
Upload Files from Angular to Firebase Storage
Fireship
7 How to Deploy an Angular App to Firebase Hosting
How to Deploy an Angular App to Firebase Hosting
Fireship
8 Sharing Data between Components in Angular
Sharing Data between Components in Angular
Fireship
9 Loading Spinners for Asynchronous Firebase Data
Loading Spinners for Asynchronous Firebase Data
Fireship
10 Angular 4 Transactional Email with Google Firebase Cloud Functions
Angular 4 Transactional Email with Google Firebase Cloud Functions
Fireship
11 Firebase Database Rules Tutorial
Firebase Database Rules Tutorial
Fireship
12 Autocomplete Search with Angular4 and Firebase
Autocomplete Search with Angular4 and Firebase
Fireship
13 Reddit Inspired Upvoting System with Angular and Firebase NoSQL
Reddit Inspired Upvoting System with Angular and Firebase NoSQL
Fireship
14 Angular Drag-and-Drop File Uploads to Firebase Storage
Angular Drag-and-Drop File Uploads to Firebase Storage
Fireship
15 Text Translation with Firebase Cloud Functions onWrite and Angular 4
Text Translation with Firebase Cloud Functions onWrite and Angular 4
Fireship
16 Custom Usernames with Firebase Authentication
Custom Usernames with Firebase Authentication
Fireship
17 Twitter-Inspired Follow Unfollow Feature with Firebase and Angular 4
Twitter-Inspired Follow Unfollow Feature with Firebase and Angular 4
Fireship
18 Simple Pagination with Firebase and Angular 4
Simple Pagination with Firebase and Angular 4
Fireship
19 How to Connect Firebase Users to their Data - 3 Methods
How to Connect Firebase Users to their Data - 3 Methods
Fireship
20 Add Toast Message Notifications to your Angular App
Add Toast Message Notifications to your Angular App
Fireship
21 Facebook-Inspired Reactions System with Angular and Firebase
Facebook-Inspired Reactions System with Angular and Firebase
Fireship
22 Learn NgModule in Angular with Examples
Learn NgModule in Angular with Examples
Fireship
23 Lazy Loading Components in Angular 4
Lazy Loading Components in Angular 4
Fireship
24 Stripe Checkout Payments with Angular and Firebase - Part 1
Stripe Checkout Payments with Angular and Firebase - Part 1
Fireship
25 Process Stripe Payments with Firebase Cloud Functions - Part 2
Process Stripe Payments with Firebase Cloud Functions - Part 2
Fireship
26 Selling Digital Content in Angular with Stripe Payments - Part 3
Selling Digital Content in Angular with Stripe Payments - Part 3
Fireship
27 Angular 4 Full Text Search with Algolia - Part 1
Angular 4 Full Text Search with Algolia - Part 1
Fireship
28 Algolia with Firebase Cloud Functions - Part 2
Algolia with Firebase Cloud Functions - Part 2
Fireship
29 Firebase Phone Authentication in Angular 4
Firebase Phone Authentication in Angular 4
Fireship
30 Top 7 RxJS Concepts for Angular Developers
Top 7 RxJS Concepts for Angular Developers
Fireship
31 Learn Angular Animations with 5 Examples
Learn Angular Animations with 5 Examples
Fireship
32 Advanced Firebase Data Filtering (Multi-Property)
Advanced Firebase Data Filtering (Multi-Property)
Fireship
33 Realtime Maps with Mapbox + Firebase + Angular
Realtime Maps with Mapbox + Firebase + Angular
Fireship
34 Angular Reactive Forms with Firebase Database Backend
Angular Reactive Forms with Firebase Database Backend
Fireship
35 Send Push Notifications in Angular with Firebase Cloud Messaging
Send Push Notifications in Angular with Firebase Cloud Messaging
Fireship
36 Top 7 Ways to Debug Angular 4 Apps
Top 7 Ways to Debug Angular 4 Apps
Fireship
37 Infinite Scroll with Angular and Firebase
Infinite Scroll with Angular and Firebase
Fireship
38 Use TypeScript with Firebase Cloud Functions
Use TypeScript with Firebase Cloud Functions
Fireship
39 Realtime Graphs and Charts with Plotly and Firebase
Realtime Graphs and Charts with Plotly and Firebase
Fireship
40 Role-Based User Permissions in Firebase
Role-Based User Permissions in Firebase
Fireship
41 User Presence System in Realtime - Online, Offline, Away
User Presence System in Realtime - Online, Offline, Away
Fireship
42 Location-based Queries with GeoFire and Angular Google Maps
Location-based Queries with GeoFire and Angular Google Maps
Fireship
43 Angular ngrx Redux Quick Start Tutorial
Angular ngrx Redux Quick Start Tutorial
Fireship
44 Angular Ngrx Effects with Firebase Database
Angular Ngrx Effects with Firebase Database
Fireship
45 Progressive Web Apps with Angular
Progressive Web Apps with Angular
Fireship
46 Angular Ngrx with Firebase Google OAuth User Authentication
Angular Ngrx with Firebase Google OAuth User Authentication
Fireship
47 RxJS Quick Start with Practical Examples
RxJS Quick Start with Practical Examples
Fireship
48 Send SMS Text Messages with Twilio and Firebase
Send SMS Text Messages with Twilio and Firebase
Fireship
49 Firebase Database Performance Profiling
Firebase Database Performance Profiling
Fireship
50 Native Desktop Apps with Angular and Electron
Native Desktop Apps with Angular and Electron
Fireship
51 Subscription Payments with Stripe, Angular, and Firebase
Subscription Payments with Stripe, Angular, and Firebase
Fireship
52 Firestore with AngularFire5 Quick Start Tutorial
Firestore with AngularFire5 Quick Start Tutorial
Fireship
53 Angular HTTP Client Quick Start Tutorial
Angular HTTP Client Quick Start Tutorial
Fireship
54 Google Sign-In with Firestore Custom User Data
Google Sign-In with Firestore Custom User Data
Fireship
55 Star Review System from Scratch with Firestore + Angular
Star Review System from Scratch with Firestore + Angular
Fireship
56 Angular Chatbot with Dialogflow (API.ai)
Angular Chatbot with Dialogflow (API.ai)
Fireship
57 Learn @ngrx/entity and Feature Modules
Learn @ngrx/entity and Feature Modules
Fireship
58 Infinite Scroll Pagination with Firestore
Infinite Scroll Pagination with Firestore
Fireship
59 Faster Firestore via Data Aggregation
Faster Firestore via Data Aggregation
Fireship
60 Contentful - CMS for Angular Progressive Web Apps
Contentful - CMS for Angular Progressive Web Apps
Fireship

The video discusses the new features and improvements in React 19, including a compiler, simplified code, and improved developer experience. It also compares React to other JavaScript frameworks like Svelte, Vue, and Angular.

Key Takeaways
  1. Learn about the new compiler in React 19
  2. Understand how the compiler simplifies code
  3. Compare React to other JavaScript frameworks
  4. Use the new features in React 19 to improve developer experience
  5. Simplify code using the compiler and new hooks
  6. Use async await and promises effectively in React
💡 The new compiler in React 19 simplifies code and improves developer experience, making it more competitive with other JavaScript frameworks.

Related Reads

Up next
How To Build A Twitter Clone - React Next JS - Appwrite Crash Course
Adrian Twarog
Watch →