File tree 8 files changed +8
-31
lines changed
8 files changed +8
-31
lines changed Original file line number Diff line number Diff line change @@ -47,11 +47,13 @@ export default async function edgeSSRLoader(this: any) {
47
47
: null
48
48
49
49
const transformed = `
50
- import { adapter } from 'next/dist/server/web/adapter'
50
+ import { adapter, enhanceGlobals } from 'next/dist/server/web/adapter'
51
51
import { getRender } from 'next/dist/build/webpack/loaders/next-edge-ssr-loader/render'
52
52
53
53
import Document from ${ stringifiedDocumentPath }
54
54
55
+ enhanceGlobals()
56
+
55
57
const appMod = require(${ stringifiedAppPath } )
56
58
const pageMod = require(${ stringifiedPagePath } )
57
59
const errorMod = require(${ stringifiedErrorPath } )
Original file line number Diff line number Diff line change @@ -2,8 +2,7 @@ import type { NextConfig } from '../../../../server/config-shared'
2
2
import type { DocumentType , AppType } from '../../../../shared/lib/utils'
3
3
import type { BuildManifest } from '../../../../server/get-page-files'
4
4
import type { ReactLoadableManifest } from '../../../../server/load-components'
5
-
6
- import { NextRequest } from '../../../../server/web/spec-extension/request'
5
+ import type { NextRequest } from '../../../../server/web/spec-extension/request'
7
6
8
7
import WebServer from '../../../../server/web-server'
9
8
import {
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import type {
9
9
GetStaticProps ,
10
10
} from '../../../../types'
11
11
import type { BaseNextRequest } from '../../../../server/base-http'
12
+ import type { __ApiPreviewProps } from '../../../../server/api-utils'
12
13
13
14
import { format as formatUrl , UrlWithParsedQuery , parse as parseUrl } from 'url'
14
15
import { parse as parseQs , ParsedUrlQuery } from 'querystring'
@@ -20,7 +21,6 @@ import {
20
21
matchHas ,
21
22
prepareDestination ,
22
23
} from '../../../../shared/lib/router/utils/prepare-destination'
23
- import { __ApiPreviewProps } from '../../../../server/api-utils'
24
24
import { acceptLanguage } from '../../../../server/accept-header'
25
25
import { detectLocaleCookie } from '../../../../shared/lib/i18n/detect-locale-cookie'
26
26
import { detectDomainLocale } from '../../../../shared/lib/i18n/detect-domain-locale'
Original file line number Diff line number Diff line change @@ -3,18 +3,10 @@ import { join } from '../shared/lib/isomorphic/path'
3
3
4
4
export const NEXT_PROJECT_ROOT = join ( __dirname , '..' , '..' )
5
5
export const NEXT_PROJECT_ROOT_DIST = join ( NEXT_PROJECT_ROOT , 'dist' )
6
- export const NEXT_PROJECT_ROOT_NODE_MODULES = join (
7
- NEXT_PROJECT_ROOT ,
8
- 'node_modules'
9
- )
10
6
export const NEXT_PROJECT_ROOT_DIST_CLIENT = join (
11
7
NEXT_PROJECT_ROOT_DIST ,
12
8
'client'
13
9
)
14
- export const NEXT_PROJECT_ROOT_DIST_SERVER = join (
15
- NEXT_PROJECT_ROOT_DIST ,
16
- 'server'
17
- )
18
10
19
11
// Regex for API routes
20
12
export const API_ROUTE = / ^ \/ a p i (?: \/ | $ ) /
Original file line number Diff line number Diff line change @@ -222,21 +222,6 @@ export function createSuffixStream(
222
222
} )
223
223
}
224
224
225
- export function createPrefixStream (
226
- prefix : string
227
- ) : TransformStream < Uint8Array , Uint8Array > {
228
- let prefixFlushed = false
229
- return new TransformStream ( {
230
- transform ( chunk , controller ) {
231
- if ( ! prefixFlushed ) {
232
- controller . enqueue ( encodeText ( prefix ) )
233
- prefixFlushed = true
234
- }
235
- controller . enqueue ( chunk )
236
- } ,
237
- } )
238
- }
239
-
240
225
// Suffix after main body content - scripts before </body>,
241
226
// but wait for the major chunks to be enqueued.
242
227
export function createDeferredSuffixStream (
Original file line number Diff line number Diff line change @@ -5,12 +5,12 @@ import type {
5
5
RouteMatch ,
6
6
Params ,
7
7
} from '../shared/lib/router/utils/route-matcher'
8
+ import type { RouteHas } from '../lib/load-custom-routes'
8
9
9
10
import { getNextInternalQuery , NextUrlWithParsedQuery } from './request-meta'
10
11
import { getPathMatch } from '../shared/lib/router/utils/path-match'
11
12
import { removeTrailingSlash } from '../shared/lib/router/utils/remove-trailing-slash'
12
13
import { normalizeLocalePath } from '../shared/lib/i18n/normalize-locale-path'
13
- import { RouteHas } from '../lib/load-custom-routes'
14
14
import { matchHas } from '../shared/lib/router/utils/prepare-destination'
15
15
import { removePathPrefix } from '../shared/lib/router/utils/remove-path-prefix'
16
16
import { getRequestMeta } from './request-meta'
Original file line number Diff line number Diff line change @@ -40,8 +40,6 @@ export function stripInternalQueries(query: NextParsedUrlQuery) {
40
40
delete query . __props__
41
41
// routing
42
42
delete query . __flight_router_state_tree__
43
-
44
- return query
45
43
}
46
44
47
45
// When react version is >= 18 opt-in using reactRoot
Original file line number Diff line number Diff line change
1
+ import type { CookieSerializeOptions } from '../types'
2
+
1
3
import cookie from 'next/dist/compiled/cookie'
2
- import { CookieSerializeOptions } from '../types'
3
4
4
5
type GetWithOptionsOutput = {
5
6
value : string | undefined
You can’t perform that action at this time.
0 commit comments