jmoenig / Snap

a visual programming language inspired by Scratch
http://snap.berkeley.edu
GNU Affero General Public License v3.0
1.49k stars 742 forks source link

Project and libary loading should be async. #1242

Closed BookOwl closed 5 years ago

BookOwl commented 8 years ago

I know that jens doesn't like async things, but the current synchronous style makes the web browser display warnings that the tab has locked up and in some web browser like Firefox it locks up the entire browser for two or three minutes.

jmoenig commented 8 years ago

What makes you assume I don't like async things? the library stuff was a quick hack at the time, and - I think - it's the only part in Snap that's still synchronous, plus, it would be really easy to convert. How about you give it a shot? :-)

BookOwl commented 8 years ago

@jmoenig, that's just what I heard on the Snap! dev thread. I'll give it a shot.

BookOwl commented 8 years ago

@jmoenig which file actually loads the projects? I know that cloud.js downloads them, but I can't figure out where they go after that. nvm. It's store.js

cycomachead commented 8 years ago

I 👍 these changes. In theory, ALL XHR's in Snap! should be async, including the http block function, but that one may be a bit more work to adapt.

jmoenig commented 8 years ago

Wait, Michael, the http block function is asynchronous! The beauty of Snap's http block is that is magically transforms an asynchronous JS call into a synchronous Snap one through Morphic's stepping mechanism and Snap's Process model.

That said, I agree that all http requests should become asynch. Of course!

cycomachead commented 8 years ago

D'oh, you're right! I could have sworn that I saw a console error from that one before...

jmoenig commented 5 years ago

Okay, I think - with your help - this is now the case, right? Closing, thank you!