-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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
[website] Add no-op service worker to fix stale cache issue #37607
Conversation
Netlify deploy previewhttps://deploy-preview-37607--material-ui.netlify.app/ Bundle size report |
docs/pages/_app.js
Outdated
process.env.NODE_ENV === 'production' && | ||
window.location.host.indexOf('mui.com') !== -1 | ||
) { | ||
if ('serviceWorker' in navigator && process.env.NODE_ENV === 'production') { |
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.
This change is here only for demonstration purposes in deploy preview, I'll revert it before merging
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.
This looks good, I was about to propose removing this logic end of 2024, but actually reloading all the other tabs when a new version is released can make sense as a logic to keep. It's a bit annoying to lose page states, but this would especially be interesting if we expose an API to improve smooth releases (API backward compatibility issues between versions). This logic wouldn't be enough but maybe still helps. We could consider https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API as well but probably a bit more flaky (sw have this built-in)
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.
Bringing this to Toolpad as well mui/mui-toolpad#2190
@cherniavskii is it ok to merge this? |
@michaldudak Yes, it's ready to be merged now 👍 |
Fixes #36808
Same as mui/mui-x#8598, but for the Core docs.
It fixed the issue for MUI X docs, here's the feedback from the team:
Apart from the problem described in #36808, there are a few more reasons to fix this issue: