[PR #32231] feat(web): improve marketplace SSR prefetch and plugins route loading #33619

Open
opened 2026-02-21 20:53:36 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/32231

State: open
Merged: No


Summary

Improve the plugins marketplace first-load experience by reducing SSR/client query mismatches and adding a route-level loading fallback.

Changes

  • pass request searchParams into marketplace page hydration from web/app/(commonLayout)/plugins/page.tsx
  • add route-level loading.tsx for web/app/(commonLayout)/plugins using the existing full-screen Loading component
  • enhance marketplace hydration logic:
    • prefetch collections data in non-search mode (all/tool)
    • prefetch first page of searchAdvanced in search mode (q, tags, or non-collection categories)
    • run prefetches in parallel
  • make collections query explicitly enabled and avoid coupling collections loading into search-mode loading
  • restore default nuqs behavior for category by removing clearOnDefault: false
  • add web/app/components/plugins/marketplace/hydration-server.spec.tsx to cover SSR prefetch branches

Validation

  • pnpm lint 'app/(commonLayout)/plugins/page.tsx' 'app/(commonLayout)/plugins/loading.tsx' app/components/plugins/marketplace/query.ts app/components/plugins/marketplace/search-params.ts app/components/plugins/marketplace/state.ts app/components/plugins/marketplace/hydration-server.tsx app/components/plugins/marketplace/hydration-server.spec.tsx
  • pnpm type-check:tsgo
  • pnpm test app/components/plugins/marketplace/hydration-server.spec.tsx app/components/plugins/marketplace/index.spec.tsx app/components/plugins/marketplace/list/index.spec.tsx
**Original Pull Request:** https://github.com/langgenius/dify/pull/32231 **State:** open **Merged:** No --- ## Summary Improve the plugins marketplace first-load experience by reducing SSR/client query mismatches and adding a route-level loading fallback. ## Changes - pass request searchParams into marketplace page hydration from web/app/(commonLayout)/plugins/page.tsx - add route-level loading.tsx for web/app/(commonLayout)/plugins using the existing full-screen Loading component - enhance marketplace hydration logic: - prefetch collections data in non-search mode (all/tool) - prefetch first page of searchAdvanced in search mode (q, tags, or non-collection categories) - run prefetches in parallel - make collections query explicitly enabled and avoid coupling collections loading into search-mode loading - restore default nuqs behavior for category by removing clearOnDefault: false - add web/app/components/plugins/marketplace/hydration-server.spec.tsx to cover SSR prefetch branches ## Validation - pnpm lint 'app/(commonLayout)/plugins/page.tsx' 'app/(commonLayout)/plugins/loading.tsx' app/components/plugins/marketplace/query.ts app/components/plugins/marketplace/search-params.ts app/components/plugins/marketplace/state.ts app/components/plugins/marketplace/hydration-server.tsx app/components/plugins/marketplace/hydration-server.spec.tsx - pnpm type-check:tsgo - pnpm test app/components/plugins/marketplace/hydration-server.spec.tsx app/components/plugins/marketplace/index.spec.tsx app/components/plugins/marketplace/list/index.spec.tsx
yindo added the pull-request label 2026-02-21 20:53:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33619