Best to view the commits separately, as they are independent changes, though they affect the same area of code.
Makes undefined (missing) next on blocks in a project.json not crash fromSb3. This may be a omission by a minifier used in the demo project, rather than something Scratch itself will ever serialize, though Scratch handles deserializing undefined next just fine, so sb-edit should too.
Improves some code clarity. blockWithNext is sometimes called without its parentId argument so we just make it parentId?: string instead of parentId: string | undefined. And getBlockScript, previously called once for each script in a target, is now called just once for each target, because getBlockScript does not care which script you're about to get, and is structured to make all scripts available. (It's a currying function, so now we use it like one!)
Tested manually with the project shared in #141, WebOMatic!.
Development:
See #143 for some technical discussion.
Best to view the commits separately, as they are independent changes, though they affect the same area of code.
next
on blocks in a project.json not crashfromSb3
. This may be a omission by a minifier used in the demo project, rather than something Scratch itself will ever serialize, though Scratch handles deserializing undefinednext
just fine, so sb-edit should too.blockWithNext
is sometimes called without itsparentId
argument so we just make itparentId?: string
instead ofparentId: string | undefined
. AndgetBlockScript
, previously called once for each script in a target, is now called just once for each target, becausegetBlockScript
does not care which script you're about to get, and is structured to make all scripts available. (It's a currying function, so now we use it like one!)Tested manually with the project shared in #141, WebOMatic!.