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

Make --watch instant #5236

Merged
merged 1 commit into from
Sep 14, 2023
Merged

Make --watch instant #5236

merged 1 commit into from
Sep 14, 2023

Conversation

Jarred-Sumner
Copy link
Collaborator

What does this PR do?

This makes --watch not wait on the event loop. So if you have slow code that is running, the script restarts immediately instead of waits. While we do use CLOEXEC, we also go ahead and manually track open listening sockets for the HTTP server and close them all before reloading the process. I think that was the original reason why we didn't do this - because you could end up in situations where the OS would route it to a stale HTTP server listening.

Screen Recording 2023-09-13 at 12 59 23 AM

How did you verify your code works?

Manual + existing tests

@github-actions
Copy link
Contributor

@Jarred-Sumner 2 files with test failures on linux-x64:

  • test/bundler/esbuild/splitting.test.ts
  • test/js/web/fetch/fetch-gzip.test.ts

View test output

#f569551671f7cab6066e9a27c3abb0a4eea8a8e3

@github-actions
Copy link
Contributor

@Jarred-Sumner 6 files with test failures on bun-darwin-x64-baseline:

  • test/cli/install/bun-install.test.ts
  • test/js/bun/spawn/spawn-streaming-stdout.test.ts
  • test/js/bun/sqlite/sqlite.test.js
  • test/js/node/fs/fs.test.ts
  • test/js/third_party/webpack/webpack.test.ts
  • test/js/web/timers/setTimeout.test.js

View test output

#f569551671f7cab6066e9a27c3abb0a4eea8a8e3

@Jarred-Sumner Jarred-Sumner merged commit 9c9f4ed into main Sep 14, 2023
16 of 20 checks passed
@Jarred-Sumner Jarred-Sumner deleted the jarred/watchy branch September 14, 2023 00:32
paperdave pushed a commit to SuperAuguste/bun that referenced this pull request Sep 18, 2023
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
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.

1 participant