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

fix: location for `@calcom/embed-react` types

Open hariombalhara opened this issue 2 years ago • 5 comments

What does this PR do?

Fixes #9089

I think when we upgraded Vite, the location for generated types got changed somehow. This PR uses the correct location now.

Also, floatingButton config support is live but it's typings won't work if people are using getCalApi. It also fixes that by upgrading @calcom/embed-core

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

  • Make a simple nextjs project. in TypeScript
  • Add @calcom/embed-react as a dependency
  • Use this sample code
  • Notice that you would recieve TypeScript errors
  • Build packages/embeds/embed-react and copy the content to the nextjs project's node_modules/@calcom/embed-react. It should fix the issue. You can also simply try tweaking the types property of package.json in node_modules/@calcom/embed-react Screenshot 2023-05-24 at 6 14 20 PM

Followup

  • [ ] This bug never came up during local testing as in local testing we are testing the source code and not the built code that's published. Created a ticket to be able to test that in CI https://github.com/calcom/cal.com/issues/9091

Checklist

  • I haven't added tests that prove my fix is effective or that my feature works

hariombalhara avatar May 24 '23 13:05 hariombalhara

CAL-1756 @calcom/[email protected] doesn't have types available. Build would fail for projects using it.

It looks like when we upgraded Vite here , the location of the types that are generated got changed and that's causing types to be not available.

linear[bot] avatar May 24 '23 13:05 linear[bot]

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

Name Status Preview Comments Updated (UTC)
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 29, 2023 7:35pm
cal ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 29, 2023 7:35pm
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 29, 2023 7:35pm

vercel[bot] avatar May 24 '23 13:05 vercel[bot]

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

Ten 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)
/[user]/book 255.7 KB 406.66 KB 116.19% (🟢 -0.14%)
/apps/[slug]/[...pages] 458.86 KB 609.81 KB 174.23% (🟡 +0.25%)
/auth/setup 174.78 KB 325.73 KB 93.07% (🟡 +0.16%)
/d/[link]/book 255.35 KB 406.3 KB 116.09% (🟢 -0.14%)
/event-types/[type] 480.08 KB 631.03 KB 180.29% (🟡 +0.19%)
/getting-started/[[...step]] 426.18 KB 577.13 KB 164.89% (🟢 -0.22%)
/new-booker/[user]/[type] 290.92 KB 441.88 KB 126.25% (🟢 -0.14%)
/new-booker/team/[slug]/[type] 290.93 KB 441.88 KB 126.25% (🟢 -0.14%)
/settings/my-account/calendars 252.26 KB 403.21 KB 115.20% (🟢 -0.23%)
/team/[slug]/book 255.35 KB 406.31 KB 116.09% (🟢 -0.14%)
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 "+/-

github-actions[bot] avatar May 24 '23 13:05 github-actions[bot]

Current Playwright Test Results Summary

✅ 113 Passing - ❌ 1 Failing - ⚠️ 2 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 05/29/2023 08:11:25pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: df7548e7d85b55a70a1a18bc821b46ffa89a4daf

Started: 05/29/2023 08:01:27pm UTC

❌ Failures

📄   apps/web/playwright/login.e2e.ts • 1 Failure

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
user can login & logout succesfully login flow user & logout using dashboard
Retry 2Retry 1Initial Attempt
Error: page.waitForURL: Timeout 15000ms exceeded....
page.waitForURL: Timeout 15000ms exceeded.
=========================== logs ===========================
waiting for navigation to "/auth/logout" until "load"
  navigated to "http://127.0.0.1:3000/auth/logout"
  navigated to "http://127.0.0.1:3000/auth/logout"
============================================================
8.22% (30) 30 / 365 runs
failed over last 7 days
0.55% (2) 2 / 365 runs
flaked over last 7 days

⚠️ Flakes

📄   apps/web/playwright/booking-seats.e2e.ts • 2 Flakes

Top 1 Common Error Messages

null

2 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking with Seats -- new-booker Reschedule for booking with seats -- old-booker Should reschedule booking with seats and if everyone rescheduled it should be deleted
Retry 1Initial Attempt
0% (0) 0 / 378 runs
failed over last 7 days
88.10% (333) 333 / 378 runs
flaked over last 7 days
Booking with Seats -- old-booker Reschedule for booking with seats -- new-booker Should reschedule booking with seats and if everyone rescheduled it should be deleted
Retry 1Initial Attempt
0% (0) 0 / 374 runs
failed over last 7 days
19.52% (73) 73 / 374 runs
flaked over last 7 days

View Detailed Build Results


deploysentinel[bot] avatar May 24 '23 13:05 deploysentinel[bot]

@zomars As it was a simple change and important bug fix, I published it already to npm. But the PR needs to be merged too so that npm package and code here are in the same state. Now, the codesandbox is also showing the types correctly.

Screenshot 2023-05-24 at 6 51 42 PM

hariombalhara avatar May 24 '23 13:05 hariombalhara