scratchfoundation / scratch-gui

Graphical User Interface for creating and running Scratch 3.0 projects.
https://scratchfoundation.github.io/scratch-gui/develop/
BSD 3-Clause "New" or "Revised" License
4.46k stars 3.55k forks source link

Projects with a large number of assets take a long time to/won't load #3380

Open BryceLTaylor opened 6 years ago

BryceLTaylor commented 6 years ago

Expected Behavior

If you load a project with many assets such as https://llk.github.io/scratch-gui/develop/#211917681 (856 assets) or https://llk.github.io/scratch-gui/develop/#203953289 (386 assets) it should load in a time that's comparable to 2.0

Actual Behavior

The project will take a really long time to load and on many devices with less memory, such as iPads or Android tablets, it won't load at all. (specifically 211917681)

Steps to Reproduce

Load one of those projects on Chrome Note: it takes an extremely long time

Load one of those projects on an iPad or Android Tablet Note: the browser will time out and the project won't load

ecc521 commented 5 years ago

If you use a Service Worker to cache lib.min.js you can save around 4.1 MB. Has potential to improve load times a few seconds, depending on network speed.

ed6767 commented 5 years ago

+1 on this. Acer Chromebook R11 on ChromeOS v70 (4GB Ram) 2.0 projects would load and work fine, meanwhile all Scratch 3.0 projects do not load, even though in the past Beta versions it would work completly fine. Console:

The Web Audio autoplay policy will be re-enabled in Chrome 71 (December 2018). Please check that your website is compatible with it. https://goo.gl/7K7WLu
(anonymous) @ projects.bundle.js:169
56Active resource loading counts reached to a per-frame limit while the tab is in background. Network requests will be delayed until a previous loading finishes, or the tab is foregrounded. See <URL> for more details
projects.bundle.js:162 The Web Audio autoplay policy will be re-enabled in Chrome 71 (December 2018). Please check that your website is compatible with it. https://goo.gl/7K7WLu
e.exports @ projects.bundle.js:162
projects.bundle.js:31 Stop!
projects.bundle.js:31 This is part of your browser intended for developers. If someone told you to copy-and-paste something here, don't do it! It could allow them to take over your Scratch account, delete all of your projects, or do many other harmful things. If you don't understand what exactly you are doing here, you should close this window without doing anything.
WorkSans-Thin.ttf:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
WorkSans-ExtraLight.ttf:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
WorkSans-Light.ttf:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
WorkSans-Medium.ttf:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
WorkSans-SemiBold.ttf:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
WorkSans-Bold.ttf:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
WorkSans-ExtraBold.ttf:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
WorkSans-Regular.ttf:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
WorkSans-Black.ttf:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
scratch.mit.edu/:1 Uncaught (in promise) DOMException: A network error occurred.