moogle-cc / moogle-blog

This is the open sourced Moogle blog which powers all custom domains and subdomain.moogle.cc type blogs. The source code for the admin dashboard for the moogle blog is at https://github.com/moogle-cc/moogle-blog-admin
MIT License
7 stars 0 forks source link

Switch to Next.js #18

Open siddiquiaffan opened 2 years ago

siddiquiaffan commented 2 years ago

Next.js is a react framework for production.

It has some intresting features listed down below:

Head over to https://nextjs.org/ for more.

saiorama commented 2 years ago

I looked at next.js and decided not to use it because it needs pre-processing to generate static files. It's not well suited for fully serverless blogs like Moogle. Happy to be corrected if you know something about next.js that I don't.

siddiquiaffan commented 2 years ago

Not exactly. You don't need to generate static files. NextJs supports dynamic rendering. Have a look at this https://nextjs.org/docs/basic-features/data-fetching.

For example if you want that, data should be fetched from server on every request, next.js has getServerSideProps. If you want to revalidate after a certain time next.js has getStaticProps.

Next.js only generates static files for those pages in which no dynamic data is fetched from server or database. For example Home page, About page etc. Even you can use getStaticProps on those pages so that it'll revalidate after certain time as data might not be going to change/update very frequently.

BTW it's your choice 🙂

siddiquiaffan commented 2 years ago

In case you have any further doubt you can connect me on telegram or via email.