-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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-plugin-offline): "Magic" JS detection to make sites function correctly when JS is disabled retroactively #17590
feat(gatsby-plugin-offline): "Magic" JS detection to make sites function correctly when JS is disabled retroactively #17590
Conversation
Nice "magic" :-D |
@@ -15,9 +15,6 @@ export default function HTML(props) { | |||
</head> | |||
<body {...props.bodyAttributes}> | |||
{props.preBodyComponents} | |||
<noscript key="noscript" id="gatsby-noscript"> | |||
This app works best with JavaScript enabled. | |||
</noscript> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this change be part of this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also for reference - this is PR that added this initially #10945 so worth checking reasoning and see if we don't break that (or at least it's conscious decision)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks!
…ion correctly when JS is disabled retroactively (gatsbyjs#17590) * Set path resources on route update (for initial page load) * begin "magic" * refactor + fix always re-enabling * implement SW API route + only set head components for offline shell + misc * update snapshots * change messageapi back to a "normal" object * add comment re: syntax * rename back to original casing * add back noscript warning in default-html * restore snapshots
Description
gatsby-plugin-offline
's service worker (which still runs if JavaScript has been disabled retroactively) can now detect via a conditional network request whether or not JavaScript has been disabled in the browser, and serve a page from the network if this is the case.Related Issues
Closes #17386