Inline mustermann-grape into Grape::Router::MustermannPattern#2755
Open
ericproulx wants to merge 1 commit into
Open
Inline mustermann-grape into Grape::Router::MustermannPattern#2755ericproulx wants to merge 1 commit into
ericproulx wants to merge 1 commit into
Conversation
8d60f9c to
2b7d16c
Compare
Danger ReportNo issues found. |
2b7d16c to
a969b46
Compare
mustermann-grape is a ~40-line Mustermann::AST::Pattern subclass that exists only for Grape's path syntax, and it had already grown Grape-specific: the Integer constraint reads Grape's own `params` option. Maintaining it as a separate gem meant a two-step release for every syntax tweak (cut a mustermann-grape release, then bump Grape's pin) plus its own CI/versioning. Move the grammar into Grape as Grape::Router::MustermannPattern (attribution to the original authors preserved), depend on `mustermann` directly, and instantiate it directly from Grape::Router::Pattern as Grape always did. The `mustermann` core dependency is unchanged; the graph collapses from grape -> mustermann-grape -> mustermann to grape -> mustermann. The class is no longer registered as a Mustermann `type: :grape` (Grape never used the registry). Apps that called `Mustermann.new(_, type: :grape)` relying on Grape pulling in mustermann-grape transitively should depend on it directly; see UPGRADING. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
a969b46 to
f3be4cd
Compare
ericproulx
added a commit
that referenced
this pull request
Jun 1, 2026
Grape requires Ruby >= 3.3 and activesupport >= 7.2 (Rails 7.2+), but several dependency floors still advertised support for much older releases that Grape no longer tests: - rack >= 2 -> >= 2.2.4 (minimum rack across Rails 7.2 and above) - zeitwerk (none) -> >= 2.7 (where zeitwerk moved to Ruby >= 3.2) - dry-configurable (none) -> >= 1.4 (first release requiring Ruby >= 3.3) - dry-types >= 1.1 -> >= 1.9 (current line, Ruby >= 3.2) Resolved versions are unchanged (rack 3.2.6, zeitwerk 2.8.2, dry-configurable 1.4.0, dry-types 1.9.1); only the floors change. mustermann is left to #2755. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
|
Makes sense, let's just check-in with @namusyaka on whether there was a reason to have a separate gem for this? |
dblock
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
mustermann-grapeis a ~40-lineMustermann::AST::Patternsubclass that defines Grape's path syntax (:param,*splat,{name}/{+splat},( )optionals,|, and an Integer digit-only constraint). In practice it exists only for Grape — and it has already grown Grape-specific: the Integer constraint reaches into Grape's ownparamsoption.Keeping it as a separate gem means a two-step release for any syntax change (cut a
mustermann-graperelease, then bump Grape's~> 1.1.0pin), plus its own CI and versioning — a lot of ceremony for 40 lines only Grape uses. Grape also always instantiated the class directly (Mustermann::Grape.new), never through thetype: :graperegistry.What
Grape::Router::MustermannPattern(MIT attribution to the original authors — namusyaka, Konstantin Haase, Daniel Doubrovkine — preserved), and instantiate it directly fromGrape::Router::Pattern.mustermanndirectly instead ofmustermann-grape.register :grapecall — Grape never used the registry, and not squatting a global Mustermann type keeps the inlined grammar a private Grape detail.This is not a deep dependency reduction: the grammar extends
Mustermann::AST::Pattern, so themustermanncore dependency stays. The graph just collapses fromgrape → mustermann-grape → mustermanntogrape → mustermann, and Grape owns the 40 lines it was already coupled to. The win is maintenance: pattern-syntax changes become a single PR instead of a cross-gem release dance.Compatibility
One behavioral change: the pattern class is no longer registered as
type: :grape. Apps that calledMustermann.new(_, type: :grape)and relied on Grape pulling inmustermann-grapetransitively should addgem 'mustermann-grape'to their Gemfile directly. Documented inUPGRADING.md.Validation
bundle installnow resolves withoutmustermann-grape(onlymustermann 4.0.0) — Grape is self-sufficient./api/:idmatches42, rejectsfoo.🤖 Generated with Claude Code