vike: Allow returning string (unsafe) from render

I would like to be able to return a string (unsafe) from a server render without having to sanitize with the html export, perhaps this could be an opt-in config option?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 39 (23 by maintainers)

Commits related to this issue

Most upvoted comments

Released in 0.1.2.

See html._injectAssets() and pageContext._pageAssetsin https://github.com/brillout/vite-plugin-ssr/tree/master/examples/custom-server-render-integration.

I added the prefix _ to communicate that these are non-documented beta features subject to breaking changes. For now you are the only one using them and I’ll let you know if there is a breaking change.

After a while we will remove the prefix and add documentation.

Yea I’ve done a pretty deep internal refactor which I’ve been wanting to do for quite some time. The neat thing here is that everything revolves around pageContext now internally as well.

I’m 97% done, I’ll release tomorrow 😃

Tomorrow, hopefully 😃

I’ll release the solution tentatively tomorrow.

No because you have full control over what’s happening in the client.

The html.injectAssets actually injects your .page.client.js script.

AFAICT exposing injectAssets to users should do the trick.