zlacker

[parent] [thread] 10 comments
1. johnco+(OP)[view] [source] 2025-12-03 03:26:59
He may have been serving a game in a canvas hosted in a Next.js app, but have done all the actual game (rendering, simulation, etc.) in something else. That’s a decent approach - Next can handle the header of the webpage and the marketing blog or whatever just fine.
replies(1): >>komali+j1
2. komali+j1[view] [source] 2025-12-03 03:39:32
>>johnco+(OP)
But like... so can an index.html with a script tag? Am I missing something, where did you read that there was a lot of work involving the header or an attached marketing blog?
replies(2): >>shortr+F1 >>johnco+v4
◧◩
3. shortr+F1[view] [source] [discussion] 2025-12-03 03:43:06
>>komali+j1
index.html with script files would still benefit from a bundler. You can have a very minimal react footprint and still want to use react build tools just for bundling.
replies(1): >>komali+H2
◧◩◪
4. komali+H2[view] [source] [discussion] 2025-12-03 03:53:23
>>shortr+F1
Sure, but I'm more confused about the next.js usage than I am about the bundler. The bundler makes sense.
replies(1): >>johnco+G4
◧◩
5. johnco+v4[view] [source] [discussion] 2025-12-03 04:15:33
>>komali+j1
My point isn’t that you absolutely need that, just that the negative effect on your game development are pretty minimal if you’re not leaning on the SPA framework for anything related to the game. If your game is going to be embedded into an otherwise normal-ish website, this isn’t a terrible way to go (I’ve done it personally with a game mostly written in Rust and compiled to WASM). You can get gains by splitting your game and web site bundles and loading the former from the latter explicitly, but they’re not massive if your bundler was already reasonably incremental (or was already esbuild).

Thanks for assuming I “read” about bundlers somewhere, though. I’ve been using (and configuring) them since they existed.

replies(1): >>komali+Gd
◧◩◪◨
6. johnco+G4[view] [source] [discussion] 2025-12-03 04:18:36
>>komali+H2
What effect do you imagine Next.js has on a bunch of code manipulating an HTML canvas? For vanilla code directly using browser APIs it’s basically just a bundler configuration, and while it’s not optimally configured for that use case (and annoying for other reasons) it’s probably better than what someone who has never configured webpack before would get doing it themselves.
replies(1): >>komali+Cd
◧◩◪◨⬒
7. komali+Cd[view] [source] [discussion] 2025-12-03 06:12:17
>>johnco+G4
Well for one, it ships next.js and react.js bundled in with the code manipulating an HTML canvas.
replies(1): >>johnco+Pe
◧◩◪
8. komali+Gd[view] [source] [discussion] 2025-12-03 06:13:27
>>johnco+v4
I meant specifically was there something I was missing about the Bun developer's game that required a complicated header and thus next.js.
◧◩◪◨⬒⬓
9. johnco+Pe[view] [source] [discussion] 2025-12-03 06:29:31
>>komali+Cd
Okay, but it’s a web game. Those will make up less than 0.1% of the downloaded bytes required to render the first frame of the game. One image asset will dwarf the entire gzip/brotli Next.js/React framework.
replies(1): >>timcam+Ki
◧◩◪◨⬒⬓⬔
10. timcam+Ki[view] [source] [discussion] 2025-12-03 07:11:26
>>johnco+Pe
What is the use case for bundling next.js with the web game? Just the layout of the page surrounding the game canvas? It just seems unnecessary, that's all. Traditionally, software development in general and game development in particular has tried to avoid unnecessary overhead if it doesn't provide enough value to the finished product.

It's obvious why he didn't write the game in x86 assembly. It's also obvious why he didn't burn the game to CD-ROM and ship it to toy stores in big box format. Instead he developed it for the web, saving money and shortening the iteration time. The same question could be asked about next.js and especially about taking the time to develop Bun rather than just scrapping next.js for his game and going about his day. It's excellent for him that he did go this route of course, but in my opinion it was a strange path towards building this product.

replies(1): >>johnco+kV1
◧◩◪◨⬒⬓⬔⧯
11. johnco+kV1[view] [source] [discussion] 2025-12-03 17:31:57
>>timcam+Ki
Why would he stress about a theoretical inefficiency that has very little effect on the finished product or development process? Especially one that could be rectified in a weekend if needed? The game industry is usually pretty practical about what it focuses on from a performance perspective with good reason. They don’t build games like they’re demosceners min-maxing numbers for fun, and there’s a reason for that.

I also wonder how many people who sing the praises of an HTML file with a script tag hosted by Nginx or whatever have ever built a significant website that way. There’s a lot of frustrating things about the modern JS landscape, but I promise you the end results were not better nor was it easier back before bundlers and React.

[go to top]