Skip to content

fix(editor): downgrade rbush to v3 for CJS compatibility#7905

Merged
MitjaBezensek merged 1 commit intomainfrom
mitja/vendor-rbush
Feb 13, 2026
Merged

fix(editor): downgrade rbush to v3 for CJS compatibility#7905
MitjaBezensek merged 1 commit intomainfrom
mitja/vendor-rbush

Conversation

@MitjaBezensek
Copy link
Copy Markdown
Contributor

@MitjaBezensek MitjaBezensek commented Feb 13, 2026

Downgrade rbush from v4 (ESM-only) to v3 (CJS-compatible) to fix CJS environments (tsx, ts-node, Jest). v3→v4 only changed the module format with no API changes, so downgrading is safe.

Context.

Change type

  • bugfix

Test plan

  1. All existing editor tests pass
  2. Build output (CJS + ESM) works correctly
  3. node --import tsx -e "const { RBushIndex } = require('./packages/editor/src/lib/editor/managers/SpatialIndexManager/RBushIndex.ts'); new RBushIndex()" now works

Release notes

  • Fix tldraw failing to load in CJS environments (tsx, ts-node, Jest) due to ESM-only rbush dependency

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
examples Ready Ready Preview Feb 13, 2026 9:19am
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
analytics Ignored Ignored Preview Feb 13, 2026 9:19am
chat-template Ignored Ignored Preview Feb 13, 2026 9:19am
tldraw-docs Ignored Ignored Preview Feb 13, 2026 9:19am
tldraw-shader Ignored Ignored Preview Feb 13, 2026 9:19am
workflow-template Ignored Ignored Preview Feb 13, 2026 9:19am

Request Review

@huppy-bot huppy-bot bot added the bugfix Bug fix label Feb 13, 2026
@MitjaBezensek MitjaBezensek added the dotcom-hotfix-please ⚙️ Triggers tldraw.com production deploy after merge label Feb 13, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@MitjaBezensek MitjaBezensek changed the title fix(editor): vendor rbush to fix CJS compatibility fix(editor): downgrade rbush to v3 for CJS compatibility Feb 13, 2026
Copy link
Copy Markdown
Member

@mimecuvalo mimecuvalo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@MitjaBezensek MitjaBezensek added this pull request to the merge queue Feb 13, 2026
Merged via the queue into main with commit d01cba4 Feb 13, 2026
16 checks passed
@MitjaBezensek MitjaBezensek deleted the mitja/vendor-rbush branch February 13, 2026 10:16
huppy-bot bot pushed a commit that referenced this pull request Feb 13, 2026
Downgrade `rbush` from v4 (ESM-only) to v3 (CJS-compatible) to fix CJS
environments (tsx, ts-node, Jest). v3→v4 only changed the module format
with no API changes, so downgrading is safe.


[Context](https://discord.com/channels/859816885297741824/1471626494022389810).

### Change type

- [x] `bugfix`

### Test plan

1. All existing editor tests pass
2. Build output (CJS + ESM) works correctly
3. `node --import tsx -e "const { RBushIndex } =
require('./packages/editor/src/lib/editor/managers/SpatialIndexManager/RBushIndex.ts');
new RBushIndex()"` now works

### Release notes

- Fix tldraw failing to load in CJS environments (tsx, ts-node, Jest)
due to ESM-only rbush dependency
huppy-bot bot added a commit that referenced this pull request Feb 13, 2026
This is an automated hotfix for dotcom deployment.

Original PR: #7905
Original Author: @MitjaBezensek
github-merge-queue bot pushed a commit that referenced this pull request Feb 14, 2026
In order to keep the release notes current for the upcoming SDK release,
this PR updates `apps/docs/content/releases/next.mdx` with documentation
for recently merged changes.

### Changes

- Add "What's new" section for the experimental `onDropOnCanvas` canvas
drop handler (#7911)
- Add API change entry for `TldrawOptions.experimental__onDropOnCanvas`
- Update release intro paragraph to mention the new drop handler
- Add bug fix entry for CJS compatibility regression from ESM-only rbush
(#7905)
- Add bug fix entry for zero pen pressure on tablets affecting draw
shapes (#5693)

### Change type

- [x] `docs`

### Test plan

- [ ] Verify the release notes render correctly on the docs site

### Release notes

- Update next release notes with experimental canvas drop handler, CJS
fix, and tablet pressure fix
huppy-bot bot pushed a commit that referenced this pull request Feb 14, 2026
In order to keep the release notes current for the upcoming SDK release,
this PR updates `apps/docs/content/releases/next.mdx` with documentation
for recently merged changes.

### Changes

- Add "What's new" section for the experimental `onDropOnCanvas` canvas
drop handler (#7911)
- Add API change entry for `TldrawOptions.experimental__onDropOnCanvas`
- Update release intro paragraph to mention the new drop handler
- Add bug fix entry for CJS compatibility regression from ESM-only rbush
(#7905)
- Add bug fix entry for zero pen pressure on tablets affecting draw
shapes (#5693)

### Change type

- [x] `docs`

### Test plan

- [ ] Verify the release notes render correctly on the docs site

### Release notes

- Update next release notes with experimental canvas drop handler, CJS
fix, and tablet pressure fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Bug fix dotcom-hotfix-please ⚙️ Triggers tldraw.com production deploy after merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants