Skip to content

Upgrade Next.js and improve project structure#53

Merged
al-husayn merged 21 commits into
mainfrom
upgrade/nextjs-lts
Jun 8, 2026
Merged

Upgrade Next.js and improve project structure#53
al-husayn merged 21 commits into
mainfrom
upgrade/nextjs-lts

Conversation

@al-husayn

@al-husayn al-husayn commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Enhance project configuration by adding a workspace file, updating TypeScript settings for better JSX support, and migrating middleware logic for improved organization. Remove deprecated configuration and update dependencies to their latest versions.

Summary by CodeRabbit

  • Chores
    • Upgraded core framework, libraries, and dev dependencies; tightened workspace build policy and TypeScript/ESLint settings.
  • Refactor
    • Replaced the blog/sitemap/RSS content source wiring with a new MDX adapter while preserving RSS and public APIs.
  • Bug Fixes / Behavior
    • Deferred numerous effect-driven state updates to avoid synchronous state mutations and added cleanup handling.
  • UI
    • Tweaked layout, sizing, and styling across admin, analytics, blog, comments, navigation, and various UI primitives.

@vercel

vercel Bot commented Jun 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Jun 8, 2026 4:02am

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@al-husayn, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 15 minutes and 14 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 15f3b537-5eaa-46e9-bf88-f6fc5bee89ac

📥 Commits

Reviewing files that changed from the base of the PR and between 3d661f4 and 628980a.

📒 Files selected for processing (3)
  • app/about/page.tsx
  • components/site-nav.tsx
  • pnpm-workspace.yaml
📝 Walkthrough

Walkthrough

Migrates the blog MDX source to Fumadocs runtime, upgrades dependencies and pnpm workspace build allowlist, updates TypeScript/source/ESLint configs, refactors admin analytics loading/rendering, and applies widespread UI timing and styling changes.

Changes

Dependency Upgrade and MDX Source Migration

Layer / File(s) Summary
Blog MDX Source Adapter Migration
lib/blog-source.ts, app/rss.xml/route.ts, app/sitemap.ts
blogSource, sitemap, and RSS now use toFumadocsSource(docs, meta) from fumadocs-mdx/runtime/server instead of createMDXSource; downstream RSS/sitemap logic unchanged.
Dependencies and pnpm workspace
package.json, pnpm-workspace.yaml
Bump Fumadocs packages, Next.js, React/React-DOM, Zod, Clerk; tighten dev deps (React types, Tailwind tooling); add allowBuilds policy in pnpm-workspace.yaml.
TypeScript & Source Config
tsconfig.json, source.config.ts
compilerOptions.jsx changed from preservereact-jsx; include expanded for .next/dev/types/**/*.ts; removed lastModifiedTime: 'git' from source config.
Admin analytics and primitives
app/admin/page.tsx, components/admin/analytics-dashboard-primitives.tsx, components/admin/analytics-dashboard-sections/*
Refactor admin analytics fetch/dehydrate control flow and update dashboard layout classes; adjust Card/LineChart/DonutChart/EngagementGauge sizing/styling and DonutChart gradient construction.
UI timing, inputs, and TagFilter implementation
components/* (cookie-banner, table-of-contents, theme-toggle, drawer, goey-toaster, article-share, article-engagement, tag-filter, blog-card, site-nav, etc.)
Defer several in-effect state updates using zero-delay timeouts with cleanup; implement Desktop/Mobile TagFilter subcomponents; tweak comment/share/upvote button sizing, textarea/error wrapping, and many Tailwind utility class updates.
Proxy middleware fallback naming
proxy.ts
Rename internal fallback from noopMiddlewarenoopProxy when Clerk is not configured; behavior unchanged.
ESLint config migration
eslint.config.mjs
Switch to defineConfig and globalIgnores(...), add markdown ignore patterns while preserving script overrides.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • al-husayn/blog#18: Related to earlier blogSource and blog page consumers using blogSource.getPages(); touches the same blog data pipeline.
  • al-husayn/blog#35: Related to analytics primitives and DonutChart/EngagementGauge changes in components/admin/analytics-dashboard-primitives.tsx.
  • al-husayn/blog#30: Overlaps changes to components/article-share.tsx (native share timing/cleanup).

Suggested labels

enhancement

Poem

🐇 a quick rabbit hop:
Fumadocs joins the garden gate,
deps sprout leaves, configs update,
timeouts hush the hurried state,
UI trims and pages hum—hope feels great.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Upgrade Next.js and improve project structure' directly reflects the primary changes: dependency updates (Next.js from 15.3.8 to 16.2.7, React, Fumadocs, and others) and structural improvements (TypeScript config, ESLint config refactor, workspace configuration, middleware rename).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch upgrade/nextjs-lts

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.

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

Dependency Review

The following issues were found:

  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ✅ 0 package(s) with unknown licenses.
  • ⚠️ 8 packages with OpenSSF Scorecard issues.

View full job summary

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@components/admin/analytics-dashboard-primitives.tsx`:
- Line 1: Remove the unnecessary 'use client' directive from
components/admin/analytics-dashboard-primitives.tsx: the module only contains
pure rendering/utility code (no client hooks or browser APIs) and its consumers
like the various analytics-dashboard-sections/*-card.tsx files are already 'use
client'; delete the top-line "'use client';" so this file can be imported from
Server Components without forcing a client boundary.

In `@components/article-engagement.tsx`:
- Line 590: Replace the invalid CSS class token "wra-break-word" in the
paragraph element's className with the correct Tailwind utility "break-words" so
long error messages wrap correctly; update the class string on the JSX element
containing "wra-break-word" (the <p> that currently has 'wra-break-word text-xs
text-destructive') to remove the typo and include "break-words" instead.

In `@eslint.config.mjs`:
- Around line 16-23: The override for scripts ('files': ['scripts/**/*.js']) is
being bypassed because globalIgnores explicitly lists
'scripts/generate-read-times.js'; remove that filename from the globalIgnores
array (or replace the specific ignore with a narrower pattern) so the override
block applying rules like '`@typescript-eslint/no-require-imports`' to
scripts/**/*.js can take effect for generate-read-times.js; locate the
globalIgnores definition and the override block in eslint.config.mjs to make
this change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9cca1707-fa50-415a-83b6-7fe9c1598a49

📥 Commits

Reviewing files that changed from the base of the PR and between ce0548c and d9ce902.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (13)
  • app/admin/page.tsx
  • components/admin/analytics-dashboard-primitives.tsx
  • components/article-engagement.tsx
  • components/article-share.tsx
  • components/cookie-banner.tsx
  • components/table-of-contents.tsx
  • components/tag-filter.tsx
  • components/theme-toggle.tsx
  • components/ui/drawer.tsx
  • components/ui/goey-toaster.tsx
  • eslint.config.mjs
  • pnpm-workspace.yaml
  • tsconfig.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • pnpm-workspace.yaml
  • tsconfig.json

Comment thread components/admin/analytics-dashboard-primitives.tsx Outdated
Comment thread components/article-engagement.tsx Outdated
Comment thread eslint.config.mjs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/about/page.tsx`:
- Line 106: The className string on the JSX element in the About page
concatenates the mask utility and pointer-events class without a space; open the
JSX element that has className='absolute top-0 left-0 z-0 w-full h-50
mask-[linear-gradient(to_top,transparent_25%,black_95%)]pointer-events-none' and
insert a space between the mask[...] token and pointer-events-none so the final
className contains "...black_95%] pointer-events-none". Ensure you update the
className attribute where that exact sequence appears.

In `@components/home/articles-grid-skeleton.tsx`:
- Line 10: The Tailwind aspect-ratio utility used is invalid: replace any
occurrences of the class string "aspect-16/10" (found in the
ArticlesGridSkeleton component in components/home/articles-grid-skeleton.tsx and
likewise in components/read-more-section.tsx and components/blog-card.tsx) with
the arbitrary-value syntax "aspect-[16/10]"; update the JSX className values
where the div uses aspect-16/10 to use aspect-[16/10], and run your linter/build
to confirm the classes are recognized.

In `@components/home/pagination.tsx`:
- Line 91: The pagination layout used an invalid Tailwind utility
`md:order-none`; locate the Pagination component's JSX (the div with className
including "order-3 w-full justify-center flex items-center gap-2 ...") and
replace `md:order-none` with the valid utility `md:order-0` so the element has
order:0 at medium screens (ensuring correct ordering at md breakpoint).

In `@components/site-nav.tsx`:
- Line 37: The Tailwind conditional class `supports-backdrop-filter:...` used in
components/site-nav.tsx and components/cookie-banner.tsx won’t generate CSS
because no `@custom-variant supports-backdrop-filter` is defined; either 1)
update the class usage in those components to use an arbitrary `@supports` variant
like `[`@supports`(backdrop-filter:blur(1px))]:...` for the backdrop-filter
conditional styles, or 2) add the custom variant declaration `@custom-variant
supports-backdrop-filter (`@supports` (backdrop-filter: blur(1px)));` to
app/globals.css so the existing `supports-backdrop-filter:` classes in SiteNav
and the cookie banner work as intended.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2ffd4b35-b64a-4841-a7d5-4dab4bb1bb80

📥 Commits

Reviewing files that changed from the base of the PR and between d9ce902 and 3d661f4.

📒 Files selected for processing (22)
  • app/about/page.tsx
  • app/blog/[slug]/page.tsx
  • app/privacy/page.tsx
  • app/sitemap.ts
  • components/admin/analytics-dashboard-primitives.tsx
  • components/admin/analytics-dashboard-sections/top-posts-card.tsx
  • components/admin/analytics-dashboard-sections/views-card.tsx
  • components/article-engagement.tsx
  • components/blog-card.tsx
  • components/blog-post-assistant.tsx
  • components/cookie-banner.tsx
  • components/copy-header.tsx
  • components/home/articles-grid-skeleton.tsx
  • components/home/background-grid.tsx
  • components/home/featured-post.tsx
  • components/home/hero-section.tsx
  • components/home/pagination.tsx
  • components/promo-content.tsx
  • components/read-more-section.tsx
  • components/site-nav.tsx
  • components/ui/drawer.tsx
  • eslint.config.mjs
✅ Files skipped from review due to trivial changes (5)
  • components/home/background-grid.tsx
  • components/promo-content.tsx
  • components/blog-card.tsx
  • components/admin/analytics-dashboard-sections/views-card.tsx
  • components/copy-header.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • components/ui/drawer.tsx
  • components/cookie-banner.tsx
  • components/article-engagement.tsx

Comment thread app/about/page.tsx Outdated
{Array.from({ length: count }, (_, index) => (
<article key={index} className='rounded-xl border border-border bg-background'>
<div className='aspect-[16/10] w-full animate-pulse bg-muted/50' />
<div className='aspect-16/10 w-full animate-pulse bg-muted/50' />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for any other usages of the invalid aspect-16/10 pattern
rg -n 'aspect-\d+/\d+' --type=tsx --type=ts --type=jsx --type=js

# Search for correct arbitrary aspect-ratio usage
rg -n 'aspect-\[[\d.]+/[\d.]+\]' --type=tsx --type=ts --type=jsx --type=js

Repository: al-husayn/blog

Length of output: 114


🏁 Script executed:

rg -n 'aspect-[0-9]+/[0-9]+' -g'*.ts' -g'*.tsx' -g'*.js' -g'*.jsx'
rg -n 'aspect-\[[0-9.]+/[0-9.]+\]' -g'*.ts' -g'*.tsx' -g'*.js' -g'*.jsx'

Repository: al-husayn/blog

Length of output: 501


Fix invalid Tailwind aspect-ratio utility (aspect-16/10)

aspect-16/10 isn’t valid Tailwind aspect-ratio syntax; use arbitrary value form aspect-[16/10]. rg finds this invalid class in:

  • components/home/articles-grid-skeleton.tsx (current snippet)
  • components/read-more-section.tsx
  • components/blog-card.tsx
🔧 Proposed fix
-                        <div className='aspect-16/10 w-full animate-pulse bg-muted/50' />
+                        <div className='aspect-[16/10] w-full animate-pulse bg-muted/50' />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className='aspect-16/10 w-full animate-pulse bg-muted/50' />
<div className='aspect-[16/10] w-full animate-pulse bg-muted/50' />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/home/articles-grid-skeleton.tsx` at line 10, The Tailwind
aspect-ratio utility used is invalid: replace any occurrences of the class
string "aspect-16/10" (found in the ArticlesGridSkeleton component in
components/home/articles-grid-skeleton.tsx and likewise in
components/read-more-section.tsx and components/blog-card.tsx) with the
arbitrary-value syntax "aspect-[16/10]"; update the JSX className values where
the div uses aspect-16/10 to use aspect-[16/10], and run your linter/build to
confirm the classes are recognized.

</PaginationLink>

<div className='order-3 w-full justify-center flex items-center gap-2 md:order-none md:w-auto'>
<div className='order-3 w-full justify-center flex items-center gap-2 md:order-0 md:w-auto'>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Bug fix: Replaces invalid md:order-none with valid md:order-0.

This change fixes a bug where md:order-none (which is not a valid Tailwind utility) is replaced with md:order-0. The previous code was not applying any ordering at the medium breakpoint, likely causing layout issues. The new code correctly applies order: 0 at medium screens and above.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/home/pagination.tsx` at line 91, The pagination layout used an
invalid Tailwind utility `md:order-none`; locate the Pagination component's JSX
(the div with className including "order-3 w-full justify-center flex
items-center gap-2 ...") and replace `md:order-none` with the valid utility
`md:order-0` so the element has order:0 at medium screens (ensuring correct
ordering at md breakpoint).

Comment thread components/site-nav.tsx
@al-husayn al-husayn self-assigned this Jun 8, 2026
@al-husayn al-husayn added enhancement New feature or request help wanted Extra attention is needed labels Jun 8, 2026
@al-husayn al-husayn merged commit 53118c4 into main Jun 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant