-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite to Next.js from CRA (#108) #109
Conversation
* Rewrite to Next.js * Fix file capitalization
Deploying with Cloudflare Pages
|
Oh, I'm very dumb and didn't realize that there needed to be changes to actions. This is why you don't do things at 7AM so that you can feel productive when you are woken up by yet another ceiling leak in your Smile apartment. |
Copying from Minh's original comment- will work on this later today if I have time Closes #93 Summary of ChangesHere is my own Cloudflare Pages deployment to allow for testing: https://acm-uiuc-website.pages.dev/ Performance ImprovementsNext.js with static exports allows the site to load much faster than CRA since the HTML has been pre-rendered. The main website now also functions without JavaScript needing to be enabled. Routing ChangesSince CRA previously used hash routing to support SPAs, routes were previously explicitly defined in I created two route groups,
To support the transition from hash routes to static routes, I have added a script to the Additionally, the previous
Examples:
Package ChangesSeveral packages were required to be updated in order to work with the latest version of Next.js. Most notably, Storybook was also updated from major 6 to major 7, which didn't impact the repo much, at least when I using Beyond that, I added Styling ChangesTailwind preflight was affecting some of the original styles on the website - so I rewrote all the previous CSS-in-JS into Tailwind classes and (very few) CSS modules. Along the way, I fixed many styling issues related to smaller screen breakpoints and also restyled the committees section. As a result, Fonts are also now served first-party via Next.js font optimization rather than Google Fonts. Next Steps
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -22,10 +22,10 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- - name: Use Node.js 16.x
+ - name: Use Node.js 18
uses: actions/setup-node@v3
with:
- node-version: 16.x
+ node-version: 18
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: yarn run build --if-present
@@ -35,7 +35,7 @@ jobs:
shell: bash
- run : git config user.email [email protected]
shell: bash
- - run : git --work-tree build add --all
+ - run : git --work-tree out add --all
shell: bash
- run : git commit -m "Automatic Deploy action run by github-actions"
shell: bash
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed on discord:
Use dynamic routing to support /event/[id]
paradigm instead of /event?id=[id]
URLs.
Setup next.js edge worker support so we can host on Cloudflare Pages while still using dynamic features (this also enables us to one-click compression and other nice comforts later down the line).
The reason for this was actually that cf expected the output to be in |
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
That fix does not actually work. This is for dev output cache ( |
That fix is currently working in prod (www.acm.illinois.edu). |
Ok, |
Rewrite to Next.js
Fix file capitalization