Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

revert(web): use suspense boundary in home page (#40167)

yyhd1fa17032eac
diff --git a/web/app/(commonLayout)/(home)/loading.tsx b/web/app/(commonLayout)/(home)/loading.tsx
deleted file mode 100644
index 8ced1439151..00000000000
--- a/web/app/(commonLayout)/(home)/loading.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { HomeLoading } from '@/features/home/loading'
-
-export default function Loading() {
- return <HomeLoading />
-}
diff --git a/web/app/(commonLayout)/(home)/page.tsx b/web/app/(commonLayout)/page.tsx
similarity index 100%
rename from web/app/(commonLayout)/(home)/page.tsx
rename to web/app/(commonLayout)/page.tsx
diff --git a/web/features/home/loading.tsx b/web/features/home/loading.tsx
deleted file mode 100644
index 0a1ad02129d..00000000000
--- a/web/features/home/loading.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-'use client'
-
-import { useSuspenseQuery } from '@tanstack/react-query'
-import { systemFeaturesQueryOptions } from '@/features/system-features/client'
-import { HomeShell } from './home-shell'
-import { HomeSkeleton } from './home-skeleton'
-
-export function HomeLoading() {
- const { data: systemFeatures } = useSuspenseQuery(systemFeaturesQueryOptions())
-
- return (
- <HomeShell>
- <div className="flex flex-1 flex-col overflow-y-auto">
- <HomeSkeleton showBanner={systemFeatures.enable_explore_banner} />
- </div>
- </HomeShell>
- )
-}
diff --git a/web/features/home/page.tsx b/web/features/home/page.tsx
index ed283e4a2f7..b119a486ce4 100644
--- a/web/features/home/page.tsx
+++ b/web/features/home/page.tsx
@@ -1,4 +1,5 @@
import { dehydrate, HydrationBoundary } from '@tanstack/react-query'
+import { Suspense } from 'react'
import { getQueryClient } from '@/app/get-query-client'
import {
getSystemFeaturesQueryClient,
@@ -7,6 +8,8 @@ import {
import { getLocaleOnServer } from '@/i18n-config/server'
import { getServerConsoleClientContext, serverConsoleQuery } from '@/service/server'
import { HomeContent } from './home-content/home-content'
+import { HomeShell } from './home-shell'
+import { HomeSkeleton } from './home-skeleton'
export async function HomePage() {
const homeQueryClient = getQueryClient()
@@ -44,7 +47,17 @@ export async function HomePage() {
return (
<HydrationBoundary state={dehydratedState}>
- <HomeContent />
+ <Suspense
+ fallback={
+ <HomeShell>
+ <div className="flex flex-1 flex-col overflow-y-auto">
+ <HomeSkeleton showBanner={enableExploreBanner} />
+ </div>
+ </HomeShell>
+ }
+ >
+ <HomeContent />
+ </Suspense>
</HydrationBoundary>
)
}