hirosystems / connect

A library for building excellent user experiences with Stacks.
https://connect.stacks.js.org
MIT License
77 stars 41 forks source link

[poc] add static stencil component #234

Closed janniks closed 2 years ago

janniks commented 2 years ago

using *Static would always bundle the connect-ui (ideally only shown when somebody has an incompatible browser, or is missing the wallet extension) into a project. however, developers could adjust their configs (e.g. rollup > manualChunks) to achieve similar dynamic loading/chunking, but handled by the last bundler in the build step (rather than stencil before distribution, which is optimized for webpack)

janniks commented 2 years ago

cc @kyranjamie does this make sense or are there other options to consider w/ stencil?

kyranjamie commented 2 years ago

So the gist here is just creating an alternate method that synchronously loads the connect dialog?

Code looks good but, I'm not so familiar with stencil so have nothing specific to suggest.

janniks commented 2 years ago

So the gist here is just creating an alternate method that synchronously loads the connect dialog?

Yep, although upon re-checking the latest release literally just added a fix for this, days ago. It's marked as experimental, but I'll test in a new PR.

UPDATE: the other fix doesn't seem to work in the case. so i'm going to stick with the static option proposed here. if the issue in stencil is resolved we can retry moving to the experimental imports.