Skip to content

Fix HMR #2695

Open
Open

Description

@david-crespo

HMR doesn’t work at all. Totally my fault: #2545 exports components and loaders from the same file, which breaks HMR. Those route files are all the top level files and HMR is broken for any changes below them, so it’s broken for all changes. This is annoying because it takes a few seconds to see a change instead of like 50ms, and it refreshes the page, losing any client-side state.

That change was meant to prepare us for RR v7 in framework mode + SPA mode, but I’m not sure how feasible that is for us. So we need to determine whether we plan to move to that, and if not, switch all the route files back to sticking loader on PageComponent.loader.

Activity

  1. david-crespo commented on Mar 3, 2025

    @david-crespo
    CollaboratorAuthor

    RRv7 in framework mode may or may not fix this. As their docs point out, the Vite plugin removes exports like loader and action from the module. But it doesn't say anything about clientLoader. So this may require unstable_splitRouteModules to split the clientLoader off from the component export.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions