Skip to content
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

refactor: remove onUri callbacks in favor of adding single callback listener #3663

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zoruka
Copy link
Contributor

@zoruka zoruka commented Jan 15, 2025

Description

This PR is removing all onUri callback drilling for all walletConnectConnect methods in favor of a single call when initializing the UniversalProvider.

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-1826
For GH issues: closes #...

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copy link

linear bot commented Jan 15, 2025

Copy link

changeset-bot bot commented Jan 15, 2025

🦋 Changeset detected

Latest commit: a073c4d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@reown/appkit-adapter-bitcoin Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit Patch
@reown/appkit-core Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-utils Patch
@reown/appkit-cdn Patch
@reown/appkit-cli Patch
@reown/appkit-common Patch
@reown/appkit-experimental Patch
@reown/appkit-polyfills Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-ui Patch
@reown/appkit-wallet Patch
@reown/appkit-wallet-button Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jan 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
appkit-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 16, 2025 0:38am
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 16, 2025 0:38am
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-vue-solana ⬜️ Ignored (Inspect) Jan 16, 2025 0:38am
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) Jan 16, 2025 0:38am
vue-wagmi-example ⬜️ Ignored (Inspect) Jan 16, 2025 0:38am

Copy link
Contributor

github-actions bot commented Jan 15, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 67.59% 19205 / 28411
🔵 Statements 67.59% 19205 / 28411
🔵 Functions 58.31% 1672 / 2867
🔵 Branches 79.42% 3327 / 4189
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/adapters/solana/src/client.ts 50.75% 75% 34.48% 50.75% 50-57, 62-69, 73-74, 102-105, 108-111, 114-115, 118-119, 122-123, 126-134, 141-142, 152-172, 175-208, 211-212, 215-216, 224-225, 263-264, 286-288, 291-295, 301, 316-322, 325-332, 347-348, 354-358, 361-367
packages/adapters/solana/src/providers/SolanaWalletConnectProvider.ts 81.36% 86.79% 78.94% 81.36% 70-77, 155-165, 179-180, 204-205, 210-211, 214-223, 247, 279-286, 290-297
packages/adapters/wagmi/src/client.ts 74.44% 59.09% 73.52% 74.44% 124-150, 175, 236-240, 246-249, 280, 282, 311-312, 363-366, 371-372, 382-383, 422-423, 434, 454, 459-474, 478-498, 508-509, 513-514, 531-542, 581, 585-586, 607-608, 616-617, 622-623, 627-632, 639-640, 648-649, 654-655, 664-665, 673-674, 679-680, 686-693
packages/appkit/src/client.ts 61.52% 83.98% 77.17% 61.52% 172-173, 202-203, 218-219, 222-223, 238-241, 244-247, 267-268, 271-272, 288-305, 308-317, 588-589, 592-595, 598-599, 602-603, 606-607, 610-611, 618-622, 685-688, 715-716, 730-731, 740-741, 744-745, 750-751, 768-769, 790-806, 833-844, 847-884, 887-892, 908-912, 925-936, 939-958, 961-967, 970-980, 983-995, 998-1000, 1003-1005, 1008-1010, 1013-1015, 1018-1025, 1030-1088, 1092-1111, 1119-1133, 1136-1143, 1146-1160, 1163-1169, 1174, 1178, 1192, 1205-1206, 1214, 1217-1220, 1223-1229, 1239-1240, 1269-1285, 1298-1301, 1305, 1321-1331, 1346, 1352-1370, 1376-1383, 1394-1402, 1407-1416, 1419-1429, 1432-1512, 1515-1535, 1554, 1561, 1578, 1591-1592, 1627, 1650-1657, 1659-1670, 1673-1681, 1710-1726, 1729, 1741-1745, 1776-1780, 1785, 1787-1788, 1801-1802, 1807-1808, 1810-1811, 1816-1819, 1870-1874, 1899-1900, 1924-1925, 1954-1955, 1959-1960, 2049, 2051-2053, 299-804
packages/appkit/src/adapters/ChainAdapterBlueprint.ts 80.67% 93.54% 68.75% 80.67% 105-114, 136-137, 160-164, 170-173, 228-229
packages/appkit/src/connectors/WalletConnectConnector.ts 100% 100% 100% 100%
packages/appkit/src/universal-adapter/client.ts 34.86% 90% 16.66% 34.86% 12-19, 22-31, 64-65, 68-73, 76-109, 118-121, 124-128, 131-134, 137-140, 143-146, 149-150, 153-154, 157-158, 161-162, 165-166, 169-176, 186-23, 77-92
packages/core/src/controllers/ConnectionController.ts 74.07% 78.78% 41.17% 74.07% 90, 110-135, 161-162, 172, 177, 185, 189, 193, 197, 201, 205, 209, 213, 240-241, 249, 253, 263-264, 114
Generated in workflow #8948 for commit a073c4d by the Vitest Coverage Report Action

Comment on lines +1292 to +1295
this.universalProvider.on(
'display_uri',
ConnectionController.setUri.bind(ConnectionController)
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this override other display_uri handlers if subscribed from outside of appkit? in the case they provide the UP externally they can self-manage

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think if this would override an external callback, any other of the setters on display_uri we had would do the same. Do you think previously of this change this would not happen? I'm not sure about this one

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