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:
Giancarlo Buomprisco
2024-10-22 08:39:21 +02:00
committed by GitHub
parent 93cb011260
commit 5b9285a575
109 changed files with 5143 additions and 5545 deletions

View File

@@ -15,9 +15,9 @@
"./components": "./src/components/index.ts"
},
"dependencies": {
"@stripe/react-stripe-js": "^2.8.0",
"@stripe/stripe-js": "^4.6.0",
"stripe": "^16.12.0"
"@stripe/react-stripe-js": "^2.8.1",
"@stripe/stripe-js": "^4.9.0",
"stripe": "^17.2.1"
},
"devDependencies": {
"@kit/billing": "workspace:^",
@@ -28,10 +28,10 @@
"@kit/tailwind-config": "workspace:*",
"@kit/tsconfig": "workspace:*",
"@kit/ui": "workspace:^",
"@types/react": "^18.3.10",
"@types/react": "^18.3.11",
"date-fns": "^4.1.0",
"next": "14.2.13",
"react": "18.3.1",
"next": "15.0.0",
"react": "19.0.0-rc-69d4b800-20241021",
"zod": "^3.23.8"
},
"eslintConfig": {

View File

@@ -34,13 +34,16 @@ export async function createStripeCheckout(
const isSubscription = mode === 'subscription';
const trialSettings = params.plan.trialDays && enableTrialWithoutCreditCard ? {
trial_settings: {
end_behavior: {
missing_payment_method: 'cancel' as const,
},
},
} : {};
const trialSettings =
params.plan.trialDays && enableTrialWithoutCreditCard
? {
trial_settings: {
end_behavior: {
missing_payment_method: 'cancel' as const,
},
},
}
: {};
// this should only be set if the mode is 'subscription'
const subscriptionData:
@@ -96,11 +99,12 @@ export async function createStripeCheckout(
};
});
const paymentCollectionMethod = enableTrialWithoutCreditCard && params.plan.trialDays
? {
payment_method_collection: 'if_required' as const,
}
: {};
const paymentCollectionMethod =
enableTrialWithoutCreditCard && params.plan.trialDays
? {
payment_method_collection: 'if_required' as const,
}
: {};
return stripe.checkout.sessions.create({
mode,

View File

@@ -2,7 +2,7 @@ import 'server-only';
import { StripeServerEnvSchema } from '../schema/stripe-server-env.schema';
const STRIPE_API_VERSION = '2024-06-20';
const STRIPE_API_VERSION = '2024-09-30.acacia';
/**
* @description returns a Stripe instance

View File

@@ -38,8 +38,7 @@ export class StripeWebhookHandlerService
constructor(private readonly config: BillingConfig) {}
private readonly provider: BillingProvider =
'stripe';
private readonly provider: BillingProvider = 'stripe';
private readonly namespace = 'billing.stripe';