Skip to content

Commit

Permalink
* remove swcMinify because it is default now
Browse files Browse the repository at this point in the history
* params needs to be awaited using dynamic apis
  • Loading branch information
aromko committed Dec 23, 2024
1 parent 0285f7c commit 30385b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
10 changes: 3 additions & 7 deletions docs/app/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ import { TocContainer } from '@/ui/Toc';
import { Mdx } from '@/ui/mdx';

interface ContentPageProps {
params: {
slug: string[];
};
params: Promise<{ slug: string[] }>;
}

async function getPageFromParams(params: ContentPageProps['params']) {
const slug = params?.slug?.join('/');
const slug = (await params)?.slug?.join('/');
const page = allContentPages.find(page => page.slug === slug);

return page || null;
Expand Down Expand Up @@ -49,9 +47,7 @@ export async function generateMetadata({
: {};
}

export async function generateStaticParams(): Promise<
ContentPageProps['params'][]
> {
export async function generateStaticParams(): Promise<{ slug: string[] }[]> {
return allContentPages.map(page => ({
slug: page.slug.split('/'),
}));
Expand Down
7 changes: 3 additions & 4 deletions docs/app/releases/blog/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import { TocContainer } from '@/ui/Toc';
import { Mdx } from '@/ui/mdx';

interface BlogPostProps {
params: {
slug: string[];
};
params: Promise<{ slug: string[] }>;
}
async function getPostFromParams(params: BlogPostProps['params']) {
const fullPath = `releases/blog/${params.slug}`;
const { slug } = await params;
const fullPath = `releases/blog/${slug}`;
const currentPost = allBlogs.find(post => post.slug === fullPath);

return currentPost || null;
Expand Down
1 change: 0 additions & 1 deletion docs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const pkg = require('./package.json');
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
swcMinify: true,
distDir: '.next',
eslint: {
ignoreDuringBuilds: true,
Expand Down

0 comments on commit 30385b2

Please sign in to comment.