Moddable SDK 5.3.0
Moddable SDK 5.3 contains improvements made between November 13, 2024 and December 3, 2024.
Camera Support for Raspberry Pi Pico
Last month brought the new ECMA-419 Image Input API to the Moddable SDK with implementations for ESP32, macOS, Windows, and Linux. This month extends that support to Raspberry Pi Pico.
High Speed JPEG Decoder for ESP32
We've integrated an all-new high performance JPEG decoder from Espressif for use across the entire family of ESP32 microcontrollers. The new decoder is up to 600% faster, making real-time JPEG decoding practical. To decode a single JPEG frame:
import loadJPEG from "commodetto/loadJPEG";
let bitmap = loadJPEG(new Resource("image.jpg"));
Because the pixel buffer can be quite large, it is convenient to be able to free it immediately rather than waiting for the garbage collector. Bitmaps returned by loadJPEG
have a close()
method on their pixel buffer that can be invoked to free the pixel buffer immediately:
bitmap.buffer.close();
To use the new JPEG decoder, include $MODDABLE/modules/commodetto/jpeg/manifest.json
in your project manifest.
Integrating Git Repositories
It has long been possible to include Git repositories in Moddable SDK project manifests. The build automatically clones the repository, eliminating the need to retrieve it manually. This feature now works for repositories that do not include a Moddable SDK manifest.json
file, allowing it to be used in more situations, such as retrieving native driver code for use in JavaScript bindings.
Your project manifest.json can embed the manifest for the imported repository to select the files to build and directories to add to the include path. You can use a local path to a repository which is great when developing. For details see the https://github.com/Moddable-OpenSource/moddable/blob/public/documentation/tools/manifest.md#include-git and check out the Pico hm01b0 camera driver for a working example.
ESP-IDF v5.3.1
We've migrated to ESP-IDF v5.3.1 to from v5.3.0. The update should be transparent to JavaScript code. The update is recommended for reliability and security, and to generally keep up with the latest from Espressif. Updating just takes a couple minutes.
- If you used xs-dev to install the Moddable SDK, execute
xs-dev update --device esp32
- Otherwise, follow the update instructions for macOS and Linux and Windows.
Just after wrapping up this Moddable SDK release, ESP-IDF v5.3.2 was released. The Moddable SDK hasn't been tested with that, so it is not a recommended update yet.
Coming Soon: ECMAScript 2025
Behind the scenes, we've been working to update our XS JavaScript engine to support the next revision of the JavaScript language, ECMAScript 2025 (ES2025). With the last meeting in 2024 of TC39, the JavaScript language committee, complete the features for ES2025 are finalized. Moddable expects to release ES2025 support for XS in January 2025. The release will also implement the Immutable ArrayBuffers proposal, now at Stage 2, that Moddable is co-championing.
Community News
- Congratulations to Pocuter for the successful completion of their crowdfunding campaign on Kickstarter for their incredible new Spectra, a maker-friendly smartwatch. A watch this beautiful could only be powered by the Moddable SDK.
- @ScreamZ has published a Wi-Fi Connection Manager implemented entirely in TypeScript. It provides a persistent Wi-Fi connection, reconnecting as needed.
- @HipsterBrown has been very active with xs-dev, deploying significant code updates and addressing several issues reported by users
- If you haven't yet read our blog post about the "Language Evolution" proposal to improve user security by dividing JavaScript into two parts, check it out.
Release Details
- Devices
- Raspberry Pi Pico
- Ecma-419 Audio Out support
- Ecma-419 Image In support for Arducam hm01b0 camera
- New
pico/pico4ml
device target to demonstrate driver support for hm01b0 camera
- ESP32
- Fast JPEG decoder for ESP32 integrated. The implementation is the latest from Espressif via the ESP Component Registry. Performance is excellent – over 600% faster than picojoeg, which is optimized to minimize memory use rather than speed. It is mostly compatible with the Commodetto JPEG reader API.
- ESP32 build asserts that
CONFIG_FREERTOS_HZ
is set to 1000 as required by Moddable SDK. - ESP-IDF now recommends v5.3.1
- Raspberry Pi Pico
- Ecma-419
- WebSocket client
- Payloads of length 127 now properly transmitted
- Eliminate occasional "would block" exceptions when using WebSocket over TLS
- WebSocket client
- Bluetooth
- The
manufacturerSpecific
getter for received advertisements no longer returns data beyond the end of the field
- The
- Tools
- Git repository import in
mcconfig
andmcrun
have been enhanced to work with repositories that do not contain a Moddable SDKmanifest.json
. See Including Git Respositories documentation for details. This capability is used for the Pico camera (Ecma-419 image-in) support to import the native camera driver from its Git repository.
- Git repository import in
- XS JavaScript engine
- Overflows in
Date
parsing of integers sets date toNaN
(improves conformance) - Object copy helper function checks meter when looping
- Overflows in
- Testing
- Ecma-419 Update (OTA) unit tests added
Contact Us
If you have questions or suggestions about anything here, please reach out:
- Start a new Discussion on our GitHub repository
- Drop by our Gitter to chat
- Contact us on Twitter / X at @moddabletech