Any thoughts on making the Phaser module import pure? As in, not requiring window or canvas etc?
The main reason I ask is that I’d like to run my simple non-dom related classes without jsdom and jest-canvas-mock (ie: faster). However, I do use non-dom utilities from Phaser even in some of these classes (eg: Phaser.Math.Clamp). At this point I have to extract those calls to another component that can then be mocked or use jsdom and the canvas mock just to test the simplest of functions because
import Phaser relies on the dom and canvas being available.
I’d expect any code that relies on
window or canvas operations to only run once
Phaser.Game(config) is called. Maybe I’m missing something or doing something silly?