Needs review
Project:
Search API Autocomplete
Version:
8.x-1.x-dev
Component:
General code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
22 Sep 2021 at 18:49 UTC
Updated:
12 Jan 2022 at 14:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mkalkbrennerComment #3
drunken monkeyMakes sense, thanks for the suggestion!
I normally try to keep the Search API module as free of other modules’ code as possible, but Autocomplete is popular enough to surely warrant this small addition (which also comes with more or less zero maintenance burden).
Attached are three patches: the one for Search API and step 1 for Autocomplete could be committed right away; step 2 for Autocomplete will have to wait until we can rely on a Search API version that includes the new interface.
Also, now that I think of it, we probably don’t want to remove that interface completely, but just deprecate it for now. (Would then also need a change notice – but that should probably wait until we move the issue to the Autocomplete project. Or should we create a separate issue there anyways?)
Finally, I took this chance to also add type hints to the interface’s sole method. Would you say that’s OK? After all, no-one will yet have implemented that interface, that would need to be an explicit change on the part of any module – and when they do that, they can also change the method signature.
(Side note: I ran the automated tests manually with all three patches applied, and they all passed, so shouldn’t be any hidden pitfalls.)
Comment #4
mkalkbrennerThanks for working on this one.
I agree that the old interface could be deprecated first and be removed later. Together with the removal, composer.json should declare incompatibilities with older versions of Search API and Search API Solr.
Comment #6
drunken monkeyThanks for reviewing!
OK then, committed the Search API patch and moving to Search API Autocomplete.
Comment #7
drunken monkeyHere are the updated patches. I expect we want to deprecate the interface in Search API Autocomplete right away and then remove it in step 2? (Not sure anymore, though. Also not sure when we should switch the doc comments to point to the new type – all a bit tricky in this case.)
In any case, I also already created a change record for Autocomplete. Might need to be adapted in case the deprecation won’t go in before the 1.6 release (planned for this week).
Comment #9
drunken monkeyCommitted the first step. Keeping at “Needs review” for the second step – to be committed once we (want to) add a dependency on Search API 1.22 (to be released soon).
Regarding the
composer.jsonincompatibility with older versions of Search API Solr: Is that really necessary? It seems the current version doesn’t use the interface, except in comments, so should be no harm there.Otherwise: What should the conflict constraint be,
<4.3?Comment #10
mkalkbrennerI can't find it in composer.json. Can you provide a link?
Comment #11
drunken monkeyIt isn’t there yet, sorry for the confusion. I was referring to your comment #4:
Comment #12
mkalkbrennerI the Interface has the same name and the backends leverage a use statement we can indeed avoid the declaration of an incompatbility.