Skip to content

Commit

Permalink
remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Sep 16, 2022
1 parent dc8265a commit 9b0ff10
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 25 deletions.
6 changes: 2 additions & 4 deletions packages/next/build/webpack-config.ts
Expand Up @@ -1227,6 +1227,8 @@ export default async function getBaseWebpackConfig(
moduleIds: isClient ? 'deterministic' : 'named',
}
: {}),
moduleIds: 'named',
chunkIds: 'named',
splitChunks: (():
| Required<webpack.Configuration>['optimization']['splitChunks']
| false => {
Expand Down Expand Up @@ -1479,11 +1481,7 @@ export default async function getBaseWebpackConfig(
include: [
dir,
// To let the internal client components passing through flight loader
// /next[\\/]dist[\\/]client[\\/]components[\\/][\w-]+\.client\.js$/,
/next[\\/]dist[\\/]client[\\/]/,
// To let next/* api entry files passing through flight loader instead
// of the internal implementation files
// /next[\\/](link|image|future[\\/]image)/,
],
issuerLayer: WEBPACK_LAYERS.server,
use: {
Expand Down
Expand Up @@ -5,7 +5,6 @@ import {
getRSCModuleType,
} from '../../../analysis/get-page-static-info'
import { parse } from '../../../swc'
// import { isNextBuiltInClientComponent } from '../utils'

function transformClient(resourcePath: string): string {
const output = `
Expand Down Expand Up @@ -79,14 +78,6 @@ export default async function transformSource(
// Exclude next internal files which are not marked as client files
buildInfo.rsc = { type: rscType }

// Mark next.js internal client components as client rsc module
// if (
// /next[\\/]dist[\\/]client[\\/]/.test(resourcePath) ||
// isNextBuiltInClientComponent(resourcePath)
// ) {
// buildInfo.rsc = { type: 'client' }
// }

if (buildInfo.rsc?.type === RSC_MODULE_TYPES.client) {
errorForInvalidDataFetching(this.emitError)
const code = transformClient(this.resourcePath)
Expand Down
1 change: 0 additions & 1 deletion packages/next/build/webpack/loaders/next-swc-loader.js
Expand Up @@ -138,7 +138,6 @@ export function pitch() {
export default function swcLoader(inputSource, inputSourceMap) {
const loaderSpan = this.currentTraceSpan.traceChild('next-swc-loader')
const callback = this.async()
console.log('inputSource', inputSource.toString())
loaderSpan
.traceAsyncFn(() =>
loaderTransform.call(this, loaderSpan, inputSource, inputSourceMap)
Expand Down
8 changes: 1 addition & 7 deletions packages/next/build/webpack/loaders/utils.ts
Expand Up @@ -7,16 +7,10 @@ const imageRegex = new RegExp(`\\.(${imageExtensions.join('|')})$`)
const NEXT_API_CLIENT_RSC_REGEX = new RegExp(
`next[\\\\/]dist[\\\\/]client[\\\\/](${nextClientComponents.join('|')})\\.js$`
)
// const NEXT_BUILT_IN_CLIENT_RSC_REGEX = new RegExp(
// `next[\\\\/](${nextClientComponents.join('|')})\\.js$`
// )

// Cover resource paths like `next/*` and `next/dist/client/*`
export function isNextBuiltInClientComponent(resource: string) {
return (
// NEXT_BUILT_IN_CLIENT_RSC_REGEX.test(resource) ||
NEXT_API_CLIENT_RSC_REGEX.test(resource)
)
return NEXT_API_CLIENT_RSC_REGEX.test(resource)
}

export function isClientComponentModule(mod: {
Expand Down
2 changes: 0 additions & 2 deletions test/e2e/app-dir/app-prefetch/app/dashboard/loading.js
@@ -1,5 +1,3 @@
'client'

export default function DashboardLoading() {
return <>Loading dashboard...</>
}
2 changes: 0 additions & 2 deletions test/e2e/app-dir/app-prefetch/app/loading.js
@@ -1,5 +1,3 @@
'client'

export default function GlobalLoading() {
return <>Loading...</>
}

0 comments on commit 9b0ff10

Please sign in to comment.