docs(upgrade): cover V2 constructor kwargs and stimulus_identifier_from_path removal#26
Closed
stevegeek wants to merge 1 commit into
Closed
docs(upgrade): cover V2 constructor kwargs and stimulus_identifier_from_path removal#26stevegeek wants to merge 1 commit into
stimulus_identifier_from_path removal#26stevegeek wants to merge 1 commit into
Conversation
…rom_path` removal Two real migration blockers surfaced in a confinus app port that weren't documented in UPGRADING.md: 1. After the §1 class rename (`Vident::StimulusAction` → `Vident::Stimulus::Action`), the next error at render time is `ArgumentError: wrong number of arguments` because V1 accepted positional args to `.new` and V2's `Literal::Data` classes require kwargs. Three fix paths are idiomatic — Array form at prop boundaries, `.parse(positional, ..., implied:)` for typed objects, or direct kwarg construction for internals. Also notes that `implied_controller:` is gone and what replaces it. 2. `stimulus_identifier_from_path` is removed; `Vident::Stimulus::Naming.stimulize_path` is the V2 replacement. It was mentioned in api-reference.md but nowhere that a migrator would look. Adds a "Related" paragraph to §1 for the constructor change (it belongs next to the rename it follows from) and a new §10 for the identifier helper. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
Author
|
Applied manually on main in commit HEAD (branch had conflicts from recent UPGRADING.md reshuffling). Content is preserved with updated section numbering (§10 is now the stimulus_identifier_from_path section). Thanks! |
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.
Summary
Two migration blockers that weren't documented in
UPGRADING.md, surfaced porting a real app from Vident 1.0.2 → 2.0.0.1. Constructor signatures changed from positional to kwargs
After the §1 class rename (
Vident::StimulusAction→Vident::Stimulus::Action), the next error a migrator hits at render time is:V1
StimulusAction.new(:click, "ctrl/path", :method)mapped positional args to props. V2'sLiteral::Data-backed classes require kwargs. I added a "Related: V2 constructors take kwargs, not positional args." paragraph inside §1 covering three idiomatic fixes:.parse(positional, ..., implied:)when you need a typed objectAlso notes that
implied_controller:kwarg is gone and what replaces it.2.
stimulus_identifier_from_pathis removedMentioned in api-reference.md at line 590 but not in UPGRADING.md where a migrator looks first. Added a new §10 with the one-line fix:
Vident::Stimulus::Naming.stimulize_path(path).Why these warranted docs updates
Both are first-order consequences of V2 changes that already have sections in UPGRADING.md — they're the second error message a migrator sees after following §1 / existing guidance. Without these notes, the path from "I renamed everything" to "renders cleanly" includes grepping the gem's
lib/andskills/to figure out what moved where.Related: issue #25 (and a follow-up issue for the
no_stimulus_controllerinheritance case) cover the remaining V2 migration gaps that don't fit as doc additions.🤖 Generated with Claude Code