-
Notifications
You must be signed in to change notification settings - Fork 48
Bundling with React 19 + React compiler & dependency upgrades #1735
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
base: dev
Are you sure you want to change the base?
Conversation
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.
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>); |
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.
can this be removed?
| const t4 = useTriggerPosition(r4); | ||
| const t5 = useTriggerPosition(r5); | ||
| const t6 = useTriggerPosition(r6); | ||
| // FIXME: remove as cast |
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.
can be fixed now?
|
@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. |
| active={audioAutoPlay} | ||
| onClick={async () => { | ||
| dispatch(toggleAudioAutoplay()); | ||
| await window.setSettingValue(SettingsKey.audioAutoplay, !audioAutoPlay); |
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.
should we (almost) always use setSettingValue instead of Storage.put?
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.
maybe, ive cleaned this up a lot in my settings pr, making more unified setting setters
Upgrades:
Building:
Dependency tweaks: