Skip to content

Releases: Moddable-OpenSource/moddable

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 Register 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 @gibson402 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 @gibson402. #1392
    • Fix parsing of conditional expressions following await. Only occurred when explicit resource management proposal support is enabled. (Reported by @gibson402). #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:

Moddable SDK 4.7.0

07 May 16:54
Compare
Choose a tag to compare

The Moddable SDK 4.7.0 release contains improvements made between April 3, 2024 and May 5, 2024.

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

  • Nordic nRF52 IO enhancements
  • String performance optimizations
  • First implementation of draft ECMA-419 Files API
  • Significant additions to xst, the XS test tool, to expand test coverage including running test262 under Hardened JavaScript

Note: This release is expected to be the last using ESP-IDF 5.1.2. We will migrate to ESP-IDF 5.2.1 in the next few weeks. ESP-IDF 5.2.1 has many Wi-Fi and BLE improvements.

Release Details

  • XS JavaScript engine

    • String optimizations
      • Background: XS optimizes strings to minimize memory use. For some operations on larger strings (over 1024 bytes), this reduces performance.
      • Added optional side-table to optimize common string operations. The side-table caches the following information for the most recently used strings:
        • String length in bytes
        • String length in Unicode codepoints
        • Flag indicating string is 7-bit only ASCII
        • Last accessed index in bytes and Unicode codepoints
      • Side-table improves performance of common operations by 100x or more for long strings
      • Disabled by default in embedded runtimes
      • Enabled by default in command line build tools and xsbug
    • Upgrade to fdlibm from FreeBSD (previously using Netlib version)
      • Benefits
        • Actively maintained version
        • Fixes several undefined behavior errors
        • Generates results consistent with V8
      • Note: XS does not use fdlibm by default but provides it as an option for runtimes that need numerical consistency beyond what ECMA-262 requires
    • Fixes for issues uncovered through fuzz testing. Thank you to @Agoric for their support of this work.
      • String.prototype.at could read from arbitrary memory if garbage collection occurred while validating arguments
      • Eliminate overflow in newly added Uint8Array toBase64 and toHex
    • Fix build conflict between string cache and metering (contributed by @raphdev)
  • Modules

    • ECMA-419
      • Early implementation of Files for ECMA-419 3rd Edition. This is currently POSIX-only, for macOS and Linux. Embedded device support and unit tests are planned.
    • Poco
      • Option to allocate pixel buffers in DMA capable memory as required by ILI9341 (MIPI) 8-bit parallel display driver
      • Let display driver set minimum size of pixel rendering buffer
    • ILI9341 (MIPI) 8-bit parallel display driver keeps display output disabled until first frame is drawn to eliminate start-up display glitch
  • Devices

    • nRF52
      • Improvements when building on nRF targets on Windows
        • USE_WDT supported
        • Don't build USB sources on device without USB (UART-only)
      • ECMA-419 PWM
        • hz getter returns actual frequency, not requested frequency
        • Support more frequencies with nrF52 specific top_value property in constructor's options object
      • Instrumentation supported on UART-only builds
      • Reset pins to default configuration when closed (not in use). This can reduce energy use.
      • Uses SPI2 by default, instead of SPI3, to work around intermittent start-up failures
      • Fix build conflict with nRF52 _read and new read symbol from XS Base64 support
    • ESP32
      • Backlight management changes for Hosts that implement Backlight class (e.g. Moddable Two, Moddable Display 2)
        • Commodetto and Piu turn on backlight for projects that include them
        • Projects that don't use Commodetto or Piu leave backlight off at start-up
  • Documentation

  • Tools

    • xst
      • Option to track all XS memory allocations to support more efficient fuzzing
        • Optionally abort when memory limit exceeded
        • Free memory on unrecoverable VM exists
      • Source code split into three parts to contain test262 and fuzzing support in their own files for easier maintenance
      • Profiling data includes metering count when metering is enabled
      • Remove code to disable LSAN, now that xst can clean-up memory allocations on abort (contributed by @raphdev)
      • Options to run test262 under lockdown (-l) and inside a Compartment after lockdown (-lc) to validate test262 conformance under Hardened JavaScript.
    • serial2xsbug on macOS suggests launching xsbug if attempt to connect to it fails
    • nodered2mcu maps Blockly to Function node (enables Blockly support for embedded JavaScript using Node-RED) (thanks to @ralphwetzel for the suggestion and @spillz-dxb for the motivation) @phoddie/node-red-mcu#126

Contact Us

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

Moddable SDK 4.6.0

05 Apr 18:40
Compare
Choose a tag to compare

The Moddable SDK 4.6.0 release contains improvements made between March 4, 2024 and April 3, 2024.

Highlights of this release include:

  • M5Nano C6 and M5Stack Core 2 v1.1 device support
  • Support for proposed standard Base64 and Hex extensions to Uint8Array from Ecma TC39. XS is the first JavaScript engine to ship support for this proposal! Please give it a try to help evaluate the design before it is finalized.
  • fontbm now included in the release tools binaries making it easier than ever to use custom fonts in your projects (if you don't use the downloadable release binaries, you'll still continue building fontbm yourself)

Note: This release is expected to be the last using ESP-IDF 5.1.2. We will migrate to ESP-IDF 5.2.1 in the next few weeks. ESP-IDF 5.2.1 has many Wi-Fi and BLE improvements.

Release Details

  • Devices
    • Add support for M5Stack Core 2 v1.1. (Contributed by @meganetaaan and first time contributor @RChikamura!)
    • Add support for M5Nano C6 (esp32/m5nanoc6) (contributed by @stc1988)
    • Add esp32/esp32h2_cdc and esp32/esp32c6_cdc platform targets for USB debugging (motivated by @stc1988) #1326
  • ESP32 family
    • Wi-Fi now clears credentials when done with a connection to avoid unexpected reconnects
    • ECMA-419
      • Digital Bank no longer uninstalls GPIO ISR service as it may be in use by other system components
      • Analog input fully initializes data structures (Contributed by @linfan68) #1322
    • ILI9341_P8 driver
      • Defaults to 50 FPS
      • Enable tearing-effect interrupt
      • Fixes for compatibility with testmc
  • Modules
    • EventSource (for Server-Sent Events) now supports method, headers, and body options. This was motivated by certain AI cloud services.
    • AudioOut and pins/servo modules now link on Linux for convenience when using the simulator (Reported by @ronron-gh) #1328
    • Piu outline shape object supports disabling bounding box clip
    • zlib encoder and decoder modules reduce native stack size by moving buffers from stack to heap. This allows the modules to be used reliably with the default stack configurations.
  • XS
    • Base64 / Hex Stage 3 proposal fully implemented
      • See proposal's playground for documentation and examples
      • Passes 100% of test262 tests
      • API designed enables streaming decoding and encoding to reduce peak memory use. See the example.
      • Moddable SDK modules and examples updated to use new JavaScript language Base64 and Hex transformations in place of Moddable SDK Base64 and Hex modules
      • Hex and Base64 modules still supported, but new code is recommended to use the new JavaScript language features
    • Fixes for issues uncovered through fuzz testing. Thank you to @Agoric for their support of this work.
      • Obscure bug in DataView.prototype.slice triggered by hostile use of species that triggered a call to memcpy with overlapping ranges
      • Obscure native stack overflow in RegExp parser
      • Reliably convert -9223372036854775808 to BigInt
  • Tools
    • fontbm font generator
    • test262 now runs on ESP32-S3 devices using esp32/esp32s3 platform target
    • xst now has -b option to load binary files as JavaScript source text (useful for fuzzer generated test cases)
    • Disable ASAN on RegExp stack check for more reliable fuzzing (contributed by @raphdev)
  • Tests
    • Wi-Fi scan cancel test waits for final scan to complete
    • Wi-Fi mode off test uses $DONE(err) instead of throwing
    • Wi-Fi constructor BSSID test uses highest signal strength access point if more than one available to improve reliability of test
    • Wi-Fi timeouts increased to allow tests to pass in more environments
  • TypeScript
    • Typings for the standalone easing functions, recently split out from Piu. (Contributed by @stc1988)

Contact Us

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

Moddable SDK 4.5.0

05 Mar 07:52
Compare
Choose a tag to compare

This release contains improvements to the Moddable SDK made between February 2, 2024 and March 4, 2024.

Highlights of this release include:

  • XS 15, the latest version of our embedded JavaScript engine is here! It supports all the new capabilities of the latest revision of the JavaScript language, ECMAScript 2024!
  • Energy savings. ESP32 now has the option to power-off Wi-Fi when not in use and nRF52 uses significantly less energy when in idle, extending battery life.
  • New M5Stack simulator lets you use the Moddable SDK's simulator to more accurately develop your M5Stack projects.
M5Stack clock

New Hardware: Moddable recently launched the Moddable Display product line. Moddable Display is the beautiful way to bring your latest embedded JavaScript project from the workbench to the real world.

Moddable Display product family

Reminder: ESP-IDF v5.1.2 is now recommended for ESP32 development. Please see the January 2024 Release Notes for details on how to update.

Release Details

  • XS
    • XS 15 is here, with full support for ECMAScript 2024 (ES2024)! Conformance with the standard for all new features is 100%. Overall conformance is 99.92% for language tests and 99.88% for built-ins tests (see the XS Conformance document for details). New features in ECMAScript 2024 include:
    • Optimizations for String getOwnProperty, String.prototype.at(), and String.prototype.replaceAll()
    • Handle out of memory errors safely in xsdtoa.c
    • Fixes for issues uncovered through fuzz testing. Thank you to @Agoric for their support of this work.
    • XS reports syntax error for try without either catch or finally
    • Module specifiers with an arbitrary number of "../" are now supported
  • ESP32
    • 8-bit parallel ILI9341 driver
      • CS pin optional
      • frameRate accessor to set hardware refresh rate
      • Uses binary semaphore to synchronize with tearing-effect ISR to eliminate spin loop
    • Using Serial JTAG debugger port with xsbug is now much more reliable. Worked around bug in the ROM that caused occasional hangs when writing. #1299 (reported by @NW-Lab)
    • Audio output supports optional GPIO to enable/disable an external audio amplifier
    • Clean-up watch-dog timer settings in sdkconfig files
  • nRF52
    • Default to PowerMode.LowPower instead of PowerMode.ConstantLatency for (much) lower energy use during system sleep
      • New example showing how to set PowerMode
    • Hardware supports misaligned writes, so no need to set mxMisalignedSettersCrash (slightly faster 32-bit TypedArray writes)
    • When done using pin, reset to default state to reduce energy use
  • Modules
    • New WiFi.Mode enumeration of constants for Wi-Fi operating modes
    • Wi-Fi implements new off mode to disable the Wi-Fi stack #1295
      • This frees memory (about 60 KB on ESP32) and reduces energy use
      • Implemented on ESP32 and Raspberry Pi Pico
      • Check for availability with if ("off" in WiFi.Mode)
      • Requested by @beckerzito, thanks to @tve for input.
    • OpenAI Audio streaming now supports Wave files in additional to previous MP3 support. (Contributed by @stc1988) #1316
    • Easing equation functions split out from Piu to their own module to be more generally useful (suggested by @stc1988) #1309
    • MQTT client handles write error while sending initial connect message
  • Drivers
    • GT911 touch interrupt now triggers on rising edge (lower latency)
    • AM2320 temperature and humidity sensor - more reliable read timing and general clean-up. (contributed by @louisvangeldrop) #1311
  • Tools
    • M5Stack simulator! (contributed by @stc1988). Use mcconfig -d -m -p sim/m5stack to try it out.
    • mcpack fixes for module aliasing to allow more npm modules to work correctly. (Reported by @FWeinb who is now using protobuf for protocol buffers)
    • xst
      • On Linux no longer sets -fsanitize-recover=undefined (contributed by @raphdev)
      • Hooks memory allocators (malloc, etc) to be able to force failures when fuzzing
    • mcchex now available in Linux binary distribution (contributed by @ethos-jgreenwood) #1315
  • TypeScript
    • Typing for Time.delta() (contributed by @meganetaaan)
    • Typing for Outline.scale single scale factor overload (contributed by @stc1988)
    • Typing for easing (contributed by @stc1988)
  • Examples
    • ECMA-419 blink and button examples report missing pin configuration
    • Color-Picker example manifest updated to include Commodetto explicitly #1303 (reported by @stc1988)
    • Wi-Fi examples updated to use new WiFi.Mode enumeration to improve readability
    • SomaFM app uses much less memory on station list screen, improving reliability

Contact Us

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

Moddable SDK 4.4

07 Feb 03:00
Compare
Choose a tag to compare

This release contains improvements to the Moddable SDK made between January 3, 2024 and February 1, 2024.

Highlights of this release include:

  • Moddable Display. Our latest hardware is also our most beautiful. Fully supported in this release.
  • Web Streams. Help explore the feasibility and potential of this powerful web standard on embedded devices.
  • OpenAI text-to-speech provides another high quality option that's easy to add to projects.
  • Bosch BME68x Visualizers for round displays (works in the simulator too). Learn how to use outline graphics to creatively visualize sensor data.
  • Many low-level improvements for nRF52 ports. The port that powers our ultra-low energy Moddable Four is more capable than ever.

New Hardware: Moddable recently launched the Moddable Display product line. Moddable Display is the beautiful way to bring your latest embedded JavaScript project from the workbench to the real world.

Documentation: All of the Moddable SDK documentation is available to read on moddable.com. We recently moved the site to a new hosting provider so browsing the documentation is fast.

Reminder: ESP-IDF v5.1.2 is now recommended for ESP32 development. Please see the January 2024 Release Notes for details on how to update.

Release Details

  • Moddable Display
    • Build build targets to support all Moddable Display products
    • Documentation
  • New Bosch BME68x Visualizers for sensor (temperature, humidity, pressure) on round display
    • Check out the video demo
    • Core host with four different visualizers implemented as mods
    • Great example of using outline rendering to build an advanced UI
    • See readme for details and build instructions
  • Experimental web streams implementation for embedded (!!)
    • Effort to study feasibility of standard web streams on embedded
    • Modified version of WHATWG reference implementation
    • Includes examples using fetch(), ECMA-419 Digital IO, and ECMA-419 touch sensor
    • Conformance verified at better than 99% using Web Platform Tests.
    • See the readme for more information
  • Modules
    • OpenAI text-to-speech support using streaming MP3 audio. (Contributed by @stc1988)
    • New AW3641 flash-light driver (with example). Works with M5Stack Core-S3. (contributed by @NW-Lab)
    • ls013b4dn04 display driver support for 180 degree rotation
      • Works with Moddable Four and Moddable Display 4
        • Jog dial adjusts direction based on screen rotation
        • Accelerometer adjusts direction based on screen rotation
    • structuredClone() fix for TypedArray under XS 14.3
    • Implement TextDecoder special case for invalid UTF-8 data on flush (for compatibility with Web Streams tests)
    • Streaming JSON parser
      • Major documentation update with cookbook and reference sections
      • Eliminated timezone dependency in unit tests
    • MQTT client
      • Keep-alive improvements to eliminate mistaken disconnects
      • Uses elapsed-time rather than time-of-date for keep-alive timeouts
    • Support TLS device certificates for Node-RED MCU Edition
  • ECMA-419
    • TCP socket on macOS no longer tries to look-up IP addresses using DNS. Fixes connection failures.
    • TLS socket now uses normative module specifier embedded:io/socket/tcp/tls
    • HTTP server (listener) example fix for missing request body (reported by @stc1988) #1298
    • MQTT client
      • Now accepts buffer for read() (in addition to number, as before)
      • Keep-alive improvements to eliminate mistaken disconnects
      • Uses elapsed-time rather than time-of-date for keep-alive timeouts
  • XS
    • xst (XS test tool)
      • Uses fdlibm for certain functions of the Math object to guarantee exact results across all platforms test (details). fdlibm is recommended, but not required, by ECMA-262.
      • Supports Fuzzilli on Linux builds (for cloud fuzzing!) (contributed by @raphdev)
      • On macOS and Windows now supports Memory and Undefined Behavior sanitizers (contributed by @raphdev)
    • Bug fixes for issues detected by fuzzing
      • Fix infinite loop in Regular Expression's with nested greedy quantifiers
      • Fix crash calling super() from within an arrow function
      • If SharedArrayBuffer allocation fails, there was a potential to crash on the next garbage collection. Fixed.
      • Consistent out-of-memory handling via fxAbort()
        • JavaScript parser previously threw exception
        • dtoa library previously ignored allocation failures
    • xsbug
      • Crash on surrogate pairs split across buffers fixed
      • REPL now ignores debugger statements, as it does other breaks
  • Devices
    • ESP32
      • Fix sample rate validation on ESP32 audio (reported by @stc1988) #1287
      • Fix audio build on Windows when using ESP32 analog audio (reported by @NW-Lab) #1275
      • Configure output slot for I2S audio on ESP32 (contributed by @stc1988) Fixes #1236
    • nRF52
      • Support for Serial 7E1 and 7O1 modes
      • Optional pull-up on receive pin for serial
      • Supports multiple devices on the same I²C bus
      • Report address of mods flash partition from mcconfig using -t modLocation
      • Free SPI buffers on close()
      • Instrumented builds working again
    • Fix date to conversion for New Year's Day on ESP8266, nRF52, Raspberry Pi Pico, and QCA4020 (off by one error in modGmTime).
  • Tools
  • Documentation
    • Timer
      • Added details of this in callbacks
      • Detailed description of initial and repeat intervals
  • Examples
    • Timer example updated with schedule and unschedule
    • Moddable Four first-run app doesn't try to sleep in debug builds (deep sleep is unavailable in debug builds)
  • TypeScript
    • Typings for embedded:network modules (contributed by @tve)
    • Typings for Header and URL (contributed by @stc1988)

Contact Us

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

Moddable SDK 4.3.8

03 Jan 23:34
Compare
Choose a tag to compare

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. Call modSoftReset() 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 replaces sweeper (unused). Signature indicates the type of the dispatch table that follows.
      • Any fields following signature are defined by the object
      • Use xsGetHostHooks(), xsGetHostHooksIf(), or xsGetHostHooksValidate() 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() and ArrayBuffer.fromString() now correctly handle null characters (reported by @tve) #1271 (thanks to @Frida854 for reporting a problem in the initial implementation #1279)
  • Examples
  • 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

Moddable SDK 4.3.4

04 Dec 20:56
Compare
Choose a tag to compare

This release contains improvements to the Moddable SDK made between November 6, 2023 and November 30, 2023.

Highlights of this release include:

  • New animated Piu round-balls example for circular displays
  • New circular display simulator (WaveShare Pico RP2040)
  • Support for M5Dial and M5Stamp S3 devices
  • LittleFS now available on Raspberry Pi Pico

Release Details

  • Devices
    • ESP32 Family
      • Add support for M5Dial device (contributed by @stc1988)
      • Add support for M5Stamp S3 device (contributed by @stc1988)
      • Watchdog timer working again on ESP32 Family devices. Was temporarily broken by upgrade to ESP-IDF 5. (Contributed by @tve)
    • Raspberry Pi Pico
    • nRF52
  • Modules
    • ECMA-419
      • ECMA-419 Serial implementations all default the format to "buffer". This was previously "number" on some platforms. Tracks an update to ECMA-419. EcmaTC53/spec#41 (Reported by @HipsterBrown). Projects that rely on the default format being "number" need to be updated.
      • ECMA-419 HTTP Client consistently updates writable count to fix edge case write failures with TLS. (reported by @sburel)
      • ECMA-419 GT911 touch driver implements get configuration to allow Piu to use its interrupt
      • MQTT.js module implementation now uses URL module
      • ECMA-419 WebSocket module implementation now uses URL module
      • ESP32 family devices running a debug build now reserve the Serial transmit and receive pins used for debugging. If a script attempts to use these pins, it generates an exception. Inspired by report #1226 by @ralphwetzel.
    • ElevenLabs text-to-speech supports additional parameters (contributed by @stc1988)
  • XS
    • Fix typeof operator for host (native) functions to return "function"
    • Module loader now only calls resolve hook once for each unique module specifier in a Compartment
    • Module loader wasn't always decrementing loaded module count, leading to preposterous loaded module count
    • Fix crash in XS debugging support when launching a second time (very rare).
  • Examples
    • New Piu round-balls example for circular displays -- balls bounce of the edges of a circle
    • Fix capitalization of GIF and QRCode paths in Moddable Four First run app to build on case-sensitive file systems
    • httpserverputfile example now uses config.file.root for portability. (Reported by @kallistisoft) #1246
    • Giphy app only opens Flash module instance once. This allows it to work on ESP-IDF 5 which no longer supports memory mapping the same region multiple times. (reported by @stc1988) #1258.
  • Instrumentation
    • Fix instrumentation memory leak when root VM allocated more than once
    • Instrument additional cases of floating point math in add, subtract, and multiply
  • Tools
    • mcrun supports -t build option to build mod without deploying or running
    • New "WaveShare Pico RP2040" device simulator provides round screen (for use with piu/round-balls example)
    • ESP32 makefile on macOS & Linux supports experimental -t buildArchive to build the archive with Moddable SDK objects but not build and link the ESP-IDF host (for specialized scenarios like building the Moddable SDK into an ESP-IDF application)
    • XS Linker fixes #1209 again ("0" and "@" confusion). This original fix was broken when fixing #1232. Both #1209 and #1232 are now fixed. Thanks to @linfan68 for re-reporting.
  • Tests
    • Add warning if Resource slice test on fails on Windows because Moddable SDK was checked out with Windows line endings instead of Unix line endings
  • Documentation