Serverless for React Developers

Rate this content
Bookmark

Intro to serverless

Prior Art: Docker, Containers, and Kubernetes

Activity: Build a Dockerized application and deploy it to a cloud provider

Analysis: What is good/bad about this approach?

Why Serverless is Needed/Better

Activity: Build the same application with serverless

Analysis: What is good/bad about this approach?

This workshop has been presented at React Summit 2022, check out the latest edition of this React Conference.

FAQ

Serverless computing refers to a cloud computing execution model where the cloud provider runs the server and dynamically manages the allocation of machine resources. The pricing is based on the actual amount of resources consumed by an application, rather than on pre-purchased units of capacity.

Zada is a serverless database that focuses on developer experience, offering a UI with TypeScript client, a playground, and a Visual Studio Code extension. It provides features like full search capabilities, branching for safe database changes, and a globally distributed network.

ISR allows you to update static content after the initial build step on a per-page basis. This means your static pages can be updated without needing to rebuild the whole site, providing faster performance and better SEO while still serving dynamic content.

The 'revalidate' option in ISR specifies the number of seconds after which a page re-generation can occur. Setting it to 'true' or '1' means the page will be revalidated after every request, ensuring users always receive the most up-to-date content.

Edge Functions are similar to traditional serverless functions but are executed closer to the user by running on a globally distributed network. This reduces latency because the functions are run on servers geographically nearer to the end user compared to centralized server locations.

Branching in Zada allows developers to make changes to a database in a safe, isolated environment. This feature lets you create, test, and merge changes without affecting the main database, ensuring that your production environment remains stable.

SSG offers improved load times and better SEO since the pages are pre-rendered at build time. However, it lacks real-time data fetching capabilities, which SSR provides by rendering pages on each request, allowing for dynamic content updates.

Tejas Kumar
Tejas Kumar
107 min
04 Jul, 2022

Comments

Sign in or register to post your comment.
Video Summary and Transcription
The Workshop focuses on building an open-source project using serverless technologies and React. It covers various topics such as choosing serverless approaches, debugging serverless code, working with databases, and creating a data model. The workshop also explores deploying React apps to a serverless setup, server-side rendering, and static site generation. It discusses the benefits of serverless, the use of Zada as a serverless database, and the concept of edge functions. Overall, the workshop provides a comprehensive overview of working with serverless and React for modern front-end development.

1. Introduction to Serverless and React

Short description:

The plan is to build an open source project in this workshop. Serverless is named as it is because, as a developer, you never touch a server. Instead, you interact with an API. React and serverless are both abstractions that simplify complexity. You can model servers without actually having to deal with them.

I would like to start with... so just an overview for you, the plan is to build a project, an open source project. This project is not going to benefit me or my company in any way. It's just to learn together. And it's a workshop.

By workshop, I mean we're working, but we're doing interactive shit. It's not like a three-hour-long talk where you turn off your video and fall asleep and then come back at the end to say, wow, great job. Meaning it's misnamed. It's a lie, is what Wikimedia says. And the presumption there is it's a lie because there's actually servers.

So it's not server-less. But really, serverless is named as it is because to you as a developer, it is serverless. You're not the one managing the servers. You're not maintaining the servers. You're not scaling the servers. You're not implementing strategies for failover for the servers. So for the developer, it is serverless in that you never touch a server. Instead, what do you touch? You touch an API. Literally an API, an application platform interface, an interface into someone else's server. That is it.

How does it connect to React? React is a level of abstraction on the imperative browser DOM, the document object model. Like React is just a bunch of functions that have state that map to elements in your browser. Serverless is similar because serverless is nothing more than abstraction. The servers and their complexity are abstracted away. You could put React as JSX in JavaScript to model the DOM. There's ways you can also model servers without actually having to deal with them.

2. Choosing Serverless Approach

Short description:

You can choose your own adventure in this workshop. There are two ways to approach serverless: looking at it under the hood and building servers, or using existing serverless solutions in a React app. The latter option focuses more on React and provides transferable skills for modern front-end development. Pick your choice by writing one or two in the chat.

Excellent. From what you wanted to learn, I received that, Matt. You mentioned you wanted to learn strategies and recipes and cookbooks on building with serverless. I think that's really helpful. Because I wanted to do this workshop in a way where you can choose your own adventure. And there's usually two ways this can go. I'm gonna need you to pay attention here. Because this will literally affect the entire workshop. You get a very different workshop if you fuck this up. It can either be... We look at serverless under the hood. So we build, maintain, provision, scale servers. And so we kind of understand serverless from that way by actually creating servers and doing the work that AWS would do. Or we use existing serverless solutions and compose them together in a React app. The latter is definitely more React-focused, less like backend infrastructure-focused. And will actually give you, I think, in my opinion, more transferable-slash-useful skills in the modern front-end React world. Because how people build apps today is, for example, if you're building a React app, you'd probably connect to Auth0 for authentication. You'd use some type of serverless database, like Zada. You'd compose different serverless providers. And then have your React app also server render or serverless render in its own way. So there's rendering strategies and things that React can talk about that would help you more meaningfully. The other one is more information that you learn about how things work. But you probably will never use professionally because there's people who work at AWS that's their full-time job, okay? So if that's clear, pick your own adventure by writing in the chat one for the serverless behind the scenes and two for composing serverless things in React.

QnA

Watch more workshops on topic

React, TypeScript, and TDD
React Advanced 2021React Advanced 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 2021React Advanced 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.
AI on Demand: Serverless AI
DevOps.js Conf 2024DevOps.js Conf 2024
163 min
AI on Demand: Serverless AI
Top Content
Featured WorkshopFree
Nathan Disidore
Nathan Disidore
In this workshop, we discuss the merits of serverless architecture and how it can be applied to the AI space. We'll explore options around building serverless RAG applications for a more lambda-esque approach to AI. Next, we'll get hands on and build a sample CRUD app that allows you to store information and query it using an LLM with Workers AI, Vectorize, D1, and Cloudflare Workers.
Remix Fundamentals
React Summit 2022React Summit 2022
136 min
Remix Fundamentals
Top Content
Featured WorkshopFree
Kent C. Dodds
Kent C. Dodds
Building modern web applications is riddled with complexity And that's only if you bother to deal with the problems
Tired of wiring up onSubmit to backend APIs and making sure your client-side cache stays up-to-date? Wouldn't it be cool to be able to use the global nature of CSS to your benefit, rather than find tools or conventions to avoid or work around it? And how would you like nested layouts with intelligent and performance optimized data management that just works™?
Remix solves some of these problems, and completely eliminates the rest. You don't even have to think about server cache management or global CSS namespace clashes. It's not that Remix has APIs to avoid these problems, they simply don't exist when you're using Remix. Oh, and you don't need that huge complex graphql client when you're using Remix. They've got you covered. Ready to build faster apps faster?
At the end of this workshop, you'll know how to:- Create Remix Routes- Style Remix applications- Load data in Remix loaders- Mutate data with forms and actions
Vue3: Modern Frontend App Development
Vue.js London Live 2021Vue.js London Live 2021
169 min
Vue3: Modern Frontend App Development
Top Content
Featured WorkshopFree
Mikhail Kuznetsov
Mikhail Kuznetsov
The Vue3 has been released in mid-2020. Besides many improvements and optimizations, the main feature of Vue3 brings is the Composition API – a new way to write and reuse reactive code. Let's learn more about how to use Composition API efficiently.

Besides core Vue3 features we'll explain examples of how to use popular libraries with Vue3.

Table of contents:
- Introduction to Vue3
- Composition API
- Core libraries
- Vue3 ecosystem

Prerequisites:
IDE of choice (Inellij or VSC) installed
Nodejs + NPM
Developing Dynamic Blogs with SvelteKit & Storyblok: A Hands-on Workshop
JSNation 2023JSNation 2023
174 min
Developing Dynamic Blogs with SvelteKit & Storyblok: A Hands-on Workshop
Top Content
Featured WorkshopFree
Alba Silvente Fuentes
Roberto Butti
2 authors
This SvelteKit workshop explores the integration of 3rd party services, such as Storyblok, in a SvelteKit project. Participants will learn how to create a SvelteKit project, leverage Svelte components, and connect to external APIs. The workshop covers important concepts including SSR, CSR, static site generation, and deploying the application using adapters. By the end of the workshop, attendees will have a solid understanding of building SvelteKit applications with API integrations and be prepared for deployment.

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

Don't Solve Problems, Eliminate Them
React Advanced 2021React Advanced 2021
39 min
Don't Solve Problems, Eliminate Them
Top Content
Kent C. Dodds discusses the concept of problem elimination rather than just problem-solving. He introduces the idea of a problem tree and the importance of avoiding creating solutions prematurely. Kent uses examples like Tesla's electric engine and Remix framework to illustrate the benefits of problem elimination. He emphasizes the value of trade-offs and taking the easier path, as well as the need to constantly re-evaluate and change approaches to eliminate problems.
Understanding React’s Fiber Architecture
React Advanced 2022React Advanced 2022
29 min
Understanding React’s Fiber Architecture
Top Content
This Talk explores React's internal jargon, specifically fiber, which is an internal unit of work for rendering and committing. Fibers facilitate efficient updates to elements and play a crucial role in the reconciliation process. The work loop, complete work, and commit phase are essential steps in the rendering process. Understanding React's internals can help with optimizing code and pull request reviews. React 18 introduces the work loop sync and async functions for concurrent features and prioritization. Fiber brings benefits like async rendering and the ability to discard work-in-progress trees, improving user experience.
Jotai Atoms Are Just Functions
React Day Berlin 2022React Day Berlin 2022
22 min
Jotai Atoms Are Just Functions
Top Content
State management in React is a highly discussed topic with many libraries and solutions. Jotai is a new library based on atoms, which represent pieces of state. Atoms in Jotai are used to define state without holding values and can be used for global, semi-global, or local states. Jotai atoms are reusable definitions that are independent from React and can be used without React in an experimental library called Jotajsx.
Debugging JS
React Summit 2023React Summit 2023
24 min
Debugging JS
Top Content
Watch video: Debugging JS
Debugging JavaScript is a crucial skill that is often overlooked in the industry. It is important to understand the problem, reproduce the issue, and identify the root cause. Having a variety of debugging tools and techniques, such as console methods and graphical debuggers, is beneficial. Replay is a time-traveling debugger for JavaScript that allows users to record and inspect bugs. It works with Redux, plain React, and even minified code with the help of source maps.
The Epic Stack
React Summit US 2023React Summit US 2023
21 min
The Epic Stack
Top Content
Watch video: The Epic Stack
This Talk introduces the Epic Stack, a project starter and reference for modern web development. It emphasizes that the choice of tools is not as important as we think and that any tool can be fine. The Epic Stack aims to provide a limited set of services and common use cases, with a focus on adaptability and ease of swapping out tools. It incorporates technologies like Remix, React, Fly to I.O, Grafana, and Sentry. The Epic Web Dev offers free materials and workshops to gain a solid understanding of the Epic Stack.
Fighting Technical Debt With Continuous Refactoring
React Day Berlin 2022React Day Berlin 2022
29 min
Fighting Technical Debt With Continuous Refactoring
Top Content
Watch video: Fighting Technical Debt With Continuous Refactoring
This Talk discusses the importance of refactoring in software development and engineering. It introduces a framework called the three pillars of refactoring: practices, inventory, and process. The Talk emphasizes the need for clear practices, understanding of technical debt, and a well-defined process for successful refactoring. It also highlights the importance of visibility, reward, and resilience in the refactoring process. The Talk concludes by discussing the role of ownership, management, and prioritization in managing technical debt and refactoring efforts.