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 all 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
41 changes: 38 additions & 3 deletions azure-pipelines.yml
Expand Up @@ -35,7 +35,8 @@ variables:
PNPM_CACHE_FOLDER: $(Pipeline.Workspace)/.pnpm-store
PNPM_VERSION: 7.3.0
NEXT_TELEMETRY_DISABLED: '1'
node_version: ^14.19.0
node_14_version: ^14.19.0
node_16_version: ^16.8.0

stages:
- stage: Test
Expand All @@ -46,7 +47,7 @@ stages:
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_version)
versionSpec: $(node_14_version)
displayName: 'Install Node.js'

- bash: |
Expand Down Expand Up @@ -84,7 +85,7 @@ stages:

- task: NodeTool@0
inputs:
versionSpec: $(node_version)
versionSpec: $(node_14_version)
displayName: 'Install Node.js'

- bash: |
Expand All @@ -107,3 +108,37 @@ stages:
- script: node run-tests.js --type unit
condition: eq(variables['isDocsOnly'], 'No')
displayName: 'Run tests'

- job: test_integration_app_dir
pool:
vmImage: 'windows-2019'
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_16_version)
displayName: 'Install Node.js'

- bash: |
node scripts/run-for-change.js --not --type docs --exec echo "##vso[task.setvariable variable=isDocsOnly]No"
displayName: 'Check Docs Only Change'

- script: npm i -g pnpm@$(PNPM_VERSION)
condition: eq(variables['isDocsOnly'], 'No')

- script: pnpm config set store-dir $(PNPM_CACHE_FOLDER)
condition: eq(variables['isDocsOnly'], 'No')

- script: pnpm store path
condition: eq(variables['isDocsOnly'], 'No')

- script: pnpm install && pnpm run build
condition: eq(variables['isDocsOnly'], 'No')
displayName: 'Install and build'

- script: npx playwright install chromium
condition: eq(variables['isDocsOnly'], 'No')

- script: |
node run-tests.js -c 1 test/integration/app-dir-basic/test/index.test.js
condition: eq(variables['isDocsOnly'], 'No')
displayName: 'Run tests'
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 })