From 47e4240bdf438c39c2f3fd362ab66d6eb9a95a97 Mon Sep 17 00:00:00 2001 From: Kevin Van Cott Date: Fri, 1 Aug 2025 17:36:54 -0500 Subject: [PATCH 1/4] fix: homepage errors and nested links --- src/routes/_libraries/index.tsx | 12 ++++++--- src/utils/partners.tsx | 43 +++++++++++++++++++-------------- 2 files changed, 34 insertions(+), 21 deletions(-) diff --git a/src/routes/_libraries/index.tsx b/src/routes/_libraries/index.tsx index 00f8cba32..0fa34a40f 100644 --- a/src/routes/_libraries/index.tsx +++ b/src/routes/_libraries/index.tsx @@ -1,5 +1,4 @@ import { Await, Link, MatchRoute, getRouteApi } from '@tanstack/react-router' -import { Carbon } from '~/components/Carbon' import { twMerge } from 'tailwind-merge' import { CgSpinner } from 'react-icons/cg' import { Footer } from '~/components/Footer' @@ -13,10 +12,11 @@ import { partners } from '../../utils/partners' import OpenSourceStats from '~/components/OpenSourceStats' import splashLightImg from '~/images/splash-light.png' import splashDarkImg from '~/images/splash-dark.png' -import { GamFooter } from '~/components/Gam' import LandingPageGad from '~/components/LandingPageGad' import { MaintainerCard } from '~/components/MaintainerCard' import { coreMaintainers } from '~/libraries/maintainers' +import { Suspense } from 'react' +import { ErrorBoundary } from '@sentry/react' export const textColors = [ `text-rose-500`, @@ -139,7 +139,13 @@ function Index() {
- +
+ }> + }> + + + +
diff --git a/src/utils/partners.tsx b/src/utils/partners.tsx index dcc09ddfb..ad92d28a6 100644 --- a/src/utils/partners.tsx +++ b/src/utils/partners.tsx @@ -1,4 +1,3 @@ -import { Link } from '@tanstack/react-router' import agGridDarkSvg from '~/images/ag-grid-dark.svg' import agGridLightSvg from '~/images/ag-grid-light.svg' import nozzleImage from '~/images/nozzle.png' @@ -223,15 +222,16 @@ const agGrid = (() => { for the entire JS/TS ecosystem. Whether it's a lightweight table or a complex datagrid, we've we've got you covered.
- { + window.location.href = '/blog/ag-grid-partnership' }} className="text-blue-500 uppercase font-black text-sm" > Learn More - + ), } @@ -365,25 +365,32 @@ const uiDev = (() => { TanStack's priority is to make its users productive, efficient and knowledgeable about web dev. To help us on this quest, we've partnered with{' '} - + window.open( + 'https://ui.dev/?utm_source=tanstack&utm_campaign=tanstack', + '_blank', + 'noopener,noreferrer' + ) + } + tabIndex={0} > ui.dev - {' '} + {' '} to provide best-in-class education about TanStack products. It doesn't stop at TanStack though, with their sister product{' '} - window.open(href, '_blank', 'noopener,noreferrer')} + tabIndex={0} > Bytes.dev - {' '} + {' '} as our official newsletter partner, you'll be able to{' '} stay up to date with the latest and greatest in the web dev world regardless. From 89bd74c82ef554f0f792e60a462295c6c794b144 Mon Sep 17 00:00:00 2001 From: Kevin Van Cott Date: Fri, 1 Aug 2025 17:37:56 -0500 Subject: [PATCH 2/4] format --- src/routes/_libraries/index.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/routes/_libraries/index.tsx b/src/routes/_libraries/index.tsx index 0fa34a40f..7dae87f26 100644 --- a/src/routes/_libraries/index.tsx +++ b/src/routes/_libraries/index.tsx @@ -139,13 +139,13 @@ function Index() {
-
- }> - }> - - - -
+
+ }> + }> + + + +
From ad27307ed10a65a1aad4eeaa2f7169e0e751372b Mon Sep 17 00:00:00 2001 From: Kevin Van Cott Date: Fri, 1 Aug 2025 17:44:47 -0500 Subject: [PATCH 3/4] use blank error boundary around OpenSourceStats --- src/components/BlankErrorBoundary.tsx | 35 +++++++++++++++++++++++++++ src/components/OpenSourceStats.tsx | 14 ++++++++++- src/routes/_libraries/index.tsx | 11 +-------- 3 files changed, 49 insertions(+), 11 deletions(-) create mode 100644 src/components/BlankErrorBoundary.tsx diff --git a/src/components/BlankErrorBoundary.tsx b/src/components/BlankErrorBoundary.tsx new file mode 100644 index 000000000..f0faa9a2f --- /dev/null +++ b/src/components/BlankErrorBoundary.tsx @@ -0,0 +1,35 @@ +import React, { Component, ReactNode } from 'react' + +interface Props { + children: ReactNode +} + +interface State { + hasError: boolean +} + +export class BlankErrorBoundary extends Component { + constructor(props: Props) { + super(props) + this.state = { hasError: false } + } + + static getDerivedStateFromError(_: Error): State { + // Update state so the next render will show the fallback UI + return { hasError: true } + } + + componentDidCatch(error: Error, errorInfo: React.ErrorInfo) { + // You can log the error to an error reporting service here + console.error('BlankErrorBoundary caught an error:', error, errorInfo) + } + + render() { + if (this.state.hasError) { + // Render nothing when an error occurs + return null + } + + return this.props.children + } +} diff --git a/src/components/OpenSourceStats.tsx b/src/components/OpenSourceStats.tsx index 3629f6371..6aa287a06 100644 --- a/src/components/OpenSourceStats.tsx +++ b/src/components/OpenSourceStats.tsx @@ -7,6 +7,8 @@ import { FaCube, FaStar, FaUsers } from 'react-icons/fa' import { FaDownload } from 'react-icons/fa' import convexImageWhite from '~/images/convex-white.svg' import convexImageDark from '~/images/convex-dark.svg' +import { BlankErrorBoundary } from './BlankErrorBoundary' +import { Suspense } from 'react' const StableCounter = ({ value, @@ -58,7 +60,7 @@ const NpmDownloadCounter = ({ return } -export default function OssStats() { +function _OssStats() { const { data: github } = useSuspenseQuery( convexQuery(api.stats.getGithubOwner, { owner: 'tanstack', @@ -156,3 +158,13 @@ export default function OssStats() {
) } + +export default function OssStats() { + return ( + }> + + <_OssStats /> + + + ) +} diff --git a/src/routes/_libraries/index.tsx b/src/routes/_libraries/index.tsx index 7dae87f26..b1add2f5f 100644 --- a/src/routes/_libraries/index.tsx +++ b/src/routes/_libraries/index.tsx @@ -5,7 +5,6 @@ import { Footer } from '~/components/Footer' import SponsorPack from '~/components/SponsorPack' import discordImage from '~/images/discord-logo-white.svg' import { useMutation } from '~/hooks/useMutation' -import { sample } from '~/utils/utils' import { librariesByGroup, librariesGroupNamesMap, Library } from '~/libraries' import bytesImage from '~/images/bytes.svg' import { partners } from '../../utils/partners' @@ -15,8 +14,6 @@ import splashDarkImg from '~/images/splash-dark.png' import LandingPageGad from '~/components/LandingPageGad' import { MaintainerCard } from '~/components/MaintainerCard' import { coreMaintainers } from '~/libraries/maintainers' -import { Suspense } from 'react' -import { ErrorBoundary } from '@sentry/react' export const textColors = [ `text-rose-500`, @@ -73,9 +70,7 @@ function Index() { fn: bytesSignupServerFn, }) - const { randomNumber } = Route.useLoaderData() const { sponsorsPromise } = librariesRouteApi.useLoaderData() - const gradient = sample(gradients, randomNumber) return ( <> @@ -140,11 +135,7 @@ function Index() {
- }> - }> - - - +
From 1b8b879a62b4221af78e9cacc1bcd9c9f2866b60 Mon Sep 17 00:00:00 2001 From: Kevin Van Cott Date: Fri, 1 Aug 2025 17:45:41 -0500 Subject: [PATCH 4/4] remove extra div --- src/routes/_libraries/index.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/routes/_libraries/index.tsx b/src/routes/_libraries/index.tsx index b1add2f5f..e4bd334c8 100644 --- a/src/routes/_libraries/index.tsx +++ b/src/routes/_libraries/index.tsx @@ -134,9 +134,7 @@ function Index() {
-
- -
+