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

Investigate dependencies of 11ty #164

Open
43081j opened this issue Mar 5, 2025 · 7 comments
Open

Investigate dependencies of 11ty #164

43081j opened this issue Mar 5, 2025 · 7 comments
Labels
umbrella issue This issue contains a list of dependents of a package and tracks the progress in each

Comments

@43081j
Copy link
Collaborator

43081j commented Mar 5, 2025

https://github.com/11ty/eleventy/blob/main/package.json

Zach seems happy to do some maintenance here, so we should take a look.

Obvious ones:

  • rimraf (already done)
  • fast-glob, is-glob, etc (replace with tinyglobby)
  • chokidar (part of Update chokidar to @4 #138 )
  • ava (big change - but vitest would be better)

We are going to track this in an equivalent umbrella issue inside the eleventy repo. So do not make individual issues unless Zach decides to pull one out of the umbrella to focus on.

@43081j 43081j added the umbrella issue This issue contains a list of dependents of a package and tracks the progress in each label Mar 5, 2025
@pralkarz
Copy link

pralkarz commented Mar 5, 2025

  • graceful-fs can most likely be replaced with node:fs in modern versions. Depends on how they're using it though.
  • micromatch -> picomatch for deduping with tinyglobby
  • p-map -> should probably be inlined

@Krinkle
Copy link

Krinkle commented Mar 6, 2025

chokidar

You may want to consider switching to node-watch by @yuanchuan. I did this for QUnit back in 2018 and it helped us reduce dependencies from 142 to 9.

https://qunitjs.com/blog/2019/01/06/qunit-2-9-0/

qunitjs/qunit#1342 (comment)

Before: QUnit 2.8.0 has 142 dependencies.

After: QUnit 2.9.1 has 9 dependencies.

Before After
qunit-28 qunit-29

Pull request: qunitjs/qunit#1345

@Fuzzyma
Copy link
Collaborator

Fuzzyma commented Mar 6, 2025

@Krinkle what is the advantage over choking v4? It doesn't seem to support globs only filters. And filters don't cut it when watching directories because they will filter out subdirs that don't match the glob (even tho they could have files that do match the glob)

@43081j
Copy link
Collaborator Author

43081j commented Mar 6, 2025

Note that chokidar currently has 1 dependency. Times have changed since you switched 👀

I'm biased since I maintain it but I would just stick with it and benefit from the de-dupe

@Krinkle
Copy link

Krinkle commented Mar 7, 2025

what is the advantage over [chokidar] v4? It doesn't seem to support globs only filters. And filters don't cut it when watching directories because they will filter out subdirs that don't match the glob (even tho they could have files that do match the glob)

@Fuzzyma Filtering out one result and recursively skipping an entire directory, are two different things. I haven't tried it recently, but the readme sounds like Chokidar made the same decision as node-watch. https://github.com/paulmillr/chokidar/tree/4.0.3 reads:

v4 is out! It […] removes support for globs, […]

... except node-watch does still support the optmization to skip subtrees when desired. This becomes less relevant over time, but it's there today.

Note that chokidar currently has 1 dependency. Times have changed since you switched […]

@43081j I'm glad Chokidar was able to make such a drastic change. That benefits a huge portion of the ecosystem. Very nice!

Ultimately, I suppose the key question for this issue is: What does Eleventy actually need?

@Fuzzyma
Copy link
Collaborator

Fuzzyma commented Mar 7, 2025

Chokidar v4 also allows filtering via ignore and it will filter out any subtree you want.

However, this is unfortunately not a replacement for globs as i experienced painfully.

Not shooting against node-watch here. Just wanted to make sure that the capabilities are understood :)

// Edit: actually looked at the docs now and it seems that node-watch allows to skip items more granualy than chokidar by returning false / "skip"

@43081j
Copy link
Collaborator Author

43081j commented Mar 7, 2025

Let's find out what 11ty currently uses chokidar for and go from there

There's still opportunity to add new functionality to chokidar but I suspect 11ty won't need that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
umbrella issue This issue contains a list of dependents of a package and tracks the progress in each
Projects
None yet
Development

No branches or pull requests

4 participants