Skip to content

feat(root): upgrade to React 18, migrate @reach → @react-aria + native ARIA#276

Draft
Copilot wants to merge 8 commits intomainfrom
copilot/upgrade-react-18-packages
Draft

feat(root): upgrade to React 18, migrate @reach → @react-aria + native ARIA#276
Copilot wants to merge 8 commits intomainfrom
copilot/upgrade-react-18-packages

Conversation

Copy link

Copilot AI commented Feb 27, 2026

💡 Hvorfor?

React 17 er EOL. @reach/dialog og @reach/tabs er deprecated og inkompatible med React 18. Oppgraderingen muliggjør bruk av concurrent features og holder oss på vedlikeholdte avhengigheter.

🔧 Hvordan?

React 18 upgrade:

  • react/react-dom 17.0.2 → 18.3.1, @types/react 17 → 18
  • tsconfig.base.json: jsx: "react""react-jsx"
  • @testing-library/react 10.x → 16.x, lagt til @testing-library/dom 10.x
  • Alle 21 pakkers peerDependencies: >=16.8.0>=18.0.0

@reach/dialog → @react-aria/dialog + @react-aria/overlays (modal):

  • useModalOverlay for overlay (Escape, click-outside, scroll lock)
  • useDialog for ARIA dialog-attributter
  • FocusScope for focus trapping
  • OverlayContainer for portal

@reach/tabs → Native ARIA (tab):

  • Egen implementasjon med TabsContext, role="tablist"/"tab"/"tabpanel", aria-selected, aria-controls/aria-labelledby
  • Tastaturnavigasjon: ArrowLeft/Right, Home, End

@react-aria/tabs ble vurdert og avvist — Collections API (Item-komponenter) er inkompatibel med eksisterende consumer API (indeks-basert <Tab>/<TabPanel>).

Testfikser:

  • Dropdown typeahead-tester: fjernet assertion på intermediate loading-state (upålitelig med React 18 automatic batching)

Provider-valg

Kriterium @radix-ui (avvist) @react-aria (valgt for modal) Native ARIA (valgt for tabs)
Allerede i prosjektet? ❌ Ny provider ✅ Brukt av datepicker ✅ Ingen avhengighet
Pakker lagt til 21 3 (delt infrastruktur) 0

Etter migrering: 3 UI-providers@react-aria (datepicker, modal), @floating-ui (tooltip, dropdown, menu), downshift (dropdown).

@reach-audit

Pakke Status
@reach/dialog ✅ Migrert → @react-aria
@reach/tabs ✅ Migrert → native ARIA
@reach/menu ✅ Allerede migrert → @floating-ui
@reach/router ⚪ Gatsby-intern (@gatsbyjs/reach-router)

🧩 Type endring

  • 🐞 Feilretting
  • 🚀 Ny funksjonalitet
  • 💥 Breaking change (krever kodeendringer hos brukere)
  • 📝 Dokumentasjonsoppdatering
  • 🧹 Refaktorering (ingen funksjonelle endringer)
  • ⚡️ Ytelsesforbedring
  • 🏗️ Bygg-/CI-endring

🖼️ Skjermbilder

Ingen visuelle endringer — intern implementasjon byttet, public API bevart.

💬 Tilleggsnotater

  • Gatsby docs-bygg kompilerer OK men feiler på Sanity CMS-fetch (nettverksbegrensning i sandbox)
  • as-prop på Tab/Modal-komponenter er ikke lenger støttet — usannsynlig at noen bruker dette
  • Se REACT-18-MIGRATION.md for komplett migrasjonsguide med provider-analyse

💣 Breaking changes (om aktuelt)

Endring Migrering
react >=18.0.0 kreves som peer dep npm install react@^18 react-dom@^18
ReactDOM.render()createRoot() Se React 18 upgrade guide
@testing-library/react 16.x npm install @testing-library/react@^16 @testing-library/dom@^10
as-prop på Tab/Modal fjernet Bruk composition

Public API for Modal, Drawer, Tabs, TabList, Tab, TabPanel, TabPanels er uendret — props, callbacks og oppførsel er identiske.

✅ Sjekkliste

  • Navnestandarder følges
  • Kode og Figma reflekterer hverandre
  • Dokumentasjonen er oppdatert (hvis aktuelt)
  • Ingen ubrukte imports / varsler / console.logs

🧪 Testing

365 tester, 0 feil. Alle 22 pakker bygger OK.

  • Testet med skjermleser
  • Testet i Safari og Firefox
  • Testet i dokumentasjonsiden

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ofcncog2cu-dsn.algolia.net
    • Triggering command: /opt/hostedtoolcache/node/20.20.0/x64/bin/node node /opt/hostedtoolcache/node/20.20.0/x64/bin/yarn workspace @entur/modal add @react-aria/dialog @react-aria/overlays @react-aria/focus @react-stately/overlays (dns block)
  • unpkg.com
    • Triggering command: /opt/hostedtoolcache/node/20.20.0/x64/bin/node /opt/hostedtoolcache/node/20.20.0/x64/bin/node scripts/postinstall.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits February 27, 2026 14:14
…adix-ui

BREAKING CHANGE: React 18 is now the minimum required version. All packages now require react>=18.0.0 and react-dom>=18.0.0 as peer dependencies. @reach/dialog replaced with @radix-ui/react-dialog, @reach/tabs replaced with @radix-ui/react-tabs.

Co-authored-by: magnusrand <22789935+magnusrand@users.noreply.github.com>
Remove intermediate loading state assertion that is no longer reliable with React 18's automatic batching. Use waitFor with increased timeout for async assertions.

Co-authored-by: magnusrand <22789935+magnusrand@users.noreply.github.com>
Co-authored-by: magnusrand <22789935+magnusrand@users.noreply.github.com>
Co-authored-by: magnusrand <22789935+magnusrand@users.noreply.github.com>
Copilot AI changed the title [WIP] Plan for upgrading packages to React 18 in design system feat(root): upgrade all packages to React 18 Feb 27, 2026
Copilot AI and others added 3 commits February 27, 2026 15:12
…e ARIA

Replace @radix-ui/react-dialog with @react-aria/dialog + @react-aria/overlays
in @entur/modal, leveraging the existing @react-aria provider already used by
@entur/datepicker.

Replace @radix-ui/react-tabs with native ARIA tab implementation in @entur/tab,
eliminating the need for any third-party tab library.

This removes @radix-ui entirely from the dependency tree (21 packages eliminated)
and reduces the number of third-party UI providers from 4 to 3.

Co-authored-by: magnusrand <22789935+magnusrand@users.noreply.github.com>
…audit

Explains why @react-aria was chosen over @radix-ui (existing provider,
fewer new packages), why native ARIA was chosen for tabs (Collections API
incompatibility), and documents the complete @reach package audit.

Co-authored-by: magnusrand <22789935+magnusrand@users.noreply.github.com>
Add comment explaining OverlayTriggerState no-op methods, simplify
Tab onClick handler, add context documentation.

Co-authored-by: magnusrand <22789935+magnusrand@users.noreply.github.com>
Copilot AI changed the title feat(root): upgrade all packages to React 18 feat(root): upgrade to React 18, migrate @reach → @react-aria + native ARIA Feb 27, 2026
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