How Blitz.js Makes Fullstack Web Development a Breeze

Rate this content
Bookmark

Blitz was created as a full-stack React framework, inspired by Ruby on Rails, and with a goal to make you as productive as possible! It features a “”Zero-API”" data layer abstraction, has authn & authz out of the box and a few more exciting features. However, we recently decided to pivot Blitz to a framework agnostic toolkit, which means a huge and thrilling change for the Blitz community. During this talk, I will introduce the core concepts, talk about the why & how of the pivot, and give you a glimpse of Blitz’s future.

This talk has been presented at JSNation 2022, check out the latest edition of this JavaScript Conference.

FAQ

Bleach.js was created by Brandon in February 2020 with significant contributions from the community.

The Bleach.js framework includes features like authentication and authorization, Prisma setup, React Query, utilities for data parsing with Zot, an API layer that eliminates the need for using Fetch API, and code scaffolding.

Bleach 2.0 introduced a more modular approach with Blitz core, framework adapters, enhanced authentication features, configurable session storage, and a plugin for the ZeroAPI layer.

Developers can start a new project by running the command 'Blitz new' followed by the project name, which sets up the project with necessary configurations and initializes the database.

Developers can find documentation for the new toolkit of Bleach.js on the website canary.blitz.js.com.

Future enhancements for the Bleach.js toolkit may include handling web sockets, job queues, mailers integration, billing systems, possibly a GraphQL data layer, and improved support for mobile app development.

The decision to fork Next.js was made to increase flexibility and allow for the integration of specific Bleach.js features directly into the Next.js codebase.

The main goal of Bleach.js is to make full-stack web development as enjoyable and productive as possible, aiming to provide the best developer experience in the world.

Aleksandra Sikora
Aleksandra Sikora
8 min
20 Jun, 2022

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Bleach.js is a toolkit designed to make full-stack web development enjoyable. It is built on top of Next.js and includes features like authentication, authorization, Prisma setup, React Query, utilities, recipes, and code scaffolding. The upcoming version, Blitz 2.0, is being worked on. Blitz.js toolkit expands on the core framework with additional features like web sockets, scheduled jobs, mailers integration, and better mobile app support. Visit canary.blitz.js.com for documentation on the new toolkit and blitz.js.com for framework documentation.

1. Introduction to Bleach.js

Short description:

I'm going to talk today about Bleach.js and how it's making full-stack web development a breeze. The main purpose of Bleach.js was to make full-stack web development as enjoyable as possible. We decided to have a toolkit instead of a framework, so you can use a framework of your choice and some or all of the Bleach.js features. The core of the framework was Next.js, with authentication, authorization, Prisma setup, React Query, utilities, recipes, and code scaffolding. Blitz 2.0 is the next version we're working on.

Hi, thank you everyone for joining. I'm going to talk today about Bleach.js and how it's making full-stack web development a breeze. I'm Aleksandra, the late Bleach.js maintainer. You can find me on Twitter, as Aleksandra says, so if you have any questions after the talk, don't hesitate to send me a message.

I'm going to talk about three things today. What's the Bleach.js goal? Why was it created in the first place? Then I'm going to talk about the Bleach.js framework and the future of Bleach.

So what are the goals? So the main purpose of Bleach.js was to make full-stack web development as enjoyable as possible. We wanted to give you the best developer experience in the world and make you as productive as possible. So with these goals in mind, let's see how do we achieve them. We're going to start with a timeline, like what was happening during the Bleach.js development, how it started, and where it's going. So in February 2020, Bleach.js was created by Brandon with a huge help of the community. Then over the next few months, we got like tons of positive feedback, like people loved it, people said that it's making them like really productive. And it also reached 11,000 GitHub stars. Last year, in 2021, we decided to fork Next.js because we wanted to be more flexible and hook some Bleach.js code into the Next.js code. Unfortunately, we weren't able to move as fast as we wanted, and the weekly downloads kind of started to decline. So then we started thinking like, what can we do about it? How can we bring Bleach.js to even more people? And how can we move faster than we did before? That's when we decided to, instead of having a framework, we can have like a toolkit. And instead of having you decide whether to use Bleach.js or Next or Bleach.js or Remix, you can use a framework of your choice and some or all of the Bleach.js features. We started working on that early this year and in April, during React Miami. Brandon for the first time announced the Bleach 2.0 alpha.

So let's talk for a bit about the framework, how it looked like. So the core of the framework was Next.js and then we had like authentication and authorization building. We had Prisma set up, React Query, some utilities, like for example, to parse your data with Zot, we had recipes, the 0 API layer, which eliminates the need for using Fetch API. You can import your server code directly to your front-end components. We had code scaffolding and we had like the App Code so you can run blitz new and the new app is generated for you. This is how it looks like. You can run Blitz new, my new app, and then we initialized the new project, we initialize the database, and you can start developing. This is how it looks like just after the new command. You have a new project, you have the authentication and authorization already there. You can sign up and then log in and start using your application.

So now let's see how the Blitz 2.0 is gonna look like.

2. Overview of Blitz.js Toolkit

Short description:

Blitz core includes CLI, n-variables loading, plugins, middlewares, code scaffolding, and more. Blitz.js.next provides GSP and GSSP functions for git static probes and server side probes. Auf offers authentication, authorization, passport adapter, and ZeroAPI plugin. The toolkit includes all framework features and adds possibilities like web sockets, scheduled jobs, mailers integration, and better mobile app support. Visit canary.blitz.js.com for new toolkit documentation and blitz.js.com for the framework documentation.

So, firstly, we have Blitz core. It's gonna have CLI, n-variables loading, plugins, middlewares. This is where recipes and some utilities are gonna be. And we'll also have code scaffolding there.

Then we have a framework adapter Blitz.js.next, which is going to export GSP and GSSP functions that you can use to wrap your git static probes and git server side probes in your pages. And it will also have a wrapper for API routes to be able to use Blitz features inside of your API handler's code.

Then we have Auf, which has the same authentication and authorization that Blitz framework had. It also has a passport adapter for third party authentication and configurable session storage. We also have the plugin for ZeroAPI layer. You can configure your query client. It exports React-like functions like useQuery and useMutation that you can use for Blitz.js resolvers.

So you can start with installing the Alpha version and then running Blitz new. This is the server setup. So in Blitz server TS, you declare what plugins you want to use. In this example, I'm using Alpha server plugin. On the client, you do almost the same. You declare what plugins you want to use on the client. So in the example on the screen, you can see that there is Alpha plugin and Blitz RPC plugin.

Okay, so we saw how this setup looks like. So let's compare the Blitz framework and the new toolkit. So all of the features that were there in the framework are also going to be in the toolkit, which is your API layer, authentication, authorization, new app templates, the code scaffolding, recipes. But in the toolkit, we have like so many possibilities. And there are so many things that we can start working on. Like we can handle web sockets, like Chrome scheduled jobs, job queues, some mailers integration, billing integration, maybe even GraphQL data layer. And we can also add better support for mobile app development.

That was a quick intro into Blitz.js. If you want to know more about the toolkit, you can visit canary.blitz.js.com website. It has all the documentation for the new toolkit. And if you want to check out the old documentation for the framework, you can visit blitz.js.com. Also, you can check out our repository. It's in Blitz.js organization under Blitz. Thank you a lot.

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

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.
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.
Full Stack Documentation
JSNation 2022JSNation 2022
28 min
Full Stack Documentation
Top Content
The Talk discusses the shift to full-stack frameworks and the challenges of full-stack documentation. It highlights the power of interactive tutorials and the importance of user testing in software development. The Talk also introduces learn.svelte.dev, a platform for learning full-stack tools, and discusses the roadmap for SvelteKit and its documentation.
SolidJS: Why All the Suspense?
JSNation 2023JSNation 2023
28 min
SolidJS: Why All the Suspense?
Top Content
Suspense is a mechanism for orchestrating asynchronous state changes in JavaScript frameworks. It ensures async consistency in UIs and helps avoid trust erosion and inconsistencies. Suspense boundaries are used to hoist data fetching and create consistency zones based on the user interface. They can handle loading states of multiple resources and control state loading in applications. Suspense can be used for transitions, providing a smoother user experience and allowing prioritization of important content.
From GraphQL Zero to GraphQL Hero with RedwoodJS
GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
From GraphQL Zero to GraphQL Hero with RedwoodJS
Top Content
Tom Pressenwurter introduces Redwood.js, a full stack app framework for building GraphQL APIs easily and maintainably. He demonstrates a Redwood.js application with a React-based front end and a Node.js API. Redwood.js offers a simplified folder structure and schema for organizing the application. It provides easy data manipulation and CRUD operations through GraphQL functions. Redwood.js allows for easy implementation of new queries and directives, including authentication and limiting access to data. It is a stable and production-ready framework that integrates well with other front-end technologies.
RedwoodJS: The Full-Stack React App Framework of Your Dreams
React Summit Remote Edition 2021React Summit Remote Edition 2021
43 min
RedwoodJS: The Full-Stack React App Framework of Your Dreams
Top Content
Redwood JS is a full stack React app framework that simplifies development and testing. It uses a directory structure to organize code and provides easy data fetching with cells. Redwood eliminates boilerplate and integrates Jest and Storybook. It supports pre-rendering and provides solutions for authentication and deployment. Redwood is a cross-client framework that allows for building web and mobile applications without duplicating work.

Workshops on related topic

Building WebApps That Light Up the Internet with QwikCity
JSNation 2023JSNation 2023
170 min
Building WebApps That Light Up the Internet with QwikCity
Featured WorkshopFree
Miško Hevery
Miško Hevery
Building instant-on web applications at scale have been elusive. Real-world sites need tracking, analytics, and complex user interfaces and interactions. We always start with the best intentions but end up with a less-than-ideal site.
QwikCity is a new meta-framework that allows you to build large-scale applications with constant startup-up performance. We will look at how to build a QwikCity application and what makes it unique. The workshop will show you how to set up a QwikCitp project. How routing works with layout. The demo application will fetch data and present it to the user in an editable form. And finally, how one can use authentication. All of the basic parts for any large-scale applications.
Along the way, we will also look at what makes Qwik unique, and how resumability enables constant startup performance no matter the application complexity.
Back to the Roots With Remix
React Summit 2023React Summit 2023
106 min
Back to the Roots With Remix
Featured Workshop
Alex Korzhikov
Pavlik Kiselev
2 authors
The modern web would be different without rich client-side applications supported by powerful frameworks: React, Angular, Vue, Lit, and many others. These frameworks rely on client-side JavaScript, which is their core. However, there are other approaches to rendering. One of them (quite old, by the way) is server-side rendering entirely without JavaScript. Let's find out if this is a good idea and how Remix can help us with it?
Prerequisites- Good understanding of JavaScript or TypeScript- It would help to have experience with React, Redux, Node.js and writing FrontEnd and BackEnd applications- Preinstall Node.js, npm- We prefer to use VSCode, but also cloud IDEs such as codesandbox (other IDEs are also ok)
Let AI Be Your Docs
JSNation 2024JSNation 2024
69 min
Let AI Be Your Docs
Workshop
Jesse Hall
Jesse Hall
Join our dynamic workshop to craft an AI-powered documentation portal. Learn to integrate OpenAI's ChatGPT with Next.js 14, Tailwind CSS, and cutting-edge tech to deliver instant code solutions and summaries. This hands-on session will equip you with the knowledge to revolutionize how users interact with documentation, turning tedious searches into efficient, intelligent discovery.
Key Takeaways:
- Practical experience in creating an AI-driven documentation site.- Understanding the integration of AI into user experiences.- Hands-on skills with the latest web development technologies.- Strategies for deploying and maintaining intelligent documentation resources.
Table of contents:- Introduction to AI in Documentation- Setting Up the Environment- Building the Documentation Structure- Integrating ChatGPT for Interactive Docs
Learn Fastify One Plugin at a Time
Node Congress 2021Node Congress 2021
128 min
Learn Fastify One Plugin at a Time
Workshop
Matteo Collina
Matteo Collina
Fastify is an HTTP framework for Node.js that focuses on providing a good developer experience without compromising on performance metrics. What makes Fastify special are not its technical details, but its community which is wide open for contributions of any kind. Part of the secret sauce is Fastify plugin architecture that enabled developers to write more than a hundred plugins.This hands-on workshop is structured around a series of exercises that covers from basics "hello world", to how to structure a project, perform database access and authentication.

https://github.com/nearform/the-fastify-workshop
Build a Universal Reactive Data Library with Starbeam
JSNation 2023JSNation 2023
66 min
Build a Universal Reactive Data Library with Starbeam
WorkshopFree
Yehuda Katz
Yehuda Katz
This session will focus on Starbeam's universal building blocks. We'll use Starbeam to build a data library that works in multiple frameworks.We'll write a library that caches and updates data, and supports relationships, sorting and filtering.Rather than fetching data directly, it will work with asynchronously fetched data, including data fetched after initial render. Data fetched and updated through web sockets will also work well.All of these features will be reactive, of course.Imagine you filter your data by its title, and then you update the title of a record to match the filter: any output relying on the filtered data will update to reflect the updated filter.In 90 minutes, you'll build an awesome reactive data library and learn a powerful new tool for building reactive systems. The best part: the library works in any framework, even though you don't think about (or depend on) any framework when you built it.
Table of contents- Storing a Fetched Record in a Cell- Storing multiple records in a reactive Map- Reactive iteration is normal iteration- Reactive filtering is normal filtering- Fetching more records and updating the Map- Reactive sorting is normal sorting (is this getting a bit repetitive?)- Modelling cache invalidation as data- Bonus: reactive relationships
Build a Product Page with Shopify’s Hydrogen Framework
React Advanced 2022React Advanced 2022
81 min
Build a Product Page with Shopify’s Hydrogen Framework
WorkshopFree
David Witt
David Witt
Get hands on with Hydrogen, a React-based framework for building headless storefronts. Hydrogen is built for Shopify commerce with all the features you need for a production-ready storefront. It provides a quick start, build-fast environment so you can focus on the fun stuff - building unique commerce experiences. In this workshop we’ll scaffold a new storefront and rapidly build a product page. We’ll cover how to get started, file-based routing, fetching data from the Storefront API, Hydrogen’s built-in components and how to apply styling with Tailwind.You will know:- Get started with the hello-world template on StackBlitz- File-based routing to create a /products/example route- Dynamic routing /products/:handle- Hit the Storefront API with GraphQL- Move the query into the Hydrogen app- Update the query to fetch a product by handle- Display title, price, image & description.- Tailwind styling- Variant picker and buy now button- Bonus if there’s time: Collections page
Prerequisites: - A Chromium-based browser (StackBlitz)- Ideally experience with React. A general web development background would be fine.