Custom field dropdowns: shadow blocks are serializing functions not meant to be exposed
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 641
- Avg merge
- 12h 4m
- Merged PRs (30d)
- 57
Description
Custom field editors are serializing out the contents of their shadow blocks instead of their literal values.
This serialization problem is also appearing in the BuildBee MakeCode color picker. I had to expose the shadow block in the API so that it would not look strange. But it looks like the feature is broken?
** PXT Playground Example **
Load up PXT playground, example field-editors-dropdowns
https://makecode.com/playground#field-editors-dropdowns
Hit the run button

Add the "Say hello" block

Flip the editor to Javascript

Expected
Since the __wordPicker function is marked as blockHidden, and it is a shadow field editor, I expect the correct serialization to be time.say("Hello")
Actual
It seems to generate javascript that can't be compiled (this is worse than what I'm seeing on BuildBee using number types)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Load the PXT Playground example field-editors-dropdowns and reproduce the shadow-block dropdown serialization through the documented steps. Trace the custom field editor path that produces the JavaScript output, then verify that the hidden __wordPicker shadow field serializes to time.say("Hello") and that the result compiles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100