-
Notifications
You must be signed in to change notification settings - Fork 710
Description
Is your feature request related to a problem? Please describe.
I've been experimenting with MakeCode Embed and I want to pass JavaScript for a MakeCode program into the iframe and have that JavaScript be used to generate the blocks for the project. I have only had success passing in a fully-formed MakeCodeProject object. If the XML is missing or empty then I either get an empty project or one time I got a project with the right JavaScript but no blocks view.
Describe the solution you'd like
I want to be able to send in JavaScript (main.ts) and pxt.json for a MakeCode project via a postMessage to a MakeCode iframe. I want MakeCode to then generate main.blocks based on the JavaScript provided.
Describe alternatives you've considered
I thought about generating the XML outside of MakeCode, so that I can pass in a fully-formed MakeCodeProject object, but that seems like a burdensome duplication of functionality. You can do what I'm fundamentally trying to do by simply pasting JavaScript into the editor and navigating back to blocks view. I just want to be able to trigger it in this alternate scenario.
Additional context
This is related to Forward Education product development efforts.