You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So the key is that island component can be loaded dynamically.Then we can use requestIdleCallback, IntersectionObserver API or some custom logic to decide to load the component in proper time.
Describe the solution you'd like
In Island.js, we can implement above feature in these parts:
Expose more island config to user, such as __island="visible" | "idle" | "media".
Islands bundle build phase, we should hang the load function instead of component itself so that the component to can be loaded dynamically.
In client runtime, we should optimize the hydrate script.Base on the island config by user, we choose to load the island component and hydrate it in the proper time.
Is your feature request related to a problem? Please describe.
Now island component can only hang on
window
object globally and it is difficult if we want to lazyload it.In Astro, you can lazyload the island component by multi directives:
So the key is that island component can be loaded dynamically.Then we can use requestIdleCallback, IntersectionObserver API or some custom logic to decide to load the component in proper time.
Describe the solution you'd like
In Island.js, we can implement above feature in these parts:
__island="visible" | "idle" | "media"
.Describe alternatives you've considered
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: