Skip to content

refactor: use watchDebounced from @netlify/dev-utils #7467

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

Merged

Conversation

keanu-a
Copy link
Contributor

@keanu-a keanu-a commented Jul 23, 2025

Summary

Fixes #EX-324

Replaced all usages from cli watchDebounced with function from @netlify/dev-utils package. Removed function from command-helpers.ts and unused imports.

Ref: https://github.com/netlify/primitives/blob/main/packages/dev-utils/src/lib/watch-debounced.ts


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@keanu-a keanu-a requested a review from a team as a code owner July 23, 2025 21:02
Copy link

github-actions bot commented Jul 23, 2025

📊 Benchmark results

Comparing with aef99f7

  • Dependency count: 1,080 (no change)
  • Package size: 290 MB ⬇️ 0.00% decrease vs. aef99f7
  • Number of ts-expect-error directives: 385 ⬇️ 0.78% decrease vs. aef99f7

@keanu-a keanu-a marked this pull request as draft July 23, 2025 21:15
@keanu-a keanu-a marked this pull request as ready for review July 24, 2025 15:58
Copy link
Member

@serhalp serhalp left a comment

Choose a reason for hiding this comment

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

LGTM, just one follow-up

import WSL from 'is-wsl'
import debounce from 'lodash/debounce.js'
Copy link
Member

Choose a reason for hiding this comment

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

this time I don't think github is fooling me 😁 — we can remove this dependency!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This time github isn't fooling you! But we do use other submodules from the lodash package 😅
Ex: https://github.com/netlify/cli/blob/main/src/commands/base-command.ts

import merge from 'lodash/merge.js'
import pick from 'lodash/pick.js'

Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

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

LGTM

@keanu-a keanu-a merged commit e963056 into main Jul 24, 2025
67 of 68 checks passed
@keanu-a keanu-a deleted the keanualoua/ex-324-use-watchdebounced-from-netlifydev-utils branch July 24, 2025 20:59
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.

3 participants