Menu

Version 2.x Updates

Good to know

Please check the version field in the package.json file for version number

2.0.0

Optimization

  • More universal landing page boilerplate
  • Built-in complete payment requirements: monthly subscription, annual subscription, one-time payment

2.1.0

Optimization

  • Optimized Supabase database initialization and update methods
    • SQL files originally in the data/ folder have been migrated to supabase/migrations
    • For new initialization and update methods, please see details
  • Optimized styles of some components

2.2.0

New Features

  1. Record user's first visit source, see update record 1 and update record 2
  • Execute database file supabase/migrations/20250802164211_users_add_referral.sql, and update types.ts file
  • Execute database file supabase/migrations/20250803113600_update_my_profile_add_referral.sql, and update types.ts file
  • middleware.ts: Record user source in Cookie based on URL parameters
  • components/providers/AuthProvider.tsx: Carry user source to login parameters
  • app/auth/callback/route.ts: Record user source to users table
  1. Simplified existing email boilerplates, email content only retains English, see update record:
  • emails/invoice-payment-failed.tsx: Delete non-English content
  • emails/newsletter-welcome.tsx: Delete non-English content
  • actions/newsletter/index.ts: Update incoming email parameters
  1. Unified email sending function, see update record:
  • actions/resend/index.ts: Unified handling of email sending and unsubscription
  • actions/newsletter/index.ts: Call unified email sending method
  • lib/stripe/actions.ts: Call unified email sending method
  1. Configurable welcome email for new users, see update record
  • .env.example: Added environment variable NEXT_PUBLIC_USER_WELCOME to configure whether to enable welcome emails for new users
  • app/auth/callback/route.ts: Send new user email notification when new user logs in
  • emails/user-welcome.tsx: New user welcome email boilerplate

Optimization

  1. Optimized styles of some components:
  • components/LanguageDetectionAlert.tsx
  • components/ui/rainbow-button.tsx
  1. Optimized dynamic icon handling:
  • components/DynamicIcon.tsx
  1. Optimized login modal closing timing:
  • components/auth/LoginForm.tsx

2.2.1

Optimization

  1. Optimized JSON validation of lang_json field in pricing management form and JSON parsing of preview card
  • app/[locale]/(protected)/dashboard/(admin)/prices/PricePlanForm.tsx
  • app/[locale]/(protected)/dashboard/(admin)/prices/PricingCardPreview.tsx
  • lib/safeJson.ts

2.2.2

Optimization

  1. Optimized language switcher alert styles
  • components/LanguageDetectionAlert.tsx
  • Multilingual package LanguageDetection field:
    • i18n/messages/en/common.json
    • i18n/messages/ja/common.json
    • i18n/messages/zh/common.json

2.3.0

Optimized user benefits acquisition pipeline and implemented a reliable SSG solution.

Optimizations

  1. Moved the useSearchParams call in AuthProvider.tsx down to the login component to maintain layout server-side rendering, see update record
  • Updated components/providers/AuthProvider.tsx
  • Updated components/auth/LoginForm.tsx
  • Updated app/[locale]/login/page.tsx
  1. The original user benefits acquisition pipeline was complex, not beginner-friendly, and affected SSG. Therefore, we optimized the way benefits are acquired and used, see update record
  • Installed dependency swr: pnpm i swr
  • Updated app/[locale]/layout.tsx
  • Updated actions/usage/benefits.ts, added client-side user benefits acquisition method getClientUserBenefits
  • Added hooks/useUserBenefits.ts to share user benefits request, update methods and data state
  • Updated components/layout/CurrentUserBenefitsDisplay.tsx, changed from calling @/stores/benefitsStore to calling @/hooks/useUserBenefits. Since both files provide the same method names, no other code changes were needed in this file
  • Updated components/header/UserInfo.tsx
  • Updated app/[locale]/payment/success/page.tsx to use the data refetch method mutate(revalidateBenefits) for immediate benefits update
  • Removed components/layout/BenefitsErrorBoundary.tsx
  • Removed components/providers/BenefitsProvider.tsx

For secondary development features, whether adding or deducting points, always call mutate(revalidateBenefits) to immediately synchronize database points.

  1. Fixed SSG implementation, see update record
  • Updated app/[locale]/layout.tsx
  • Updated app/[locale]/blogs/[slug]/page.tsx, extracted locale from params instead of using getLocale()

2.3.1

Fixes

  1. GoogleOneTap checks if environment variables are configured, see update record 1 and update record 2
  • components/auth/GoogleOneTap.tsx