omshub / website

Unofficial reviews site for Georgia Tech's Online Master of Science (OMS) programs. Contact: gt.omshub@gmail.com
https://omshub.org
GNU General Public License v3.0
58 stars 8 forks source link

[BUG] Use Static Site Generation to generate review pages #99

Closed MatthewCaseres closed 1 year ago

MatthewCaseres commented 2 years ago

Describe the bug We are currently fetching data in a useEffect, it can be generated at build time.

To Reproduce There is a loading spinner that shouldn't exist when looking at the course reviews.

Expected behavior Pages are blazingly fast.

MatthewCaseres commented 2 years ago

https://nextjs.org/docs/basic-features/data-fetching/get-static-props

shaun-jacks commented 2 years ago

I'm new to Next but was curious what happens if the review data changes after build time? Do we need to do another rebuild of the site? Then I came across https://youtu.be/BGexHR1tuOA and this seems to fix that !

MatthewCaseres commented 2 years ago

Right! I have it in this branch for the main page, just waiting on merge

https://github.com/omshub/website/pull/100

awpala commented 1 year ago

Using SWR instead for data fetching, cf. PR #131. Closing issue.