Skip to content

LINK-2463 | Upgrade HDS to v6 and React to v19#299

Merged
jorilindell merged 7 commits into
mainfrom
LINK-2463-react-19-and-hds-6
Jun 11, 2026
Merged

LINK-2463 | Upgrade HDS to v6 and React to v19#299
jorilindell merged 7 commits into
mainfrom
LINK-2463-react-19-and-hds-6

Conversation

@jorilindell

@jorilindell jorilindell commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR upgrades the UI stack to React 19 and HDS 6, and applies the compatibility fixes required for build, runtime, and tests.

Changes

  • Upgraded core dependencies:
    • React and React DOM to 19.2.7
    • hds-core, hds-design-tokens, hds-react to 6.0.2
    • @tanstack/react-query to 5.101.0
    • Testing Library packages aligned with React 19
  • Added/updated supporting dependencies required by the upgrade:
    • @juggle/resize-observer
    • react-merge-refs
    • react-use-measure
    • @testing-library/dom
    • vite
  • Updated UI/component code for compatibility:
    • Single select typings migrated to component-derived props
    • Server error summary migrated from ErrorSummary to Notification
    • Menu dropdown keyboard/focus handling updated for React 19 patterns
    • Dialog focusAfterCloseRef typing adjusted in confirm delete signup modal

Refs: LINK-2463

Summary by CodeRabbit

  • New Features

    • Improved menu dropdown keyboard and click handling for better accessibility.
  • Bug Fixes

    • Switched server error display to consistent notification component.
  • Chores

    • Upgraded React to v19 and updated HDS, React Query, Sentry, Vite, testing libs and other dependencies.
    • Added a postinstall maintenance script to patch third-party cookie-consent assets.
  • Refactor

    • Tightened TypeScript typings across query hooks and select/form components.
  • Tests

    • Relaxed dehydrated-state assertions for more resilient tests.

add missing runtime packages:
- @juggle/resize-observer
- @sentry/browser
- @sentry/core
- date-fns
- react-merge-refs
- react-use-measure

add vite to devDependencies for vitest config usage

Refs: LINK-2463
@jorilindell jorilindell requested a review from a team as a code owner June 10, 2026 21:55
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jorilindell, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 8 minutes and 47 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7fec1630-bad5-4a70-98f4-682052814a52

📥 Commits

Reviewing files that changed from the base of the PR and between b8eaa2a and 0486a9f.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • src/domain/attendanceList/searchRow/__tests__/__snapshots__/SearchRow.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (22)
  • README.md
  • package.json
  • scripts/fix-hds-core-cookie-consent.js
  • src/__tests__/Pages.test.tsx
  • src/common/components/formFields/SingleSelectField.tsx
  • src/common/components/menuDropdown/MenuDropdown.tsx
  • src/common/components/serverErrorSummary/ServerErrorSummary.tsx
  • src/common/components/singleSelect/SingleSelect.tsx
  • src/domain/event/query.ts
  • src/domain/order/query.ts
  • src/domain/payment/query.ts
  • src/domain/registration/__tests__/query.test.ts
  • src/domain/registration/query.ts
  • src/domain/signup/__tests__/query.test.ts
  • src/domain/signup/modals/confirmDeleteSignupModal/ConfirmDeleteSignupModal.tsx
  • src/domain/signup/query.ts
  • src/domain/signupGroup/__tests__/query.test.ts
  • src/domain/signupGroup/query.ts
  • src/domain/singups/query.ts
  • src/domain/user/query.ts
  • src/pages/_app.tsx
  • src/utils/getEnvValue.ts
📝 Walkthrough

Walkthrough

Upgrades core dependencies (React 19, HDS 6, React Query 5), adds a postinstall shim script, adapts Select typings and ServerErrorSummary to HDS 6 API, refactors MenuDropdown keyboard/focus logic, tightens React Query hook option generics, and relaxes dehydrated-state test assertions.

Changes

React 19 and HDS 6.0 Upgrade

Layer / File(s) Summary
Dependency upgrades and postinstall shim
package.json, scripts/fix-hds-core-cookie-consent.js
Bump React→19.2.7, HDS→6.0.2, React Query→5.101.0, testing and build tooling; add postinstall script and shim script that writes/updates hds-core cookieConsent.js from cookieConsent.css.
Select component type refactoring
src/common/components/formFields/SingleSelectField.tsx, src/common/components/singleSelect/SingleSelect.tsx
Replace SelectProps imports with ComponentProps<typeof Select> for select prop typings to match HDS 6 types.
ServerErrorSummary component API update
src/common/components/serverErrorSummary/ServerErrorSummary.tsx
Replace ErrorSummary with Notification, pass type="error", and use NotificationSize.Medium.
MenuDropdown keyboard and focus refactoring
src/common/components/menuDropdown/MenuDropdown.tsx
Memoize open/close/focus helpers, centralize item activation, extract onDropdownKeyDown handler, reset focusedIndex via effect, and use functional state updater for toggling.
Test dehydration assertion updates
src/__tests__/Pages.test.tsx, src/domain/registration/__tests__/query.test.ts, src/domain/signup/__tests__/query.test.ts, src/domain/signupGroup/__tests__/query.test.ts
Change dehydrated-state assertions to use expect.objectContaining(...) for partial matching of dehydrated query entries.
React Query hook generics tightening & hydration typing
src/domain/*/query.ts, src/pages/_app.tsx
Narrow options types on various useXQuery hooks to Pick<UseQueryOptions<T, Error>, ...> and change _app's dehydratedState prop to DehydratedState.
Minor type and lint fixes
src/domain/signup/modals/ConfirmDeleteSignupModal.tsx, src/utils/getEnvValue.ts
Cast focusAfterCloseRef to React.RefObject<HTMLElement> and add eslint-disable-next-line no-console before console.warn.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • mikkojamG

Poem

🐰 A shim, some types, a focused hop,

React and HDS leap to the top;
Selects aligned and tests set free,
Menu keys dance with harmony,
The rabbit cheers — the code runs happy!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and concisely describes the main objective: upgrading HDS to v6 and React to v19, matching the PR's primary focus across all changes.
Description check ✅ Passed The PR description provides a clear summary and detailed list of changes with specific version numbers and component updates, though it lacks the full template structure with Issues, Testing, and Screenshots sections.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch LINK-2463-react-19-and-hds-6

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/domain/signup/modals/confirmDeleteSignupModal/ConfirmDeleteSignupModal.tsx`:
- Around line 40-42: The explicit cast on focusAfterCloseRef is redundant—remove
the "as React.RefObject<HTMLElement>" assertion and pass
openConfirmationButtonRef directly to Dialog's focusAfterCloseRef prop in
ConfirmDeleteSignupModal; if the ref declaration differs, change the
openConfirmationButtonRef creation to React.useRef<HTMLElement>(null) so its
type already matches Dialog's focusAfterCloseRef?: RefObject<HTMLElement>.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 57270fd6-11af-4654-8dfc-5a0c4b2d4acb

📥 Commits

Reviewing files that changed from the base of the PR and between 9324525 and 2c14061.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • src/domain/attendanceList/searchRow/__tests__/__snapshots__/SearchRow.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (12)
  • package.json
  • src/__tests__/Pages.test.tsx
  • src/common/components/formFields/SingleSelectField.tsx
  • src/common/components/menuDropdown/MenuDropdown.tsx
  • src/common/components/serverErrorSummary/ServerErrorSummary.tsx
  • src/common/components/singleSelect/SingleSelect.tsx
  • src/domain/registration/__tests__/query.test.ts
  • src/domain/signup/__tests__/query.test.ts
  • src/domain/signup/modals/confirmDeleteSignupModal/ConfirmDeleteSignupModal.tsx
  • src/domain/signupGroup/__tests__/query.test.ts
  • src/utils/getEnvValue.ts
  • tsconfig.tsbuildinfo

@jorilindell jorilindell force-pushed the LINK-2463-react-19-and-hds-6 branch 2 times, most recently from d051f52 to b8eaa2a Compare June 10, 2026 23:00

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/common/components/menuDropdown/MenuDropdown.tsx (1)

100-100: ⚡ Quick win

Pass the memoized callback directly instead of wrapping it.

The arrow function (event) => onDropdownKeyDown(event) creates a new function reference on every render, which defeats the purpose of memoizing onDropdownKeyDown with useCallback (lines 103-138). If useDropdownKeyboardNavigation uses this callback as a dependency, the navigation setup may re-run on every render.

⚡ Recommended change
   } = useDropdownKeyboardNavigation({
     container: containerRef,
     disabledIndices: disabledIndices,
     listLength: items.length,
-    onKeyDown: (event) => onDropdownKeyDown(event),
+    onKeyDown: onDropdownKeyDown,
   });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/common/components/menuDropdown/MenuDropdown.tsx` at line 100, The
onKeyDown handler is being wrapped in a new arrow function which defeats the
memoized onDropdownKeyDown callback; change the prop assignment to pass the
memoized function directly (i.e., replace onKeyDown: (event) =>
onDropdownKeyDown(event) with onKeyDown: onDropdownKeyDown) so
useDropdownKeyboardNavigation and any dependency checks see a stable reference
to onDropdownKeyDown.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/fix-hds-core-cookie-consent.js`:
- Around line 17-29: Change the script to treat missing hds-core cookie-consent
assets as an error instead of a successful no-op: when targetDir (the
cookie-consent directory) or cssFile (cookieConsent.css) do not exist, log a
clear error via console.error and terminate the process with a non-zero exit
(e.g., process.exit(1) or throw an Error) so the postinstall fails; update the
checks around targetDir and cssFile in fix-hds-core-cookie-consent.js to use
console.error + process.exit(1) (or throw) rather than console.warn +
process.exit(0) and include a message that indicates which asset is missing.

---

Nitpick comments:
In `@src/common/components/menuDropdown/MenuDropdown.tsx`:
- Line 100: The onKeyDown handler is being wrapped in a new arrow function which
defeats the memoized onDropdownKeyDown callback; change the prop assignment to
pass the memoized function directly (i.e., replace onKeyDown: (event) =>
onDropdownKeyDown(event) with onKeyDown: onDropdownKeyDown) so
useDropdownKeyboardNavigation and any dependency checks see a stable reference
to onDropdownKeyDown.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 35bbe384-087a-4e20-b6fa-db0793fa6f3f

📥 Commits

Reviewing files that changed from the base of the PR and between 2c14061 and b8eaa2a.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • src/domain/attendanceList/searchRow/__tests__/__snapshots__/SearchRow.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (21)
  • package.json
  • scripts/fix-hds-core-cookie-consent.js
  • src/__tests__/Pages.test.tsx
  • src/common/components/formFields/SingleSelectField.tsx
  • src/common/components/menuDropdown/MenuDropdown.tsx
  • src/common/components/serverErrorSummary/ServerErrorSummary.tsx
  • src/common/components/singleSelect/SingleSelect.tsx
  • src/domain/event/query.ts
  • src/domain/order/query.ts
  • src/domain/payment/query.ts
  • src/domain/registration/__tests__/query.test.ts
  • src/domain/registration/query.ts
  • src/domain/signup/__tests__/query.test.ts
  • src/domain/signup/modals/confirmDeleteSignupModal/ConfirmDeleteSignupModal.tsx
  • src/domain/signup/query.ts
  • src/domain/signupGroup/__tests__/query.test.ts
  • src/domain/signupGroup/query.ts
  • src/domain/singups/query.ts
  • src/domain/user/query.ts
  • src/pages/_app.tsx
  • src/utils/getEnvValue.ts
✅ Files skipped from review due to trivial changes (7)
  • src/domain/user/query.ts
  • src/pages/_app.tsx
  • src/domain/signupGroup/tests/query.test.ts
  • src/utils/getEnvValue.ts
  • src/domain/registration/query.ts
  • src/domain/signup/modals/confirmDeleteSignupModal/ConfirmDeleteSignupModal.tsx
  • src/common/components/formFields/SingleSelectField.tsx
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/domain/signup/tests/query.test.ts
  • src/common/components/serverErrorSummary/ServerErrorSummary.tsx
  • src/domain/registration/tests/query.test.ts
  • src/tests/Pages.test.tsx
  • src/common/components/singleSelect/SingleSelect.tsx
  • package.json

Comment thread scripts/fix-hds-core-cookie-consent.js
@jorilindell jorilindell force-pushed the LINK-2463-react-19-and-hds-6 branch from b8eaa2a to 438984b Compare June 10, 2026 23:19
Comment thread src/common/components/menuDropdown/MenuDropdown.tsx Outdated
@azure-pipelines

Copy link
Copy Markdown

LINKEDREGISTRATIONS-UI branch is deployed to platta: https://linkedregistrations-pr299-ui.dev.hel.ninja 🚀🚀🚀

@azure-pipelines

Copy link
Copy Markdown

e2e tests result is success for https://linkedregistrations-pr299-ui.dev.hel.ninja 😆🎉🎉🎉

- upgrade react and react-dom to v19
- upgrade @types/react to v19
- refine MenuDropdown listener/effect handling
for React 19-safe behavior

Refs: LINK-2463
- bump hds-core, hds-design-tokens, and hds-react to v6
- replace ErrorSummary with Notification in server error summary UI
- migrate SingleSelect and SingleSelectField typing
to ComponentProps<typeof Select>
- update SearchRow snapshot for HDS v6 class and id output

Refs: LINK-2463
HDS 6.0.2 ships cookieConsent.ts but not cookieConsent.js
at the path required by hds-react, causing build failures.
Add fix-hds-shim script that creates a compatible shim
from cookieConsent.css.
The shim uses an ES module-shaped export and avoids
Node built-ins so webpack/browser bundling works.

Refs: LINK-2463
- upgrade @testing-library/react from 14.2.1 to 16.3.2
- upgrade @testing-library/user-event from 14.5.2 to 14.6.1
- update lockfile after testing dependency refresh

Refs: LINK-2463
- bump @tanstack/react-query to ^5.101.0
- bump react-scroll to ^1.9.3
- bump eslint-plugin-react-hooks to ^7.1.1

Refs: LINK-2463
@jorilindell jorilindell force-pushed the LINK-2463-react-19-and-hds-6 branch from 438984b to 0486a9f Compare June 10, 2026 23:51
@sonarqubecloud

Copy link
Copy Markdown

@azure-pipelines

Copy link
Copy Markdown

LINKEDREGISTRATIONS-UI branch is deployed to platta: https://linkedregistrations-pr299-ui.dev.hel.ninja 🚀🚀🚀

@azure-pipelines

Copy link
Copy Markdown

e2e tests result is success for https://linkedregistrations-pr299-ui.dev.hel.ninja 😆🎉🎉🎉

@jorilindell jorilindell merged commit 8681201 into main Jun 11, 2026
28 checks passed
@jorilindell jorilindell deleted the LINK-2463-react-19-and-hds-6 branch June 11, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants