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

Fix pyodide loading without using beforeInteractive loading strategy #43

Open
kennethcassel opened this issue Sep 25, 2021 · 7 comments

Comments

@kennethcassel
Copy link
Contributor

Using beforeInteractive in the next.js script component fixed the pyodide loading issue but now the experience of using the site is frustrating.

Site does the initial render but you can't scroll until pyodide loads.

Ideally we'd have some sort of loading indicator and let a user scroll on the site instead of making it hang

@mcintyre94
Copy link
Contributor

mcintyre94 commented Sep 25, 2021

Ah that's rubbish, sorry! Do you see this on desktop browsers or only mobile? I'm only seeing it on iOS (don't have any other devices to check it on), but it seems okay on desktop:

runwasm-scroll.mov

In terms of loading indicators I did add something very basic for the matplotlib one:

runwasm-matplotlib-load.mov

We could easily add the Loading Pyodide... part of that for the main page (or a better loading indicator!)

But for that one scrolling is frozen (on mobile only for me) during the load pyodide + load matplotlib.

I'm wondering if this might be a problem with mobile + useEffect? It's a bit tricky to tell though because we have no visual indicator when that beforeInteractive script is loaded. And depends which devices you're seeing it on too.

@kennethcassel
Copy link
Contributor Author

Ah okay shouldn't have just assumed it was due to beforeInteractive.

I'm only seeing it on iOS mobile safari.

@mcintyre94
Copy link
Contributor

mcintyre94 commented Sep 25, 2021

I made a create-react-app project that has a useEffect fetching http://httpbin.org/delay/10 and then updating UI - on iOS Safari scrolling stays responsive (and the default spinning logo keeps spinning) during that delay. So my best guess is that the CPU is getting throttled during the load, which seems.. surprising for iOS.

Out of interest what device are you seeing this on? I'm on an iPhone XR so a few years old.

FWIW I can also repro this on a checkout of 74d8565 (the last commit before any of mine today) - site goes unresponsive and won't scroll until the run code button is displayed.

@kennethcassel
Copy link
Contributor Author

I'm on iPhone XS 14.71

@mcintyre94
Copy link
Contributor

Pretty similar then, probably the same CPU. It’d be good to hear from someone on a newer device or any android device to see if we can narrow it down at all.

@hatemhosny
Copy link

BrowserStack offers free plan for open source projects.

This can help in testing across multiple devices

@shadab14meb346
Copy link
Contributor

For me, scrolling is frozen on during only the Loading Pyodide...

Using it on mobile google chrome.
I am on Andriod below are my phone configs.
WhatsApp Image 2021-09-30 at 2 32 23 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants