T
TanStack4mo ago
absent-sapphire

SIGTERM hook/teardown logic

I have a TanStack Start app, and it needs to perform some teardown logic when receiving a SIGTERM. What would be a suitable place for such a hook?
11 Replies
national-gold
national-gold4mo ago
you mean "where would I install that event handler"?
absent-sapphire
absent-sapphireOP4mo ago
Yes, basically.
national-gold
national-gold4mo ago
would do it in server.ts (on the alpha branch)
absent-sapphire
absent-sapphireOP4mo ago
Hm, is there any chance to get a pointer to the repo? I checked the alpha branch and all the examples, but I didn't find an indicator on how to use the server.ts.
national-gold
national-gold4mo ago
we have not documented this yet
national-gold
national-gold4mo ago
GitHub
router/e2e/react-start/basic/src/server.ts at alpha · TanStack/router
🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering. - TanStack/router
absent-sapphire
absent-sapphireOP4mo ago
I see, thanks for the pointer, @Manuel Schiller The alpha branch is all about migrating away from Nitro and Vinxi, right? How close is it to being promoted to beta?
national-gold
national-gold4mo ago
pretty close we still need to fix some bugs before we can merge to main
absent-sapphire
absent-sapphireOP4mo ago
Sounds good. I'm a little hesitant to switch to the alpha in our production app, though. On the other hand, we really need the possibility for some teardown logic. Are there any hard breaking changes that I need to take into account when using the alpha?
national-gold
national-gold4mo ago
GitHub
Start BETA - Tracking · TanStack router · Discussion #2863
Tracking any important changes for TanStack Start during the BETA period. If you are coming from the ALPHA of TanStack Start, you can see all the breaking changes that were made here - #2403
absent-sapphire
absent-sapphireOP4mo ago
Cool! Thanks!

Did you find this page helpful?