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

🗺️ Remix Retune (HMR) #5240

Closed
2 of 3 tasks
ryanflorence opened this issue Jan 24, 2023 · 2 comments
Closed
2 of 3 tasks

🗺️ Remix Retune (HMR) #5240

ryanflorence opened this issue Jan 24, 2023 · 2 comments
Assignees
Milestone

Comments

@ryanflorence
Copy link
Member

ryanflorence commented Jan 24, 2023

Clientside assets only, expect the server to do it's own reboot/reload etc. when the server assets change (since they all do anyway, and in the case of express, just do --watch in v19)

PRs

TODO

@ryanflorence ryanflorence converted this from a draft issue Jan 24, 2023
@ryanflorence
Copy link
Member Author

@jacob-ebey and Pedro to pair on this, especially in the beginning

@ryanflorence ryanflorence changed the title HMR 🗺️ HMR Jan 24, 2023
@pcattori
Copy link
Contributor

pcattori commented Jan 30, 2023

How we handle different types of updates

Prototype

Any code changes: HMR new modules only applying React Refresh after routes revalidate

Platonic ideal

Detect addition or change of loaders so we only revalidate those.

Removal shouldn't require special handling.
Stale data can just be kept around and garbage collected.
Or we can "revalidate" it which will instantly clean it up since there's nothing to do.

How to detect loader changes

Hash the loader function.
Ideally we could detect subtle things like an import alias changing or an import source changing even when loader source code stays the same, but that's HARD, so not gonna do that. At least not now.

For correctness, we can err on the side of doing a full revalidation for this loader whenever anything changes in its file.
For speed, we could err on the side of only revalidating when loader hash changes, but might miss out on subtle cases like the ones mentioned above.

Since we currently have "double save = full refresh" dev snacks, we could go for the "speed optimized" approach and let users double save to force a revalidation when those subtle cases come up, but they should be exceedingly rare.

@ryanflorence ryanflorence changed the title 🗺️ HMR 🗺️ Remix Rejuvenate (HMR) Jan 31, 2023
@ryanflorence ryanflorence changed the title 🗺️ Remix Rejuvenate (HMR) 🗺️ Remix Retune (HMR) Jan 31, 2023
@ryanflorence ryanflorence added this to the v1.14 milestone Feb 21, 2023
@pcattori pcattori moved this from In Progress to Merged in Roadmap Feb 22, 2023
@MichaelDeBoey MichaelDeBoey moved this from Merged to Released in Roadmap Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants