Skip to content

0.5.1

Choose a tag to compare

@JanMiksovsky JanMiksovsky released this 26 Aug 23:58
· 999 commits to main since this release

Removal of deprecated features

This release includes a significant version bump (0.4 to 0.5) to signal that some previously deprecated features have been removed.

If you have an Origami project that was using Origami 0.3.x or earlier, you should first upgrade it to a 0.4 release (like 0.4.2) first, and then follow the instructions for upgrading. The 0.4 releases show warnings for deprecated features, making it easier to find and update them. Only after your project successfully builds with a 0.4 release should you upgrade to 0.5.

The most significant change is that Origami no longer makes the entire set of Origami builtin functions available as globals. Instead, all builtins are grouped into a small number of top-level namespaces. Example: the map builtin is now only available as Tree.map. The former map short form was deprecated in 0.4 but still worked; in 0.5 map on its own no longer works; you must call Tree.map.

This change greatly reduces the numbers of globals, which in turn reduces the potential that a name you pick will conflict with a global. In particular, if you start names with lowercase letters, there is only a short list of possible conflicts; see Name conflicts for the complete list.

Dropped support for Unicode ellipsis character for spreads

Origami previously allowed the single … Unicode ellipsis as an alternative to ... three separate period characters in array and object spreads. For greater consistency with JavaScript, three separate periods are now required for a spread. The use of the single ellipsis character will now show a deprecation warning.

Some support for JavaScript static methods

It is now possible to call static methods on JavaScript classes, e.g., Date.now() didn't work in 0.4 but now works in 0.5.

However, Origami still invokes those methods with a this target that the target method may not be expecting. Certain JavaScript classes like Promise.all will still complain if you use a static method. There's a plan to fix that but it will take some time.

Other

  • A new method, Origami.fetch, has been introduced to expose Origami's URL fetch behavior. Previously this was offered as the global fetch method, but that global will now return the standard JavaScript fetch method. This lets you decide whether you want Origami's behavior with Origami.fetch or the completely standard behavior with plain fetch.
  • A new method, Tree.deepText, returns the concatenated text of a tree.
  • This release also includes some bug fixes.