-
Hello to all my friends :) I have some important and weighty things to discuss. TLDR: I’m proposing to pivot Blitz to a framework agnostic toolkit that preserves the world-class DX and features we adore but brings it to all Next.js users and optionally Remix, SvelteKit, Nuxt, etc. I’ve been taking stock of where we are with Blitz and of what we’ve accomplished in the almost 2 year journey together. What we have done is incredible. We invented a fullstack developer experience that is unmatched, enabled by our zero-API RPC data layer. So many tell us it makes them 5-10x more productive 🤯 Nearly 100,000 Blitz projects have been created. No doubt many of those are throwaway tests, but still, that's a ton!! We recently passed the 10,000 Github Stars milestone that so few reach. Our community has grown to 2,500 Discord members and is absolutely incredible. We’ve had almost zero negative incidents. Everyone is so kind and generous. We’ve also achieved incredible awareness. Tons of people are really impressed with what we’ve made. But at the end of the day, 99% go back to Next.js to build their production apps. The reality is that we are, and always will, play second fiddle to Next.js. And so sadly, 99% of people never get to benefit from what we've built. Growth has totally stagnated this year. Our weekly npm downloads is a perfectly flat line this year with around 5,000/week meanwhile Next.js downloads are growing exponentially and is now at 2.2 million per week. When we made the decision to fork Next.js, I expected that Blitz would start to carve out a small portion of Next.js users. But that absolutely hasn't happened. In fact, I think the fork has actually hurt adoption. That said, I still feel trying the fork was the right decision. I have a way better vision for what a Blitz toolkit should be now than I did then. The Next.js fork has nearly killed our feature momentum. And we are no longer executing on the vision we set out to solve. Instead we spend so much time spinning our wheels fixing weird package manager things, keeping up with nextjs changes (we have no inside knowledge of nextjs plans), etc. Lack of momentum and lack of growth really hampers our motivation. At the end of the day, I can't see anything that would significantly change our growth trajectory without a pivot. If we’re always going to play second fiddle to Next.js, the best solution is to find another instrument no one is already playing :) ProposalFirst let me say that the thought of not having Blitz is terrifying. I’m building the Flightcontrol dashboard with it, and I can’t imagine having to do it all from scratch without the Blitz DX. And I know I'm not alone in this. Many of you have told me the massive impact it has had on the productivity at your companies, your ability to hire and onboard developers, etc. So whatever would come next, it absolutely must preserve the DX and huge productivity wins that current Blitz has. Objectives
Therefore I’m proposing to pivot Blitz to a framework agnostic toolkit that preserves the world-class DX and features we adore but brings it to all Next.js users and optionally Remix, SvelteKit, Nuxt, etc. A toolkit for building anything with a database, from side projects to massive enterprise apps. A toolkit that both enhances fullstack DX and provides the missing backend components for JS that Rails and Laravel enjoy. Keep reading, I flesh out the vision more below. Trust & TransitionI really care about you all, the time and effort you’ve invested into Blitz, and your involvement in the community. It’s been a super fun journey, and we’ve come a long ways. But I truly feel we have reached the peak. I don’t see any possible way to go from here to the future we imagined and dreamed of, without a significant change. It’s time to face some realities and decide what is best for us all You all have put incredible trust in me, building many thousands of production apps on an alpha and then beta status framework. So I feel a heavy responsibility to not damage that. You have my word that, should we choose to pivot, I will do everything we can to make for a smooth transition from current Blitz to Next.js + Blitz Toolkit. This means preserving APIs as much as possible and heavy reliance on codemods to automate almost all changes including renaming imports from It would be very sad to lose Blitz as we currently know it (I’ve shed some tears). But many times in life we have to make difficult decisions to lose some things in order to gain even greater things. I’ve already discussed this privately with a sampling of folks from our community, and all of them have basically been like “yeah it would suck to have some sort of migration, it would be sad to lose what we have, but also it makes sense that this would be the best for us.” What The New Blitz Toolkit Could Look LikeThe New Future, Features, and PossibilitiesI originally set out to make the Ruby on Rails equivalent for Javascript and React. But I’m now of the opinion that the surface area for something like this is too massive for one framework to do well. Using a JS UI library like React or Vue adds so much more complexity to the problem. Complexity that Rails and Laravel knowing smirk :) However, I want to give huge props to RedwoodJS. They have done a way better job at executing on that very Rails-y flavor, at least in part because they've built everything from scratch. They also had ~1 year head start. If we take a look at the entire JS ecosystem, most of the money and effort is going into frontend frameworks, but very little into backend functionality like queues, cron jobs, etc. There are Nestjs and Adonis, but they aren’t exactly designed to work with frameworks like Next.js/Nuxt/Remix. This means there’s a huge opportunity for us to provide all of the backend features that Rails and Laravel enjoy, and do it in a way that all JS frameworks will love. It was always my intention to build these features for Blitz, but got bogged down too much to get to them. My vision for the new thing is an enterprise-ready fullstack toolkit with an emphasis on backend components. Blitz would be a DX booster pack you can add to anything to ship faster and have more fun. FeaturesI believe the core value that Blitz currently provides is 1) the zero-api data layer, 2) authentication, 3) authorization, 4) conventions, 5) new app templates & code scaffolding. A new toolkit would start with these as the foundation. I think almost everything Blitz currently adds would be migrated to the toolkit including recipes, typesafe Routes manifest, etc. Then we’d start shipping a ton more awesome things. Here’s the features I want to build. And all them would be standalone modules that you can use independent of the others.
New Zero-API Data Layer Setup
Server setup file // blitz.server.ts
import { setupServer, sessionMiddleware } from "@blitzjs/next"
// queries/mutations folders are no longer "magic".
// You know have to explicitly import into this setup file
import createProject from "app/projects/mutations/createProject"
import updateProject from "app/projects/mutations/updateProject"
// You can now have multiple resolvers in a single file
import * as projectQueries from "app/projects/queries"
// api, gSSP, gSP will be used to wrap everything for auth and middleware
export const { api, gSSP, gSP, Server } = setupServer({
middleware: [sessionMiddleware],
queries: {
...projectQueries,
},
mutations: {
createProject,
updateProject,
deleteProject,
},
})
export type Server = typeof Server Expose your server in an API route // pages/api/rpc/[...path].ts
export { Server as default } from "blitz.server"; Client setup file // blitz.client.ts
import { setupClient, clientSessionMiddleware } from "@blitzjs/next";
import type { Server } from "./blitz.server";
export const {
useQuery,
useQueries,
useInfiniteQuery,
useMutation,
queryClient,
BlitzProvider,
} = setupClient<Server>({
middleware: [clientSessionMiddleware],
}) Using Queries/Mutations on Client // some component or page
import {useQuery, useMutation} from 'blitz.client'
// Option 1 (strongly typed)
const [project] = useQuery.getProject({ id: 1 });
cosnt [createProjectMutation] = useMutation.createProject()
// Option 2 (also strongly typed)
const [project] = useQuery("getProject", { id: 1 });
cosnt [createProjectMutation] = useMutation('createProject') Wrap getServerSideProps // pages/ssr.tsx
import {gSSP} from 'blitz.server'
import getProject from 'app/project/queries/getProject'
// fully typed automatically
export const getServerSideProps = gSSP(async ({req, res, ctx}) => {
// access session
ctx.session.userId
// Directly call query fn, pass `ctx` through
const project = getProject({id: 1}, ctx)
return {
props: {}
}
}) Wrap getStaticProps // pages/static.tsx
import {gSP} from 'blitz.server'
import getProject from 'app/project/queries/getProject'
// fully typed automatically
export const getStaticProps = gSP(async ({queryClient}) => {
// Easily prefetch query to fill client side cache
await queryClient.prefetchQuery('getProject', {id: 1})
return {props: {}}
}) Wrap API routes // pages/api/hello.ts
import {api} from 'blitz.server'
import {trackEvent} from 'app/events/mutations'
const handler = api((req, res, ctx) => {
// access ctx and session
ctx.session.$authorize()
// Call query/mutation directly, pass ctx through
await trackEvent('api', ctx)
res.statusCode = 200
res.setHeader("Content-Type", "application/json")
res.end(JSON.stringify({ name: "Secured Agent" }))
})
export default handler Cons
Pros
Few Misc Notes
So What Now?DecisionFirst thing is to get all your feedback and make a decision on whether to move forward with this or not. Aiming to make a decision next week. We can also spawn off other RFC discussions to discuss feature and API specifics. Building The New Blitz ToolkitIf we move forward, there’s different paths to take, but I think the best is for Aleksandra and I to pause any new work on existing Blitz and focusing on shipping new Blitz Toolkit in January. At which point people could start building new apps with it or manually migrating existing Blitz apps. Then finish codemods etc that are needed to automate migrations as much as possible for everyone else. I would petition the Next.js team with all my might to accept as many of the current Blitz-only features as possible like app env loading with Status of Current BlitzYour existing Blitz apps will continue to run as they always have, and we will fix any critical bugs the come up. The current blitz codebase will remain. It may move to a different repo, but it will be preserved and we can continue to make releases as needed. Your FeedbackI know this is a big deal and has a big effect on all of us. You are probably feeling a number of emotions right now. So I invite you to avoid a knee-jerk reaction, take a little time to process it, and then please share your perspective on what we should do. 💜 |
Beta Was this translation helpful? Give feedback.
Replies: 62 comments 101 replies
-
A) Thanks so much for the honesty! I really love the product you made and feel confident that your future contributions (technological and cultural ) will help transform the Javascript ecosystem for the better. B) I'm fairly new to blitz ( 2 years developing as a whole ), but I just spent two months on a project that we were about to deploy (it's not a continual improvement thing, it's just done). Should I be putting effort into converting it to a NextJS project for future maintainability before delivering this product, or should I be good to deploy it as is? |
Beta Was this translation helpful? Give feedback.
-
Honestly everyone takes a risk using such a new framework but we all knew. I found out blitzJS while creating a website so I had to move all the nextJS project to blitzJS. I literally took me 2 weeks to do what it would have done in probably months with a lot of things to manage. Web development is constantly evolving, today the most used JS frontend framework is NextJS but I see a future for Svelte and probably there will be also a new one soon. I think that having an independent toolkit is the right path to take and take this project to the next level. |
Beta Was this translation helpful? Give feedback.
-
At first I was sad. Now this makes total sense. Currently prisma is the default orm for blitz. Would this continue being the case? |
Beta Was this translation helpful? Give feedback.
-
How about using Vite? I believe Vite is the future. Not only is it a very well-designed piece of Software but also a welcoming community. I've got to know the Vite folks while contributing to the Vite ecosystem and they are lovely people 😊. |
Beta Was this translation helpful? Give feedback.
-
Hey @flybayer, I appreciate the detailed write-up. A few months ago I decided to use blitz as the production framework for a new product I'm building. It's large codebase, it was a bit of a risk (with it not being at 1.0), but I was so compelled by the design decisions + community, that I took a chance on it. I had a slight recoil to the announcement, but in reflection, I think this is a strong move. And, I really respect the transparency and fortitude to suggest such a large pivot (especially so close to 1.0!). I'm not excited about a migration, but I'm happy to do it to be back on the nextjs release path as well as take advantage of the compelling feature list that you specify above. I'm pulling together various tools to accomplish many of the things that Blitz does not, I would love for things like queueing, mailers, etc. to be out-of-the-box. I'm confident continuing to deploy with Blitz in its current state. I'd love to punt on a migration until Q2 of next year, so would be greatly indebted to y'all for staying up with critical fixes in the meantime. I'll be starting a monthly contribution! Pausing on feature releases makes sense. Please let the community know where involvement / contribution could be helpful -- I'd love to take part. |
Beta Was this translation helpful? Give feedback.
-
I am 💯% on board with this ideaI agree with the premise of this proposal, blitz has grown into something that is very difficult to track and contribute to. I have been recently drawn to Remix, so I love the idea that going in that direction doesn't have to mean ditching Blitz. Plus it's great for Blitz to have such a clearly defined scope going forward. The foundational change in scope here is that Blitz can defer to the best practices and guidelines of your chosen host framework instead of trying to reinvent the wheel on everything. Some implications of this that I want to call attention to:
The main drawback to losing this is when you run a recipe that adds multiple pages/queries/mutations/utility files it was nice to have a single folder you could delete if you wanted to not use that recipe anymore vs having to find all the individual files it created. But that's a relatively minor complaint, overall getting rid of this will simplify matters for blitz.
Right now Blitz asks you which form library you want to use immediately when you create a new project. That always struck me as bad timing/a trick question. Possibly the user doesn't know what form library they should use and so they just have to guess. With this proposal, you can stick with whatever the host framework recommends for you. If you are doing Blitz + Remix, then the best form option is Remix's
It feels like there ought to be a default convention or DSL (probably tailored to the host framework) that I could work from, without having to manually register every query and mutation. Sort of like |
Beta Was this translation helpful? Give feedback.
-
👋 Happy to work with you to understand changes that could be pushed upstream to Next.js from the Blitz fork. This was well-written and very clear, kudos 🙏 |
Beta Was this translation helpful? Give feedback.
-
👏 Congrats on having the guts to see this situation and make this post. Couldn't have been easy. My thoughts:
|
Beta Was this translation helpful? Give feedback.
-
Hey! I understand where you are coming from. Competing with a powerhouse like Next (especially when Vercel seem to be hiring half of the best react talent out there at the moment) is daunting so I respect the reason you are looking to do this. Although I probably don't have much use for the toolkits proposed features right now - I have tried to work with some of this stuff in a previous role and it was a nightmare, so it would be cool to see what the blitz team can do in this space. I am not as happy about this as other people seem to be - but I understand the reasonings, and that will have to do for now :D |
Beta Was this translation helpful? Give feedback.
-
I love this proposal, especially the plan to possibly support frameworks other than Next.js. In light of that, I recommend you do everything you can to make this backend-agnostic. In Remix especially, some folks deploy to Cloudflare Workers, and they'll soon support Deno. Supporting those non-Node.js runtimes will even more important as time goes on and more compute happens at the edge. |
Beta Was this translation helpful? Give feedback.
-
Hi @flybayer, I'd like first to thank you and the rest of contributors for your dedication to this project and also I appreciate the chance you give us to participate in this discussion. I'd try to focus on these two paragraphs. Forgive me if my English is not too good.
I'd like to tell you why I decided to choose Blitz. I started a project using NextJS but after some weeks I started to struggle with documentation and I found that some things like authentication, convention about project structure... were not there. Then I started to look for an alternative, and I saw Blitz, but you know what? I didn't choose Blitz mainly because I saw "It's on beta". I know that it's silly but I wasn't sure about this bet, so I kept using NextJS once again until I found that I wasn't happy with I was doing so I ended trying Blitz and then I felt relieved. I understood docs, I liked how it was using the tools I added to NextJS like Prisma and thanks to your authentication option I was writing code happier than ever. I'd like that Blitz would come out of beta version as IMHO it would help Blitz to get more users, but I understand that it's not fine to struggle with NextJS as you state later. NextJS is great but Blitz helped me to use it in a better way and I will continue focusing on Blitz.
I'd like to be a better coder so I could help you more with Blitz so I can only give you this advice, if this pivot can reboot your motivation and gain more time for providing new features, please do it. You've shared your time with us and I think it's a thoughtful decision. I know that the community will do their best to migrate current code to the new framework. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the detailed proposal. I remain glad that I chose Blitz, for the inclusive culture as well as the technology. I once maintained a Rails app that was built during the Rails beta, by a Rails dev. The process of upgrading in those circumstances was painful indeed! I am keen to help find a way to smooth out the path here. Thanks again for all you've done. |
Beta Was this translation helpful? Give feedback.
-
Great writeup. Love the incremental adoption path for Next.js users, and the ability to bring this experience to most people. I've always felt the |
Beta Was this translation helpful? Give feedback.
-
starting w basic data: I do think it would be interesting if we could find out why the spike in March has come and gone to me it looks like blitz has gone from 2k/week to 5k/week and next has gone from .8M/week to 2.2M/week. Not a major proportional difference imo. (although we would really want to compare to Next in 2017, not this year) I can see if you were expecting exponential growth there is a problem but I'm not convinced we have hit the exponential increase part of the S curve yet. Scaffolding seems to be a core value prop imo and we still have plenty of room to go. Kudos on recently merging this feature for example: beyond the data, to the main discussion: Let me argue in favor of 'playing nice with Next' Before I do that, let me be clear that 'playing nice with' doesn't need to mean maintaining a fork. However, we all know that Next released some really cool features this year and as a developer I want to be able to use those. As long as Blitz enhances Next, I love Blitz, but as soon as Blitz becomes hard to use with Next, I expect to lose out on the current use case (true, maybe it will find some other use cases) I see a tradeoff between "wide scope" and "deep scope" and I would personally prefer deep scope. I don't want a CLI tool that can scaffold a single basic form over many languages and frameworks. I want a CLI tool that can generate complex code within React world. Consider the I also worry that becoming framework-agnostic is a step away from the value prop which is to have strong opinions. Next is the go-to SSG+SSR in React world and Blitz enhances Next. If Blitz stops enhancing Next, Next will remain the go-to and Blitz will be what? A competitor? An incentive to use Svelte or Remix? That seems to be a worse situation. In conclusion, i think it's basically a mistake to change the vision for Blitz. The new vision seems to align with a new and different project. We could simply have two different projects. The cost would be split attention, but the benefit would be A/B testing the growth curve. I'd recommend A/B testing personally. |
Beta Was this translation helpful? Give feedback.
-
Full support on the pivot ❤️🚀 I'm definitely a fringe user who avoided building anything real with blitz because a pivot like this hadn't happened yet. Moving to an add-on for fresh next projects (and perhaps in the future remix etc) would convince me this project is future-proof enough to build stable apps upon. I'd definitely love to see the next ecosystem fully embraced before an over-extension into other ecosystems too :) |
Beta Was this translation helpful? Give feedback.
-
For whatever reason, if we give up a project before it reaches version 1.0, I think it's a pity! In my opinion, we should at least reach |
Beta Was this translation helpful? Give feedback.
-
We have considered blitz for an application we are developing and didn't choose it. That's because the
To me, blitz is a full-stack framework. And frameworks tend to make decisions for you. NextJS as a web-framework decided to build on top of React. They provide their own solutions to analytics, images, APIs, etc. That's many decisions that teams don't need to make any more. I liked how Blitz as a full-stack framework went further, being based on NextJS. Choosing Prisma for Database connections, providing solutions to sessions and auth. A blitz-toolkit will provide some flexibility while loosing all the advantages of a framework. Also, for the maintainers, supporting all web-frameworks or component libraries will most likely be more complicated to support. |
Beta Was this translation helpful? Give feedback.
-
It would be nice if Blitz were like Nestjs; having fullstack, microservice and serveless capabilities. But without the complication that is Nestjs. |
Beta Was this translation helpful? Give feedback.
-
I totally understand where the idea comes from and I respect your decision if this happens. While I am not a fan of this switch. Our stack is stable (React + Next) and we just launched a product using Blitz. If you increase the codebase to support other frameworks the quality of support for our stack will collapse and the chance is high we have to rewrite the codebase using a more focused framework which I d like to avoid. Would it not be better and safer to start another project if you feel Blitz is not fun to make anymore? |
Beta Was this translation helpful? Give feedback.
-
There's a lot of truth in these observations @paulm17, @PixelsCommander, especially in comparing this to Prisma and regarding project scope vs available (very limited) resources. I consider the new Blitz.js (beware, elevator pitch) "the Prisma for frontend". There's a central difference, though. Prisma needs to wrap and map multiple fundamentally different databases to a single unified interface, to deliver its value. Blitz, as any other JS-library, does not have to do that. The adaption for frameworks like Next.js or Remix is not comparable to that. That's because web frameworks like Next etc. usually tend to work with other JS-libraries, or at least, with other React libraries. As long as the common denominator is React, I don't consider the effort in the same league as what Prisma has to do. I think the effort is in fact far less than maintaining that Next.js fork. That said - I share your view, that project scope should be super-narrow, sharp and focussed - at least in the beginning.
|
Beta Was this translation helpful? Give feedback.
-
Update Jan 11, 2022Thank you everyone for all your input!! We are moving forward with the toolkit pivot, focusing primarily on nextjs support and a fully seamless migration from current blitz. I can't promise a timeline, but we're eyeing February. And after a very short beta/preview period, we'll release it as 1.0. We'll post general updates here. And we'll post zero API updates to the zero API RFC as we have them. And if there's any other things with more than small changes we'll post RFCs for them too. If/when we get to place where it's easy for y'all to contribute to cleanly scoped issues, we'll let you know. I hope your January is going well, and you're staying safe! |
Beta Was this translation helpful? Give feedback.
-
As a Next.js Dev I am thrilled to adopt blitz into my current project and maybe further projects as well. And I think @flybayer has true balls to 1. try to compete with next, but 2. also does not fear to officially stand up and make a pivot in to the direction were most of devs can benefit from. You are my hero bro :) |
Beta Was this translation helpful? Give feedback.
-
Just wanna say once I can use Blitz with Vue I will jump ship from Laravel immediately. Thanks for all your work. |
Beta Was this translation helpful? Give feedback.
-
Super excited for this pivot, are there any rough estimates as to when we can expect the newest pivoted version of blitz 🙃? |
Beta Was this translation helpful? Give feedback.
-
For the proposed new toolkit, is the implementation of the "Zero-API Data Layer" feature 'almost' complete? Could you pl. tell me the names of the folders / files where this code is lying. I am following Blitz closely since the last one year. When you decided to import the Next code in Blitz and started modifying it, I was like Blitz may fail because of this. Well, you have finally decided to make Blitz framework-agnostic, I appreciate it. You are looking forward to make Blitz a feature-rich full-stack framework. A suggestion in this regard. Keep it as flexible as possible and try to use the proven, stable Node modules. For example pino and winston are very popular loggers. If possible, create a logger plugin in Blitz and the developers should be able to plug the existing logging module of their choice. Similarly for Message Queues, let them use bull or kafka. |
Beta Was this translation helpful? Give feedback.
-
Greetings, I was just curious as to the status of the Blitzjs pivot. Mostly, I was just curious as to when we could get our hands on the first build post-pivot 😄 |
Beta Was this translation helpful? Give feedback.
-
Just recently I've started to use Blitz and I've to admit, that the DX is top. The actual comparison with nextjs is difficult. Next has a solid funding, I am seeing vercel ads on twitter every day. Next.js is there since end 2016 and got support from some influential people like Arunoda Susiripala who was very influential in the Meteor.js community. So, I would say you need to start a company, which will provide hosting, db, file uploads, image-compression/rendering, real-time features, GDPR conform analytics etc. and provide a full-packaged dev solution to users to get the right funding. However, you definitely have to sell services and heavily advertise the product, to grow the user base. |
Beta Was this translation helpful? Give feedback.
-
Hi, I remember the original post talking about allowing sveltekit. The only thing stopping me from this is having to use react. Are you guys going to work with sveltekit in the timeline? |
Beta Was this translation helpful? Give feedback.
-
Honestly didn't want this to happen all together but after considering the entire framework landscape right now , i feel this is more than the right way to go. Make Blitz more of a language tools than a framework tool |
Beta Was this translation helpful? Give feedback.
Update Jan 11, 2022
Thank you everyone for all your input!!
We are moving forward with the toolkit pivot, focusing primarily on nextjs support and a fully seamless migration from current blitz.
I can't promise a timeline, but we're eyeing February. And after a very short beta/preview period, we'll release it as 1.0.
We'll post general updates here. And we'll post zero API updates to the zero API RFC as we have them. And if there's any other things with more than small changes we'll post RFCs for them too.
If/when we get to place where it's easy for y'all to contribute to cleanly scoped issues, we'll let you know.
I hope your January is going well, and you're staying safe!