TanStackT
TanStack5mo ago
14 replies
dangerous-fuchsia

dynamic middleware generation???

I did reach out to Tanner on twitter regarding this as well here but does anyone know if we can generate middleware dynamicaly on the fly? or must it be generated statically so bundled at build time.

this as an example would be a dynamic middleware generator that checks user has the correct permissions in screenshot.

if can't be done I'll just do as a utility function at top of handler but this would be nice if can do.
GywMjFRacAQh0FM.png
Alistair (@ahut10)
@tannerlinsley feel free to redirect, but curious in #tanstackstart if we can generate middleware dynamically, like in this rough example for a permission check? or if we need to statically define each middleware once so available at build time.

btw, loving devX experience!!
Preview image

X

8/19/25, 11:53 PM

Was this page helpful?