Skip to content

Commit

Permalink
add incremental PPR
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed Jun 14, 2024
1 parent c436705 commit 3e410fe
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
14 changes: 8 additions & 6 deletions patches/fumadocs-mdx+8.2.31.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
diff --git a/node_modules/fumadocs-mdx/dist/.DS_Store b/node_modules/fumadocs-mdx/dist/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/node_modules/fumadocs-mdx/dist/.DS_Store differ
index 0000000..e69de29
diff --git a/node_modules/fumadocs-mdx/dist/chunk-2D5JCHQ5.mjs b/node_modules/fumadocs-mdx/dist/chunk-2D5JCHQ5.mjs
new file mode 100644
index 0000000..8c26a76
index 0000000..512fcbb
--- /dev/null
+++ b/node_modules/fumadocs-mdx/dist/chunk-2D5JCHQ5.mjs
@@ -0,0 +1,303 @@
@@ -0,0 +1,306 @@
+// src/config.ts
+import path2 from "node:path";
+import {
Expand Down Expand Up @@ -236,7 +235,9 @@ index 0000000..8c26a76
+ ...nextConfig,
+ pageExtensions: nextConfig.pageExtensions ?? defaultPageExtensions,
+ experimental: {
+ ...nextConfig.experimental,
+ turbo: {
+ ...nextConfig.experimental?.turbo,
+ rules: {
+ "*.{md,mdx}": [
+ {
Expand All @@ -255,8 +256,9 @@ index 0000000..8c26a76
+ ...loadOptions
+ }
+ }
+ ]
+ }
+ ],
+ ...nextConfig.experimental?.turbo?.rules
+ },
+ }
+ },
+ webpack: (config, options) => {
Expand Down
2 changes: 2 additions & 0 deletions site/app/registry/[title]/[version]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { type Plugin, PluginPage } from "@/components/plugin-page";
import { getPluginData, getPlugins } from "@/lib/registry";
import type { Metadata } from "next";

export const experimental_ppr = true

const Page = async ({
params,
}: {
Expand Down
2 changes: 2 additions & 0 deletions site/app/registry/[title]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { type Plugin, PluginPage } from "@/components/plugin-page";
import { getPluginData, getPlugins } from "@/lib/registry";
import type { Metadata } from "next";

export const experimental_ppr = true

const Page = async ({ params }: { params: { title: string } }) => {
const plugin = params.title;
const pluginData = await getPluginData(plugin);
Expand Down
2 changes: 0 additions & 2 deletions site/components/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ export const Toolbar = () => {
return null;
}

console.log("enabling toolbar for admin");

return <VercelToolbar />;
};
6 changes: 5 additions & 1 deletion site/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@ import { clerkMiddleware } from "@clerk/nextjs/server";
export default clerkMiddleware();

export const config = {
matcher: ["/((?!.*\\..*|_next).*)", "/", "/(api|trpc)(.*)"],
matcher: [
"/registry/(.*)?",
"/cockpit/(.*)?",
"/(api|trpc)(.*)"
],
};
4 changes: 1 addition & 3 deletions site/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ const rootMapPath = ".map.ts";

const wit = JSON.parse(fs.readFileSync("wit.tmLanguage.json", "utf8"));

const rootMapFile = path.resolve(cwd, rootMapPath);

const withMDX = createMDX({
mdxOptions: {
providerImportSource: "@/mdx-components",
Expand Down Expand Up @@ -42,7 +40,7 @@ const config = {
// typedRoutes: true,
// serverMinification: true,
// serverSourceMaps: true,
ppr: true,
ppr: "incremental",
mdxRs: true,
},
typescript: {
Expand Down

0 comments on commit 3e410fe

Please sign in to comment.