Skip to content

Skip route.lazy hydration properties after hydration #13376

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

Merged
merged 5 commits into from
Apr 8, 2025

Conversation

markdalgleish
Copy link
Member

@markdalgleish markdalgleish commented Apr 7, 2025

This PR takes advantage of the new granular route.lazy API by skipping unused hydration properties when we're done hydrating.

TODO:

  • Refactor to avoid awkward empty hydrationRouteProperty array passing?

Copy link

changeset-bot bot commented Apr 7, 2025

🦋 Changeset detected

Latest commit: cd3840c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
react-router Patch
@react-router/architect Patch
@react-router/cloudflare Patch
@react-router/dev Patch
react-router-dom Patch
@react-router/express Patch
@react-router/node Patch
@react-router/serve Patch
@react-router/fs-routes Patch
@react-router/remix-routes-option-adapter Patch
create-react-router Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -817,6 +818,7 @@ export function createRouter(init: RouterInit): Router {
"You must provide a non-empty routes array to createRouter"
);

let hydrationRouteProperties = init.hydrationRouteProperties || [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol I have a love/hate relationship with the agnostic nature of this sometimes

@markdalgleish markdalgleish changed the title WIP: Skip route.lazy hydration properties after hydration Skip route.lazy hydration properties after hydration Apr 7, 2025
@markdalgleish markdalgleish marked this pull request as ready for review April 7, 2025 22:20
@brophdawg11
Copy link
Contributor

I'm going to merge this to dev because I was planning to get #13253 up to date with latest dev this AM and this will touch some of the same code

@brophdawg11 brophdawg11 merged commit c63b509 into dev Apr 8, 2025
5 checks passed
@brophdawg11 brophdawg11 deleted the markdalgleish/lazy-hydrate-fallback-optimization branch April 8, 2025 14:19
Copy link
Contributor

🤖 Hello there,

We just published version 7.5.1-pre.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Copy link
Contributor

🤖 Hello there,

We just published version 7.5.1 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants