Skip to content

fix: upgrade dependencies, enable React Compiler support, and improve Vite 8 compatibility#349

Merged
imxade merged 1 commit into
AOSSIE-Org:mainfrom
Arbaaz123676:feat/compiler-upgrade-v2
May 11, 2026
Merged

fix: upgrade dependencies, enable React Compiler support, and improve Vite 8 compatibility#349
imxade merged 1 commit into
AOSSIE-Org:mainfrom
Arbaaz123676:feat/compiler-upgrade-v2

Conversation

@Arbaaz123676
Copy link
Copy Markdown
Contributor

@Arbaaz123676 Arbaaz123676 commented May 9, 2026

Addressed Issues:

Fixes #327


Description

This PR focuses strictly on upgrading and stabilizing the Vite 8 migration while ensuring existing functionality remains unaffected.

Changes made:

  • Updated project dependencies to newer compatible versions
  • Added React Compiler support using babel-plugin-react-compiler
  • Updated Vite configuration to follow the newer Vite 8 plugin setup
  • Removed invalid/unsafe as any workaround previously used for Babel config
  • Verified compatibility with existing Electron + TanStack Start setup
  • Reviewed existing useCallback usage for React Compiler compatibility
  • Ensured project builds and runs correctly after dependency upgrades
  • Performed npm audit review and dependency cleanup where applicable
  • Ensured changes are scoped only to issue-related files

Verification performed

  • npm run dev
  • npm run build
  • npm run check

The application runs successfully after the migration and configuration updates.


Screenshots/Recordings:

N/A


Functional Verification

Screen Mirror

  • Screen Mirror works.

Authentication

  • Connection doesn't work without a valid token.

Basic Gestures

  • One-finger tap: Verified as Left Click.
  • Two-finger tap: Verified as Right Click.
  • Click and drag: Verified selection behavior.
  • Pinch to zoom: Verified zoom functionality (if applicable).

Modes & Settings

  • Cursor mode: Cursor moves smoothly and accurately.
  • Scroll mode: Page scrolls as expected.
  • Sensitivity: Verified changes in cursor speed/sensitivity settings.
  • Copy and Paste: Verified both Copy and Paste functionality.
  • Invert Scrolling: Verified scroll direction toggles correctly.

Advanced Input

  • Key combinations: Verified "hold" behavior for modifiers and held keys are shown in buffer.
  • Keyboard input: Verified Space, Backspace, and Enter keys work correctly.
  • Glide typing: Verified path drawing and text output.
  • Voice input: Verified speech-to-text functionality for full sentences.
  • Backspace doesn't send the previous input.

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the community and I will share a link to this PR with the project maintainers there
  • I have read the contributing guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • Incase of UI change I've added a demo video.

Summary by CodeRabbit

  • Chores

    • Upgraded React, TanStack, build/dev tooling, and formatting tooling to newer versions.
    • Updated project configuration schema to the latest Biome version.
  • Build/Configuration

    • Changed project base path and added a source path alias to improve module resolution and asset handling.
  • UI

    • Replaced a pair of navigation icons in the trackpad controls (visual-only).
  • Refactor

    • Internal connection and streaming code refactored for reliability and performance.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 9, 2026

Warning

Rate limit exceeded

@Arbaaz123676 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 39 minutes and 15 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1a21feac-631d-458a-8732-f9c4418e5b7c

📥 Commits

Reviewing files that changed from the base of the PR and between d3e54c8 and 41f391f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • biome.json
  • package.json
  • src/components/Trackpad/ExtraKeys.tsx
  • src/contexts/ConnectionProvider.tsx
  • src/hooks/useCaptureProvider.ts
  • src/hooks/useMirrorStream.ts
  • src/server/ydotool.ts
  • vite.config.ts

Walkthrough

Bumps runtime/dev dependencies, updates Biome schema and files.includes, modifies Vite base/alias and dev-server wiring, refactors ConnectionProvider and mirroring/capture hooks to remove useCallback and inline handlers, and applies small import/catch renames.

Changes

Dependency and Configuration Upgrade

Layer / File(s) Summary
Dependency Versions
package.json
TanStack packages, React/React-DOM, Nitro mapping, Biome, Vite, Tailwind, and dev tooling versions updated.
Biome Configuration
biome.json
$schema bumped to 2.4.15; files migrated to files.includes array with negated entries; assist.actions.source.organizeImports set to off.
Vite Configuration
vite.config.ts
base changed to /; added resolve.alias mapping @src; removed vite-tsconfig-paths plugin; enabled viteReact({ reactCompiler: true }); removed custom build outDir/emptyOutDir; added server import wiring.
ConnectionProvider
src/contexts/ConnectionProvider.tsx
Remove useCallback, inline connect, plain subscribe, add direct send helper, and change ping/pong handler registration approach.
Mirror & Capture Hooks
src/hooks/*
useMirrorStream and useCaptureProvider remove useCallback wrappers, move render/handleMessage into effects, preserve decode/draw, capture/start/stop logic and cleanup.
Small Source Edits
src/components/Trackpad/ExtraKeys.tsx, src/server/ydotool.ts
Removed unused react-icons/fa imports; unused catch parameters renamed to _e/_err.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • AOSSIE-Org/Rein#313: Similar icon import changes in src/components/Trackpad/ExtraKeys.tsx.
  • AOSSIE-Org/Rein#212: Related WebSocket mirroring and hook changes touching ConnectionProvider and mirror hooks.
  • AOSSIE-Org/Rein#183: Related edits to ExtraKeys.tsx and Biome organizeImports adjustments.

Suggested labels

Typescript Lang

"I'm a rabbit in the build tree, nibbling deps with care,
Vite hops to eight and Biome's schema's in the air,
Icons pruned and catch names tucked neat,
Hooks inlined, the render loop keeps the beat,
A tiny hop — the repo's lighter, I declare!" 🐇✨

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The PR substantially addresses issue #327 objectives: dependencies upgraded, React Compiler enabled with useCallback removal, Vite 8 config updated, and builds verified. However, comment feedback indicates some dependencies remain outdated and errors were reported on fresh installs. Verify all dependencies are correctly updated and test on a clean environment (remove node_modules and lockfile, then reinstall) to confirm the build succeeds without errors on fresh installation.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main changes: dependency upgrades, React Compiler support, and Vite 8 compatibility improvements.
Description check ✅ Passed The PR description is comprehensive, addressing the linked issue #327, explaining changes made, and including functional verification checks completed by the author.
Out of Scope Changes check ✅ Passed Changes are appropriately scoped to dependency upgrades, Vite 8 migration, React Compiler enablement, and related configuration updates. No unrelated refactoring or feature additions detected.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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
Copy Markdown
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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/contexts/ConnectionProvider.tsx (1)

33-34: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

children is dropped from props but still used, causing a hard failure

Line 34 defines an empty destructuring pattern, but Line 199 renders {children}. This leaves children undefined in scope and breaks compilation.

Proposed fix
-export function ConnectionProvider({
-}: { children: React.ReactNode }) {
+export function ConnectionProvider({
+	children,
+}: { children: React.ReactNode }) {
🤖 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/contexts/ConnectionProvider.tsx` around lines 33 - 34, The
ConnectionProvider function drops the children prop in its parameter
destructuring but still uses {children} when rendering; restore children in the
function signature by destructuring it from props (or accept props and extract
children) so that the children variable is defined for use in ConnectionProvider
(refer to the ConnectionProvider function and the children render usage).
🤖 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 `@biome.json`:
- Around line 12-19: The current "includes" array contains negated globs that
won't match without a catch-all; update the biome.json "includes" entry to
either prepend an empty string ("") before the negated patterns so the negations
take effect (e.g., ensure "" appears before "!src/routeTree.gen.ts" and
"!src/styles.css"), or move those negated entries into a separate "ignores"
array and keep "includes" as the normal positive patterns (referencing the
"includes" key and the specific patterns "!src/routeTree.gen.ts" and
"!src/styles.css").

In `@package.json`:
- Line 62: The devDependency "vite-tsconfig-paths" is unused and should be
removed: delete the "vite-tsconfig-paths" entry from package.json's
devDependencies and run the package manager uninstall command (e.g., `npm
uninstall vite-tsconfig-paths`) to update package-lock.json/node_modules; verify
that vite.config.ts does not reference the plugin and run a test build to
confirm no breakage.
- Around line 22-28: The package `@tanstack/react-router` is pinned to 1.169.1 but
`@tanstack/router-plugin` requires ^1.169.2; update the dependency version for
"@tanstack/react-router" in package.json to ">=1.169.2" (e.g. "^1.169.2") and
then reinstall/update the lockfile (npm install / yarn install / pnpm install)
so the lockfile reflects the bumped version and peer dependency is satisfied.
- Line 37: The lockfile is out of sync: package.json declares "@biomejs/biome":
"^2.4.14" but package-lock.json still pins "^1.9.4", and biome.json is using the
v2 schema; run a fresh install to regenerate the lockfile (npm install) so
package-lock.json reflects `@biomejs/biome` v2.4.14, verify the updated
package-lock.json contains `@biomejs/biome` ^2.4.14 and that biome.json schema
still matches, then commit the updated package-lock.json.

---

Outside diff comments:
In `@src/contexts/ConnectionProvider.tsx`:
- Around line 33-34: The ConnectionProvider function drops the children prop in
its parameter destructuring but still uses {children} when rendering; restore
children in the function signature by destructuring it from props (or accept
props and extract children) so that the children variable is defined for use in
ConnectionProvider (refer to the ConnectionProvider function and the children
render usage).
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 402369d1-e5f1-48a1-a9ad-d15e24fe36f2

📥 Commits

Reviewing files that changed from the base of the PR and between b996759 and 83bac55.

📒 Files selected for processing (4)
  • biome.json
  • package.json
  • src/contexts/ConnectionProvider.tsx
  • vite.config.ts

Comment thread biome.json
Comment thread package.json Outdated
Comment thread package.json
Comment thread package.json
@PinJinx
Copy link
Copy Markdown
Contributor

PinJinx commented May 9, 2026

@Arbaaz123676 I went through the PR and tested it locally. There are still a few outdated dependencies remaining, and I’m also seeing some issues/errors while running npm run dev on a fresh install.
Could you recheck the setup from a clean environment once? I’d suggest removing node_modules and the lockfile, then reinstalling dependencies and testing again to verify everything works correctly.

If you run into any issues while reproducing it, feel free to ask here.

Copy link
Copy Markdown
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

🤖 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 `@package.json`:
- Around line 27-28: The package.json currently pins pre-release packages
"nitro" (^3.0.260429-beta) and "nitro-nightly" (^3.0.1-20260501-164602-aee73f19)
in dependencies; change this by replacing "nitro" with a stable release (or
update the version to a stable semver) and move "nitro-nightly" from
dependencies to devDependencies if it's only needed for development/testing, or
add a brief rationale comment in your repo docs if you intentionally must keep
these bleeding-edge versions; update the package.json entries for "nitro" and
"nitro-nightly" accordingly and run install to verify no regressions.

In `@src/contexts/ConnectionProvider.tsx`:
- Around line 127-129: In ConnectionProvider (the catch around JSON parsing of
incoming WebSocket messages) stop silently swallowing errors: rename the catch
parameter from _e to e, log the error and the raw message payload in development
only (e.g. if (process.env.NODE_ENV === 'development') console.error('WS JSON
parse error', e, rawMessage)), and ensure the production branch remains silent
to avoid leaking sensitive data; update the code path that parses messages so
the debug log provides both the exception and the offending string for easier
debugging.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f7a493ea-4f95-4bee-9d45-3c1638b2a8fb

📥 Commits

Reviewing files that changed from the base of the PR and between 83bac55 and 64f2552.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • package.json
  • src/components/Trackpad/ExtraKeys.tsx
  • src/contexts/ConnectionProvider.tsx
  • src/server/ydotool.ts
💤 Files with no reviewable changes (1)
  • src/components/Trackpad/ExtraKeys.tsx

Comment thread package.json
Comment thread src/contexts/ConnectionProvider.tsx Outdated
Copy link
Copy Markdown
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: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/hooks/useCaptureProvider.ts (1)

118-125: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Unmount cleanup should mirror stopSharing and notify the peer.

When the component unmounts mid-share, this cleanup clears the timer and stops local tracks but never sends stop-mirror to the WebSocket. The peer is left believing the provider is still streaming until it notices the connection drop or its own timeout. Since stopSharing already centralizes this teardown (timer + tracks + WS notification), invoking it (or inlining the WS send) here keeps both paths symmetric.

♻️ Suggested fix
 	useEffect(() => {
 		return () => {
 			if (timerRef.current) clearInterval(timerRef.current)
 			if (streamRef.current) {
 				for (const track of streamRef.current.getTracks()) track.stop()
 			}
+			if (wsRef.current?.readyState === WebSocket.OPEN) {
+				wsRef.current.send(JSON.stringify({ type: "stop-mirror" }))
+			}
 		}
 	}, [])

Note: calling stopSharing() directly here would also work but introduces a render-scope dependency; the inline version is safer in a cleanup.

🤖 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/hooks/useCaptureProvider.ts` around lines 118 - 125, The cleanup in the
useEffect currently clears timerRef and stops streamRef tracks but omits the
WebSocket notification and shared state teardown performed by stopSharing;
update the cleanup to mirror stopSharing by also sending the "stop-mirror"
message over the WebSocket (using wsRef.current if present), clearing the
interval (timerRef.current), stopping all tracks on streamRef.current, and
resetting any sharing state (e.g., isSharing) as stopSharing does — inline these
steps in the cleanup rather than calling stopSharing to avoid adding
render-scope dependencies; reference useEffect cleanup, timerRef, streamRef,
wsRef (or the WebSocket variable), and stopSharing to locate the logic.
🤖 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/contexts/ConnectionProvider.tsx`:
- Around line 173-182: The code directly mutates subscribersRef.current.pong and
adds handlePong, which bypasses the existing subscribe API; change to call the
subscribe function (e.g., subscribe('pong', handlePong)) instead of poking
subscribersRef.current.pong, capture the returned unsubscribe function and call
it in the effect cleanup so listeners are unregistered, and apply the same
change for the duplicate block that currently touches
subscribersRef.current.pong (the one around where handlePong/setLatency is used
and the other block at the later occurrence).
- Around line 126-137: The onclose handler schedules setTimeout(connect, delay)
but never stores or clears the timer; add a reconnectTimerRef (e.g.,
useRef<number | null>) and replace setTimeout(...) with
reconnectTimerRef.current = window.setTimeout(connect, delay), clear any
existing timer before scheduling, and clearTimeout(reconnectTimerRef.current)
and set it to null in the component cleanup (and after a successful connect) so
the pending timer is cancelled on unmount; references: socket.onclose,
reconnectCountRef, isMountedRef, connect, and the component cleanup function.
- Around line 38-48: The subscribe and send functions (and the inlined context
value containing wsRef, status, platform, latency, send, subscribe) must be
stabilized to avoid unnecessary consumer re-renders if React Compiler bails;
wrap subscribe and send in useCallback with correct dependency arrays
(referencing subscribersRef, wsRef, etc.) and memoize the context value with
useMemo (including wsRef, status, platform, latency, send, subscribe) inside
ConnectionProvider (and similarly for the other affected blocks), then run the
build and verify React Compiler reports no bailouts for this file to confirm the
change succeeded.

In `@src/hooks/useMirrorStream.ts`:
- Around line 38-41: The effect sends "start-mirror" unconditionally which can
throw if the socket is already CLOSING/CLOSED; change the setup to mirror the
teardown guard by checking ws.readyState === WebSocket.OPEN before calling
ws.send("start-mirror") (and similarly guard the other ws.send call around lines
referencing the second send at 69-73). Locate the useMirrorStream effect where
ws, status, setHasFrame are used and wrap both start-mirror sends with the same
readyState check used for stop-mirror so listeners are only wired when the
socket is actually OPEN.
- Line 90: In useMirrorStream, remove wsRef and canvasRef from the useEffect
dependency array and leave only status (or other real reactive values) because
wsRef and canvasRef are stable RefObjects; update the dependency list in the
effect attached to useMirrorStream so it reads only the necessary reactive
dependencies (e.g., [status]) to avoid unnecessary re-runs while keeping effect
logic in the same function.

---

Outside diff comments:
In `@src/hooks/useCaptureProvider.ts`:
- Around line 118-125: The cleanup in the useEffect currently clears timerRef
and stops streamRef tracks but omits the WebSocket notification and shared state
teardown performed by stopSharing; update the cleanup to mirror stopSharing by
also sending the "stop-mirror" message over the WebSocket (using wsRef.current
if present), clearing the interval (timerRef.current), stopping all tracks on
streamRef.current, and resetting any sharing state (e.g., isSharing) as
stopSharing does — inline these steps in the cleanup rather than calling
stopSharing to avoid adding render-scope dependencies; reference useEffect
cleanup, timerRef, streamRef, wsRef (or the WebSocket variable), and stopSharing
to locate the logic.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: fb98d7b3-0d6a-4f83-a068-344686987453

📥 Commits

Reviewing files that changed from the base of the PR and between 64f2552 and d3e54c8.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • biome.json
  • src/contexts/ConnectionProvider.tsx
  • src/hooks/useCaptureProvider.ts
  • src/hooks/useMirrorStream.ts
  • vite.config.ts

Comment thread src/contexts/ConnectionProvider.tsx
Comment thread src/contexts/ConnectionProvider.tsx
Comment thread src/contexts/ConnectionProvider.tsx
Comment thread src/hooks/useMirrorStream.ts
Comment thread src/hooks/useMirrorStream.ts
Comprehensive update to support React Compiler and Vite 8:
- Integrated React Compiler into the build pipeline via @vitejs/plugin-react.
- Upgraded to Vite 8 and updated related dependencies.
- Refactored ConnectionProvider and hooks (useCaptureProvider, useMirrorStream) to remove manual memoization (useCallback/useMemo), leveraging automatic compiler optimizations.
- Improved ConnectionProvider with robust reconnection timer management to prevent memory leaks and redundant connection attempts.
- Updated Biome configuration for better compatibility and schema synchronization.
@Arbaaz123676 Arbaaz123676 force-pushed the feat/compiler-upgrade-v2 branch from d3e54c8 to 41f391f Compare May 10, 2026 11:17
@imxade imxade merged commit 3a13f9c into AOSSIE-Org:main May 11, 2026
2 of 6 checks passed
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.

Vite 8 and other dependency updates

3 participants