Skip to content
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

feat(server)!: use parcel watcher #14731

Closed
wants to merge 1 commit into from
Closed

feat(server)!: use parcel watcher #14731

wants to merge 1 commit into from

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Oct 23, 2023

Description

Decided to give #13593 another shot before deciding if we should fit it into Vite 5. But with the state of the implementation, I don't think it's feasible (for now).

This PR implements a hybrid @parcel/watcher + fs.watch approach, where the former is used for root recursive watching, and the latter for non-recursive watching. parcel-bundler/watcher#92

It also implements chokidar's watcher interface for better compatibility. Ultimately it feels like I'm re-implementing chokidar and would be better as a standalone library, but it's easier to test this way for now.

Additional context

WIP TODO:

  • Implement unfinished API
  • Make sure it's compatible with chokidar
    • getWatched compatible
    • unwatch and add on the same path should continue watching
    • unlinkDir not correctly detected
  • Make tests pass
  • Update docs

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

@bluwy bluwy added p2-nice-to-have Not breaking anything but nice to have (priority) breaking change labels Oct 23, 2023
@stackblitz
Copy link

stackblitz bot commented Oct 23, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@bluwy bluwy mentioned this pull request Oct 23, 2023
4 tasks
@lure23
Copy link

lure23 commented Apr 19, 2024

Short FYI that also a polling solution is important (what Chokidar does with CHOKIDAR_USEPOLLING=1). I faced this again this week, running development under a VM with mounts to my desktop account. Such mounts don't usually pass change notifications, but the said env.var. has worked nice.

@bluwy
Copy link
Member Author

bluwy commented May 18, 2024

Closing this for now as I haven't got to finishing this and requires a large rebase. It would still be helpful for others who like to bring this across the line though. My notes about parcel watcher at #13593 (comment) still remain.

@bluwy bluwy closed this May 18, 2024
@bluwy bluwy deleted the try-parcel-watcher branch May 18, 2024 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants