To solve this problem, define as much of your block with JSON as possible, and use JavaScript for the rest. The following example creates a block definition with an init function, which uses jsonInit ...
The list below isn't meant to be exclusive, it's more so a collection of links that have helped me out along the way (and can hopefully help you). As you'll see, I've focused on JavaScript, React, and ...