Skip to content

Commit 50bfd5c

Browse files
Merge branch 'canary' into react18-hydrate
2 parents 213d155 + 136b754 commit 50bfd5c

File tree

112 files changed

+203
-207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+203
-207
lines changed

.github/labeler.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@
99
"packages/react-refresh-utils/**",
1010
"packages/next-codemod/**"
1111
],
12-
"type: chrome": [
12+
"created-by: Chrome Aurora": [
1313
{ "type": "user", "pattern": "spanicker" },
1414
{ "type": "user", "pattern": "housseindjirdeh" },
1515
{ "type": "user", "pattern": "devknoll" },
1616
{ "type": "user", "pattern": "janicklas-ralph" },
1717
{ "type": "user", "pattern": "atcastle" },
1818
{ "type": "user", "pattern": "Joonpark13" }
19+
],
20+
"created-by: Next.js team": [
21+
{ "type": "user", "pattern": "ijjk" },
22+
{ "type": "user", "pattern": "padmaia" },
23+
{ "type": "user", "pattern": "huozhi" },
24+
{ "type": "user", "pattern": "shuding" },
25+
{ "type": "user", "pattern": "sokra" },
26+
{ "type": "user", "pattern": "styfle" },
27+
{ "type": "user", "pattern": "timneutkens" }
1928
]
2029
}
2130
}

packages/next/amp.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './dist/next-server/lib/amp'
1+
export * from './dist/shared/lib/amp'

packages/next/amp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('./dist/next-server/lib/amp')
1+
module.exports = require('./dist/shared/lib/amp')

packages/next/bin/next.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ commands[command]()
118118
})
119119

120120
if (command === 'dev') {
121-
const { CONFIG_FILE } = require('../next-server/lib/constants')
121+
const { CONFIG_FILE } = require('../shared/lib/constants')
122122
const { watchFile } = require('fs')
123123
watchFile(`${process.cwd()}/${CONFIG_FILE}`, (cur: any, prev: any) => {
124124
if (cur.size > 0 || prev.size > 0) {

packages/next/build/babel/loader/get-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { NextBabelLoaderOptions, NextJsLoaderContext } from './types'
88
import { consumeIterator } from './util'
99
import * as Log from '../../output/log'
1010

11-
const nextDistPath = /(next[\\/]dist[\\/]next-server[\\/]lib)|(next[\\/]dist[\\/]client)|(next[\\/]dist[\\/]pages)/
11+
const nextDistPath = /(next[\\/]dist[\\/]shared[\\/]lib)|(next[\\/]dist[\\/]client)|(next[\\/]dist[\\/]pages)/
1212

1313
/**
1414
* The properties defined here are the conditions with which subsets of inputs

packages/next/build/babel/plugins/commonjs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { NodePath, PluginObj, types } from 'next/dist/compiled/babel/core'
22
import commonjsPlugin from 'next/dist/compiled/babel/plugin-transform-modules-commonjs'
33

4-
// Rewrite imports using next/<something> to next-server/<something>
5-
export default function NextToNextServer(...args: any): PluginObj {
4+
// Handle module.exports in user code
5+
export default function CommonJSModulePlugin(...args: any): PluginObj {
66
const commonjs = commonjsPlugin(...args)
77
return {
88
visitor: {

packages/next/build/babel/plugins/next-page-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
Visitor,
77
} from 'next/dist/compiled/babel/core'
88
import { PageConfig } from 'next/types'
9-
import { STRING_LITERAL_DROP_BUNDLE } from '../../../next-server/lib/constants'
9+
import { STRING_LITERAL_DROP_BUNDLE } from '../../../shared/lib/constants'
1010

1111
const CONFIG_KEY = 'config'
1212

packages/next/build/babel/plugins/next-ssg-transform.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ import {
44
types as BabelTypes,
55
} from 'next/dist/compiled/babel/core'
66
import { SERVER_PROPS_SSG_CONFLICT } from '../../../lib/constants'
7-
import {
8-
SERVER_PROPS_ID,
9-
STATIC_PROPS_ID,
10-
} from '../../../next-server/lib/constants'
7+
import { SERVER_PROPS_ID, STATIC_PROPS_ID } from '../../../shared/lib/constants'
118

129
export const EXPORT_NAME_GET_STATIC_PROPS = 'getStaticProps'
1310
export const EXPORT_NAME_GET_STATIC_PATHS = 'getStaticPaths'

packages/next/build/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ import {
4545
SERVER_DIRECTORY,
4646
SERVER_FILES_MANIFEST,
4747
STATIC_STATUS_PAGES,
48-
} from '../next-server/lib/constants'
48+
} from '../shared/lib/constants'
4949
import {
5050
getRouteRegex,
5151
getSortedRoutes,
5252
isDynamicRoute,
53-
} from '../next-server/lib/router/utils'
53+
} from '../shared/lib/router/utils'
5454
import { __ApiPreviewProps } from '../next-server/server/api-utils'
5555
import loadConfig, {
5656
isTargetLikeServerless,
@@ -89,7 +89,7 @@ import {
8989
import getBaseWebpackConfig from './webpack-config'
9090
import { PagesManifest } from './webpack/plugins/pages-manifest-plugin'
9191
import { writeBuildId } from './write-build-id'
92-
import { normalizeLocalePath } from '../next-server/lib/i18n/normalize-locale-path'
92+
import { normalizeLocalePath } from '../shared/lib/i18n/normalize-locale-path'
9393
import { isWebpack5 } from 'next/dist/compiled/webpack/webpack'
9494

9595
const staticCheckWorker = require.resolve('./utils')

packages/next/build/utils.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ import {
1919
} from '../lib/constants'
2020
import prettyBytes from '../lib/pretty-bytes'
2121
import { recursiveReadDir } from '../lib/recursive-readdir'
22-
import { getRouteMatcher, getRouteRegex } from '../next-server/lib/router/utils'
23-
import { isDynamicRoute } from '../next-server/lib/router/utils/is-dynamic'
24-
import escapePathDelimiters from '../next-server/lib/router/utils/escape-path-delimiters'
22+
import { getRouteMatcher, getRouteRegex } from '../shared/lib/router/utils'
23+
import { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic'
24+
import escapePathDelimiters from '../shared/lib/router/utils/escape-path-delimiters'
2525
import { findPageFile } from '../server/lib/find-page-file'
2626
import { GetStaticPaths } from 'next/types'
2727
import { denormalizePagePath } from '../next-server/server/normalize-page-path'
2828
import { BuildManifest } from '../next-server/server/get-page-files'
2929
import { removePathTrailingSlash } from '../client/normalize-trailing-slash'
3030
import { UnwrapPromise } from '../lib/coalesced-function'
31-
import { normalizeLocalePath } from '../next-server/lib/i18n/normalize-locale-path'
31+
import { normalizeLocalePath } from '../shared/lib/i18n/normalize-locale-path'
3232
import * as Log from './output/log'
3333
import { loadComponents } from '../next-server/server/load-components'
3434
import { trace } from '../telemetry/trace'
@@ -765,7 +765,7 @@ export async function isPageStatic(
765765
const isPageStaticSpan = trace('is-page-static-utils', parentId)
766766
return isPageStaticSpan.traceAsyncFn(async () => {
767767
try {
768-
require('../next-server/lib/runtime-config').setConfig(runtimeEnvConfig)
768+
require('../shared/lib/runtime-config').setConfig(runtimeEnvConfig)
769769
const components = await loadComponents(distDir, page, serverless)
770770
const mod = components.ComponentMod
771771
const Comp = mod.default || mod
@@ -880,7 +880,7 @@ export async function hasCustomGetInitialProps(
880880
runtimeEnvConfig: any,
881881
checkingApp: boolean
882882
): Promise<boolean> {
883-
require('../next-server/lib/runtime-config').setConfig(runtimeEnvConfig)
883+
require('../shared/lib/runtime-config').setConfig(runtimeEnvConfig)
884884

885885
const components = await loadComponents(distDir, page, isLikeServerless)
886886
let mod = components.ComponentMod
@@ -900,7 +900,7 @@ export async function getNamedExports(
900900
isLikeServerless: boolean,
901901
runtimeEnvConfig: any
902902
): Promise<Array<string>> {
903-
require('../next-server/lib/runtime-config').setConfig(runtimeEnvConfig)
903+
require('../shared/lib/runtime-config').setConfig(runtimeEnvConfig)
904904
const components = await loadComponents(distDir, page, isLikeServerless)
905905
let mod = components.ComponentMod
906906

0 commit comments

Comments
 (0)