Skip to content

Commit 3da6ee7

Browse files
committed
Merge branch '3287-we-should-generate-test-template-as-wrappers' of https://github.com/tact-lang/tact into 3287-we-should-generate-test-template-as-wrappers
2 parents 7e67feb + 7d7c54c commit 3da6ee7

File tree

23 files changed

+177
-58
lines changed

23 files changed

+177
-58
lines changed

dev-docs/CHANGELOG-DOCS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
77
## Doc: 2025-06
88

99
- Adjusted inline code tag highlighting to support global Starlight themes, and modified the One Light color theme to support proper highlighting of `keyword.operator.new` TextMate scopes: PR [#3346](https://github.com/tact-lang/tact/pull/3346)
10+
- Warned that imports are automatically exported: PR [#TBD](https://github.com/tact-lang/tact/pull/TBD)
1011

1112
## Doc: 2025-05
1213

dev-docs/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ The documentation changelog is kept separately: [CHANGELOG-DOCS](./CHANGELOG-DOC
99

1010
## [Unreleased]
1111

12+
### Code generation
13+
14+
- Reordered arguments of the `__tact_store_address_opt` function to optimize gas consumption: PR [#3333](https://github.com/tact-lang/tact/pull/3333)
15+
1216
## [1.6.13] - 2025-05-29
1317

1418
### Language features

docs/astro.config.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,7 @@ export default defineConfig({
153153
},
154154
items: [
155155
{ slug: 'book' },
156-
{
157-
slug: 'book/learn-tact-in-y-minutes',
158-
badge: { variant: 'tip', text: 'new' },
159-
},
156+
{ slug: 'book/learn-tact-in-y-minutes' },
160157
// NOTE: saved for coming from other blockchains / languages
161158
// {
162159
// label: 'Cheatsheets',
@@ -190,7 +187,10 @@ export default defineConfig({
190187
{ slug: 'book/expressions' },
191188
{ slug: 'book/statements' },
192189
{ slug: 'book/constants' },
193-
{ slug: 'book/functions' },
190+
{
191+
slug: 'book/functions',
192+
badge: { variant: 'tip', text: 'new' },
193+
},
194194
{ slug: 'book/assembly-functions' },
195195
{
196196
label: 'Communication',

docs/src/content/docs/book/config.mdx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ A [JSON schema](https://json-schema.org/) file is available for editors to provi
2323

2424
Simply add the `$schema` field at the top of your configuration file:
2525

26-
```json filename="tact.config.json" {2}
26+
```json title="tact.config.json" {2}
2727
{
2828
"$schema": "http://raw.githubusercontent.com/tact-lang/tact/main/src/config/configSchema.json",
2929
"projects": []
@@ -34,7 +34,7 @@ Simply add the `$schema` field at the top of your configuration file:
3434

3535
A list of Tact projects with respective compilation options. Each `.tact` file represents its own Tact project.
3636

37-
```json filename="tact.config.json" {3,4}
37+
```json title="tact.config.json" {3,4}
3838
{
3939
"projects": [
4040
{ },
@@ -49,7 +49,7 @@ The name of the project. All generated files are prefixed with it.
4949

5050
In [Blueprint][bp], `name` refers to the name of the contract itself.
5151

52-
```json filename="tact.config.json" {4,7}
52+
```json title="tact.config.json" {4,7}
5353
{
5454
"projects": [
5555
{
@@ -68,7 +68,7 @@ Path to the project's Tact file. You can specify only one Tact file per project.
6868

6969
In [Blueprint][bp], the `path` field is superseded by the `target` field in `wrappers/ContractName.compile.ts` by default, or in `compilables/ContractName.compile.ts` if you have the `separateCompilables` option set in [`blueprint.config.ts`][bp-config].
7070

71-
```json filename="tact.config.json" {5}
71+
```json title="tact.config.json" {5}
7272
{
7373
"projects": [
7474
{
@@ -85,7 +85,7 @@ Path to the directory where all generated files will be placed.
8585

8686
In [Blueprint][bp], the `output` field is not used, and all generated files are always placed in `build/ProjectName/`.
8787

88-
```json filename="tact.config.json" {6}
88+
```json title="tact.config.json" {6}
8989
{
9090
"projects": [
9191
{
@@ -103,7 +103,7 @@ Compilation options for the project.
103103

104104
In [Blueprint][bp], these options act as defaults unless modified in `wrappers/ContractName.compile.ts` by default, or in `compilables/ContractName.compile.ts` if you have the `separateCompilables` option set in [`blueprint.config.ts`][bp-config].
105105

106-
```json filename="tact.config.json" {7,11}
106+
```json title="tact.config.json" {7,11}
107107
{
108108
"projects": [
109109
{
@@ -128,7 +128,7 @@ If set to `true{:json}`, enables debug output for a contract and allows the usag
128128

129129
The `debug` mode implies the activation of the [`nullChecks`](#safety-nullchecks) safety option.
130130

131-
```json filename="tact.config.json" {8,14}
131+
```json title="tact.config.json" {8,14}
132132
{
133133
"projects": [
134134
{
@@ -161,7 +161,7 @@ The `debug` mode implies the activation of the [`nullChecks`](#safety-nullchecks
161161

162162
If set to `true{:json}`, enables support for [external](/book/external) message receivers.
163163

164-
```json filename="tact.config.json" {8,14}
164+
```json title="tact.config.json" {8,14}
165165
{
166166
"projects": [
167167
{
@@ -194,7 +194,7 @@ If set to `true{:json}`, enables support for [external](/book/external) message
194194

195195
If set to `true{:json}`, enables the generation of a [getter](/book/contracts#getter-functions) with IPFS links describing the contract's ABI.
196196

197-
```json filename="tact.config.json" {8,14}
197+
```json title="tact.config.json" {8,14}
198198
{
199199
"projects": [
200200
{
@@ -227,7 +227,7 @@ If set to `true{:json}`, enables the generation of a [getter](/book/contracts#ge
227227

228228
If set to `true{:json}`, enables the generation of a [getter](/book/contracts#getter-functions) with a list of interfaces provided by the contract.
229229

230-
```json filename="tact.config.json" {8,14}
230+
```json title="tact.config.json" {8,14}
231231
{
232232
"projects": [
233233
{
@@ -258,7 +258,7 @@ If set to `true{:json}`, enables the generation of a [getter](/book/contracts#ge
258258

259259
Experimental options that might be removed in the future. Use with caution!
260260

261-
```json filename="tact.config.json" {8,14}
261+
```json title="tact.config.json" {8,14}
262262
{
263263
"projects": [
264264
{
@@ -285,7 +285,7 @@ Experimental options that might be removed in the future. Use with caution!
285285

286286
If set to `true{:json}`, enables inlining of all functions in contracts. This can reduce gas usage at the cost of larger contracts.
287287

288-
```json filename="tact.config.json" {9,17}
288+
```json title="tact.config.json" {9,17}
289289
{
290290
"projects": [
291291
{
@@ -316,7 +316,7 @@ If set to `true{:json}`, enables inlining of all functions in contracts. This ca
316316

317317
Options that affect the safety of contracts.
318318

319-
```json filename="tact.config.json" {8,14}
319+
```json title="tact.config.json" {8,14}
320320
{
321321
"projects": [
322322
{
@@ -347,7 +347,7 @@ If set to `true{:json}`, enables runtime null checks on the arguments of the unw
347347

348348
Null checks are always enabled in [`debug`](#options-debug) mode.
349349

350-
```json filename="tact.config.json" {9,17}
350+
```json title="tact.config.json" {9,17}
351351
{
352352
"projects": [
353353
{
@@ -378,7 +378,7 @@ Null checks are always enabled in [`debug`](#options-debug) mode.
378378

379379
Options that affect the optimization of contracts.
380380

381-
```json filename="tact.config.json" {8,14}
381+
```json title="tact.config.json" {8,14}
382382
{
383383
"projects": [
384384
{
@@ -409,7 +409,7 @@ If set to `false{:json}`, saves the contract state at the end of a receiver exec
409409

410410
This option can be used to provide an extra safety level or for debugging.
411411

412-
```json filename="tact.config.json" {9,17}
412+
```json title="tact.config.json" {9,17}
413413
{
414414
"projects": [
415415
{
@@ -440,11 +440,11 @@ This option can be used to provide an extra safety level or for debugging.
440440

441441
`true{:json}` by default.
442442

443-
If set to `true{:json}`, stores internal and external receivers outside the methods map.
443+
If set to `true{:json}`, stores internal and external receivers outside the [methods map](/book/functions#low-level-representation).
444444

445445
When enabled, it saves gas but can cause the contract to be incorrectly recognized and misparsed by some explorers and user wallets.
446446

447-
```json filename="tact.config.json" {9,17}
447+
```json title="tact.config.json" {9,17}
448448
{
449449
"projects": [
450450
{
@@ -477,7 +477,7 @@ When enabled, it saves gas but can cause the contract to be incorrectly recogniz
477477

478478
If set to `true{:json}`, enables the generation of the `lazy_deployment_completed(){:tact}` getter. This option has no effect if [contract parameters](/book/contracts#parameters) are declared.
479479

480-
```json filename="tact.config.json" {8,14}
480+
```json title="tact.config.json" {8,14}
481481
{
482482
"projects": [
483483
{
@@ -541,7 +541,7 @@ If set to `true{:json}`, disables automatic generation of test files. By default
541541

542542
Sets the verbosity level — higher values produce more output.
543543

544-
```json filename="tact.config.json" {7}
544+
```json title="tact.config.json" {7}
545545
{
546546
"projects": [
547547
{
@@ -567,7 +567,7 @@ Value | Description
567567

568568
In [Blueprint][bp], `mode` is always set to `"full"{:json}` and cannot be overridden.
569569

570-
```json filename="tact.config.json" {7,13}
570+
```json title="tact.config.json" {7,13}
571571
{
572572
"projects": [
573573
{
@@ -588,7 +588,7 @@ In [Blueprint][bp], `mode` is always set to `"full"{:json}` and cannot be overri
588588

589589
## Full example
590590

591-
```json filename="tact.config.json" copy=false
591+
```json title="tact.config.json" copy=false
592592
{
593593
"$schema": "http://raw.githubusercontent.com/tact-lang/tact/main/src/config/configSchema.json",
594594
"projects": [

docs/src/content/docs/book/debug.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ If you're overwhelmed by the testing setup of [Blueprint][bp] or just want to te
907907

908908
On Linux or macOS, it would look like:
909909

910-
```json filename="package.json" {3}
910+
```json title="package.json" {3}
911911
{
912912
"scripts": {
913913
"lab": "blueprint build --all 1>/dev/null && yarn test -t plays"
@@ -917,7 +917,7 @@ If you're overwhelmed by the testing setup of [Blueprint][bp] or just want to te
917917

918918
And here's how it may look on Windows:
919919

920-
```json filename="package.json" {3-4}
920+
```json title="package.json" {3-4}
921921
{
922922
"scripts": {
923923
"build": "blueprint build --all | out-null",

docs/src/content/docs/book/expressions.mdx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,7 @@ Note that identifiers for [primitive types][p] start with an uppercase letter. U
211211

212212
## Instantiation
213213

214-
You can create instances of the following types:
215-
216-
* [Structs][s]
217-
* [Messages][m]
214+
You can create instances of [structs][s] and [message structs][m].
218215

219216
```tact
220217
struct StExample {
@@ -236,10 +233,7 @@ fun example() {
236233

237234
## Field access
238235

239-
You can directly access fields of the following types:
240-
241-
* [Structs][s]
242-
* [Messages][m]
236+
You can directly access fields of [structs][s] and [message structs][m].
243237

244238
```tact
245239
struct StExample {

docs/src/content/docs/book/gas-best-practices.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ fun example() {
198198

199199
To disable runtime `null{:tact}` checks of the `!!` operator, set the [`nullChecks`](/book/config#safety-nullchecks) field to `false{:json}` in your [`tact.config.json`](/book/config).
200200

201-
```json filename="tact.config.json" {9}
201+
```json title="tact.config.json" {9}
202202
{
203203
"projects": [
204204
{

docs/src/content/docs/book/import.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,29 @@ Additionally, the Tact compiler has a versatile set of standard libraries which
1111

1212
All imported code is combined together with yours, so it's important to avoid name collisions and always double-check the sources!
1313

14+
Moreover, imports are transitive and are always automatically exported — if an `a.tact` imports `b.tact`, which in turn imports `c.tact`, then all the definitions from `c.tact` are immediately accessible in `a.tact` without an explicit import of `c.tact` to it.
15+
16+
```tact title="c.tact"
17+
trait StatelessGetters {
18+
get fun bar(): Int { return 42 }
19+
get fun baz(): Int { return 43 }
20+
}
21+
```
22+
23+
```tact title="b.tact"
24+
import "c.tact";
25+
```
26+
27+
```tact title="a.tact"
28+
import "b.tact";
29+
30+
// Definitions available in "c.tact" are now available in this file
31+
// due to their transitive import from the "b.tact" file.
32+
contract Transitive() with StatelessGetters {}
33+
```
34+
35+
This behavior may change in future major releases.
36+
1437
:::
1538

1639
## Import Tact code

docs/src/content/docs/book/statements.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Some statements, such as [`let{:tact}`](#let) or [`return{:tact}`](#return), mus
133133

134134
## Expression
135135

136-
An expression statement is an expression used in a place where a statement is expected. The expression is evaluated, and its result is discarded. Therefore, it makes sense only for expressions that have side effects, such as executing a function or updating a variable.
136+
An expression statement is an expression used in a place where a statement is expected. The expression is evaluated, and its result is discarded. Therefore, it makes sense only for expressions that have side effects, such as [printing to the debug console](/ref/core-debug#dump) or executing an [extension mutation function](/book/functions#mutates).
137137

138138
```tact
139139
dump(2 + 2); // stdlib function

0 commit comments

Comments
 (0)