Skip to content

[FEATURE] Take inspiration from systemfd #328

Open
@WIGGLES-dev

Description

@WIGGLES-dev

https://lucumr.pocoo.org/2025/1/19/what-is-systemfd/

I tried for a bit to figure out how to get the tool to play nicely with bacon's TUI and gave up because the ability to work with vite and server rendered HTML in axum without dealing with my dev server being down because its rebooting was too convenient.

Just to be completely clear on the value proposition here:

  1. Vite is running in backend integration mode (https://vite.dev/guide/backend-integration)
  2. Rust is serving HTML and utilizing a hypermedia framework (ala datastar or htmx or whatever) but benefits from a build step.
  3. Vite dev server is constantly asking the browser to refresh when I make changes to client files (which is fine my server is still running to serve html!)'
  4. Vite dev server also wants to listen to assets in my rust project (in my case tailwind and heavy use of the hypertext crate)
  5. Vite refreshes the browser (because its all server rendered there's no HMR) but my server is restarting because I made changes to my rust file!
  6. And of course we get the following
Unable to connect

Firefox can’t establish a connection to the server at localhost:3001.

    The site could be temporarily unavailable or too busy. Try again in a few moments.
    If you are unable to load any pages, check your computer’s network connection.
    If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the web.
  1. Realize that there's less friction in using watchexec and systemfd than trying to ramrod bacon into a parent process.

I can't think of any convincing reason that a new change strategy for Bacon couldn't support this, at least on Linux. If I find some spare time I might rip the rust code from the tools (since its already in rust) and see about adding it into bacon.

Otherwise let this issue stand as a basis for a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions