Skip to content

Commit

Permalink
fix(vue): createStreamingResponse missing URL push
Browse files Browse the repository at this point in the history
  • Loading branch information
galvez committed Oct 18, 2024
1 parent 7bf7344 commit 424d539
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions packages/fastify-vue/rendering.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,21 @@ export async function createRenderFunction ({ routes, create }) {
}
}

async function createStreamingResponse (req, routes, routeMap, create) {
// Vue application instance
const app = await create({
routes,
routeMap,
ctxHydration: req.route,
url: req.url,
})
async function createStreamingResponse (req, routes) {
req.route.router.push(req.url)
await req.route.router.isReady()
// SSR stream
const body = renderToNodeStream(app.instance, app.ctx)
const body = renderToNodeStream(req.route.app, req.route.ssrContext)
return { routes, context: req.route, body }
}

async function createResponse (req, routes, routeMap, create) {
console.log('createResponse()')
async function createResponse (req, routes) {
let body
if (!req.route.clientOnly) {
req.route.router.push(req.url)
await req.route.router.isReady()
// SSR string
body = await renderToString(req.route.app, req.route.ssrContext)
console.log('req.route.ssrContext', req.route.ssrContext)
}
return { routes, context: req.route, body }
}
Expand Down

0 comments on commit 424d539

Please sign in to comment.