Version 2.x Updates
Good to know
Please check the
versionfield in thepackage.jsonfile 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 tosupabase/migrations - For new initialization and update methods, please see details
- SQL files originally in the
- Optimized styles of some components
2.2.0
New Features
- Record user's first visit source, see commit history 1 and commit history 2
- Execute database file
supabase/migrations/20250802164211_users_add_referral.sql, and updatetypes.tsfile - Execute database file
supabase/migrations/20250803113600_update_my_profile_add_referral.sql, and updatetypes.tsfile middleware.ts: Record user source in Cookie based on URL parameterscomponents/providers/AuthProvider.tsx: Carry user source to login parametersapp/auth/callback/route.ts: Record user source to users table
- Simplified existing email boilerplates, email content only retains English, see commit history:
emails/invoice-payment-failed.tsx: Delete non-English contentemails/newsletter-welcome.tsx: Delete non-English contentactions/newsletter/index.ts: Update incoming email parameters
- Unified email sending function, see commit history:
actions/resend/index.ts: Unified handling of email sending and unsubscriptionactions/newsletter/index.ts: Call unified email sending methodlib/stripe/actions.ts: Call unified email sending method
- Configurable welcome email for new users, see commit history
.env.example: Added environment variableNEXT_PUBLIC_USER_WELCOMEto configure whether to enable welcome emails for new usersapp/auth/callback/route.ts: Send new user email notification when new user logs inemails/user-welcome.tsx: New user welcome email boilerplate
Optimization
- Optimized styles of some components:
components/LanguageDetectionAlert.tsxcomponents/ui/rainbow-button.tsx
- Optimized dynamic icon handling:
components/DynamicIcon.tsx
- Optimized login modal closing timing:
components/auth/LoginForm.tsx
2.2.1
Optimization
- Optimized JSON validation of
lang_jsonfield in pricing management form and JSON parsing of preview card
app/[locale]/(protected)/dashboard/(admin)/prices/PricePlanForm.tsxapp/[locale]/(protected)/dashboard/(admin)/prices/PricingCardPreview.tsxlib/safeJson.ts
2.2.2
Optimization
- Optimized language switcher alert styles
components/LanguageDetectionAlert.tsx- Multilingual package
LanguageDetectionfield:i18n/messages/en/common.jsoni18n/messages/ja/common.jsoni18n/messages/zh/common.json
2.3.0
Optimized user benefits acquisition pipeline and implemented a reliable SSG solution.
Optimizations
- Moved the
useSearchParamscall inAuthProvider.tsxdown to the login component to maintain layout server-side rendering, see commit history
- Updated
components/providers/AuthProvider.tsx - Updated
components/auth/LoginForm.tsx - Updated
app/[locale]/login/page.tsx
- 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 commit history
- Installed dependency
swr:pnpm i swr - Updated
app/[locale]/layout.tsx - Updated
actions/usage/benefits.ts, added client-side user benefits acquisition methodgetClientUserBenefits - Added
hooks/useUserBenefits.tsto share user benefits request, update methods and data state - Updated
components/layout/CurrentUserBenefitsDisplay.tsx, changed from calling@/stores/benefitsStoreto 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.tsxto use the data refetch methodmutate(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.
- Fixed SSG implementation, see commit history
- Updated
app/[locale]/layout.tsx - Updated
app/[locale]/blogs/[slug]/page.tsx, extractedlocalefromparamsinstead of usinggetLocale()
2.3.1
Fixes
GoogleOneTapchecks if environment variables are configured, see commit history 1 and commit history 2
components/auth/GoogleOneTap.tsx
2.3.2
Improvements
- Login and payment buttons now redirect to the login page with the current page path included in the URL for post-login redirection. See commit history
components/home/PricingCTA.tsxcomponents/header/UserInfo.tsxlib/utils.ts
Bug Fixes
- Fixed an issue where login would fail when the URL parameter
nextwas an empty string. This bug was introduced in version 2.3.0 whenLoginForm.tsxwas modified. This update includes a fallback solution. See commit history
app/auth/callback/route.tsapp/auth/confirm/route.ts
2.4.0
Optimizations
- Updated layout, Dashboard uses Shadcn Sidebar component to refactor left-right layout, other pages maintain the original top-middle-bottom layout, see commit history
- Execute
pnpm dlx shadcn@latest add sidebar - Created folder
app/[locale]/(basic-layout), added fileapp/[locale]/(basic-layout)/layout.tsx - Moved all files and folders under
app/[locale]folder, exceptapp/[localte]/layout.tsxandapp/[locale]/(protected), intoapp/[localte]/(basic-layout) - Updated
app/[locale]/layout.tsx, removedHeaderandFooterreferences, removed<main>tag (do not removechildreninside<main>) - Added
app/[locale]/(protected)/dashboard/DashboardSidebar.tsx - Added
components/header/SidebarInsetHeader.tsx - Updated
app/[locale]/(protected)/dashboard/layout.tsx, using new Sidebar - Added directory icons to
UserMenusandAdminMenusini18n/message/en/common.json,i18n/message/ja/common.jsonandi18n/message/zh/common.json - Removed
app/[locale]/(protected)/dashboard/Sidebar.tsx - Removed
app/[locale]/(protected)/dashboard/MobileSidebar.tsx - Component style optimizations:
components/header/UserInfo.tsxcomponents/header/UserAvatar.tsxcomponents/header/MobileMenu.tsxcomponents/header/HeaderLinks.tsxcomponents/header/Header.tsx
- Optimized copy styles
components/mdx/CopyButton.tsx
New Features
- Added administrator overview page, see commit history
- Execute
pnpm dlx shadcn@latest add chart - Migrated new SQL files:
supabase/migrations/20250812143117_create_order_stats_function.sql,supabase/migrations/20250812151308_create_daily_growth_stats_function.sql, see update methods - Added Server Actions
actions/overview - Added page
app/[locale]/(protected)/dashboard/(admin)/overview - Updated
lib/supabase/middleware.ts, added/dashboard/overviewto administrator permission pages - Updated
lib/utils.ts, added number formatting methods - Updated multilingual packages
- Edited directories:
i18n/messages/en/common.json,i18n/messages/ja/common.json,i18n/messages/zh/common.json, added new page directory items - Added new page language packages:
i18n/messages/en/Dashboard/Admin/Overview.json,i18n/messages/ja/Dashboard/Admin/Overview.json,i18n/messages/zh/Dashboard/Admin/Overview.json - Edited
i18n/request.ts, imported new page language packages
- Edited directories:
- Added administrator orders viewing page, see commit history
- Added Server Actions
actions/orders - Added page
app/[locale]/(protected)/dashboard/(admin)/orders - Updated
lib/supabase/middleware.ts, added/dashboard/ordersto administrator permission pages - Updated multilingual packages
- Edited directories:
i18n/messages/en/common.json,i18n/messages/ja/common.json,i18n/messages/zh/common.json, added new page directory items - Added new page language packages:
i18n/messages/en/Dashboard/Admin/Orders.json,i18n/messages/ja/Dashboard/Admin/Orders.json,i18n/messages/zh/Dashboard/Admin/Orders.json - Edited
i18n/request.ts, imported new page language packages
- Edited directories:
2.4.1
Bug Fixes
- Fixed Google model issues on AI Demo page
.env.exampleconfig/models.tsapp/api/admin/translate/route.tsapp/api/ai-demo/multi-chat/route.tsapp/api/ai-demo/single-chat/route.ts
- Email boilerplates now use site name from
config/site.tsconfiguration
actions/newsletter/index.tsapp/auth/callback/route.ts
- Added admin orders viewing page, see commit history
- Added Server Actions
actions/orders - Added page
app/[locale]/(protected)/dashboard/(admin)/orders - Updated
lib/supabase/middleware.ts, added/dashboard/ordersto admin permission pages - Updated multilingual packages
- Edited directories:
i18n/messages/en/common.json,i18n/messages/ja/common.json,i18n/messages/zh/common.json, added new page directory items - Added new page language packages:
i18n/messages/en/Dashboard/Admin/Orders.json,i18n/messages/ja/Dashboard/Admin/Orders.json,i18n/messages/zh/Dashboard/Admin/Orders.json - Edited
i18n/request.ts, imported new page language packages
- Edited directories:
2.4.2
Bug Fixes
- Fixed the issue where one-time payments using 100% discount codes could not handle benefit upgrades, see commit history
lib/stripe/webhook-handlers.tsapp/api/payment/verify-success/route.ts
Optimizations
Made some styling and detail optimizations
2.4.3
Bug Fixes
- Update redirect URLs to use site URL instead of origin in auth callback and confirm routes, see commit history
app/auth/callback/route.tsapp/auth/confirm/route.ts
2.4.4
Webhook Processing Improvements
- Reduce one
orderstable query for one-time and subscription payments in webhook processing, see commit history
lib/stripe/webhook-handlers.ts
- Add retry mechanism for payment upgrade benefits
rpcin one-time and subscription payments, see commit history
lib/stripe/webhook-handlers.ts
- Add email notification when payment upgrade benefits
rpcfails after 3 retry attempts, see commit history
emails/credit-upgrade-failed.tsxEmail notification templatelib/stripe/actions.tsAdd email notification methodlib/stripe/webhook-handlers.tsCall email notification method after retry failures
Other Optimizations
-
Make pricing card TabsList responsive
components/home/Pricing.tsx -
Fix incorrect i18n namespace in
PricePlanForm
app/[locale]/(protected)/dashboard/(admin)/prices/PricePlanForm.tsx
2.4.5
- Changed
.eslintrc.jsonto.eslintrc.js
2.4.7
- Added support for Magic Link login confirmation redirect to prevent token invalidation and login failures caused by email service page scanning
- Added new page
app/[locale]/(basic-layout)/login/confirm/page.tsx - Modified
app/auth/confirm/route.ts - Added environment variable
MAGIC_LINK_REQUIRE_CONFIRMATION, redirect page is only enabled when value istrue