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

Merged
merged 4 commits into from
Jan 20, 2025

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: 8da7395

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 20, 2025 3:02pm
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 20, 2025 3:02pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-vue-solana ⬜️ Ignored (Inspect) Jan 20, 2025 3:02pm
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) Jan 20, 2025 3:02pm
vue-wagmi-example ⬜️ Ignored (Inspect) Jan 20, 2025 3:02pm

Copy link
Contributor

github-actions bot commented Jan 15, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 68.56% 19500 / 28441
🔵 Statements 68.56% 19500 / 28441
🔵 Functions 59.14% 1698 / 2871
🔵 Branches 79.79% 3436 / 4306
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.84% 61.95% 73.52% 74.84% 124-150, 175, 236-240, 246-249, 280, 282, 311-312, 363-366, 371-372, 382-383, 422-423, 459, 464-479, 483-503, 513-514, 518-519, 536-547, 586, 590-591, 612-613, 621-622, 627-628, 632-637, 644-645, 653-654, 659-660, 669-670, 678-679, 684-685, 691-698
packages/appkit/src/client.ts 61.58% 84.03% 77.17% 61.58% 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, 1340-1341, 1346, 1352-1370, 1376-1383, 1394-1402, 1407-1416, 1419-1429, 1432-1512, 1515-1535, 1554, 1561, 1578, 1591, 1628, 1651-1658, 1660-1671, 1674-1682, 1711-1727, 1742-1746, 1777-1781, 1802-1803, 1808-1809, 1811-1812, 1817-1820, 1831-1832, 1871-1875, 1900-1901, 1925-1926, 1955-1956, 1960-1961, 2050, 2052-2054, 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 76.43% 77.14% 41.17% 76.43% 90, 110-130, 156-157, 167, 172, 180, 184, 188, 192, 196, 200, 204, 208, 235-236, 244, 248, 258-259
Generated in workflow #9026 for commit 8da7395 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

@tomiir tomiir merged commit 018c6f1 into main Jan 20, 2025
19 checks passed
@tomiir tomiir deleted the refactor/wc-set-uri-single-setup branch January 20, 2025 15:47
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