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

Fix app client entry key for windows #44011

Merged
merged 6 commits into from Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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 azure-pipelines.yml
Expand Up @@ -70,7 +70,7 @@ stages:
condition: eq(variables['isDocsOnly'], 'No')

- script: |
node run-tests.js -c 1 test/integration/production/test/index.test.js test/integration/css-client-nav/test/index.test.js test/integration/rewrites-has-condition/test/index.test.js
node run-tests.js -c 1 test/integration/production/test/index.test.js test/integration/css-client-nav/test/index.test.js test/integration/rewrites-has-condition/test/index.test.js test/integration/app-dir-basic/test/index.test.js
condition: eq(variables['isDocsOnly'], 'No')
displayName: 'Run tests'

Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -198,6 +198,7 @@
"release": "6.3.1",
"request-promise-core": "1.1.2",
"resolve-from": "5.0.0",
"rimraf": "3.0.2",
"sass": "1.54.0",
"seedrandom": "3.0.5",
"selenium-webdriver": "4.0.0-beta.4",
Expand Down
1 change: 0 additions & 1 deletion packages/create-next-app/package.json
Expand Up @@ -45,7 +45,6 @@
"cross-spawn": "6.0.5",
"got": "10.7.0",
"prompts": "2.1.0",
"rimraf": "3.0.2",
"tar": "4.4.10",
"update-check": "1.5.4",
"validate-npm-package-name": "3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/font/package.json
Expand Up @@ -12,7 +12,7 @@
],
"license": "MIT",
"scripts": {
"build": "rm -rf dist && pnpm ncc-fontkit && tsc -d -p tsconfig.json",
"build": "rimraf dist && pnpm ncc-fontkit && tsc -d -p tsconfig.json",
"prepublishOnly": "cd ../../ && turbo run build",
"dev": "pnpm ncc-fontkit && tsc -d -w -p tsconfig.json",
"typescript": "tsec --noEmit -p tsconfig.json",
Expand Down
Expand Up @@ -509,7 +509,10 @@ export class FlightClientEntryPlugin {
// Add for the client compilation
// Inject the entry to the client compiler.
if (this.dev) {
const pageKey = COMPILER_NAMES.client + bundlePath
const pageKey = (COMPILER_NAMES.client + bundlePath).replace(
/\\/g,
path.posix.sep
)
if (!entries[pageKey]) {
entries[pageKey] = {
type: EntryTypes.CHILD_ENTRY,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dev-overlay/package.json
Expand Up @@ -12,7 +12,7 @@
"author": "Joe Haddad <timer@vercel.com>",
"license": "MIT",
"scripts": {
"build": "rm -rf dist && tsc -d -p tsconfig.json",
"build": "rimraf dist && tsc -d -p tsconfig.json",
"prepublishOnly": "cd ../../ && turbo run build",
"dev": "tsc -d -w -p tsconfig.json",
"typescript": "tsec --noEmit -p tsconfig.json"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-refresh-utils/package.json
Expand Up @@ -12,7 +12,7 @@
"author": "Joe Haddad <timer@vercel.com>",
"license": "MIT",
"scripts": {
"build": "rm -rf dist && tsc -d -p tsconfig.json",
"build": "rimraf dist && tsc -d -p tsconfig.json",
"prepublishOnly": "cd ../../ && turbo run build",
"dev": "tsc -d -w -p tsconfig.json"
},
Expand Down
9 changes: 5 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions test/integration/app-dir-basic/app/blog/page.js
@@ -0,0 +1,3 @@
export default function page() {
return <>blog</>
}
8 changes: 8 additions & 0 deletions test/integration/app-dir-basic/app/layout.js
@@ -0,0 +1,8 @@
export default function RootLayout({ children }) {
return (
<html>
<head></head>
<body>{children}</body>
</html>
)
}
3 changes: 3 additions & 0 deletions test/integration/app-dir-basic/app/page.js
@@ -0,0 +1,3 @@
export default function page() {
return <>page</>
}
5 changes: 5 additions & 0 deletions test/integration/app-dir-basic/next.config.js
@@ -0,0 +1,5 @@
module.exports = {
experimental: {
appDir: true,
},
}
33 changes: 33 additions & 0 deletions test/integration/app-dir-basic/test/index.test.js
@@ -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 })