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
React-based views don't correctly update features #6554
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
In Chrome we can already use the navigation API https://developer.mozilla.org/en-US/docs/Web/API/Navigation/navigate_event |
Nope. It fires before the actual navigation, so we'd still have to wait for the content to be loaded somehow. However I think I have a solution:
Detecting this removal might be a bit complicated, or maybe we just need a good ol MutationObserver on |
I solved the URL detection issue in the PR above, but that's only part of it. The main issue is that the DOM is no longer actually re-generated:
In practice this means our features are not updated. I think we just need dynamic elements:
This brings us back to discussions like #6493, where we need to find a usable library and then work the new MutationObserver-based listener into it. |
selector observer generates "seen" mark with caller id. If we can detect path changing correctly and ensure that feature is based on |
That's not going to be enough because we also need to remove the old element from the page. At that point it's easier to write:
Then the observer will take care of the rest, no need to add a dependency to the URL. Maybe that's just what we need though:
This wouldn't require writing dynamic elements. |
I'm opening this issue to track it properly. In short:
Known issues
turbo:render
isn't calledpopstate
events don't trigger anyturbo:render
norsoft-nav:render
Related issues
download-folder-button
duplicated #6414rgh-feature-descriptions
only works when opened in a new page #6528Current status
For the whole existence of Refined GitHub, we've relied on GitHub to delete our elements when the page/URL changes, with one exception (I don't remember which). New React-based views break this assumption. I think we need to:
soft-nav:render
popstate
and avoid duplicates calls in casesoft-nav:render
is also firedonAbort(() => element.remove())
rgh-seen
element is still on the page, it won't be seen again.The text was updated successfully, but these errors were encountered: