Files
Janka UrygaandGitHub 3a1d3f847b [unstable_after] always use 'waitUntil' from '@next/request-context' if available (#66119)
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.
2024-05-23 14:22:13 +02:00

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)
}