Skip to content

Commit

Permalink
Merge pull request #506 from Telegram-Mini-Apps/changeset-release/master
Browse files Browse the repository at this point in the history
chore(packages): version packages
  • Loading branch information
heyqbnk authored Oct 17, 2024
2 parents 00fb8f3 + a0ab5d1 commit b026c6a
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 62 deletions.
52 changes: 0 additions & 52 deletions .changeset/itchy-moles-repair.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/seven-poems-pretend.md

This file was deleted.

6 changes: 6 additions & 0 deletions packages/bridge/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @telegram-apps/bridge

## 1.3.0

### Minor Changes

- 5346f76: "Add web_app_share_to_story" to `supports` checks.

## 1.2.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/bridge/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@telegram-apps/bridge",
"version": "1.2.1",
"version": "1.3.0",
"description": "TypeScript package to provide communication layer between Mini App and Telegram application.",
"author": "Vladislav Kibenko <[email protected]>",
"homepage": "https://github.com/Telegram-Mini-Apps/telegram-apps#readme",
Expand Down
7 changes: 7 additions & 0 deletions packages/navigation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @telegram-apps/navigation

## 1.0.4

### Patch Changes

- Updated dependencies [5346f76]
- @telegram-apps/bridge@1.3.0

## 1.0.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/navigation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@telegram-apps/navigation",
"version": "1.0.3",
"version": "1.0.4",
"description": "Navigation functionality for Telegram Mini Apps.",
"author": "Vladislav Kibenko <[email protected]>",
"homepage": "https://github.com/Telegram-Mini-Apps/telegram-apps#readme",
Expand Down
7 changes: 7 additions & 0 deletions packages/sdk-react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @telegram-apps/sdk-react

## 2.0.7

### Patch Changes

- Updated dependencies [34b2595]
- @telegram-apps/sdk@2.5.0

## 2.0.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@telegram-apps/sdk-react",
"version": "2.0.6",
"version": "2.0.7",
"description": "React bindings for Mini Apps client SDK. Contains hooks, components and other useful tools which allow usage of React along with Mini Apps client SDK.",
"author": "Vladislav Kibenko <[email protected]>",
"homepage": "https://github.com/Telegram-Mini-Apps/telegram-apps#readme",
Expand Down
7 changes: 7 additions & 0 deletions packages/sdk-solid/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @telegram-apps/sdk-solid

## 2.0.7

### Patch Changes

- Updated dependencies [34b2595]
- @telegram-apps/sdk@2.5.0

## 2.0.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-solid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@telegram-apps/sdk-solid",
"version": "2.0.6",
"version": "2.0.7",
"description": "Solid JS bindings for Mini Apps client SDK.",
"author": "Vladislav Kibenko <[email protected]>",
"homepage": "https://github.com/Telegram-Mini-Apps/telegram-apps#readme",
Expand Down
59 changes: 59 additions & 0 deletions packages/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,64 @@
# @telegram-apps/sdk

## 2.5.0

### 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:

```ts
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:

```ts
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:

```ts
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:

```ts
import { backButton } from "@telegram-apps/sdk";

backButton.show();
// TypedError('ERR_NOT_MOUNTED') will be thrown
```

### Patch Changes

- Updated dependencies [5346f76]
- @telegram-apps/bridge@1.3.0
- @telegram-apps/navigation@1.0.4

## 2.4.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@telegram-apps/sdk",
"version": "2.4.1",
"version": "2.5.0",
"description": "TypeScript Source Development Kit for Telegram Mini Apps client application.",
"author": "Vladislav Kibenko <[email protected]>",
"homepage": "https://github.com/Telegram-Mini-Apps/telegram-apps#readme",
Expand Down

0 comments on commit b026c6a

Please sign in to comment.