Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
6c8b18b0
Commit
6c8b18b0
authored
7 years ago
by
Dan Abramov
Committed by
GitHub
7 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Improve interaction between compile and runtime overlays (#2219)
parent
43b819c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/react-dev-utils/webpackHotDevClient.js
+9
-4
packages/react-dev-utils/webpackHotDevClient.js
packages/react-error-overlay/src/styles.js
+1
-1
packages/react-error-overlay/src/styles.js
with
10 additions
and
5 deletions
+10
-5
packages/react-dev-utils/webpackHotDevClient.js
+
9
-
4
View file @
6c8b18b0
...
@@ -38,7 +38,7 @@ function createOverlayIframe(onIframeLoad) {
...
@@ -38,7 +38,7 @@ function createOverlayIframe(onIframeLoad) {
iframe
.
style
.
width
=
'
100vw
'
;
iframe
.
style
.
width
=
'
100vw
'
;
iframe
.
style
.
height
=
'
100vh
'
;
iframe
.
style
.
height
=
'
100vh
'
;
iframe
.
style
.
border
=
'
none
'
;
iframe
.
style
.
border
=
'
none
'
;
iframe
.
style
.
zIndex
=
9999999999
;
iframe
.
style
.
zIndex
=
2147483647
;
iframe
.
onload
=
onIframeLoad
;
iframe
.
onload
=
onIframeLoad
;
return
iframe
;
return
iframe
;
}
}
...
@@ -192,7 +192,6 @@ function clearOutdatedErrors() {
...
@@ -192,7 +192,6 @@ function clearOutdatedErrors() {
// Successful compilation.
// Successful compilation.
function
handleSuccess
()
{
function
handleSuccess
()
{
clearOutdatedErrors
();
clearOutdatedErrors
();
destroyErrorOverlay
();
var
isHotUpdate
=
!
isFirstCompilation
;
var
isHotUpdate
=
!
isFirstCompilation
;
isFirstCompilation
=
false
;
isFirstCompilation
=
false
;
...
@@ -200,14 +199,17 @@ function handleSuccess() {
...
@@ -200,14 +199,17 @@ function handleSuccess() {
// Attempt to apply hot updates or reload.
// Attempt to apply hot updates or reload.
if
(
isHotUpdate
)
{
if
(
isHotUpdate
)
{
tryApplyUpdates
();
tryApplyUpdates
(
function
onHotUpdateSuccess
()
{
// Only destroy it when we're sure it's a hot update.
// Otherwise it would flicker right before the reload.
destroyErrorOverlay
();
});
}
}
}
}
// Compilation with warnings (e.g. ESLint).
// Compilation with warnings (e.g. ESLint).
function
handleWarnings
(
warnings
)
{
function
handleWarnings
(
warnings
)
{
clearOutdatedErrors
();
clearOutdatedErrors
();
destroyErrorOverlay
();
var
isHotUpdate
=
!
isFirstCompilation
;
var
isHotUpdate
=
!
isFirstCompilation
;
isFirstCompilation
=
false
;
isFirstCompilation
=
false
;
...
@@ -231,6 +233,9 @@ function handleWarnings(warnings) {
...
@@ -231,6 +233,9 @@ function handleWarnings(warnings) {
// Only print warnings if we aren't refreshing the page.
// Only print warnings if we aren't refreshing the page.
// Otherwise they'll disappear right away anyway.
// Otherwise they'll disappear right away anyway.
printWarnings
();
printWarnings
();
// Only destroy it when we're sure it's a hot update.
// Otherwise it would flicker right before the reload.
destroyErrorOverlay
();
});
});
}
else
{
}
else
{
// Print initial warnings immediately.
// Print initial warnings immediately.
...
...
This diff is collapsed.
Click to expand it.
packages/react-error-overlay/src/styles.js
+
1
-
1
View file @
6c8b18b0
...
@@ -15,7 +15,7 @@ const iframeStyle = {
...
@@ -15,7 +15,7 @@ const iframeStyle = {
width
:
'
100%
'
,
width
:
'
100%
'
,
height
:
'
100%
'
,
height
:
'
100%
'
,
border
:
'
none
'
,
border
:
'
none
'
,
'
z-index
'
:
1337
,
'
z-index
'
:
2147483647
-
1
,
// below the compile error overlay
};
};
const
overlayStyle
=
{
const
overlayStyle
=
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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