Lukas
Lukas

Reputation: 10370

Partially hydrate a SSR VUE app

We are building a website that—to our all sorrow—has a lot of advertisements. Now we wanna use VUE to build the website, do server side rendering and hydrate the website in the client.

The problem is that the advertisements can basically do anything. Ie. change the background image, inject stuff in the dom, etc. pp.

So the the strategy we want to implement is to render the site in the server and only hydrate specific parts of the website, i.e. specific components with VUE, leaving the rest to the site to the advertisements.

Is that possible with VUE?

edit to clarify: The problem ist that if we hydrate the entire site VUE will clash with things the ads have changed in the site. That is why we want to hydrate specific components in the site only.

Upvotes: 1

Views: 1808

Answers (1)

Nik Cornish
Nik Cornish

Reputation: 36

Late answer but perhaps the Vue Quench library offers some functionality you're looking for. This presentation from the creator details how their team runs a sports website composed of 4 smaller hydrated Vue components based on static HTML markup.

A strategy such as this allows a coexistence of both a Vue app (or multiple Vue instances) alongside the advertisement content you're required to embed.

Upvotes: 1

Related Questions