Skip to content

Conversation

@Aerilym
Copy link
Collaborator

@Aerilym Aerilym commented Dec 12, 2025

Upgrades:

  • React 19
  • Electron Builder 26
  • Redux 5
  • Zod 4

Building:

  • React compiler
  • Babel (for bundling)
  • Terser (for minification) - Note: this is unstable and only for testing, it wont be included in production builds.

Dependency tweaks:

  • Locked to specific version resolutions of many dependencies
  • Remove redux-persist

Copilot AI review requested due to automatic review settings December 12, 2025 05:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request upgrades Session Desktop to React 19 with React compiler support and updates several major dependencies (Electron Builder 26, Redux 5, Zod 4). The changes include Babel for bundling and Terser for minification, along with refactoring of test utilities, selectors, and type definitions to align with the new library versions.

Key Changes

  • Upgraded React 18→19, Redux 4→5, Zod 3→4, Electron Builder to v26
  • Integrated React compiler and updated build toolchain (Babel, Terser)
  • Migrated test utilities from react-test-renderer to @testing-library/react
  • Refactored selectors to be hook-independent for React compiler compatibility
  • Fixed type definitions for better type safety with React 19

Reviewed changes

Copilot reviewed 166 out of 167 changed files in this pull request and generated no comments.

Show a summary per file
File Description
yarn.lock Major dependency upgrades including React 19, Redux 5, Zod 4, Electron Builder 26, Babel, and Terser
ts/util/urlHistory.ts Updated Zod enum usage from z.nativeEnum to z.enum for Zod 4 compatibility
ts/types/Util.ts Added JSX type import for React 19 compatibility
ts/themes/globals.tsx Improved type safety by splitting duration functions and fixing type coercion
ts/test/components/renderComponent.tsx Migrated from react-test-renderer to @testing-library/react with new testing APIs
ts/test/components/SessionInput_test.tsx Updated test to use new findAllByTagName API
ts/test/components/AvatarPlaceHolder_test.tsx Updated tests to use DOM queries instead of React element tree inspection
ts/state/selectors/userGroups.ts Exported getGroupById for use in other selectors
ts/state/selectors/selectedConversation.ts Refactored hooks to use selector functions for React compiler compatibility
ts/state/selectors/proBackendData.ts Major refactor adding data processing logic and mock feature flag support
ts/state/selectors/onions.ts Exported selectors directly, removing intermediate hook wrappers
ts/state/selectors/messages.ts Removed unnecessary useMemo calls and refactored for React compiler
ts/state/selectors/groups.ts Exported selectLibGroupName for reuse
ts/state/reducer.ts Added RootState type export
ts/state/ducks/types/releasedFeaturesReduxTypes.ts Renamed hooks to *Memo pattern for clarity

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

const { docX, docY } = useMouse(contextMenuRef);
const contextMenuRef = useRef<HTMLDivElement | null>(null);
// FIXME: remove as cast
const { docX, docY } = useMouse(contextMenuRef as RefObject<Element>);
Copy link
Collaborator

Choose a reason for hiding this comment

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

can this be removed?

const t4 = useTriggerPosition(r4);
const t5 = useTriggerPosition(r5);
const t6 = useTriggerPosition(r6);
// FIXME: remove as cast
Copy link
Collaborator

Choose a reason for hiding this comment

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

can be fixed now?

@Aerilym
Copy link
Collaborator Author

Aerilym commented Dec 17, 2025

@Bilb I'm going to leave a note here to do a hooks library migration, as discussed the hooks library we currently used does not support react typing beyond react 17 and the hook library is no longer actively maintained.

Bilb
Bilb previously approved these changes Dec 17, 2025
active={audioAutoPlay}
onClick={async () => {
dispatch(toggleAudioAutoplay());
await window.setSettingValue(SettingsKey.audioAutoplay, !audioAutoPlay);
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we (almost) always use setSettingValue instead of Storage.put?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

maybe, ive cleaned this up a lot in my settings pr, making more unified setting setters

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