Performance
Shapeless is built on lightweight tools like Hono and Drizzle ORM to deliver high performance by default.
To further improve your app's performance, Shapeless supports dynamic router and dependency loading to reduce bundle sizes and speed up cold starts.
Dynamically Loading Routers
Use the dynamic()
helper to load routers only when needed. This keeps your initial bundle small and reduces cold start time:
Dynamic Imports Within Procedures
You can also do dynamic imports inside your procedure handlers to split code and defer loading of heavy dependencies until actually needed:
This approach helps keep your server bundle lean and your app fast, especially as it grows.