Skip to content

Migrate build system from Next.js CLI to VineXT#1046

Open
eser wants to merge 1 commit intof:mainfrom
eser:worktree-agent-ac8b3492
Open

Migrate build system from Next.js CLI to VineXT#1046
eser wants to merge 1 commit intof:mainfrom
eser:worktree-agent-ac8b3492

Conversation

@eser
Copy link

@eser eser commented Feb 28, 2026

Summary

  • Replace Next.js CLI with VineXT (Vite-based reimplementation of the Next.js API surface) for Cloudflare Workers deployment
  • Add vite.config.ts with vinext, @vitejs/plugin-rsc, and @cloudflare/vite-plugin configured for App Router RSC
  • Simplify next.config.ts: remove Sentry, MDX, and next-intl plugin wrappers; remove output: standalone, reactCompiler, and webpack config
  • Update package.json scripts from next to vinext for dev/build/start, add type: module for ESM
  • Create wrangler.jsonc with nodejs_compat flag for Cloudflare Workers
  • Fix vitest.config.ts __dirname for ESM compatibility
  • Bump React to ^19.2.4 (VineXT peer dependency)
  • Add missing @testing-library/dom peer dependency

Test plan

  • vinext dev starts successfully on localhost:3000
  • All 652 unit tests pass (39 test files)
  • ESLint passes (0 errors, 205 pre-existing warnings)
  • vinext build reaches app-level font shim issue (Noto_Sans_Arabic not exported by VineXT font shim) -- this is outside core migration scope and will be addressed in a separate app-code compatibility unit

Summary by CodeRabbit

  • Chores
    • Migrated build tooling from Next.js to Vite for improved development and build performance.
    • Upgraded React and React-DOM to version 19.2.4.
    • Removed Sentry error monitoring integration.
    • Removed internationalization (next-intl) support.
    • Removed Markdown (MDX) rendering support.
    • Added Cloudflare deployment configuration.

@coderabbitai
Copy link

coderabbitai bot commented Feb 28, 2026

📝 Walkthrough

Walkthrough

This PR migrates the build system from Next.js with integrated plugins to a Vite-based setup using vinext, removes Sentry, next-intl, and MDX integrations, adds React Server Components and Cloudflare Workers support, and converts the project to ESM modules.

Changes

Cohort / File(s) Summary
Build System Configuration
next.config.ts, vite.config.ts
Removed Next.js plugin wrappers (Sentry, next-intl, MDX) from next.config.ts; added new vite.config.ts with vinext, RSC plugin, and Cloudflare plugin configuration.
Package Management
package.json
Added ESM module type; replaced Next.js CLI commands with vinext (dev, build, start); upgraded React/React-DOM to ^19.2.4; added vinext, vite, @vitejs/plugin-rsc, @cloudflare/vite-plugin, and @testing-library/dom.
Test Configuration
vitest.config.ts
Added ES module compatibility for __dirname using fileURLToPath and configured path alias for src directory.
Deployment Configuration
wrangler.jsonc
Added new Wrangler configuration file for Cloudflare Workers project with Node.js compatibility flag.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A hoppy change, I must declare,
From Next to Vite, a fresh affair!
Plugins removed with care and grace,
Vinext now leads this builder's race,
RSC and Cloudflare, hand in hand,
A nimbler build across the land! 🚀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: migrating the build system from Next.js CLI to VineXT, which is the main objective of this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
package.json (2)

85-85: Consider moving vinext to devDependencies.

vinext is a build tool similar to Vite and should typically be a development dependency rather than a production dependency, unless it's required at runtime for the Cloudflare Workers deployment.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 85, The package.json currently lists "vinext" under
dependencies but it is a build tool and should be moved to devDependencies;
update package.json by removing "vinext" from the dependencies object and adding
the same version entry under devDependencies, then verify any npm/yarn scripts
(e.g., build/start scripts that reference vinext) still work in CI and local
development (ensure CI installs devDependencies or add a separate build step)
and confirm it is not required at runtime in your Cloudflare Workers code before
removing from dependencies.

37-41: Consider removing unused MDX dependencies.

@mdx-js/loader, @mdx-js/react, and @next/mdx remain in dependencies, but the MDX integration was removed from next.config.ts. If MDX is no longer used with VineXT, these dependencies can be removed to reduce bundle size.

#!/bin/bash
# Description: Check if MDX is still being used in the codebase

echo "=== MDX file usage ==="
fd -e mdx --exclude node_modules | head -20

echo -e "\n=== MDX imports in code ==="
rg -l "@mdx-js|\.mdx" --type ts --type tsx -g '!node_modules' | head -10
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 37 - 41, package.json still lists MDX packages
("@mdx-js/loader", "@mdx-js/react", "@next/mdx") though MDX support was removed
from next.config.ts; search the repo for any remaining ".mdx" files or imports
of "@mdx-js" or ".mdx" and if none exist remove those three dependencies from
package.json, run your package manager to update lockfile (npm/yarn/pnpm
install), and verify builds/tests pass; additionally check for any MDX-related
config or loader code (imports referencing `@mdx-js/`* or next-mdx) and delete
those remnants if present.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@next.config.ts`:
- Line 49: Package.json contains unused dependencies `next-intl` and
`@sentry/nextjs`; remove them from dependencies to shrink the bundle unless you
intend to add i18n or Sentry integration. If you plan to support localization,
instead of keeping the package unused, integrate `next-intl` by calling its
helpers (e.g., useTranslations() in components and getTranslations() in server
code) and add the proper config, otherwise delete `next-intl` and
`@sentry/nextjs` entries from package.json and run a fresh install to update
lockfile; note that `next.config.ts` does not need plugin wrappers for this
change.

---

Nitpick comments:
In `@package.json`:
- Line 85: The package.json currently lists "vinext" under dependencies but it
is a build tool and should be moved to devDependencies; update package.json by
removing "vinext" from the dependencies object and adding the same version entry
under devDependencies, then verify any npm/yarn scripts (e.g., build/start
scripts that reference vinext) still work in CI and local development (ensure CI
installs devDependencies or add a separate build step) and confirm it is not
required at runtime in your Cloudflare Workers code before removing from
dependencies.
- Around line 37-41: package.json still lists MDX packages ("@mdx-js/loader",
"@mdx-js/react", "@next/mdx") though MDX support was removed from
next.config.ts; search the repo for any remaining ".mdx" files or imports of
"@mdx-js" or ".mdx" and if none exist remove those three dependencies from
package.json, run your package manager to update lockfile (npm/yarn/pnpm
install), and verify builds/tests pass; additionally check for any MDX-related
config or loader code (imports referencing `@mdx-js/`* or next-mdx) and delete
those remnants if present.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d9370c8 and 4a6faed.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • next.config.ts
  • package.json
  • vite.config.ts
  • vitest.config.ts
  • wrangler.jsonc

},
},
});
export default nextConfig;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check next-intl usage patterns
echo "=== next-intl usage in codebase ==="
rg -n "useTranslations|getTranslations|NextIntlClientProvider" --type ts --type tsx -g '!node_modules' 2>/dev/null || echo "No matches found"

# Check i18n configuration files
echo -e "\n=== i18n configuration files ==="
fd -e json -e ts "i18n|messages|locale" --exclude node_modules 2>/dev/null || echo "No files found"

# Check package.json for dependencies
echo -e "\n=== Checking package.json for next-intl and sentry ==="
grep -E "next-intl|@sentry/nextjs" package.json 2>/dev/null || echo "Dependencies not found"

# Check next.config.ts content
echo -e "\n=== next.config.ts content ==="
cat -n next.config.ts

Repository: f/prompts.chat

Length of output: 1744


Remove unused dependencies from package.json.

next-intl and @sentry/nextjs are present in dependencies but not used anywhere in the codebase. The simplified next.config.ts is correct—no plugin wrappers are needed. Remove these unused packages to reduce bundle size and avoid maintaining unnecessary dependencies. Note that the coding guidelines require next-intl for all user-facing strings; if i18n support is not needed, this is acceptable, but if it is planned, the dependency should be properly integrated with useTranslations() and getTranslations().

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@next.config.ts` at line 49, Package.json contains unused dependencies
`next-intl` and `@sentry/nextjs`; remove them from dependencies to shrink the
bundle unless you intend to add i18n or Sentry integration. If you plan to
support localization, instead of keeping the package unused, integrate
`next-intl` by calling its helpers (e.g., useTranslations() in components and
getTranslations() in server code) and add the proper config, otherwise delete
`next-intl` and `@sentry/nextjs` entries from package.json and run a fresh
install to update lockfile; note that `next.config.ts` does not need plugin
wrappers for this change.

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.

1 participant