Skip to content

⚠️ React-based views don't correctly update features #6554

@fregante

Description

@fregante

I'm opening this issue to track it properly. In short:

  1. Open https://github.com/refined-github/refined-github/blob/main/source/features/action-used-by-link.tsx
  2. Visit a folder or change file via the sidebar or go back and forth

Known issues

  • turbo:render isn't called
  • popstate events don't trigger any turbo:render nor soft-nav:render
  • the view isn't generated from scratch, so previous elements stick around

Related issues

Current 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:

  • listen to soft-nav:render
  • listen to popstate and avoid duplicates calls in case soft-nav:render is also fired
  • figure out a way to make widgets/buttons dynamic so that they change or disappear when the URL changes
    • this could help, but that alone doesn't fit into our concept of "feature unloading when pages change": A brief investigation of using SolidJS #6493
    • maybe we could add a onAbort(() => element.remove())
      • edit: I tried it, but if an rgh-seen element is still on the page, it won't be seen again.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions