Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

[Issue #134] Renable static rendering #85

Merged
merged 3 commits into from
Jul 5, 2024
Merged

Conversation

acouch
Copy link
Member

@acouch acouch commented Jun 15, 2024

Summary

Fixes #134

Time to review: 10 mins

Changes proposed

With the move to the app router, pages were no longer statically rendered which meant that the server re-rendered the pages every time a new user visits the site which is bad for performance and not necessary for static HTML. This fixes that.

This removes the unit tests for pages because of an error we got "unstable_setRequestLocale" is not supported in Client Components. which is not true, but broke the unit tests. There is coverage for pages in the e2e tests.

@rylew1
Copy link
Collaborator

rylew1 commented Jun 18, 2024

Not sure why pa11y is failing on the search page - I wonder if because part of the layout is static, but the actual page is dynamic it causes some problems - but also there is another PR that @btabaska is working on to have pa11y load the api on its runs (so we test the search results in a11y tests).

I think I pulled this PR down the other day and the search page does work though - just with a red alert error because no api.

Copy link

github-actions bot commented Jul 3, 2024

Coverage report for ./frontend

St.
Category Percentage Covered / Total
🟢 Statements
83.72% (-0.15% 🔻)
756/903
🟡 Branches
66.99% (-1.26% 🔻)
207/309
🟡 Functions
77.07% (+0.97% 🔼)
158/205
🟢 Lines
83.83% (+0.37% 🔼)
710/847
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / Header.tsx
95.45%
62.5% (-12.5% 🔻)
100% 95.24%
🟢
... / breadcrumbs.ts
70% (-25% 🔻)
100% 100% 100%

Test suite run success

158 tests passing in 49 suites.

Report generated by 🧪jest coverage report action from 6435c62

@acouch acouch changed the title Renable static rendering [Issue #134] Renable static rendering Jul 3, 2024
@acouch acouch marked this pull request as ready for review July 3, 2024 21:08
@acouch acouch requested a review from andycochran as a code owner July 3, 2024 21:08
@@ -8,7 +8,7 @@ import PageSEO from "src/components/PageSEO";
import BetaAlert from "src/components/BetaAlert";
import { useTranslations } from "next-intl";
import { Metadata } from "next";
import { getTranslations } from "next-intl/server";
import { getTranslations, unstable_setRequestLocale } from "next-intl/server";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a code comment here that unstable_setRequestLocale is a temporary API that next-intl aims to remove it in the future?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…and that, per their docs, you must be "cautious to apply it in all relevant places"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we make a ticket for dealing with this in the future?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name unstable_ is a common convention and speaks for itself, and this is used in every page, so would opt not to comment in the code. I'll create a ticket to remove it. It could be a while based on amannn/next-intl#663

@acouch acouch merged commit 78dfc83 into main Jul 5, 2024
12 checks passed
@acouch acouch deleted the acouch/static-render-pages branch July 5, 2024 12:29
acouch added a commit that referenced this pull request Sep 18, 2024
acouch added a commit that referenced this pull request Sep 18, 2024
acouch added a commit to HHS/simpler-grants-gov that referenced this pull request Sep 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Re-enable static rendering
3 participants