Why Everybody Needs a Framework

Rate this content
Bookmark
The talk emphasizes the necessity of using frameworks in web development. It begins by highlighting how frameworks like React and React frameworks such as Next.js or ReMix can significantly improve development workflows. The speaker explains that a framework is a set of opinions that helps developers by solving common issues like server-side rendering and data fetching. The talk includes a live demo of a jokes app, showcasing server-side rendering and efficient data fetching. The speaker also discusses the importance of server components, which execute exclusively on the server. Server components can be async, enabling seamless rendering and soft navigation. The talk concludes by stressing that while not every project may need a framework, they are invaluable for large-scale applications, especially in a team environment.

From Author:

The prevalent advice on how to use React today is to use a framework: either to start with one or to incrementally adopt one. This deep-dive talk will explore why, and how to go about this with live code examples.

This talk has been presented at React Advanced Conference 2023, check out the latest edition of this React Conference.

Watch video on a separate page

FAQ

The main focus of Tejas's talk is on the importance of using frameworks in development, particularly emphasizing the benefits of using React and React frameworks like Next.js or ReMix.

According to Tejas, a framework is essentially a set of opinions that provides a structure within which developers work. It guides on aspects like routing, data fetching, and where rendering should occur, helping to accelerate development workflows by handling these concerns.

Frameworks solve several key problems including server-side rendering, client and server-side routing, and simplifying data fetching. They prevent issues like network waterfalls by managing data fetching efficiently, which enhances performance and user experience.

Tejas argues that frameworks provide a structured approach to building applications, handling routine challenges and intricacies that can bog down development if handled individually. Frameworks like React and its associated tools ensure that developers can focus on building out features rather than solving common problems repeatedly.

In his live demo, Tejas demonstrated a full-stack application using a jokes app. The demo included both frontend and backend aspects, showcasing how frameworks can manage data fetching and server-side rendering effectively.

Tejas Kumar
Tejas Kumar
39 min
20 Oct, 2023

Comments

Sign in or register to post your comment.

Video Transcription

1. Introduction to Frameworks

Short description:

Today we're here to talk about why everybody needs to use a framework. React has revolutionized the way we build on the web. Andrew Clark from the React team on Vercel posted that if you use React, you should be using a React framework. A framework is essentially a set of opinions that help you accelerate your development workflows.

Hi! How are we? OK, I'll work with it. It's the last talk of the day. You know, fun fact, I have 25 minutes. It's on 16 minutes. I have 20 minutes, right? But it's the last talk, so technically, I have all the minutes. Cause the after-party from here is at 7. But anyway, I'll try and be respectful of your time. The organizer is looking at me here like, hey, hey, now.

I'm Tejas. That's pronounced, like, contagious. I can say that now cause the lockdowns, for the most part, are over. And I've had the privilege of working in some capacity, either as a consultant or as an employee at a number of different tech companies across my career. And it's an opportunity that I'm really thankful for. And through it, I get to experience a bunch of different things, right? Today, I run a small but effective developer relations agency where we support developer tools, developer-oriented companies, communicate, get their message across, and really refine that developer experience, okay? But that's not what we're here to talk about today. Today we're here to talk about why everybody needs to use a framework. And you might be reading this and going, what does that even mean? Does everybody need to use a framework? Ideally, we clarify some of those things today. I just need to preface. I'm not... I don't work on React. I've been working with React since 2013, 2014, and I deeply love it. I have the privilege of knowing some of the team. And the work they do is inspiring and is intellectual and solves real world problems with high abstractions that just get the job done and make you, guys, the hero. So if we can hear it for the team. I would really... Yeah. Yeah. It has... I think it's an understatement to say that React has revolutionized the way we build on the web. And I think it's worth acknowledging.

So why does everybody need to use a framework? Where does this even come from? Earlier on X, the platform formerly known as Twitter, Andrew Clark from the React team on Vercel posted this in January. He said, if you use React, you should be using a React framework. If your existing app doesn't use a framework, you should incrementally migrate to one. If you're creating a new React project, you should use a framework from the beginning. Some of you might be thinking, but isn't React a framework? Is React a library or framework? We're not doing that today. Let's go on social media and fight. No. But React by framework, what Andrew is referring to is something like Next.js or ReMix, et cetera. And I love this. I use framework. Are any of you using frameworks here in production? Okay, almost everybody. For those of you not, let's talk about why. And this is what I want to do today. This is great, but I want to understand the mechanism that leads us to arrive at that conclusion. Like, why does one say this? And to understand the mechanism, you have to answer the question, okay, what even is a framework? And a framework is essentially a set of opinions. It's a frame within which you work, literally. It gives you opinions around routing, around data fetching, around where do you render the server or the client somewhere in between. And these opinions are handled for you so that you can, you can what? You can build your product with velocity. You don't have to solve these problems individually. So it's the opinions that help you accelerate your development workflows, okay? If we refine that a little bit, what do frameworks do? What do frameworks do? Well, a lot of them have overlap. This is maybe not every framework, but Next JS, Remix.

2. Frameworks and Demo

Short description:

They solve routing on both the client and server side. Frameworks make data fetching easier and more efficient. They also handle edge cases that we may overlook. Let's dive into a demo that showcases server-side rendering and data fetching. We'll explore a full stack application and fill a database interactively. The app is a jokes app that queries a database and renders jokes on both the client and server side. We'll walk through the code and play with the app.

They'll do server side rendering. How many of you server side rendering in production? Okay. Almost everybody who uses a framework, great. They solve routing but not just on the client side. On the server side as well. Isomorphic routing. And this is useful for a number of reasons because previously back when we were doing only client side stuff, we used to send 404's. I don't know if you all remember this. We used to send 404 status codes from the server side and then a 404 HTML page would pick up on the client side and give you an app. But this is fundamentally a lie from client to server, okay? And frameworks solve for that.

Number three, data fetching is tremendously easier with frameworks. If I ask you, where's the best place and when is the best time to fetch data in your React app? What would you tell me? Would you tell me that I use effect and I fetch inside use effect and then I set state? That's a really common pattern but that's a problematic pattern because it leads to what? It leads to, I see you, this is React Advanced. We're not in kindergarten here, right? It leads to network waterfalls. It leads to slow things. You've got to render first, that takes some time. It's CPU bound and then you've got to fetch and then you've got to render and it's not fast, it's not performant and your user experience suffers. So frameworks solve a lot of these problems for us and more. In fact, they solve all the edge cases that we probably miss because they're built by very large communities who run into problems that we may have next year today. OK.

So that's the theory of it but I'm already bored with my slides and I figure we just do a little demo for that. This is a demo that solves for those things. It solves for rendering on the server side, it solves for data fetching, etc. It's kind of interactive and it's the end of the day, let's just play. Since we're talking about server rendering and data fetching, we need a full stack application. We need a frontend, we need a backend. There's plenty of ready to go backends. If you need a quick API, there's dog.ceo where you can query a bunch of dogs. Since we're in London, I was on the search for a good backend. I happened to find a stealth London based start up that has been very quiet but has been building something really cool. I was so compelled, I had dinner with the founders last night. I was compelled let's just put it in my presentation and show you all this. I have permission for this but I want to just fill out the full stack of the stack. This is the application we have, so if we go to the browser, if we go to the code, OK. So it's a jokes app. It says no jokes. I don't know if you can read that, it's intentionally small but it's essentially going to query a database where jokes live and render them. Client side first, then server side and we'll do that together. But we need to fill this database somehow. Let me walk you through the code a little bit and then we'll fill it interactively. OK. It's the end of the day so let's play a bit. If we look at the code, what do we have? We have a React app here. Is that font size OK? Can you see in the back? Nobody cares? Great. OK. Let's... Boom! There we go. So, very basic React app. We're hydrating the document with a layout and if we have a joke ID, it's an answer, otherwise it's a question. It's a question answer type of joke, right? Like why did the chicken cross the road? Because there was hydration, I don't know. Whatever.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

A Guide to React Rendering Behavior
React Advanced Conference 2022React Advanced Conference 2022
25 min
A Guide to React Rendering Behavior
Top Content
This transcription provides a brief guide to React rendering behavior. It explains the process of rendering, comparing new and old elements, and the importance of pure rendering without side effects. It also covers topics such as batching and double rendering, optimizing rendering and using context and Redux in React. Overall, it offers valuable insights for developers looking to understand and optimize React rendering.
Building Better Websites with Remix
React Summit Remote Edition 2021React Summit Remote Edition 2021
33 min
Building Better Websites with Remix
Top Content
Remix is a web framework built on React Router that focuses on web fundamentals, accessibility, performance, and flexibility. It delivers real HTML and SEO benefits, and allows for automatic updating of meta tags and styles. It provides features like login functionality, session management, and error handling. Remix is a server-rendered framework that can enhance sites with JavaScript but doesn't require it for basic functionality. It aims to create quality HTML-driven documents and is flexible for use with different web technologies and stacks.
Scaling Up with Remix and Micro Frontends
Remix Conf Europe 2022Remix Conf Europe 2022
23 min
Scaling Up with Remix and Micro Frontends
Top Content
This talk discusses the usage of Microfrontends in Remix and introduces the Tiny Frontend library. Kazoo, a used car buying platform, follows a domain-driven design approach and encountered issues with granular slicing. Tiny Frontend aims to solve the slicing problem and promotes type safety and compatibility of shared dependencies. The speaker demonstrates how Tiny Frontend works with server-side rendering and how Remix can consume and update components without redeploying the app. The talk also explores the usage of micro frontends and the future support for Webpack Module Federation in Remix.
React Compiler - Understanding Idiomatic React (React Forget)
React Advanced Conference 2023React Advanced Conference 2023
33 min
React Compiler - Understanding Idiomatic React (React Forget)
Top Content
Watch video: React Compiler - Understanding Idiomatic React (React Forget)
Joe Savona
Mofei Zhang
2 authors
The Talk discusses React Forget, a compiler built at Meta that aims to optimize client-side React development. It explores the use of memoization to improve performance and the vision of Forget to automatically determine dependencies at build time. Forget is named with an F-word pun and has the potential to optimize server builds and enable dead code elimination. The team plans to make Forget open-source and is focused on ensuring its quality before release.
Using useEffect Effectively
React Advanced Conference 2022React Advanced Conference 2022
30 min
Using useEffect Effectively
Top Content
Today's Talk explores the use of the useEffect hook in React development, covering topics such as fetching data, handling race conditions and cleanup, and optimizing performance. It also discusses the correct use of useEffect in React 18, the distinction between Activity Effects and Action Effects, and the potential misuse of useEffect. The Talk highlights the benefits of using useQuery or SWR for data fetching, the problems with using useEffect for initializing global singletons, and the use of state machines for handling effects. The speaker also recommends exploring the beta React docs and using tools like the stately.ai editor for visualizing state machines.
Speeding Up Your React App With Less JavaScript
React Summit 2023React Summit 2023
32 min
Speeding Up Your React App With Less JavaScript
Top Content
Watch video: Speeding Up Your React App With Less JavaScript
Mishko, the creator of Angular and AngularJS, discusses the challenges of website performance and JavaScript hydration. He explains the differences between client-side and server-side rendering and introduces Quik as a solution for efficient component hydration. Mishko demonstrates examples of state management and intercommunication using Quik. He highlights the performance benefits of using Quik with React and emphasizes the importance of reducing JavaScript size for better performance. Finally, he mentions the use of QUIC in both MPA and SPA applications for improved startup performance.

Workshops on related topic

React Performance Debugging Masterclass
React Summit 2023React Summit 2023
170 min
React Performance Debugging Masterclass
Top Content
Featured WorkshopFree
Ivan Akulov
Ivan Akulov
Ivan’s first attempts at performance debugging were chaotic. He would see a slow interaction, try a random optimization, see that it didn't help, and keep trying other optimizations until he found the right one (or gave up).
Back then, Ivan didn’t know how to use performance devtools well. He would do a recording in Chrome DevTools or React Profiler, poke around it, try clicking random things, and then close it in frustration a few minutes later. Now, Ivan knows exactly where and what to look for. And in this workshop, Ivan will teach you that too.
Here’s how this is going to work. We’ll take a slow app → debug it (using tools like Chrome DevTools, React Profiler, and why-did-you-render) → pinpoint the bottleneck → and then repeat, several times more. We won’t talk about the solutions (in 90% of the cases, it’s just the ol’ regular useMemo() or memo()). But we’ll talk about everything that comes before – and learn how to analyze any React performance problem, step by step.
(Note: This workshop is best suited for engineers who are already familiar with how useMemo() and memo() work – but want to get better at using the performance tools around React. Also, we’ll be covering interaction performance, not load speed, so you won’t hear a word about Lighthouse 🤐)
Concurrent Rendering Adventures in React 18
React Advanced Conference 2021React Advanced Conference 2021
132 min
Concurrent Rendering Adventures in React 18
Top Content
Featured WorkshopFree
Maurice de Beijer
Maurice de Beijer
With the release of React 18 we finally get the long awaited concurrent rendering. But how is that going to affect your application? What are the benefits of concurrent rendering in React? What do you need to do to switch to concurrent rendering when you upgrade to React 18? And what if you don’t want or can’t use concurrent rendering yet?

There are some behavior changes you need to be aware of! In this workshop we will cover all of those subjects and more.

Join me with your laptop in this interactive workshop. You will see how easy it is to switch to concurrent rendering in your React application. You will learn all about concurrent rendering, SuspenseList, the startTransition API and more.
React Hooks Tips Only the Pros Know
React Summit Remote Edition 2021React Summit Remote Edition 2021
177 min
React Hooks Tips Only the Pros Know
Top Content
Featured Workshop
Maurice de Beijer
Maurice de Beijer
The addition of the hooks API to React was quite a major change. Before hooks most components had to be class based. Now, with hooks, these are often much simpler functional components. Hooks can be really simple to use. Almost deceptively simple. Because there are still plenty of ways you can mess up with hooks. And it often turns out there are many ways where you can improve your components a better understanding of how each React hook can be used.You will learn all about the pros and cons of the various hooks. You will learn when to use useState() versus useReducer(). We will look at using useContext() efficiently. You will see when to use useLayoutEffect() and when useEffect() is better.
React, TypeScript, and TDD
React Advanced Conference 2021React Advanced Conference 2021
174 min
React, TypeScript, and TDD
Top Content
Featured WorkshopFree
Paul Everitt
Paul Everitt
ReactJS is wildly popular and thus wildly supported. TypeScript is increasingly popular, and thus increasingly supported.

The two together? Not as much. Given that they both change quickly, it's hard to find accurate learning materials.

React+TypeScript, with JetBrains IDEs? That three-part combination is the topic of this series. We'll show a little about a lot. Meaning, the key steps to getting productive, in the IDE, for React projects using TypeScript. Along the way we'll show test-driven development and emphasize tips-and-tricks in the IDE.
Web3 Workshop - Building Your First Dapp
React Advanced Conference 2021React Advanced Conference 2021
145 min
Web3 Workshop - Building Your First Dapp
Top Content
Featured WorkshopFree
Nader Dabit
Nader Dabit
In this workshop, you'll learn how to build your first full stack dapp on the Ethereum blockchain, reading and writing data to the network, and connecting a front end application to the contract you've deployed. By the end of the workshop, you'll understand how to set up a full stack development environment, run a local node, and interact with any smart contract using React, HardHat, and Ethers.js.
Designing Effective Tests With React Testing Library
React Summit 2023React Summit 2023
151 min
Designing Effective Tests With React Testing Library
Top Content
Featured Workshop
Josh Justice
Josh Justice
React Testing Library is a great framework for React component tests because there are a lot of questions it answers for you, so you don’t need to worry about those questions. But that doesn’t mean testing is easy. There are still a lot of questions you have to figure out for yourself: How many component tests should you write vs end-to-end tests or lower-level unit tests? How can you test a certain line of code that is tricky to test? And what in the world are you supposed to do about that persistent act() warning?
In this three-hour workshop we’ll introduce React Testing Library along with a mental model for how to think about designing your component tests. This mental model will help you see how to test each bit of logic, whether or not to mock dependencies, and will help improve the design of your components. You’ll walk away with the tools, techniques, and principles you need to implement low-cost, high-value component tests.
Table of contents- The different kinds of React application tests, and where component tests fit in- A mental model for thinking about the inputs and outputs of the components you test- Options for selecting DOM elements to verify and interact with them- The value of mocks and why they shouldn’t be avoided- The challenges with asynchrony in RTL tests and how to handle them
Prerequisites- Familiarity with building applications with React- Basic experience writing automated tests with Jest or another unit testing framework- You do not need any experience with React Testing Library- Machine setup: Node LTS, Yarn