⚡️The Fullstack React Framework — built on Next.js

Overview

Blitz.js


The Fullstack React Framework

"Zero-API" Data Layer — Built on Next.js — Inspired by Ruby on Rails

Read the Documentation


“Zero-API” data layer lets you import server code directly into your React components instead of having to manually add API endpoints and do client-side fetching and caching.

New Blitz apps come with all the boring stuff already set up for you! Like ESLint, Prettier, Jest, user sign up, log in, and password reset.

Provides helpful defaults and conventions for things like routing, file structure, and authentication while also being extremely flexible.


Quick Start

You need Node.js 12 or newer

Install Blitz

Run npm install -g blitz or yarn global add blitz

You can alternatively use npx

Create a New App

  1. blitz new myAppName
  2. cd myAppName
  3. blitz dev
  4. View your brand new app at http://localhost:3000



Bytes Newsletter



The Foundational Principles

  1. Fullstack & Monolithic
  2. API Not Required
  3. Convention over Configuration
  4. Loose Opinions
  5. Easy to Start, Easy to Scale
  6. Stability
  7. Community over Code

The Blitz Manifesto explains these principles in detail.


What is Blitz Designed For?

Blitz is designed for tiny to large database-backed applications that have one or more graphical user interfaces.

While we currently only support web, we are pursuing the dream of a single monolithic application that runs on web and mobile with maximum code sharing and minimal boilerplate.


Welcome to the Blitz Community 👋

The Blitz community is warm, safe, diverse, inclusive, and fun! LGBTQ+, women, and minorities are especially welcome. Please read our Code of Conduct.

Join our Discord Community where we help each other build Blitz apps. It's also where we collaborate on building Blitz itself.

For questions and longer form discussions, post in our forum.

There's still a lot of work to do, so you are especially invited to join us in building Blitz! A good place to start is The Contributing Guide.


Financial Contributors

Your financial contributions help ensure Blitz continues to be developed and maintained! We have monthly sponsorship options starting at $5/month.

👉 View options and contribute at GitHub Sponsors, PayPal, or Open Collective

🌱 Seedling Sponsors

🥉 Bronze Sponsors

🥈 Silver Sponsors

🏆 Gold Sponsors

💎 Diamond Sponsors


Core Team


Brandon Bayer

Creator

Maintainers (Level 2)

Code ownership, pull request approvals and merging, etc (see Maintainers L2)


Adam Markon

CLI

Robert Rosenberg

Website/Docs

Simon Knott

SuperJSON

Juan Martín Seery

Website/Docs

Maintainers (Level 1)

Issue triage, pull request triage, community encouragement and moderation, etc (see Maintainers L1)


Corey Brown

Jeremy Liberman

Jaga Santagostino

Satoshi Nitawaki

Alexandru Stratulat

Patrick Engelkes

Jamie Davenport

Myron Davis

Reo Ishiyama

Robert Malko

Contributors

Thanks to these wonderful people (emoji key):


Brandon Bayer

💻 🖋 🤔 👀 ⚠️ 📖

Rudi Yardley

💻 🤔 👀 ⚠️

Dylan Brookes

💻 🤔 👀 ⚠️ 📖

Adam Markon

💻 🤔 👀 ⚠️ 🚧

Corey Brown

💻 👀 🚧

Lori Karikari

💻 👀 🚧 📖

Elias Johansson

💻 👀 🚧

Michael Edelman

🚇 💻

Todd Geist

💵 💻

Robert Rosenberg

💻 🚧 📖

Beata Obrok

💻

Tahir Awan

💻

Camilo Gonzalez

💻

Daniel Kempner

💻

Giel

💻

Jeremy Liberman

💻 🚧 ⚠️

Jim Cummins

💻

Kristina Matuška

🎨

Jason Blalock

💻

aej11a

💻

marcoseoane

🤔

Rishabh Poddar

🤔

Lorenzo Rapetti

💻

Justin Hall

💻 📖

Sajjad Hashemian

💻

Eduardo Lopes

💻

Matthew Leffler

📖

Matt

📖

Sonny

📖

Fran Zekan

💻 📖

Jan Baykara

📖

Mike Perry Y Attara

📖

Devan

📖

Jack Clancy

💻 🚧

Nicolas Torres

⚠️ 💻 👀

Simon Knott

💻 ⚠️ 🚧 📖

Jaga Santagostino

💻 📖 🚧

João Portela

💻

Da-Jin Chu

💻

Shinobu Hayashi

💻

Karan Kiri

💻

Alan Long

📖

codingsh

💻

Rafael Nunes

👀 💻

Simon Debbarma

🎨 🚧 📖

0xflotus

💻 📖

tmns

💻 📖

Jru Harris

📖

Ivan Medina

💻 🚧

Dwight Watson

💻 📖

Horie Issei

💻

Nhat Khanh

💻

Abu Uzayr

💻

Nabiullah elham

💻

Lachlan Campbell

💻

Enzo Ferey

💻

Pierre Grimaud

💻

Andreas Adam

💻

Kevin Tovar

💻

Ante Primorac

💻 📖

Mykal Machon

💻

Jamie Davenport

💻 🚧

GaneshMani

💻

reymon359

💻

gvasquez11

💻

José Miguel Ochoa

💻

Oscar Sirvent

💻 📖

Daniel Molnar

📖 💻

Kevin Wu Won

📖

John Duong

💻

Noah Fleischmann

💻

Matsumoto Toshi

💻 📖

Simon Edelmann

💻

Shaun Church

📖 💻

Steven

📖

Sigurd Moland Wahl

💻

Brian Andrews

📖

Garrison Snelling

📖

Ty Lange-Smith

💻

Rubén Moya

💻 ⚠️

robertgrzonka

💻 🚇

Alex Orr

💻

Chris Tse

💻

Netto Farah

💻

Rohan Julka

🚇

Ivan Santos

💻

Soumyajit Pathak

💻

Sebastian Kurpiel

📖

Steffan

💻 📖 💵

Kristóf Poduszló

💻

Weilbyte

💻 📖

Ricardo Trejos

💻 📖

George Karagkiaouris

💻 📖

Brady Pascoe

💻

Jirka Svoboda

💻

Alan Alickovic

💻 📖

Yngve Høiseth

📖

Bruno Crosier

📖

Johan Schepmans

💻

Dillon Raphael

💻

Cody G

💻 ⚠️

madflow

📖

Satoshi Nitawaki

💻 🚧 💬 📖

sirmyron

📖 💻

engelkes-finstreet

📖 💻 🚧

Denis Radin

👀 💻 📖

Michael Li

💻

yuta0801

💻

Obadja Ris

📖

Jose Felix

💻

John Cantrell

💻

Kwuang Tang

💻

John Letey

💻

Juan Di Toro

💻

Taylor Johnson

💻 📖

Sriram Thiagarajan

📖

Sergio Xalambrí

📖

Patrick G

💻

अभिनाश (Avinash)

💻

Enrico Schaaf

💻

Kitze

🤔

Mohamed Shaban

💻

Joris

💻

Valentin Funk

📖

Luke Bennett

💻

Haseeb Majid

💻

Phillipp Schmedt

💻

Piotr Monwid-Olechnowicz

💻

Kotaro Chikuba

💻 ⚠️

Konrad Kalemba

💻

Alucard17

💻

Domantas Mauruča

⚠️ 💻

Stratulat Alexandru

💻 🚧

André Ericson

💻 📖

Carlos Fernández

📖

Kevin Østerkilde

📖 💻

aaronfulkerson

💻 💬

Alexandru Naiman

💻

David Ezekiel Lutta

💻

wanjuntham

💻

Victor Nahuel Chaves

💻

Peter Shih

💻

Seweryn Kalemba

💻

Nikhil Saraf

💻 📖

Zane

📖

Dulce Hernández

💻

Mark Hähnel

💻

Viktor Nemes

💻

Gabe O'Leary

📖

Lucas Machado

💻

maciek_grzybek

💻

Michael Weibel

💻

Hiroki Isogai

💻

matamatanot

📖

Eric Sakmar

📖

Simon Legg

📖

Robert Soriano

💻

Benedikt Schnatterbeck

💻

Talor Anderson

💻

Akira Baruah

💻

Christopher Wray

💻

Piotrek Tomczewski

💻

Raphaël Huchet

📖 ⚠️ 💻

Alex Johansson

💻

David Mazza

💻

Ray Andrew

💻 📖

Abdullah Mzaien

💻 📖

William Kwao

📖

Lukas Strassel

💻

Thibaut Patel

💻

Jon Stuebe

💻

Ugo Onali

📖

SaintMalik

📖

Khaled Garbaya

💻

tundera

💻

markylaing

💻 📖

Akifumi Sato

💻

Beep LIN

💻

Matt Wood

💻

Joaquin Bravo Contreras

💻

Arjun Dubey

💻

chanand

💻

phillipkregg

📖

Tim Reynolds

📖

Linbudu

📖

C Reimers

📖

Tsuyoshi Osawa

💻

Rembrandt Reyes

💻 📖 ⚠️

Toshiya Doi

📖

t.kuriyama

💻

Robert Malko

💻

Ranjan Purbey

💻

tarunama

💻

David Kramer

💻

Michael Esteban

📖

marina

📖 💻

Jonas Thiesen

📖

Yash Thakkar

💻

Kazuma Suzuki

🎨 💻

Yuji Matsumoto

📖

Gimel Dick

💻

Andreas Bollig

💻 📖

AJ Markow

⚠️ 💻

TagawaHirotaka

💻 ⚠️

Amr A.Mohammed

💻

Lucas Willems

📖 💻

Alistair Smith

💻

Rodrigo Ehlers

💻

Michael Ford

💻

Brian Liu

💻

Aleksandra Sikora

💻

JuanM04

💻 📖 ⚠️

Arend de Boer

📖

Felipe Milani

📖

Joe Edelman

💻

Gary

📖

Oliver Lopez

📖

Andreas Zaralis

📖

David Torbeck

📖

Gustavo Gard

📖

Immortalin

💻

Cristian Granda

💻

Denise Yu

💻

Andrea Della Corte

📖

Adit Sachde

📖

Hiren Chauhan

💻

Mark Jackson

📖 💻

Lewis Blackburn

📖

Vytenis

💻

Matthieu

💻 ⚠️

Mitchell Johnson

💻

Roshan Manuel

💻 📖 ⚠️

Kevin Langley Jr.

💻 📖

Gabriel Picard

📖

Ryan Chenkie

📖

Santhosh B. Appan

📖

James Moran

💻 📖

Jack Zhao

💻

Hisaki Akaza

📖

Flavio

💻

Bhanu Teja Pachipulusu

💻

Pavel Struhar

💻

Reo Ishiyama

💻

Tom MacWright

📖

François Best

💻

Faraz Patankar

📖

Eric Vicenti

📖

Alex Dolan

📖 💻 ⚠️

Mathis Pinsault

📖

gstranger

💻 📖

Mark Hughes

💻

Andrea Rizzello

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Comments
  • [legacy-framework] [RFC] Blitz App Architecture

    [legacy-framework] [RFC] Blitz App Architecture

    The purpose of this RFC (Request For Comments) is to gather as much feedback as possible before building everything outlined in it.

    We welcome all feedback, whether good or bad! This is your chance to ensure Blitz meets the needs for your company or project.

    👉 View the Rendered RFC 👈

    Also, there are now two other open issues for defining more details on Blitz queries and mutations:

    1. Query & Mutation Usage: https://github.com/blitz-js/blitz/issues/89
    2. Query & Mutation Error Handling: https://github.com/blitz-js/blitz/issues/87

    Please also check those out and provide any feedback!

    kind/rfc 
    opened by flybayer 28
  • [legacy-framework] Refactor synchronizer

    [legacy-framework] Refactor synchronizer

    Pull Request Type

    • [ ] Feature
    • [ ] Bug fix
    • [x] Refactoring (no functional changes, no api changes)
    • [ ] Build related changes
    • [ ] Tests related changes
    • [ ] Other (please describe): Dependency updates

    Checklist

    • [x] Tests added for changes (or N/A)
    • [x] Any added terminal logging uses packages/server/src/log.ts (or N/A)
    • [x] Code Coverage stayed the same or increased

    What's the reason for the change? :question:

    Synchronizer was not structured in an extensible way that allows us to move forward quickly.

    What are the changes and their implications? :gear:

    • [x] Agnostic input file watcher / glob = no watcher in unit tests
    • [x] Define stream error rendering
    • [x] Related logic needs to live together
    • [x] Everything is a stream
    • [x] More efficiency potential
    • [x] Parallel processing
    • [x] Cleaner Architecture
    • [x] Prepare for dirty restart functionality
    • [x] Migrate existing functionality over to streams
      • [x] Incorporate zeit now build logic
      • [x] Incorporate duplicate page detection logic
      • [x] Add app/foo/api/bar -> pages/api/bar to paths rule
    • [x] Simplify tests
    • [x] Docs
    • [x] Move deps to root
    • [x] Support VERCEL_BUILDER
    • [x] "stuck" on the last file progress indicator
    • [x] ~~Cross package loader animation~~ (probably best done in the cli package)

    Does this introduce a breaking change? :warning:

    • [ ] Yes
    • [x] No

    Closes blitz-js/legacy-framework#897

    Synchronizer Refactor

    Rendered docs

    Design goals

    • [x] Rules: Related logic needs to live together
    • [x] Everything is a rule
    • [x] Efficiency
    • [x] Parallel processing via streams
    • [x] Cleaner Architecture to allow for future Dirty restart functionality
    • [x] Agnostic input file watcher / glob
    • [x] Define error decoration pattern

    Tasks

    Fuzzy / Concerns

    • How do we handle calls to process.exit()? Currently I handle exit in a try catch for upfront stuff that prevents execution but that is wrong as it doesn't take into account what happens after the promise has resolved and the watcher

    Things to look at still possibly later PR

    • Use in memory fs for tests
    opened by ryardley 27
  • [legacy-framework] Add autogenerated `Routes` manifest for use with `<Link>` components

    [legacy-framework] Add autogenerated `Routes` manifest for use with `` components

    Closes: blitz-js/legacy-framework#513

    What are the changes and their implications?

    Give users a Route manifest as described in blitz-js/legacy-framework#513.

    ToDo:

    • [x] Generate manifest
    • [x] Decide on where the manifest should be generated into
    • [x] Do TypeScript shenanigans to allow importing from blitz

    Checklist

    • [x] Changes covered by tests (tests added if needed)
    • [x] PR submitted to blitzjs.com for any user facing changes
    status/done 
    opened by Skn0tt 26
  • [legacy-framework] [RFC] Blitz File Structure & Routing

    [legacy-framework] [RFC] Blitz File Structure & Routing

    The purpose of this RFC (Request for Comments) is to gather as much feedback as possible.

    We welcome all feedback, whether good or bad! This is your chance to ensure Blitz meets the needs of your company or project.

    👉 View the Rendered RFC 👈

    kind/rfc 
    opened by flybayer 21
  • Unhandled Runtime Error Error: The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.

    Unhandled Runtime Error Error: The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.

    What is the problem?

    image

    I tested this only happens when adding passport auth with Google (tried to add the auth file to a new sample repo, reproduced the issue).

    Paste all your error logs here:

    Server side log:

    xiaoshundan-macbookpro2:tokenpass xiaoshundan$ blitz dev
    Loaded env from /Users/xiaoshundan/workspace/tokenpass/.env.local
    Loaded env from /Users/xiaoshundan/workspace/tokenpass/.env
    ready - started server on 0.0.0.0:3000, url: http://localhost:3000
    event - compiled client and server successfully in 647 ms (275 modules)
    wait  - compiling /404 (client and server)...
    event - compiled client and server successfully in 176 ms (280 modules)
    warn  - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/basic-features/fast-refresh#how-it-works
    wait  - compiling / (client and server)...
    event - compiled client and server successfully in 128 ms (325 modules)
    [Rendering Suspense fallback...]
    warn  - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/basic-features/fast-refresh#how-it-works
    [Rendering Suspense fallback...]
    [Rendering Suspense fallback...]
    wait  - compiling /api/rpc/[[...blitz]]...
    event - compiled successfully in 136 ms (91 modules)
    [blitzSessionMiddleware] Starting handler...
    Starting sessionMiddleware...
    Starting with input: null
    Result: null
    Next.js serialization:1ms
    Finished: resolver:0ms serializer:1ms total:1ms
    

    Client side error:

    Unhandled Runtime Error
    Error: The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.
    
    Call Stack
    updateDehydratedSuspenseComponent
    node_modules/react-dom/cjs/react-dom.development.js (21469:0)
    updateSuspenseComponent
    node_modules/react-dom/cjs/react-dom.development.js (21129:0)
    beginWork
    node_modules/react-dom/cjs/react-dom.development.js (22379:0)
    beginWork$1
    node_modules/react-dom/cjs/react-dom.development.js (27219:0)
    performUnitOfWork
    node_modules/react-dom/cjs/react-dom.development.js (26392:0)
    workLoopSync
    node_modules/react-dom/cjs/react-dom.development.js (26303:0)
    renderRootSync
    node_modules/react-dom/cjs/react-dom.development.js (26271:0)
    performConcurrentWorkOnRoot
    node_modules/react-dom/cjs/react-dom.development.js (25577:0)
    workLoop
    node_modules/scheduler/cjs/scheduler.development.js (266:0)
    flushWork
    node_modules/scheduler/cjs/scheduler.development.js (239:0)
    MessagePort.performWorkUntilDeadline
    node_modules/scheduler/cjs/scheduler.development.js (533:0)
    

    Paste all relevant code snippets here:

    Please check: https://github.com/sherryxiao1988/blitz-passport-error/blob/main/pages/api/auth/%5B...auth%5D.ts

    What are detailed steps to reproduce this?

    I created a repo with this error:

    https://github.com/sherryxiao1988/blitz-passport-error

    Run blitz -v and paste the output here:

    xiaoshundan-macbookpro2:blitz-example xiaoshundan$ blitz -v
    Loaded env from /Users/xiaoshundan/workspace/blitz-example/.env.local
    Loaded env from /Users/xiaoshundan/workspace/blitz-example/.env
    Blitz version: 2.0.0-alpha.58 (global)
    Blitz version: 2.0.0-alpha.58 (local)
    macOS Monterey | darwin-x64 | Node: v16.15.1
    
    
     Package manager: npm
    
      System:
        OS: macOS 12.4
        CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
        Memory: 557.58 MB / 32.00 GB
        Shell: 3.2.57 - /bin/bash
      Binaries:
        Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
        Yarn: 1.22.19 - ~/.nvm/versions/node/v16.15.1/bin/yarn
        npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm
      npmPackages:
        @blitzjs/auth: alpha => 2.0.0-alpha.58
        @blitzjs/next: alpha => 2.0.0-alpha.58
        @blitzjs/rpc: 2.0.0-alpha.58 => 2.0.0-alpha.58
        @prisma/client: 3.9.0 => 3.9.0
        blitz: 2.0.0-alpha.58 => 2.0.0-alpha.58
        next: 12.2.0 => 12.2.0
        prisma: 4.0.0 => 4.0.0
        react: 18.0.0 => 18.0.0
        react-dom: 18.0.0 => 18.0.0
        typescript: ^4.5.3 => 4.7.4
    

    Please include below any other applicable logs and screenshots that show your problem:

    No response

    kind/bug status/done 
    opened by sherryxiao1988 20
  • [legacy-framework] Allow user to select a recipe with `blitz install` command

    [legacy-framework] Allow user to select a recipe with `blitz install` command

    Closes: blitz-js/legacy-framework#233

    What are the changes and their implications?

    If a user doesn't provide a recipe name, the command will show a prompt to choose a recipe from a list of available recipes.

    Screenshot 2021-10-18 at 12 22 32

    Bug Checklist

    • [x] Integration test added (see test docs if needed)

    Feature Checklist

    status/done 
    opened by mochi-sann 20
  • RPC Specification

    RPC Specification

    This issue is for defining the RPC specification used for Blitz queries and mutations. Each query and mutation can be used by third parties, so the specification must be clear and documented publicly.

    This initial specification is my first pass. I haven't thought real deeply about this, so please help me refine it!

    • [x] Define the specification
    • [ ] Implement versioning (#98)
    • [x] Add comprehensive tests (#99)
    • [x] Add specification to the Blitz docs (https://github.com/blitz-js/blitzjs.com/issues/21)

    Specification

    This specification is used for both queries and mutations. From an HTTP perspective, there is no difference between a query and mutation because they are both function calls.

    Details

    HEAD

    This will be used to warm the lambda. For example, when a component renders on the client that uses a mutation, it will issue a HEAD request to the mutation endpoint immediately on page load so that there's a much higher chance the actual mutation request will hit a warm lambda.

    • Must always return HTTP 200

    POST

    Used to actually execute the RPC

    • Request body must be JSON with the following keys:
      • params (required) - This will be provided as the first argument to the query or mutation
      • version (optional) - String containing the version of the built RPC client
    • Response body is JSON with the following keys:
      • result - the exact result returned from the query/mutation function or null if there was an error
      • error - null if success, otherwise an object.

    Example:

    // Valid request
    {
      params: {id: 1},
    }
    
    // Success response
    {
      result: {id: 1, name: "Brandon"},
      error: null
    }
    

    Responses

    | | HTTP Response Code | Response result value | Response error value | | --------------------------------- | ------------- | ------------------------------------------- | ---------------------------------------------------------- | | HEAD | 200 | - | - | | Valid request | 200 | - | - | | Invalid request, not JSON | 400 | null | {message: "Request body is not valid JSON"} | | Invalid request, missing params | 400 | null | {message: "Request body is missing the 'params' key"} | | Execution success | 200 | Exact value returned from query/mutation function | null | | Execution error | 200 | null | TBD | | All other HTTP verbs, like GET | 404 | - | - |

    Versioning

    Any time you have client-server communication, there is a very real risk of the client & server code becoming out of sync and causing an error. For example, let's say you have a mutation function whose input is a single object. You decide to change the mutation input to be a single array. You make the change and deploy it. Your server code is now updated, but all your users still have the old client code running in the browser. So it's likely you now have client code sending an object to your mutation which is going to error because it's expecting an array.

    Now one obvious solution is to only make changes that are backwards compatible, but sometimes you can't do this.

    The other solution is to track the version of your client code and your server code. If there is a version mismatch, you can display a friendly message to the user, telling them they need to reload the webpage to continue.

    Blitz is well positioned to provide this, so let's do.

    • During the build, we generate a unique version number that's embedded in both the rpc client and the server handlers.
    • The RPC client will automatically send it's version to the server in the request body.
    • The server will check for a version match.
    • If the versions don't match, we let the handler run as usual, resulting in execution success or error. But we also need to return an indicator in the response about whether the versions match. Maybe we can add a versionMismatch to the error object if execution fails. Then the Blitz dev can check that field in their error handler if they want.

    Notes

    • I'll create another issue for defining how error handling works. I.e. how queries and mutations can return error data to the client.
    scope/core kind/discussion 
    opened by flybayer 20
  • Toolkit: Authenticate and RedirectTo not working as expected

    Toolkit: Authenticate and RedirectTo not working as expected

    What is the problem?

    Using the latest toolkit .60.

    Home.authenticate = { redirectTo: Routes.LoginPage() }
    

    Doesn't seem to do anything. Have confirmed nothing in the application Tab in dev tools.

    Also

    LoginPage.redirectAuthenticatedTo = Routes.Home()
    

    Seems to create the following error, when authenticated and hitting the page:

    alt text

    Run blitz -v and paste the output here:

    Blitz version: 2.0.0-alpha.53 (global)
    Blitz version: 2.0.0-alpha.60 (local)
    macOS Monterey | darwin-arm64 | Node: v18.4.0
    
    
     Package manager: npm
    
      System:
        OS: macOS 12.4
        CPU: (10) arm64 Apple M1 Pro
        Memory: 556.45 MB / 32.00 GB
        Shell: 5.8.1 - /bin/zsh
      Binaries:
        Node: 18.4.0 - ~/.nvm/versions/node/v18.4.0/bin/node
        Yarn: 1.22.19 - ~/.nvm/versions/node/v18.4.0/bin/yarn
        npm: 8.12.1 - ~/.nvm/versions/node/v18.4.0/bin/npm
      npmPackages:
        @prisma/client: Not Found
        blitz: Not Found
        next: Not Found
        prisma: Not Found
        react: Not Found
        react-dom: Not Found
        typescript: Not Found
    
    kind/bug needs investigation status/done 
    opened by paulm17 19
  • [legacy-framework] Fix ability to import from pages, API routes, and queries/mutations

    [legacy-framework] Fix ability to import from pages, API routes, and queries/mutations

    Closes: blitz-js/legacy-framework#759 Closes: blitz-js/legacy-framework#683

    What are the changes and their implications?

    Blitz's file pipeline moves files from A to B, but doesn't update any imports to A. This PR makes sure that imports are rewritten, such that importing from any of the moved files doesn't break compilation.

    Checklist

    • [X] Tests added for changes
    • [ ] PR submitted to blitzjs.com for any user facing changes
    status/done 
    opened by Skn0tt 19
  • [legacy-framework] (newapp) Add `.editorconfig` and `.vscode` extension recomendations

    [legacy-framework] (newapp) Add `.editorconfig` and `.vscode` extension recomendations

    opened by JuanM04 17
  • [legacy-framework] Add `--parent` to `blitz generate` + Lots of code template updates + change route id to modelId

    [legacy-framework] Add `--parent` to `blitz generate` + Lots of code template updates + change route id to modelId

    Type: feature

    Closes: https://github.com/blitz-js/legacy-framework/issues/825

    What are the changes and their implications? :gear:

    Adds a CLI flag for the user to specify a --parent while generating pages. These pages will be nested under {{parentModelName}}/{{parentModelId}}, enabling the user to generate pages for dependent data models:

    $ blitz g pages tasks --parent=projects
    You are using alpha software - if you have any problems, please open an issue here:
      https://github.com/blitz-js/blitz/issues/new/choose
    
    CREATE    app/tasks/pages/projects/[projectId]/tasks/[id]/edit.tsx
    CREATE    app/tasks/pages/projects/[projectId]/tasks/[id].tsx
    CREATE    app/tasks/pages/projects/[projectId]/tasks/index.tsx
    CREATE    app/tasks/pages/projects/[projectId]/tasks/new.tsx
    

    Checklist

    • [ ] Tests added for changes
    • [ ] Any added terminal logging uses packages/server/src/log.ts

    Breaking change: no

    status/done 
    opened by aem 17
  • Fix suspense error codegen patch for latest nextjs version

    Fix suspense error codegen patch for latest nextjs version

    Closes: #4014

    What are the changes and their implications?

    • Add digest property when throwing an error and use the new nextjs constant (NEXT_DYNAMIC_NO_SSR_CODE) per (https://github.com/vercel/next.js/blob/canary/packages/next/shared/lib/no-ssr-error.ts).
    • Use the semver package to ensure previous codegen patch satisfies versions 13-13.0.6

    Bug Checklist

    • [x] Changeset added (run pnpm changeset in the root directory)
    • [ ] Integration test added (see test docs if needed)

    Feature Checklist

    • [x] Changeset added (run pnpm changeset in the root directory)
    • [ ] Integration test added (see test docs if needed)
    • [ ] Documentation added/updated (submit PR to blitzjs.com repo main branch)
    status/in-review 
    opened by dillonraphael 1
  • Suspense callback rendered despite prefetch

    Suspense callback rendered despite prefetch

    What is the problem?

    I am trying to prefetch whether or not the user is logged in to avoid rendering the suspense fallback. My understanding is that if the user data is available, the suspense fallback shouldn't be rendered.

    However, when I prefetch the user, the suspense callback gets rendered anyway. Is this the correct behavior?

    Paste all relevant code snippets here:

    useCurrentUser.ts:

    import { useQuery } from "@blitzjs/rpc"
    import getCurrentUser from "src/users/queries/getCurrentUser"
    import { Ctx } from "blitz"
    
    export const useCurrentUser = () => {
      const [user] = useQuery(getCurrentUser, null)
      return user
    }
    
    export const prefetchCurrentUser = async (ctx: Ctx) => {
      await ctx.prefetchQuery(getCurrentUser, null)
    }
    

    index.tsx

    import { Suspense } from "react"
    import Layout from "src/core/layouts/Layout"
    import { prefetchCurrentUser, useCurrentUser } from "src/users/hooks/useCurrentUser"
    import { BlitzPage } from "@blitzjs/next"
    import { gSSP } from "../blitz-server"
    
    export const getServerSideProps = gSSP(async ({ ctx }) => {
      await prefetchCurrentUser(ctx)
    
      return { props: {} }
    })
    
    const UserInfo = () => {
      const currentUser = useCurrentUser()
    
      if (currentUser) {
        return (
          <>
            logged in
          </>
        )
      } else {
        return <>
          logged out
        </>
      }
    }
    
    const Home: BlitzPage = () => {
      return (
        <Layout title="Home">
          <Suspense fallback="Loading...">
            <UserInfo />
          </Suspense>
        </Layout>
      )
    }
    
    export default Home
    

    What are detailed steps to reproduce this?

    1. run blitz new with typescript, db & auth, pnpm
    2. Change the files mentioned above
    3. Run blitz dev
    4. Observe [Rendering Suspense fallback...] in logs

    Run blitz -v and paste the output here:

    Blitz version: 2.0.0-beta.20 (global)
    Blitz version: 2.0.0-beta.20 (local)
    Windows 11 | win32-x64 | Node: v16.14.2
    
    
     Package manager: pnpm
    
      System:
        OS: Windows 10 10.0.22621
        CPU: (20) x64 12th Gen Intel(R) Core(TM) i9-12900H
        Memory: 14.89 GB / 31.70 GB
      Binaries:
        Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
        Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
        npm: 9.2.0 - C:\Program Files\nodejs\npm.CMD
      npmPackages:
        @blitzjs/auth: 2.0.0-beta.20 => 2.0.0-beta.20
        @blitzjs/next: 2.0.0-beta.20 => 2.0.0-beta.20
        @blitzjs/rpc: 2.0.0-beta.20 => 2.0.0-beta.20
        @prisma/client: 4.6.0 => 4.6.0
        blitz: 2.0.0-beta.20 => 2.0.0-beta.20
        next: 12.2.5 => 12.2.5
        prisma: 4.6.0 => 4.6.0
        react: 18.2.0 => 18.2.0
        react-dom: 18.2.0 => 18.2.0
        typescript: ^4.8.4 => 4.9.4
    
    

    Please include below any other applicable logs and screenshots that show your problem:

    No response

    kind/bug status/triage 
    opened by SimonBerens 0
  • Guard `blitz generate` input against unwanted characters

    Guard `blitz generate` input against unwanted characters

    Closes: https://github.com/blitz-js/blitz/issues/4021

    What are the changes and their implications?

    The input strings passed to blitz g are checked against an allow list of characters via regex. The helper throws if an unwanted character is found.

    I think it would be enough to check in prisma/fields.ts. The main reason for added it there was so the tests in prisma/fields.test.ts can be used to test the regex. However, generators/model-generator.ts has the raw string (right?), so this would be the place it first. To keep the code simpler, we could remove it from generators/model-generator.ts again – let me know what you thing.

    Also, please give the regex and everything a good review. I am new new to this :-).

    Bug Checklist

    • [x] Changeset added (run pnpm changeset in the root directory)
    • [ ] Integration test added (see test docs if needed)

    Feature Checklist

    • [x] Changeset added (run pnpm changeset in the root directory)
    • [ ] Integration test added (see test docs if needed)
    • [ ] ~Documentation added/updated (submit PR to blitzjs.com repo main branch)~
    status/in-review 
    opened by tordans 1
  • `blitz g` with brackets can break the cli

    `blitz g` with brackets can break the cli

    What is the problem?

    This is what I get after breaking thinks:

    % blitz help
    blitz:22: command not found: endAt:dateTime
    % blitz g all post title:string author:string content:string
    blitz:23: command not found: endAt:dateTime
    % blitz help
    blitz:24: command not found: endAt:dateTime
    

    This is likely how I broke thinks…

    I suspect the now() caused the issue.

    blitz generate all date startAt:dateTime:default=now() endAt:dateTime title:string locationName:string locationUrl:string description:string id:uuid --dry-run 
    

    How not to fix this…

    • npm uninstall -g blitz, then reinstall does not help
    • force-cleaning the npm cache does not help
    • removing node_modues, then reinstalling all does not help

    How to fix it:

    I had to remove files in a npm temp folder, which "cached" broken code.

    // 
    $ echo TMPDIR
    /var/folders/_2/w9vhc5hx1fg2vfmnypv3wvmm0000gp/T/
        
    % cd $TMPDIR
    % cd node-jiti
    % ls
      blitz-auth-build.config.ts.42bb7c8e.js
      blitz-build.config.ts.531e0b43.js
      blitz-next-build.config.ts.b5eaaddf.js
      blitz-rpc-build.config.ts.f41b01c7.js
      codemod-build.config.ts.8d2cf2eb.js
      generator-build.config.ts.515f44ba.js
      pkg-template-build.config.ts.40d86f9a.js
        
    $ cat pkg-template-build.config.ts.40d86f9a.js
    
    "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0;
    
    const config = {
      entries: ["./src/index-browser", "./src/index-server"],
      externals: ["index-browser.cjs", "index-browser.mjs", "react"],
      declaration: true,
      rollup: {
        emitCJS: true,
        esbuild: {
          target: ["es2015"] } } };var _default =
    
    
    
    config; exports.default = _default; /* v7-eb5970095fe3c5ea */
    
    $ cat /private/var/folders/_2/w9vhc5hx1fg2vfmnypv3wvmm0000gp/T/node-jiti/generator-build.config.ts.515f44ba.js
    
    "use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
    
    const config = {
      entries: ["./src/index"],
      externals: ["react"],
      declaration: true,
      rollup: {
        emitCJS: true,
        esbuild: {
          target: ["es2015"] } } };var _default =
    
    
    
    config;exports.default = _default; /* v7-5f8f751e7d033013 */
    

    Other blitz files hold the same content. Once I removed them all, blitz started working again.


    A quick fix could be to make sure only allow-listed characters (A-Za-z-_:=, but no () etc) are processed by the generator. I peeked at https://github.com/blitz-js/blitz/blob/main/packages/blitz/src/cli/commands/generate.ts but could not see where to do this…

    Paste all your error logs here:

    See above.

    Paste all relevant code snippets here:

    See above.

    What are detailed steps to reproduce this?

    See above.

    Run blitz -v and paste the output here:

    % blit
    z --version
    Blitz version: 2.0.0-beta.20 (global)
    Blitz version: 2.0.0-beta.20 (local)
    macOS Ventura | darwin-arm64 | Node: v18.8.0
    
    
     Package manager: npm
    
      System:
        OS: macOS 13.0.1
        CPU: (8) arm64 Apple M1
        Memory: 83.39 MB / 16.00 GB
        Shell: 5.8.1 - /bin/zsh
      Binaries:
        Node: 18.8.0 - ~/.nvm/versions/node/v18.8.0/bin/node
        Yarn: Not Found
        npm: 8.18.0 - ~/.nvm/versions/node/v18.8.0/bin/npm
      npmPackages:
        @blitzjs/auth: 2.0.0-beta.20 => 2.0.0-beta.20
        @blitzjs/next: 2.0.0-beta.20 => 2.0.0-beta.20
        @blitzjs/rpc: 2.0.0-beta.20 => 2.0.0-beta.20
        @prisma/client: 4.6.0 => 4.6.0
        blitz: 2.0.0-beta.20 => 2.0.0-beta.20
        next: 12.2.5 => 12.2.5
        prisma: 4.6.0 => 4.6.0
        react: 18.2.0 => 18.2.0
        react-dom: 18.2.0 => 18.2.0
        typescript: ^4.8.4 => 4.9.4
    

    Please include below any other applicable logs and screenshots that show your problem:

    No response

    kind/bug status/ready-to-work-on 
    opened by tordans 3
  • Remove `getLayout` for `reset-password.tsx`s

    Remove `getLayout` for `reset-password.tsx`s

    What are the changes and their implications?

    The other three auth templates have the <Layout> right in the component. This brings the reset-password file(s) in line. It also gets rid of the empty wrapper-<div>.

    Feature Checklist

    I had trouble getting all tests running due to ELIFECYCLE errors. In case this is broken, feel free to just close the ticket.

    • [x] Changeset added (run pnpm changeset in the root directory)
    • [x] ~~Integration test added (see test docs if needed)~~
    • [x] ~~Documentation added/updated (submit PR to blitzjs.com repo main branch)~~
    status/in-review 
    opened by tordans 3
  • Using setQueryData with useInfiniteQuery doesn't work

    Using setQueryData with useInfiniteQuery doesn't work

    What is the problem?

    Hi,

    I am trying to use setQueryData to change some of the data from useInifiniteQuery hook before the request to backend is complete. It seems, that it doesn't do anything actually. I think there is also a few problems with typing. I am using it right? This function seems bit unmaintained so what do you guys use for infinite query?

    Paste all your error logs here:

    No error.

    Paste all relevant code snippets here:

    // typescript throws error here, even tho it should be possible to return just the old data
    setQueryData(oldData => oldData)
    
    // old data is in fact undefined
    setQueryData((oldData) => {
       console.log({ oldData }) // oldData === undefined in most of the cases
    })
    
    // it's typed to use like this but that doesn't work
    setQueryData({
          contacts: [{ ...contactFormValues, id: faker.datatype.uuid() }],
          ...contactPages[0]
     }, {refetch: false})
    
    // kinda make sense to use it like this, but also doesn't work
    const [firstPage, ...restPages] = contactPages;
    setQueryData([
          {
            ...firstPage,
            contacts: [
              { ...contactFormValues, id: faker.datatype.uuid() },
              ...firstPage.contacts
            ],
          },
          ...restPages
    ], {refetch: false})
    

    What are detailed steps to reproduce this?

    1. pull https://github.com/Daidalos117/blitzjs-infinity/
    2. go to /contacts and try to add new contact
    3. open app/contacts/components/ContactsList.tsx in editor
    4. look into the onOnContactSave fnc

    Run blitz -v and paste the output here:

    blitz -v
    Blitz version: 2.0.0-beta.4 (global)
    Blitz version: 2.0.0-beta.20 (local)
    macOS Monterey | darwin-arm64 | Node: v16.17.1
    
    
     Package manager: npm
    
      System:
        OS: macOS 12.6
        CPU: (8) arm64 Apple M1 Pro
        Memory: 568.14 MB / 16.00 GB
        Shell: 5.8.1 - /bin/zsh
      Binaries:
        Node: 16.17.1 - /usr/local/bin/node
        Yarn: 1.22.17 - /opt/homebrew/bin/yarn
        npm: 8.5.5 - /opt/homebrew/bin/npm
      npmPackages:
        @blitzjs/auth: 2.0.0-beta.20 => 2.0.0-beta.20 
        @blitzjs/next: 2.0.0-beta.20 => 2.0.0-beta.20 
        @blitzjs/rpc: 2.0.0-beta.20 => 2.0.0-beta.20 
        @prisma/client: 4.0.0 => 4.0.0 
        blitz: 2.0.0-beta.20 => 2.0.0-beta.20 
        next: 12.2.5 => 12.2.5 
        prisma: 4.0.0 => 4.0.0 
        react: 18.2.0 => 18.2.0 
        react-dom: 18.2.0 => 18.2.0 
        typescript: ^4.5.3 => 4.9.4 
    
    

    Please include below any other applicable logs and screenshots that show your problem:

    No error.

    kind/bug status/triage 
    opened by Daidalos117 1
Releases(v2.0.0-beta.20)
  • v2.0.0-beta.20(Dec 16, 2022)

    🚀 Features/Improvements

    blitz

    • 74a14b70: When db.$reset() rejects, reject with an Error object
    • 6ece0961: Decoupled Blitz RPC from Blitz Auth to allow independent use.
    • a0596279: Fix blitz install for recipes that use the path helper to check if ./src/pages directory is available, otherwise use ./pages

    @blitzjs/auth

    • 6ece0961: Decoupled Blitz RPC from Blitz Auth to allow independent use.
    • 03bad317: fix Cannot read properties of null (reading 'isReady') for pnpm/yarn v3

    @blitzjs/next

    • 6ece0961: Decoupled Blitz RPC from Blitz Auth to allow independent use.
    • 03bad317: fix Cannot read properties of null (reading 'isReady') for pnpm/yarn v3

    @blitzjs/rpc

    • 6ece0961: Decoupled Blitz RPC from Blitz Auth to allow independent use.
    • 03bad317: fix Cannot read properties of null (reading 'isReady') for pnpm/yarn v3
    • 8c247e26: Switch from jest to vitest in new app templates
    • 650a157e: fix: allow GET requests without params and meta keys

    🐞 Patches

    @blitzjs/generator

    • 8c247e26: Switch from jest to vitest in new app templates
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-beta.19(Nov 22, 2022)

    🚀 Features/Improvements

    blitz

    • 942536d9: update paginate.ts, return more params for more complex pagination control
    • c1e00406: transpile packages to es2015 to support older browsers
    • 696f48c4: some providers need extra attributes, update for wrapAppWithProvider
    • a6f32d1d: Export enhancePrisma for client again (Fixes #3964)
    • c126b819: fix for when using "blitz install" inside recipe with addRunCommandStep causes hangs up
    • b33db082: Fix ambigious class warning log & upgrade superjson from 1.9.1 to 1.11.0

    @blitzjs/auth

    • c1e00406: transpile packages to es2015 to support older browsers

    @blitzjs/next

    • c1e00406: transpile packages to es2015 to support older browsers
    • b33db082: Fix ambigious class warning log & upgrade superjson from 1.9.1 to 1.11.0

    @blitzjs/rpc

    • c1e00406: transpile packages to es2015 to support older browsers
    • b493c93f: fix resolverPath:root and make it work with monorepo resolver
    • b33db082: Fix ambigious class warning log & upgrade superjson from 1.9.1 to 1.11.0

    🐞 Patches

    @blitzjs/generator

    • b80c3d92: Fix form paths when running blitz generate all
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-beta.18(Nov 16, 2022)

    🚀 Features/Improvements

    @blitzjs/rpc

    • 72a4e594: internal: remove unneeed useSession from useQuery hooks
    • c0a3b1ee: Fix mutability bug in RPC configuration
    • ed2b0e22: Add ability to put your query and mutation resolvers in a separate monorepo folder, allowing you to use them in multiple apps.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-beta.17(Nov 9, 2022)

    🐞 Patches

    blitz

    • 5ea068b2: Check if blitz-server & blitz-client is located in either the app or src directory and return the correct path for blitz recipes.
    • 8b4bf999: Update dependencies
    • 88caa18e: Patch next13 for suspense error

    @blitzjs/auth

    • 8b4bf999: Update dependencies
    • 97469a12: Added option role to authenticate property of BlitzPage to authenticate page with respect to the role of the user. String value or Array of strings can be passed to authorize users.

    @blitzjs/next

    • 8b4bf999: Update dependencies
    • 97469a12: Added option role to authenticate property of BlitzPage to authenticate page with respect to the role of the user. String value or Array of strings can be passed to authorize users.

    @blitzjs/rpc

    • 8b4bf999: Update dependencies

    @blitzjs/generator

    • 2a81af7b: Update generator templates to use the src directory instead of app
    • 8b4bf999: Update dependencies
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-beta.16(Nov 4, 2022)

    🚀 Features/Improvements

    @blitzjs/auth

    • 55a43ce1: maybe fix anon session CSRF issue + add ability to customize anon session expiry time

    @blitzjs/next

    • 11b548ed: Change setupBlitzServer logger config to be optional. Will default to BlitzLogger

    @blitzjs/rpc

    • 55a43ce1: maybe fix anon session CSRF issue + add ability to customize anon session expiry time
    • ceb7db27: Add an opt-in GET request support to RPC specification by exporting a config object that has the httpMethod property. from query files.

    🐞 Patches

    blitz

    • 1569bd53: Upgrade tslog to the latest version
    • ceb7db27: Add an opt-in GET request support to RPC specification by exporting a config object that has the httpMethod property. from query files.
    • 8e5903c0: Fix cannot find module db error in JavaScript template. Replace requiring the config using esbuild with parsing using jscodeshift to get the cliConfig values. Added logic to find the blitz-server file in src directory
    • 45459129: Include resolvers in src directory in blitz console

    @blitzjs/generator

    • 1569bd53: Upgrade tslog to the latest version
    • 8e5903c0: Fix cannot find module db error in JavaScript template. Replace requiring the config using esbuild with parsing using jscodeshift to get the cliConfig values. Added logic to find the blitz-server file in src directory
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-beta.15(Oct 28, 2022)

  • v2.0.0-beta.14(Oct 25, 2022)

    🐞 Patches

    blitz

    • 78fd5c48: Fix blitz install command getting stuck on the Generating file diff... step
    • 0a8b0cb3: Fix custom server's TypeScript error - add es6 target config to the esbuild config

    @blitzjs/generator

    • 54761393: Remove unnecessary as number assertions from new app templates
    • 60de0574: Fix reset token being undefined when passed to the resetPassword mutation
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-beta.13(Oct 19, 2022)

    🐞 Patches

    blitz

    • a6e81f15: Add BlitzLogger plugin and allow customizing logging
    • 6f434989: Fix "Ambiguous class detected" errors reported by SuperJson by removing duplicated export from errors.ts file

    @blitzjs/next

    • a6e81f15: Add BlitzLogger plugin and allow customizing logging

    @blitzjs/rpc

    • 7b63f0f1: Allow the updater function in setQueryData to return undefined to match react-query typings

    @blitzjs/generator

    • 4e26ae21: Upgrade eslint-config-next in new app templates to fix linting issues on blitz build
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-beta.12(Oct 13, 2022)

    🐞 Patches

    blitz

    • 3a602b61: Fix blitz install not working due to missing blitz/installer dependency
    • f39ba1ff: Allow passing custom templates to the blitz generate command. Extend the generate command with custom-templates to provide an easy starting point for users to customize the default templates: blitz generate custom-templates

    @blitzjs/generator

    • f39ba1ff: Allow passing custom templates to the blitz generate command. Extend the generate command with custom-templates to provide an easy starting point for users to customize the default templates: blitz generate custom-templates
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-beta.11(Oct 11, 2022)

    🐞 Patches

    blitz

    • 9db6c885: Fix blitz --help CLI command not being found
    • d98e4bac: Add blitz routes CLI command back to the toolkit
    • 9fe0cc54: Fix auth-related React hydration errors by not redirecting until after component mount.
    • af58e2b2: Add a global Blitz version check when generating a new Blitz project to ensure users use the latest Blitz.
    • 2ade7268: Add blitz export CLI command to the toolkit
    • 0edeaa37: Allow for custom page extensions for the wildcard blitz route. For example [...blitz].api.ts. For more information vist https://nextjs.org/docs/api-reference/next.config.js/custom-page-extensions
    • 430f6ec7: Only generate the Prisma client if it's not found in node_modules when running a blitz cli command.
    • 15d22af2: Add theblitz console CLI command back to the toolkit
    • aa34661f: Fix invalidateQuery generating the wrong param when no param argument is passed
    • 8e0c9d76: Migrate over recipe functionality from the legacy framework & expose recipe builder helper functions that find and modify next.config.js, blitz-server & blitz-client.
    • e2c18895: Add client testing utilities and a sample test to a new blitz app template

    @blitzjs/auth

    • 9fe0cc54: Fix auth-related React hydration errors by not redirecting until after component mount.

    @blitzjs/next

    • 1742eb45: Fix prefetching infinite Blitz queries.
    • 9fe0cc54: Fix auth-related React hydration errors by not redirecting until after the component mount
    • e2c18895: Add client testing utilities and a sample test to a new blitz app template
    • 25f4526f: Treat API Route handler as a middleware. It allows the outer middlewares to wrap queries and mutations

    @blitzjs/rpc

    • 0edeaa37: Allow for custom page extensions for the wildcard blitz route. For example [...blitz].api.ts. For more information visit https://nextjs.org/docs/api-reference/next.config.js/custom-page-extensions
    • aa34661f: Fix invalidateQuery generating the wrong param when no param argument is passed
    • 8e0c9d76: Migrate over recipe functionality from the legacy framework & expose recipe builder helper functions that find and modify next.config.js, blitz-server & blitz-client.

    @blitzjs/codemod

    • b3b4c215: Unwrap invokeWithMiddleware so the query or mutation is called directly when running the codemod
    • eb970f7b: Fix detecting blitz.config.(ts|js) config file when running the codemod.

    @blitzjs/generator

    • 04730205: Update prisma-ast dependency to prevent Blitz generator from failing when Prisma keywords are used as model names
    • 824a9b5e: Fix no-floating-promises lint errors after generating pages with Blitz generator by adding await to router.push calls in the templates
    • d6717b9d: Load schema.prisma path from package.json instead of assuming it's db/schema.prisma
    • bf4aaf1d: Move useCurrentUser hook from core/hooks to users/hooks folder
    • b43c1a81: Remove the random user ([email protected]) & use the user's default git account when committing a newly generated blitz project.
    • 83281a84: Fix eslint config in new JavaScript app templates
    • bd09db75: Remove views property from Session.PublicData in types.ts file
    • e2c18895: Add client testing utilities and a sample test to a new blitz app template
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-beta.4(Sep 13, 2022)

    🐞 Patches

    blitz

    • c213d521: Fix issue with the route name that's generated for nested routes in @blitzjs/rpc. This was causing issues for windows users.
    • 0b94a450: Upgrade superjson to the latest version
    • 161270e3: Only run the prisma generate command when the schema file changes.

    @blitzjs/auth

    • 713aead9: Allow specifying custom strategy name in Blitz's passport adapter

    @blitzjs/next

    • 69fb2803: Allow setting static page properties (e.g. getInitialProps) on the App component
    • 0b94a450: Upgrade superjson to the latest version

    @blitzjs/rpc

    • c213d521: Fix issue with the route name that's generated for nested routes in @blitzjs/rpc. This was causing issues for windows users.
    • 0b94a450: Upgrade superjson to the latest version
    • f6dac093: Improve RPC logging: print resolverName() insetad of /resolverName()

    @blitzjs/codemod

    • d3403cf8: Show file path on error when running the upgrade legacy codemod.
    • 74a4ce8e: Add AuthenticatedSessionContext to the upgrade-legacy codemod import map
    • 43e65cfe: Remove TypeScript type annotations from next.config.js (a JavaScript file) in the upgrade-legacy codemod.
    • da914c92: Convert import statements to require when creating the next.config.js file in the codemod

    @blitzjs/generator

    • 7498aef4: Fix tsconfig.json referencing blitz-env.d.ts insetad of next-env.d.ts in new app templates
    • 22344d05: New apps generated by the cli was missing the getLayout function in _app, so when you used the getLayout property on your page, it didn't render. You'll need to manually update your _app if you generated an app with blitz v2.
    • 8fa9a56f: Fix eslint and types setup in minimal app template
    • c53978d5: Fix upgrade-legacy Update imports step — import getAntiCSRFToken and AuthenticatedMiddlewareCtx from correct locations
    • a84b8de4: Remove -cookie-prefix appended to the cookiePrefix config property in the new app template. It will also fix auth and CSRF issues for users upgrading from a legacy framework.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-beta.3(Aug 22, 2022)

    🐞 Patches

    blitz

    • 638f2319: Prevent Minified react error #419 in production

    @blitzjs/codemod

    • 2313fa61: Fix upgrade-legacy codemod replacing identifiers with an invalid value. Previously new values were hardcoded to NextApiRequest. Now we're using correct values provided as replaceIdentifiers function argument.
    • 1bf185d6: Add a new codemod step to update the .eslintrc.js file

    @blitzjs/generator

    • b72d1215: Add vscode debugging configuration to new app templates
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-beta.2(Aug 18, 2022)

    🐞 Patches

    blitz

    • db7233db: Bump react, react-dom, @types/react and next versions

      This fixes a console warning: Warning: Receivedtruefor a non-boolean attributeglobal. when using styled-jsx. Versions bump also fixes React Hydration error that happens on and off when using redirectAuthenticatedTo.

    • 0936cb38: Patch Next.js Suspense issue in all node environments. Previously we only patched it in the development environment, but now we make sure it gets patched in the production env (with the blitz build command) as well.

    • 3f9fe8f0: Exit the CLI process after blitz new command is finished

    @blitzjs/auth

    • db7233db: Bump react, react-dom, @types/react and next versions

    @blitzjs/next

    • db7233db: Bump react, react-dom, @types/react and next versions

    @blitzjs/rpc

    • db7233db: Bump react, react-dom, @types/react and next versions

    @blitzjs/codemod

    • db7233db: Bump react, react-dom, @types/react and next versions

    • a3b5fdd0: Change ES6 import for withBlitz during the codemod to the require syntax.

    • ebfb562b: Add Script as a default import from next.js during the codemod.

    @blitzjs/generator

    • db7233db: Bump react, react-dom, @types/react and next versions

    • eb971568: Add BlitzPage types to auth pages in new app template

    • 8ada2c26: Include ResetPasswordPage in new app template

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-beta.1(Aug 15, 2022)

    Announcing Blitz 2.0 BETA 🎉 🎉 🎉

    Blitz is no longer an all-in-one framework but a full-stack toolkit for Next.js 🔥

    Previously Blitz abstracted Next.js, but Blitz 2.0 is now a modular toolkit that plugs into any new or existing Next.js app. Blitz picks up where Next.js leaves off, providing battle-tested libraries and conventions for shipping and scaling worldwide apps

    Going forward, our mission is to be the most trusted technical resource for rapidly building and scaling full-stack TypeScript apps. We're doing that through frontend-agnostic libraries that simplify complex app problems with minimal tradeoffs and through full-stack guides.

    Upgrade Guide

    If you have an existing Blitz.js app and would like to upgrade it to the Blitz 2.0, you can use our @blitzjs/codemod package by running the following command in the root of your Blitz application:

    npx @blitzjs/codemod upgrade-legacy
    

    After running the command, your Blitz app will be upgraded to the Blitz 2.0 + Next.js setup. If you face any issues with the upgrade — let us know!

    You can also check out the manual upgrade guide.

    Try Blitz 2.0 Yourself With Just a Few Commands

    Set Up Your Computer

    You need Node.js 16 or newer. You can verify this by running node -v in your terminal.

    Install Blitz

    Run yarn global add blitz or npm install -g blitz or pnpm add -g blitz.

    Generate a New App

    1. blitz new myAppName
    2. cd myAppName
    3. blitz dev

    View your brand new Next.js + Blitz 2.0 app at http://localhost:3000/.

    Blitz Packages

    Blitz 2.0 consist of six packages: blitz, @blitzjs/next, @blitzjs/auth, @blitzjs/rpc, @blitzjs/codegen. Read below to learn about each of them.

    blitz

    blitz is our core package containing utilities and the base for all the Blitz packages and plugins. Blitz CLI is also a part of this package, including the blitz generate command for code scaffolding.

    Read the Blitz CLI docs. Read the Blitz utilities docs.

    @blitzjs/next

    The @blitzjs/next package exposes functions and components specific to the Next.js framework.

    Read the docs.

    @blitzjs/auth

    The package provides authentication and authorization. Works with any identity provider, including self-hosted username and password and third parties like Auth0.

    Read the docs.

    @blitzjs/rpc

    Blitz "Zero-API" data layer (Blitz RPC) is focused on making the communication between server and client seamless. It lets you import server code directly into your components instead of having to manually add API endpoints and manually do client-side fetching and caching.

    Read the docs.

    @blitzjs/codemod

    The @blitzjs/codemod has an upgrade-legacy codemod for upgrading the existing Blitz framework application to the new Blitz 2.0 + Next.js setup.

    Read the docs.


    HUGE shout out to everyone who contributed to this release:

    @Zeko369 @datner @anteprimorac @iDavidB @andreasasprou @the-bayer @chaiwattsw @prisis @oltdaniel @Trancever @edrickleong @ganeshmani @orionmiz @iojcde @noxify @siddhsuresh @saadaltabari @dillonraphael @flybayer

    🙌 🙌 🙌

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-alpha.71(Aug 14, 2022)

  • v2.0.0-alpha.70(Aug 12, 2022)

    🐞 Patches

    @blitzjs/codemod

    • f88702c1: Remove trailing comma when removing BlitzConfig from next.config.js & Fix codemod so if route (eg. app/auth/pages) convert to (eg. pages/) instead of (eg. pages/auth)

    @blitzjs/generator

    • 4656e6ec: Print model that was added or updated in schema.prisma after running the model generator
    • 1e0ec7a9: Add BlitzPage type to Home pages in new app templates
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-alpha.69(Aug 12, 2022)

    🐞 Patches

    @blitzjs/next

    • a3c92cb8: Allow using RouteUrlObject as redirect.destination in getStaticProps and getServerSideProps

    @blitzjs/rpc

    • 49028024: Add getQueryData utility to get an existing query's cached data

    @blitzjs/codemod

    • 86af6dec: Wrap middlewares with BlitzServerMiddleware function with codemod
    • 72a332e0: Wrap blitz.config.ts with the withBlitz function during the codemod step instead of creating a blank next.config.js file
    • 2d1482fc: Allow codemod to finish if cookiePrefix is undefined. Then show an error at the end of the codemod output

    @blitzjs/generator

    • https://github.com/blitz-js/blitz/commit/e2fac297fd479d7349a71c83d102d5c3c330d812: Add theblitz generate command to the toolkit
    • 6baab190: Add type checking to next.config.js files in new app templates
    • 37623a4f: Fix typo in a next.config.js file name
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-alpha.68(Aug 10, 2022)

    🐞 Patches

    blitz

    • 271c58ac: Fix Cannot find module "generate" errors when using CLI
    • 630c7181: Use internal branded Blitz logger for @blitzjs/rpc
    • f0ca738d: Run Blitz codegen with blitz dev command
    • 41608c4c: Fix Next suspense issue not being patched when creating a new app with Yarn as a package manager

    @blitzjs/rpc

    • 630c7181: Use internal branded Blitz logger for @blitzjs/rpc

    @blitzjs/codemod

    • 06427f67: Throw error if a detected cookiePrefix is undefined when running upgrade-legacy
    • f120f672: Add DocumentProps and DocumentContext to the upgrade-legacy import map
    • 8dfaad08: Set correct packages versions in package.json with upgrade-legacy
    • cb55ed26: Fix upgrade-legacy to accept a self closing DocumentHead in the _document page

    @blitzjs/generator

    • 70b334a2: Remove trailing comma from tsconfig.json file in the new app template
    • dd299ae8: Add ts-jest to dependencies in new app templates
    • 078fe474: Add @testing-library/jest-dom to new app dependencies
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-alpha.67(Aug 5, 2022)

  • v2.0.0-alpha.66(Aug 4, 2022)

    🐞 Patches

    blitz

    • 928e840b: Fixes loading production env variables by default for blitz build command
    • 240f3f34: Add BlitzServerMiddleware utility function to wrap middleware in blitz server file
    • 55b1cb20: Runs the codegen on the blitz build command
    • 4d7d126d: Run prisma generate as a blitz codegen step if "prisma" is found in project's dependencies
    • 890b0c0c: Improve blitz new messaging and fix minor issues
    • 807a2b56: Fixes peer dependency warnings
    • a3e6c49c: Fixes the supports-color warning for pnpm

    @blitzjs/auth

    • a3e6c49c: Fixes the supports-color warning for pnpm

    @blitzjs/next

    • ccb1af8d: Avoid invalid config detected warnings by deleting "blitz" key from next config object
    • 807a2b56: Fixes peer dependency warnings
    • a3e6c49c: Fixes the supports-color warning for pnpm

    @blitzjs/rpc

    • 807a2b56: Fixes peer dependency warnings
    • a3e6c49c: Fixes the supports-color warning for pnpm
    • 9620ef6b: moves zod to devDependencies

    @blitzjs/generator

    • 91aa5356: Include .env.test file to the generator templates
    • 890b0c0c: Improve blitz new messaging and fix minor issues
    • 807a2b56: Fixes peer dependency warnings
    • a3e6c49c: Fixes the supports-color warning for pnpm
    • 065db256: Update new app templates to use blitz-rpc's resolver function
    • f202aac1: Mocks @blitzjs/auth instead of blitz inside the forgotPassword mutation test & hardcodes blitz package version types instead of just using the alpha tag.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-alpha.65(Aug 2, 2022)

  • v2.0.0-alpha.64(Aug 1, 2022)

    🐞 Patches

    blitz

    • 54db8a46: Add missing value to "skip" option when choosing a package manager during new app scaffolding
    • 62bf12b5: Fix blitz codegen to work with monorepos
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-alpha.63(Jul 30, 2022)

  • v2.0.0-alpha.62(Jul 29, 2022)

    🐞 Patches

    blitz

    • 365e6709: Fixes the db seed command so that the database can disconnect after running the seed file.

    @blitzjs/next

    • 31d7a6f4: Set prefix in moduleNameWrapper's options in Blitz's jest configuration
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-alpha.61(Jul 28, 2022)

  • v2.0.0-alpha.60(Jul 28, 2022)

  • v2.0.0-alpha.59(Jul 27, 2022)

  • v2.0.0-alpha.58(Jul 26, 2022)

    🚀 Features/Improvements

    blitz

    • 83b35590: Truncate errors from api/auth/<strategy>/callback request to 100 characters before passing them to the ?authError= query parameter

    🐞 Patches

    @blitzjs/auth

    • 83b35590: Truncate errors from api/auth/<strategy>/callback request to 100 characters before passing them to the ?authError= query parameter

    @blitzjs/next

    • 6ab9db78: Infer result type in the api handler and allow customizing it

    @blitzjs/rpc

    • c721c104: Pass signal from useQuery to Blitz internal rpc client to be able to cancel queries on unmount

    @blitzjs/codemod

    • dcdcd040: These are various changes to will make the codemod more dynamic and work with a larger variety of codebases. These fixes are implemented to make the codemod work with flightdeck.
    • 7e538ba4: Import ErrorComponent as DefaultErrorComponent
    • 8e00605a: Updates the error messages based on if it's a babel parse error or an unexpected error

    @blitzjs/generator

    • e339e2fd: Add hoist pattern entry for react-query in new app templates
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-alpha.57(Jul 22, 2022)

  • v0.45.5(Jul 15, 2022)

A React-Fullstack platform helps to track & compare your Incomes & Expenses transactions in one place via detailed Graphical information to manage your Budget.

Budget Master Track your income and expenses in one place via detailed graphical information to manage your budget. Manage your budget and transaction

Siddharth Singh Bhadoriya 9 Nov 27, 2022
This is a challenge intiated by ModelSis. It consists in building a basic fullstack web app

modelsis-react-fullstack ?? Description This is a challenge intiated by ModelSis. It consists in building a basic fullstack web app. The current repos

Régis 1 Jan 21, 2022
A complete example of fullstack NFT minting dApp

This a complete example of fullstack NFT minting dApp. BoredApe is built with the purpose of providing an entry point for future NFT Minting Website projects.

codingwithdidem 66 Dec 13, 2022
Twitter-Clone-Nextjs - Twitter Clone Built With React JS, Next JS, Recoil for State Management and Firebase as Backend

Twitter Clone This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn de

Basudev 0 Feb 7, 2022
Juka Official Website built on top of Docusaurus/React Framework. Help us make it better!

Juka Programming Language Juka Programming Language website is built on top of Docusaurus 2. Feel free to contribute to our website! Any help is appre

Juka Programming Language 5 Dec 24, 2022
The Tesla Clone built in React Native FrameWork

Tesla Clone The Tesla Clone built in React Native FrameWork Features Flat Infinite Scroll List View with animations. Design is responsive to different

LakhanKumawat ᵖ⁺ 2 Feb 10, 2022
A web application to search all the different countries in the world and get details about them which can include languages, currencies, population, domain e.t.c This application is built with CSS, React, Redux-Toolkit and React-Router.

A web application to search all the different countries in the world and get details about them which can include languages, currencies, population, domain e.t.c This application is built with CSS, React, Redux-Toolkit and React-Router. It also includes a theme switcher from light to dark mode.

Franklin Okolie 4 Jun 5, 2022
Simple React Social Network, built with React,Node,Express,MongoDB and Tailwind

Full stack react social network application A mini social network application built with React,Typescript, Redux, Node, Express, MongoDB, and Tailwind

Albenis Kërqeli 31 Dec 19, 2022
Recoil is an experimental state management library for React apps. It provides several capabilities that are difficult to achieve with React alone, while being compatible with the newest features of React.

Recoil · Recoil is an experimental set of utilities for state management with React. Please see the website: https://recoiljs.org Installation The Rec

Facebook Experimental 18.2k Jan 8, 2023
Next-multipart - Easy & Simple File Uploads for Next.js

Next-Multipart Next-multipart is a small utility library to ease the process of file uploads with Next.js. It uses formidable under the hood, but with

Tim Raderschad 10 Nov 11, 2022
Next.js: Primeiro mergulho no framework

Next.js: Primeiro mergulho no framework. getServerSideProps: Roda a cada acesso recebido. Em modo DEV, sempre roda. A cada acesso. getStaticProps: Rod

Lucas Magalhães 2 Feb 3, 2022
A web-app built with next.js that can automatically install mods into a new Minecraft or MultiMC Launcher Profile using the File System Access API

Mod Installer This is a Next.js App which automatically installs fabric mods on your PC and creates a Minecraft Launcher Profile for you. Idea & Inspi

Emma Böcker 18 Nov 27, 2022
A Webapp Template built by RainySystems with Next.js and Appwrite

?? RainySystems Template Webapp A Template Webapp with basic functionality built with Next.js and Typescript. Demo: You can check out a live demo of t

RainySystems 11 Oct 22, 2022
Utilities library built on top of Next.js providing feature extensions and helpers for common patterns

nextjs-utilites This library provides many helpful utilities for use in Next.js projects. Prerequisites This project requires NodeJS (version 8 or lat

Snehil K 5 Sep 7, 2022
Next-gen, highly customizable content editor for the browser - based on React and Redux and written in TypeScript. WYSIWYG on steroids.

ReactPage ReactPage is a smart, extensible and modern editor ("WYSIWYG") for the web written in React. If you are fed up with the limitations of conte

null 9.1k Jan 6, 2023
An interactive CLI automation tool 🛠️ for creating react.js and next.js projects most fast and efficiently. ⚛️

An interactive CLI automation tool ??️ for creating react.js and next.js projects most fast and efficiently. ⚛️ About ℹ️ ReexJs CLI is an interactive

Alexis Guzman 27 Apr 12, 2022
Get an array of all React Spectrum modules, useful for integrating with Next.js

get-react-spectrum-modules This package exports a function that returns an array of all React Spectrum modules that it finds in the node_modules direc

Marc Abramowitz 1 Mar 8, 2022
🚀 Aplicação mobile com React Native produzida durante o Next Level Week #05

✨ Tecnologias Esse projeto foi desenvolvido com as seguintes tecnologias: React Native Typescript Expo ?? Projeto Aplicativo para lhe ajudar a lembrar

Danilo Alexandrino 11 May 28, 2022
🧍‍♂️ React Native + Next.js, unified.

Solito A library dedicated to unifying React Native with Next.js, primarily focused on navigation. This is still experimental. Docs & Examples ?? Docu

Fernando Rojo 2k Jan 9, 2023