Skip to content

Moddable SDK 5.2.0

Compare
Choose a tag to compare
@phoddie phoddie released this 13 Nov 21:44
· 209 commits to public since this release

Moddable SDK 5.2 contains improvements made between October 12, 2024 and November 12, 2024.

Highlights of this release include:

  • Camera – all-new camera module with support for ESP32 and the simulator (macOS, Windows, and Linux)
  • Support for devices with cameras from M5 Stack, Lilygo, and Seeed Studio
  • New storage and flash modules - preview of features from forthcoming ECMA-419 3rd Edition. The storage module will replace the current Preferences module which is widely used in projects.

The JavaScript eco-system is abuzz with discussion about the "Language Evolution" proposal to increase the security and stability of JavaScript by dividing it into two parts. Moddable believes this is be good for the language and especially good for embedded JavaScript developers. Read our latest blog post for all the details.

We are very excited to bring camera support to the Moddable SDK. It is a natural fit with our focus on bringing a modern user experience to low-cost embedded products. As you would expect our camera integration is extremely lightweight, simple to use, and powerful. The camera input isn't limited to a rectangle on the screen. You can fully integrate the camera image into dynamic, animated user interfaces as our new "camera balls" example demonstrates. Read all about the new suite of camera examples and browse the source code here. The "camera balls" example works on macOS, Windows, and Linux with most cameras so you can try it out even before you have an ESP32 device with a camera.

The Moddable SDK now supports directly including ESP-IDF native components from the ESP Component Registry. This is how our new ESP32 camera support has been integrated. Check out our blog post Using the ESP Component Registry with the Moddable SDK to learn more.

Note: ESP-IDF v5.3.1 has been released. Our testing shows that it is compatible with Moddable SDK v5.2. The Moddable SDK will move to ESP-IDF v5.3.1 in the December 2024 release.

Release Details

  • ECMA-419
    • Camera module available for ESP32, macOS, Windows, and Linux.
      • Implementation of the new ImageIn class, derived from the IO class patter
      • Returns uncompressed RGB565LE, uncompressed YUV422, and compressed JPEG images
      • Supports new buffer/disposable format to give JavaScript code direct access to camera driver's internal buffers, reducing memory use and improving performance by eliminating data copies
      • ESP32 implementation based on the ESP32 Camera Driver module from ESP Component Registry
      • Suite of new camera examples available
    • Flash module available for ESP32 and macOS
      • macOS simulator uses memory mapped file as backing store. Available partitions defined in configuration section of manifest
    • Storage module available for ESP32 and macOS
      • ESP32 implementation uses ESP-IDF nvs API for backing store
      • macOS implementation use CFPreferences API for backing store
    • Audio
      • Add audioType to options object of AudioIn and AudioOut constructor and as a read-only property of instances. Currently the only value defined is "LPCM" for linear PCM audio.
      • AudioIn onReadable callback receives second parameter indicating the number of readable samples (first argument remains number of readable bytes)
      • AudioOut onWritable callback receives second parameter indicating the maximum number of writable samples (first argument remains the maximum number of writable bytes)
    • HTTP server
      • Server instance implements port property to allow use of ephemeral ports
      • If content-length not specified for response body and not chunked transfer encoding, the length is indeterminate. Previously incorrectly handled as length of 0 causing connection to drop prematurely.
      • Byte count passed to onWritable callback pins to bytes known to be remaining in response body
    • Network sockets
      • Listener and TCP sockets on Windows correctly sets non-blocking mode #1428
      • TCP socket on Linux and Windows
        • Calls onError when remote endpoint cleanly disconnects #1430
        • Correctly adjust reference count in close() to account for inflight callbacks. Eliminates orphaned socket. #1430
    • Analog input on ESP32 supports MCU-specific options to set attenuation and disable calibration. Details in new readme. Reported by @takkaO) #1431
    • SMBus writeBuffer() method handles views correctly
    • Add support for buffer/disposable format
    • Add minimal implementation of axp2101 driver using ECMA-419 I²C
  • Devices
    • M5 Stack CoreS3
      • Add camera support
      • Uses ECMA-419 drivers for touch, audio, power, and IMU. This eliminates conflicts with the I²C support in the new camera driver.
    • Add new ESP32-S3 devices, all with camera support. For more information see our ESP32 document
      • Lilygo T Camera Plus S3 - platform build target esp32/lilygo_t_camera_plus_s3
      • M5 Atom S3R M12 - platform build target esp32/m5atom_s3r
      • XIAO ESP32S3 Sense - platform build target esp32/xiao_esp32s3_sense
  • Modules
    • Commodetto
      • Bitmap
        • Implements set buffer - experimental and may be removed
        • Stores buffer reference in native code
        • Add YUV422 pixel format (YUYV byte order)
      • Pixel format Converter implements YUV422 to RGB565LE conversion
  • XS
    • TypedArrays implement PreventExtensions to fail on resizable buffer. This tracks a fix in ECMA-262.
    • Fixed Error.prototype.stack memory corruption when function named Symbol.asyncIterator is on the stack and function names are stripped (default on embedded builds) (reported by @cmidgley)
    • Implement Module constructor from Hardened JavaScript draft specification
      • Enabled in xst for testing, disabled by default otherwise. - Define mxModuleStuff=1 to enable
      • Constructor is assigned to the global variable ModuleStuff reflecting its experimental status
  • Testing
    • Add unit tests for ECMA-419 Flash.
    • ECMA-419 Audio out unit tests updated to test new type property
    • ECMA-419 storage tests updated for iterator and missing keys
    • Add remote disconnect test for ECMA-419 TCP socket #1430
  • TypeScript
    • Fix type definition of original AudioIn read() (contributed by @stc1988)
    • Correct Wi-Fi modes (contributed by @cmidgley)
  • Documentation
    • Improve syntax highlighting for code blocks and fix syntax errors in example code in documentation (contributed by @stc1988)
    • Correct licenses link (contributed by @SamuelMarks) #1432
  • Examples

Contact Us

If you have questions or suggestions about anything here, please reach out: