Skip to content

[pull] main from tldraw:main#123

Merged
pull[bot] merged 1 commit intocode:mainfrom
tldraw:main
Aug 1, 2025
Merged

[pull] main from tldraw:main#123
pull[bot] merged 1 commit intocode:mainfrom
tldraw:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Aug 1, 2025

See Commits and Changes for more details.


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

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

When I was working on the workflows starter, I found myself needing to
store a lot of state in atoms. This includes:
* The current exectution
* Which ports on which shapes should be highlighted when dragging a
connection
* Whether the on-canvas component picker was visible, and which shape it
should be attached to

All of this state should really belong to a specific `Editor` instance.
It's referencing data from that instance. If I was building a full app
and navigated from one workflow to another, I would want all the state
to be cleared due to the editor getting re-created. It's possible to get
this sort of functionality by using a weak map from editors to atoms,
but it takes a fair bit of management.

This diff adds an `EditorAtom` helper which handles the weak-map
juggling. The interface is similar to that of `Editor`, but each method
takes an `editor` for scoping.

### Change type

- [x] `api`


### Release notes

### API Changes

- Added `EditorAtom`, a helper for storing editor UI state in an `Atom`
@pull pull Bot locked and limited conversation to collaborators Aug 1, 2025
@pull pull Bot added the ⤵️ pull label Aug 1, 2025
@pull pull Bot had a problem deploying to deploy-staging August 1, 2025 21:13 Error
@pull pull Bot merged commit 146e95b into code:main Aug 1, 2025
0 of 7 checks passed
@pull pull Bot had a problem deploying to deploy-production August 1, 2025 21:13 Failure
@pull pull Bot had a problem deploying to deploy-staging August 1, 2025 21:13 Error
@pull pull Bot had a problem deploying to vsce publish August 1, 2025 21:13 Failure
@pull pull Bot had a problem deploying to deploy-staging August 2, 2025 00:23 Failure
@pull pull Bot temporarily deployed to e2e-dotcom August 2, 2025 02:27 Inactive
@pull pull Bot had a problem deploying to deploy-staging August 3, 2025 00:27 Failure
@pull pull Bot temporarily deployed to e2e-dotcom August 3, 2025 02:35 Inactive
@pull pull Bot had a problem deploying to deploy-staging August 4, 2025 00:27 Failure
@pull pull Bot temporarily deployed to e2e-dotcom August 4, 2025 02:35 Inactive
@pull pull Bot had a problem deploying to deploy-production August 4, 2025 10:08 Failure
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.

1 participant