News for hackers. Stuff that matters.
Re:Blitz.js – Fullstack Toolkit for Next.js by bluelightning2k on Monday August 15, 2022 @10:53AM (#32470439)
This looks awesome. Really enjoyed the tech talk (just watched it on YouTube). You present well!

There's 2 problems though: 1. Does the Blitz RPC thing work the same way as TRPC? If so then it will suffer the same slowdown at scale and basically have to be removed once a project reaches a certain size?

2. Having got used to Vite I just cannot go back to Webpack (which IIRC Next still wraps).

Re:Blitz.js – Fullstack Toolkit for Next.js by flybayer on Monday August 15, 2022 @10:59AM (#32470510)
> 1. Does the Blitz RPC thing work the same way as TRPC?

Depends what you mean by "same way". Yes in that both provide fully typesafe client-server communication. No in that the Blitz implementation is a tiny fraction of the size and does not have any Typescript-related performance slowdown at scale like TRPC.

The Blitz RPC tech itself will scale forever. However as a company scales it'll probably face another problem which is API contracts between internal teams. When you hit that, you may want to adopt GraphQL.

> 2. Having got used to Vite I just cannot go back to Webpack (which IIRC Next still wraps).

Yep, I want Next.js to get off webpack too

Re:Blitz.js – Fullstack Toolkit for Next.js by bluelightning2k on Monday August 15, 2022 @11:14AM (#32470745)
I'd strongly suggest having a direct comparison vs. tRPC page in the documentation. I doubt we're alone in being curious, and this is the real flagship feature.

Since you say Blitz is no longer tied to Next - does that mean it can be used with Vite? Again I doubt I am alone in thinking this would be huge.

I've said it in other comments but to repeat - I think this is super interesting.

Honestly I can't decide whether this is a framework or a feature. But it's definitely interesting.

Re:Blitz.js – Fullstack Toolkit for Next.js by flybayer on Monday August 15, 2022 @11:38AM (#32471049)
> I'd strongly suggest having a direct comparison vs. tRPC page in the documentation

Yes, it's coming.

> does that mean it can be used with Vite?

Yes, but we do have a bit more work to clean up our internal package dependencies and APIs so that this works.

Re:Blitz.js – Fullstack Toolkit for Next.js by alexdotjs on Monday August 15, 2022 @05:33PM (#32475677)
It won't scale forever. You'll need project references in the same way as we need in tRPC on large projects.
Re:Blitz.js – Fullstack Toolkit for Next.js by flybayer on Monday August 15, 2022 @05:38PM (#32475747)
Unless I'm missing something, Blitz RPC add's zero TS overhead. So the limitation will be the total amount of TS code you have which is not related to Blitz.
Re:Blitz.js – Fullstack Toolkit for Next.js by emptysea on Monday August 15, 2022 @10:57AM (#32470492)
I’ve never used TRPC but curious to learn more about the slowdown. Is that a slowdown with Typescript or a runtime thing?
Re:Blitz.js – Fullstack Toolkit for Next.js by bluelightning2k on Monday August 15, 2022 @11:09AM (#32470669)
By their own admission (or at least those of their advocates who I've paid attention to) tRPC isn't suitable for large projects.

tRPC as I understand it basically serves definition files to the client using a clever misuse of Typescript - but over time that means Typescript has to conditionally evaluate every type in your app to find the correct one. Or something like that.

My understanding of BlitzRPC from their documentation is it's more Svelte-like with the "everything is a magic compiler" philosophy. This may come with issues but it sounds pretty nice.

Re:Blitz.js – Fullstack Toolkit for Next.js by flybayer on Monday August 15, 2022 @11:41AM (#32471093)
> with the "everything is a magic compiler" philosophy

Blitz RPC has 1 minimal magic step, which is a webpack step to replace the resolver imports in client code with a fetch function and to add resolvers to the server-side API endpoint.

And we'll be adding an API that lets you use Blitz RPC without webpack or any compile step.

Re:Blitz.js – Fullstack Toolkit for Next.js by zamalek on Monday August 15, 2022 @01:15PM (#32472445)
The slowdown occurs in the editor (red squiggles, autocomplete, etc.). tRPC relies heavily on TS inference, which the TS team strongly discourage due to performance concerns.
Re:Blitz.js – Fullstack Toolkit for Next.js by flybayer on Monday August 15, 2022 @11:01AM (#32470547)
Slowdown with Typescript and IDE completion. Not runtime.