Skip to content

Expose Rack Server Pages middleware configuration - #183

Merged
dblock merged 1 commit into
slack-ruby:masterfrom
dblock:feature/server-pages-configuration
Oct 25, 2026
Merged

dblock merged 1 commit into
slack-ruby:masterfrom
dblock:feature/server-pages-configuration

Conversation

@dblock

@dblock dblock commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Bump the next version to 2.3.0 for this new configuration feature.

Add a config.server_pages block that receives the underlying Rack::ServerPages::Config after the framework applies view_paths. Bots can configure template/static cache policies and other supported page options centrally in an initializer rather than assigning headers inside templates.

The callback is applied when the middleware stack is built, not per request. A later registration replaces the earlier callback; Config.reset! clears it; configuration errors propagate. With no callback, existing view-path behavior and the installed library’s defaults remain unchanged. No dependency minimum, global cache policy, release, or bot deployment is introduced.

Document startup timing, rebuilding cached middleware, library-version requirements for newer options, and an example setting cache_control and static_cache_control. This enables a follow-up to the template-level cache headers in slack-ruby/slack-shellbot#88 once a framework release is available.

Validation

Targeted middleware specs pass with both Mongoid 9.1 and Active Record 8.1 on Ruby 4.0.9 / Grape 4: 7 examples, 0 failures each. Focused lint passes. Regressions cover unchanged defaults, configuration ordering and one-time application, view-path overrides, callback replacement/reset, and explicit errors.

Authored by Copilot (AI), on behalf of @dblock.

@dblock
dblock force-pushed the feature/server-pages-configuration branch from 7693906 to acf1108 Compare October 25, 2026 19:41
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Danger Report

No issues found.

View run

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dblock
dblock force-pushed the feature/server-pages-configuration branch from acf1108 to c2f478b Compare October 25, 2026 19:44
@dblock
dblock merged commit df1960b into slack-ruby:master Oct 25, 2026
25 checks passed
@dblock
dblock deleted the feature/server-pages-configuration branch October 25, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant