feat(yeah): add keyword-based element discoverability API#2
Merged
Conversation
Hybrid approach using Chassis multimethod + var metadata: - Enumerate via (keys (methods c/resolve-alias)) - Lookup via keyword -> var -> metadata resolution - Zero new mutable state, no stale entries on reload Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace symbol-based `describe`/`attributes` functions with a new keyword-based API that matches how elements are used in hiccup markup: - `element` - lookup metadata by keyword tag (e.g. `:ns/element`) - `element-tags` - list all registered element keywords - `elements` - list elements with optional namespace filtering (symbol or regex) - `search-elements` - search by documentation text (string or regex) The implementation uses a hybrid approach: enumerate via Chassis multimethod, lookup via var metadata. No new mutable state required. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implementation completed in commit 2ea1e18. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace symbol-based `describe`/`attributes` examples with `element` - Add new "Discoverability API" section documenting all functions - Update `::merge` property example to use new API - Update `generate` example to use keyword tags Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove generated specs UI files from tracking and add to .gitignore. These are generated by `/specs ui` command and shouldn't be committed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document breaking changes to discoverability API and migration path. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use :dev/daisy-button keyword instead of var reference to match how elements are used in hiccup markup. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
element- lookup metadata by keyword tag (e.g.,:ns/button)element-tags- list all registered element keywordselements- list elements with optional namespace filtering (symbol or regex)search-elements- search by documentation text (string or regex)describe/attributesfunctionsThe implementation uses a hybrid approach: enumerate via Chassis multimethod, lookup via var metadata. No new mutable state required.
Test plan
elementlookup by keywordelement-tagslistingelementswith namespace filterssearch-elementswith string and regex patterns🤖 Generated with Claude Code