Skip to content

Conversation

@PragmaTwice
Copy link
Member

This includes:

  • update nextjs from 14 to 15
  • remove the URL rewrite function from next config
  • add a nextjs nodejs middleware to rewrite URLs dynamically (without rebuild the webui!)
  • enable standalone mode
  • add an env var KVCTL_API_HOST for running node with dynamic endpoint (server side)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades Next.js from version 14 to 15 and implements dynamic API routing using Next.js middleware instead of static URL rewrites. The changes enable runtime configuration of API endpoints without requiring webui rebuilds.

  • Update Next.js from 14.2.29 to 15.5.4 and React from 18 to 19
  • Replace static URL rewrites in next.config.mjs with dynamic middleware-based routing
  • Implement standalone build mode for containerized deployments

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
webui/package.json Updates Next.js and React versions, adds deployment script
webui/next.config.mjs Removes static API rewrites, enables standalone mode
webui/src/middleware.ts Adds middleware for dynamic API routing using KVCTL_API_HOST
webui/tsconfig.json Formatting improvements and target specification
webui/src/app/page.tsx Fixes useRef initialization for React 19 compatibility
webui/src/app/namespaces/[namespace]/page.tsx Updates params handling for Next.js 15 async params
webui/src/app/namespaces/[namespace]/clusters/[cluster]/page.tsx Updates params handling for Next.js 15 async params
webui/src/app/namespaces/[namespace]/clusters/[cluster]/shards/[shard]/page.tsx Updates params handling for Next.js 15 async params
webui/src/app/namespaces/[namespace]/clusters/[cluster]/shards/[shard]/nodes/[node]/page.tsx Updates params handling for Next.js 15 async params

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}

export const config = {
matcher: "/api/v1/:path*",
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The matcher pattern only covers /api/v1 but the middleware function checks for url.pathname.startsWith('/api/v1'). Consider aligning these patterns or using a more specific matcher like '/api/v1/:path*' to ensure consistency.

Copilot uses AI. Check for mistakes.
@PragmaTwice PragmaTwice merged commit d9f8c40 into unstable Oct 8, 2025
8 checks passed
@PragmaTwice PragmaTwice deleted the webui-middleware branch October 11, 2025 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants