Pixi.js Lifecycle Audit
Key Files
- •
src/components/PixiStage.jsx— main Pixi.js Application mount point (React component) - •
src/components/PixiStageController.js— orchestrates Pixi stage lifecycle - •
src/utils/pixiStageUtils.js— Pixi utility helpers for setup/teardown - •
src/scenes/Gig.jsx— scene that hosts the rhythm game Pixi stage - •
tests/pixiStageUtils.test.js— existing tests for Pixi utilities
Workflow
- •Read
PixiStage.jsxand locatenew Application()creation — verify it runs inside auseEffectwith proper cleanup. - •Confirm the cleanup return function calls
app.destroy({ children: true, texture: true, baseTexture: true })and stops the ticker. - •Check
PixiStageController.jsfor refs — confirm they are nulled on unmount. - •Verify
Gig.jsxscene transitions don't leave orphaned Pixi instances (check unmount path). - •Check for
addEventListener,setInterval, orrequestAnimationFramecalls and ensure they are disposed.
Output
- •Report missing cleanup paths with file and line references.
- •Provide the correct cleanup snippet if needed.
Related Skills
- •
webaudio-reliability-fixer— audio leaks often accompany Pixi lifecycle issues - •
perf-budget-enforcer— memory leaks directly impact performance budgets