Next.js 15 Update (#26)
* Update Next.js and React versions in all packages * Replace onRedirect function with next/link in BillingSessionStatus, since it's no longer cached by default * Remove unused revalidatePath import in billing return page, since it's no longer cached by default * Add Turbopack module aliases to improve development server speed * Converted new Dynamic APIs to be Promise-based * Adjust mobile layout * Use ENABLE_REACT_COMPILER to enable the React Compiler in Next.js 15 * Report Errors using the new onRequestError hook
This commit is contained in:
committed by
GitHub
parent
93cb011260
commit
5b9285a575
@@ -1,6 +1,5 @@
|
||||
import 'server-only';
|
||||
|
||||
import { unstable_noStore as noStore } from 'next/cache';
|
||||
import { cookies } from 'next/headers';
|
||||
|
||||
import { createClient } from '@supabase/supabase-js';
|
||||
@@ -33,9 +32,6 @@ function createServerSupabaseClient<
|
||||
export function getSupabaseServerActionClient<
|
||||
GenericSchema extends Database = Database,
|
||||
>(params?: { admin: boolean }) {
|
||||
// prevent any caching (to be removed in Next v15)
|
||||
noStore();
|
||||
|
||||
const keys = getSupabaseClientKeys();
|
||||
const admin = params?.admin ?? false;
|
||||
|
||||
@@ -55,16 +51,21 @@ export function getSupabaseServerActionClient<
|
||||
}
|
||||
|
||||
function getCookiesStrategy() {
|
||||
const cookieStore = cookies();
|
||||
|
||||
return {
|
||||
get: (name: string) => {
|
||||
return cookieStore.get(name)?.value;
|
||||
get: async (name: string) => {
|
||||
const cookieStore = await cookies();
|
||||
const cookie = cookieStore.get(name);
|
||||
|
||||
return cookie?.value;
|
||||
},
|
||||
set: (name: string, value: string, options: object) => {
|
||||
set: async (name: string, value: string, options: object) => {
|
||||
const cookieStore = await cookies();
|
||||
|
||||
cookieStore.set({ name, value, ...options });
|
||||
},
|
||||
remove: (name: string, options: object) => {
|
||||
remove: async (name: string, options: object) => {
|
||||
const cookieStore = await cookies();
|
||||
|
||||
cookieStore.set({
|
||||
name,
|
||||
value: '',
|
||||
|
||||
Reference in New Issue
Block a user