You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Implement a minimal file watcher using a simple poll-based strategy (Go)
How to incrementally recompile esbuild based on file changes
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:
Implementing platform-independent, poll-based file watching in Go
If you’re like me and want the simplest form-factor that you can actually understand / debug yourself, you can roll your own naive watcher in Go in <50 LOC:
So I figured out how to implement esbuild incremental recompilation + server-sent events to trigger reloads which feels like HMR but works today. I used this playground to validate my ideas: https://github.com/zaydek/esbuild-dev-server.
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:
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:
Implementing platform-independent, poll-based file watching in Go
MVP dev server: How to integrate react-refresh in esbuild to implement hmr ? evanw/esbuild#645 (comment)
The text was updated successfully, but these errors were encountered: