lwc
lwc copied to clipboard
Add more control when hydration happens
Is your feature request related to a problem? Please describe. No
Describe the solution you'd like
This feature can improve initial page loading
https://vuejs.org/guide/components/async.html#lazy-hydration
https://nuxt.com/blog/v3-16#%EF%B8%8F-delayed-hydration-support
I believe this would be an improvement of the island feature.
https://developer.salesforce.com/docs/platform/lwr/guide/lwr-ssr-islands-implementation.html
Describe alternatives you've considered N/A
Additional context N/A
Thanks for the suggestion! Can you elaborate more on the use case that you're trying to solve? What are you trying to do that cannot be accomplished with the current state of LWC?
I have a custom chart and it doesn't need to be interactive until it is visible or a mouse action happened, such as hover or click. Salesforce pages are often filled with these type of charts so deferring hydration on user actions is going to reduce the initial loading time of these pages.
Hydration directives like these ones would be good for chart components
lwc:hydrate:mouseoverlwc:hydrate:scroll-into-viewlwc:hydrate:click
Some companies measure TTI and FID and use it as KPI to prove they are providing a good user experience to customers over time. Developers could make use of these new hydration directives to reach those goals.