(hydrate: (assetPrefix: string) => void)
| 56 | } |
| 57 | |
| 58 | export function appBootstrap(hydrate: (assetPrefix: string) => void) { |
| 59 | const assetPrefix = getAssetPrefix() |
| 60 | |
| 61 | loadScriptsInSequence((self as any).__next_s, () => { |
| 62 | // If the static shell is being debugged, skip hydration if the |
| 63 | // `__nextppronly` query is present. This is only enabled when the |
| 64 | // environment variable `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING` is |
| 65 | // set to `1`. Otherwise the following is optimized out. |
| 66 | if (process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1') { |
| 67 | const search = new URLSearchParams(window.location.search) |
| 68 | if ( |
| 69 | search.get('__nextppronly') === 'fallback' || |
| 70 | search.get('__nextppronly') === '1' |
| 71 | ) { |
| 72 | console.warn( |
| 73 | `Skipping hydration due to __nextppronly=${search.get('__nextppronly')}` |
| 74 | ) |
| 75 | return |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | hydrate(assetPrefix) |
| 80 | }) |
| 81 | } |
no test coverage detected