Presently I'm getting this error in my console when I run build.py:
SERVER ERROR: blockly_compressed_vertical.js (for example)
Too many compiles performed recently. Try again later.
This is a bit annoying. Apparently the only solution is to wait an hour or so until I'm not rate-limited anymore. How can I build scratch-blocks locally, to avoid this?
Apologies if I missed anything in the documentation wiki.
Okay, it looks like I can just not build at all and my changes will be reflected. But I'll leave this open, since I'd still like to know if it's at all possible to build compressed versions without being online.
Yeah, unfortunately Closure uses an online compiler that rate limits users, which we can't do much to change, and when you get locked you get locked out for an hour. (from https://developers.google.com/closure/compiler/docs/api-ref).
I'm not totally sure how many compiles it takes to trigger it.
@fsih Thanks for the help and clarification! This helps a bunch.
It is definitely possible to build scratch blocks offline--closure has an offline compiler that you can use, and we have instructions + a demo over in Blockly. More on that below.
Separately, you don't need to build to see changes if you're only working in scratch-blocks, as @fsih mentioned above. When you use the uncompressed version, changes are reflected immediately upon a page reload, and you don't need to build unless you're making changes to provides and requires.
Blockly Advanced Compilation/offline compilation instructions.
To compile, follow the instructions in "Download Closure Compiler" and "Install Closure Library". You may already have the closure library if npm is doing everything necessary.
In "Boiler Plate" you don't need to create index.html. You should create main.js and add requires for all of the block types.
In "Compile" you can change the compilation_level to SIMPLE_OPTIMIZATIONS and set the js_output_file to scratch-blocks/dist/vertical.js.
Caveats:
I know this is a pain point for development. Blockly team doesn't currently have resources to redo our build process, so unfortunately I can't promise any fast fixes.
Although this is closed because the question was resolved - this is properly fixed in #1471 now :) :tada:
Most helpful comment