Skip to content

feat: Setups prisma accelerate#11324

Merged
zomars merged 18 commits intomainfrom
prisma/accelerate
Sep 19, 2023
Merged

feat: Setups prisma accelerate#11324
zomars merged 18 commits intomainfrom
prisma/accelerate

Conversation

@zomars
Copy link
Copy Markdown
Contributor

@zomars zomars commented Sep 12, 2023

What does this PR do?

  • Enables Prisma Accelerate extension
  • Suppress some resulting Vitest errors until we figure out the new typings (test are passing tho)

Requirement/Documentation

  • If there is a requirement document, please, share it here.
  • If there is ab UI/UX design document, please, share it here.

Type of change

  • Chore (refactoring code, technical debt, workflow improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How should this be tested?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my PR needs changes to the documentation
  • I haven't checked if my changes generate no new warnings
  • I haven't added tests that prove my fix is effective or that my feature works
  • I haven't checked if new and existing unit tests pass locally with my changes

zomars added 4 commits April 18, 2023 11:25
# Conflicts:
#	packages/prisma/package.json
#	packages/prisma/schema.prisma
#	packages/trpc/server/createContext.ts
#	yarn.lock
@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 12, 2023

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

Name Status Preview Comments Updated (UTC)
ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 19, 2023 8:51pm
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 19, 2023 8:51pm
cal-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 19, 2023 8:51pm
dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 19, 2023 8:51pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Sep 19, 2023 8:51pm
qa ⬜️ Ignored (Inspect) Visit Preview Sep 19, 2023 8:51pm
ui ⬜️ Ignored (Inspect) Visit Preview Sep 19, 2023 8:51pm

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 12, 2023

Thank you for following the naming conventions! 🙏

@zomars zomars added the core area: core, team members only label Sep 12, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 12, 2023

📦 Next.js Bundle Analysis for @calcom/web

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

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)
/_error 46.46 KB 201.98 KB 57.71% (🟡 +0.15%)
/workflows 276.81 KB 432.33 KB 123.52% (🟡 +0.15%)
/workflows/[workflow] 387.76 KB 543.28 KB 155.22% (🟡 +0.15%)
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.

@deploysentinel
Copy link
Copy Markdown

deploysentinel Bot commented Sep 12, 2023

No failed tests 🎉

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Sep 13, 2023

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@prisma/extension-accelerate 0.6.2 network +0 59.4 kB prismabot
@prisma/generator-helper 5.3.1 None +1 63 kB prismabot

🚮 Removed packages: @prisma/client@5.0.0, prisma@5.0.0

@keithwillcode keithwillcode added High priority Created by Linear-GitHub Sync performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive labels Sep 13, 2023

describe("Check Booking Limits Tests", () => {
it("Should return no errors", async () => {
// @ts-expect-error Prisma v5 typings are not yet available
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prisma client with extensions break Vitest deep Mocking

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any estimate on when this is coming? Maybe it is worth creating a follow-up issue to tackle this when the time comes

Comment on lines +53 to +54
// TODO: Re-enable once we get confirmation from compliance that this is okay.
// cacheStrategy: { ttl: 60, swr: 1 },
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Until we get confirmation from compliance @keithwillcode @ConnorGargano

Copy link
Copy Markdown
Contributor Author

@zomars zomars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready to review

@zomars zomars marked this pull request as ready for review September 19, 2023 20:25
leog
leog previously approved these changes Sep 19, 2023
Copy link
Copy Markdown
Contributor

@leog leog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


describe("Check Booking Limits Tests", () => {
it("Should return no errors", async () => {
// @ts-expect-error Prisma v5 typings are not yet available
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any estimate on when this is coming? Maybe it is worth creating a follow-up issue to tackle this when the time comes

isUser: true,
...(includeCredentials && { credentials: user.credentials }),
credentials: includeCredentials ? [] : user.credentials,
parent: null,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this an unrelated bug?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was messing with the type signature. This makes it more consistent

@zomars
Copy link
Copy Markdown
Contributor Author

zomars commented Sep 19, 2023

Pushed public API build fixes. Should be good to go.

@zomars zomars requested review from emrysal and leog September 19, 2023 20:42
@zomars zomars enabled auto-merge (squash) September 19, 2023 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only High priority Created by Linear-GitHub Sync performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants