Skip to content

ECHOES-1269 Backport#663

Merged
jeremy-davis-sonarsource merged 2 commits intobranch-2.0from
jay/backport-2.0.2
Mar 25, 2026
Merged

ECHOES-1269 Backport#663
jeremy-davis-sonarsource merged 2 commits intobranch-2.0from
jay/backport-2.0.2

Conversation

@jeremy-davis-sonarsource
Copy link
Copy Markdown
Contributor

No description provided.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 25, 2026

Deploy Preview for echoes-react ready!

Name Link
🔨 Latest commit 0cb2bf5
🔍 Latest deploy log https://app.netlify.com/projects/echoes-react/deploys/69c3a98fdbbbe600081fe22d
😎 Deploy Preview https://deploy-preview-663--echoes-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hashicorp-vault-sonar-prod
Copy link
Copy Markdown

hashicorp-vault-sonar-prod bot commented Mar 25, 2026

ECHOES-1269

@sonar-review-alpha
Copy link
Copy Markdown

Summary

Backport fix for React 19 compose-refs bug to 2.0.2

This backports ECHOES-1269 from main to branch-2.0. The fix prevents repeated ref callback updates in the composeRefs utility from @radix-ui when used with React 19. The problem: composeRefs was invoking all ref setters on every call, even when the node parameter hadn't changed, causing repeated callbacks and potential performance issues with React 19's new ref behavior.

The solution adds memoization — tracking the previous node and only updating refs if the node actually changes. Package version bumped to 2.0.2.

What reviewers should know

Where to focus: The core fix is in .yarn/patches/@radix-ui-react-compose-refs-npm-1.1.2-f0371f8267.patch — the key addition is tracking previousNode outside the returned function and short-circuiting if the node hasn't changed.

What to validate: Check that the patch is correctly applied to both the patch file and dist/index.mjs (they should be identical diffs). Verify this won't cause issues with ref identity changes or cleanup in existing code.

Non-obvious: This is a workaround/patch for upstream @radix-ui behavior, not a fix to echoes-react itself. The underlying issue is React 19's ref behavior change.


  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

@jeremy-davis-sonarsource jeremy-davis-sonarsource enabled auto-merge (rebase) March 25, 2026 09:26
@sonarqube-next
Copy link
Copy Markdown

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
0 Dependency risks
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! 🙏

@jeremy-davis-sonarsource jeremy-davis-sonarsource merged commit a99c832 into branch-2.0 Mar 25, 2026
12 checks passed
@jeremy-davis-sonarsource jeremy-davis-sonarsource deleted the jay/backport-2.0.2 branch March 25, 2026 09:29
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