mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
This PR changes the `getWaitUntil` logic to always check if the platform provided a request context with a `waitUntil` implementation (via [the `@next/request-context` symbol](https://github.com/vercel/next.js/blob/05e6b825768355372dcdfff06dfcd264f78507d3/packages/next/src/server/after/wait-until-builtin.ts#L12)) , regardless of minimalMode or runtime. Previously, we wouldn't check the context at all unless `minimalMode` was set, and defaulted `waitUntil` to a noop otherwise. This would make integration more difficult for providers who don't use `minimalMode`, because they'd have no way to inject their `waitUntil` implementation.
17 lines
453 B
JavaScript
17 lines
453 B
JavaScript
export function cliLog(/** @type {string | Record<string, any>} */ data) {
|
|
console.log('<test-log>' + JSON.stringify(data) + '</test-log>')
|
|
}
|
|
|
|
export function readCliLogs(/** @type {string} */ output) {
|
|
return output
|
|
.split('\n')
|
|
.map((line) => {
|
|
const match = line.match(/^<test-log>(?<value>.+?)<\/test-log>$/)
|
|
if (!match) {
|
|
return null
|
|
}
|
|
return JSON.parse(match.groups.value)
|
|
})
|
|
.filter(Boolean)
|
|
}
|