template-nextjs icon indicating copy to clipboard operation
template-nextjs copied to clipboard

app router port

Open justin-calleja opened this issue 4 months ago • 2 comments

Ports it to using app router. Can be kept in a separate branch and linked to in README.md for example.

Cannot target any other branch than main from here though.


[!NOTE] Migrates to Next.js App Router with client-only Phaser setup, adds integration docs, updates TS config, and bumps Phaser to 3.90.0.

  • App Router Migration:
    • Add src/app/layout.tsx, src/app/page.tsx, and src/app/ClientAppWrapper.tsx (SSR disabled via dynamic(..., { ssr: false })).
    • Remove legacy src/pages/* files.
  • Phaser Integration:
    • Refine PhaserGame lifecycle and event wiring; maintain React ↔ Phaser communication.
    • Add docs: phaser-nextjs-integration.md detailing architecture and modal usage.
  • Config:
    • Update tsconfig.json with Next plugin and includes.
  • Dependencies:
    • Upgrade phaser to ^3.90.0.

Written by Cursor Bugbot for commit 6549a67c3367f4d980b05d305c1b439e5a38dd27. This will update automatically on new commits. Configure here.

justin-calleja avatar Sep 22 '25 09:09 justin-calleja

Ports it to using app router. Can be kept in a separate branch and linked to in README.md for example.

Cannot target any other branch than main from here though.

Good luck! Just pointing out this is basically a dupe of a PR I made many months ago now: https://github.com/phaserjs/template-nextjs/pull/3

It seems these sorts of PRs are not a priority at the moment for them, they are focused on new core releases and the editor. I definitely sympathize with the PR though, maybe you will have better luck on getting a merge than I, especially since yours appears in sync w the current main. 🫡

ospira avatar Oct 10 '25 15:10 ospira

Hi @ospira - yep saw yours afterwards. Good to have a couple of references around. At least for me - not the most straightforward thing in the world to put a phaser game in a next.js app.

justin-calleja avatar Oct 10 '25 16:10 justin-calleja