Skip to content

Releases: Moddable-OpenSource/moddable

December 16, 2020

16 Dec 23:28

Choose a tag to compare

  • XS JavaScript engine

    • XS hosts for computers, ESP8266, and ESP32 now ignore .js and .mjs extensions when resolving modules. This capability is provided to ease use of JavaScript source code originally written for, or shared with, the web platform. It is not recommended for code intended only for use with the Moddable SDK. (requested by @dckc, @wmhilton, and a cast of thousands)
    • Fixes to optional chain call. While the implementation successfully passed test262, in some cases it left the stack in an incorrect state. Now you can safely write this.close?.()
    • Much larger stack in XS linker when preloading
    • Note: To use these XS changes, your need to update, rebuild Moddable SDK tools, and perform a clean build of your project. Details on how to do that are in the Update sections of the Getting Started guide for macOS, Windows, and Linux.
  • TypeScript support

    • Improvements to built-in type declarations, including the handful of XS extensions to the built-ins
    • Fix bug when building TypeScript source files stored in sub-directories (reported by @ariznaf)
  • BLE

    • Add SM.deleteBonding() API and associated onBondingDeleted() callback to delete a single bonded peer
    • Pass address and address type to client/server onDisconnected() callbacks
    • Pass bonded status to server onAuthenticated() callback
    • BLE keyboard example enhancements and fixes: generate callbacks for key down / up, fix caps lock handling, freeze instances for preload, and report arrow keys by name.
  • Documentation

  • ECMAScript Modules for Embedded Systems

  • Simulators

    • Simulated Wi-Fi connection for simulator (thanks to @wilberforce for some help)
    • ZIP module now builds on Windows simulator
    • Fix build of simulator on Linux for Raspberry Pi (reported by @natevw)
  • Enhancements

    • Add message constants to Socket
    • Add get battery voltage and current to AXP192 driver (by @stc1988)
    • Add Deflate implementation using miniz. Works in simulator but requires too much memory for most MCUs. Renamed Inflate directory to zlib.
    • Commodetto and Piu now use the Unicode horizontal ellipsis character when truncating text if available in the font. If not, they fall back to three consecutive periods. Good typography matters.
    • Moddable office window display animation app added to contributed directory. Details in blog post by Lizzie Prader.
    • bles2gatt tool now reports details of JSON parse errors in service descriptions and absence of some required elements
    • Updated tools documentation to expand on using command line arguments to mcconfig to add to the config #509 (suggested by @dckc)
  • Fixes

    • Fix remote socket disconnect failure on lwip socket implementation #503 (reported by @mlnuaa)
    • Don't double count HTTP client received bytes when using a callback to receive fragments #516 (reported by @wilberforce)
    • serial2xsbug now sets the correct timezone when running on Windows #502 (thanks to @wilberforce for help in tracking this down)
    • Instrumentation works again for Web Workers
    • Fix timers to be safe with Web Workers on QCA4020
    • Fix bug in Preference compaction on ESP8266
    • Fix ResourceIterator compilation on ESP8266
    • mcconfig and mcrun manifests now allow multiple path levels in directory targets on Windows too (reported by @ariznaf)

November 27, 2020

28 Nov 07:44

Choose a tag to compare

  • BLE
    • Add addressType to Client and Connection constructor dictionaries
    • Add getter for appearance on advertising data
    • Implement support for bonding on HID devices (mouse and keyboard)
  • Added Resource Iterator as optional patch to Resource module (original request by @wilberforce in #429). To use it, add $(MODDABLE)/modules/files/resourceiterator/manifest.json to include section of your project manifest, then Resource may be used as an iterator. If a mod (archive) is installed, its resources are also returned by the iterator.
import Resource from "Resource"

for (let name of Resource)
	trace(name + "\n");
  • Poco JavaScript API now has close method to release resources immediately, rather than waiting for garbage collector
  • Piu uses an iterative algorithm when marking fonts during garbage collection to reduce worst-case depth of native stack.
  • Wi-Fi scanner on ESP32 has option for passive scan (set active to false in dictionary passed to constructor)
  • Experimental ESP32 support for networking when both station and access point interfaces are active. Clients and servers work as well as mDNS.
  • Fix time calculations in RTC module #498 (reported by @stc1988, fixed by @wilberforce)
  • Add global require function to REPL to allow synchronous import of modules. (requested by @cmidgley)
  • Examples
    • Fixes to webConfigWifi example to eliminate simultaneous connection attempts
    • Wi-Fi continuous scan module example updated to latest API (target parameter removed from callbacks)
  • Tools and build
    • Set baud rate of xsbug connection for mcrun so it works with M5 products that don't use the default baud rate. (from @wilberforce)
    • mcconfig and mcrun manifests now allow multiple path levels in directory targets (requested by @ariznaf)
    • Moddable SDK builds on Raspberry Pi without any patches (thanks to @jins-tkomoda and @diogoviannaaraujo)
    • Moddable SDK on macOS Big Sur works with ESP32 and ESP8266. Getting Started documentation updated.
    • xsbug and mcsim now set the Retina flag for better rendering quality on high resolution displays (suggested by @tbdr)
    • Improved bezel image for 240x240 screens in simulator (from @sveniv)
  • modClock Project
    • Fix build problems
    • Reconnect after disconnect
    • Rework logic for entering and exiting access point mode
    • Static probe method added to RTC modules to eliminate exceptions on start-up when scanning for RTC
    • Sort Wi-Fi access point list
    • Set character encoding of HTML pages to UTF-8 so access points with non-ASCII characters display correctly

November 16, 2020

16 Nov 22:56

Choose a tag to compare

  • Crashes in the XS JavaScript engine fixed - #483, #484, and #485. This included a crash calling RegExp.prototype.toString with a proxy that returns numbers for source and flags. (reported by @kvenux)
  • Experimental metering feature in XS to allow a host to restrict the number of byte-codes executed. Not ready for general use.
  • Added low-level hook to Poco renderer to support custom drawing extensions.
  • Work underway to move all desktop simulators from the venerable screen test to mcsim to allow for more complete simulation. The new simulator is only used when the target platform begins with sim/. This work is still experimental and not ready for general use.
  • Turn Wi-Fi off at start-up on ESP8266 because some boards ship with flash preferences that enable it unexpectedly.
  • Improvements to the BLE mouse example - hit test order, mouse up handling, and rapid double clicks
  • BLE HID (Human Interface Device) module optimization to accelerate initial device connection.
  • BLE simplifications for remembering native objects (eliminates a build warning)
  • Piu sound example now includes M5Stack and M5Stack Core2 on the safe list (reported by @stc1988)
  • M5Stack now uses M5Button class for debouncing, like other M5 products. (from @stc1988)
  • serial2xsbug does a simple validation of the archive file to avoid installing corrupt mod. (based on report by @ariznaf)
  • mcrun on Windows now uses release tools like macOS and Linux
  • Fix deprecation warning for openFile in Piu PC on macOS Big Sur
  • Added support for 240x240 OLED displays using ST7789. (from @sveniv)
  • Support all four SPI modes in modSPI for ESP8266, ESP32, SiLabs Gecko, and Qualcomm QCA4020. (from @sveniv)
  • ILI9341 display driver supports configuring the SPI mode. (from @sveniv)
  • Add 240x240 display size to simulator (from @sveniv)

October 30, 2020

31 Oct 00:14

Choose a tag to compare

October 30, 2020

  • Instances of Digital now have a close method
  • In instances of TypedArray (Uint8Array, Float32Array, etc) an internal slot was visible to scripts. This was generally harmless but caused problems in certain circumstances. Fixes #479 and #480 (reported by @dckc)
  • Faster ESP32 builds on Windows by avoiding unnecessary time stamp change to sdkconfig.h
  • On Windows, detect invalid MODDABLE environment variable. Provides early error for #471 (reported by @thomasqbrady)
  • Fix for screen initialization on certain revisions M5Stack models (from @meganetaaan)
  • M5 device targets that support audio finish play the start-up sound before running the app. Fixes #482 (reported by @stc1988)
  • Add driver for BM8563 real time clock. Use in second generation M5 Stick C device target. (from @wilberforce)
  • AudioOut instances no longer are automatically garbage collected; they must be explicitly closed
  • NFNT font engine now uses the offset (from width offset table) when calculating horizontal position
  • New build targets in the simulator for Moddable One, Moddable Two, and Moddable Three. The devices support rotation.
> mcconfig -d -m -p sim/moddable_one
> mcconfig -d -m -p sim/moddable_two
> mcconfig -d -m -p sim/moddable_three
> mcconfig -d -m -p sim/moddable_three -r 90

Moddable Three Moddable Three rotated

October 20, 2020

20 Oct 21:42

Choose a tag to compare

This most significant change in this release is a fix to JSON parsing. The XS JavaScript engine has always been lenient in parsing for convenience, accepting trailing commas that are prohibited by the JSON specification. Here's an example, where the comma after "./main", ], and } are all disallowed in JSON (though allowed in JavaScript code):

{
	"include": "$(MODDABLE)/examples/manifest_base.json",
	"modules": {
		"*": [
			"./main",
		],
	},
}

With this release, XS fully conforms to the JSON specification, rejecting trailing commas. If your project manifests included trailing commas, you will now encounter parsing errors when building your project with mcconfig.

Note: This update to XS is backwards compatible with the byte-code from the October 14, 2020 release. Therefore, you do not have to rebuild the Moddable SDK tools, though it is recommended.

  • XS JavaScript engine fully conforms to JSON parsing requirements
  • All JSON files (about 300!) in the Moddable SDK have been updated to eliminate trailing commas #476 (reported by @erights)
  • mcconfig and mcrun now report manifest parsing errors with the file name and line number. Previously this only worked with debug builds of the tools.
  • Add $USERHOME environment variable to mcconfig which maps to $HOME on macOS and Linux, and $USERPROFILE on Windows. This is used to access some device specific build resources.
  • Fix build of servo module on Windows by using $USERPROFILE
  • Replace stray comma with semicolon in piu/bars example. Fixes #475 (reported by @stc1988)
  • Fix for display brightness control on all versions of M5Stick-C hardware #474 (from @wilberforce).
  • 16 color (4-bit palette color) displays work again in simulator and ESP8266. Works for the first time on ESP32. #477 (reported by @stc1988)
  • Added I2S to the Windows ESP8266 build to allow audio examples to build

October 14, 2020

14 Oct 22:34

Choose a tag to compare

This release is primarily an update to the XS JavaScript engine.

  • New optimization added to XS Linker to improve performance of property look-up for objects preloaded in flash/ROM. The performance gain is up to 18%, depending on a variety of factors. The optimization is based on graph coloring. See the ROM Colors document for details.
  • New XS byte code for for strings larger than 64 KB (found during work with @Agoric)
  • XS fix for "Object rest incorrectly accepts complex assignment targets" #155 (reported by @bakkot)
  • XS fix for "Eval preventing const declaration in the caller scope" #64 (reported by @tevador)
  • XS fix for "Object rest incorrectly accepts complex assignment targets" #155 (reported by @bakkot)
  • XS fix for "XS allows trailing comma in Expressions" #315 (reported by @jugglinmike)
  • XS fix for "async function: silent swallowing of the 'override mistake'" #322 (reported by @michaelfig) and "XS does not apply runtime strict mode restrictions to async functions" #334 (reported by @jugglinmike). These two reports are both symptoms of the same bug: an async function body ran in sloppy mode! Great find.

Note: The changes to the XS JavaScript engine are not backwards compatible with precompiled byte code. After updating, be sure to clear the contents of $MODDABLE/build/bin and $MODDABLE/build/tmp, and then rebuild tools. See Moddable SDK - Keeping Up To Date for details.

Note:: The xst binaries used by jsvu have been updated to this release of XS (10.4.0).

Other changes:

  • Project manifests for mods may now specify the rotation and pixel format, just like manifests for hosts
  • Correct time passed to Piu touch events (introduced in recent scheduling changes to Piu)

October 12, 2020

12 Oct 23:51

Choose a tag to compare

October 12, 2020

  • Timer class allows a timer to be unscheduled without being cleared as an optimization to avoid frequently allocating/deallocating a timer. To unschedule a timer, call Timer.schedule with only the id argument:
let t = Timer.repeat(() => trace("tick\n"), 1000);
t.schedule(t);
  • Piu unschedules internal idle timer when not needed by current UI content.
  • Fix ESP32 audio to play if first sound is queued after playback begins. This fixes Piu Sound playback failure reported by @meganetaaan
  • Backlight control is working on Moddable Two in all cases again
  • XS JavaScript engine partial fix for "Object rest incorrectly accepts complex assignment targets" #155 (reported by @bakkot)
  • Projects running on touch devices that do not use touch input can disable the touch driver entirely by setting touchCount to 0 in the config section of the manifest
  • Remove JavaScript module API interface to instrumentation from the base manifest. Most projects do not use it and removing it reduces the binary by several hundred bytes. Projects may still include the module directly. (The Instruments pane in xsbug is unchanged.)
  • Remove accents from Piu text example

October 6, 2020

06 Oct 21:38

Choose a tag to compare

  • mcrun uses correct path separator ("/", not "\") when building on Windows for ESP8266 and ESP32 targets (reported by @LongNguyen1984)
  • mDNS catches exceptions on UDP write to avoid reboot on unhandled exception when network disconnects
  • preferences on ESP32 doesn't orphan open NVS instance if invalid key passed

October 5, 2020

06 Oct 03:41

Choose a tag to compare

September 30, 2020

06 Oct 04:00

Choose a tag to compare

  • Add NodeMCU build device targets for ESP8266 and ESP32 (esp/nodemcu and esp32/nodemcu)
  • Add Button and LED classes following the TC53 IO Peripheral Class Pattern
  • Use Button and LED in classes in hosts for Moddable One, Moddable Two, Moddable Three, ESP8266 NodeMCU, and ESP32 NodeMCU.
new Host.Button.Default({
   onPush(down) {
      trace(`Button pushed: ${down}\n`);
   },
})
const led = new Host.LED.Default;
led.on();
led.off();
led.write(1);
  • Update Commodetto mini-drag example for FT6202 capacitive touch driver compatibility #465 (reported by @basuke)
  • mcrun fixes for Windows host
  • Piu example to control Moddable Two display backlight (by @lprader)
  • XS JavaScript engine fixes for #452 and #453 (reported by @kvenux)
  • ESP32 builds that do not use Wi-Fi are smaller (about 200 KB) by using esp_efuse_mac_get_default in the debugger communication to report the device ID
  • Option to set lwip hostname on ESP32 #470 (requested by @ederle)