Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Deploy preview #240

Merged
merged 17 commits into from
Mar 1, 2025
Merged

Deploy preview #240

merged 17 commits into from
Mar 1, 2025

Conversation

mahid797
Copy link
Collaborator

@mahid797 mahid797 commented Feb 26, 2025

This PR resolves all build errors preventing the deployment of the project preview to Vercel. The changes include fixing TypeScript issues, cleaning up outdated code, updating core dependencies, and refactoring components and services to comply with Next.js 15 and React 19 standards. These updates ensure improved stability, maintainability, and compatibility with modern development practices. Closes #237 and #238


🔑 Changes Summary

  • 🚀 Updated project dependencies in package.json to the latest stable versions:
    • Upgraded to Next.js 15 for enhanced App Router capabilities and build optimizations.
    • Upgraded to React 19, incorporating automatic batching and updated lifecycle management.
    • Updated Material-UI (MUI) to v6.4.5 for improved component styling and performance.
  • 🔑 Updated authentication logic:
    • Refactored api\auth\[...nextauth]\route.ts to use authOptions.ts.
    • Removed unused request parameters.
  • 🛠️ Refactored API routes and page components to align with Next.js 15 structure and features.
  • ✉️ Disabled email sending functionality for demo deployment:
    • Removed react-email usage.
    • Refactored associated email components to prevent unintended triggers.
  • 🔍 Resolved TypeScript type errors across the codebase for stricter type safety.
  • 🧹 Removed outdated code and deprecated seed options to streamline the build process.
  • 📝 Improved environment variable management:
    • Created a new .env.example to document necessary environment variables.
  • 🔧 Fixed HTML entity encoding issues for consistent content rendering.

⚠️ Important:

  • Next.js 15 introduces breaking changes in routing and server actions.
  • React 19 includes automatic batching, updated hooks behavior, and strict mode improvements.
  • Refer to the Next.js 15 Migration Guide and React 19 Release Notes for details.

🔗Part of: #236 - Deploy Project Preview to Vercel

All API and page components have been refactored to use Promise for params handling, according to the latest Next.Js 15 specifications
- Updated next.config.mjs to include server-side external packages, enable React strict mode, and enforce TypeScript build validation.
- Modified DocumentsPage to use dynamic rendering and streamlined the list of features with a map function for better readability.
@mahid797 mahid797 added Refactor Code Improvement Core Work to do on the core system of the App 🔥Critical Must be addressed immediately; blocking core functionality or major bug labels Feb 26, 2025
@mahid797 mahid797 added this to the v0.1 milestone Feb 26, 2025
@mahid797 mahid797 self-assigned this Feb 26, 2025
@mahid797 mahid797 added the New Feature New feature to be implemented label Feb 26, 2025
@mahid797 mahid797 marked this pull request as ready for review February 26, 2025 12:47
This was linked to issues Feb 26, 2025
@mahid797
Copy link
Collaborator Author

@SajanGhuman @parwatcodes

Please review this as soon as possible.

mahid797 and others added 5 commits February 27, 2025 03:26
**This closes #234.**

**Implemented:** 

1. Ran the build to identify all current build warnings in the terminal.
2. Fixed missing dependencies in React Hooks (useEffect, useCallback,
useMemo).
3. Tested affected components to ensure functionality remains intact
after fixes.
4. Reran the build after each set of changes to verify warnings are
resolved.


**Warnings before being fixed:**

1. **ContactsTable.tsx**

Warning: React hook useEffect has a missing dependency.
Fixed by rowHeight state ( e.g., [rowHeight] ).


2. **DocumentsTable.tsx**

Warning: React hook useEffect has a missing dependency.
Fixed by rowHeight state ( e.g., [rowHeight] ).


3. **DragAndDropBox.tsx**

Warning: React hook useCallback has a missing dependency.
Fixed by handleFileSelect function because the related function (onDrop)
is effected by handleFileSelect ( e.g., [handleFileSelect] ).
Then, wrapped handleFileSelect in useCallback with the related
dependencies to prevent unnecessary re-creation of onDrop on every
render.


4. **FileAccessContainer.tsx**

Warning: React hook useEffect has a missing dependency.
Fixed by toast. In fact, the useEffect hook already had linkId as a
dependency, but it needed both linkId and toast because the useEffect
hook should run whenever either linkId or toast changes ( e.g., [linkId,
toast] ).


5. **ProfileForm.tsx**

Warning: React hook useEffect has a missing dependency.
In this case, we had the fetchProfileData function inside the useEffect
hook, so we needed to leave the the dependency array empty.


6. **Breadcrumb.tsx**

Warning: React hook useMemo has a missing dependency.
Fixed by renderBreadcrumb function. In fact, the useMemo hook already
had pathnames as a dependency, but it needed both pathnames and
renderBreadcrumb because the useMemo hook should run whenever either
pathnames or renderBreadcrumb changes ( e.g., [pathnames,
renderBreadcrumb] ).
Then, wrapped renderBreadcrumb in useCallback with the related
dependency to prevent unnecessary re-creation of breadcrumbs on every
render.


7. **CustomCircularProgress.tsx**

Warning: React hook useEffect has a missing dependency.
Fixed by the handleProgress seState, which was passed to the
CustomCircularProgress component as a props ( e.g., [handleProgress] ).
@mahid797 mahid797 merged commit 7ac524f into dev Mar 1, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Core Work to do on the core system of the App 🔥Critical Must be addressed immediately; blocking core functionality or major bug New Feature New feature to be implemented Refactor Code Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Build Errors Update Project Dependencies
3 participants