Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigation: is-number #17

Open
43081j opened this issue Jan 28, 2024 · 4 comments
Open

Investigation: is-number #17

43081j opened this issue Jan 28, 2024 · 4 comments

Comments

@43081j
Copy link
Owner

43081j commented Jan 28, 2024

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

  • to-regex-range
  • randomatic - replace with nanoid
  • get-object - replace with dlv
  • array-initial - replace with slice(start, -1)
  • array-last - replace with slice(-offset)
  • window-size - probably somewhat useful still

Highest impact chain

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

  • braces
    • fill-range
      • to-regex-range
        • is-number

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:

  • chokidar
  • karma
  • wireit

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
Copy link

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
Copy link
Owner Author

43081j commented Apr 12, 2024

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
Copy link

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

@43081j
Copy link
Owner Author

43081j commented Apr 13, 2024

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

aomarks pushed a commit to google/wireit that referenced this issue Jul 2, 2024
I'm helping out with some ecosystem cleanup and this dependency came up as a possible contender. Reference: 43081j/ecosystem-cleanup#17. I don't have a strong opinion here, but happy to discuss.

https://npmgraph.js.org/?q=braces
https://npmgraph.js.org/?q=brace-expansion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants