rompetomp / inertia-bundle

Inertia.js server-side adapter for Symfony
MIT License
151 stars 36 forks source link

(Needs testing) Serialization fix for X-Inertia requests #11

Closed innocenzi closed 4 years ago

innocenzi commented 4 years ago

I made a mistake in #10. I allowed the usage of the serializer component, but I only implemented it for the first requests, the ones that use Twig.

Because of that, the subsequent requests made with Inertia would not be serialized. To fix this, I had to move the serialization inside the implementation of InertiaInterface.

Also, instead of injecting the container, I injected directly the serializer. I'm not sure how DependencyInjection will behave if the serializer is not installed, although tests are passing.

That being said, I could not write specific tests because I lack knowledge in Mockery, and this is needed to fake a use of the Serializer object.

If you could make tests and correct the service definition if I edited it in the wrong way because of the optional nature of the serializer service, it would be great. Thank you!

eznix86 commented 4 years ago

Why it is not merged yet ?