The limit of 12 functions is only if you are deploying an API-only project without bundling[1]. The majority of the modern frameworks support bundling, so you can write many, many more APIs (100s+) which compile down to a handful of functions.
This bundling also means fewer cold starts. Bundling is the default for Astro[2]. Also worth noting, on paid plans, functions are kept warm automatically[3].
Thanks Lee. That makes total sense when using SvelteKit or NextJS on Vercel, when Vercel owns the build step, bundling, and infrastructure you really have a great chance to optimize everything.
Its a bit of a crap shoot with third party frameworks though. With Astro, unless I'm misremembering the timing, they defaulted to bundling per route originally and only changed that when Vercel users ran into issues with the Hobby plan. More interestingly on the timing, I think that was right around the time Vercel took over as Astro's official hosting sponsor. Not sure how much a part that played in the change in defaults.
In general, I'm always hesitant with a build system that I depend on to route split in a way that impacts my actual cost to run. At the end of the day I have little say in how routes are split and little insight into what metrics are used at bundle time to make those decisions. That said, I haven't heard any horror stories with SvelteKit or NextJS on Vercel so the concern may very well be unfounded as long as I stay in the Vercel ecosystem.
This bundling also means fewer cold starts. Bundling is the default for Astro[2]. Also worth noting, on paid plans, functions are kept warm automatically[3].
[1]: https://vercel.com/docs/functions/runtimes#functions-created...
[2]: https://vercel.com/docs/frameworks/astro#configuration-optio...
[3]: https://vercel.com/changelog/vercel-functions-now-have-faste...