Closed OneRandom1509 closed 10 months ago
The new commits have made all the pages to be server-side and components to be server-side, except the sidebar and the carousel as it needs the user interactivity in order for it to work. All the above commented required changes have been made in a proper manner too.
Migration to App Router
This pull request addresses issue #1 by migrating the Nex music player application from the "pages router" to the "app router." This change helps us take advantage of the latest Next.js features and improves the overall maintainability and performance of Nex.
In this process,
_app.tsx
and_document.tsx
have been merged intolayout.tsx
file in the root directory of the app folder, and404.tsx
has been replaced with the new convention -not-found.tsx
. Some components have been added withuse client;
directive in order to use the newrouter()
router instance andusePathame()
function fromnext/navigation
instead of the old router instance fromnext/router
, both of which can only be used in the client side.In addition to the migration, the
SEO
page has been replaced with the new built-inMetadata
API to export metadata easily inside the app router.Every
page
inside the app router has been split into two files -layout.tsx
andpage.tsx
.layout.tsx
is where every client side operation takes place andpage.tsx
is where server side operations take place. For now, the only server side operation inpage.tsx
files is the export of metadata using Metadata API. A void function has been written in order to bypass the error of not exporting a react component in the file. This void function can be used for future server side features as well.Screenshots
The improved not-found page