companieshouse / MojoX-Plugin-Hook-BeforeRendered

Add before_renderer hook to Mojolicious. This allows non-blocking activities to take place just before content is rendered to the client.
Other
1 stars 2 forks source link

Update to support most recent version of Mojolicious (7.78) #4

Closed marcransome closed 6 years ago

marcransome commented 6 years ago

Note that the use of reserved mojo.* stash variables (a pre-existing issues with this code) means that this module is tied to the internal implementation details of a particular version of Mojolicious and may break when upstream changes are made. 😅

macreman commented 6 years ago

changes look fine but if you have a link to the relevant change/upgrade notes detailing this it would be worth including here for reference

marcransome commented 6 years ago

There wasn't a specific announcement I could find as this appears to be an internal change, but for reference I've reviewed a legacy version of the source against the latest version (7.78):

Previously, the code in this module was bound to the assignment of a timer by the Mojolicious framework to the reserved mojo.started stash variable (see the 'legacy' link above). In the latest version of the framework, this has been replaced with a helper which assigns the timer to the mojo.timer key of a mojo.timing hash: https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Plugin/DefaultHelpers.pm#L166.

mojo.started is still used in other places, but it appears that the mojo.timing hash was added specifically to store timers for various things, so the change in purpose affects our dependency on this code.