Skip to content

feat: upgrade to react 19 and add document metadata support#1993

Open
zmjohnso wants to merge 2 commits intogetAlby:masterfrom
zmjohnso:react-19-upgrade
Open

feat: upgrade to react 19 and add document metadata support#1993
zmjohnso wants to merge 2 commits intogetAlby:masterfrom
zmjohnso:react-19-upgrade

Conversation

@zmjohnso
Copy link

@zmjohnso zmjohnso commented Dec 21, 2025

This PR updates to React 19. See #1851

It also tests utilizes React 19's support for document metadata tags to add titles to top level routes, as suggested in #1851. This addresses #1837.

Tab title:
image
History:
image

These titles are mostly examples. Might want to update to something that makes more sense; I also might have missed pages. But if it is okay to go ahead with the React 19 upgrade, this should be easy to update in the future.

Additionally, if this looks good, I will work on additional follow-up PRs to take advantage of other React 19 features, such as form actions and useTransition, as mentioned in #1851. But this would be a substantially larger refactor.

Summary by CodeRabbit

  • New Features

    • Added dynamic page titles that display in the browser tab for improved navigation clarity across all major screens and settings pages.
  • Chores

    • Upgraded React and React DOM dependencies to version 19.0.0.
    • Updated development instructions for HTTP mode.

@rolznz rolznz added this to the v1.22.0 milestone Dec 23, 2025
@rolznz
Copy link
Contributor

rolznz commented Jan 7, 2026

@zmjohnso thanks for the PR, and thanks for keeping it simple. The other React 19 features and refactoring are not a priority for us right now, but thanks for the offering to work on it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 18, 2026

📝 Walkthrough

Walkthrough

This pull request upgrades React and React DOM to version 19 with corresponding type definitions, updates documentation, and implements page title functionality across the frontend by adding a new optional pageTitle prop to header components and direct title elements to various screen components.

Changes

Cohort / File(s) Summary
React Ecosystem Upgrade
README.md, frontend/package.json
Bumped React and React DOM from 18.x to 19.x, along with corresponding type declarations (@types/react and @types/react-dom). Updated development documentation to reference yarn dev:http command.
Page Title Component Infrastructure
frontend/src/components/AppHeader.tsx, frontend/src/components/SettingsHeader.tsx
Added optional pageTitle?: string prop to both header components. When provided, renders a <title> element composed as "${pageTitle} - Alby Hub" at the top of the component fragment.
AppHeader Page Title Integration
frontend/src/screens/Home.tsx, frontend/src/screens/CreateNodeMigrationFileSuccess.tsx, frontend/src/screens/alby/AlbyEarn.tsx, frontend/src/screens/alby/SupportAlby.tsx, frontend/src/screens/apps/Connections.tsx, frontend/src/screens/channels/Channels.tsx, frontend/src/screens/peers/Peers.tsx, frontend/src/screens/subwallets/SubwalletIntro.tsx, frontend/src/screens/subwallets/SubwalletList.tsx, frontend/src/screens/wallet/index.tsx
Passes pageTitle prop to AppHeader component with screen-specific titles (e.g., "Home", "Earn", "Connections", "Wallet").
SettingsHeader Page Title Integration
frontend/src/screens/settings/Settings.tsx
Passes pageTitle="Settings" prop to SettingsHeader component.
Direct Title Element Integration
frontend/src/screens/Intro.tsx, frontend/src/screens/NotFound.tsx, frontend/src/screens/setup/SetupPassword.tsx
Adds <title> element as the first child in component return, composing page-specific titles (e.g., "Welcome - Alby Hub", "Login - Alby Hub", "Create Password - Alby Hub").
Screen Refactoring with Title Elements
frontend/src/screens/ConnectAlbyAccount.tsx, frontend/src/screens/Start.tsx, frontend/src/screens/Unlock.tsx, frontend/src/screens/Welcome.tsx
Wraps component return in a fragment and adds <title> element. Some components contain duplicate title elements in the rendered output. Restructures DOM hierarchy and adjusts element nesting.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 React's been upgraded, version nineteen!
Page titles now shine, the brightest we've seen,
With props flowing through, from screen to screen,
The Alby Hub's branding stays strong and serene.

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: upgrading React to version 19 and adding document metadata support for page titles across multiple screens.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
frontend/src/screens/ConnectAlbyAccount.tsx (1)

136-142: Consider extracting AlbyProIcon outside the component.

Defining a component function inside another component causes it to be recreated on every render, preventing React from optimizing reconciliation. Since AlbyProIcon has no dependencies on the parent's scope, it can be moved outside.

♻️ Proposed refactor
+function AlbyProIcon() {
+  return (
+    <div className="absolute right-2 top-2" title="Pro">
+      <SparklesIcon className="size-4" />
+    </div>
+  );
+}
+
 export function ConnectAlbyAccount({ connectUrl }: ConnectAlbyAccountProps) {
   return (
     <>
       ...
     </>
   );
-
-  function AlbyProIcon() {
-    return (
-      <div className="absolute right-2 top-2" title="Pro">
-        <SparklesIcon className="size-4" />
-      </div>
-    );
-  }
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/screens/ConnectAlbyAccount.tsx` around lines 136 - 142,
AlbyProIcon is defined inside the parent component which causes it to be
re-created on every render; move the function AlbyProIcon out of the parent
ConnectAlbyAccount component (or file scope) as a top-level pure component, keep
its JSX unchanged (the div with className "absolute right-2 top-2" and
SparklesIcon), and update the parent to reference the top-level AlbyProIcon so
React can reuse the component between renders.
frontend/src/screens/Intro.tsx (1)

65-67: Consider a more specific title for the carousel route.

Line 66 is pretty generic for the intro flow. A label like Getting Started or Intro would make tabs/history easier to scan next to the later onboarding screens.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/screens/Intro.tsx` around lines 65 - 67, Update the page title
used in the Intro component to be specific to the carousel/onboarding flow:
replace the generic <title>Welcome - Alby Hub</title> with a more descriptive
label such as <title>Getting Started - Alby Hub</title> (or "Intro - Alby Hub")
so browser tabs and history entries referencing this component (Intro.tsx) and
the Carousel element (Carousel, setApi) are easier to scan during onboarding.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@frontend/package.json`:
- Line 56: Remove the unmaintained "react-lottie" dependency from package.json
and add "lottie-react"@2.4.1 instead; then update the Lottie component import in
frontend/src/components/LottieLoading.tsx to use the lottie-react API (replace
any imports referencing "react-lottie" and its <Lottie> usage with the
corresponding export from "lottie-react"), adapt prop names and event/callback
usage to lottie-react's API, run install and exercise the animations to confirm
behavior.

In `@frontend/src/screens/subwallets/SubwalletList.tsx`:
- Around line 81-84: The route title is set after the component's data-dependent
early return so the tab can show the old title while Sub-wallets loads; move the
AppHeader (the JSX using <AppHeader title="Sub-wallets" pageTitle="Sub-wallets"
...>) above the loading guard in the SubwalletList component so the title is
rendered immediately (i.e., hoist the AppHeader render before the
early-return/loading check used to short-circuit rendering).

---

Nitpick comments:
In `@frontend/src/screens/ConnectAlbyAccount.tsx`:
- Around line 136-142: AlbyProIcon is defined inside the parent component which
causes it to be re-created on every render; move the function AlbyProIcon out of
the parent ConnectAlbyAccount component (or file scope) as a top-level pure
component, keep its JSX unchanged (the div with className "absolute right-2
top-2" and SparklesIcon), and update the parent to reference the top-level
AlbyProIcon so React can reuse the component between renders.

In `@frontend/src/screens/Intro.tsx`:
- Around line 65-67: Update the page title used in the Intro component to be
specific to the carousel/onboarding flow: replace the generic <title>Welcome -
Alby Hub</title> with a more descriptive label such as <title>Getting Started -
Alby Hub</title> (or "Intro - Alby Hub") so browser tabs and history entries
referencing this component (Intro.tsx) and the Carousel element (Carousel,
setApi) are easier to scan during onboarding.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9d735ce6-2bf4-4edf-bd3d-0fe145b38b74

📥 Commits

Reviewing files that changed from the base of the PR and between 956c841 and 0fb6c91.

⛔ Files ignored due to path filters (1)
  • frontend/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (22)
  • README.md
  • frontend/package.json
  • frontend/src/components/AppHeader.tsx
  • frontend/src/components/SettingsHeader.tsx
  • frontend/src/screens/ConnectAlbyAccount.tsx
  • frontend/src/screens/CreateNodeMigrationFileSuccess.tsx
  • frontend/src/screens/Home.tsx
  • frontend/src/screens/Intro.tsx
  • frontend/src/screens/NotFound.tsx
  • frontend/src/screens/Start.tsx
  • frontend/src/screens/Unlock.tsx
  • frontend/src/screens/Welcome.tsx
  • frontend/src/screens/alby/AlbyEarn.tsx
  • frontend/src/screens/alby/SupportAlby.tsx
  • frontend/src/screens/apps/Connections.tsx
  • frontend/src/screens/channels/Channels.tsx
  • frontend/src/screens/peers/Peers.tsx
  • frontend/src/screens/settings/Settings.tsx
  • frontend/src/screens/setup/SetupPassword.tsx
  • frontend/src/screens/subwallets/SubwalletIntro.tsx
  • frontend/src/screens/subwallets/SubwalletList.tsx
  • frontend/src/screens/wallet/index.tsx

"react-day-picker": "^9.11.0",
"react-dom": "18.3.1",
"react-dom": "^19.0.0",
"react-lottie": "^1.2.4",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check react-lottie usage and look for potential alternatives

# Find all usages of react-lottie in the codebase
echo "=== react-lottie usage in codebase ==="
rg -n "react-lottie|from ['\"]react-lottie['\"]" --type ts --type tsx || rg -n "react-lottie" -g "*.tsx" -g "*.ts"

# Check the react-lottie package for deprecated lifecycle methods
echo -e "\n=== Checking react-lottie source for deprecated APIs ==="
if [ -d "frontend/node_modules/react-lottie" ]; then
  rg -n "componentWillMount|componentWillReceiveProps|componentWillUpdate|findDOMNode" frontend/node_modules/react-lottie/
fi

Repository: getAlby/hub

Length of output: 275


🌐 Web query:

Is react-lottie compatible with React 19?

💡 Result:

No, react-lottie (the package from chenqingspring/react-lottie, npm react-lottie v1.2.10) is not compatible with React 19. Its peer dependency is react >=15.0.0 with dev deps on react ^15.6.2, and the repo shows no updates for React 19 support. Open issues like autoplay bugs remain unresolved since 2018. It may install with overrides but lacks official support and testing.

Citations:


🏁 Script executed:

# Check React version in frontend/package.json
head -60 frontend/package.json | tail -20

Repository: getAlby/hub

Length of output: 681


🌐 Web query:

Is lottie-react actively maintained and compatible with React 19?

💡 Result:

Yes, lottie-react (the most popular package from Gamote/lottie-react on npm with 1.7M weekly downloads) is actively maintained and compatible with React 19. It had recent commits as late as 2026-03-03, latest release v2.4.1 on 2025-01-22. Peer dependencies explicitly include React ^19.0.0 (updated via merged PR #121). Users report successful installation with React 19 after v2.4.1, though some SSR issues in Next.js can be fixed with dynamic imports (issue #122 remains open for ongoing reports but core compatibility resolved).

Citations:


Remove react-lottie — it is incompatible with React 19 and no longer maintained.

The project uses React 19.0.0, but react-lottie (^1.2.4) has no support for React 19 and hasn't been updated since 2018. Using it with React 19 will likely cause runtime errors or unexpected behavior.

Replace it with lottie-react (v2.4.1), which is actively maintained, explicitly supports React 19, and has significantly higher adoption (1.7M weekly downloads). Update the import in frontend/src/components/LottieLoading.tsx and test animations thoroughly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/package.json` at line 56, Remove the unmaintained "react-lottie"
dependency from package.json and add "lottie-react"@2.4.1 instead; then update
the Lottie component import in frontend/src/components/LottieLoading.tsx to use
the lottie-react API (replace any imports referencing "react-lottie" and its
<Lottie> usage with the corresponding export from "lottie-react"), adapt prop
names and event/callback usage to lottie-react's API, run install and exercise
the animations to confirm behavior.

Comment on lines 81 to 84
<AppHeader
title="Sub-wallets"
pageTitle="Sub-wallets"
description="Create sub-wallets for yourself, friends, family or coworkers"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Set the route title before the loading branch.

Line 83 only takes effect after the data-dependent early return above is bypassed, so the tab can keep the previous page title while Sub-wallets is loading. Hoist the route title above the loading guard so navigation updates immediately.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/screens/subwallets/SubwalletList.tsx` around lines 81 - 84, The
route title is set after the component's data-dependent early return so the tab
can show the old title while Sub-wallets loads; move the AppHeader (the JSX
using <AppHeader title="Sub-wallets" pageTitle="Sub-wallets" ...>) above the
loading guard in the SubwalletList component so the title is rendered
immediately (i.e., hoist the AppHeader render before the early-return/loading
check used to short-circuit rendering).

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.

3 participants