Skip to content

Comments

chore(deps): upgrade chokidar to v4.0.3 and adjust watcher logic for compatibility#13251

Merged
czubocha merged 1 commit intomainfrom
chokidar-upgrade
Jan 14, 2026
Merged

chore(deps): upgrade chokidar to v4.0.3 and adjust watcher logic for compatibility#13251
czubocha merged 1 commit intomainfrom
chokidar-upgrade

Conversation

@czubocha
Copy link
Contributor

Summary

Upgrades chokidar from v3.6.0 to v4.0.3 in both @serverless/engine and @serverless/framework packages.

Breaking Changes Addressed

chokidar v4 removed glob pattern support in the ignored option. The engine package's dev mode watcher has been migrated from glob patterns to a function-based filter:

- ignored: [
-   '**/node_modules/**',
-   '**/.git/**',
-   '**/coverage/**',
-   '**/test/**',
-   '**/*.test.js',
-   '**/*.spec.js',
- ],
+ ignored: (filePath, stats) => {
+   // Function-based filter with same behavior
+ },

The serverless package only uses regex patterns (/\.serverless/) which are still fully supported in v4 - no changes needed.

Changes

  • packages/engine/src/lib/devMode/index.js - Migrated glob patterns to function-based ignored filter
  • packages/engine/package.json - Updated chokidar to ^4.0.3
  • packages/serverless/package.json - Updated chokidar to ^4.0.3
  • .github/dependabot.yml - Added chokidar >= 5.0.0 to ignore list (v5 requires Node.js 20)

Testing

  • Verified behavior equivalence with 82 test cases covering:
    • Built-in ignored directories (node_modules/, .git/, coverage/, test/)
    • Test file patterns (.test.js, .spec.js)
    • User-configured excludeDirectories
    • Edge cases (e.g., testdata/ not matching /test/)

Notes

  • chokidar v5.0.0 requires Node.js 20.19+, which is incompatible with our Node.js 18 support

@Mmarzex
Copy link
Contributor

Mmarzex commented Jan 14, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@czubocha czubocha merged commit e32d315 into main Jan 14, 2026
11 checks passed
@czubocha czubocha deleted the chokidar-upgrade branch January 14, 2026 21:44
@github-actions github-actions bot locked and limited conversation to collaborators Jan 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants