JavaScript Icon

JavaScript

Tracking all things JavaScript
934 Stories
All Topics

Sean DuBois webrtcforthecurious.com

WebRTC for the Curious 📘

A new CC0 book about WebRTC by Sean DuBois (and friends). Sean recently shared his love for and deep knowledge about the technology on our Go Time podcast.

This book was created by WebRTC implementers to share their hard-earned knowledge with the world. WebRTC for the curious is an Open Source book written for those that are always looking for more. This book doesn’t settle for abstraction.

This book is all about protocols and APIs, and will not be talking about any software in particular. We attempt to summarize RFCs and get all undocumented knowledge into one place. This is book is not a tutorial, and will not contain much code.

This is very much a WIP, but there’s a fair bit ready for consumption and the authors are actively collaborating in the GitHub repo.

TypeScript github.com

Airbnb's tool for helping migrate code to TypeScript

ts-migrate is a tool for helping migrate code to TypeScript. It takes a JavaScript, or a partial TypeScript, project in and gives a compiling TypeScript project out.

ts-migrate is intended to accelerate the TypeScript migration process. The resulting code will pass the build, but a followup is required to improve type safety. There will be lots of // @ts-expect-error, and any that will need to be fixed over time. In general, it is a lot nicer than starting from scratch.

ts-migrate is designed as a set of plugins so that it can be pretty customizable for different use-cases. Potentially, more plugins can be added for addressing things like improvements of type quality or libraries-related things (like prop-types in React).

JavaScript github.com

A tiny JS library for keybindings

Yes, you can do keybindings directly. But for a mere ~400 bytes you can do keybindings like this instead:

import tinykeys from "tinykeys"

tinykeys(window, {
  "Shift+D": () => {
    alert("The 'Shift' and 'd' keys were pressed at the same time")
  },
  "y e e t": () => {
    alert("The keys 'y', 'e', 'e', and 't' were pressed in order")
  },
  "$mod+KeyD": () => {
    alert("Either 'Control+d' or 'Meta+d' were pressed")
  },
})

Apple github.com

A virtual Apple Macintosh with System 8 (running in Electron)

First things first… does it actually work?!

Yes! Quite well, actually - on macOS, Windows, and Linux. Bear in mind that this is written entirely in JavaScript, so please adjust your expectations. The virtual machine is emulating a 1991 Macintosh Quadra 900 with a Motorola CPU, which Apple used before switching to IBM’s PowerPC architecture in the late 1990s.

Ok, cool. Does it run my favorite game?!

The short answer is “Yes”. In fact, you’ll find various games and demos preinstalled, thanks to an old MacWorld Demo CD from 1997. Namely, Oregon Trail, Duke Nukem 3D, Civilization II, Alley 19 Bowling, Damage Incorporated, and Dungeons & Dragons.

There are also various apps and trials preinstalled, including Photoshop 3, Premiere 4, Illustrator 5.5, StuffIt Expander, the Apple Web Page Construction Kit, and more.

A virtual Apple Macintosh with System 8 (running in Electron)

Node.js github.com

A lightweight and powerful wiki app built on Node

I’m not sure what makes this lightweight (their word, not mine), but it does load pretty fast from where I’m accessing it. I definitely see what they mean by powerful, though, as wiki.js boasts many features: multiple editors, multiple auth schemes, search functions, comments, multiple locales, the list goes on…

The demo is worth a thousand words.

JS Party JS Party #136

Deep in the WebRTC deep end

Jerod assembles a team of WebRTC experts (Suz, Feross, Mikeal) for a deep, deep dive on this practically-ubiquitous yet still-complicated web API.

We review its history, share really cool applications using the tech, provide an excellent primer on what you need to know about it, and details some production gotchas. ALSO we celebrate how Feross single-handedly “upgraded the internet”! 🙌

JS Party JS Party #135

Where the Prolog version of Vue died

An amalgam of interest on this week’s episode starting with a peek at what’s finally coming in Vue 3. We talk about the process of change in the Vue ecosystem and what interesting features are coming either very soon or not for a while depending on how you view time right now. Then, the panelists share what they’ve learned recently, and finish off with shout outs to the projects, ideas, and people we’re appreciative of.

Antoni Kepinski DEV.to

How to embed a Changelog podcast player into a React app

Antoni Kepinski, who was a guest of ours on JS Party #85:

I wrote a short tutorial on how to embed Changelog’s podcast player into a React application so that it doesn’t affect the performance and accessibility of the site.

While I do understand that Changelog isn’t interested in How-to's and tutorials, I feel like this one can be an exception, as it is related directly to Changelog and its podcasts ;)

Antoni is correct! How-to’s and tutorials aren’t something we share often. It’s not that they aren’t useful, it’s just that they aren’t really news and they are rarely noteworthy. But I’ll make an exception this time. 😉

JavaScript github.com

A JS library for building regular expressions in (almost) natural language

I’ve seen tools like this one before, but every time I do I still pass them around because regular expressions are powerful but also quite unapproachable. With this library, you can chain together function calls describing how you think about a rule and it’ll generate the expression for you. Example!

const SuperExpressive = require('super-expressive');

const myRegex = SuperExpressive()
  .startOfInput
  .optional.string('0x')
  .capture
    .exactly(4).anyOf
      .range('A', 'F')
      .range('a', 'f')
      .range('0', '9')
    .end()
  .end()
  .endOfInput
  .toRegex();

// Produces the following regular expression:
/^(?:0x)?([A-Fa-f0-9]{4})$/

That matches and captures the value of a 16-bit hexadecmal number like 0xC0D3. Assuming this library generates clean, somewhat optimal expressions (which might be a big assumption), it’s a great way to learn how to write your own expressions over time.

JavaScript hyperapp.dev

Hyperapp – the tiny framework for building web interfaces

Hyperapp claims to be twice as fast as React, weighs in at 1.8KB, and renders interactively in ~10ms.

Hyperapp is a modern VDOM engine, state management solution, and application design pattern all-in-one. once you learn to use it, there’ll be no end to what you can do.

Filed under: zero-minutes-since-last-frontend-framework

Node.js github.com

An extremely fast and lightweight test runner for Node and the browser

uvu has minimal dependencies and supports both async/await style tests and ES modules, but it’s not immediately clear to me why it benchmarks so well against the likes of Jest and Mocha.

~> "jest"  took  1,630ms  (861  ms)
~> "mocha" took    215ms  (  3  ms)
~> "tape"  took    132ms  (  ???  )
~> "uvu"   took     74ms  (  1.4ms)

The benchmark suites are pretty basic, so it’d be cool to see a “production” grade library or application port their test suite to uvu for comparison.

Matteo mailgo.dev

mailgo makes `mailto` and `tel` links more useful

Instead of only triggering the default email or phone apps when selecting a mailto or tel link on your website, “mailgo” provides a modal with more options such as “Open in Gmail”, “Open in Outlook”, etc.

This will extra functionality will be less important on mobile now that Apple is letting us change our default clients in iOS 14 (so that the default app would already be set to Gmail, for example), but you may find it helpful for your users anyhow. 4.96 KB cheap.

0:00 / 0:00