Skip to content

Replace Next.js with Vite + client-side router (TanStack Router or React Router) #481

@aldbr

Description

@aldbr

Description

DiracX-Web is a fully client-side SPA shipped as a static export. We use none of Next.js's server features (no SSR, no API routes, no middleware, no server components). Every component is marked "use client".

Next.js is increasingly server-oriented — each upgrade risks new server defaults we must opt out of. We're fighting the framework rather than benefiting from it.

What Next.js costs us today:

  • Webpack config hacks for HMR in the monorepo (next.config.js)
  • "use client" on every component, dynamic: "error", images: { unoptimized: true } — all workarounds for features we don't use
  • Slower dev server than esbuild-based alternatives
  • Extension boilerplate: adding a single custom app (e.g. gubbins) requires ~8 framework files (layouts, pages, error boundaries) on top of the ~4 actual business logic files

Proposal: Replace Next.js with Vite as build tool. Use this as an opportunity to simplify the extension contract so extensions only provide a config + components, not duplicated framework boilerplate.

Definition of Done

  • Replace Next.js with Vite
  • Evaluate whether TanStack Router is needed (we only have 2 routes: /auth and /)
  • Simplify the extension contract to remove framework boilerplate
  • OIDC redirect flow still works
  • All existing Cypress tests pass

Thanks @ryuwd for the initial suggestion and investigation in LHCb context!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions