lwc icon indicating copy to clipboard operation
lwc copied to clipboard

Add more control when hydration happens

Open AllanOricil opened this issue 8 months ago • 2 comments

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

AllanOricil avatar Mar 08 '25 15:03 AllanOricil

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?

wjhsf avatar Mar 10 '25 14:03 wjhsf

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:mouseover
  • lwc:hydrate:scroll-into-view
  • lwc: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.

AllanOricil avatar Mar 10 '25 17:03 AllanOricil