-
Notifications
You must be signed in to change notification settings - Fork 725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Replace deprecated DOMNodeInserted with MutationObserver for Algolia DocSearch initialization #17424
Conversation
@Mergifyio backport release/stable/5.2 |
@Mergifyio backport release/stable/5.3 |
✅ Backports have been created
|
✅ Backports have been created
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-17424/index.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
dc76100
to
d03e516
Compare
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-17424/index.html |
d03e516
to
7f03de9
Compare
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-17424/index.html |
7f03de9
to
22ef577
Compare
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-17424/index.html |
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-17424/index.html |
1 similar comment
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-17424/index.html |
…olia DocSearch initialization - Removed deprecated DOMNodeInserted event listener - Implemented MutationObserver to monitor changes in the DOM - Added error handling for better debugging - Ensured observation starts only after DOM is fully loaded - Included comments for better code understanding and future updates
2ba7ac4
to
860bf6b
Compare
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-17424/index.html |
…5.3/pr-17424 fix: Replace deprecated DOMNodeInserted with MutationObserver for Algolia DocSearch initialization (backport #17424)
…5.2/pr-17424 fix: Replace deprecated DOMNodeInserted with MutationObserver for Algolia DocSearch initialization (backport #17424)
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The Algolia search box for the documentation is no longer visible in canary browsers, and a similar behavior is expected in upcoming stable browser versions when using the deprecated
DOMNodeInserted
.What is the new behavior?
The Algolia search box for the documentation is visible for all browser versions using
MutationObserver
as a replacement for the deprecatedDOMNodeInserted
.Changes Summary
Important
Currently,
DOMNodeInserted
is deprecated and triggers a warning in stable browser versions (126.0.x.x) but has already been disabled and throws an error in the latest canary versions (127.0.x.x and above).Mutation event support will be disabled by default starting in Chrome 127, around July 30, 2024.
For more information: Chrome Status.
Replaced deprecated
DOMNodeInserted
withMutationObserver
for Algolia DocSearch initialization:DOMNodeInserted
event listener.MutationObserver
to monitor changes in the DOM and initialize DocSearch when the#docsearch
element is added.Changes tested with latest versions of:
PR Checklist
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Run
results.