Repository navigation
Match utility dependencies exactly in the registry - #259
Merged
Merged
Conversation
getUtilities matched keys by prefix with no separator between the
dependencies and the name, so a lookup for { widget: 'url' } also
returned utilities registered for { widget: 'url_list' }. getUtility
and getUtilities also did not sort dependency keys, so multi-key
lookups only worked when callers passed them in sorted order.
Build the dependency part of the key in one helper that sorts the keys
and ends with a separator.
sneridagh
added a commit
that referenced
this pull request
Oct 10, 2026
* origin/main: Validate schema-driven forms (#256) Move the recurrence modal off TanStack Form (#254) Move the forms onto the helpers form store (#253) Add a Jotai-native form layer to helpers (#252) Render every schema form through one field renderer (#251) Document and type the form widget contract (#97) Match utility dependencies exactly in the registry (#259) # Conflicts: # packages/cmsui/config/widgets.ts
sneridagh
added a commit
that referenced
this pull request
Oct 10, 2026
…widget-context * origin/feat/widget-adapters: Restore files the pre-commit hook reformatted Validate schema-driven forms (#256) Move the recurrence modal off TanStack Form (#254) Move the forms onto the helpers form store (#253) Add a Jotai-native form layer to helpers (#252) Render every schema form through one field renderer (#251) Document and type the form widget contract (#97) Match utility dependencies exactly in the registry (#259)
sneridagh
added a commit
that referenced
this pull request
Oct 10, 2026
…yped-widget-registry * origin/feat/widget-context: Restore files the pre-commit hook reformatted Validate schema-driven forms (#256) Move the recurrence modal off TanStack Form (#254) Move the forms onto the helpers form store (#253) Add a Jotai-native form layer to helpers (#252) Render every schema form through one field renderer (#251) Document and type the form widget contract (#97) Match utility dependencies exactly in the registry (#259)
sneridagh
added a commit
that referenced
this pull request
Oct 10, 2026
… feat/missing-widgets * origin/feat/typed-widget-registry: Restore files the pre-commit hook reformatted Validate schema-driven forms (#256) Move the recurrence modal off TanStack Form (#254) Move the forms onto the helpers form store (#253) Add a Jotai-native form layer to helpers (#252) Render every schema form through one field renderer (#251) Document and type the form widget contract (#97) Match utility dependencies exactly in the registry (#259)
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.
getUtilitiesmatched utility keys by prefix, with no separator between the dependencies and the utility name. A lookup for{ widget: 'url' }also returned utilities registered for{ widget: 'url_list' }, or for any value starting withurl.getUtilityandgetUtilitiesalso didn't sort dependency keys (unlikeregisterUtility), so multi-key lookups only matched when callers passed the keys in sorted order.The dependency part of the key is now built by one helper,
utilityDepsPrefix. It sorts the keys and ends with a separator:|widget:url|urlinstead of|widget:urlurl. Utilities registered without dependencies keep their plain name as the key. Nothing outside the registry reads the keys directly.Behavior to note:
getUtilitieswithout dependencies still returns every utility of the type. The app relies on this forclientEndpoints,rootLoaderData,rootContentSubRequestand the somersault migrations, and a test now covers it.getUtilities.Tests: added cases for prefix-sharing values, unsorted keys in
getUtilitiesandgetUtility, a dependency/name split collision, and the no-dependency case. Registry (132), cmsui (205) and aurora app vitest (48) pass. Registry build andcheck:tsare clean.