Roda 3.106.0 Released #425
jeremyevans
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Roda 3.106.0 has been released!
New Features
A shape_friendly plugin has been added, which makes Roda's scope,
request, and response objects shape-friendly, meaning they use the
same instance variables in the same order. This can significantly
improve performance in some cases on Ruby 3.2+, especially with
YJIT.
In order for this to work, plugins must report which instance
variables that they use. This is done by checking for three
constants in the loaded plugins:
If these constants are defined in the plugin's module, they should
be arrays of instance variable symbols, and the instance variables
will be set to nil during the initialization of the related objects.
For application-specific instance variables that are set in the route
block scope, you can use the :scope_instance_variables plugin option
with an array of instance variable symbols.
It is possible to use Roda without setting instance variables in
route block scope, by always local variables, passing data to views
via the :locals option, and passing data between routing trees using
the shared_vars plugin.
Some other internal classes are now shape-friendly by default.
Roda.plugins has been added, and can be used to access the list of
plugin modules that have been loaded into the application.
Backwards Compatibility
defined for scope, request, or response objects should be changed
to check the value of the instance variable (which will be nil if
the variable is not defined).
Best,
Jeremy
All reactions