Skip to content

Releases: Telegram-Mini-Apps/telegram-apps

@telegram-apps/[email protected]

23 Oct 14:42
c57d93c
Compare
Choose a tag to compare

Patch Changes

@telegram-apps/[email protected]

18 Oct 16:15
2e4551c
Compare
Choose a tag to compare

Patch Changes

  • 4c9581f: Fix invalid Mini App mount using theme params RGB header color

@telegram-apps/[email protected]

18 Oct 16:15
2e4551c
Compare
Choose a tag to compare

Patch Changes

@telegram-apps/[email protected]

18 Oct 16:15
2e4551c
Compare
Choose a tag to compare

Patch Changes

@telegram-apps/[email protected]

17 Oct 09:24
b026c6a
Compare
Choose a tag to compare

Minor Changes

  • 34b2595: We realized that many developers might be using the SDK without knowing that some functionality they're using may not work. This is due to the non-strict postEvent function in the init function:

    import { init } from "@telegram-apps/sdk";
    
    init({
      postEvent: "non-strict",
    });

    Using the non-strict postEvent can lead to bugs that developers are unaware of. For example:

    backButton.onClick(() => {
      // User clicked the button, navigate to a new page.
      navigate("market");
    });
    
    backButton.show();

    In this case, if the show method is unsupported, and the postEvent function is non-strict (not throwing an error, only using console.warn), the user could get stuck on the current screen without any indication to the developer.

    To prevent such scenarios, we now disallow non-strict postEvent. Only a custom postEvent function can be passed. This way, you can bypass the protection mechanism, but you'll be fully aware of the risks. This function can also be used to decorate the original postEvent from the SDK.

    Since we no longer allow non-strict actions, most component and utility methods now include the isSupported property. For example:

    import { backButton } from "@telegram-apps/sdk";
    
    if (backButton.mount.isSupported()) {
      backButton.mount();
      backButton.show();
    }

    Calling the mount method without checking if it's supported may throw an error if the method is unsupported in the current Mini App version.

    Additionally, if a component has the mount method, many of its other methods now check if the component was mounted. If it wasn't, an error will be thrown. This behavior ensures that you are working with components within their intended lifecycle.

    For example, the following code will throw an error:

    import { backButton } from "@telegram-apps/sdk";
    
    backButton.show();
    // TypedError('ERR_NOT_MOUNTED') will be thrown

Patch Changes

@telegram-apps/[email protected]

17 Oct 09:24
b026c6a
Compare
Choose a tag to compare

Patch Changes

@telegram-apps/[email protected]

17 Oct 09:24
b026c6a
Compare
Choose a tag to compare

Patch Changes

@telegram-apps/[email protected]

17 Oct 09:24
b026c6a
Compare
Choose a tag to compare

Patch Changes

@telegram-apps/[email protected]

17 Oct 09:24
b026c6a
Compare
Choose a tag to compare

Minor Changes

  • 5346f76: "Add web_app_share_to_story" to supports checks.

@telegram-apps/[email protected]

16 Oct 20:28
785ea64
Compare
Choose a tag to compare

Patch Changes

  • 521a23e: Fix qr scanner capture logic