Rapid icon indicating copy to clipboard operation
Rapid copied to clipboard

Convert globbed imports from PIXI to explicit package imports

Open Bonkles opened this issue 3 years ago • 1 comments

Currently our code is sprinkled with

import * as PIXI from 'pixi.js';

we should REALLY convert these to explicit imports a la:

import {Container, Rectangle} from 'pixi';

The latter will allow esbuild to tree-shake more effectively and get rid of things we don't use.

Bonkles avatar Oct 20 '22 17:10 Bonkles

Did some work on this today but it seems that we have some snags:

  1. Resource loading doesn't work the same way apparently- the Promises being returned by the loader aren't including the 'textures' object which the helpers.js and others rely on.

  2. The Pixi debugger chrome extension relies on a full bundle to be defined as PIXI

  3. There were no bundle size savings even after doing it.

(stored on my local 'import_rework' branch)

Bonkles avatar Dec 08 '22 18:12 Bonkles