Plugins getting destroyed on game create and hot reload

Aberta
#7 5 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
25/100
Tipo de issue
Bug
Clareza
Precisa de esclarecimento
Status de atividade
Estagnada
Stack de tecnologia
javascript, react, vite
Domínio
frontend, game-dev

Direção de pesquisa

Reproduce the plugin behavior using the minimal example linked in the issue and the template's src/game/PhaserGame.jsx, especially lines 11–32. Compare browser refreshes with React-file and Phaser-related hot reloads, then verify that the plugin lifecycle behaves as expected in both the JavaScript and TypeScript templates.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

I have been trying to use a plugin with this template but it just gets destroyed, minimal example can be found at https://github.com/KlutzyBubbles/phaser-react-plugin

However is only gets destroyed when a browser refresh or hot reload of phaser related files happens, but works fine when react files are hot reloaded.

Below is an image where 1 is a browser refresh, 2 is a hot reload from a react file and 3 is a hot reload from a scene file.

Image

The only spot i can see the game being destroyed which could trigger the plugin destroying is https://github.com/phaserjs/template-react/blob/db8c134eb6328ba5d08eb4ef77270f38e2e0b9b9/src/game/PhaserGame.jsx#L11C4-L32C15 but i don't know what to do to fix it. Any help or pointers would be greatly appreciated.

This can also be replicated in the typescript version of this template

Linguagem predominante
JavaScript
Estrelas
155
Forks
52
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Issues semelhantes

Mais issues de JavaScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.