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

chore(deps): replace fast-glob with tinyglobby #4132

Merged
merged 6 commits into from
Sep 5, 2024

Conversation

Namchee
Copy link
Contributor

@Namchee Namchee commented Aug 13, 2024

Description

This pull request replaces fast-glob with tinyglobby to reduce dependency size while keeping the same behavior

Linked Issues

Additional Context

Package size report
===================

Package info for "[email protected]": 512 kB
  Released: 2023-11-06 12:41:11.203 +0000 UTC (40w ago)
  Downloads last week: 26,252,063 (55.53%)
  Estimated traffic last week: 13 TB
  Subdependencies: 17

Removed dependencies:
  - @nodelib/[email protected]: 12 kB (2.39%)
    Downloads last week: 35,212,220 (N/A% from 2.0.5)
    Downloads last week from "[email protected]": 26,252,063 (N/A%)
    Traffic last week: N/A
    Traffic from "[email protected]": 13 TB (N/A%)
    Subdependencies: 0 (0%)
  - @nodelib/[email protected]: 130 kB (25.38%)
    Downloads last week: 34,851,744 (N/A% from 1.2.8)
    Downloads last week from "[email protected]": 26,252,063 (N/A%)
    Traffic last week: N/A
    Traffic from "[email protected]": 13 TB (N/A%)
    Subdependencies: 6 (35.29%)
  - [email protected]: 33 kB (6.47%)
    Downloads last week: 46,878,871 (N/A% from 5.1.2)
    Downloads last week from "[email protected]": 26,252,063 (N/A%)
    Traffic last week: N/A
    Traffic from "[email protected]": 13 TB (N/A%)
    Subdependencies: 2 (11.76%)
  - [email protected]: 9.3 kB (1.81%)
    Downloads last week: 34,334,669 (N/A% from 1.4.1)
    Downloads last week from "[email protected]": 26,252,063 (N/A%)
    Traffic last week: N/A
    Traffic from "[email protected]": 13 TB (N/A%)
    Subdependencies: 0 (0%)
  - [email protected]: 243 kB (47.37%)
    Downloads last week: 19,237,645 (N/A% from 4.0.7)
    Downloads last week from "[email protected]": 26,252,063 (N/A%)
    Traffic last week: N/A
    Traffic from "[email protected]": 13 TB (N/A%)
    Subdependencies: 5 (29.41%)

Added dependencies:
  + [email protected]: 171 kB (33.44%)
    Downloads last week: 29,150 (N/A% from 0.2.2)
    Estimated traffic last week: N/A
    Subdependencies: 2 (11.76%)

Estimated new statistics:
  Package size: 512 kB → 171 kB (33.44%)
  Subdependencies: 17 → 3 (-14)
  Traffic with last week's downloads:
    For current version: 13 TB → 4.5 TB (8.9 TB saved)
    For all versions: 24 TB → 8.1 TB (16 TB saved)

Tip

The author of this PR can publish a preview release by commenting /publish below.

@Namchee Namchee marked this pull request as draft August 14, 2024 13:05
@SuperchupuDev
Copy link

for better fast-glob compatibility you can set the expandDirectories option to false btw

@Namchee Namchee marked this pull request as ready for review August 25, 2024 03:01
@brc-dd
Copy link
Member

brc-dd commented Sep 1, 2024

Few questions -

  • Is there any benchmark of fast-glob vs tinyglobby?
  • Is vite planning to migrate away from fast-glob too? Is there any attempt in vite's repo to replace the package that passes their tests?

nit: the "TB saved" thing in description isn't correct. It will only save ~1 GB / wk. (The bundled + gz size difference is 13KB x 80K vitepress downloads / wk.)

@brc-dd brc-dd added the enhancement New feature or request label Sep 1, 2024
Copy link

pkg-pr-new bot commented Sep 1, 2024

pnpm add https://pkg.pr.new/vitepress@4132

commit: 87c4448

@benmccann
Copy link
Contributor

Is there any benchmark of fast-glob vs tinyglobby?

They're pretty comparable. I've generally seen that tinyglobby is a bit faster though it can depend on the file structure being searched, glob pattern, etc.

image

Is vite planning to migrate away from fast-glob too? Is there any attempt in vite's repo to replace the package that passes their tests?

I think that would be nice to do and would be happy to review any PRs in the Vite repo and @bluwy said he'd be supportive of trying it as well. I've filed a couple of feature requests with tinyglobby to make the migration path easier as Vite uses some uncommon functionality of fast-glob. We might be able to just replicate that functionality directly in Vite with a couple of small utility methods, but if tinyglobby can add support that'd be easiest for us

@brc-dd brc-dd merged commit cb1106d into vuejs:main Sep 5, 2024
9 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cr-tracked enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace fast-glob with alternative in vitepress
5 participants