Skip to content
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

a non-fast-refresh update doesn't cause a cell reload #12

Open
jaked opened this issue Apr 25, 2024 · 1 comment
Open

a non-fast-refresh update doesn't cause a cell reload #12

jaked opened this issue Apr 25, 2024 · 1 comment

Comments

@jaked
Copy link
Collaborator

jaked commented Apr 25, 2024

In 6738918 I made it so there's not a full-page reload for a client-side cell whenever an unrelated cell changes; but this breaks full-page reloads that are actually needed (e.g. if you change the exports of a cell).

@jaked
Copy link
Collaborator Author

jaked commented Jun 4, 2024

Vite's HMR propagates changes bottom up. If a change is accepted by a module along the way then propagation stops; otherwise a full reload happens when propagation gets to the root of the dependency tree. This scheme doesn't account for multiply-rooted trees (e.g. multiple cells with independent dependencies), so if a change propagates to a root it sends a full reload message to all views.

To handle this correctly we need to pass the affected roots in reload messages, and check in the message handler for a view that it's one of the affected roots. (I recall this being tricky because the handler is generic and doesn't have access to the root; it has the window URL but the dependency graph doesn't connect the Javascript root module with the window URL.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant