Closed (fixed)
Project:
Drupal core
Version:
9.3.x-dev
Component:
javascript
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
27 Sep 2021 at 18:40 UTC
Updated:
2 Nov 2021 at 09:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
hooroomooSpoke with user @bnjmnm and was informed despite there being no existing use to change, this polyfill is useful in reducing the scope of the Autocomplete issue.
To provide evidence the polyfill works, I temporarily added the polyfill to the messages library used by the Olivero theme. I pasted this code snippet into the JS console in IE11.
As the video shows, I received the expected console output of "event fired, cat name is Buddy"
Comment #4
hooroomooComment #5
bnjmnmIt looks like the test runner stops at spellcheck
Here's information on working with the spellchecker https://www.drupal.org/node/3122084
This can be addressed by either adding
customeventto the skipped words dictionary or adding comments to ignore the usages in the file they appear. I recommend the first option as other libraries may wind up depending ondrupal.customevent, and this ensures the spellchecker won't object every time a new library adds this as a dependency.Comment #6
hooroomooComment #7
bnjmnmThe MR and change record look good, and the video in #3 confirms it works as expected.
While it's true there is no current use of CustomEvent in core (other than libraries that already have this polyfilled), adding this here is helpful to reduce the overall size of #3076171: Provide a new library to replace jQuery UI autocomplete, an issue that must land for Drupal 10, and one that is unlikely to change in a manner that makes the CustomEvent polyfill unnecessary. Even if the unlikely occurs and the Autocomplete issue no longer uses CustomEvent, the presence of this polyfill is not a major burden on core as it's small, demonstrated to work, and is only loaded if explicitly added as a dependency to another library.
Comment #9
catchMakes sense to get this in separate to the autocomplete issue.
Committed b986c49 and pushed to 9.3.x. Thanks!