Skip to content

Internalize the route scope behind InheritableSetting accessors#2811

Open
ericproulx wants to merge 1 commit into
inheritable-setting-finalefrom
route-scope-accessors
Open

Internalize the route scope behind InheritableSetting accessors#2811
ericproulx wants to merge 1 commit into
inheritable-setting-finalefrom
route-scope-accessors

Conversation

@ericproulx

Copy link
Copy Markdown
Contributor

Follow-up to #2810, stacked on inheritable-setting-finale (will retarget to master once #2810 merges).

Continues the InheritableSetting encapsulation by sealing off the per-route settings store: every raw route[...] access from outside InheritableSetting is replaced by a semantic accessor, so nothing external touches the @route hash anymore. The route reader is now reached only from specs, so it can be made internal once the stores are extracted (planned follow-up).

Accessors added on InheritableSetting

  • route_validations / route_declared_params (+ writers) — the flat per-route param snapshots, seeded per endpoint and topped up on mount.
  • route_renamed_params / add_route_renamed_param — the as: rename map; the add_ accumulator replaces the read-modify-write in ParamsScope#push_renamed_param.
  • route_description (+ writer) — the desc block's settings.
  • route_settings — the settings handed to each Router::Route (everything but the internal snapshots), replacing route.except(...) in Endpoint#to_routes.
  • route_setting — the open store behind the route_setting DSL, which now delegates here instead of poking the raw hash.
  • inherit_route_params — folds a mounting parent's namespace snapshots into the route buffers, replacing the merge that lived in Endpoint#inherit_settings.

Call sites migrated

Endpoint, DSL::Declared, DSL::Desc, DSL::Routing, DSL::Settings, Validations::ParamsScope.

Bumps Metrics/ClassLength to 370; InheritableSetting is a settings registry and will shrink again once its stores are extracted.

🤖 Generated with Claude Code

Every raw `route[...]` poke from outside InheritableSetting is replaced by
a semantic accessor, so nothing external touches the `@route` hash anymore
(the `route` reader is now reachable only from specs and can go internal
later):

* `route_validations` / `route_declared_params` (+ writers) — the flat
  per-route param snapshots seeded per endpoint and topped up on mount.
* `route_renamed_params` / `add_route_renamed_param` — the `as:` rename
  map, an accumulator replacing the read-modify-write in ParamsScope.
* `route_description` (+ writer) — the `desc` block's settings.
* `route_settings` — the settings handed to each Route (everything but the
  internal snapshots), replacing the `route.except(...)` in Endpoint.
* `route_setting` — the open store behind the `route_setting` DSL, which
  now delegates here instead of reaching into the raw hash.
* `inherit_route_params` — folds a mounting parent's namespace snapshots
  into the route buffers, replacing the merge that lived in
  `Endpoint#inherit_settings`.

Bumps Metrics/ClassLength to 370; the class is a settings registry and
will shrink again once its stores are extracted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ericproulx
ericproulx force-pushed the route-scope-accessors branch from b9aa661 to 44dcf28 Compare July 23, 2026 02:32
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

Danger Report

No issues found.

View run

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