未验证 提交 9e8f1733 编写于 作者: J JJ Kasper 提交者: GitHub

Update to latest watchpack with dynamic route rename fix (#10351)

* Fix dynamic route rename failing for case change

* Update normalizing curPageFiles

* Remove using webpacks file info since its inaccurate

* Revert changes in favor of fixing upstream

* Update to latest watchpack with case rename fix
上级 2a084334
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
"url": "0.11.0", "url": "0.11.0",
"url-polyfill": "1.1.7", "url-polyfill": "1.1.7",
"use-subscription": "1.1.1", "use-subscription": "1.1.1",
"watchpack": "2.0.0-beta.5", "watchpack": "2.0.0-beta.13",
"webpack": "4.41.2", "webpack": "4.41.2",
"webpack-dev-middleware": "3.7.0", "webpack-dev-middleware": "3.7.0",
"webpack-hot-middleware": "2.25.0", "webpack-hot-middleware": "2.25.0",
......
/* eslint-env jest */
/* global jasmine */
import fs from 'fs-extra'
import { join } from 'path'
import {
renderViaHTTP,
launchApp,
findPort,
killApp,
waitFor,
} from 'next-test-utils'
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 30 * 2
let app
let appPort
let stderr = ''
const appDir = join(__dirname, '../')
const pageFile = join(appDir, 'pages/[pid].js')
const pageFileAlt = join(appDir, 'pages/[PiD].js')
describe('Dynamic route rename casing', () => {
beforeAll(async () => {
appPort = await findPort()
app = await launchApp(appDir, appPort, {
onStderr(msg) {
stderr += msg || ''
},
})
})
afterAll(() => killApp(app))
it('should not throw error when changing casing of dynamic route file', async () => {
// make sure route is loaded in webpack
const html = await renderViaHTTP(appPort, '/abc')
expect(html).toContain('hi')
await fs.rename(pageFile, pageFileAlt)
await waitFor(2000)
expect(stderr).not.toContain(
`You cannot use different slug names for the same dynamic path`
)
await fs.rename(pageFileAlt, pageFile)
await waitFor(2000)
expect(stderr).not.toContain(
`You cannot use different slug names for the same dynamic path`
)
})
})
...@@ -16736,14 +16736,13 @@ walker@^1.0.7, walker@~1.0.5: ...@@ -16736,14 +16736,13 @@ walker@^1.0.7, walker@~1.0.5:
dependencies: dependencies:
makeerror "1.0.x" makeerror "1.0.x"
watchpack@2.0.0-beta.5: watchpack@2.0.0-beta.13:
version "2.0.0-beta.5" version "2.0.0-beta.13"
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.0.0-beta.5.tgz#c005db39570d81d9d34334870abc0f548901b880" resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.0.0-beta.13.tgz#9d9b0c094b8402139333e04eb6194643c8384f55"
integrity sha512-HGqh9e9QZFhow8JYX+1+E+kIYK0uTTsk6rCOkI0ff0f9kMO0wX783yW8saQC9WDx7qHpVGPXsRnld9nY7iwzQA== integrity sha512-ZEFq2mx/k5qgQwgi6NOm+2ImICb8ngAkA/rZ6oyXZ7SgPn3pncf+nfhYTCrs3lmHwOxnPtGLTOuFLfpSMh1VMA==
dependencies: dependencies:
glob-to-regexp "^0.4.1" glob-to-regexp "^0.4.1"
graceful-fs "^4.1.2" graceful-fs "^4.1.2"
neo-async "^2.5.0"
watchpack@^1.6.0: watchpack@^1.6.0:
version "1.6.0" version "1.6.0"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册