Skip to content

[pull] main from tldraw:main#607

Merged
pull[bot] merged 3 commits into
code:mainfrom
tldraw:main
Jun 19, 2026
Merged

[pull] main from tldraw:main#607
pull[bot] merged 3 commits into
code:mainfrom
tldraw:main

Conversation

@pull

@pull pull Bot commented Jun 19, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

frolic and others added 3 commits June 19, 2026 17:07
…9340)

In order to unblock the staging deploy, this PR adds `--archive=tgz` to
the `vercel deploy` command in the dotcom deploy script. Relates to
#9327.

#9327 stopped stripping `.js.map` files from the client deploy (so
deployed builds are debuggable in devtools), which was the right call —
but the extra files pushed the prebuilt output to 15,237 files, over
Vercel's 15,000-individual-file upload limit, and the "Deploy dotcom to
staging" job has failed on every `main` push since:

```
Error: Invalid request: `files` should NOT have more than 15000 items, received 15237.
Try using `--archive=tgz` to limit the amount of files you upload.
```

Archiving uploads the output as a single tarball instead of as
individual files, so the per-file count limit no longer applies, while
keeping the source maps that #9327 intentionally ships. This is exactly
the workaround Vercel's own error message recommends. The change applies
to staging, production, and PR preview deploys (all go through
`deploySpa()`).

### Change type

- [x] `bugfix`

### Test plan

1. Merge and confirm the "Deploy dotcom to staging" job succeeds on the
next `main` push, with the Vercel step reporting an archived upload
rather than the 15,000-file error.

### Code changes

| Section        | LOC change |
| -------------- | ---------- |
| Config/tooling | +10 / -3   |
…9345)

🙇‍♂️ File this one under "things we should have done four years ago".
Speeds up load time by 50-75ms on my M5 MacBook. Affects SDK as well as
everything else.

---


https://github.com/user-attachments/assets/bc9d0642-73f6-4e77-821d-60549ec5f5b3

In order to avoid regenerating SVG hash-pattern fill defs on every
editor mount, this PR caches the generated pattern images at the module
level. The pattern images are produced in `usePattern` by drawing to a
canvas and encoding a blob for every zoom LOD × theme (light/dark) — at
high-zoom LODs the canvas can reach ~2048×2048, so the draw-and-encode
work costs roughly 50ms and was repeated from scratch on each load.

The encoded output only depends on `(devicePixelRatio, zoom,
solidColor)`, so a module-level `patternImageBlobCache` keyed by those
values now stores the `Promise<Blob>` and reuses it across editor mounts
and instances. Object URLs are still created and revoked per-instance
exactly as before — only the immutable blobs are shared, so there is no
risk of handing out a revoked URL. Rejected promises (e.g. the
`throwToBlob` debug flag) are evicted from the cache so a later mount
can retry.

### Change type

- [x] `improvement`

### Test plan

1. Open an editor and add a shape with a pattern fill.
2. Unmount and remount the editor (or mount a second editor instance).
3. Confirm pattern fills render correctly and the canvas
pattern-generation work does not repeat.

- [ ] Unit tests
- [ ] End to end tests

### Release notes

- Cache generated pattern fill defs so they are not regenerated on every
editor mount, reducing editor load time.

### Code changes

| Section   | LOC change |
| --------- | ---------- |
| Core code | +21 / -2   |
In order to keep sidebar menus from being stranded when dismissed from
outside the sidebar, this PR clears open menu state when the mobile
sidebar overlay closes and lets desktop canvas clicks dismiss the
workspace switcher. The switcher dismissal overlay covers the viewport,
so that dismissing click is swallowed before it reaches sidebar items or
the canvas, while focus changes from workspace-switch canvas remounts
are still ignored.

### Change type

- [x] `bugfix`

### Test plan

1. On desktop, open the workspace switcher, click the canvas, and verify
the switcher closes without the click deselecting the current shape.
2. In a mobile viewport, open the sidebar, open the workspace switcher,
then click the sidebar overlay and verify the switcher closes.
3. Reopen the mobile sidebar, open a sidebar file menu, then click the
sidebar overlay and verify the file menu closes.
4. `yarn lint-current`
5. `yarn workspace dotcom lint`
6. Attempted `NODE_OPTIONS='--no-strip-types' yarn workspace dotcom
playwright test e2e/tests/smoke/workspaces.spec.ts --project=chromium -g
"closing the mobile sidebar closes open sidebar menus"`, but the shared
`workerStorageState` auth fixture timed out waiting for the login
redirect before the test body ran.

- [x] End to end tests

### Release notes

- Fix sidebar menus staying open after closing the mobile sidebar or
clicking the canvas.

### Code changes

| Section | LOC change |
| ------- | ---------- |
| Apps | +8 / -7 |
| Tests | +68 / -0 |
@pull pull Bot locked and limited conversation to collaborators Jun 19, 2026
@pull pull Bot added the ⤵️ pull label Jun 19, 2026
@pull
pull Bot merged commit 7fad8b7 into code:main Jun 19, 2026
@pull
pull Bot had a problem deploying to bemo-canary June 19, 2026 21:13 Failure
@pull
pull Bot had a problem deploying to deploy-production June 19, 2026 21:13 Failure
@pull
pull Bot had a problem deploying to deploy-staging June 19, 2026 21:13 Error
@pull
pull Bot had a problem deploying to deploy-staging June 19, 2026 21:13 Error
@pull
pull Bot had a problem deploying to deploy-staging June 20, 2026 00:55 Failure
@pull
pull Bot temporarily deployed to e2e-dotcom June 20, 2026 02:38 Inactive
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants