lhapaipai / vite-bundle

Integration with your Symfony app & Vite
https://symfony-vite.pentatrion.com
MIT License
215 stars 23 forks source link

`Pentatrion\ViteBundle\Service\EntrypointRenderer` does not implement `Symfony\Contracts\Service\ResetInterface` #78

Closed FluffyDiscord closed 7 months ago

FluffyDiscord commented 8 months ago

vite-bundle version

v6.3.2

vite-plugin-symfony version

6.3.2

your OS, Symfony version, PHP version, Node version

No response

Description

Currently I am unable to run my Symfony in worker mode using RoadRunner because after the first request EntrypointRenderer fills up it's $renderedFiles array and following requests skip rendering the entrypoints. because the array is not cleared. EntrypointRenderer already has ->reset() function, but it seems that you have forgotten to register the class to be resetable by implementing the ResetInterface, so it's currently not working.

How to reproduce

Not relevant

Possible Solution

No response

lhapaipai commented 7 months ago

hi @FluffyDiscord, I implemented the reset() method for another need. I had seen that ResetInterface and its tag kernel.reset existed but I didn't understand what it was for... thank you, I now understand!

I tested with FrankenPHP (worker mode) and added a new playground : https://github.com/lhapaipai/symfony-vite-dev/tree/main/playground/worker-mode . Can you confirm that everything is ok with RoadRunner?

FluffyDiscord commented 7 months ago

Can confirm its fixed with dev-master

lhapaipai commented 7 months ago

great ! ps : you don't have to stay on a development branch, the patch was applied in version 6.3.3