You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have some improvements we could make which involve breaking changes, with the reasoning why:
As much as possible configuration should be done in pure JS. This is so attributes do not need to be passed through HTML attributes which are limited in what types can be used and require additional boilerplate to update the state (and then conflicts between attributes and state variables). It's also unclear where you pass them if you do not actually render any HTML elements, which will now be possible.
Only pass invoice to launchModal - do not allow passing it to the modal component itself
core configuration will be possible through a new init function exposed by the BC api (where you can pass things like showBalance: false, filters: ["nwc"], appName: "Zap.stream") etc.
Only retain attributes on elements that only apply to that specific element - like the title field on bc-button.
bc-modal will now be automatically injected into the DOM by launchModal. This reduces a line of code and simplifies for the developer (they don't need to consider where it should be rendered)
the provider will not be injected into the window by default. Global state should be avoided, and the provider can be accessed through connected callbacks. Note: we still need to show somewhere on the README how the provider can be set so that BC can be easily integrated into existing apps which rely on window.webln. WebLN.guide and webln-types currently assumes WebLN exists in the window.
Init() is explicitly called. Multiple devs have run into the issue where Bitcoin Connect is not available globally.
WebLN provider internal implementation will be able to be easily accessed through Typescript
WebLN provider is now exposed in nice callback methods rather than using window events (e.g. onConnect: provider => provider.nwc && provider.nwc.connectionString))
Add a new requestProvider function, that after executing the function the app can know they have a usable webln provider instance.
No longer rely on esbuild for usage in pure html. Use <script type="module">
TODO
Upgrade guide
Link to version 2 docs from README
List breaking changes in release notes
The text was updated successfully, but these errors were encountered:
We have some improvements we could make which involve breaking changes, with the reasoning why:
launchModal
- do not allow passing it to the modal component itselfinit
function exposed by the BC api (where you can pass things likeshowBalance: false, filters: ["nwc"], appName: "Zap.stream"
) etc.title
field on bc-button.bc-modal
will now be automatically injected into the DOM bylaunchModal
. This reduces a line of code and simplifies for the developer (they don't need to consider where it should be rendered)onConnect: provider => provider.nwc && provider.nwc.connectionString)
)requestProvider
function, that after executing the function the app can know they have a usable webln provider instance.<script type="module">
TODO
The text was updated successfully, but these errors were encountered: