cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

Create separate API route for each trpc router

Open keithwillcode opened this issue 2 years ago • 3 comments

What does this PR do?

Separates all tRPC routers into their own subfolders so we only load the dependencies needed per router instead of for all of them.

Environment: Staging(main branch) / Production

Type of change

  • Chore (refactoring code, technical debt, workflow improvements)

How should this be tested?

Need to test basically the entire app.

keithwillcode avatar Apr 27 '23 16:04 keithwillcode

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 29, 2023 10:56pm
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 29, 2023 10:56pm

vercel[bot] avatar Apr 27 '23 16:04 vercel[bot]

This started out as a separate experiment for the public router but is truly an extension of #8041 so if we choose this path, I will cherry-pick commits over to that PR to build on @juliusmarminge work.

keithwillcode avatar Apr 27 '23 19:04 keithwillcode

Initial tests are showing that this does in fact make a massive different on cold starts. We didn't see the benefits in #8041 because it only separated the slots router out. In my initial follow up experiment, separating the public tRPC router to a subfolder resulted in a cold start load time of public.viewer.i18n of 2 seconds instead of 15+.

keithwillcode avatar Apr 27 '23 19:04 keithwillcode

Closing this because all work now going into #8041

keithwillcode avatar May 01 '23 16:05 keithwillcode