mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
* remove the experimental web vital hook api * remove the exported flush effects api and only error on development, keep only usage to styled-jsx for web vital hook API: The usage is not widly adopted since the existing exported vital api could do the same work. In the future we'll deprecate the `_app.server` in favor of `_app` in server component pages. so that this api won't be required. for flush effects api: other css-in-js libs are not using the same approach like styled-jsx which holding a style registry and could flush it during streaming. emotion-js and styled-components are still relying on `Document.getInitialProps` atm and we have supported it in latest canary
26 lines
442 B
JavaScript
26 lines
442 B
JavaScript
if (typeof navigator !== 'undefined') {
|
|
window.__BEACONS = window.__BEACONS || []
|
|
|
|
navigator.sendBeacon = async function () {
|
|
const args = await Promise.all(
|
|
[...arguments].map((v) => {
|
|
if (v instanceof Blob) {
|
|
return v.text()
|
|
}
|
|
return v
|
|
})
|
|
)
|
|
|
|
window.__BEACONS.push(args)
|
|
}
|
|
}
|
|
|
|
export default () => {
|
|
return (
|
|
<div>
|
|
<h1>Foo!</h1>
|
|
<h2>bar!</h2>
|
|
</div>
|
|
)
|
|
}
|