Skip to content

Using unreleased versions of tools early

Novus Nota edited this page Feb 18, 2025 · 25 revisions

Bleeding-edge versions of Tact

This is important for the development of the compiler and if you want to receive all the latest features and fixes without waiting for a new release.

See the following subsections to start using Tact in your projects directly from its official GitHub repository.

First time setup

Important

Ensure that you have Node.js 22+ installed. To check, run node --version — it should show you the version 22.0.0 or later. If not, download and install Node.js from here: https://nodejs.org/en/download.

Tact compiler uses package manager Yarn, to enable and install it run: corepack enable yarn. Check installation with yarn -v — if it shows the version number, then everything's ready.

If it's your first time working with Tact from its GitHub repository, run the following command in the terminal. Just once:

# Cloning the Tact compiler repository somewhere convenient
git clone https://github.com/tact-lang/tact

# Get into the repo
cd tact
yarn install # dependencies
yarn build:fast # compiler
yarn link # to prepare the compiler for use in projects

Linking in projects

Important

For this part to work you need to make sure all the steps in the first time setup are made.

The linking approach works best with tact-template, because template uses the same package manager.

If not already, clone the template manually or via the GitHub interface itself.

Then, run the following in the terminal just once:

cd /local/path/to/cloned/tact/template
yarn link @tact-lang/compiler

And that's it — now it'll use the Tact from its cloned repository and not from the public NPM registry.

To upgrade the Tact compiler from time to time, see: Compiler upgrades.

Compiler upgrades

To upgrade the compiler, run the following commands:

# Get into the folder with Tact
cd /local/path/to/cloned/tact/repo

# Fetch and pull updates
git pull

# Refresh dependencies and rebuild the compiler
yarn install
yarn build:fast

After those commands, all linked installations of the compiler will start using the newly updated one.

Global availability

To invoke the locally built Tact compiler in any folder of any project via its CLI, run the following:

# Get into the folder with Tact
cd /local/path/to/cloned/tact/repo

# Install it globally
npm i -g .

Aside from the compiler, it'll also give you the access to the latest version of the BoC disassembler bundled with it:

unboc --help # disasm
tact --help # tact compiler

Tact language server, related extensions and plugins

Extensions for VS Code and VSCode-based editors like VSCodium are frequently updated on their marketplaces:

To get even more recent updates, or to set it up for other editors like (Neo)Vim, Sublime Text, Helix, and others, see the installation steps here. They use the nightly releases in the GitHub's repo of the Tact language server.

Published dev versions of Tact with Blueprint

Some development versions of Tact are published with the next tag on NPM. However, those releases are rather rare, so prefer to use the Bleeding-edge versions of Tact instead.

If you still wish to proceed, let's make sure everything works and remove the linked local version of Tact or a globally installed one, if either is present:

cd /local/path/to/tact/repo
yarn unlink # npm command is very similar, just replace yarn with npm

npm uninstall -g @tact-lang/compiler

We provide instructions for npm and yarn below. The instructions are in the form of shell scripts, so you can copy-paste the steps and reproduce those in your setting.

Note that those are incompatible, because the ways of overriding dependencies for the two package managers are different — npm supports using tags like next for specifying overrides, but yarn does not.

yarn package manager

To learn the current next release version, i.e. 1.5.4-dev.20240813, use the following shell command:

yarn info @tact-lang/compiler --json | jq '.data."dist-tags".next'

Now, proceed with the following instructions and substitute the 1.5.4-dev.20240813 with the version obtained via the previous command:

yarn create ton -y -- TestTactFromNext --type tact-empty --contractName Test
cd TestTactFromNext
rm -rf node_modules yarn.lock
cat <<< $(jq '. += { "resolutions": { "@tact-lang/compiler": "1.5.4-dev.20240813" } }' package.json) > package.json
yarn install
echo 'import "@stdlib/deploy"; contract Test with Deployable { get fun foo(): Address { return newAddress(0,0) } }' > contracts/test.tact
yarn blueprint build && yarn blueprint test
yarn tact --version

npm package manager

npm create ton -y -- TestTactFromNext --type tact-empty --contractName Test
cd TestTactFromNext
rm -rf node_modules package-lock.json
cat <<< $(jq '. += { "overrides": { "@ton/blueprint": { "@tact-lang/compiler": "next" } } }' package.json) > package.json
npm install
echo 'import "@stdlib/deploy"; contract Test with Deployable { get fun foo(): Address { return newAddress(0,0) } }' > contracts/test.tact
npx blueprint build && npx blueprint test
npx tact --version   # should output something like 1.4.1-dev.20240813
Clone this wiki locally