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

[docs] Fix docs using wrong service worker #9030

Merged
merged 3 commits into from May 18, 2023

Conversation

cherniavskii
Copy link
Member

@cherniavskii cherniavskii added the scope: docs-infra Specific to the docs-infra product label May 18, 2023
@mui-bot
Copy link

mui-bot commented May 18, 2023

Netlify deploy preview

Netlify deploy preview: https://deploy-preview-9030--material-ui-x.netlify.app/

Updated pages

No updates.

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 619 1,007.5 638.3 785.16 165.178
Sort 100k rows ms 637.8 1,079.6 922.7 917.46 149.543
Select 100k rows ms 220.3 366 275.4 293.12 61.537
Deselect 100k rows ms 129.2 323.4 215.7 229.52 79.279

Generated by 🚫 dangerJS against 83086a7

if (
'serviceWorker' in navigator &&
process.env.NODE_ENV === 'production' &&
window.location.host.indexOf('mui.com') !== -1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this line just for testing purposes in the deploy preview.
Looks good:

I'll revert this change

@cherniavskii cherniavskii marked this pull request as ready for review May 18, 2023 08:40
Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ 💯

@cherniavskii cherniavskii merged commit efd46f4 into mui:master May 18, 2023
17 checks passed
@cherniavskii cherniavskii deleted the fix-sw branch May 18, 2023 10:47
@oliviertassinari
Copy link
Member

oliviertassinari commented May 19, 2023

I'm not sure about my suggestion in hindsight. Does it mean that we will have two service workers trying to serve the https://mui.com/x/* pages? I have tried to dive a bit deeper into how the scope works for service workers, e.g. scope in https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register.

If our goal is to entirely get rid of the sw.js logic, then maybe should revert this PR, remove the sw logic from this repo as it would become dead code, and apply #8598 in the docs-infra codebase (in https://github.com/mui/material-ui to be clear). I think it's what was proposed in

Screenshot 2023-05-19 at 15 57 55

mui/material-ui#36808 (comment)

@cherniavskii
Copy link
Member Author

@oliviertassinari I decided to try out the no-op service worker on a smaller scale first to ensure it works as expected.
As far as I can tell, it's working great - I cannot reproduce the issues described in mui/material-ui#36808 on MUI X docs https://mui.com/x/introduction/. I couldn't get a single outdated page 🎉

I would give it a bit more time to make sure the approach indeed works as expected, and then we can replace the service worker in the core repo as well 👍

@oliviertassinari
Copy link
Member

oliviertassinari commented May 19, 2023

From what I can observe, we do get both SW installed & activated but only the SW of the narrowest scope handles the requests. Nice 👍

Screenshot 2023-05-19 at 18 10 50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants