amupedia2021 / amupedia-web

Source code of the website.
https://www.amupedia.site/
MIT License
164 stars 178 forks source link

🚀 [Feature Request] - Migration from Pages Router to App Router in Next.js #464

Closed s2sharpit closed 1 year ago

s2sharpit commented 1 year ago

Is your feature request related to a problem ? Please describe. ✍️

I would like to propose a migration from the existing Pages Router to the new App Router in Next.js. This transition would bring numerous benefits and enhance the overall development experience.

Benefits

Allow me to outline the advantages of adopting the App Router over the Pages Router:

  1. Improved Performance: The App Router introduces optimized client-side routing, resulting in faster navigation between pages. By utilizing dynamic imports, it enables code splitting, leading to smaller initial page loads and improved performance for users.

  2. Enhanced Developer Experience: The App Router simplifies the management of complex routing scenarios. It offers a more intuitive and declarative API, allowing developers to define their routes in a centralized configuration file. This approach improves code maintainability and reduces duplication, leading to a cleaner and more scalable codebase.

  3. Enhanced Code Splitting: The App Router allows for granular control over code splitting, enabling us to dynamically load only the necessary components for each page. As a result, the initial page load is significantly faster, and subsequent navigations are more efficient.

  4. Advanced Route Handling: The App Router introduces additional features such as nested routes, parameter-based routing, and dynamic route segments. These capabilities enable more flexible and dynamic page structures, making it easier to handle various URL patterns and create dynamic routes that adapt to different contexts.

  5. SEO-Friendly: The App Router supports server-side rendering (SSR) and static site generation (SSG), making it SEO-friendly out of the box. It ensures that search engines can crawl and index your application's pages effectively, improving discoverability and organic traffic.

  6. Layout Flexibility: Unlike the Pages Router, which enforces a strict file-based layout structure, the App Router allows us to have more flexibility in designing layouts. We can easily create shared layouts that wrap multiple pages without duplicating code, promoting better code organization.

Describe briefly how you would implement this enhancement.

Migration Plan

To ensure a smooth transition from the Pages Router to the App Router, I suggest the following migration plan:

  1. Conduct a thorough code analysis and identify all the relevant routes currently implemented with the Pages Router.

  2. Create a test branch to implement the App Router in the existing codebase, while keeping the Pages Router intact to avoid disrupting the application's functionality during the migration process.

  3. Migrate one route at a time, testing each page thoroughly to ensure functionality remains consistent.

  4. Update any custom code associated with navigation, such as Link components, to work with the App Router.

  5. Conduct rigorous testing, including performance tests, to benchmark the improvements achieved through the migration.

  6. Ensure the codebase adheres to the best practices and conventions recommended by Next.js for App Router implementation.

  7. Update the documentation and provide clear instructions for developers on how to work with the new App Router.

Additional context or screenshots

Conclusion

I believe that migrating to the App Router is a valuable step for our project, bringing numerous benefits to both developers and end-users. The improved performance, enhanced developer experience, advanced route handling, SEO-friendliness, and layout flexibility make it a compelling choice. With the suggested migration plan, we can ensure a smooth and successful transition. I would be more than happy to assist with the migration process and provide any necessary support.

Thank you for considering this proposal. I look forward to discussing and implementing this change.

Are you contributing for a program?

GSSoC2023

Code of Conduct

github-actions[bot] commented 1 year ago

Hello @s2sharpit! Thank you for raising this issue.

Please make sure to follow our Contributing Guidelines. 💪🏻 Don't forget to ⭐ our Project-Amupedia. 📔

Our review team will carefully assess the issue and reach out to you soon! 😇 We appreciate your patience! 😀

anmode commented 1 year ago

cool

s2sharpit commented 1 year ago

Thank you for assigning me to this issue. I appreciate the opportunity to work on implementing the migration from the existing Pages Router to the new App Router in Next.js.

To ensure a focused and organized approach, I kindly request that you create a dedicated branch specifically for this migration, such as "app-router-migration." This will allow us to work on the migration without disrupting the main development branch and maintain the application's functionality throughout the process.

Once the branch is created, I will proceed with the following steps:

  1. Implement the App Router: I will begin implementing the App Router in the "app-router-migration" branch while keeping the existing Pages Router intact.

  2. Migrate one route at a time: I will migrate each route individually, ensuring that each page functions properly with the App Router.

  3. Thorough testing: I will conduct comprehensive testing on each page after migration to ensure consistent functionality and identify any issues.

  4. Update navigation code: I will update any custom code related to navigation, such as Link components, to work seamlessly with the App Router.

  5. Adhere to best practices: I will ensure that the codebase adheres to the best practices and conventions recommended by Next.js for implementing the App Router.

If you have any questions, suggestions, or specific guidelines you would like me to follow during the migration process, please let me know. I value your input and want to ensure that the migration aligns with your expectations.

Thank you for your trust in me to handle this task. I'm excited to work on this enhancement and I'm available to provide any support or assistance throughout the migration process.

s2sharpit commented 1 year ago

Hey @anmode Looking forward to your response.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 7 days since being marked as stale.