5.9 KiB
Releases
How tldraw is versioned
Unlike many JavaScript packages distributed on NPM, the tldraw SDK does not follow semantic versioning in its release versions. Here's what we do instead:
- Major version bumps are very rare and we reserve them for special changes that signify a paradigm shift of some kind.
- Minor version bumps are released on a regular cadence. At the time of writing that cadence is monthly. They may contain breaking changes. We aim to make breaking changes as minimally disruptive as possible by providing warnings several releases in advance, and by providing tooling to help you migrate your code. We recommend updating tldraw at a similar pace to our release cadence, and be sure to check the release notes.
- Patch version bumps are for bugfixes and hotfixes that can't wait for the next cadence release.
How to publish a new major or minor release
New cadence releases are published from production. You trigger a release manually by running the workflow defined in publish.yml.
Before you publish
The release notes are read from two places at publish time, and both have to be current:
-
production'sapps/docs/content/releases/next.mdx.prepack.tsgenerates theRELEASE_NOTES.mdthat ships inside thetldrawnpm package from the checkout being published, so whatevernext.mdxsays onproductionat that moment is baked into the tarball. It can't be fixed afterwards without a patch release. During the freezeproductiononly moves by hotfix, so release-notes updates merged tomainhave to be brought over (thedotcom-hotfix-pleaselabel on the release-notes PR does this). The gate is an empty diff:git fetch origin production main git diff --stat origin/production origin/main -- apps/docs/content/releases/next.mdx -
The draft GitHub release named
vX.Y.0.publish-new.tspublishes its body verbatim and refuses to run if it doesn't exist. Theupdate-release-notesskill keeps it in sync withnext.mdx(.claude/skills/update-release-notes/scripts/update-draft-release.sh); re-run that ifnext.mdxchanged after the last sync.
- Go here, select the
productionbranch, and click the 'Run workflow' button. - Set the publish type to
new. - Fill out the form that appears. You can leave the defaults as they are if you want to publish a new 'minor' release. If you want to publish a new 'major' release, select that option from the dropdown.
- If you need to publish an exact version number, select the override option and provide the version number, like
3.4.0.
When you click the 'run' button after selecting how to bump the version number, the github action will do the following things:
- Update the version numbers in package.json files.
- Publish the draft GitHub release for the new version.
- Publish the new packages to npm.
- Create a new release branch for the new version. e.g. for version
3.4.0it will create a branch calledv3.4.x. - Push
production's docs and examples todocs-production, and its bemo worker tobemo-production. - Trigger a version bump on
mainso its package versions match.
After you publish
-
Check the notes that shipped inside the package match what you expected. The section for the new version should have the same entries as
next.mdxdid onproduction:curl -sL "$(npm view tldraw@X.Y.0 dist.tarball)" | tar -xzO package/RELEASE_NOTES.md | head -40 -
The version bump lands on
main, notproduction, so the publish itself doesn't push toproduction. The post-releaseupdate-release-notesrun (which archivesnext.mdxtovX.Y.0.mdxand needsdocs-hotfix-pleaseto reach the new release branch) is triggered by the nextproductionpush, normally the post-launch dotcom release frommain. Dispatchupdate-release-notes.ymlby hand if you want the docs page sooner.
How to publish a new patch release
-
Make sure your git repo is up-to-date.
git fetch -
Check out the latest release branch.
New major or minor releases will be given their own 'release branch' at publish time, with a name like
v2.0.x. Every release branch starts with avand ends in.x. Patch releases are published from these release branches.To see the latest tldraw version number run
npm show tldraw version. Then checkout the release branch for that number by prefixing thevand replacing the patch number withx. For example, if the latest version is3.4.3, you would rungit checkout v3.4.xYou can also patch older release branches if you need to. For example, if the latest version is
3.4.3but you need to patch2.8.2, you would rungit checkout v2.8.x -
Create a new branch based on the release branch.
git checkout -b david/my-helpful-patchesReplace
david/my-helpful-patcheswith a branch name that makes sense for the patches you are about to make. -
Cherry-pick the commits you want to include in the patch release.
git cherry-pick <commit-hash>You can cherry-pick multiple commits if you want to include multiple bugfixes in the patch release.
-
Push the branch and make a PR targeting the release branch.
-
Merge the PR.
That's it! The patch release will be published automatically after merging. Changelog and version number updates will be committed back to the release branch, and deliberately not to main.
What about documentation?
Our docs site is published in tandem with our npm packages. When you publish a new release, the docs site will be updated automatically so that the docs are always in sync with the latest version of tldraw.
If you make a docs change that you want to publish independently of a new cadence release, you can do so by following the same process as for creating a patch release. This will automatically detect that the packages themselves have not changed and will only update the docs site.