Skip to content

SSR support? #357

@yooouuri

Description

@yooouuri

Request / Idea

Inject the needed scripts (in the head and body tag) in SSR, so the server wil render the tags.

Additional Context

Use https://github.com/vueuse/head to inject script to the head tag.

Of course this needs some work in the frontend, because you have to get the injected head and merge with your index.html, see: https://github.com/vueuse/head#ssr-rendering

There seems no plugin available to inject stuff into the body, as Evan You states: You should not teleport an element to the body because SSR don't know how to hydrate it. Maybe exposing a function, returning the code to add to the body, and implement it in the SSR implementation live mentioned in the vueuse link.

Im going to need this, so expect a PR soon!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions