Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PPR #745

Merged
merged 9 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dashboard/final-example/app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import SideNav from '@/app/ui/dashboard/sidenav';

export const experimental_ppr = true;

export default function Layout({ children }: { children: React.ReactNode }) {
return (
<div className="flex h-screen flex-col md:flex-row md:overflow-hidden">
Expand Down
4 changes: 2 additions & 2 deletions dashboard/final-example/app/ui/invoices/create-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import {
UserCircleIcon,
} from '@heroicons/react/24/outline';
import { Button } from '@/app/ui/button';
import { createInvoice } from '@/app/lib/actions';
import { createInvoice, State } from '@/app/lib/actions';
import { useFormState } from 'react-dom';

export default function Form({ customers }: { customers: CustomerField[] }) {
const initialState = { message: null, errors: {} };
const initialState: State = { message: null, errors: {} };
const [state, dispatch] = useFormState(createInvoice, initialState);

return (
Expand Down
4 changes: 2 additions & 2 deletions dashboard/final-example/app/ui/invoices/edit-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@heroicons/react/24/outline';
import Link from 'next/link';
import { Button } from '@/app/ui/button';
import { updateInvoice } from '@/app/lib/actions';
import { updateInvoice, State } from '@/app/lib/actions';
import { useFormState } from 'react-dom';

export default function EditInvoiceForm({
Expand All @@ -19,7 +19,7 @@ export default function EditInvoiceForm({
invoice: InvoiceForm;
customers: CustomerField[];
}) {
const initialState = { message: null, errors: {} };
const initialState: State = { message: null, errors: {} };
const updateInvoiceWithId = updateInvoice.bind(null, invoice.id);
const [state, dispatch] = useFormState(updateInvoiceWithId, initialState);

Expand Down
9 changes: 9 additions & 0 deletions dashboard/final-example/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import('next').NextConfig} */

const nextConfig = {
experimental: {
ppr: 'incremental',
},
};

export default nextConfig;
2 changes: 1 addition & 1 deletion dashboard/final-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"autoprefixer": "10.4.15",
"bcrypt": "^5.1.1",
"clsx": "^2.0.0",
"next": "15.0.0-rc.0",
"next": "15.0.0-canary.28",
"next-auth": "^5.0.0-beta.4",
"postcss": "8.4.31",
"react": "19.0.0-rc-6230622a1a-20240610",
Expand Down
86 changes: 43 additions & 43 deletions dashboard/final-example/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dashboard/final-example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand Down
4 changes: 0 additions & 4 deletions dashboard/starter-example/next.config.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};

module.exports = nextConfig;
export default nextConfig;
2 changes: 1 addition & 1 deletion dashboard/starter-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"autoprefixer": "10.4.15",
"bcrypt": "^5.1.1",
"clsx": "^2.0.0",
"next": "15.0.0-rc.0",
"next": "15.0.0-canary.28",
"postcss": "8.4.31",
"react": "19.0.0-rc-6230622a1a-20240610",
"react-dom": "19.0.0-rc-6230622a1a-20240610",
Expand Down
Loading
Loading