pixi-viewport icon indicating copy to clipboard operation
pixi-viewport copied to clipboard

move interaction to events

Open davidfig opened this issue 2 years ago • 5 comments

This is a branch off of the @cuire v7 branch. This is the branch that will publish to pixi-viewport v5.

I moved options.interaction to options.events and made it a required option. This is a breaking change but thought it was necessary.

Everything seems to be working properly, but I am having some issues with the yarn build command. @cuire can you help out?

davidfig avatar Jan 08 '23 12:01 davidfig

Hey @davidfig. I completely forgot to test build process, cos I used vite from docs branch to test it. My bad, Ill check it now. 😐

cuire avatar Jan 08 '23 16:01 cuire

I found that build breaks because of these lines:

import { Point, Rectangle } from '@pixi/core';

When that works fine:

import { Point, Rectangle } from '@pixi/math';

Most likely something is wrong with build config.

And I had no idea what was causing api-extractor to throw an error, config remains the same

Details Error: src/InputManager.ts:1:1 - (ae-wrong-input-file-type) Incorrect file type; API Extractor expects to analyze compiler outputs with the .d.ts file extension. Troubleshooting tips: https://api-extractor.com/link/dts-error

Im continuing the investigation

cuire avatar Jan 08 '23 17:01 cuire

@davidfig Do you have any thoughts on this?

cuire avatar Jan 08 '23 17:01 cuire

@cuire That was the error I was seeing as well. I don't have a strong understanding of pixi's new build process so I have nothing much to add. I can do a bit more digging if needed, though.

davidfig avatar Jan 08 '23 17:01 davidfig

FWIW I tried out this branch and got things working by disabling sourcemaps in rollup.config.js - I'm sure not the solution you're looking for but if it helps here it is:

import { main } from '@pixi-build-tools/rollup-configurator/main';

export default main({
    excludeExternals: ['penner'],
    production: true,
    sourcemap: false,
});

I'm afraid I'm not familiar enough with rollup to help further.

I also removed @pixi/math and @pixi/ticker from peerDependencies to get rid of the build warnings.

Mobius5150 avatar Jan 18 '23 17:01 Mobius5150