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

Enable App Router for all applications #49088

Merged
merged 27 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/next/src/server/config-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ export const defaultConfig: NextConfig = {
swcFileReading: true,
craCompat: false,
esmExternals: true,
appDir: false,
appDir: true,
// default to 50MB limit
isrMemoryCacheSize: 50 * 1024 * 1024,
incrementalCacheHandlerPath: undefined,
Expand Down
5 changes: 0 additions & 5 deletions packages/next/src/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ const experimentalWarning = execOnce(
`Experimental features are not covered by semver, and may cause unexpected or broken application behavior. ` +
`Use at your own risk.`
)
if (features.includes('appDir')) {
Log.info(
`Thank you for testing \`appDir\` please leave your feedback at https://nextjs.link/app-feedback`
)
}
timneutkens marked this conversation as resolved.
Show resolved Hide resolved

console.warn()
}
Expand Down
8 changes: 0 additions & 8 deletions test/e2e/app-dir/app-static/app-static.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1877,14 +1877,6 @@ createNextDescribe(
})
})

if (!(global as any).isNextDeploy) {
it('should show a message to leave feedback for `appDir`', async () => {
expect(next.cliOutput).toContain(
`Thank you for testing \`appDir\` please leave your feedback at https://nextjs.link/app-feedback`
)
})
}

it('should keep querystring on static page', async () => {
const browser = await next.browser('/blog/tim?message=hello-world')
const checkUrl = async () =>
Expand Down
4 changes: 2 additions & 2 deletions test/integration/app-tree/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { render } from 'react-dom'
import App, { AppContext } from 'next/app'
import { renderToString } from 'react-dom/server'

export const DummyContext = createContext(null)
export const DummyContext = createContext(null) as React.Context<string | null>

export default class MyApp extends App<{ html: string }> {
static async getInitialProps({ Component, AppTree, ctx }: AppContext) {
Expand All @@ -20,7 +20,7 @@ export default class MyApp extends App<{ html: string }> {

if (typeof window !== 'undefined') {
const el = document.createElement('div')
document.querySelector('body').appendChild(el)
document.querySelector('body')?.appendChild(el)
render(toRender, el)
html = el.innerHTML
el.remove()
Expand Down
2 changes: 1 addition & 1 deletion test/integration/app-tree/pages/hello.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Page.getInitialProps = async ({ AppTree }) => {

if (typeof window !== 'undefined') {
const el = document.createElement('div')
document.querySelector('body').appendChild(el)
document.querySelector('body')?.appendChild(el)
render(toRender, el)
html = el.innerHTML
el.remove()
Expand Down
10 changes: 8 additions & 2 deletions test/integration/app-tree/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
"jsx": "preserve",
"plugins": [
{
"name": "next"
}
],
"strictNullChecks": true
},
"exclude": ["node_modules"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"]
}
10 changes: 0 additions & 10 deletions test/integration/appdir-missing-config/app/layout.js

This file was deleted.

3 changes: 0 additions & 3 deletions test/integration/appdir-missing-config/app/page.js

This file was deleted.

95 changes: 0 additions & 95 deletions test/integration/appdir-missing-config/test/index.test.ts

This file was deleted.