Skip to content

Commit

Permalink
Bump version to 3.88.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyevans committed Jan 14, 2025
1 parent b1aaa04 commit 1e5db56
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=== master
=== 3.88.0 (2025-01-14)

* Support fixed locals in templates when using Tilt 2.6+ (jeremyevans)

Expand Down
52 changes: 52 additions & 0 deletions doc/release_notes/3.88.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
= New Features

* Fixed locals are now supported in templates when using Tilt 2.6+.
Without fixed locals, templates that support local variables can
be called with any locals, and a separate template method is
compiled for each combination of local variable names. This
causes multiple issues:

* It is inefficient, especially for large templates that are called with
many combinations of locals.
* It hides issues if unused local variable names are passed to the template
* It does not support default values for local variables
* It does not support required local variables
* It does not support cases where you want to pass values via a keyword splat
* It does not support named blocks

Fixed locals solve these problems by having the compiled methods
use keyword arguments instead of a single positional hash
argument. This allows you to use required keyword arguments,
provide default values for optional keyword arguments, and use keyword
splats and named blocks. See https://github.com/jeremyevans/tilt#fixed-locals
for details.

You can enable embedded fixed locals in templates using the `:extract_fixed_locals`
template option. The recommended template options when creating new Roda
applications that use the render plugin are now:

plugin :render, template_opts: {
scope_class: self, # Always uses current class as scope class for compiled templates
freeze: true, # Freeze string literals in templates
extract_fixed_locals: true, # Support embedded fixed locals in templates
default_fixed_locals: '()', # Default to templates not supporting local variables
escape: true, # For Erubi templates, escapes <%= by default (use <%== for unescaped
chain_appends: true, # For Erubi templates, improves performance
skip_compiled_encoding_detection: true, # Unless you need encodings explicitly specified
}

= Other Improvements

* The json_parser plugin now handles the case where
Rack::Request#POST has already been called on the env hash,
when using Rack 3+.

* The default_headers plugin now handles a mixed/upper case
Content-Type header, when using Rack 3+ (which requires
lower case headers).

* The render_coverage plugin now handles the case where both
:scope_class template option and fixed locals are used.

* Roda now avoids warnings when the -W:strict_unused_block Ruby
option is used.
2 changes: 1 addition & 1 deletion lib/roda/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Roda
RodaMajorVersion = 3

# The minor version of Roda, updated for new feature releases of Roda.
RodaMinorVersion = 87
RodaMinorVersion = 88

# The patch version of Roda, updated only for bug fixes from the last
# feature release.
Expand Down

0 comments on commit 1e5db56

Please sign in to comment.