Skip to content

Moddable SDK 6.0

Latest

Choose a tag to compare

@mkellner mkellner released this 08 Nov 00:26

Moddable SDK 6.0 contains improvements made between October 2, 2025 and November 7, 2025.

New Native API

We've added a new way to bind native C functions to JavaScript. Unlike its predecessor, the new Native API uses 100% standard JavaScript, making it friendly for tools in the JavaScript ecosystem, including TypeScript, ESLint, and LLM-based AI agents. The intent of the code is now more clear to humans as well.

We're excited about this change and have already updated a significant portion of the Moddable SDK to use it. To learn about the benefits and motivation, read our blog post. For technical details, check out the latest XS in C documentation.

Piu Memory Optimization

We've made an optimization to our Piu user interface framework that saves 28 bytes per object on microcontrollers. For a product with dozens or even hundreds of objects, the savings are significant.

What did we change? A powerful feature of Piu is that every UI object can be a timer. This simplifies the code because many behaviors in a UI require a timer. Prior to this optimization, each Piu object reserved storage for the timer. With the optimization in place, Piu now only allocates memory for the timer for objects that need it.

No changes are necessary to your code to benefit from this optimization. If you've written any native extensions to Piu, their initialization will require a small update to work properly.

As part of the timer changes, we've also reduced the memory used by the name property of objects. While name isn't widely used, every byte matters.

ESLint Support

Linters are a valuable tool for detecting common mistakes in code. ESLint is one of the best linters for JavaScript. With our new Native API, it is possible to run ESLint against the majority of the JavaScript code in the Moddable SDK.

The default configuration of ESLint is designed for web developers. Embedded JavaScript developers have somewhat different needs. We've run ESLint against many modules and examples in the Moddable to create an ESLint configuration that is well-suited for Embedded JavaScript.

After installing ESLint, you can lint the contents of any directory in the Moddable SDK.

cd $MODDABLE/examples/helloworld
eslint

We used ESLint to detect a healthy collection of minor issues in our examples and modules. Corrections for all those have been included in this release.

TypeScript Refresh

This release includes a major refresh of our TypeScript declarations for the modules in the Moddable SDK. We've updated to the latest TypeScript features and conventions, updated APIs, and corrected mistakes. There are significant improvements to type declarations for Piu.

We've also added new TypeScript declarations for many modules:

  • ResourceIterator
  • Commodetto static extension
  • Commodetto colorcell extension
  • commodetto/loadJPEG
  • commodetto/ReadGIF
  • commodetto/readStream
  • commodetto/BufferOut
  • commodetto/Convert
  • commodetto/ReadPNG
  • piu/QRCode
  • deflate
  • inflate

There are also TypeScript declarations for the native() and Native() global functions in our new Native API.

At this point, just about all of the Piu and Commodetto examples can run under TypeScript with minimal changes to accommodate TypeScript. That was not the case before.

Our TypeScript declarations are valuable for developers and for AI agents. We will continue to improve them for the benefit of both.

The Moddable SDK typings are included in our repository. They are also available as an NPM package to install in your project:

npm install @moddable/typings

As a quick reminder, working with TypeScript in the Moddable SDK is a simple two-step process.

  1. Install TypeScript

  2. Include $MODDABLE/examples/manifest_typings.json in your project's manifest.json.

    	"include": [
    		"$(MODDABLE)/examples/manifest_base.json",
    		"$(MODDABLE)/examples/manifest_typings.json"
    	]

Zephyr RTOS Port Advances

Since the launch of our Zephyr RTOS port last month, we've been working hard to port more features. We've updated our Zephyr branch as part of this release. This is what you'll find there:

  • Wi-Fi
  • Network sockets – UDP, TCP, Listener
  • File System
  • BLE Client
  • Real-Time Clock
  • NTP Client (network time)
  • Espressif ESP32 support
  • Bug fixes

Wi-Fi and NTP are the first implementations we've done of these APIs from the ECMA‑419 Standard. We'll bring these to other platforms in the future.

What's particularly great is that once we bring up the portability layer, our JavaScript libraries run unchanged. For example, now that network sockets are available, we've verified that our DNS Client, HTTP Client, HTTP Server, and MQTT Client all work on Zephyr.

For all the details, check out our article "Moddable SDK on Zephyr RTOS Advancing Quickly with Networking, BLE, and More Storage".

Release Details

Note that these notes do not include the features already described above.

  • Tools
    • ESP32 installation reliability improvements on Linux (reported by @mshioji)
  • Modules
    • Worker
      • Option to set thread priority and CPU core affinity on FreeRTOS targets (ESP32). Contributed by @rmontrose.
  • ECMA-419
    • mDNS renamed to DNSSD
    • Fetch fix when no headers to send
  • XS
    • Linker's strip now eliminates Proxy getter and setter when Proxy is unused
  • Devices
    • ESP32 devices using TinyUSB for debugging again build and run #1542
  • Examples
    • New example shows using subclass work with Worker Contributed by @rmontrose.
    • Replace global with preferred globalThis
  • Documentation
    • Add xsReference and xsToReference to XS in C
    • Document new Native API in XS in C
    • Correct Piu easing equation argument documentation

Contact Us

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