-
Notifications
You must be signed in to change notification settings - Fork 492
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
Need a component ServerOnly or any alternative #1408
Comments
Could https://github.com/maoberlehner/vue-lazy-hydration help in this case? |
but it seems your question is a duplicate of #1056 . |
Thanks @noxify but I am unable to stop vue to re-render the component on client-side using
The page initially renders with server-side content, then on loading complete vue rerenders complete data. Any suggestion how to stop the rerender ? |
@milindsingh - currently not - can you share your repo? Then I can take a look with the same setup as you have. |
Thanks @noxify I have added to the project it's currently private until complete. Its a copy of gridsome.org. deployed at https://dev.adapttive.com |
Hi, I created a simple codesandbox to test it without gridsome :
I'm not sure if I did something wrong, but it seems not to work 🤷♂️ ( maybe someone could review it, just to make sure :) ) But the positive: It's not a gridsome problem 🙈 and we can reproduce the problem also with a "vanilla vue" setup. @hjvedvik - Maybe you have a minute to take a look? Regards, |
I have added the lazy hydration to never and the app is not getting mounted, that is correct. But it still has the same weird issue, i.e prismjs content is re-rendered and code preview is replaced with normal text. Open the page directly in the browser with the first link, you'll see not code preview. Then check out the source, prismjs SSR have generated a code preview. Now, use any page route to go some other page, and then from blog route come back to the same page, you'll see code preview working. How this is happening? @AllanChain have you faced anything related to this? |
@milindsingh Sorry, not yet. To clarify, if you see the word disable hydration in @allanchain/gridsome-plugin-pwa app shell mode, that's about rendering totally on client side. |
Thanks everyone for your help. It was https://github.com/maoberlehner/vue-lazy-hydration works perfectly fine. |
Summary
Need a component ServerOnly or any alternative way to render component only on the server-side and do not re-render in the browser.
Basic example
This will generate HTML only on
gridsome build
and will not re-render on browser routing.Motivation
This will optimize the content and speed-up page render. If anyone can direct me to the right direction I am very much willing to add this feature (if missing).
Thank you.
The text was updated successfully, but these errors were encountered: