es-tooling / ecosystem-cleanup

A place to keep track of ongoing efforts to clean up the JS ecosystem
372 stars 2 forks source link

Investigation: is-number #17

Open 43081j opened 8 months ago

43081j commented 8 months ago

Just notes for how we can tackle this one.

Of course, typeof obj === 'number' will be fine for most consumers

there may be edge cases where this package is necessary, but most likely it belongs in edge cases rather than the common case.

Significant dependents

Highest impact chain

to-regex-range is the key here. The primary path is:

The first primary package we reach is braces, a package for bash-like brace expansion.

We can probably replace braces with brace-expansion.

Some significant consumers of braces are:

If we move these to use brace-expansion (or any other light alternative we can agree on), we will likely strip is-number from most of the common dependency trees.

mehulkar commented 6 months ago

I took a random stab at this today and replaced wireit's brace with brace-extension. The main thing that came up is wireit has a transitive dependency on micromatch (via @11ty/eleventy and fast-glob), and micromatch depends on braces, so braces is still in the tree

43081j commented 6 months ago

ultimately i wonder if we could have a fast-glob alternative thats faster and lighter, an issue for another time though

even if we still have braces in wireit's tree, we're making progress 👍

mehulkar commented 6 months ago

another fast-glob alternative could be fdir (discovered here: https://github.com/11ty/eleventy/issues/3167) or the upcoming fs.glob native API

43081j commented 6 months ago

great find 🙏

IMO we should migrate towards fdir and, once the native API settles, consider using that in projects which don't need to support older node versions

talentlessguy commented 2 months ago

to-regex-range no longer depends on is-number but is still not published on npm

43081j commented 2 months ago

once that and chokidar 4 are published, we should do a follow up investigation into what's left depending on is-number

I suspect it won't be many packages anymore

if it is a very low impact amount, we can probably close this issue at that point