Code card rendering should use api name from 'blockAliasFor='
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 641
- Avg merge
- 12h 4m
- Merged PRs (30d)
- 57
Description
Rendering of code cards uses the api name from the decompile info even when the attrs have blockAliasFor set. I'm thinking that if both the blocks and ```sig rendering use the alias name, the TS code cards should do the same?
The example here shows the api name with the _ while the alias name is set as onItemDropped.
//% blockId=events_onItemDropped
//% blockAliasFor="events.onItemDropped"
//% block="on $item dropped with $count"
//% draggableParameters="reporter"
//% group="Items"
//% weight=80 help=events/on-item-dropped
export function _onItemDropped(handler: (item: number, count: number) => void) {
events.onItemDropped(handler);
}
RE: https://github.com/microsoft/pxt-minecraft/pull/2846#issuecomment-3222206254
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
Start by tracing the code card rendering path for TypeScript code cards, then compare how block rendering and sig rendering resolve blockAliasFor. Use the provided onItemDropped example to check the displayed API name. Done means the code card uses onItemDropped rather than _onItemDropped when the alias is set.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100