Skip to content

August contributions

September 7, 2024

This post is a little late thanks to me being stuck in the middle of a super typhoon, but here's some highlights of what the community has been up to in August!

If you want to get involved, remember to come join the discussion!

Libraries

Here are just some of the great libraries we've seen this August.

tinyexec

tinyexec is a new library from the tinylibs group to provide a super lightweight abstraction around child_process.

Usage is familiar and simple:

ts
import { x } from 'tinyexec'

await x('npm', ['install'])

In many places where we need to launch a command, we don't need a high level abstraction so we can save a lot on performance and footprint by using this instead.

vitest, nuxt, astro, and many others have already moved over.

For places where we do want a higher level interface, we still have projects like zx.

tinyglobby / fdir

Much of the community has been hard at work moving projects away from various heavyweight glob libraries to fdir.

fdir is a very fast and lightweight library for traversing the file system and has optional glob support.

Already a great contributor in the e18e space, @superchupudev has also provided us with tinyglobby.

tinyglobby adds a useful layer on top of fdir for when you still need a glob interface and consistent behaviour with other glob libraries:

ts
import { glob } from 'tinyglobby'

const files = await glob(['src/*.ts'])

So many projects have been quick to adopt these libraries, saving on install size and getting great performance gains at the same time. To name a few:

Great work by both @thecodrr and @superchupudev here!

package-manager-detector

package-manager-detector is used to detect the local package manager (e.g. npm, pnpm, yarn, etc.)

Much lighter than other alternatives, this package has quickly been adopted by many projects across the ecosystem.

As an example, @benjaminmccann switched from preferred-pm (1MB) to package-manager-detector (28KB) in changesets and svelte-add recently. Great work 🙏

Thanks to @antfu7 and @userquin for building this!

tschema

tschema is a cool new library to generate JSON schema types by @lukeed05.

Super light and fast, this is another package quickly being adopted in the e18e space.

ts
import * as t from 'tschema'

const User = t.object({
  uid: t.integer()
})

knip

knip is a tool for detecting unused files and dependencies in your project. This has been incredibly useful and widely used across the e18e community already.

For example, mocha has already adopted this and cleaned up a huge amount of deep dependencies thanks to the efforts of @voxpelli.

Contributions / Improvements

As well as some cool new libraries, we've seen many great contributions to performance and clean up across the ecosystem.

dotenvx

The maintainers of dotenvx have been hard at work with @superchupudev to massively reduce the install size and depedency tree complexity.

Down from 142 dependencies to only 28 dependencies, this is a great achievement 🎉

changesets

The changesets project has been busy merging many e18e-focused improvements.

Just a quick look at the changelog, you can see many of our community have been working to reduce the dependency tree and increase performance.

Thanks to @bluwyoo, @benjaminmccann and @trivikram in particular for pushing this forward 🙏

picocolors

picocolors has been around a while already, but recently published a new version with support for bright variants of colours.

This has allowed many, many projects to migrate to it from other slower and larger libraries.

If you need terminal colors, this is the one to use.

If you're using node 20 or above, and don't need to support older runtimes, also check out styleText which is built in!

payload CMS

The payload CMS team have been doing some impressive work optimizing the install size and performance of their packages.

Some quick stats:

  • Before: 277MB, 603 packages
  • After: 54MB, 148 packages

To get an idea of the change, take a look at the npmgraph before and after.

postcss

The PostCSS maintainers improved postcss-mixins, with its size going from 1.3MB to 930KB, dropping ~15 dependencies. Great work by @sitnikcode and the team, continuing their long tradition of caring about the size of their user’s node_modules.

Get involved

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

There are still many gaps to fill with new libraries, many contributions to existing libraries to be had, and many performance gains to be achieved.

Released under the MIT License. (5d824b5b)