Skip to content

October contributions

November 4, 2024

October Contributions Cover Image

A few days late again because I was caught in another typhoon 😬, but here's the latest wins from the e18e community!

Libraries

picospinner & nanospinner

Two small but great additions, these CLI spinner libraries are here to replace heavier weight alternatives like ora.

picospinner was recently adopted into the tinylibs organisation, and is being lead by Pondwader.

nanospinner author @usmanyunusov has also recently joined the e18e community and is actively helping move things forward.

Both of these libraries are great alternatives and unblock a whole bunch of future migrations. Looking forward to see more!

empathic / fd-package-json

As part of the cleanup project, we needed an alternative package for finding the closest package.json. To fill the gap, fd-package-json was created and recently passed 800,000 downloads/week!

However, we still had many gaps where we wanted to traverse for other files and directories without having to pull in a heavy library.

This is where empathic comes in!

Another great library by @lukeed, this provides a bunch of useful utilities for dealing with paths and traversals.

This library can easily replace many of the find-up-like packages floating around the ecosystem:

ts
import * as find from 'empathic/find'

// Find closest "foobar.config.js" file
const file = find.up('foobar.config.js', { cwd })

Let the migrations begin!

nano-staged

Another one by @usmanyunusov, nano-staged is a tiny replacement for lint-staged.

Benchmarks show it is much faster, and comes in with a much smaller footprint (currently only 47kB, 1 dependency).

This is another easy migration we will soon be kicking off across the ecosystem 🚀

milliparsec

In the web server space, milliparsec has gained a huge amount of usage as a replacement for body-parser.

At only 11kB, this is much smaller than older alternatives, and much faster!

Excellent work by v1rtl on building this and actively working on feedback from the community ❤️

Contributions / Improvements

Storybook

The Storybook team has continued to pour effort into improving the performance and install footprint in collaboration with the e18e community, as we reported on last month.

The biggest win by far this month was migrating from express to polka, installing 69 fewer dependencies and decreasing the install size by 6 MB! 🎉 The effort was initially led by @43081j and driven home by Jeppe Reinhold of the Storybook core team.

The team has also been on a dependency-prebundling-spree to cleanup and tree-share dependencies across @storybook/builder-vite, @storybook/react and @storybook/addon-docs, removing a total of 77 dependencies.

To ensure none of these gains are lost in future, they also did some great work to add benchmarking to all new pull requests. This is a super nice idea for making sure we don't regress. Hopefully other projects can implement similar in the near future 🙏

ESLint plugins (and removing older Node support!)

A big win for the community this month - removing support for very old Node versions in a few popular ESLint plugins 🎉

For some time now, these plugins have been a source of considerable bloat for those of us who do not need to support such old engines. It is awesome to see the source projects finally dropping these polyfills in new major (breaking) versions.

Just a couple of plugins that are moving ahead on this:

None of these have been released yet but they are well on their way and are being supported by the maintainers.

Do note, the community lead alternatives will certainly live on as they drop even more opinionated dependencies and logic. If you want to reduce your install footprint and get some performance gains, check out the alternatives docs for them here:

strip-ansi

The community had a realisation recently that strip-ansi can be replaced very easily by the built-in stripVTControlCharacters!

Since then, Namchee, @ari_perkkio and others have contributed a whole raft of PRs migrating away from the library.

This was a great catch and has allowed us to drop the dependency in dozens of projects already.

If you're using Node 16.x and above, you can drop this one too!

Docusaurus

This one didn't originate from e18e but is still well worth a mention. Docusaurus is currently tackling a pretty huge project of improving build performance.

Great to see another large project taking a focus on performance 🙏

They have already shaved off minutes from their build times 🔥 very impressive work by @sebastienlorber and the team.

Other news

require(esm) in Node

@joyeecheung and others have recently been working hard on allowing Node to require(...) ES modules.

For example, this means the following code would now work:

ts
// chai 5.x is ESM only
const { expect } = require('chai')

Until now, many of us have been publishing "dual packages" - packages which contain both CommonJS and ES module syntax.

This is unfortunate since it means we're often shipping double our package size in order to support both systems.

With the ability to require ES modules, this will all change and we should be able to ship only ESM! 🎉

As part of this becoming available, the e18e community is preparing to help in a few ways:

  • Migrate projects pinned to older CJS versions of dependencies to their later, ESM-only versions
  • Migrate projects with a dual package setup to ESM-only
  • Migrate projects which have type: "module" but also have CJS exports to ESM-only

Huge reductions will happen once we are able to stop publishing dual packages. Big wins ahead!

If you want to help out with this, we're tracking the work on GitHub.

porffor passes 50% of ECMAScript tests

If you haven't seen it yet, check out porffor, a very cool experimental ahead-of-time JavaScript compiler/engine.

Built by @canadahonk (an active member of our community ❤️), porffor has the potential to become an extremely useful tool for producing much smaller and faster WASM binaries.

Instead of packaging a runtime alongside the code, porffor will compile down to native (which comes with huge performance gains).

Recently, the biggest win has been to see the engine pass 50% of the Test262 tests! Read more in Porffor passes 50% of Test262.

e18e on Bluesky

The e18e community now also has a profile on Bluesky: e18e.dev.

Give us a follow and we'll post updates on the cool stuff happening in the community! 🦋

Get involved

If you want to help out, join the discord. We'd love to have the help 🙏

Released under the MIT License. (1811b46d)