Contents not rendered at server-side with nuxt.
See original GitHub issueHello,
thanks for the great plugin!
It seems that when doing static site generation (SSG) on the server-side (I suspect it also applies for the SSR use case), any HTML injected into the dom via dompurify-html
will not be present in the pre-rendered HTML.
Sure, the content will be added to the DOM after the initial page visit at hydration time, but that causes multiple layout shifts as content come into the page increasing our CLS performance metric massively, not only offering a worse experience to the users but also affecting our SEO ranking. Another (possible) SEO hit comes more directly because the original HTML is missing crucial content.
FYI I’ve already seen this closed MR https://github.com/LeSuisse/vue-dompurify-html/pull/591
Tested with vue-dompurify-html v2.5.0
Issue Analytics
- State:
- Created a year ago
- Comments:10 (5 by maintainers)
Thanks for the PR @serialine!
Hi,
I did some changes to expose the necessary primitive so the directive can be also used on the server side. You can see the setup here: https://github.com/LeSuisse/vue-dompurify-html/tree/vue-legacy#server-side
I will take a look to provide a Nuxt module for the v3 to make the setup easier.