Skip to content

Conversation

@MichaelFisher1997
Copy link

Summary

  • Updated 15 dependencies including critical @opennextjs/cloudflare upgrade (1.3.1 → 1.11.0)
  • Fixed Cloudflare deployment by adding nodejs runtime to 15+ pages/API routes
  • Successfully deployed to Cloudflare Workers with Pro plan (4.4MB bundle)
  • Added comprehensive documentation (AGENTS.md)

Dependencies Updated

  • @opennextjs/cloudflare: 1.3.1 → 1.11.0 (critical for deployment)
  • react: 19.1.0 → 19.2.0
  • react-dom: 19.1.0 → 19.2.0
  • All @radix-ui UI components (9 packages) to latest stable
  • axios: 1.7.9 → 1.12.2
  • motion: 12.0.5 → 12.23.24
  • wrangler: 4.22.0 → 4.43.0

Deployment Fixes

  • Added export const runtime = "nodejs" to fix edge runtime compatibility
  • Updated wrangler.jsonc with correct worker configuration
  • Temporarily removed R2 cache (will restore when main Cloudflare access is granted)

Resolves

Next Steps

  • Phase 3: Major updates (Next.js, Sanity, TailwindCSS)
  • Restore R2 cache when Cloudflare account access is granted
  • Add CORS origins to Sanity for reviews section

Status

✅ All dependency updates completed without breaking changes
✅ Successfully deployed and functional
⚠️ Local CORS issues with Sanity (production works fine)

## Dependencies Updated (15 packages)
- @opennextjs/cloudflare: 1.3.1 → 1.11.0 (critical for deployment)
- react: 19.1.0 → 19.2.0
- react-dom: 19.1.0 → 19.2.0
- All @radix-ui UI components (9 packages) to latest stable
- axios: 1.7.9 → 1.12.2
- motion: 12.0.5 → 12.23.24
- wrangler: 4.22.0 → 4.43.0

## Deployment Fixes
- Added `export const runtime = "nodejs"` to 15+ pages/API routes to fix edge runtime compatibility
- Updated wrangler.jsonc with correct worker name and service bindings
- Removed R2 cache dependency from open-next.config.ts
- Modified Sanity client to use CDN only in production

## Documentation
- Added AGENTS.md with build commands, code style guidelines, and architecture notes

## Deployment Status
✅ Successfully deployed to Cloudflare Workers (requires Pro plan for 4.4MB bundle)
✅ All dependency updates completed without breaking changes
⚠️ Local development has CORS issues with Sanity API (production works fine)

## Next Steps
- Consider major updates: Next.js, Sanity, TailwindCSS (require individual testing)
- Add localhost to Sanity CORS settings for local development
- Monitor bundle size optimization opportunities
@sonarqubecloud
Copy link

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Summary

This PR successfully modernizes the Redot website's deployment infrastructure by upgrading @opennextjs/cloudflare from 1.3.1 to 1.11.0 and fixing Cloudflare Workers compatibility issues. The changes enable successful deployment to Cloudflare Workers by adding runtime = "nodejs" to 15+ pages and API routes, addressing edge runtime incompatibilities.

Key changes:

  • Updated 15 dependencies including React 19.1.0 → 19.2.0, all @radix-ui components, motion, and wrangler
  • Removed R2 cache configuration (temporary until main Cloudflare account access is granted)
  • Simplified Cloudflare worker configuration in wrangler.jsonc
  • Added output: "standalone" to Next.js config for proper bundling
  • Updated Sanity client to only use CDN in production

Critical issue found:

  • axios version 1.12.2 specified in package.json does not exist (latest is 1.7.x series)

Confidence Score: 2/5

  • This PR cannot be merged as-is due to invalid axios version that will cause installation failures
  • The axios version typo (1.12.2 instead of 1.7.12 or similar) is a critical blocker that will prevent npm install or bun install from working. All other changes appear sound and well-tested, but this syntax error must be fixed before merging
  • package.json requires immediate attention to fix the invalid axios version

Important Files Changed

File Analysis

Filename Score Overview
package.json 2/5 Updated 15 dependencies including critical @opennextjs/cloudflare upgrade, but axios version 1.12.2 does not exist
wrangler.jsonc 4/5 Removed R2 bucket and service bindings, simplified worker name to redot-website
open-next.config.ts 4/5 Removed R2 incremental cache configuration, now uses memory-based caching
next.config.ts 5/5 Added output: "standalone" for Cloudflare deployment compatibility
app/api/download/route.ts 5/5 Changed runtime from edge to nodejs for Cloudflare Workers compatibility

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Build as Next.js Build
    participant OpenNext as OpenNext Cloudflare
    participant Worker as Cloudflare Worker
    participant Assets as Cloudflare Assets
    participant Sanity as Sanity CMS

    Dev->>Build: npm run build
    Build->>Build: Compile Next.js app (standalone output)
    Build->>Build: Add runtime="nodejs" to pages/routes
    
    Dev->>OpenNext: opennextjs-cloudflare build
    OpenNext->>OpenNext: Bundle worker.js
    OpenNext->>OpenNext: Extract static assets
    OpenNext->>OpenNext: Configure memory-based cache (no R2)
    
    Dev->>OpenNext: opennextjs-cloudflare deploy
    OpenNext->>Worker: Deploy worker.js (4.4MB)
    OpenNext->>Assets: Deploy static assets
    Worker->>Worker: Initialize with nodejs_compat flag
    
    Note over Worker: Runtime Execution
    Worker->>Worker: Execute nodejs runtime routes
    Worker->>Sanity: Fetch content (useCdn in production)
    Sanity-->>Worker: Return CMS data
    Worker->>Assets: Serve static files
    Worker-->>Dev: Return response
Loading

23 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

"@sanity/vision": "3",
"@tabler/icons-react": "^3.22.0",
"axios": "^1.7.9",
"axios": "^1.12.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: axios version 1.12.2 does not exist - the latest version is 1.7.x. This appears to be a typo (likely meant 1.7.12 or similar)

Suggested change
"axios": "^1.12.2",
"axios": "^1.7.12",
Prompt To Fix With AI
This is a comment left during a code review.
Path: package.json
Line: 46:46

Comment:
**syntax:** axios version 1.12.2 does not exist - the latest version is 1.7.x. This appears to be a typo (likely meant 1.7.12 or similar)

```suggestion
    "axios": "^1.7.12",
```

How can I resolve this? If you propose a fix, please make it concise.

@MichaelFisher1997
Copy link
Author

image

@MichaelFisher1997
Copy link
Author

the bots gone crazy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MODERNIZATION] Update core dependencies and fix Cloudflare deployment

1 participant