Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop legacy RSC server and client extension #40692

Merged
merged 4 commits into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions packages/next/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -702,16 +702,6 @@ function assignDefaults(userConfig: { [key: string]: any }) {
}
}

if (result.experimental?.serverComponents) {
const pageExtensions: string[] = []
;(result.pageExtensions || []).forEach((ext) => {
pageExtensions.push(ext)
pageExtensions.push(`server.${ext}`)
pageExtensions.push(`client.${ext}`)
})
result.pageExtensions = pageExtensions
}

if (result.devIndicators?.buildActivityPosition) {
const { buildActivityPosition } = result.devIndicators
const allowedValues = [
Expand Down
Empty file.
3 changes: 3 additions & 0 deletions test/e2e/app-dir/app/app/extension/page.server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <h1 id="result-page">Result Page</h1>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <p>This file won't be treated as entry page file</p>
}
26 changes: 17 additions & 9 deletions test/e2e/switchable-runtime/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ describe('Switchable runtime', () => {
)
})

it('should not consume server.js file extension', async () => {
const { status } = await fetchViaHTTP(
context.appPort,
'/legacy-extension'
)
expect(status).toBe(404)
})

it('should build /api/hello and /api/edge as an api route with edge runtime', async () => {
let response = await fetchViaHTTP(context.appPort, '/api/hello')
let text = await response.text()
Expand Down Expand Up @@ -216,7 +224,7 @@ describe('Switchable runtime', () => {
export const config = {
runtime: 'experimental-edge',
}

export default () => new Response('edge response')
`
)
Expand Down Expand Up @@ -246,7 +254,7 @@ describe('Switchable runtime', () => {
export const config = {
runtime: 'experimental-edge',
}

export default () => new Response('edge response again')
`
)
Expand Down Expand Up @@ -327,7 +335,7 @@ describe('Switchable runtime', () => {
export const config = {
runtime: 'experimental-edge',
}

export default () => new Response('edge response')
`
)
Expand Down Expand Up @@ -360,7 +368,7 @@ describe('Switchable runtime', () => {
export const config = {
runtime: 'experimental-edge',
}

export default => new Response('edge response')
`
)
Expand All @@ -378,7 +386,7 @@ describe('Switchable runtime', () => {
export const config = {
runtime: 'experimental-edge',
}

`
)
await check(
Expand All @@ -400,7 +408,7 @@ describe('Switchable runtime', () => {
export default function Page() {
return <p>Hello from page with invalid type</p>
}

export const config = {
runtime: 10,
}
Expand All @@ -421,7 +429,7 @@ describe('Switchable runtime', () => {
export default function Page() {
return <p>Hello from page with invalid runtime</p>
}

export const config = {
runtime: "asd"
}
Expand All @@ -442,11 +450,11 @@ describe('Switchable runtime', () => {
export default function Page() {
return <p>Hello from page without errors</p>
}

export const config = {
runtime: 'experimental-edge',
}

`
)
await check(
Expand Down