Back to Cal

Embed Playground

packages/embeds/embed-core/routing-playground.html

6.2.01.9 KB
Original Source

Routing Form - Prerender Headless Router itself queuing the form response NOTE: Pass query param param.formId=FORM_UID_HERE to test with a particular routing form. Easiest is to run seed-insights.ts script to create a seeded form and then use the form id here.

  1. As page is loading, we prerender the headless router for the email passed as param.email

  2. Whenever email changes and onblur happens, the prerender is triggered for the new email and previous prerendered modal is removed

  3. The prerender of the headless router queues the form response and doesn't really record it. When the actual booking is made, the form response is recorded from the queue

  4. If the CTA click happens before the slots are considered stale(configurable via options.slotsStaleTimeMs), then it will open the prerendered modal without fetching the slots, otherwise it will fetch the slots(for the routedTeamMembers/contactOwner only) and till then skeleton will be shown

  5. If the CTA click happens after iframeForceReloadThresholdMs has passed, then fresh headless router request is sent which could be really slow. It is important to do force reload after a certain time because the Routing Form itself could have changed in the meantime or Salesforce ownership might be available or some other change might have occurred in Cal.com's side

  6. slotsStaleTimeMs is set to 10 seconds(default is 1 minute) and iframeForceReloadThresholdMs is set to 30 seconds(default is 15 minutes) and they are considered from the time when the prerender/modal call was made

  7. To avoid reaching the iframeForceReloadThresholdMs, user could prerender the router again and again judiciously

  8. You can disable prerendering by passing the query param param.disablePrerender=true

Name

Email

SkillsSelect a skillJavaScriptReactNode.jsPythonSales

LocationSelect a locationNew YorkLondonTokyoBerlinRemote Submit