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

Selective hydration #236

Open
KoderFPV opened this issue Jun 11, 2024 · 2 comments
Open

Selective hydration #236

KoderFPV opened this issue Jun 11, 2024 · 2 comments

Comments

@KoderFPV
Copy link

Hi,

I would like to know if selective hydration can be achieved with this library.

As far I understand rehydrateMarks forces the app to wait until all js are downloaded before it starts the hydration process.

So we have to get everything to have anything working.
In selective hydration react can prior what to download and hydrate first based on user interaction.

am I right?

@theKashey
Copy link
Owner

Selective Hydration might not be what you think it is. Apparently, if you will try to operate with your application when it's not fully loaded there is a chance that all "not yet loaded" boundaries will fall into suspense mode. Any context update "above" will cause it.

So you dont need to wait for rehydrateMarks, but you might want to do that.

@KoderFPV
Copy link
Author

KoderFPV commented Jun 12, 2024

Selective Hydration might not be what you think it is.

Yes, I am still learning all the new R18/19 features, and thay're quite confusing sometimes.

However, I achieved something interesting in nextjs, and now I would like to do the same in React without a framework.
But, I am not sure if waiting for marks allows me that, or even if it's related to this library

In nextjs, a I created dev toolbar, it is an asynchronous server component with promise inside of it. This promise resolves after 5000ms (because it's waiting for some data)

And In my understanding, I was able to, load the whole page, make it interactive, before whole page was fully loaded.

Is it something that react-imported-component could help with?

screen-capture.2.webm

image

image

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

2 participants