fix(public): fix problems with building #2

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-11-13 22:12:17 +01:00
parent 915e8f4dbf
commit eab92bb780
9 changed files with 97 additions and 96 deletions

View File

@@ -3,15 +3,16 @@ import { Faq } from '@/components/sections/faq';
import { Features } from '@/components/sections/features';
import { Pricing } from '@/components/sections/pricing';
import { Sdks } from '@/components/sections/sdks';
import { Stats } from '@/components/sections/stats';
import { Stats, StatsPure } from '@/components/sections/stats';
import { Testimonials } from '@/components/sections/testimonials';
import type { Metadata } from 'next';
import { Suspense } from 'react';
export const metadata: Metadata = {
title: 'An open-source alternative to Mixpanel',
};
export const revalidate = 3600;
export const experimental_ppr = true;
export default function HomePage() {
return (
@@ -19,7 +20,17 @@ export default function HomePage() {
<Hero />
<Features />
<Testimonials />
<Stats />
<Suspense
fallback={
<StatsPure
projectCount={882}
eventCount={634_000_000}
last24hCount={7_000_000}
/>
}
>
<Stats />
</Suspense>
<Faq />
<Pricing />
<Sdks />

View File

@@ -27,18 +27,7 @@ const getProjectsWithCount = cacheable(async function getProjectsWithCount() {
return { projects, last24hCount: last24h[0]?.count || 0 };
}, 60 * 60);
export default Stats;
export function Stats() {
return (
<Suspense
fallback={<StatsPure projectCount={0} eventCount={0} last24hCount={0} />}
>
<StatsServer />
</Suspense>
);
}
export async function StatsServer() {
export async function Stats() {
const { projects, last24hCount } = await getProjectsWithCount();
const projectCount = projects.length;
const eventCount = projects.reduce((acc, { count }) => acc + count, 0);

View File

@@ -1,7 +1,6 @@
import type { TableOfContents } from 'fumadocs-core/server';
import { ArrowRightIcon } from 'lucide-react';
import Link from 'next/link';
import type React from 'react';
interface Props {
toc: TableOfContents;

View File

@@ -8,6 +8,9 @@ const config = {
images: {
domains: ['localhost', 'openpanel.dev'],
},
// experimental: {
// ppr: 'incremental', // does not work with hyperdx?!
// },
transpilePackages: [
'@openpanel/queue',
'@openpanel/db',

View File

@@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "pnpm with-env next dev",
"build": "next build",
"build": "pnpm with-env next build",
"start": "next start",
"postinstall": "fumadocs-mdx",
"with-env": "dotenv -e ../../.env -c --"
@@ -29,7 +29,7 @@
"fumadocs-ui": "14.1.1",
"geist": "^1.3.1",
"lucide-react": "^0.454.0",
"next": "15.0.1",
"next": "15.0.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"rehype-external-links": "^3.0.0",