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

[Question] Are you open to having a live reload section? #4

Closed
zaydek opened this issue Jan 28, 2021 · 1 comment
Closed

[Question] Are you open to having a live reload section? #4

zaydek opened this issue Jan 28, 2021 · 1 comment

Comments

@zaydek
Copy link

zaydek commented Jan 28, 2021

Hi @evanw. Are you open to a pull request that documents how to implement a minimally viable rapid development / live-reload server? I’d be happy to submit a PR that explains the following:

  1. Implement a minimal file watcher using a simple poll-based strategy (Go)
  2. How to incrementally recompile esbuild based on file changes
  3. How to use SSE (server-sent events) so the client browser tabs reload themselves when incremental recompilation is done

Your serve implementation helped me understand why a) native file watching can be a bad idea and b) how to strategically use HTTP servers to delay requests to prevent race conditions, etc., but it didn’t demonstrate to me how to make esbuild respond to filesystem changes and trigger reloads on client browser tabs.

I’d like to help document implementing this kind of dev server architecture from scratch in a few paragraphs with Go code examples.

No worries if you’d rather not, I just thought I’d try to help where I can be usefuk.

Relevant links:

@zaydek
Copy link
Author

zaydek commented Jan 31, 2021

I’ll close this since this feature has been added to 0.8.38!

@zaydek zaydek closed this as completed Jan 31, 2021
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

No branches or pull requests

1 participant