-
Notifications
You must be signed in to change notification settings - Fork 43
Bump pxt 12.x and some other changes #1052
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Fixed all fields field_motors, field_ports, field_brickbuttons, field_music except field_color. When choosing a color, the color does not change. There is no error in the console. |
Replacing ports with images. field ports has been removed. Almost completely repeats the functionality.
|
Replacing field ports to images. field ports has been removed. Almost completely repeats the functionality. All sensor blocks that used field_ports had to register this. I don’t know how it could have been done differently without repeating these lines. Accidentally added field_colors changes to this commit. He's not ready. There are no errors, but the color selection does not work. |
Where did turnRatio come from?
The last change to field_colour removed the addition of className. It’s not clear for what reason, but I’m adding it myself now.
The new version of FieldColorNumber does not apply applyColour() inside the doValueUpdate_() method. Secondly, the applyColour() method was redesigned in the new version so that it no longer worked with this enum code.
|
The colorenum field has been fixed. |
Fixes for new versions of Blockly, Fixing buttons in showEditor_(). Return scroll otherwise the items won't fit
Fixes for new versions of Blockly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR upgrades to pxt-core v11 and pxt-common-packages v12, updates block field editors across sensor libraries to use image pickers with layout options, refactors custom field editor implementations, and adds EV3 debugging and improved serial-buffer parsing.
- Bump pxt-core and pxt-common-packages versions in package.json
- Switch block fieldEditors from "ports" to "images" with new fieldOptions in sensor libs
- Restructure/refactor fieldeditors (motors, music, color, brickbuttons) and update reference paths
- Add dumpInputCmd/dumpOutputCmd helpers in
editor/wrap.tsand enhance buffer parsing ineditor/deploy.ts
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated pxt-core/pxt-common-packages versions |
| libs/*/ultrasonic-sensor/ultrasonic.ts | Changed fieldEditor to "images" with columns/width options |
| libs/storage/storage-core.ts | Moved Separators enum out of namespace and rewrapped namespace |
| fieldeditors/field_motors.ts | Refactored FieldMotors rendering and dropdown logic |
| editor/wrap.ts | Added dumpInputCmd/dumpOutputCmd for detailed HF2 logging |
| editor/deploy.ts | Improved WebSerialPackageIO bufferSize method and parsing logic |
| enum Separators { | ||
| //% block="comma" | ||
| Comma, | ||
| //% block="semicolon" | ||
| Semicolon | ||
| } | ||
|
|
||
| export enum Separators { | ||
| //% block="comma" | ||
| Comma, | ||
| //% block="semicolon" | ||
| Semicolon | ||
| } | ||
| namespace storage { |
Copilot
AI
Jun 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving Separators to the top-level without export and outside namespace storage breaks references to storage.Separators. Re-export it inside namespace storage or add export.
| enum Separators { | |
| //% block="comma" | |
| Comma, | |
| //% block="semicolon" | |
| Semicolon | |
| } | |
| export enum Separators { | |
| //% block="comma" | |
| Comma, | |
| //% block="semicolon" | |
| Semicolon | |
| } | |
| namespace storage { | |
| namespace storage { | |
| export enum Separators { | |
| //% block="comma" | |
| Comma, | |
| //% block="semicolon" | |
| Semicolon | |
| } |
| console.warn(`Received larger bufer then command command: ${buffer.length} recieved but waiting for ${size}`); | ||
| let tmp = buffer.slice(0, size - 1); | ||
| this.onData(new Uint8Array(tmp)); | ||
| tmp = buffer.slice(size, buffer.length - 1); | ||
| buffer = tmp; | ||
| console.debug(`Next buffer size: ${this.bufferSize(buffer)}`); | ||
| } else { | ||
| console.warn("Incomplete command " + size); | ||
| console.warn(`Incomplete command: ${buffer.length} recieved but waiting for ${size}. Keep waiting...`); |
Copilot
AI
Jun 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix spelling and grammar: "bufer" → "buffer", "then" → "than", and "recieved" → "received".
| let tmp = buffer.slice(0, size - 1); | ||
| this.onData(new Uint8Array(tmp)); | ||
| tmp = buffer.slice(size, buffer.length - 1); |
Copilot
AI
Jun 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using slice(0, size - 1) drops the last byte of the intended payload. It should be slice(0, size) to include all bytes of the frame header and body.
| let tmp = buffer.slice(0, size - 1); | |
| this.onData(new Uint8Array(tmp)); | |
| tmp = buffer.slice(size, buffer.length - 1); | |
| let tmp = buffer.slice(0, size); | |
| this.onData(new Uint8Array(tmp)); | |
| tmp = buffer.slice(size, buffer.length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember what this change was connected with, but Bluetooth download didn't break for me.
Fix for no voice acting when mouse is hovered. But console shows error: Uncaught (in promise) AbortError: The play() request was interrupted by a call to pause(). https://goo.gl/LdLk22
|
@abchatra @riknoll pr is not ready yet. If they gave me some tips how to solve or something was not the best made, it would be great. |
There is a problem in pxsim.AudioContextManager, which manifests itself in the fact that if you quickly move the mouse cursor, an error appears in the console: Uncaught (in promise) AbortError: The play() request was interrupted by a call to pause(). https://goo.gl/LdLk22
Replacing substr with slice.
Optimized the withdrawal of logs about file download. DumpinPutCmd Reply Status should have been by BYTE 6, not 5. Fixed.
Change to allow the use of underscores in file names.
Return scroll for default blocklyDropDownContent class.
An error that prevented the simulator from starting, citing errors when executing brick.readButtons() and hashDevices(). Simulator crashed, no error handler Error: TypeError: Expected type Buffer but received type object.
Here buf() simply returns an object with a data: Uint8Array field, not a real Buffer (i.e. RefBuffer), which the PXT runtime expects.
The BufferMethods.slice, getNumber, etc. methods expect an object with a Buffer prototype and methods, not a raw JS object { data: Uint8Array }.
By returning a full Buffer from buf() you fix this.
|
Fixed simulator crash in last commit. |
|
I noticed one thing: the EV3 code stops immediately after loading. I don't understand what's causing this. And I don't understand when this happened. I don't remember if I tested it on hardware right away when creating the PR. @abchatra @riknoll Is this related to the need to update the runtime due to increased pxt-core versions? core---linux? |
|
We haven't done any intentional change and don't have bandwidth either to debug. |

After switching to pxt-core v10, fieldmotors break.
Related to this.
I understand that these changes should be considered after this
#1048
microsoft/pxt-microbit#5496
microsoft/pxt#9865