Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
We are currently exposing every method in the class, let's decide what our public API is and only expose only those methods.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork a11y_autocomplete-3217881
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
justafish@nod_ I started on this but I'm not sure which methods should be public
Comment #5
nod_Posted a few things in the MR. Working on additional feedback.
Comment #6
nod_Actually, I think we need to remove any option/method until we actually have a use case for it. I also think it will end up being better documented because we can take the time to document and add code examples each method/option when we introduce it.
Adding additional options/methods to the API won't change the major version so it shouldn't be very disruptive to users and since there are already many, many options available it'll be a small work to enable each thing.
Comment #7
nod_Comment #8
nod_this doesn't break the core patch too much, need to get around to make the extra (unsupported) options work for the jquery shim.
Comment #9
nod_working on it alongside the core patch #3076171: Provide a new library to replace jQuery UI autocomplete
Comment #10
nod_I guess it looks good:
Object has 2 things:
Options supported:
The rest is filtered out and can't be set on autocomplete init.
Comment #11
nod_Comment #12
nod_Comment #13
justafish@nod_ tests are failing https://git.drupalcode.org/project/a11y_autocomplete/-/jobs/8439
Comment #14
nod_fixed, working a bit on the documentation and adding tests for the supported options
Comment #15
nod_actually tests should be done in #3230678: Write tests
Comment #16
nod_and the docs is in #3211252: Generated Readme
Comment #17
nod_Comment #18
justafishlooks great and tests are passing 🎉
Comment #19
nod_All right it's all about incremental improvements for now :)
Comment #21
nod_Comment #22
lauriiiHow was the list of options supported in #10 decided? I have some questions:
Comment #23
nod_I'm trying a different approach than we're used to in Drupal, which is to not introduce a feature unless someone says: I need this.
The shim is a special case that shouldn't influence the architecture of the library, it's internal Drupal-stuff. So nothing that only the shim need will be explicitly supported.
I agree that classes could be good to have, template support would be even better so people can change everything they need (maybe a dl makes sense for the autocomplete results in some cases), but I want to have the opportunity to discuss this instead of our default stance of "let's get this in it might be useful for someone at some point". Same thing for delay, z-index, etc.
Comment #24
lauriiiWe are trying to make the whole Drupal ecosystem migrate to this library and we can make some guesses on the needs based on what exists in contrib. Wouldn't it be enough to justify a feature if there are multiple examples in the contrib eco system where a feature is needed?
I'm afraid that if we make it too difficult to upgrade to this library, people will choose to continue using jQuery UI which is not safe. Ideally, people would come and tell what is missing from the library for them to upgrade, but I'm not sure that's how it works in practice, especially when there's the option to revert back to jQuery UI.
Comment #25
nod_If what you mean is that we find examples, and have a quick conversation with folks about their need sure. Let's not assume what their needs are based on a specific implementation. We don't know the tradeoffs they made to their initial needs because of limitations/biais in the implementation.
It's going to take work but it's the price for making something better than what exists currently. Otherwise we're just rewriting existing code and keeping the same biais and asking people to make the same tradeoffs again. If that's what we do, I'd rather just maintain jQuery UI and not think about this too much.