Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
d72b2d6e
Unverified
Commit
d72b2d6e
authored
Jan 14, 2021
by
Ramiro Silveyra d'Avila
Committed by
GitHub
Jan 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: webpack 5 and worker-loader support (#21050)
Co-authored-by:
Joe Haddad
<
joe.haddad@zeit.co
>
parent
9efe8eb0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
25 deletions
+18
-25
build_test_deploy.yml
.github/workflows/build_test_deploy.yml
+1
-1
package.json
package.json
+6
-6
ReactRefreshWebpackPlugin.ts
packages/react-refresh-utils/ReactRefreshWebpackPlugin.ts
+2
-0
next.config.js
test/integration/worker-loader/next.config.js
+1
-1
index.test.js
test/integration/worker-loader/test/index.test.js
+1
-2
yarn.lock
yarn.lock
+7
-15
No files found.
.github/workflows/build_test_deploy.yml
View file @
d72b2d6e
...
@@ -183,7 +183,7 @@ jobs:
...
@@ -183,7 +183,7 @@ jobs:
-
run
:
yarn list webpack react react-dom
-
run
:
yarn list webpack react react-dom
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs-only' }}
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs-only' }}
-
run
:
xvfb-run node run-tests.js test/integration/{link-ref,production,basic,async-modules,ssr-ctx}/test/index.test.js test/acceptance/*.test.js
-
run
:
xvfb-run node run-tests.js test/integration/{link-ref,production,basic,async-modules,ssr-ctx
,worker-loader
}/test/index.test.js test/acceptance/*.test.js
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs-only' }}
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs-only' }}
testFirefox
:
testFirefox
:
...
...
package.json
View file @
d72b2d6e
...
@@ -44,6 +44,11 @@
...
@@ -44,6 +44,11 @@
"
@babel/preset-react
"
:
"7.12.10"
,
"
@babel/preset-react
"
:
"7.12.10"
,
"
@fullhuman/postcss-purgecss
"
:
"1.3.0"
,
"
@fullhuman/postcss-purgecss
"
:
"1.3.0"
,
"
@mdx-js/loader
"
:
"0.18.0"
,
"
@mdx-js/loader
"
:
"0.18.0"
,
"
@opentelemetry/exporter-zipkin
"
:
"0.14.0"
,
"
@opentelemetry/node
"
:
"0.14.0"
,
"
@opentelemetry/plugin-http
"
:
"0.14.0"
,
"
@opentelemetry/plugin-https
"
:
"0.14.0"
,
"
@opentelemetry/tracing
"
:
"0.14.0"
,
"
@types/cheerio
"
:
"0.22.16"
,
"
@types/cheerio
"
:
"0.22.16"
,
"
@types/fs-extra
"
:
"8.1.0"
,
"
@types/fs-extra
"
:
"8.1.0"
,
"
@types/http-proxy
"
:
"1.17.3"
,
"
@types/http-proxy
"
:
"1.17.3"
,
...
@@ -129,12 +134,7 @@
...
@@ -129,12 +134,7 @@
"
wait-port
"
:
"0.2.2"
,
"
wait-port
"
:
"0.2.2"
,
"
web-streams-polyfill
"
:
"2.1.1"
,
"
web-streams-polyfill
"
:
"2.1.1"
,
"
webpack-bundle-analyzer
"
:
"4.3.0"
,
"
webpack-bundle-analyzer
"
:
"4.3.0"
,
"
worker-loader
"
:
"2.0.0"
,
"
worker-loader
"
:
"3.0.7"
"
@opentelemetry/exporter-zipkin
"
:
"0.14.0"
,
"
@opentelemetry/node
"
:
"0.14.0"
,
"
@opentelemetry/plugin-http
"
:
"0.14.0"
,
"
@opentelemetry/plugin-https
"
:
"0.14.0"
,
"
@opentelemetry/tracing
"
:
"0.14.0"
},
},
"resolutions"
:
{
"resolutions"
:
{
"
browserslist
"
:
"^4.14.7"
,
"
browserslist
"
:
"^4.14.7"
,
...
...
packages/react-refresh-utils/ReactRefreshWebpackPlugin.ts
View file @
d72b2d6e
...
@@ -100,6 +100,7 @@ function webpack5(this: ReactFreshWebpackPlugin, compiler: WebpackCompiler) {
...
@@ -100,6 +100,7 @@ function webpack5(this: ReactFreshWebpackPlugin, compiler: WebpackCompiler) {
// @ts-ignore This exists in webpack 5
// @ts-ignore This exists in webpack 5
const
{
runtimeTemplate
}
=
this
.
compilation
const
{
runtimeTemplate
}
=
this
.
compilation
return
Template
.
asString
([
return
Template
.
asString
([
`if (
${
RuntimeGlobals
.
interceptModuleExecution
}
) {`
,
`
${
`
${
RuntimeGlobals
.
interceptModuleExecution
RuntimeGlobals
.
interceptModuleExecution
}
.push(
${
runtimeTemplate
.
basicFunction
(
'options'
,
[
}
.push(
${
runtimeTemplate
.
basicFunction
(
'options'
,
[
...
@@ -132,6 +133,7 @@ function webpack5(this: ReactFreshWebpackPlugin, compiler: WebpackCompiler) {
...
@@ -132,6 +133,7 @@ function webpack5(this: ReactFreshWebpackPlugin, compiler: WebpackCompiler) {
]
]
)}
`
,
)}
`
,
])}
)`
,
])}
)`
,
'}'
,
])
])
}
}
}
}
...
...
test/integration/worker-loader/next.config.js
View file @
d72b2d6e
...
@@ -4,7 +4,7 @@ module.exports = {
...
@@ -4,7 +4,7 @@ module.exports = {
test
:
/
\.
worker
\.(
js|ts|tsx
)
$/
,
test
:
/
\.
worker
\.(
js|ts|tsx
)
$/
,
loader
:
'worker-loader'
,
loader
:
'worker-loader'
,
options
:
{
options
:
{
name
:
'static/[hash].worker.js'
,
file
name
:
'static/[hash].worker.js'
,
publicPath
:
'/_next/'
,
publicPath
:
'/_next/'
,
},
},
})
})
...
...
test/integration/worker-loader/test/index.test.js
View file @
d72b2d6e
...
@@ -9,8 +9,7 @@ const context = {}
...
@@ -9,8 +9,7 @@ const context = {}
jest
.
setTimeout
(
1000
*
60
*
2
)
jest
.
setTimeout
(
1000
*
60
*
2
)
// TODO: Upgrade worker-loader when it's published with webpack 5 support
describe
(
'Web Workers with Fast Refresh'
,
()
=>
{
describe
.
skip
(
'Web Workers with Fast Refresh'
,
()
=>
{
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
context
.
appPort
=
await
findPort
()
context
.
appPort
=
await
findPort
()
context
.
server
=
await
launchApp
(
appDir
,
context
.
appPort
)
context
.
server
=
await
launchApp
(
appDir
,
context
.
appPort
)
...
...
yarn.lock
View file @
d72b2d6e
...
@@ -9918,7 +9918,7 @@ loader-utils@2.0.0, loader-utils@^2.0.0:
...
@@ -9918,7 +9918,7 @@ loader-utils@2.0.0, loader-utils@^2.0.0:
emojis-list "^3.0.0"
emojis-list "^3.0.0"
json5 "^2.1.2"
json5 "^2.1.2"
loader-utils@^1.0.
0, loader-utils@^1.0.
1, loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3:
loader-utils@^1.0.1, loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3:
version "1.4.0"
version "1.4.0"
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613"
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613"
dependencies:
dependencies:
...
@@ -14067,14 +14067,6 @@ schema-utils@2.7.1, schema-utils@^2.0.0, schema-utils@^2.6.5, schema-utils@^2.6.
...
@@ -14067,14 +14067,6 @@ schema-utils@2.7.1, schema-utils@^2.0.0, schema-utils@^2.6.5, schema-utils@^2.6.
ajv "^6.12.4"
ajv "^6.12.4"
ajv-keywords "^3.5.2"
ajv-keywords "^3.5.2"
schema-utils@^0.4.0:
version "0.4.7"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.7.tgz#ba74f597d2be2ea880131746ee17d0a093c68187"
integrity sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==
dependencies:
ajv "^6.1.0"
ajv-keywords "^3.1.0"
schema-utils@^1.0.0:
schema-utils@^1.0.0:
version "1.0.0"
version "1.0.0"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770"
...
@@ -16185,13 +16177,13 @@ worker-farm@^1.7.0:
...
@@ -16185,13 +16177,13 @@ worker-farm@^1.7.0:
dependencies:
dependencies:
errno "~0.1.7"
errno "~0.1.7"
worker-loader@
2.0.0
:
worker-loader@
3.0.7
:
version "
2.0.0
"
version "
3.0.7
"
resolved "https://registry.yarnpkg.com/worker-loader/-/worker-loader-
2.0.0.tgz#45fda3ef76aca815771a89107399ee4119b430ac
"
resolved "https://registry.yarnpkg.com/worker-loader/-/worker-loader-
3.0.7.tgz#9cf2122a9a781d6742cb873c58c3769591b31988
"
integrity sha512-
tnvNp4K3KQOpfRnD20m8xltE3eWh89Ye+5oj7wXEEHKac1P4oZ6p9oTj8/8ExqoSBnk9nu5Pr4nKfQ1hn2APJw
==
integrity sha512-
LjYLuYJw6kqQKDoygpoD5vWeR1CbZjuVSW3/8pFsptMlUl8gatNM/pszhasSDAWt+dYxMipWB6695k+1zId+iQ
==
dependencies:
dependencies:
loader-utils "^
1
.0.0"
loader-utils "^
2
.0.0"
schema-utils "^
0.4
.0"
schema-utils "^
3.0
.0"
wrap-ansi@^2.0.0:
wrap-ansi@^2.0.0:
version "2.1.0"
version "2.1.0"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment