v3.8.0
This update brings a host of improvements across performance, user interface, and developer experience—all while squashing a number of bugs. Read on for a quick summary of the highlights.
What's New
Shape & Asset Enhancements
- ShapeUtil.configure for shape options (#5399). Introduces a new utility for passing options to shape utils. (This change also moves note shape resize mode and max draw shape points to their respective configuration objects.)
- Note Shape Resize Option. The note shape can be configured to resize by scale. (#5273)
- Asset uploads updated (#5218). The upload API now returns an object with both the asset
srcand optional metadata—allowing for richer asset records. - New "select geo tool" shortcut (#5341). Quickly select your most recent geometric tool with the
gshortcut. - Drag URLs onto the canvas (#5411). Drag a URL or link onto the canvas to create a bookmark shape.
Developer Experience & API Improvements
- Exports DX Pass (#5114). We’ve refined export functionality:
- The copy/export as JSON option has been removed.
- Export APIs (like
Editor.getSvgElementandEditor.getSvgString) now handle shape selections more gracefully. - Export contexts now expose
scaleandpixelRatiooptions and offer aresolveAssetUrlhelper. - A new
Editor.toImagemethod simplifies creating images from your canvas.
- i18n Enhancements (#5208). Expanded our localization support to cover the top 40 languages.
- React 19 (#5293). tldraw now supports React 19.
- Easier external content customisation (#5298, #5402). You can re-use our default handlers, and now customise pasted tldraw & excalidraw content.
- Customize input event handling (#5319). Listen to the
before-eventevent to run custom code before tldraw handles input events. - Custom cropping (#5137). There’s a new
onCropmethod thatShapeUtils can implement to opt-into & customize cropping.
Breaking Changes
- Shape Options Configuration. With the introduction of
ShapeUtil.configure, if you pass in a shape util that shares a type with a default, it now replaces the default instead of crashing. In addition, the previousoptions.maxDrawShapePointsis now set via: - Asset Upload API Changes. In
@tldraw/tlschema,TLAssetStore.uploadnow returns an object with{ src, meta? }rather than just the source string. Similarly,Editor.uploadAssethas been updated to reflect this change. (#5218) - Export Functionality. The option to copy/export as JSON has been removed since it was not fully supported. Additionally, hooks like
useImageOrVideoAssetUrlnow require awidthparameter, and export methods have been updated to export all shapes when no IDs are provided. (#5114) - Toasts and Dialogs. The tldraw components now include toasts and dialogs. The
TldrawUiToastsandTldrawUiDialogscomponents are renamed toDefaultToastsandDefaultDialogsand can be accessed viauseTldrawUiComponents.(#5263).
Bug Fixes
- UI & Interaction Bugs
- Asset & Export Fixes
Performance & Reliability
- Improved performance for headings (#5413). Improved frame performance by relocating computations to their point of use.
Authors
A huge thank you to everyone who contributed to this release:
Prev
v3.9.0Next
v3.7.0