X Tutup
Skip to content

feat(deps)!: update chokidar to v5#150

Merged
chenjiahan merged 5 commits intomainfrom
chokidar_v5
Mar 10, 2026
Merged

feat(deps)!: update chokidar to v5#150
chenjiahan merged 5 commits intomainfrom
chokidar_v5

Conversation

@chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Mar 10, 2026

Update chokidar dependency from v3 to v5, which drops glob pattern support.

Ref: webpack/webpack-dev-server#5374

Copilot AI review requested due to automatic review settings March 10, 2026 07:55
Copy link

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

Updates the project’s file-watching stack by upgrading chokidar from v3 to v5 (which removes glob-pattern support) and adjusts the dev-server/watchFiles behavior, tests, and migration docs accordingly.

Changes:

  • Bump chokidar dependency to ^5.0.0 and update the lockfile accordingly.
  • Refactor Server watcher setup to async-import chokidar and await watch setup during initialization.
  • Update watchFiles e2e test logic and add migration documentation for the glob-pattern breaking change.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/e2e/watch-files.test.js Switches from chokidar glob patterns to pre-expanded file lists using fs.promises.glob().
src/types.ts Aligns chokidar type imports with newer chokidar typings (ChokidarOptions).
src/server.ts Uses memoized async import of chokidar and makes watcher setup async/awaited.
rslib.config.ts Removes chokidar from externals, affecting bundling behavior.
package.json Updates chokidar version to ^5.0.0.
pnpm-lock.yaml Updates resolved chokidar + dependency graph for v5.
docs/migrate-v1-to-v2.md Documents chokidar v5 upgrade and the removal of glob-pattern support, with suggested migration approaches.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request performs a significant upgrade of the chokidar dependency to version 5, addressing the breaking change where glob patterns are no longer directly supported. The core changes involve adapting the file watching mechanisms to the new chokidar API, including dynamic imports for improved performance and updated type definitions. Comprehensive migration guidance has been added to the documentation, and existing tests have been updated to ensure compatibility and correct functionality with the new version.

Highlights

  • Dependency Upgrade: Updated chokidar from v3 to v5, which is a major version bump and introduces breaking changes.
  • Breaking Change Adaptation: Modified internal file watching logic to accommodate chokidar v5's removal of direct glob pattern support, including type definition updates and asynchronous handling.
  • Dynamic Import: Refactored chokidar to be dynamically imported using import('chokidar'), improving initial load performance.
  • Dependency Tree Simplification: The pnpm-lock.yaml reflects a significantly simplified dependency tree for chokidar, removing several transitive dependencies like anymatch, glob-parent, and fsevents.
  • Documentation and Testing: Added a new section to the migration guide (docs/migrate-v1-to-v2.md) explaining the chokidar v5 upgrade and providing examples for handling glob patterns, and updated end-to-end tests to reflect these changes.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • docs/migrate-v1-to-v2.md
    • Added a new section to the migration guide detailing the chokidar v5 upgrade and providing examples for handling glob patterns.
  • package.json
    • Updated the chokidar dependency from v3 to v5.
  • pnpm-lock.yaml
    • Updated lockfile to reflect the chokidar v5 upgrade and its simplified dependency tree, removing several no longer needed transitive dependencies.
  • rslib.config.ts
    • Removed chokidar from the list of external dependencies.
  • src/server.ts
    • Refactored chokidar import to be dynamic, updated watch options types, and made file watching setup asynchronous to accommodate the new chokidar API.
  • src/types.ts
    • Updated the WatchOptions type definition to align with chokidar v5 and removed the ignored property from WatchFiles options.
  • tests/e2e/watch-files.test.js
    • Modified end-to-end tests for file watching to use node:fs/promises glob for pattern resolution, reflecting the chokidar v5 API changes.
Activity
  • No human activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates chokidar from v3 to v5, which is a breaking change as it drops support for glob patterns. The changes include updating the dependency, documenting the breaking change with migration paths, and adjusting the server implementation and tests to align with the new version. My review focuses on the correctness of these changes. I've pointed out a potential issue with the build configuration regarding chokidar as an external dependency and suggested an improvement to the migration documentation to clarify a key difference between the suggested approaches.

@chenjiahan chenjiahan merged commit ea268c3 into main Mar 10, 2026
3 checks passed
@chenjiahan chenjiahan deleted the chokidar_v5 branch March 10, 2026 08:50
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.

2 participants

X Tutup