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-infra] Use embed as the default for opening CodeSandbox #43618

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Sep 5, 2024

Before: https://deploy-preview-43616--material-ui.netlify.app/material-ui/react-button/#basic-button

It opens a devbox experience. The loading time is longer than the embed version. It takes ~12sec to see the demo.
Note that the devbox cannot be open with an initial file.

Screen.Recording.2567-09-05.at.16.09.22.mov

After: https://deploy-preview-43618--material-ui.netlify.app/material-ui/react-button/#basic-button

The embed version is editable and feels faster. It takes ~4sec to see the demo. By changing to embed mode, we can target the initial file to open.

Screen.Recording.2567-09-05.at.16.10.34.mov

@siriwatknp siriwatknp added the scope: docs-infra Specific to the docs-infra product label Sep 5, 2024
@siriwatknp siriwatknp requested a review from a team September 5, 2024 09:20
@mui-bot
Copy link

mui-bot commented Sep 5, 2024

Netlify deploy preview

https://deploy-preview-43618--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 46d8618

Copy link
Member

@alexfauquette alexfauquette left a comment

Choose a reason for hiding this comment

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

Thanks, this waiting time to access CodeSandbox was quite annoying 👍

@siriwatknp siriwatknp added the regression A bug, but worse label Sep 5, 2024
@siriwatknp
Copy link
Member Author

Thanks, this waiting time to access CodeSandbox was quite annoying 👍

Thanks, I thought that it was only me that get annoy with the devbox experience haha.

@siriwatknp
Copy link
Member Author

siriwatknp commented Sep 5, 2024

I marked this as regression because opening with the initial file was working before.

addHiddenInput(
form,
'query',
`file=${initialFile}${initialFile.match(/(\.tsx|\.ts|\.js)$/) ? '' : extension}`,
`module=${initialFile}${initialFile.match(/(\.tsx|\.ts|\.js)$/) ? '' : extension}`,
Copy link
Member Author

Choose a reason for hiding this comment

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

embed has changed from file to module. There is no documentation, I have to get the embed to know that it's changed.

Eg:

<iframe src="https://codesandbox.io/embed/9sc876?view=editor+%2B+preview&module=%2FSignIn.tsx"
     style="width:100%; height: 500px; border:0; border-radius: 4px; overflow:hidden;"
     title="recursing-rain-9sc876"
     allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
     sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
   ></iframe>

@siriwatknp siriwatknp merged commit 145aa39 into mui:master Sep 6, 2024
24 checks passed
Michael-Hutchinson pushed a commit to Michael-Hutchinson/material-ui that referenced this pull request Sep 7, 2024
@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work performance and removed regression A bug, but worse labels Sep 7, 2024
@oliviertassinari
Copy link
Member

oliviertassinari commented Sep 7, 2024

It looks like the same regression as in codesandbox/codesandbox-client#8299, which was introduced again. The main problem seems to not be able to show the right source file right away, as well as the right browser preview port.

As for the loading speed, yeah in the video below, it's 5s vs. 3s. Not a huge concern though, it's painful to have to click on "Edit Sandbox" now to share the changes.

Screen.Recording.2024-09-08.at.00.00.31.mov

I raised the problem again to the CodeSandbox team on that same, they should be aware of this: codesandbox/codesandbox-client#8597. I think that we should revert this PR once they fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work performance scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants