This diff tries to move the rounds page to rely on more raw data (which is pretty easy for this page) instead of precomputing everything.
Along the way, it relies on getStaticProps, which is essentially the nextJS version of writing to a static file like we were doing before. A nifty benefit is that it will automatically recompute the static data needed for the page every 30 seconds (as configured) if needed, so we don't need to redeploy when the spreadsheet changes.
I also tweaked some things along the way:
Move from using values.get() to values.batchGet() which allows us to make once API request to gogole to get all the data from the sheet instead of 1 request per round.
I wanted to get some type data so it'd be easier to code in VSCode. Since JSDoc comments are supported, I added some types using those. If we want TS and real types in the future, we can basically move that text out of comments and it should mostly just work.
We used to have the index page just export the RoundsPage. That doesn't well if nextJS is expecting extra methods (getInitialProps, getStaticProps, etc). This took me hours to figure out. So I dropped the index page and added a redirect from '/' to '/rounds' in next.config.js.
This diff tries to move the rounds page to rely on more raw data (which is pretty easy for this page) instead of precomputing everything.
Along the way, it relies on getStaticProps, which is essentially the nextJS version of writing to a static file like we were doing before. A nifty benefit is that it will automatically recompute the static data needed for the page every 30 seconds (as configured) if needed, so we don't need to redeploy when the spreadsheet changes.
I also tweaked some things along the way: