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

Update chokidar to v4 #15302

Open
Fuzzyma opened this issue Dec 4, 2024 · 5 comments
Open

Update chokidar to v4 #15302

Fuzzyma opened this issue Dec 4, 2024 · 5 comments

Comments

@Fuzzyma
Copy link

Fuzzyma commented Dec 4, 2024

I would like to propose to update chokidar to v4. It reduces its dependency count by 11 deps and also brings better type safety.
This is part of the ecosystem cleanup initiative (https://e18e.dev). We try to modernize and declutter the ecosystem as best as we can.
Tailwind is downloaded over 46 million times per month and reducing its dependencies will have a huge impact and will lead to faster install times in ci and on dev machines.

I would be happy to create a PR with the necessary changes if you are open for that :)

PS: Sorry for misusing the bug tracker. I didn't know where to put it

@philipp-spiess
Copy link
Member

@Fuzzyma Hey! Really appreciate the help here, reducing the number of dependencies has been a huge focus for us too for v4.

I do think though that we'd rather focus on getting a release for Tailwind CSS v4 out instead. That should also take care of this issue since we're no longer relying on chokidar! I don't think it's going to be trivial either to upgrade to v4 since we're relying on the glob support heavily unfortunately (the Tailwind JS config API accepts a list of globs to the content array).

@Fuzzyma
Copy link
Author

Fuzzyma commented Dec 5, 2024

Oh I see! Yes, I should have figured that the content prop is powered by chokidars glob.
That's unfortunate :D.

But thanks for the prompt reply and explanation!

I am looking forward to the new tailwind version and I hope that most people will upgrade right away :).
My idea was that a lot of people will not bother upgrading and therefore v3 should be as lean as possible. But I agree that this is not an easy thing to do here.

Keep up the good work!!

@talentlessguy
Copy link

a suggestion on how it could work: use is-glob and tinyglobby and do something like this:

chokidar.watch(paths.map(p => isGlob(p) ? tinyglobby(p) : p))

@benmccann
Copy link

Good suggestion. One more on top of that: you don't need is-glob because you can use isDynamicPattern from tinyglobby, which does the same thing

@Fuzzyma
Copy link
Author

Fuzzyma commented Dec 5, 2024

@philipp-spiess I looked into the code of v3 and it seems like the glob functionality is not actually used. Instead the content paths are resolved via fastGlob. I can be totaly wrong here. But if thats the case, the update should be trivial (which would be great)

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

4 participants