Updating of sw.js

I've noticed that it doesn't have all the costumes. The same thing might be true of sounds and/or libraries. It also has nothing for help screens. I was thinking I might be up to the task of updating it.

please don't. We try to strike a balance between including all the resources needed to run Snap! offline and keeping the download footprint such that it also works in low bandwidth situations. And we actually sometimes know what we're doing.

Sometimes? Thats concerning...

C'mon, don't be snarky to kids. It's not as if there aren't a zillion things we haven't gotten around to yet. So it's perfectly reasonable for him to ask if this is one of them. If he just filed a PR without asking first, then you could be snarky, I guess.

Suppose someone wanted to use the Crayons library ("Just the crayons, without the rest of the colors library. Fast and simple.") or the Menus library, but they're offline and using the PWA app? Would they want to be met with this?:

If you don't want me to, that's fine, I'll just keep making help screens for blocks that don't have them, have incorrect information in them, or are outdated. I was simply putting the idea here, where you could see it and actually give me an answer, which you have.


I find it strange and interesting that you often capitalize words everywhere one "should" except at the beginning of a post.

Had to look that up--"critical or mocking in an indirect or sarcastic way".

Yeah, we should probably keep the libraries up to date. But none of the other categories; we deliberately limit the choice of costumes and sounds to reduce downloading time.

And as for help screens, figuring how to avoid downloading them for every language even though you're only going to use at most two (English and your native language) is what's standing in the way of merging the help translation system into Snap!. I guess the right thing is probably JIT loading when you select Help from a primitive block's context menu, or maybe loading all the ones in a particular language when you select a different one, although even that might be too slow. I suppose we could invent a way to include only languages you've used in sw.js somehow, for downloading an offline version.

Interesting idea...I just thought maybe the same could be done for costumes and sounds, i.e., just download the necessary files (*.js and the icons) and libraries, which are usually small. (Colors and Crayons is an exception.)

Yeah, Jens hates that. But he also hates that it's slow, and turning huge procedures into bunches of little procedures with data-directed programming helps with that.

For costumes and sounds, the Right Thing is to have thumbnails of all the costumes loaded at startup, so that the chooser windows can open quickly, but not load the actual costumes until you choose them. It says here that we can make it even faster by putting a bunch of costume thumbnails into one biggish .png, and selecting the right pixels from the thumbnail .png algorithmically. (That could even be written in Snap!, since we have fast hyperblocks.)

Indeed. I've found it excruciatingly slow to load. "This page isn't responding" slow.

(a bit later)

As far as I can tell, only the new (Jahrd and Tad) costumes are not there.

Compare the files COSTUMES and COSTUMES-full in the repo.

Is there a way I can diff them in the online Github?

Not that I know of, but here's a diff:
foo (5.1 KB)

I do not know how to interpret that diff. I'm more used to the Github-type diffs.

I think I might be able to use Python...

Every line that starts with > is added in COSTUMES-full. Every line that starts with < is added in COSTUMES. The lines that don't start with either just give the line numbers in the two files; you can ignore them.

Ok, but I already diffed it myself in Python. I guess the letters aren't in COSTUMES, and other such things. However, a bunch of costumes aren't in COSTUMES-full but are in COSTUMES...

Besides Tad and/or Jahrd? I guess I added a few of the newer Scratch ones, but I don't really remember the details. My long-term plan is to get all the Scratch ones, plus a lot more of Meghan Taylor's watercolors, plus maybe we'll see... When one of my favorite web cartoonists announces that they're open to commissions, I'll snap 'em up. :slight_smile:



I'm sure he's way too expensive, if he does commissions at all. Same with Questionable Content, Gunnerkrig Court, Doonesbury, or Unsounded. It has to be ones nobody's heard of, or I won't be able to afford it. In addition to Meghan Taylor, maybe Mary Cagle, eyugho, Suzana Harcum and Owen White, Olga Makarova, Al Grimm, Robin Dassen, NotImportant, Xiao Tong “Velinxi” Kong, Koti Saavedra, Lorena Garcia, or Zhengo. If, again, they ever announce that they're taking commissions. Mostly they seem to think it's all they can do to keep up to date with posting pages of their webcomic.

Many of these webcomics are PG-13. Don't click the links if that bothers you.

It definitely doesn't bother me. Apparently neither does, say, (in fiction) murder, which I can tell because I'm fine reading Stieg Larsson's the Girl With the Dragon Tattoo (and the rest of the series, which, from book 4 on, is actually authored by David Lagercrantz)