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

feat(gatsby): New overlay for DEV_SSR #31061

Merged
merged 29 commits into from
May 7, 2021
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
fa973ed
wip
LekoArts Apr 26, 2021
bbf8ece
update lock fiel
LekoArts Apr 26, 2021
fe66c81
working error codes in json
LekoArts Apr 27, 2021
1f6814c
get the overlay correctly working (albeit with a little hack :D)
LekoArts Apr 27, 2021
862e9ca
add note for reloading page
LekoArts Apr 28, 2021
d87f716
fix build-html ts issue
LekoArts Apr 28, 2021
a8fb25e
fix snapshot test
LekoArts Apr 28, 2021
08c3f66
use error message inside react template itself instead of hacky solution
LekoArts Apr 29, 2021
87ed4fc
fix unit test
LekoArts Apr 29, 2021
4ce68fa
cypress tests
LekoArts Apr 29, 2021
a256448
update snapshot
LekoArts Apr 29, 2021
52fdd95
use status(200)
LekoArts May 3, 2021
051171b
404 with cypress options
LekoArts May 3, 2021
0a87b43
try some stuff
LekoArts May 4, 2021
938a29f
rename code to sourceContent
LekoArts May 4, 2021
e8af19e
remove unused stuff
LekoArts May 4, 2021
5f7d19e
use custom structured error for failure on dev-404-page
LekoArts May 5, 2021
e364f3a
Merge remote-tracking branch 'upstream/master' into dev-ssr-new-overlay
May 5, 2021
81b4885
revert some e2e changes
LekoArts May 6, 2021
a7ba407
revert some failOnStatusCode changes
LekoArts May 6, 2021
2143440
try catch for clientOnlyShell
LekoArts May 6, 2021
daf954c
minimal html for error outside of module scope
LekoArts May 6, 2021
9edb3f9
account for disabled JS
LekoArts May 6, 2021
3b00bde
updates snapshot
LekoArts May 6, 2021
7615e6c
use snapshot serializer
LekoArts May 6, 2021
4ecfd3c
update snapshot
pieh May 6, 2021
9eb5a5b
make stripIndent actually strip intendent
pieh May 6, 2021
4430c5f
maybe correct snapshot now?
pieh May 6, 2021
8826dc7
colors are bad
pieh May 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update snapshot
  • Loading branch information
LekoArts committed Apr 29, 2021
commit a256448ac51092d2eb231140b09b4b0f02a7f149
2 changes: 1 addition & 1 deletion integration-tests/ssr/__tests__/__snapshots__/ssr.js.snap
Original file line number Diff line number Diff line change
@@ -2,4 +2,4 @@

exports[`SSR is run for a page when it is requested 1`] = `"<!DOCTYPE html><html><head><meta charSet=\\"utf-8\\"/><meta http-equiv=\\"x-ua-compatible\\" content=\\"ie=edge\\"/><meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1, shrink-to-fit=no\\"/><link data-identity=\\"gatsby-dev-css\\" rel=\\"stylesheet\\" type=\\"text/css\\" href=\\"/commons.css\\"/><meta name=\\"note\\" content=\\"environment=development\\"/><script src=\\"/socket.io/socket.io.js\\"></script></head><body><div id=\\"___gatsby\\"><div style=\\"outline:none\\" tabindex=\\"-1\\" id=\\"gatsby-focus-wrapper\\"><div><h1 class=\\"hi\\">Hello world</h1></div></div><div id=\\"gatsby-announcer\\" style=\\"position:absolute;top:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0\\" aria-live=\\"assertive\\" aria-atomic=\\"true\\"></div></div><script src=\\"/polyfill.js\\" nomodule=\\"\\"></script><script src=\\"/framework.js\\"></script><script src=\\"/commons.js\\"></script></body></html>"`;

exports[`SSR it generates an error page correctly 1`] = `"<!DOCTYPE html><html><head><meta charSet=\\"utf-8\\"/><meta http-equiv=\\"x-ua-compatible\\" content=\\"ie=edge\\"/><meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1, shrink-to-fit=no\\"/><link data-identity=\\"gatsby-dev-css\\" rel=\\"stylesheet\\" type=\\"text/css\\" href=\\"/commons.css\\"/><meta name=\\"note\\" content=\\"environment=development\\"/><script src=\\"/socket.io/socket.io.js\\"></script></head><body><div id=\\"___gatsby\\"><div style=\\"outline:none\\" tabindex=\\"-1\\" id=\\"gatsby-focus-wrapper\\"></div><div id=\\"gatsby-announcer\\" style=\\"position:absolute;top:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0\\" aria-live=\\"assertive\\" aria-atomic=\\"true\\"></div></div><script src=\\"/polyfill.js\\" nomodule=\\"\\"></script><script src=\\"/framework.js\\"></script><script src=\\"/commons.js\\"></script><script>window._gatsbyEvents = window._gatsbyEvents || []; window._gatsbyEvents.push([\\"FAST_REFRESH\\",{action: \\"SHOW_DEV_SSR_ERROR\\",payload: {\\"codeFrame\\":\\"\\\\u001b[0m \\\\u001b[90m 2 |\\\\u001b[39m\\\\u001b[0m\\\\n\\\\u001b[0m \\\\u001b[90m 3 |\\\\u001b[39m \\\\u001b[36mconst\\\\u001b[39m \\\\u001b[33mComponent\\\\u001b[39m \\\\u001b[33m=\\\\u001b[39m () \\\\u001b[33m=>\\\\u001b[39m {\\\\u001b[0m\\\\n\\\\u001b[0m\\\\u001b[31m\\\\u001b[1m>\\\\u001b[22m\\\\u001b[39m\\\\u001b[90m 4 |\\\\u001b[39m \\\\u001b[36mconst\\\\u001b[39m a \\\\u001b[33m=\\\\u001b[39m window\\\\u001b[33m.\\\\u001b[39mwidth\\\\u001b[0m\\\\n\\\\u001b[0m \\\\u001b[90m |\\\\u001b[39m \\\\u001b[31m\\\\u001b[1m^\\\\u001b[22m\\\\u001b[39m\\\\u001b[0m\\\\n\\\\u001b[0m \\\\u001b[90m 5 |\\\\u001b[39m\\\\u001b[0m\\\\n\\\\u001b[0m \\\\u001b[90m 6 |\\\\u001b[39m \\\\u001b[36mreturn\\\\u001b[39m \\\\u001b[33m<\\\\u001b[39m\\\\u001b[33mdiv\\\\u001b[39m\\\\u001b[33m>\\\\u001b[39mhi\\\\u001b[33m<\\\\u001b[39m\\\\u001b[33m/\\\\u001b[39m\\\\u001b[33mdiv\\\\u001b[39m\\\\u001b[33m>\\\\u001b[39m\\\\u001b[0m\\\\n\\\\u001b[0m \\\\u001b[90m 7 |\\\\u001b[39m }\\\\u001b[0m\\",\\"source\\":\\"src/pages/bad-page.js\\",\\"line\\":4,\\"column\\":13}}])</script></body></html>"`;
exports[`SSR it generates an error page correctly 1`] = `"<!DOCTYPE html><html><head><meta charSet=\\"utf-8\\"/><meta http-equiv=\\"x-ua-compatible\\" content=\\"ie=edge\\"/><meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1, shrink-to-fit=no\\"/><link data-identity=\\"gatsby-dev-css\\" rel=\\"stylesheet\\" type=\\"text/css\\" href=\\"/commons.css\\"/><meta name=\\"note\\" content=\\"environment=development\\"/><script src=\\"/socket.io/socket.io.js\\"></script></head><body><div id=\\"___gatsby\\"><div style=\\"outline:none\\" tabindex=\\"-1\\" id=\\"gatsby-focus-wrapper\\"></div><div id=\\"gatsby-announcer\\" style=\\"position:absolute;top:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0\\" aria-live=\\"assertive\\" aria-atomic=\\"true\\"></div></div><script>window._gatsbyEvents = window._gatsbyEvents || []; window._gatsbyEvents.push([\\"FAST_REFRESH\\", { action: \\"SHOW_DEV_SSR_ERROR\\", payload: {\\"codeFrame\\":\\"\\\\u001b[0m \\\\u001b[90m 2 |\\\\u001b[39m\\\\u001b[0m\\\\n\\\\u001b[0m \\\\u001b[90m 3 |\\\\u001b[39m \\\\u001b[36mconst\\\\u001b[39m \\\\u001b[33mComponent\\\\u001b[39m \\\\u001b[33m=\\\\u001b[39m () \\\\u001b[33m=>\\\\u001b[39m {\\\\u001b[0m\\\\n\\\\u001b[0m\\\\u001b[31m\\\\u001b[1m>\\\\u001b[22m\\\\u001b[39m\\\\u001b[90m 4 |\\\\u001b[39m \\\\u001b[36mconst\\\\u001b[39m a \\\\u001b[33m=\\\\u001b[39m window\\\\u001b[33m.\\\\u001b[39mwidth\\\\u001b[0m\\\\n\\\\u001b[0m \\\\u001b[90m |\\\\u001b[39m \\\\u001b[31m\\\\u001b[1m^\\\\u001b[22m\\\\u001b[39m\\\\u001b[0m\\\\n\\\\u001b[0m \\\\u001b[90m 5 |\\\\u001b[39m\\\\u001b[0m\\\\n\\\\u001b[0m \\\\u001b[90m 6 |\\\\u001b[39m \\\\u001b[36mreturn\\\\u001b[39m \\\\u001b[33m<\\\\u001b[39m\\\\u001b[33mdiv\\\\u001b[39m\\\\u001b[33m>\\\\u001b[39mhi\\\\u001b[33m<\\\\u001b[39m\\\\u001b[33m/\\\\u001b[39m\\\\u001b[33mdiv\\\\u001b[39m\\\\u001b[33m>\\\\u001b[39m\\\\u001b[0m\\\\n\\\\u001b[0m \\\\u001b[90m 7 |\\\\u001b[39m }\\\\u001b[0m\\",\\"source\\":\\"src/pages/bad-page.js\\",\\"line\\":4,\\"column\\":13} }])</script><script src=\\"/polyfill.js\\" nomodule=\\"\\"></script><script src=\\"/framework.js\\"></script><script src=\\"/commons.js\\"></script></body></html>"`;