From dba21b86f6cd37c53903920f32b84a85391bc5e4 Mon Sep 17 00:00:00 2001 From: Vladislav Deryabkin <53311479+evermake@users.noreply.github.com> Date: Fri, 13 Feb 2026 22:50:29 +0500 Subject: [PATCH 1/2] Enhance README with JSX support instructions Added details on enabling JSX support and how it works with the @grom.js/tgx package. --- README.md | 63 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 5886e55..0160db2 100644 --- a/README.md +++ b/README.md @@ -441,6 +441,40 @@ Benefits of using JSX: `Text.tgx` function accepts a JSX element and returns an instance of `Text.Tgx`, which can then be used as a content of a message. +
+How it works? + +JSX is just syntactic sugar transformed by the compiler. +Result of transformation depends on the JSX runtime. +`effect-tg` relies on JSX runtime from [`@grom.js/tgx`](https://github.com/grom-dev/tgx), which transforms JSX elements to `TgxElement` instances. +When `Send.sendMessage` encounters an instance of `Text.Tgx`, it converts inner `TgxElement`s to the parameters for a `send*` method. + +
+ +
+How to enable? + +To enable JSX support: + +1. Install `@grom.js/tgx` package: + + ```sh + npm install @grom.js/tgx + ``` + +2. Update your `tsconfig.json`: + + ```json + { + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "@grom.js/tgx" + } + } + ``` + +
+ **Example:** Composing reusable messages with JSX. ```tsx @@ -500,32 +534,3 @@ const publish = Send.message(Content.text(summary)).pipe( Send.to(Dialog.channel(3011378744)), ) ``` - -
-How it works? - -JSX is just syntactic sugar transformed by the compiler. -Result of transformation depends on the JSX runtime. -`effect-tg` relies on JSX runtime from [`@grom.js/tgx`](https://github.com/grom-dev/tgx), which transforms JSX elements to `TgxElement` instances. -When `Send.sendMessage` encounters an instance of `Text.Tgx`, it converts inner `TgxElement`s to the parameters for a `send*` method. - -
- -To enable JSX support: - -1. Install `@grom.js/tgx` package: - - ```sh - npm install @grom.js/tgx - ``` - -2. Update your `tsconfig.json`: - - ```json - { - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "@grom.js/tgx" - } - } - ``` From 5a71e5b1e614b9e71632acc7e07ef729569c4d65 Mon Sep 17 00:00:00 2001 From: Vladislav Deryabkin <53311479+evermake@users.noreply.github.com> Date: Fri, 13 Feb 2026 22:53:10 +0500 Subject: [PATCH 2/2] wip --- README.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0160db2..e9c1a3f 100644 --- a/README.md +++ b/README.md @@ -441,21 +441,9 @@ Benefits of using JSX: `Text.tgx` function accepts a JSX element and returns an instance of `Text.Tgx`, which can then be used as a content of a message. -
-How it works? - -JSX is just syntactic sugar transformed by the compiler. -Result of transformation depends on the JSX runtime. -`effect-tg` relies on JSX runtime from [`@grom.js/tgx`](https://github.com/grom-dev/tgx), which transforms JSX elements to `TgxElement` instances. -When `Send.sendMessage` encounters an instance of `Text.Tgx`, it converts inner `TgxElement`s to the parameters for a `send*` method. - -
-
How to enable? -To enable JSX support: - 1. Install `@grom.js/tgx` package: ```sh @@ -475,6 +463,16 @@ To enable JSX support:
+
+How it works? + +JSX is just syntactic sugar transformed by the compiler. +Result of transformation depends on the JSX runtime. +`effect-tg` relies on JSX runtime from [`@grom.js/tgx`](https://github.com/grom-dev/tgx), which transforms JSX elements to `TgxElement` instances. +When `Send.sendMessage` encounters an instance of `Text.Tgx`, it converts inner `TgxElement`s to the parameters for a `send*` method. + +
+ **Example:** Composing reusable messages with JSX. ```tsx