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
Add the library and associated assets.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork a11y_autocomplete-3204530
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
nod_retitled to make it look better on in the core js queue
Comment #3
bnjmnmSome questions I have about assembling this
Comment #4
bnjmnmSeveral polyfills are needed to support IE11: fetch, es6-promise, element.closest, and CustomEvent. Unsure if it's best to make that part of the build in this package, or let Drupal take care of that. es6-promise is already in core.
Comment #5
justafish@bnjmnm I like Nightwatch, but if you think there's a more appropriate tool then I think that's fine too. Once didn't use Nightwatch because it's not testing any UI interactions.
Could we get rid of the class syntax so this isn't an issue? Anecdotally they seem to be increasingly unpopular since they're only syntactic sugar and not really OOP anyway. For the polyfills let's have Drupal take care of that, we'll probably end up with polyfills embedded multiple times otherwise.
Just a heads up you might want to take a look at https://www.drupal.org/project/once/issues/3201195 since I had to remove "type: module" from package.json as it doesn't play very nicely with other packages (like Nightwatch)
Comment #6
lauriiiRe #4: I don't think we should ship polyfills as part of the build in this package - it should be the responsibility of the projects to add dependency on required polyfills. We could document in the project which polyfills are required for IE 11 support.
Comment #7
bnjmnmThere's also spread operator usage that won't work with IE11. Is there a preferred approach for that?
Comment #8
justafish@bnjmnm can we use .apply instead?
Comment #10
bnjmnmI set the merge request to ready, aware that there are multiple unaddressed comments. I'd like to get this initial commit in so work can be split into multiple issues that can be worked on simultaneously. Could the commit-blocking feedback be limited to things that could set bad precedence in the followup issues? For example, if there are problems with the overall Nightwatch testing setup, that should get addressed here as it impacts how test are written in later issues. Changes to the class itself, docs, etc I think can safely be addressed in followups.
Also worth mentioning: Although the generated README.md has been deferred to be worked on in a separate issue, there is a README.old.md that has a decent amount of API documentation already, and will be helpful for contributors working on issues before the generated docs are ready.
Comment #11
nod_Thanks!
test:nightwatch
command)autocomplete
nota11y.autocomplete
to avoid issues withL
and1
(including package name, so@drupal/autocomplete
, we keep the namespace on drupal.org for now, might end up in the monorepo down the line)In any case, good start :)
Comment #12
bnjmnmI believe #11 is addressed. Switching back to Needs Review and we'll see if that's the case...
Comment #13
nod_Pre commit:
yarn build
seems like a
yarn build
has some funky results, the generated file in dist is not usable in a browser :the rest of the commands are working as expected.
Post commit:
a11y
part but that can be done until we release the first version.@justafish: what do you think?
Comment #14
bnjmnmThe build should now works in a browser. Manually tested and temporarily switched the tests use to use assets from /dist instead of /src. Before changing the build, the test would not work loading from /dist
Comment #15
nod_That looks better :)
Good enough MVP for me, could use a +1 from justafish if she has some time.
Comment #16
bnjmnmIn a separate branch I have improved docs and basic jsdoc2md set up (no templates at the moment). The end result is the README.md attached here.
I could add that to this branch, which may help with the followup issues, particularly since events are now documented. Refinements could still happen here: #3211252: Generated Readme .
However, if there's a risk that adding this generated README would delay this issue by more than a minute or two, it should probably wait.
Comment #17
nod_let's keep the readme to the other issue. The template is not necessary if the default output is good, let's talk about that in the related issue :)
Just giving some time to sally to have a look.
Comment #18
justafishComment #19
bnjmnm@lauriii or myself responded to every point that kicked this back to "Needs Work" in #18. I only set ones to "unresolved" where it wouldn't be presumptuous to do so, but hopefully most (all?) are suitable for "resolved" status.
Comment #21
justafishI've pushed some updates -
The test doesn't seem to be passing - I added the GitLab CI file first so you can see it failing before I added the factory https://git.drupalcode.org/project/a11y_autocomplete/-/jobs/7385
Comment #23
justafish@nod_ and I are going to merge this and then open follow up issues individually for pre-release items
Comment #24
nod_All good :) Sally will open a couple of follow-ups