pixijs / customize

Customize the list of packages to use for PixiJS v5
https://pixijs.io/customize
11 stars 5 forks source link

Minimal installation should work out of the box #16

Closed prichey closed 4 years ago

prichey commented 4 years ago

Hi there,

I'm trying to get a minimal bundle working as a proof of concept. If you uncheck all of the non-required options, the Bundler output is as follows, which doesn't actually export anything:

// Renderer plugins
import { Renderer } from '@pixi/core';

I'm trying to get a slightly less minimal app (basically, the required options + text, graphics, and application) and am running into issues. Specifically, the error I'm getting is this.currentRenderer is undefined (the sourcemap links to this line, if that's helpful).

I'm thinking that I need to call some method on the Renderer to wire up some of the internals but I'm not certain what that should actually look like. If you need further clarification I'm happy to try to put together a minimal codepen. Thanks!

prichey commented 4 years ago

I figured it out. The output should include the following:

import { Renderer, BatchRenderer } from '@pixi/core';
Renderer.registerPlugin('batch', BatchRenderer);

At least in my instance this seems to work. I'll look into making a PR to fix this

ivanpopelyshev commented 4 years ago

Yes, that's really minimal.

Btw, it takes '@pixi/display' with it, you need DisplayObject's, right? I want to remove that dependency after a few refactorings.

bigtimebuddy commented 4 years ago

Yeah @ivanpopelyshev it would be good to fix that! That’s such a silly dependency on display.

bigtimebuddy commented 4 years ago

When I deselect all options I get the following. Are you not seeing that @prichey?

export * from '@pixi/constants';
export * from '@pixi/math';
export * from '@pixi/runner';
export * from '@pixi/settings';
export * from '@pixi/ticker';
import * as utils from '@pixi/utils';
export { utils };
export * from '@pixi/display';
export * from '@pixi/core';

// Renderer plugins
import { Renderer } from '@pixi/core';
import { BatchRenderer } from '@pixi/core';
Renderer.registerPlugin('batch', BatchRenderer);
prichey commented 4 years ago

So this is weird: in one tab, I hard refresh the page and get the following, which I described above.

Screenshot 2020-03-01 10 46 19

But if I open a fresh tab, I get the output as expected. Looks like somehow my local state got messed up with some permutation of toggling but since I don't have steps to reproduce I'll go ahead and close the issue! Sorry for the false alarm!

prichey commented 4 years ago

So I actually figured out what was causing this but it should probably be a separate issue so I'm going to open up a new one to track. Somehow, I got to the unsecured version of /customize which is broken as described above (http://pixijs.io/customize/). The https version works fine! https://pixijs.io/customize/. No idea what state voodoo is happening but looks like that's what did it.

EDIT: reopened this accidentally, sorry about that