#10478·blockly

Update custom code generator codelab to declare a `CodeGenerator` subclass?

Author: cpcallenCreated Aug 14, 2023Updated Sep 11, 2026
Labelsarea: docs & examples

From my comment on PR RaspberryPiFoundation/blockly-samples#1839:

What do you think about updating this codelab to create a JsonGenerator class and then a (mostly trivial) jsonGenerator instance, to reflect the way that the 1st party generators are created? I think in particular such an example would be useful to TypeScript devs (though getting the 1p generators updated to TS would be even more so…)

@maribethb replied:

Eh, I'm torn, so definitely don't want to do this in this PR. I'm not sure we should do it in general, because I think most people never actually need to use both the class and a separate instance, so why do we need to complicate the codelab. But I could go either way on that so I'm not opposed to it if someone wants to do it as a follow up.

Source: RaspberryPiFoundation/blockly