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
fcc6d7d4
Unverified
Commit
fcc6d7d4
authored
Apr 25, 2020
by
Joe Haddad
Committed by
GitHub
Apr 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CSS Module HMR (#12177)
parent
e97cf15d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
41 deletions
+41
-41
index.js
packages/next/compiled/cssnano-simple/index.js
+1
-1
package.json
packages/next/package.json
+3
-3
index.test.js
test/integration/css-modules/test/index.test.js
+8
-8
index.test.js
test/integration/scss-modules/test/index.test.js
+9
-9
yarn.lock
yarn.lock
+20
-20
No files found.
packages/next/compiled/cssnano-simple/index.js
View file @
fcc6d7d4
This diff is collapsed.
Click to expand it.
packages/next/package.json
View file @
fcc6d7d4
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
"babel-plugin-transform-define"
:
"2.0.0"
,
"babel-plugin-transform-define"
:
"2.0.0"
,
"babel-plugin-transform-react-remove-prop-types"
:
"0.4.24"
,
"babel-plugin-transform-react-remove-prop-types"
:
"0.4.24"
,
"browserslist"
:
"4.8.3"
,
"browserslist"
:
"4.8.3"
,
"css-loader"
:
"3.5.
2
"
,
"css-loader"
:
"3.5.
3
"
,
"find-cache-dir"
:
"3.3.1"
,
"find-cache-dir"
:
"3.3.1"
,
"fork-ts-checker-webpack-plugin"
:
"3.1.1"
,
"fork-ts-checker-webpack-plugin"
:
"3.1.1"
,
"jest-worker"
:
"24.9.0"
,
"jest-worker"
:
"24.9.0"
,
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
"react-refresh"
:
"0.8.1"
,
"react-refresh"
:
"0.8.1"
,
"resolve-url-loader"
:
"3.1.1"
,
"resolve-url-loader"
:
"3.1.1"
,
"sass-loader"
:
"8.0.2"
,
"sass-loader"
:
"8.0.2"
,
"style-loader"
:
"1.
1.4
"
,
"style-loader"
:
"1.
2.0
"
,
"styled-jsx"
:
"3.2.5"
,
"styled-jsx"
:
"3.2.5"
,
"use-subscription"
:
"1.1.1"
,
"use-subscription"
:
"1.1.1"
,
"watchpack"
:
"2.0.0-beta.13"
,
"watchpack"
:
"2.0.0-beta.13"
,
...
@@ -160,7 +160,7 @@
...
@@ -160,7 +160,7 @@
"conf"
:
"5.0.0"
,
"conf"
:
"5.0.0"
,
"content-type"
:
"1.0.4"
,
"content-type"
:
"1.0.4"
,
"cookie"
:
"0.4.0"
,
"cookie"
:
"0.4.0"
,
"cssnano-simple"
:
"1.0.
0
"
,
"cssnano-simple"
:
"1.0.
1
"
,
"devalue"
:
"2.0.1"
,
"devalue"
:
"2.0.1"
,
"dotenv"
:
"8.2.0"
,
"dotenv"
:
"8.2.0"
,
"dotenv-expand"
:
"5.1.0"
,
"dotenv-expand"
:
"5.1.0"
,
...
...
test/integration/css-modules/test/index.test.js
View file @
fcc6d7d4
/* eslint-env jest */
/* eslint-env jest */
/* global jasmine */
/* global jasmine */
import
{
join
}
from
'path
'
import
cheerio
from
'cheerio
'
import
{
re
move
,
readFile
,
readdir
}
from
'fs-extra'
import
{
re
addir
,
readFile
,
remove
}
from
'fs-extra'
import
{
import
{
nextBuild
,
File
,
nextStart
,
findPort
,
findPort
,
killApp
,
killApp
,
launchApp
,
launchApp
,
waitFor
,
nextBuild
,
nextStart
,
renderViaHTTP
,
renderViaHTTP
,
waitFor
,
}
from
'next-test-utils'
}
from
'next-test-utils'
import
cheerio
from
'cheerio'
import
webdriver
from
'next-webdriver'
import
webdriver
from
'next-webdriver'
import
{
join
}
from
'path'
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
1000
*
60
*
1
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
1000
*
60
*
1
...
@@ -189,7 +190,7 @@ describe('Has CSS Module in computed styles in Production', () => {
...
@@ -189,7 +190,7 @@ describe('Has CSS Module in computed styles in Production', () => {
})
})
})
})
x
describe
(
'Can hot reload CSS Module without losing state'
,
()
=>
{
describe
(
'Can hot reload CSS Module without losing state'
,
()
=>
{
const
appDir
=
join
(
fixturesDir
,
'hmr-module'
)
const
appDir
=
join
(
fixturesDir
,
'hmr-module'
)
let
appPort
let
appPort
...
@@ -203,7 +204,6 @@ xdescribe('Can hot reload CSS Module without losing state', () => {
...
@@ -203,7 +204,6 @@ xdescribe('Can hot reload CSS Module without losing state', () => {
await
killApp
(
app
)
await
killApp
(
app
)
})
})
// FIXME: this is broken
it
(
'should update CSS color without remounting <input>'
,
async
()
=>
{
it
(
'should update CSS color without remounting <input>'
,
async
()
=>
{
const
browser
=
await
webdriver
(
appPort
,
'/'
)
const
browser
=
await
webdriver
(
appPort
,
'/'
)
...
...
test/integration/scss-modules/test/index.test.js
View file @
fcc6d7d4
/* eslint-env jest */
/* eslint-env jest */
/* global jasmine */
/* global jasmine */
import
{
join
}
from
'path
'
import
cheerio
from
'cheerio
'
import
{
re
move
,
readFile
,
readdir
}
from
'fs-extra'
import
{
re
addir
,
readFile
,
remove
}
from
'fs-extra'
import
{
import
{
nextBuild
,
File
,
nextStart
,
findPort
,
findPort
,
killApp
,
killApp
,
launchApp
,
launchApp
,
waitFor
,
nextBuild
,
nextStart
,
renderViaHTTP
,
renderViaHTTP
,
waitFor
,
}
from
'next-test-utils'
}
from
'next-test-utils'
import
cheerio
from
'cheerio'
import
webdriver
from
'next-webdriver'
import
webdriver
from
'next-webdriver'
import
{
join
}
from
'path'
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
1000
*
60
*
1
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
1000
*
60
*
1
...
@@ -188,7 +189,7 @@ describe('Has CSS Module in computed styles in Production', () => {
...
@@ -188,7 +189,7 @@ describe('Has CSS Module in computed styles in Production', () => {
})
})
})
})
x
describe
(
'Can hot reload CSS Module without losing state'
,
()
=>
{
describe
(
'Can hot reload CSS Module without losing state'
,
()
=>
{
const
appDir
=
join
(
fixturesDir
,
'hmr-module'
)
const
appDir
=
join
(
fixturesDir
,
'hmr-module'
)
let
appPort
let
appPort
...
@@ -202,7 +203,6 @@ xdescribe('Can hot reload CSS Module without losing state', () => {
...
@@ -202,7 +203,6 @@ xdescribe('Can hot reload CSS Module without losing state', () => {
await
killApp
(
app
)
await
killApp
(
app
)
})
})
// FIXME: this is broken
it
(
'should update CSS color without remounting <input>'
,
async
()
=>
{
it
(
'should update CSS color without remounting <input>'
,
async
()
=>
{
const
browser
=
await
webdriver
(
appPort
,
'/'
)
const
browser
=
await
webdriver
(
appPort
,
'/'
)
...
@@ -217,7 +217,7 @@ xdescribe('Can hot reload CSS Module without losing state', () => {
...
@@ -217,7 +217,7 @@ xdescribe('Can hot reload CSS Module without losing state', () => {
const
cssFile
=
new
File
(
join
(
appDir
,
'pages/index.module.scss'
))
const
cssFile
=
new
File
(
join
(
appDir
,
'pages/index.module.scss'
))
try
{
try
{
cssFile
.
replace
(
'
color: red'
,
'colo
r: purple'
)
cssFile
.
replace
(
'
$var: red'
,
'$va
r: purple'
)
await
waitFor
(
2000
)
// wait for HMR
await
waitFor
(
2000
)
// wait for HMR
const
refreshedColor
=
await
browser
.
eval
(
const
refreshedColor
=
await
browser
.
eval
(
...
...
yarn.lock
View file @
fcc6d7d4
...
@@ -5427,10 +5427,10 @@ css-loader@1.0.0:
...
@@ -5427,10 +5427,10 @@ css-loader@1.0.0:
postcss-value-parser "^3.3.0"
postcss-value-parser "^3.3.0"
source-list-map "^2.0.0"
source-list-map "^2.0.0"
css-loader@3.5.
2
:
css-loader@3.5.
3
:
version "3.5.
2
"
version "3.5.
3
"
resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-3.5.
2.tgz#6483ae56f48a7f901fbe07dde2fc96b01eafab3c
"
resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-3.5.
3.tgz#95ac16468e1adcd95c844729e0bb167639eb0bcf
"
integrity sha512-
hDL0DPopg6zQQSRlZm0hyeaqIRnL0wbWjay9BZxoiJBpbfOW4WHfbaYQhwnDmEa0kZUc1CJ3IFo15ot1yULMIQ
==
integrity sha512-
UEr9NH5Lmi7+dguAm+/JSPovNjYbm2k3TK58EiwQHzOHH5Jfq1Y+XoP2bQO6TMn7PptMd0opxxedAWcaSTRKHw
==
dependencies:
dependencies:
camelcase "^5.3.1"
camelcase "^5.3.1"
cssesc "^3.0.0"
cssesc "^3.0.0"
...
@@ -5443,7 +5443,7 @@ css-loader@3.5.2:
...
@@ -5443,7 +5443,7 @@ css-loader@3.5.2:
postcss-modules-scope "^2.2.0"
postcss-modules-scope "^2.2.0"
postcss-modules-values "^3.0.0"
postcss-modules-values "^3.0.0"
postcss-value-parser "^4.0.3"
postcss-value-parser "^4.0.3"
schema-utils "^2.6.
5
"
schema-utils "^2.6.
6
"
semver "^6.3.0"
semver "^6.3.0"
css-modules-loader-core@^1.1.0:
css-modules-loader-core@^1.1.0:
...
@@ -5588,19 +5588,19 @@ cssnano-preset-default@^4.0.7:
...
@@ -5588,19 +5588,19 @@ cssnano-preset-default@^4.0.7:
postcss-svgo "^4.0.2"
postcss-svgo "^4.0.2"
postcss-unique-selectors "^4.0.1"
postcss-unique-selectors "^4.0.1"
cssnano-preset-simple@^1.0.
0
:
cssnano-preset-simple@^1.0.
1
:
version "1.0.
2
"
version "1.0.
3
"
resolved "https://registry.yarnpkg.com/cssnano-preset-simple/-/cssnano-preset-simple-1.0.
2.tgz#0af821593cec5edf010e5ff0753fd89eb52d40de
"
resolved "https://registry.yarnpkg.com/cssnano-preset-simple/-/cssnano-preset-simple-1.0.
3.tgz#a6b00bebb457a79218443d345ba7e28e9d1e3e4a
"
integrity sha512-
FhAjiyAJoQOfvOZVSaNYkmmg2KE/SmaJVBNqglvvZ4QgwtTMVOaggozmRwfyO2QfeyKstRCpeRglziWym0Q9/w
==
integrity sha512-
TMtCiUf75Kw+RCyBcYSz14cEmjKb+QI9KDUZbuinqdaZvc7qOuTKU27FTIfnCorbekmA7EGMC3tgN7J4vt1N1Q
==
dependencies:
dependencies:
postcss "^7.0.18"
postcss "^7.0.18"
cssnano-simple@1.0.
0
:
cssnano-simple@1.0.
1
:
version "1.0.
0
"
version "1.0.
1
"
resolved "https://registry.yarnpkg.com/cssnano-simple/-/cssnano-simple-1.0.
0.tgz#a9322f7f4c192fad29c6d48afcb7927a9c5c597b
"
resolved "https://registry.yarnpkg.com/cssnano-simple/-/cssnano-simple-1.0.
1.tgz#6e90b8a4544f229420b27fca57d437969486e3ac
"
integrity sha512-
B7u9vvtXEqeU2rzdt+Kfw5O9Nd46R7KNjJoP7Y5lGQs6c7n1Et5Ilofh2W9OjBV/ZiJV5+7j9ShWgiYNtH/57A
==
integrity sha512-
M8OQI62DtI4/VM7GSDXOOFTBPc+0nWgF9d8w15QTx8tOYuo1KJyPFBP6uc0gQ8buLDUvUdy1ZDL548qVlJK1qQ
==
dependencies:
dependencies:
cssnano-preset-simple "^1.0.
0
"
cssnano-preset-simple "^1.0.
1
"
postcss "^7.0.18"
postcss "^7.0.18"
cssnano-util-get-arguments@^4.0.0:
cssnano-util-get-arguments@^4.0.0:
...
@@ -14825,7 +14825,7 @@ schema-utils@^1.0.0:
...
@@ -14825,7 +14825,7 @@ schema-utils@^1.0.0:
ajv-errors "^1.0.0"
ajv-errors "^1.0.0"
ajv-keywords "^3.1.0"
ajv-keywords "^3.1.0"
schema-utils@^2.0.0, schema-utils@^2.6.1, schema-utils@^2.6.4, schema-utils@^2.6.
5
:
schema-utils@^2.0.0, schema-utils@^2.6.1, schema-utils@^2.6.4, schema-utils@^2.6.
6
:
version "2.6.6"
version "2.6.6"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.6.6.tgz#299fe6bd4a3365dc23d99fd446caff8f1d6c330c"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.6.6.tgz#299fe6bd4a3365dc23d99fd446caff8f1d6c330c"
integrity sha512-wHutF/WPSbIi9x6ctjGGk2Hvl0VOz5l3EKEuKbjPlB30mKZUzb9A5k9yEXRX3pwyqVLPvpfZZEllaFq/M718hA==
integrity sha512-wHutF/WPSbIi9x6ctjGGk2Hvl0VOz5l3EKEuKbjPlB30mKZUzb9A5k9yEXRX3pwyqVLPvpfZZEllaFq/M718hA==
...
@@ -15631,13 +15631,13 @@ style-inject@^0.3.0:
...
@@ -15631,13 +15631,13 @@ style-inject@^0.3.0:
resolved "https://registry.yarnpkg.com/style-inject/-/style-inject-0.3.0.tgz#d21c477affec91811cc82355832a700d22bf8dd3"
resolved "https://registry.yarnpkg.com/style-inject/-/style-inject-0.3.0.tgz#d21c477affec91811cc82355832a700d22bf8dd3"
integrity sha512-IezA2qp+vcdlhJaVm5SOdPPTUu0FCEqfNSli2vRuSIBbu5Nq5UvygTk/VzeCqfLz2Atj3dVII5QBKGZRZ0edzw==
integrity sha512-IezA2qp+vcdlhJaVm5SOdPPTUu0FCEqfNSli2vRuSIBbu5Nq5UvygTk/VzeCqfLz2Atj3dVII5QBKGZRZ0edzw==
style-loader@1.
1.4
:
style-loader@1.
2.0
:
version "1.
1.4
"
version "1.
2.0
"
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.
1.4.tgz#1ad81283cefe51096756fd62697258edad933230
"
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.
2.0.tgz#f78e4d49caf5018f7c03ae1886e1270124feeb0a
"
integrity sha512-
SbBHRD8fwK3pX+4UDF4ETxUF0+rCvk29LWTTI7Rt0cgsDjAj3SWM76ByTe6u2+4IlJ/WwluB7wuslWETCoPQdg
==
integrity sha512-
HC8WcGnjwNrKji7HSBqFOhGNUSt7UDU/jHxT6bA83Gk+JWJBmgitWlGihc0V1w6ZvwlzcX5LJOsofZzSP7b1tQ
==
dependencies:
dependencies:
loader-utils "^2.0.0"
loader-utils "^2.0.0"
schema-utils "^2.6.
5
"
schema-utils "^2.6.
6
"
styled-jsx@3.2.5:
styled-jsx@3.2.5:
version "3.2.5"
version "3.2.5"
...
...
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