The Deno team recently released Deno 1.10, which supports sharing WASM memory, implementing Web Storage apis, remotely importing maps, improving built-in test runners, and more.

Deno 1.10 now supports WebAssembly atomics and shared memory, following the path of Chrome and Firefox, which enable previous functionality by default.

const memory = new WebAssembly.Memory({
  initial: 1,
  maximum: 10,
  // enables atomics and allows for shared array buffers as WASM memory the backing store
  shared: true,
});
console.assert(memory.buffer instanceof SharedArrayBuffer);

Copy the code

The new Deno version also supports the browser’s Web storage API. The Network storage API provides a mechanism to replace cookies, allowing persistence of a small number of key/value pairs (up to 5MB in local storage). These mechanisms are available in the browser via the window.sessionStorage and window.localStorage properties. In Deno, localStorage and sessionStorage can be used directly without permission, as shown below.

// kv.ts const key = Deno.args[0]; if (key === undefined) { // if user passes no args, display number of entries console.log(localStorage.length); } else { const value = Deno.args[1]; if (value === undefined) { // if no value is specified, return value of the key console.log(localStorage.getItem(key)); } else { // if value is specifed, set the value localStorage.setItem(key, value); }}Copy the code

The storage is typed from the origin (–location option). The following is an execution of the previous script, showing how the data persists during the call.

$ deno run --location https://example.com ./kv.ts 0 $ deno run --location https://example.com ./kv.ts foo bar $ deno run  --location https://example.com ./kv.ts foo bar $ deno run --location https://example.com ./kv.ts 1Copy the code

Deno 1.10 allows developers to access imported maps remotely.

$ deno install --import-map=https://example.com/import_map.json -n example https://example.com/mod.ts
Copy the code

Import maps, recently added in Chrome 89, specify which urls are retrieved by JavaScriptimport statements and import() expressions (for example, import moment from “moment”). Therefore, import maps allow you to remap imports without modifying the source code.

Deno’s built-in test runner also has significant improvements. While tests continue to run in serial mode by default, developers can use the — Jobs option to specify the number of concurrent threads to run tests. Test modules run in isolation, with each module having a new runtime instance. Deno.test, which also supports specifying test case permissions to observe file changes associated with test cases (–watch option).

Deno users can upgrade by running Deno Upgrade on a terminal. Deno 1.10 includes additional features, bug fixes, and performance improvements. Developers are encouraged to view a full list and description of the new features and stable apis.

Deno is open source software licensed by MIT. Contributions are encouraged through the Deno project and should follow the Deno contribution Guidelines.