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
Some help or suggestions are required so I can work on the code changes and raise a PR for this.
I have tried few ways in the package by setting a global state variable in the DelayHydration.mjs but does not work.
Happy to discuss more
The delay hydration and replayClick scripts are added to the rendered HTML even if the <DelayHydration> component is not used.
I have a use case where I am wrapping the entire page layout with based on a condition (Check attached screenshot)
When the v-else part is rendered the scripts are still added to the HTML output from nitro.
This is a problem especially when replayClick is enabled and causes the scroll touchEvent issue on mobile devices which was reported below #54 #47
To Reproduce
Steps to reproduce the behavior:
Please check the below stackblitz https://stackblitz.com/edit/nuxt-starter-8agcnh?file=app.vue
Manual mode and is not used, but the scripts is being injected and replayClick is triggering due to this
Expected behavior
If the mode is manual and the component is not used, delay hydration scripts shouldn't be appended in the nitro plugin.
Screenshots
Additional context
I have tried with some code changes in the package where I wanted to set a global state in the DelayHydration.mjs based on which scripts are appended or not in the nitro plugin.
Include or exclude filters won't help here as its a common page and delay hydration is toggled based on a condition.
The text was updated successfully, but these errors were encountered:
sauravbv
changed the title
Delay hydration scripts added even if no DelayHydration component
Script added in manual mode even if DelayHydration component is not used
Aug 16, 2024
Description
Some help or suggestions are required so I can work on the code changes and raise a PR for this.
I have tried few ways in the package by setting a global state variable in the DelayHydration.mjs but does not work.
Happy to discuss more
The delay hydration and replayClick scripts are added to the rendered HTML even if the
<DelayHydration>
component is not used.I have a use case where I am wrapping the entire page layout with based on a condition (Check attached screenshot)
When the v-else part is rendered the scripts are still added to the HTML output from nitro.
This is a problem especially when replayClick is enabled and causes the scroll touchEvent issue on mobile devices which was reported below
#54
#47
To Reproduce
Steps to reproduce the behavior:
Please check the below stackblitz
https://stackblitz.com/edit/nuxt-starter-8agcnh?file=app.vue
Manual mode and is not used, but the scripts is being injected and replayClick is triggering due to this
Expected behavior
If the mode is
manual
and the component is not used, delay hydration scripts shouldn't be appended in the nitro plugin.Screenshots
![image](https://private-user-images.githubusercontent.com/41701284/358620095-8863c05c-795d-489f-8ed8-2c704e06409f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNDk2ODUsIm5iZiI6MTczOTM0OTM4NSwicGF0aCI6Ii80MTcwMTI4NC8zNTg2MjAwOTUtODg2M2MwNWMtNzk1ZC00ODlmLThlZDgtMmM3MDRlMDY0MDlmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDA4MzYyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcyMGQwZDRkOTk2ZjAxZDEzNWMyMzU1Y2M3YzNhODg2NzFkMDc4OTkyNzMyYmFjZjE2ZWE4MDZiZWM1NTQ0ZjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.RxQiDmXgaBRFr6aSFk942Vh_I137-_Alf4eR0IFI1iI)
Additional context
I have tried with some code changes in the package where I wanted to set a global state in the DelayHydration.mjs based on which scripts are appended or not in the nitro plugin.
Include or exclude filters won't help here as its a common page and delay hydration is toggled based on a condition.
The text was updated successfully, but these errors were encountered: