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.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
refactor(web): organize devtools components (#30318)
yyh673209d08636
diff --git a/web/app/components/devtools/react-scan/loader.tsx b/web/app/components/devtools/react-scan/loader.tsxnew file mode 100644index 00000000000..ee702216f7c--- /dev/null+++ b/web/app/components/devtools/react-scan/loader.tsx@@ -0,0 +1,21 @@+'use client'++import { lazy, Suspense } from 'react'+import { IS_DEV } from '@/config'++const ReactScan = lazy(() =>+ import('./scan').then(module => ({+ default: module.ReactScan,+ })),+)++export const ReactScanLoader = () => {+ if (!IS_DEV)+ return null++ return (+ <Suspense fallback={null}>+ <ReactScan />+ </Suspense>+ )+}diff --git a/web/app/components/react-scan.tsx b/web/app/components/devtools/react-scan/scan.tsxsimilarity index 100%rename from web/app/components/react-scan.tsxrename to web/app/components/devtools/react-scan/scan.tsxdiff --git a/web/app/components/devtools.tsx b/web/app/components/devtools/tanstack/devtools.tsxsimilarity index 100%rename from web/app/components/devtools.tsxrename to web/app/components/devtools/tanstack/devtools.tsxdiff --git a/web/app/components/devtools/tanstack/loader.tsx b/web/app/components/devtools/tanstack/loader.tsxnew file mode 100644index 00000000000..673ea0da90e--- /dev/null+++ b/web/app/components/devtools/tanstack/loader.tsx@@ -0,0 +1,21 @@+'use client'++import { lazy, Suspense } from 'react'+import { IS_DEV } from '@/config'++const TanStackDevtoolsWrapper = lazy(() =>+ import('./devtools').then(module => ({+ default: module.TanStackDevtoolsWrapper,+ })),+)++export const TanStackDevtoolsLoader = () => {+ if (!IS_DEV)+ return null++ return (+ <Suspense fallback={null}>+ <TanStackDevtoolsWrapper />+ </Suspense>+ )+}diff --git a/web/app/layout.tsx b/web/app/layout.tsxindex c182f12dc99..fa1f7d48b55 100644--- a/web/app/layout.tsx+++ b/web/app/layout.tsx@@ -8,8 +8,8 @@ import { getLocaleOnServer } from '@/i18n-config/server'import { DatasetAttr } from '@/types/feature'import { cn } from '@/utils/classnames'import BrowserInitializer from './components/browser-initializer'+import { ReactScanLoader } from './components/devtools/react-scan/loader'import I18nServer from './components/i18n-server'-import { ReactScan } from './components/react-scan'import SentryInitializer from './components/sentry-initializer'import RoutePrefixHandle from './routePrefixHandle'import './styles/globals.css'@@ -90,7 +90,7 @@ const LocaleLayout = async ({className="color-scheme h-full select-auto"{...datasetMap}>- <ReactScan />+ <ReactScanLoader /><ThemeProviderattribute="data-theme"defaultTheme="system"diff --git a/web/context/query-client.tsx b/web/context/query-client.tsxindex 8882048a630..9562686f6fd 100644--- a/web/context/query-client.tsx+++ b/web/context/query-client.tsx@@ -2,14 +2,7 @@import type { FC, PropsWithChildren } from 'react'import { QueryClient, QueryClientProvider } from '@tanstack/react-query'-import { lazy, Suspense } from 'react'-import { IS_DEV } from '@/config'--const TanStackDevtoolsWrapper = lazy(() =>- import('@/app/components/devtools').then(module => ({- default: module.TanStackDevtoolsWrapper,- })),-)+import { TanStackDevtoolsLoader } from '@/app/components/devtools/tanstack/loader'const STALE_TIME = 1000 * 60 * 30 // 30 minutes@@ -26,11 +19,7 @@ export const TanstackQueryInitializer: FC<PropsWithChildren> = (props) => {return (<QueryClientProvider client={client}>{children}- {IS_DEV && (- <Suspense fallback={null}>- <TanStackDevtoolsWrapper />- </Suspense>- )}+ <TanStackDevtoolsLoader /></QueryClientProvider>)}