#Boot before server is ready

6 messages Β· Page 1 of 1 (latest)

tardy tusk
#

Hi team! πŸ‘‹ New to start and this ecosystem!

I was playing around with Astro for the last few weeks and noticed that they have a really cool package that let us "boot" (let's say: warm) whatever it is necessary before the server is ready to accept requests (let's say load something into memory or warm up JS, warm up cache, warm up whatever is necessary). Check here. It's on top of Vite. This is particularly useful in SSR while using node.js.

How do you guys recommend to do something similar using Tanstack Start? That will add a lot of value to TSS as a full framework πŸ™‚
Thank you 😊

tardy tusk
#

I was checking SENTRY implementation with Start, and noticed this script:

"dev": "dotenv -e .env.local -- sh -c "NODE_OPTIONS='--import ./instrument.server.mjs' vite dev --port 3000"",

I am not completely sure, but this is probably running that instrument.server.mjs file before the server starts. Maybe this is one way to boot something in TSS, but doesn't look that elegant tbh πŸ˜…

stoic crescent
#

The big point is that start uses vite

#

So it is difficult to add instrumentation without a plugin of our own

#

Start currently does not have instrumentation feature yet

#

The closest to it is probably start entrypoint