Skip to content

refactor: Extract worker, Phaser, and loading state from WebGPUGameCa…#1148

Merged
braedonsaunders merged 1 commit into
mainfrom
claude/refactor-game-canvas-NFxbW
Jan 30, 2026
Merged

refactor: Extract worker, Phaser, and loading state from WebGPUGameCa…#1148
braedonsaunders merged 1 commit into
mainfrom
claude/refactor-game-canvas-NFxbW

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner

…nvas

Phase 1 refactoring to address architectural drift in WebGPUGameCanvas:

  • Extract useWorkerBridge hook (~150 lines): Manages WorkerBridge lifecycle, MainThreadEventHandler, Game instance creation, and cleanup
  • Extract usePhaserOverlay hook (~90 lines): Manages Phaser game initialization, OverlayScene setup, loop worker for background tab immunity, resize handling
  • Extract useLoadingState hook (~70 lines): Manages loading progress, status, WebGPU detection, and fade-in animation

Also removes misleading "thin orchestrator" comment that no longer reflected the component's actual responsibilities.

WebGPUGameCanvas reduced from 762 to 455 lines while maintaining all functionality.

https://claude.ai/code/session_01DEkmgBgFkFphjaihcce7yu

…nvas

Phase 1 refactoring to address architectural drift in WebGPUGameCanvas:

- Extract useWorkerBridge hook (~150 lines): Manages WorkerBridge lifecycle,
  MainThreadEventHandler, Game instance creation, and cleanup
- Extract usePhaserOverlay hook (~90 lines): Manages Phaser game initialization,
  OverlayScene setup, loop worker for background tab immunity, resize handling
- Extract useLoadingState hook (~70 lines): Manages loading progress, status,
  WebGPU detection, and fade-in animation

Also removes misleading "thin orchestrator" comment that no longer reflected
the component's actual responsibilities.

WebGPUGameCanvas reduced from 762 to 455 lines while maintaining all functionality.

https://claude.ai/code/session_01DEkmgBgFkFphjaihcce7yu
@braedonsaunders braedonsaunders merged commit 0301cbd into main Jan 30, 2026
4 checks passed
@braedonsaunders braedonsaunders deleted the claude/refactor-game-canvas-NFxbW branch January 30, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants