Skip to content

Releases: Moddable-OpenSource/moddable

Moddable SDK 5.4.0

21 Jan 18:43
Compare
Choose a tag to compare

Moddable SDK 5.4.0 contains improvements made between December 3, 2024 and January 20, 2025. Our goal is to publish our release at the start of the month, but we missed that this month because there's so much in this one. (These notes also include following interim releases of the Moddable SDK: 5.3.1, 5.3.2, and 5.3.3.)

Latest JavaScript Standard (ES2025!) is on Embedded Devices Now

The annual update to the JavaScript language standard is on track to be published in June, but it is already fully implemented and ready for you to use on your embedded devices.

XS 16 is the latest major revision to the XS JavaScript engine. It fully supports the new features added to the language by the ES2025 standard with nearly 100% conformance, according to test262, the official JavaScript test suite.

Here's the rundown on the new ES2025 features available to developers using the latest Moddable SDK:

  • JSON Modules – Modules have always been imported as JavaScript code. The new import attributes feature opens the door to importing other kinds of modules. The first new kind of module is JSON. In the Moddable SDK, this means you can now include JSON files in the modules section of your project's manifest and access them using import. JSON modules work with preload, so they can be parsed during the build and stored in ROM, providing instant access at runtime that uses no RAM, no matter how large the JSON.
  • Float16 – Support has been added for half-precision floating-point values with the Float16Array TypedArray and getFloat16 and setFloat16 methods of DataView. The motivation for adding Float16 to the language is optimizing AI models, but the smaller data size is relevant to IoT too, especially sensor readings, which often have a limited range of values. By using less memory for the values, more data can be stored in device memory and that data can be transmitted more efficiently over BLE and the internet, saving time, bandwidth, and energy.
  • Iterator helpers – This suite of new methods brings powerful operations to JavaScript iterators, including map, filter, take, drop, flatMap, reduce, toArray, forEach, some, every, and find. The V8 team published a great introduction to these and MDN is already up-to-date.
  • Promise.try() – A new Promise helper function that brings a common developer coding pattern into the language. MDN explains it thoroughly.
  • Additional Set methods – A suite of methods has been added to the built-in Set object to perform operations across two sets. The new methods are: intersection, union, difference, symmetricDifference, isSubsetOf, isSupersetOf, isDisjointFrom. For an excellent, illustrated explanation of these new methods, see Set Composition Methods on MDN.
  • Regular Expressions – We don't use regular expressions often in embedded projects, but XS supports them so you can use them in your projects if you want. ES2025 adds two new features to regular expressions, both of which are explained extremely well by Axel Rauschmayer on his 2ality site: pattern modifiers and duplicate named capture groups.
  • Error.isError() – This new helper function isn't part of ES2025, but because it appears poised to be included in ES2026, we've included it in XS 16

We've tested these additions thoroughly with test262 to ensure conformance with the language specification and, therefore, interoperability with other JavaScript engines. We also test with testmc, the Moddable SDK's test suite to ensure compatibility with the many modules in the Moddable SDK. We have also run hundreds of hours (and still counting) of fuzz testing using Fuzzilli to ensure that the changes in XS 16 are memory safe and resilient.

ES2025 Impact on JavaScript Engine Code Size

All of these new language features would cause a significant increase in code size for any other JavaScript engine. XS is different. When building in the Moddable SDK, the build automatically removes many features of the language that it detects are unused. For example, only the new Set methods you use are included in your build; if you don't use Set at all, the entire Set object is excluded. The same is true for Float16 and Iterator Helpers. This strip feature is just one of the many ways that XS helps embedded JavaScript developers make optimal use of their resource-constrained hardware.

Improved ESP32 Debugging Connection

No tool is more important to software developers than their debugger. This release includes a complete reworking of communication for JavaScript debugging across the full ESP32 family of microcontrollers. The original implementation has evolved over the years to support more kinds of communication and more uses on more devices. The result was getting a little messy. That's been restructured, resulting in smaller, more readable, more consistent, and more maintainable code.

As a bonus, debugging over the USB JTAG connection (common on ESP32-S3 devices like Moddable Six) is now faster and more reliable. Check out the updated implementation with separate files for communication using UART, USB CDC over TinyUSB, and USB CDC over JTAG in the new esp32/lib/debugger directory.

These changes also ensure that the selected debugging communication channel is enabled for both debug and instrumentation builds and entirely disabled for release builds. This has always been the intent, but not all devices implemented it consistently.

ECMA-419 Networking for AI and Beyond

The Moddable SDK is migrating to industry standard ECMA-419 APIs everywhere we can. As part of that, we have been taking a hard look at the implementations of the ECMA-419 networking protocols, especially for use with AI cloud services. The recent flurry of "realtime" AI services that run over WebSockets uncovered a few issues, as have some TLS configuration changes by some services. Work on video streaming as part of our recent camera integration identified issues in the HTTP client and server. We've fixed all of these, as well as making improvements to eliminate buffer copies and make more optimal use of available bandwidth. Many thanks to the developers who have shared their findings – in particular, we've seen quite a few from Japan and Europe.

A little help? C compiler support for float16_t

ES2025 adds support for 16-bit floating point values based on IEEE 754 half-precision floating-point values. Unfortunately, support for float16_t is not yet universal in C compilers. This is especially true on embedded systems and Linux distributions, both of which have reasons to take their time in adopting compiler updates. To allow float16 support to work everywhere, the XS JavaScript engine can be configured at build time to use the C compiler's float16 support or to use a built-in implementation. Our preference is to use the C compiler's implementation, as it is likely better optimized for the target silicon. Because there are so many build configurations, it is impossible to test this completely. So, we ask: if you happen to run into a problem building with the latest Moddable SDK, please report it to us immediately, especially if it looks like it is related to float16 support. We want to get that resolved quickly so no one else runs into the same problem. Thanks!

On the Horizon: ESP-IDF v5.4

ESP-IDF v5.4 was released at the start of the New Year, Our initial testing shows that some changes will be required to migrate the Moddable SDK to v5.4. The current recommended ESP-IDF version remains v5.3.1. There is no plan to migrate to v5.3.2 now that v5.4 is available; however, preliminary testing of v5.3.2 did not identify any issues, so it is likely safe to use if it contains improvements your project requires.

What does Moddable think of JS0/JSSugar?

tl;dr: we really like it.

If you are the kind of person who needs to know the details, check out our "Language Evolution" blog post.

Release Details

  • XS JavaScript engine
    • XS 16 fully supports ES2025. See notes above for details.
    • Add Error.isError()
  • Devices
    • Pico
      • Uses gcc-arm-embedded
      • Pico now requires building the pioasm tool to build .pio files
      • Arducam hm01b0 camera supports 16-level (4-bit) grayscale capture
      • DigitalBank now uses the proper API to disable the IRQ
    • ESP32
      • ESP32 Camera
        • Supports 16-level grayscale capture
        • Configurable XCLK_FREQ and JPEG_QUALITY (contributed by @kitazaki...
Read more

Moddable SDK 5.3.3

21 Dec 00:38
Compare
Choose a tag to compare

Interim release:

  • Moddable Four bootloader => 8.2
    • adds a small delay after installation to prevent errors with macOS Sequoia
  • pico builds with the newer compilers
  • pico instructions to build pioasm
  • more

Moddable SDK 5.3.0

06 Dec 19:38
Compare
Choose a tag to compare

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
    • 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
  • Ecma-419
    • WebSocket client
      • Payloads of length 127 now properly transmitted
      • Eliminate occasional "would block" exceptions when using WebSocket over TLS
  • Bluetooth
    • The manufacturerSpecific getter for received advertisements no longer returns data beyond the end of the field
  • Tools
    • Git repository import in mcconfig and mcrun have been enhanced to work with repositories that do not contain a Moddable SDK manifest.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.
  • XS JavaScript engine
    • Overflows in Date parsing of integers sets date to NaN (improves conformance)
    • Object copy helper function checks meter when looping
  • Testing
    • Ecma-419 Update (OTA) unit tests added

Contact Us

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

Moddable SDK 5.2.0

13 Nov 21:44
Compare
Choose a tag to compare

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:

Moddable SDK 5.1.0

16 Oct 19:32
Compare
Choose a tag to compare

Moddable SDK 5.1 contains improvements made between September 14 and October 11, 2024

Highlights of this release include:

  • Raspberry Pi Pico - support for new RP2350 and version 2.0 of the Pico SDK
  • ECMA-419 Audio Input and Audio Output for upcoming 3rd edition
  • Improved error messages throughout XS for better JavaScript debugging

Moddable issued a press release about Moddable Six to share the news of our latest product with the world. Moddable Six is our most advanced display for Embedded JavaScript with unprecedented performance, quality, and ease-of-use. Read the news!

Raspberry Pi Pico developers need to update their pico-sdk, pico-examples, pico-extras and pico-playground repositories to version 2.0 (tag: sdk-2.0.0). That's easily done by reinstalling those repositories following the directions in our Getting Started with Raspberry Pi Pico document.

Work on the 3rd Edition of ECMA-419, the standard for Embedded JavaScript, is making rapid progress. We are adding Moddable's implementations of new modules to the Moddable SDK as they are ready. We are also providing unit tests and/or example apps. These should be considered experimental until ECMA-419 3rd Edition is officially standardized as changes may still be made. They are provided here for member of the committee and the community to try them out and provide feedback prior to standardization.

The Moddable SDK now supports directly including ESP-IDF native components from the ESP Component Registry. 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 initial testing shows that it is compatible with Moddable SDK v5.1. We are not requiring an update to ESP-IDF v5.3.1 at this time, as it does not appear to contain any critical changes and there have been quite a few ESP-IDF updates lately.

Release Details

  • Devices
    • Raspberry Pi Pico
      • Updated to Pico SDK 2.0
      • Support for new RP2350 (ARM cores only)
      • New RP2350 device build targets
        • pico/pico_2 for Raspberry Pi Pico 2
        • pico/pico_plus_2 for Pimoroni Pico Plus 2
        • pico/sparkfun_rp2350 for Sparkfun Pro Micro RP2350
      • Use sparkfun-pico library for PSRAM on Sparkfun Pro Micro RP2350
      • test262 and testmc test tools now run on Pico builds
    • Moddable Six builds no longer reserves GPIO 17 for read/write in MIPI display driver (it is not connected to the MCU)
    • Update DEBUGGER_SPEED for M5Stack Core2 based on field experience (Contributed by @stc1988) #1359
  • Documentation
  • ECMA-419
    • Audio input implementations for ESP32, macOS, Linux, and Windows added (3rd edition)
    • Audio output implementations for ESP32, macOS, Linux, and Windows added (3rd edition)
    • Listener socket conformance improvements
    • lwip socket memory corruption fix when no callbacks
    • Listener socket instances provide port property (useful when bound to dynamic port)
    • Use string in place of obsolete string;asii and string;utf8 formats
  • Examples
    • Add wss (secure WebSocket) example for ECMA-419
    • Added Audio Input and Audio Output examples for ECMA-419 (3rd edition)
  • Modules
    • lwip socket implementation
      • Validate host data (fixes use-after-free) #1410
      • Don't call XS in C API from another thread (could happen on dispose)
  • Testing
    • Add $NETWORK.resolve() helper
    • ECMA-419 tests
      • Listener socket unit tests
      • No callback socket tests
      • Audio output tests (3rd Edition)
      • Storage (key-value pair) tests (3rd Edition)
  • Tools
    • New manifest dependency feature for ESP32
      • Supports specifying additional include paths
      • Doesn't emit empty dependencies #1408
    • Update ADPCM-XQ audio compressor to version 0.5 (faster, higher quality)
    • ESP-IDF instrumented builds use CONFIG_ESP_CONSOLE_UART_BAUDRATE for the serial baud rate (contributed by @cmidgley)
  • Typings
    • Add 419 Listener port
    • Add typings union for Socket (contributed by @cmidgley)
    • More complete Worker typings - including full constructor options object
    • HTTP Headers object uses string primitive for map (Contributed by @magenetaan)
  • XS
    • Overhaul of error messages
      • Replaces "is no" with "is not a"
      • Moves name of function where error occurs to the end (in function)
      • Provides full path of function where error occurs when possible
      • Rephrased some error messages to eliminate ambiguities
      • Eliminate some redundancies
    • Fixes
      • Array.from() crash (found by Fuzzilli)
      • TypedArray [[Set]] with receiver. (Reported by @gibson042)
      • Array join() and toLocaleString() methods check meter to eliminate timeout (found by oss-fuzz)

Contact Us

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

Moddable 5.0.1

29 Sep 03:27
Compare
Choose a tag to compare

Bugfix release #1408

Moddable SDK 5.0.0

16 Sep 19:12
Compare
Choose a tag to compare

Moddable SDK 5.0 contains improvements made between August 10 and September 13, 2024.

Highlights of this release include:

  • OneWire support for ESP-IDF v5
  • Integration of The ESP Component Registry with project manifests
  • ECMA-419 TCP, UDP, and Listener sockets for Windows

The xs-dev project is working towards a version 1.0 release. If you aren't already using xs-dev, it is worth taking a look. It is the easiest way to install and update the Moddable SDK and the embedded SDKs it depends on. Nick Hehr, creator of xs-dev, is requesting feedback on changes to the structure of xs-dev to make it easier for future contributions and maintenance. If you are a user or contributor to xs-dev, please take a look.

Note: ESP-IDF v5.3.1 has been released. Our initial testing shows that it is compatible with Moddable SDK v5.0. We are not requiring an update to ESP-IDF v5.3.1 at this time, as it does not appear to contain any critical changes and there have been quite a few ESP-IDF updates lately.

Release Details

  • Modules
    • OneWire support reimplemented for ESP32 family of microcontrollers using ESP-IDF v5
    • Audio Input module in simulator
      • Allow overriding the audio resource using config.audioInWave. Requested by @stc1988. #1390
      • Support stereo audio resources
    • Add another valid device ID to FT6206 touch input driver. Contributed by @washishi.
    • Add modules/data/views directory to hold C header files for use with CompileDataView. Initially includes Wave and MAUD file headers.
    • Commodetto static renderer uses c_rand on ESP32 to avoid overhead of cryptographically secure random number generator
    • UUID module falls back to random when MAC address is unavailable and conforms to RFC 9562 (contributed by @cmidgley)
    • Implement Net.get("IP") for Linux
  • ECMA-419
    • TCP, UDP, and Listener sockets for Windows
    • TCP socket on embedded, macOS, and Linux conformance improvements
    • TCP Listener clears host destructor on close
    • File module implementations only need to export Directory
    • buildCommon.h
      • Compatibility with C++
      • Rework to support additional format types (used as part of experimental 419 Storage class)
  • Devices
    • Moddable Six device targets now define default serial port for built-in programmer (reported by @mauroForlimpopoli) #1406
  • XS
    • ArrayBuffer constructor steps were not strictly conformant with spec. Reported by @gibson042 with test case by @anba. tc39/ecma262#3388
    • TypedArray.prototype.byteLength now returns conforming size when buffer is resized to a non-integrate size. Reported by @gibson042. #1392
    • Fix parsing of conditional expressions following await. Only occurred when explicit resource management proposal support is enabled. (Reported by @gibson042). #1394
    • Correct explicit resource management function IDs that caused a few objects not to be skipped by Hardened JavaScript's lockdown()
    • Metering now uses 64-bit values consistently internally and in callback. Eliminates overflows and extends range.
    • Export fxFromBigInt64, fxFromBigUint64, fxToBigInt64, and fxToBigUint64
  • Documentation
    • Fix syntax errors in code blocks of multiple documents. (contributed by @stc1988)
    • Explain dependency element for ESP32 targets in Platforms section of Manifest documentation
    • Add image of Moddable Six programmer (reported by @stc1988) #1393
    • Use jsonc (JSON with comments) to tag JSON fragments with comments (follow on to #1378)
    • Explanation of static expanded and augmented with link to Wikipedia (Requested by @stc1988) #1396
  • Tools
    • xsbug-log
      • Can now capture binary data from embedded device to files on host computer
      • Works with multiple VMs for Web Worker support (contributed by @cmidgley)
    • Add $262.isLockDown() to allow test262 tests to determine if running under Hardened JavaScript's lockdown.
    • Bring wasm build up-to-date
    • testmc (unit test runner)
      • Add async $NETWORK.resolve() function for DNS look-up
      • Update list of TLS certificates
    • ESP-IDF component dependencies
  • TypeScript
    • Update instrumentation typings (contributed by @cmidgley)
    • Add AudioOut.volume case to enqueue typing (contributed by @stc1988)
    • Add optional microseconds() function to Time module typings (contributed by @cmidgley)
    • xsbug REPL reverse scope order resolution (impacts multiple variables of same name across different scopes)
  • Tests
    • Add unit tests for ECMA-419 TCP socket
    • Add unit tests for ECMA-419 UDP socket
  • Examples
    • New Embedded Escape Room Challenge to demonstrate Hardened JavaScript Compartments
    • Replay audio input/output example handles stereo and queues more samples to playback more reliably on all targets

Contact Us

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

Moddable SDK 4.9.5

11 Aug 15:03
Compare
Choose a tag to compare

Moddable SDK 4.9.5 contains improvements made between July 19, 2024 and August 9, 2024.

Documentation

This release features many updates to documentation. Most of the updates are a result of work to translate the Moddable SDK documentation to Japanese. Thank you to the members of this effort for their careful work. To learn more about the translation effort and how to contribute, check out the translation read me.

Latest ESP-IDF

This release of the Moddable SDK migrates to ESP-IDF v5.3 for the ESP32 family of microcontrollers. Our goal is to keep the Moddable SDK up to date with the latest production release from Espressif so that embedded JavaScript developers can benefit from the latest fixes, security improvements, performance enhancements, features, and silicon support.

We always try to make these transitions to the underlying ESP-IDF software platform transparent to your JavaScript code. This hides how much work is involved in updating the Moddable SDK to the latest ESP-IDF. Here's some of what needs to be done each time:

  • Migrate from newly deprecated APIs
  • Update include file paths
  • Update to latest configuration option constants
  • Build all example apps
  • Build for all support ESP-IDF family silicon
  • Run unit tests
  • Update recommended IDF version in make files for macOS, Windows, and Linux
  • Update ESP-IDF installation and update instructions

The Moddable SDK contains instructions for updating to the latest ESP-IDF on macOS, Linux, and Windows.

TypeScript type definitions available from NPM

The type definition files (e.g. typings) in the Moddable SDK are now also published as the NPM package @moddable/typings for convenience of developers using Visual Studio Code and other development environments. The typings are updated for each Moddable SDK release. The version number of the typings package corresponds to the Moddable SDK release.

Release Details

  • Documentation
    • Typos fixed in Poco documentation for fillPattern() and PocoBitmapDrawMasked - contributed by @tenugui-taro
    • Code examples in documentation now consistently use syntax highlighting (contributed by @stc1988)
    • Remove invalid trailing commas from JSON in documentation (contributed by @stc1988)
    • Document that mcrun supports -t build #1380
    • Fix documentation examples of ESP32 custom file system root #1386
    • Remove obsolete note about lack of https support from audio streamers documentation #1384
    • Document Flash class #1349
  • Modules
    • fetch() supports chunked transfer-encoding
  • XS JavaScript engine
    • Compartment constructor now aliases loadHook to importHook, and loadNowHook to importNowHook for compatibility with latest standards work
    • XS metering uses 64-bits internally in more places to avoid overflow
  • Testing
    • testmc can now be built in different configurations. Added OTA configuration.
    • Implemented OTA unit tests
    • HTTP unit test updated to pass with changes on example.com
  • Tools
    • Performance profiling can be enabled in xsbug when stopped at a breakpoint
    • Preload of modules supports "../../" in module specifiers #1373
    • mcpack uses canonical names internally to avoid duplicate entries in module map #1382
    • Allow projects to override device's custom partition map on ESP32 targets #1385
  • Examples
    • Add Moddable Six to compatibility list for piu/sound and Wi-Fi Config examples

Contact Us

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

Moddable SDK 4.9.0

19 Jul 23:18
Compare
Choose a tag to compare

Moddable SDK 4.9.0 contains improvements made between June 5, 2024 and July 18, 2024.

This release brings support for Moddable Six, our new development board! Moddable Six is our most powerful device, able to deliver advanced mobile-class user experiences on low-cost, compact embedded hardware. Here's just some of what it includes:

  • ESP32-S3 MCU, a dual-core 240 MHz CPU with built-in Wi-Fi and BLE
  • Bright, beautiful IPS display for flicker-free animation at 60 FPS
  • Low-latency multi-touch display
  • Audio speaker
  • 8 MB high-speed PSRAM
  • 8 MB high-speed flash storage
  • Qwiic connector
  • USB and serial

There's extensive technical documentation available for all the capabilities of Moddable Six. Dig into that to learn how to use the powerful hardware in your JavaScript projects.

Moddable Six is a significant upgrade to our most popular development board, Moddable Two. Moddable Six is available immediately at the same price as Moddable Two, starting at just $29.99. Check out the product page and order today.

Moddable Six is so much more powerful than Moddable Two that we created an all-new suite of examples to demonstrate what is now possible. Check out the Speaking Clock, Battery Monitor, and Smart Plug Schedule projects to see how Moddable Six brings mobile-class user experience to IoT products built with modern JavaScript.

Important: The Moddable SDK now recommends using ESP-IDF v5.2.2, the most recent production version of the Espressif SDK. This version contains major improvements to BLE and Wi-Fi compared to the previously recommended v5.1.2. Updating to ESP-IDF v5.2.2 is straightforward. For the vast majority of Moddable SDK projects, no changes to your JavaScript code are required. The Moddable SDK contains instructions for updating on macOS, Linux, and Windows.

Release Details

  • Modules
    • ILI9341_p8 supports continue() called from script
    • TLS adds secp384r1 ECC for compatibility with OpenAI (#1368)
    • LittleFS renames MODDEF_FILE_LFS_PARITION_SIZE to MODDEF_FILE_LFS_PARTITION_SIZE (contributed by @cmidgley)
  • ECMA-419
    • nRF52 Serial
      • Transmit pin is optional
      • Invoke onWritable before buffer is completely empty to allow truly continuous writes
    • WebSocket implementation now passes headers on to ECMA-419 WebSocketClient
  • XS JavaScript Engine
    • Metering
      • Implemented for RegExp parser
      • Implemented for JavaScript parser
      • Apply relative weights to different kinds of operations to better model execution cost
    • Several Compartment fixes to improve conformance (reported by @kriskowal)
  • Documentation
    • How XS implements JavaScript scopes is now documented - both data structures and runtime operations. Read more about it on our blog and then dive into the full document.
    • Fix Neostrand documentation examples (contributed by @stc1988)
  • Devices
    • ESP32
      • Clean-up watch-dog timer configuration #1249 (contributed by @linfan68)
      • sdkconfig names updated to match changes in ESP-IDF
      • Neopixel has no task affinity on single core devices
      • Update CDC devices for ECMA-419 and mods
      • Eliminate use of usb_serial_jtag_ll functions with latest ESP-IDF
      • Reduce default ESP-IDF log output for ESP32-H2 and ESP32-S3 devices
      • Analog input only calibrates raw values (contributed by @linfan68)
      • Small changes to support limited use with ESP-IDF 5.0.x (not recommended or supported in general)
      • Avoid hang on ESP32 CDC devices when USB disconnects while using xsbug
  • Examples
    • Piu backlight example
      • Feedback sound while adjusting brightness (requires host with audio enabled)
      • Floor on minimum brightness to avoid making screen too dark to read
  • Tools
    • xst
      • Cleans up memory on stack overflow when fuzzing (contributed by @raphdev)
      • Memory use tracking for fuzzer includes tracking overhead to more accurately estimate total memory in use of process
      • Don't attempt to load directory path as a module
    • mcconfig & mcrun
      • Escape '#' (private scoped modules) with "^" on windows-only (nmake) #1356 (contributed by @ cmidgley)
      • Merge all tsconfig options, not only compilerOptions (contributed by @cmidgley)
      • Escape TypeScript private module specifier in make file
    • serial2xsbug
      • trace and trace command are now command line options (-trace and -tracecommands) instead of compile-time options
      • Fix crash that happened occasionally on reset
    • xsbug-log
      • Break out LogMachine into separate file, and use XSBUG_LOGMACHINE environment variable to select implementation to load (contributed by @cmidgley)
    • Simulator
      • Invoke onQuit prior to exiting
      • Moddable Six simulator (use sim/moddable_six build target)
  • Tests
    • Update minimum PWM frequency to match ESP-IDF v5.2.2 changes

Contact Us

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

Moddable SDK 4.8.0

05 Jun 19:22
Compare
Choose a tag to compare

The Moddable SDK 4.8.0 release contains improvements made between May 5, 2024 and June 5, 2024.

This release features very low-level improvements to the Moddable SDK. Highlights include:

  • Updated to ESP-IDF v5.2.2 for ESP32 family MCUs
  • ECMA-419 Files API on embedded using LittleFS
  • Reliability improvements for BLE using NimBLE

Important: The Moddable SDK now recommends using ESP-IDF v5.2.2, the most recent production version of the Espressif SDK. This version contains major improvements to BLE and Wi-Fi compared to the previously recommended v5.1.2. Updating to ESP-IDF v5.2.2 is straightforward. For the vast majority of Moddable SDK projects, no JavaScript code are required. The Moddable SDK contains instructions for updating on macOS, Linux, and Windows.

Release Details

  • XS JavaScript engine
    • Fix ModuleSource instance bindings property for modules imported only for side-effects (reported by @kriskowal)
    • Add xsBeginHostExit and xsEndHostExit to allow catching fatal exceptions
    • Default for mxBoundsCheck is now enabled to favor reliable execution (catching stack overflows, for example)
    • Consistent definitions of xsNewHost* functions between xs.h and xsAll.h, needed for WebAssembly builds (contributed by @SMotaal)
    • Add callbacks for new Base64 functions for compatibility with snapshots (contributed by @SMotaal)
    • Lockdown creates secure functions with length that matches original (for test262 compatibility)
    • Metering
      • Implement for JavaScript parser
      • Array, RegExp, String, and TypedArray loops that don't invoke scripts
    • Fixes for issues uncovered through extensive fuzz testing. Thank you to @Agoric for their support of this work.
      • ArrayBuffer.fromBigInt range check fixed
      • Hostile mapper function that detaches buffer no long crashes TypedArray
  • ECMA-419
    • nRF52 Serial
      • Restart receive after read error
      • Enable useCount to avoid exceptions after closing
      • Reliability improvements
    • Files
      • Embedded
        • Implementation using LittleFS. Passes all unit tests on ESP32 family.
      • Linux
        • POSIX file support available on Linux
        • Linux uses RESOLVE_BENEATH to fully sandbox file access
      • Implement link support for POSIX file systems
    • PWM
      • PWM on ESP-IDF v5.2.x doesn't support low frequencies as fully as previous versions of ESP-IDF. An exception is thrown if an unsupported frequency is requested.
    • ESP32 H2, ESP32 C6, and ESP32 C3 now support ECMA-419 builds
      • ESP32 C6 and ESP32 H2 do not provide Pulse Count IO
      • ESP32 RISC-V devices do not provide GCC atomics. IO modules now work around this.
  • Modules
    • HTML5 WebSocket implementation supports optional options object to include full ECMA-419 ws: or wss: configuration
    • HTML5 EventSource implementation reports status and statusText so scripts can detect/handle errors (contributed by @stc1988)
    • Piu supports slow motion rendering (60x slower than real-time)
  • Devices
    • ESP32
      • Add Wi-Fi station_connect and station_disconnect events for ESP32 targets (contributed by @stc1988)
      • Audio Output amplifier control on ESP32 improvements
        • Turns off sooner after audio completes
        • Doesn't toggle if new audio queued while playing
      • BLE for NimBLE on ESP-32
        • Improvements to reliability, especially after closing, motivated by behavior changes in ESP-IDF 5.2.x
        • Bug fix in read descriptors. Previously some descriptor look-ups failed resulting in values being provided in an incorrect format. In some rare cases, this may require updating project code.
        • In rare cases, scan results could be delivered after terminating scan. This has been fixed.
      • ILI9341 parallel driver
        • Trigger transmit simplifications
        • Larger default rendering buffer (32 scan lines)
        • Eliminate potential tear on first frame after rendering pause
    • nRF52
      • Option to read User Information Configuration Registers (UICR) to a file using J-Link with the -t readuicr option to mcconfig
      • Only enable QSPI in build when USE_QSPI is set (off by default)
  • TypeScript
    • Add Wi-Fi station_connect and station_disconnect events (contributed by @stc1988)
    • Wi-Fi bssid is ArrayBuffer (contributed by @cmidgley)
    • Add typings for QRCode module (contributed by @stc1988)
  • Tools
    • xst
      • Support saving and loading test results as configurations to easily compare results between test runs
      • Adjust memory limit for oss-fuzz to reduce out-of-memory errors
      • Patches to limit memory use now thread safe
    • ble2gatt
      • Requires array values to be arrays, not single values
  • Tests
    • Add unit tests for draft ECMA-419 Files API
    • BLE client and server tests updated
      • Fix tests related to descriptors now that look-up is working correctly
      • If service look-up fails (rare, but happens) provide descriptive error message
      • NimBLE doesn't provide RSSI immediately after connection, so wait for services to be polled before requesting RSSI

Contact Us

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