The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
added suspense boundaries
Steven Teyf59ba583e155
diff --git a/apps/web/app/app.dub.co/(auth)/auth/saml/page.tsx b/apps/web/app/app.dub.co/(auth)/auth/saml/page.tsxindex 5d373663dd..ea0ca5c2c2 100644--- a/apps/web/app/app.dub.co/(auth)/auth/saml/page.tsx+++ b/apps/web/app/app.dub.co/(auth)/auth/saml/page.tsx@@ -1,10 +1,13 @@-import { LoadingSpinner } from "@dub/ui";+import { Suspense } from "react";import SAMLIDPForm from "./form";+import { LoadingSpinner } from "@dub/ui";export default function SAMLPage() {return (<div>- <SAMLIDPForm />+ <Suspense>+ <SAMLIDPForm />+ </Suspense><div className="flex h-screen flex-col items-center justify-center space-y-6 text-center"><h1 className="font-display text-4xl font-bold">Authenticating</h1><p className="text-lg text-gray-600">diff --git a/apps/web/app/app.dub.co/(auth)/welcome/page.tsx b/apps/web/app/app.dub.co/(auth)/welcome/page.tsxindex 5aad7058fa..b35c535844 100644--- a/apps/web/app/app.dub.co/(auth)/welcome/page.tsx+++ b/apps/web/app/app.dub.co/(auth)/welcome/page.tsx@@ -1,10 +1,15 @@import { constructMetadata } from "@dub/utils";import WelcomePageClient from "./page-client";+import { Suspense } from "react";export const metadata = constructMetadata({title: "Welcome to Dub",});export default function WelcomePage() {- return <WelcomePageClient />;+ return (+ <Suspense>+ <WelcomePageClient />+ </Suspense>+ );}diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/billing/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/billing/page.tsxindex 93125ff8b4..068ddf5348 100644--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/billing/page.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/billing/page.tsx@@ -1,5 +1,10 @@+import { Suspense } from "react";import ProjectBillingClient from "./page-client";export default function ProjectBilling() {- return <ProjectBillingClient />;+ return (+ <Suspense>+ <ProjectBillingClient />+ </Suspense>+ );}diff --git a/apps/web/app/app.dub.co/(dashboard)/settings/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/settings/page-client.tsxindex 425b710c36..428fcb7864 100644--- a/apps/web/app/app.dub.co/(dashboard)/settings/page-client.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/settings/page-client.tsx@@ -5,22 +5,10 @@ import { useSession } from "next-auth/react";import { toast } from "sonner";import UploadAvatar from "@/ui/account/upload-avatar";import DeleteAccountSection from "@/ui/account/delete-account";-import { useSearchParams } from "next/navigation";-import { useEffect } from "react";export default function SettingsPageClient() {const { data: session, update, status } = useSession();- const searchParams = useSearchParams();-- useEffect(() => {- if (searchParams?.get("google") === "true") {- toast.success(- "Successfully connected your Google account! You can log in with Google from now on.",- );- }- }, [searchParams]);-return (<><Formdiff --git a/apps/web/package.json b/apps/web/package.jsonindex 5c7d84af47..cec2a0c0a6 100644--- a/apps/web/package.json+++ b/apps/web/package.json@@ -20,8 +20,8 @@"@prisma/client": "^5.2.0","@react-email/components": "^0.0.7","@sindresorhus/slugify": "^2.2.1",- "@splinetool/react-spline": "^2.2.3",- "@splinetool/runtime": "^0.9.146",+ "@splinetool/react-spline": "^2.2.6",+ "@splinetool/runtime": "^0.9.481","@stripe/stripe-js": "^1.44.1","@upstash/qstash": "^0.3.6","@upstash/ratelimit": "^0.3.6",diff --git a/apps/web/ui/links/links-container.tsx b/apps/web/ui/links/links-container.tsxindex d71e22382d..dc1f9e00e1 100644--- a/apps/web/ui/links/links-container.tsx+++ b/apps/web/ui/links/links-container.tsx@@ -9,6 +9,7 @@ import LinkFilters from "./link-filters";import LinkPagination from "./link-pagination";import LinkSort from "./link-sort";import NoLinksPlaceholder from "./no-links-placeholder";+import { Suspense } from "react";export default function LinksContainer({AddEditLinkButton,@@ -24,18 +25,24 @@ export default function LinksContainer({<MaxWidthWrapper><div className="my-5 flex h-10 w-full justify-center lg:justify-end"><LinkFiltersButton />- <LinkSort />+ <Suspense>+ <LinkSort />+ </Suspense></div><div className="grid grid-cols-1 gap-5 lg:grid-cols-7"><div className="scrollbar-hide sticky top-32 col-span-2 hidden max-h-[calc(100vh-150px)] self-start overflow-auto rounded-lg border border-gray-100 bg-white shadow lg:block">- <LinkFilters />+ <Suspense>+ <LinkFilters />+ </Suspense></div><div className="col-span-1 auto-rows-min grid-cols-1 lg:col-span-5"><ul className="grid min-h-[66.5vh] auto-rows-min gap-3">{links && !isValidating ? (links.length > 0 ? (links.map((props) => (- <LinkCard key={props.id} props={props} />+ <Suspense fallback={<LinkCardPlaceholder />}>+ <LinkCard key={props.id} props={props} />+ </Suspense>))) : (<NoLinksPlaceholder AddEditLinkButton={AddEditLinkButton} />@@ -46,7 +53,11 @@ export default function LinksContainer({)))}</ul>- {links && links.length > 0 && <LinkPagination />}+ {links && links.length > 0 && (+ <Suspense>+ <LinkPagination />+ </Suspense>+ )}</div></div></MaxWidthWrapper>diff --git a/apps/web/ui/modals/link-filters-modal.tsx b/apps/web/ui/modals/link-filters-modal.tsxindex 7065930404..3c842fd98e 100644--- a/apps/web/ui/modals/link-filters-modal.tsx+++ b/apps/web/ui/modals/link-filters-modal.tsx@@ -3,6 +3,7 @@ import { ChevronDown, Filter } from "lucide-react";import {Dispatch,SetStateAction,+ Suspense,useCallback,useMemo,useState,@@ -21,7 +22,9 @@ function LinkFiltersModal({showModal={showLinkFiltersModal}setShowModal={setShowLinkFiltersModal}>- <LinkFilters />+ <Suspense>+ <LinkFilters />+ </Suspense></Modal>);}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex fc5949975d..58e6f932cd 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -62,11 +62,11 @@ importers:specifier: ^2.2.1version: 2.2.1'@splinetool/react-spline':- specifier: ^2.2.3+ specifier: ^2.2.6'@splinetool/runtime':- specifier: ^0.9.146- version: 0.9.146+ specifier: ^0.9.481+ version: 0.9.481'@stripe/stripe-js':specifier: ^1.44.1version: 1.44.1@@ -5784,23 +5784,25 @@ packages:tslib: 2.6.2dev: false- /@splinetool/[email protected](@splinetool/[email protected])([email protected])([email protected]):- resolution: {integrity: sha512-KdvyP2cCLLG/PcHp0ObE147nhawY4R/iqI6733MSWBx4KSpeo4oD589rCPuXeGdgyr2lCtZqUQOkQj4QCnXxmw==}+ /@splinetool/[email protected](@splinetool/[email protected])([email protected])([email protected]):+ resolution: {integrity: sha512-y9L2VEbnC6FNZZu8XMmWM9YTTTWal6kJVfP05Amf0QqDNzCSumKsJxZyGUODvuCmiAvy0PfIfEsiVKnSxvhsDw==}peerDependencies:'@splinetool/runtime': '*'react: '>=17.0.0'react-dom: '>=17.0.0'dependencies:- '@splinetool/runtime': 0.9.146+ '@splinetool/runtime': 0.9.481+ lodash.debounce: 4.0.8react: 18.2.0react-dom: 18.2.0([email protected])- react-merge-refs: 1.1.0+ react-merge-refs: 2.1.1dev: false- /@splinetool/[email protected]:- resolution: {integrity: sha512-6yuBu7LN9OP60cZfZoLFTXXvIuwcXjXSDnf/c3nG0dCsChrlX2/zs/iAmdWBN8ugpO4MnaodLMX0HXGHQBMz0w==}+ /@splinetool/[email protected]:+ resolution: {integrity: sha512-qN/GpjP1Qe3WE+ikbtwqlAm1Rg3GqEDZeD5QgEkZFItzpNhEyhXoGTIwcqp9x6a67yFY1fuW1nMUJmVru44NRg==}dependencies:on-change: 4.0.2+ semver-compare: 1.0.0dev: false/@sqltools/[email protected]:@@ -12072,8 +12074,8 @@ packages:react-dom: 18.2.0([email protected])dev: false- resolution: {integrity: sha512-alTKsjEL0dKH/ru1Iyn7vliS2QRcBp9zZPGoWxUOvRGWPUYgjo+V01is7p04It6KhgrzhJGnIj9GgX8W4bZoCQ==}+ resolution: {integrity: sha512-jLQXJ/URln51zskhgppGJ2ub7b2WFKGq3cl3NYKtlHoTG+dN2q7EzWrn3hN3EgPsTMvpR9tpq5ijdp7YwFZkag==}dev: false@@ -12748,6 +12750,10 @@ packages:parseley: 0.11.0dev: false+ resolution: {integrity: sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==}+ dev: false+resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==}hasBin: true