Repository navigation
fix(runtime): align parse-rf2-coord with rf2-z7f7's emitted format - #1
Merged
Merged
Conversation
The speculatively-written parser assumed `<ns>|<file>:<line>:<col>`.
re-frame2's rf2-z7f7 ships `<ns>:<handler-id>:<line>:<col>` (4
colon-separated segments, per Spec 006 §Source-coord annotation and
Tool-Pair.md §Source-mapping; verified against the SSR + Reagent
emitters and their tests). Updated parser to return
`{:ns :handler-id :line :col}`, with `:line`/`:col` nil when the
segment is `?` (programmatic registrations that bypassed the macro
path).
Refs rf2-7g2q. Closes STATUS.md known-unknown #3.
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
re-frame2's rf2-z7f7 (PR #135 in day8/re-frame2) shipped the
data-rf2-source-coordDOM annotation. The actual emitted format is<ns>:<handler-id>:<line>:<col>(4 colon-separated segments), with?legal for line/col on programmaticreg-view*calls.re-frame-pair2's
parse-rf2-coordwas written speculatively before rf2-z7f7 landed and assumed<ns>|<file>:<line>:<col>(per STATUS.md known-unknown #3). This fix aligns the parser with the canonical format.Tracked under bead rf2-7g2q (in re-frame2's bd) as discovered-from rf2-9ra3.
Changes
scripts/runtime.cljs—parse-rf2-coordupdated to handle the 4-segment format and degraded?cases.tests/runtime/parse_rf2_coord_test.clj— new, 12 tests / 21 assertions.STATUS.md— known-unknown #3 fully resolved with citations.docs/TESTING.md— struck failing-point + updated "not tested yet" list.Format citations
Test results
bb tests/runtime/parse_rf2_coord_test.clj— 12 tests, 21 assertions, 0 failures.Coverage: canonical PR #135 sample, Form-1, Form-2 inner, SSR, programmatic
?:?degradation, partial:line:?, malformed (too few/too many segments, empty<ns>or<handler-id>), non-string inputs, dotted+hyphenated ids, parse→format→parse round-trip.Edge case worth flagging
Fragment /
:>interop / fn-component fallback emits no attribute at all (substrate skips with one-shot warning per Spec 006 §Documented exemption). Parser never sees these — consumers fall back to(rf/handler-meta :view id).Side effect
dom-find-by-srcanddom-fire-clickhad afileparameter that was wrong post-fix (segment 1 ishandler-id, not file). Renamed tofile-or-id; substring-match impl unchanged. Real cross-attribute querying may want a redesign — out of scope here.