-
Notifications
You must be signed in to change notification settings - Fork 16
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
[Issue #3434] React USWDS, React, Next.JS upgrade #3515
base: main
Are you sure you want to change the base?
Conversation
@@ -2,4 +2,4 @@ | |||
/// <reference types="next/image-types/global" /> | |||
|
|||
// NOTE: This file should not be edited | |||
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. | |||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. |
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.
This was autogen
import { useTranslations } from "next-intl"; | ||
import Link from "next/link"; | ||
import Image from "next/image"; |
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.
Updated this to use the same image strategy as the Footer
component because this one doesn't work in React 19/Next 15 (not sure specifically why).
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.
This is no longer used, should have been removed in #507
@@ -22,7 +21,7 @@ export type ValidationErrors = { | |||
export default function SubscriptionForm() { | |||
const t = useTranslations("Subscribe"); | |||
|
|||
const [state, formAction] = useFormState(subscribeEmail, { | |||
const [state, formAction] = useActionState(subscribeEmail, { |
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.
@@ -61,7 +61,8 @@ export const createSession = async (token: string) => { | |||
} | |||
const expiresAt = newExpirationDate(); | |||
const session = await encrypt(token, expiresAt, clientJwtKey); | |||
cookies().set("session", session, { | |||
const cookie = await cookies(); |
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.
Dynamic APIs are:
- The params and searchParams props that get provided to pages, layouts, metadata APIs, and route handlers.
- cookies(), draftMode(), and headers() from next/headers
In Next 15, these APIs have been made asynchronous. You can read more about this in the Next.js 15 Upgrade Guide.
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.
Removed as no longer using.
@@ -1,5 +0,0 @@ | |||
import { environment } from "src/constants/environments"; |
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.
This no longer worked, haven't researched why it was necessary. import logoPath from "public/image/logo.png"
does work for static images.
37824de
to
899b198
Compare
27d030f
to
ae3527a
Compare
I've got tests working for upgrading to React 19 and Next.JS 15. Currently working on: 2. Errors in the console compiling SCSS⚠ ./src/styles/styles.scss.webpack[javascript/auto]!=!./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[11].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[11].use[3]!./node_modules/next/dist/build/webpack/loaders/resolve-url-loader/index.js??ruleSet[1].rules[13].oneOf[11].use[4]!./node_modules/next/dist/compiled/sass-loader/cjs.js??ruleSet[1].rules[13].oneOf[11].use[5]!./src/styles/styles.scss
Deprecation Warning on line 13, column 6 of file:///Users/partisan/workshop/grants/simpler-grants-gov2/frontend/node_modules/@uswds/uswds/packages/uswds-core/src/styles/functions/units/rem-to-user-em.scss:13:6:
Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
Use math.unit instead.
More info and automated migrator: https://sass-lang.com/d/import
13 | @if unit($grid-in-rem) != "rem" {
node_modules/@uswds/uswds/packages/uswds-core/src/styles/functions/units/rem-to-user-em.scss 14:7 rem-to-user-em()
node_modules/@uswds/uswds/packages/uswds-core/src/styles/mixins/helpers/at-media.scss 17:12 at-media()
node_modules/@uswds/uswds/packages/usa-display/src/styles/_usa-display.scss 7:3 @forward
node_modules/@uswds/uswds/packages/usa-display/src/styles/_index.scss 4:1 @forward
node_modules/@uswds/uswds/packages/usa-display/_index.scss 5:1 @forward
node_modules/@uswds/uswds/packages/uswds-typography/_index.scss 5:1 @forward
node_modules/@uswds/uswds/packages/uswds/_index.scss 13:1 @forward
src/styles/styles.scss 2:1 root stylesheet 3. Better documenting PR / changes |
Summary
Fixes #3434
Time to review: x mins
Changes proposed
Context for reviewers
Additional information