Skip to content

Conversation

ggodlewski
Copy link
Contributor

@ggodlewski ggodlewski commented Nov 16, 2024

PR Checklist

Overview

Current chokidar is bundled with tons of spam deps including braces which trigger some audit alert.

Uploading image.png…

All test are working. It supports globs unlike #5215

Copy link

linux-foundation-easycla bot commented Nov 16, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey thanks for getting this started! Sorry it took so long to review - since Chokidar didn't end up needing to be bumped with v11, this fell by the wayside. But I'm excited to help push this forward along now! 🚀

Requesting changes primarily on a performance point, as well as a design point. Happy to talk if you want. 🙂

@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for author waiting on response from OP or other posters - more information needed label Jan 2, 2025
@ggodlewski
Copy link
Contributor Author

Hey @JoshuaKGoldberg, there is no way I remember the details after a month :). All I know it's been a struggle to get all tests working. In the meantime we switched to ava to resolve our issues, so I can't do much.
I updated the code to fix your issues. If there is anything that I can do fast let me know.

@Uzlopak Uzlopak changed the title chore(deps): update choikdar to v4 chore(deps): update chokidar to v4 Jan 2, 2025
@talentlessguy
Copy link

@JoshuaKGoldberg is there any blocker to this PR besides merge conflicts of a lockfile?

@JoshuaKGoldberg
Copy link
Member

Just a re-request for review. I'll add it to the queue for review :)

@JoshuaKGoldberg JoshuaKGoldberg added status: needs review a maintainer should (re-)review this pull request and removed status: waiting for author waiting on response from OP or other posters - more information needed labels Jan 8, 2025
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source code looks good, thanks for the refactor!

I finally found time to really dig in and try this in production - and think I found a performance bug. LMK what you think of it.

@JoshuaKGoldberg JoshuaKGoldberg added status: waiting for author waiting on response from OP or other posters - more information needed and removed status: waiting for author waiting on response from OP or other posters - more information needed labels Jan 28, 2025
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 This is fantastic, thanks a bunch @ggodlewski! I really appreciate you sticking through & working with me on the reviews.

I've played with this a bunch locally on relatively small and large repros, and haven't found any issues. I'd really prefer to get another review from someone on @mochajs/maintenance-crew just to be safe - but otherwise ✅ on my end.

Nice job!

@JoshuaKGoldberg JoshuaKGoldberg removed the status: needs review a maintainer should (re-)review this pull request label Jan 30, 2025
@mark-wiemer mark-wiemer self-requested a review April 9, 2025 15:30
@mark-wiemer
Copy link
Member

I'll take a look at this tonight :)

@mark-wiemer
Copy link
Member

@ggodlewski are you able to resolve the merge conflict? Otherwise looks great :)

@ggodlewski
Copy link
Contributor Author

@mark-wiemer I rebased against main and updated lock file.

@JoshuaKGoldberg JoshuaKGoldberg changed the title chore(deps): update chokidar to v4 fix(deps): update chokidar to v4 Apr 10, 2025
@JoshuaKGoldberg JoshuaKGoldberg merged commit 8af0f1a into mochajs:main Apr 10, 2025
74 of 75 checks passed
@mark-wiemer mark-wiemer mentioned this pull request Jun 12, 2025
3 tasks
@voxpelli voxpelli requested a review from Copilot June 12, 2025 07:44
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the chokidar dependency to v4 to reduce unnecessary bundled dependencies and adjusts the file watching mechanism accordingly.

  • Upgrades chokidar version in package.json
  • Introduces a GlobFilesTracker class in lib/cli/watch-run.js for enhanced file pattern matching using glob
  • Modifies the chokidar watcher initialization and event handling to integrate the new tracking logic

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
package.json Upgraded chokidar from v3.5.3 to v4.0.1
lib/cli/watch-run.js Added GlobFilesTracker and refactored watcher logic using glob

const globOpts = {
dot: true,
ignore: {
childrenIgnored: pathToCheck => watchIgnoreSet.has(pathToCheck.relative())
Copy link
Preview

Copilot AI Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The call to 'pathToCheck.relative()' is likely incorrect since glob.sync returns strings, not path objects. Consider removing the 'relative()' call or converting the string to a path object using a standard Node.js path function if relative paths are required.

Suggested change
childrenIgnored: pathToCheck => watchIgnoreSet.has(pathToCheck.relative())
childrenIgnored: pathToCheck => watchIgnoreSet.has(path.relative(process.cwd(), pathToCheck))

Copilot uses AI. Check for mistakes.

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

Successfully merging this pull request may close these issues.

Chore: bump chokidar to v4
4 participants