nexty-flux-kontext 版本更新
提示
- 本章是 nexty-flux-kontext 仓库的版本更新记录。
- 版本号请查看
package.json
文件的version
字段
1.1.0
优化用户权益获取链路,并实现可靠的 SSG 方案。
优化与修复
- 将
AuthProvider.tsx
里调用useSearchParams
下移到登录组件,保持 layout 服务端渲染,查看更新记录
- 更新
components/providers/AuthProvider.tsx
- 更新
app/[locale]/login/LoginPage.tsx
- 更新
app/[locale]/login/page.tsx
- 安装依赖
swr
:pnpm i swr
- 更新
app/[locale]/layout.tsx
- 更新
actions/usage/benefits.ts
,添加客户端获取用户权益的方法getClientUserBenefits
- 新增
hooks/useUserBenefits.ts
,共享用户权益请求、更新方法和数据状态 - 更新
app/[locale]/pricing/FlashSaleBanner.tsx
,由原来调用@/stores/benefitsStore
修改为调用@/hooks/useUserBenefits
,两个文件提供的方法名一样,所以该文件里其他代码无需修改 - 更新
components/layout/CurrentUserBenefitsDisplay.tsx
,由原来调用@/stores/benefitsStore
修改为调用@/hooks/useUserBenefits
,两个文件提供的方法名一样,所以该文件里其他代码无需修改 - 更新
components/header/UserInfo.tsx
- 更新
app/[locale]/(gen-image)/flux-kontext-pro/FluxKontextProClient.tsx
,使用新的乐观更新方法optimisticDeduct
和重新获取数据的方法mutate(revalidateBenefits)
- 更新
app/[locale]/(gen-image)/multi-image-kontext-pro/MultiImageKontextProClient.tsx
,同上 - 更新
app/[locale]/payment/success/page.tsx
,使用重新获取数据的方法mutate(revalidateBenefits)
立即更新权益 - 删除
components/layout/BenefitsErrorBoundary.tsx
- 删除
components/providers/BenefitsInitializer.tsx
- 删除
components/providers/BenefitsProvider.tsx
- 删除
stores/benefitsStore.ts
二开的功能,无论新增积分或者扣除积分,都应当调用 mutate(revalidateBenefits)
立即同步数据库的积分。
- 修复 SSG 实现,查看更新记录
- 更新
app/[locale]/layout.tsx
- 更新
app/[locale]/blogs/[slug]/page.tsx
,从params
取出locale
,而不是使用getLocale()
1.1.1
修复
components/auth/GoogleOneTap.tsx
1.1.2
优化
- 登录按钮、支付按钮重定向到登录页,携带页面路径到 URL,用于登录后重定向,查看更新记录
components/pricing/PricingCTA.tsx
修复
- 修复 URL 参数
next
为空字符串时无法登录的问题,该 bug 由 2.3.0 修改LoginForm.tsx
引起,本次变更做了兜底处理。查看更新记录
app/auth/callback/route.ts
app/auth/confirm/route.ts