Moddable SDK 4.3.8
This release contains improvements to the Moddable SDK made between December 1, 2023 and January 2, 2024.
Highlights of this release include:
- Streaming JSON parser
- LTR-553ALS driver for combined Proximity and Ambient Light sensor (ECMA-419 compatible)
- nRF52 watchdog timer support
Important: ESP-IDF v5.1.2 is now recommended for ESP32 development.
- 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.
Release Details
- Contributed
- New streaming JSON parser reduces RAM required to process JSON responses by 10x or more. Invaluable when working with web services that return large, bloated JSON responses. Extensively documented. Includes examples demonstrating different uses including simple property name (key) filtering, pattern matching, and advanced context-aware filters. (Contributed by @markwharton)
- Devices
- New ECMA-419 LTR-553ALS sensor driver (Proximity and Ambient Light). (Contributed by @stc1988) This sensor is built into the M5Stack Core3.
- Built-in ESP32 touch pad support builds with ESP-IDF v5. (reported by @ntGus) #1263
- Support Watchdog Timer on nRF52 devices (set
"USE_WDT":"1"
in "build" section of manifest)
- Embedded Runtime
- Rework message handling (modMessage) to minimize blocking while processing messages. At most, only messages present at start of service are now processed. (reported by @beckerzito) #1257
- Only enable unit test support for
xsbug://
when debugging is enabled - For ESP32, separate out soft-reset (
MODDEF_SOFTRESET
) support from unit test (MODDEF_TEST
) to allow it to be used in more scenarios. CallmodSoftReset()
from C to request a soft reset at next turn. #1267
- Modules
- HTTP server reads through all of ignored request body for maximum compatibility (reported by @tve) #1270
- HTTP server accepts boxed string (String object) as response body (reported by @tve) #1269
- ECMA-419 TCP Listener had incorrect destructor function in host hooks leading to crash when terminating virtual machine (reported by @tve) #1267
- XS JavaScript engine
- Improvements to adding private field to object in ROM. These are related to stamping private fields (see "Returning overriding object").
- If object is petrified (fully immutable), adding private field fails with an exception (previously crashed)
- If object is alias-able, adding private field succeeds
- XS host hooks modified to support native dispatch table
signature
field replacessweeper
(unused). Signature indicates the type of the dispatch table that follows.- Any fields following
signature
are defined by the object - Use
xsGetHostHooks()
,xsGetHostHooksIf()
, orxsGetHostHooksValidate()
to retrieve host hooks for for an object
- Fix undefined behavior in
strtod2()
when converting long string literals flagged by UBSAN on oss-fuzz. (Thanks to David M. Gay for review and refinement) String.fromArrayBuffer()
andArrayBuffer.fromString()
now correctly handle null characters (reported by @tve) #1271 (thanks to @Frida854 for reporting a problem in the initial implementation #1279)
- Improvements to adding private field to object in ROM. These are related to stamping private fields (see "Returning overriding object").
- Examples
- Two new examples to draw a bitmap image from a PNG (motivated by question from @RiteshK551) #1280
- Rectangular image with no alpha channel
- Arbitrarily shaped image with blended edges using alpha channel
- Two new examples to draw a bitmap image from a PNG (motivated by question from @RiteshK551) #1280
- Documentation
- Describe Files class error handling (contributed by @tve)
- Document behavior of HTTP server
close()
(contributed by @tve) - Explain handling of Strings in HTTP (contributed by @tve)
- Recommend install of icon pack when using WSL2 (works around GTK bug). (contributed by @kallistisoft) #1272