T
TanStack6mo ago
harsh-harlequin

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
exotic-emerald
exotic-emerald6mo ago
you mean "where would I install that event handler"?
harsh-harlequin
harsh-harlequinOP6mo ago
Yes, basically.
exotic-emerald
exotic-emerald6mo ago
would do it in server.ts (on the alpha branch)
harsh-harlequin
harsh-harlequinOP6mo 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.
exotic-emerald
exotic-emerald6mo ago
we have not documented this yet
exotic-emerald
exotic-emerald6mo 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
harsh-harlequin
harsh-harlequinOP6mo 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?
exotic-emerald
exotic-emerald6mo ago
pretty close we still need to fix some bugs before we can merge to main
harsh-harlequin
harsh-harlequinOP6mo 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?
exotic-emerald
exotic-emerald6mo 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
harsh-harlequin
harsh-harlequinOP6mo ago
Cool! Thanks!

Did you find this page helpful?