Skip to content

watch should debounce the restart #51954

@matthieusieben

Description

@matthieusieben

What is the problem this feature will solve?

When watching the result of a build, and a build is triggered, node --watch will take a long time to actually restart. This is very likely due to the fact that it will trigger a restart for every single file that is changed.

What is the feature you are proposing to solve the problem?

Waiting a (small) amount of time to allow more changes to occur before actually stopping & re-starting would make this feature much smoother when running in dev mode.

What alternatives have you considered?

Status quo implies that the restart is slow, even when small changes are made, depending on the build system.

For example, when working on a large tsc --watch, typescript will output a new file for any edited files, as well as all of its dependent. In this setup (or when the dev triggers a new full build of is ts project), node (in watch mode) take quite long to actually restart, due to the overhead of starting & stopping for every file that changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.watch-modeIssues and PRs related to watch mode

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions