How to support NoScript, SEO, PWA & SPA with Vue ? #11446
rb-ctrl
started this conversation in
General Discussions
Replies: 1 comment 1 reply
-
I have seemed to run into the same issue after updating from There's only 2 workarounds I have so far. The first is removing contents from document.querySelectorAll("[v-text]").forEach((el) => {
el.textContent = ""
})
app.mount("#app") Otherwise, the other alternative is to make a Custom Directive <div v-content="text">Default Content</div> app.directive("content", (el, binding) => {
el.textContent = binding.value
}) I don't know if there's a better approach, though. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
I am currently gathering ideas and information on how to build a hybrid solution, which will support SEO, NoScript Browsers, but also PWA and even SPA.
The base idea is to :
1. generate a static site on the server that renders all initial data (toggle for code and details)
2. In the Browser, if JS is enabled, let vue apply itself to the HTML (toggle for code and details
The above works kinda "fine" as long as I am using vue.global.js. The only thing is a warning :
which I understand and belive to be rightfully emitted.
However, as soon as I switch to the vue.global.prod.js, that warning becomes a breaking compile error :
which translates to :
Since this is my intended behavior and I don't think it is that big of a deal, I would have expected the warning to simply disappear in the prod build instead of breaking it.
I tried to use
but that did nothing in the prod build which makes sense again, because it is for runtime errors and not for compile errors.
In the dev build its warning counterpart actually catches the warning which is a bit strange to me aswell, but I don`t really care about, it's probably to be able to debug better, idk.
My Question :
5.1 I thought that it could generally be seen as an update of the existing data, am I wrong ?
I will happily engage in discussion regarding the topic even if that discussion will not help me solve the above described problem.
Please do not tell me that the base idea is stupid without providing reasonable arguments/a starting point for a discussion. Since I am gathering information, I do not yet care about it simply beeing stupid, instead I would just like to expand my knowledge base for possible solution to any kind of usecases in the future and to be able to compare possible solutions to each other.
Full source code
vue.global.js
vue.global.prod.js
Beta Was this translation helpful? Give feedback.
All reactions