reown-com / appkit

The full stack toolkit to build onchain app UX
https://reown.com/appkit
Apache License 2.0
4.95k stars 1.41k forks source link

refactor: add subscribe account and network methods for plain js use case #3173

Closed enesozturk closed 3 weeks ago

enesozturk commented 3 weeks ago

Description

For plain JS users we are not providing expected listeners as we do with the hooks (useAppKitAccount and useAppKitNetwork). This PR introduces changes to AppKit client to have the same listener for plain JS users to subscribe account and network state.

*The testing of these will be handled in another PR specific to CDN updates

Type of change

Associated Issues

For Linear issues: Closes APKT-xxx 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

vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ā†—ļøŽ

Name Status Preview Comments Updated (UTC)
appkit-laboratory āœ… Ready (Inspect) Visit Preview šŸ’¬ Add feedback Oct 31, 2024 9:49am
appkit-wagmi-cdn-example āœ… Ready (Inspect) Visit Preview šŸ’¬ Add feedback Oct 31, 2024 9:49am
vue-wagmi-example āŒ Failed (Inspect) Oct 31, 2024 9:49am
web3modal-gallery āœ… Ready (Inspect) Visit Preview šŸ’¬ Add feedback Oct 31, 2024 9:49am
changeset-bot[bot] commented 3 weeks ago

šŸ¦‹ Changeset detected

Latest commit: 8b0ef1ffc7ae2c6abb925608439e222b0e1c4336

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

This PR includes changesets to release 20 packages | Name | Type | | ------------------------------ | ----- | | @reown/appkit | Patch | | @apps/demo | Patch | | @apps/gallery | Patch | | @apps/laboratory | Patch | | @reown/appkit-adapter-ethers | Patch | | @reown/appkit-adapter-ethers5 | Patch | | @reown/appkit-adapter-polkadot | Patch | | @reown/appkit-adapter-solana | Patch | | @reown/appkit-adapter-wagmi | Patch | | @reown/appkit-utils | Patch | | @reown/appkit-cdn | Patch | | @reown/appkit-common | Patch | | @reown/appkit-core | 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 |

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

github-actions[bot] commented 3 weeks ago

Coverage Report for Coverage

Status Category Percentage Covered / Total
šŸ”µ Lines 345.47% 4442 / 18505
šŸ”µ Statements 345.47% 4442 / 18505
šŸ”µ Functions 370.3% 367 / 1080
šŸ”µ Branches 466.63000000000005% 673 / 1374
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/appkit/src/client.ts 75.82% 75.78% 84.14% 75.82% 92-93, 112-113, 116-117, 120-121, 124-127, 130-133, 136-137, 166-173, 175-177, 180-187, 282, 290, 328-331, 337, 339-341, 343-344, 347, 442, 444-446, 449-450, 452-454, 469, 471-472, 479-480, 490-491, 506-507, 510-511, 514-515, 518-519, 528-530, 536-543, 560-563, 598, 607-619
packages/core/src/utils/TypeUtil.ts 100% 100% 100% 100%
Generated in workflow #7065 for commit 8b0ef1f by the Vitest Coverage Report Action
enesozturk commented 3 weeks ago

@magiziz Just made changes for type definitions, could you check again please?