`bud run` stdout/stderr improvements
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 5.6k
- Forks
- 175
- PR merge metrics
- No merged PRs in 30d
Description
Jotting down a quick list of bugs and improvements to make to `bud run`'s terminal logging. @012e brought us a big step forward in terms of DX with #131, but there's a few loose ends left to cleanup:
- [ ] Frontend reloads always show 0ms. This one is tricky to time because the start is in the app server, the end is in the bud dev server. The way frontend reloads work is they just send a signal to the frontend as an event source message to re-import it's page component. Should still be possible with @012e prompter state machine, we'll probably just need to make it concurrency safe and pass it through more places
- [ ] Frontend errors don't show an error message in terminal or browser until refreshing the page. I **think** this is a regression, but I'm not sure. Eventually I'd like to show error messages in the same way that CRA or Next.js have these error message dialogs, but for now, I think it's fine to just print the error out in terminal and browser.
- [ ] Rename internal prompter. Right now the prompter doesn't read from stdin and is more like a state machine that tracks what state the runner is in and updates the terminal accordingly. I'm sure there are packages that have something like this (maybe docker?), we should find a better name.
- [ ] Simplify internal prompter API. It doesn't need track stdout and stderr separately, it can implement an `io.Writer` that stores any output into a buffer, then check if that buffer has been written to in order to determine whether we can replace the current line or not.
- [ ] Provide a way to disable the prompter during tests. I find myself occasionally commenting out `clearLine` and `moveCursorUp` to prevent logs from being lost.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the `bud run` entry point and inspect the internal prompter state machine, including how frontend reload signals and terminal output are passed through. The issue lists five separate outcomes: accurate reload timing, immediate frontend errors, clearer prompter naming and API, and a way to disable it during tests; each needs its own verification before the work is complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100