fungible-systems / micro-stacks

Tiny libraries for building the next generation of Stacks apps.
https://micro-stacks.dev
MIT License
82 stars 15 forks source link

feat: better network behavior #159

Closed aulneau closed 1 year ago

aulneau commented 1 year ago

This PR updates the ways in which apps can allow for in-app network switching. Previously, users would assume that changing the network value in their framework specific micro-stacks client config provider, it would set the app to that network. This would only happen the first time a user loaded the app, because each load afterwards would use the saved session value.

This changes the default behavior, now, if you want to allow your app users to change their network in-app, you need to pass enableNetworkSwitching to the provider for the config.

When enableNetworkSwitching is false or omitted, users cannot toggle the network in-app. Whatever you pass as network in the config will always be true, in SSR and client-side contexts.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗ī¸Ž

Name Status Preview Updated
micro-stacks-docs ✅ Ready (Inspect) Visit Preview Sep 6, 2022 at 2:37PM (UTC)
changeset-bot[bot] commented 1 year ago

đŸĻ‹ Changeset detected

Latest commit: 3afe9907157226864a8117080d2ccc4faf37fb4c

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

This PR includes changesets to release 6 packages | Name | Type | | --------------------- | ----- | | @micro-stacks/client | Minor | | @micro-stacks/jotai | Patch | | @micro-stacks/react | Patch | | @micro-stacks/solidjs | Patch | | @micro-stacks/svelte | Patch | | @micro-stacks/vue | 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 1 year ago

Size Change: -871 B (-1%)

Total Size: 131 kB

Filename Size Change
packages/client/dist/index.js 7.72 kB -248 B (-3%)
packages/client/dist/index.mjs 7.61 kB +79 B (+1%)
packages/core/dist/api.js 3.75 kB -7 B (0%)
packages/core/dist/clarity.js 4.02 kB -62 B (-2%)
packages/core/dist/common.js 5.3 kB -60 B (-1%)
packages/core/dist/connect.js 4.11 kB -83 B (-2%)
packages/core/dist/crypto-aes.js 972 B -4 B (0%)
packages/core/dist/crypto-aes.mjs 925 B -7 B (-1%)
packages/core/dist/crypto-hmac-sha.js 297 B -6 B (-2%)
packages/core/dist/crypto-pbkdf2.js 634 B -2 B (0%)
packages/core/dist/crypto-sha.js 267 B -6 B (-2%)
packages/core/dist/crypto.js 5.44 kB +4 B (0%)
packages/core/dist/network.js 1.13 kB -238 B (-17%) 👏
packages/core/dist/storage.js 6.58 kB -37 B (-1%)
packages/core/dist/transactions.js 11.9 kB -59 B (0%)
packages/core/dist/wallet-sdk.js 3.24 kB -80 B (-2%)
packages/core/dist/zone-file.js 2.18 kB -4 B (0%)
packages/jotai/dist/index.js 1.3 kB -67 B (-5%) ✅
packages/react/dist/index.js 2.51 kB -67 B (-3%)
packages/react/dist/index.mjs 2.21 kB +18 B (+1%)
packages/solidjs/dist/index.js 1.18 kB +9 B (+1%)
packages/solidjs/dist/index.mjs 1.14 kB +17 B (+2%)
packages/svelte/dist/index.js 2.21 kB -26 B (-1%)
packages/svelte/dist/index.mjs 1.96 kB +39 B (+2%)
packages/vue/dist/index.js 1.45 kB +11 B (+1%)
packages/vue/dist/index.mjs 1.2 kB +15 B (+1%)
ℹī¸ View Unchanged | Filename | Size | | :--- | :---: | | `packages/core/dist/api.mjs` | 3.68 kB | | `packages/core/dist/clarity.mjs` | 3.99 kB | | `packages/core/dist/common.mjs` | 5.23 kB | | `packages/core/dist/connect.mjs` | 4.07 kB | | `packages/core/dist/crypto-hmac-sha.mjs` | 236 B | | `packages/core/dist/crypto-pbkdf2.mjs` | 578 B | | `packages/core/dist/crypto-sha.mjs` | 212 B | | `packages/core/dist/crypto.mjs` | 5.34 kB | | `packages/core/dist/network.mjs` | 1.04 kB | | `packages/core/dist/storage.mjs` | 6.58 kB | | `packages/core/dist/transactions.mjs` | 11.8 kB | | `packages/core/dist/wallet-sdk.mjs` | 3.17 kB | | `packages/core/dist/zone-file.mjs` | 2.13 kB | | `packages/jotai/dist/index.mjs` | 1.27 kB |

compressed-size-action