ES.nextNews: the latest in JavaScript and cross-platform tools
Curated by Dr. Axel Rauschmayer and Johannes Weber. News

The latest in JavaScript and cross-platform tools

Prettier 2.7: new --cache CLI option and TypeScript 4.7 syntax, @PrettierCode
Highlights – quoting the blog post:
  • This release includes a new --cache CLI option. Enabling this option will use some attributes as cache keys and format files only if they have changed. This could dramatically improve CLI performance.
  • We’ve also added support for formatting TypeScript 4.7 syntax!

Deno 1.23: no type-checking by default (deno run, deno eval, deno cache) and more, @davidsherret, github/ry, @kt3k, @satyarohith_, @deno_land
  • No type-checking by default in deno run, deno eval, and deno cache
  • File watcher watches dynamic imports
  • Updates to deno task
  • Updates to deno fmt
  • deno info supports --config and --no-config flags
  • REPL: Use Ctrl-S to insert newlines into your input
  • SIGINT and SIGBREAK signal listening support on Windows
  • Support for "deflate-raw" in CompressionStream and DecompressionStream
  • TypeScript 4.7
  • Changes to flags standard module (which parses command line arguments)
  • Changes to assertThrows and assertRejects

Add 90+ code assists and refactorings to Visual Studio Code Sponsor
Refactor JavaScript, TypeScript, React and Vue.js code. With the P42 JavaScript Assistant.

Using web streams on Node.js
Web streams are a new standard that works on browsers, Node.js and Deno. For example, the Response returned by fetch() has a property .body with a web stream.

The blog post is a tutorial for using web streams with many code examples. It focuses on Node.js but most of the content also applies to other platforms.

The JavaScript block statement
Nested block statements enable you to reuse variable names. Which can be helpful – e.g. in tests and in consoles:
function test() {
  const type = 'some';
    const thing = getThing(type, 1);
    assert.equal(thing, 1);
    const thing = getThing(type, 2);
    assert.equal(thing, 2);

Use esm-import-transformer for “isomorphic-ish” ECMAScript modules
The utility esm-import-transformer lets you search and replace module specifiers in JavaScript source code. One use case is to translate code for Node.js to code that works on browsers:
// Before
import {html, css, LitElement} from "lit";
// After
import {html, css, LitElement} from "";

Looking for deeply qualified employees or customers? Advertise on News! News reaches over 14,000 highly skilled and motivated developers. We take their trust seriously and have high editorial standards.
Check out our media data and get directly in touch with us.
Follow on Twitter

This email was sent to {{ email | default }}. Want to change how you receive these emails?
You can unsubscribe from this list