-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embed: Strictly type the codebase and fixes a few bugs found #7536
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
a5983f7
to
64c4522
Compare
64c4522
to
464968a
Compare
464968a
to
9c2ec26
Compare
9c2ec26
to
9ea5967
Compare
📦 Next.js Bundle AnalysisThis analysis was generated by the next.js bundle analysis action 🤖
|
Page | Size (compressed) |
---|---|
global |
233.33 KB (🟡 +78 B) |
Details
The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!
Sixty-three Pages Changed Size
The following pages changed size from the code in this PR compared to its base branch:
Page | Size (compressed) | First Load | % of Budget (350 KB ) |
---|---|---|---|
/404 |
8.36 KB |
241.7 KB | 69.06% (+/- <0.01%) |
/[user] |
103.4 KB |
336.73 KB | 96.21% (+/- <0.01%) |
/[user]/[type] |
91.85 KB |
325.19 KB | 92.91% (+/- <0.01%) |
/[user]/[type]/embed |
91.88 KB |
325.21 KB | 92.92% (+/- <0.01%) |
/[user]/embed |
103.47 KB |
336.8 KB | 96.23% (+/- <0.01%) |
/apps |
167.18 KB |
400.51 KB | 114.43% (+/- <0.01%) |
/apps/[slug] |
190.9 KB |
424.23 KB | 121.21% (+/- <0.01%) |
/apps/[slug]/[...pages] |
392.31 KB |
625.64 KB | 178.76% (+/- <0.01%) |
/apps/categories |
152.07 KB |
385.41 KB | 110.12% (+/- <0.01%) |
/apps/categories/[category] |
155.94 KB |
389.27 KB | 111.22% (+/- <0.01%) |
/apps/installed/[category] |
197.05 KB |
430.38 KB | 122.97% (🟢 -0.01%) |
/auth/error |
19.24 KB |
252.57 KB | 72.16% (+/- <0.01%) |
/auth/forgot-password |
25.63 KB |
258.96 KB | 73.99% (+/- <0.01%) |
/auth/forgot-password/[id] |
32.83 KB |
266.16 KB | 76.05% (+/- <0.01%) |
/auth/login |
40.1 KB |
273.43 KB | 78.12% (+/- <0.01%) |
/auth/logout |
7.56 KB |
240.89 KB | 68.83% (+/- <0.01%) |
/availability |
155.38 KB |
388.71 KB | 111.06% (+/- <0.01%) |
/availability/[schedule] |
272.14 KB |
505.47 KB | 144.42% (+/- <0.01%) |
/availability/troubleshoot |
152.76 KB |
386.09 KB | 110.31% (+/- <0.01%) |
/booking/[uid] |
123.57 KB |
356.9 KB | 101.97% (+/- <0.01%) |
/bookings/[status] |
272.38 KB |
505.71 KB | 144.49% (+/- <0.01%) |
/d/[link]/[slug] |
91.5 KB |
324.83 KB | 92.81% (+/- <0.01%) |
/d/[link]/[slug]/embed |
91.53 KB |
324.86 KB | 92.82% (+/- <0.01%) |
/event-types |
349.32 KB |
582.65 KB | 166.47% (+/- <0.01%) |
/event-types/[type] |
382.9 KB |
616.23 KB | 176.07% (+/- <0.01%) |
/insights |
386.24 KB |
619.58 KB | 177.02% (+/- <0.01%) |
/more |
151.7 KB |
385.03 KB | 110.01% (+/- <0.01%) |
/settings/admin |
157.16 KB |
390.49 KB | 111.57% (+/- <0.01%) |
/settings/admin/apps |
165.84 KB |
399.17 KB | 114.05% (+/- <0.01%) |
/settings/admin/apps/[category] |
165.83 KB |
399.16 KB | 114.04% (+/- <0.01%) |
/settings/admin/flags |
160.05 KB |
393.38 KB | 112.39% (+/- <0.01%) |
/settings/admin/impersonation |
157.44 KB |
390.77 KB | 111.65% (+/- <0.01%) |
/settings/billing |
157.27 KB |
390.6 KB | 111.60% (+/- <0.01%) |
/settings/developer/api-keys |
186.42 KB |
419.75 KB | 119.93% (+/- <0.01%) |
/settings/developer/webhooks |
159.76 KB |
393.09 KB | 112.31% (+/- <0.01%) |
/settings/developer/webhooks/[id] |
190.61 KB |
423.94 KB | 121.13% (+/- <0.01%) |
/settings/developer/webhooks/new |
190.47 KB |
423.8 KB | 121.09% (+/- <0.01%) |
/settings/my-account/appearance |
171.23 KB |
404.56 KB | 115.59% (+/- <0.01%) |
/settings/my-account/calendars |
191.46 KB |
424.79 KB | 121.37% (+/- <0.01%) |
/settings/my-account/conferencing |
163.03 KB |
396.36 KB | 113.25% (+/- <0.01%) |
/settings/my-account/general |
266.42 KB |
499.75 KB | 142.79% (+/- <0.01%) |
/settings/my-account/profile |
274.32 KB |
507.65 KB | 145.04% (+/- <0.01%) |
/settings/security/impersonation |
159.31 KB |
392.64 KB | 112.18% (+/- <0.01%) |
/settings/security/password |
192.6 KB |
425.93 KB | 121.70% (🟢 -0.01%) |
/settings/security/sso |
167 KB |
400.33 KB | 114.38% (+/- <0.01%) |
/settings/security/two-factor-auth |
161.76 KB |
395.09 KB | 112.88% (+/- <0.01%) |
/settings/teams |
156.9 KB |
390.23 KB | 111.49% (+/- <0.01%) |
/settings/teams/[id]/appearance |
171.25 KB |
404.58 KB | 115.60% (🟢 -0.01%) |
/settings/teams/[id]/billing |
157.14 KB |
390.47 KB | 111.56% (+/- <0.01%) |
/settings/teams/[id]/members |
297.14 KB |
530.47 KB | 151.56% (+/- <0.01%) |
/settings/teams/[id]/profile |
269.53 KB |
502.86 KB | 143.67% (+/- <0.01%) |
/settings/teams/[id]/sso |
167.09 KB |
400.43 KB | 114.41% (+/- <0.01%) |
/signup |
25.5 KB |
258.83 KB | 73.95% (+/- <0.01%) |
/team/[slug] |
105.87 KB |
339.2 KB | 96.92% (+/- <0.01%) |
/team/[slug]/[type] |
91.5 KB |
324.84 KB | 92.81% (+/- <0.01%) |
/team/[slug]/[type]/embed |
91.54 KB |
324.87 KB | 92.82% (+/- <0.01%) |
/team/[slug]/embed |
105.94 KB |
339.27 KB | 96.93% (+/- <0.01%) |
/teams |
151.92 KB |
385.25 KB | 110.07% (+/- <0.01%) |
/video/meeting-ended/[uid] |
14.67 KB |
248 KB | 70.86% (+/- <0.01%) |
/video/meeting-not-started/[uid] |
14.3 KB |
247.63 KB | 70.75% (+/- <0.01%) |
/video/no-meeting-found |
6.6 KB |
239.93 KB | 68.55% (+/- <0.01%) |
/workflows |
164.81 KB |
398.14 KB | 113.76% (🟢 -0.01%) |
/workflows/[workflow] |
294.01 KB |
527.34 KB | 150.67% (+/- <0.01%) |
Details
Only the gzipped size is provided here based on an expert tip.
First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link
is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.
Current Playwright Test Results Summary✅ 66 Passing - Run may still be in progress, this comment will be updated as current testing workflow or job completes... (Last updated on 03/28/2023 08:33:25am UTC) Run DetailsRunning Workflow PR Update on Github Actions Commit: c1e5454 Started: 03/28/2023 08:28:17am UTC
|
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Availablity tests Date Overrides
Retry 1 • Initial Attempt |
0% (0)0 / 192 runsfailed over last 7 days |
6.77% (13)13 / 192 runsflaked over last 7 days |
9ea5967
to
5429e09
Compare
20b2b62
to
9e6004f
Compare
// Use WEBAPP_URL till full page reload problem with website URL is solved | ||
calOrigin: WEBAPP_URL, | ||
}; | ||
this.api = new CalApi(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the public facing api is stored here,
|
||
// We need to keep in mind that autoscroll is meant to solve the problem when on a certain view(which is availability page right now), the height goes too high and then suddenly it becomes normal | ||
(config as unknown as any).__autoScroll = !!(config as unknown as any).__autoScroll; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't being used now. AutoScroll is automatically handled in a better way,
config.embedType = "modal"; | ||
const iframe = this.createIframe({ calLink, queryObject: Cal.getQueryObject(config) }); | ||
const iframe = this.cal.createIframe({ calLink, calOrigin, queryObject: Cal.getQueryObject(config) }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because 'modal' is a method on CalApi now, refer to createIframe through this.cal
api("modal", { | ||
calLink: path, | ||
config, | ||
uid: modalUniqueId, | ||
calOrigin, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modal now supports configuring calOrigin
.
// Install Cal Embed Code Snippet | ||
(function (C, A, L) { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the snippet included in preview.ts. It is already typed well in embed-snippet, so no need to focus on types here.
return; | ||
} | ||
p(cal, ar); | ||
}; | ||
})(window, EMBED_LIB_URL, "init"); | ||
|
||
const previewWindow = window; | ||
previewWindow.Cal.fingerprint = import.meta.env.EMBED_PUBLIC_EMBED_FINGER_PRINT as string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Store fingerprint on Cal in preview also.
origin: WEBAPP_URL, | ||
}); | ||
const searchParams = new URL(document.URL).searchParams; | ||
const embedType = searchParams.get("embedType"); | ||
const calLink = searchParams.get("calLink"); | ||
if (embedType! === "inline") { | ||
previewWindow.Cal!("inline", { | ||
if (!calLink) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There can't be a preview without providing calLink
@@ -9,6 +9,53 @@ function _fireEvent(fullName: string, detail: CustomEventDetail) { | |||
window.dispatchEvent(event); | |||
} | |||
|
|||
export type EventDataMap = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a map of all events/actions and their data.
@@ -1,6 +1,7 @@ | |||
{ | |||
"extends": "@calcom/tsconfig/base.json", | |||
"compilerOptions": { | |||
"target": "ES2015", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
observedAttributes work on ES2015 plus only.
@@ -0,0 +1,10 @@ | |||
<html> | |||
<head> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a separate test page to test floating popup with embed-react. Earlier it was tested along with inline and it had side effects of inline usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self review done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this PR do?
Fixes #7472
Fixes #7580. See loom of how
enabledDateButton
bg is changing again and againbranding
andalign
wasn't working.calOrigin
withmodal
andfloatingButton
instructions.calOrigin
prop ininit
instruction(but also keepsorigin
for backward compatibility) to keep it consistent with other places.Environment: Production
Type of change
How should this be tested?
Checklist