-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix app client entry key for windows (#44011)
## Bug The app client entry key was in win32 slashes like `app\blog`, and when we add the new layer checking logic in #43197, `name.startsWith('app/')` doesn't work. Fixes #43854 Fixes #43902 <img width="862" alt="image" src="https://user-images.githubusercontent.com/4800338/207641886-08ffc159-0516-4609-9a1f-8c8693586122.png"> - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
- Loading branch information
Showing
13 changed files
with
103 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function page() { | ||
return <>blog</> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default function RootLayout({ children }) { | ||
return ( | ||
<html> | ||
<head></head> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function page() { | ||
return <>page</> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
experimental: { | ||
appDir: true, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* eslint-env jest */ | ||
|
||
import { join } from 'path' | ||
import { runDevSuite, runProdSuite, renderViaHTTP } from 'next-test-utils' | ||
|
||
import webdriver from 'next-webdriver' | ||
const appDir = join(__dirname, '..') | ||
|
||
function runTests(context, env) { | ||
describe('App Dir Basic', () => { | ||
it('should render html properly', async () => { | ||
const indexHtml = await renderViaHTTP(context.appPort, '/') | ||
const blogHtml = await renderViaHTTP(context.appPort, '/blog') | ||
|
||
expect(indexHtml).toContain('page') | ||
expect(blogHtml).toContain('blog') | ||
}) | ||
|
||
it('should hydrate pages properly', async () => { | ||
const browser = await webdriver(context.appPort, '/') | ||
const indexHtml = await browser.waitForElementByCss('body').text() | ||
const url = await browser.url() | ||
await browser.loadPage(url + 'blog') | ||
const blogHtml = await browser.waitForElementByCss('body').text() | ||
|
||
expect(indexHtml).toContain('page') | ||
expect(blogHtml).toContain('blog') | ||
}) | ||
}) | ||
} | ||
|
||
runDevSuite('App Dir Basic', appDir, { runTests }) | ||
runProdSuite('App Dir Basic', appDir, { runTests }) |