Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix for #531 #533

Open
wants to merge 5 commits into
base: beta
Choose a base branch
from

Conversation

thejustinwalsh
Copy link

@thejustinwalsh thejustinwalsh commented Aug 30, 2024

Description of change

Generates a failing test for issue #531
Potential fix for #531; please modify or review as necessary.

Fixes: #531

Pre-Merge Checklist
  • Tests and/or benchmarks are included
  • Documentation is changed or added
  • Lint process passed (npm run lint)
  • Tests passed (npm run test)

Copy link

codesandbox-ci bot commented Aug 30, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e651448:

Sandbox Source
pixi.js-sandbox Configuration

@thejustinwalsh
Copy link
Author

@trezy 'handles subsequent loads' is failing in the way that is described in #531. I'll be out for the next few days, so I won't have time to research further at the moment, hope this test helps.

@thejustinwalsh thejustinwalsh marked this pull request as ready for review September 1, 2024 13:39
@thejustinwalsh
Copy link
Author

thejustinwalsh commented Sep 1, 2024

I took a crack at a fix, and the failing test I submitted is now passing. I attempted to make the test more robust as well.
I also simplified the SSR code path here, but it may be more straightforward to unwind that change.

The key to my fix is to use the resolved assets if they are already resolved by the time an additional hook is called.

However, we may need a better test that validates that the texture has the correct data and does not simply return a default texture instance. This could potentially be verified via the width and height of the texture being mocked to something specific, and for good fun, increasing the timeout delay for resolving the promise in createImageBitmap.

@trezy trezy added v8 Issues related to Pixi React v8 bug Something isn't working labels Sep 2, 2024
@thejustinwalsh thejustinwalsh changed the title refactor: lower level mock to capture bug #531 fix: fix for #531 Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v8 Issues related to Pixi React v8
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants