Follow up from #2056513-32: Remove PluginUI subsystem, provide block plugins UI as one-off:
The one thing that would be nice is a generic facility for autocompletion that other modules could use to avoid boilerplate code like Block module has to do, but that can be a follow-up.
We now have a UserAutocompleteController and a BlockAutocompleteController in HEAD. UserAutocompleteController delegates the fetching of matches to a separate UserAutocomplete service, whereas BlockAutocompleteController implements that inline. The UserAutocomplete service implements a getMatches() method, but that's not defined in any interface. I think it should be possible to:
- create a AutocompleteInterface
- have UserAutocomplete implement it
- create a BlockAutocomplete service that implements it
- create a generic AutocompleteControllerBase that can receive the appropriate AutocompleteInterface service as an injected dependency
- we may still need UserAutocompleteController around that extends AutocompleteControllerBase, since it includes a separate method for autocompleteUserAnonymous(), but hopefully block and other autocompletes could just use AutocompleteControllerBase without extending it (only need a services.yml entry to define the appropriate AutocompleteInterface implementation to inject).
Thoughts?
Comments
Comment #1
effulgentsia CreditAttribution: effulgentsia commentedI recommend postponing this until after #1987858: Convert taxonomy_autocomplete() to a new style controller, because I think having 3 examples of autocompletes in core will make us implement this better than if we base it only on the two we currently have. If someone disagrees and wants to unpostpone this, go for it.
Comment #2
tim.plunkettRelated: #2056627: Form API autocomplete is broken for routes
(I agree with this being postponed)
Comment #15
quietone CreditAttribution: quietone at PreviousNext commentedNo longer postponed.