collaboration Drawing app
 
 
 
Go to file
David Sheldrick 731da1bc77
derived presence state (#1204)
This PR adds

- A new `TLInstancePresence` record type, to collect info about the
presence state in a particular instance of the editor. This will
eventually be used to sync presence data instead of sending
instance-only state across the wire.
- **Record Scopes**

`RecordType` now has a `scope` property which can be one of three
things:
- `document`: the record belongs to the document and should be synced
and persisted freely. Currently: `TLDocument`, `TLPage`, `TLShape`, and
`TLAsset`
- `instance`: the record belongs to a single instance of the store and
should not be synced at all. It should not be persisted directly in most
cases, but rather compiled into a kind of 'instance configuration' to
store alongside the local document data so that when reopening the
associated document it can remember some of the previous instance state.
Currently: `TLInstance`, `TLInstancePageState`, `TLCamera`, `TLUser`,
`TLUserDocument`, `TLUserPresence`
- `presence`: the record belongs to a single instance of the store and
should not be persisted, but may be synced using the special presence
sync protocol. Currently just `TLInstancePresence`

This sets us up for the following changes, which are gonna be pretty
high-impact in terms of integrating tldraw into existing systems:

- Removing `instanceId` as a config option. Each instance gets a
randomly generated ID.
- We'd replace it with an `instanceConfig` option that has stuff like
selectedIds, camera positions, and so on. Then it's up to library users
to get and reinstate the instance config at persistence boundaries.
- Removing `userId` as config option, and removing the `TLUser` type
altogether.
- We might need to revisit when doing auth-enabled features like locking
shapes, but I suspect that will be separate.
2023-04-27 18:03:19 +00:00
.github lite: tweak lockfile name 2023-04-25 12:01:38 +01:00
.husky lite: standalone? 2023-04-25 12:01:38 +01:00
.yarn transfer-out: transfer out 2023-04-25 12:01:25 +01:00
apps [lite] upgrade lazyrepo (#1198) 2023-04-25 14:32:17 +01:00
assets transfer-out: transfer out 2023-04-25 12:01:25 +01:00
config [lite] upgrade lazyrepo (#1198) 2023-04-25 14:32:17 +01:00
packages derived presence state (#1204) 2023-04-27 18:03:19 +00:00
scripts derived presence state (#1204) 2023-04-27 18:03:19 +00:00
.eslintignore transfer-out: transfer out 2023-04-25 12:01:25 +01:00
.eslintplugin.js transfer-out: transfer out 2023-04-25 12:01:25 +01:00
.eslintrc.js transfer-out: transfer out 2023-04-25 12:01:25 +01:00
.gitignore transfer-out: transfer out 2023-04-25 12:01:25 +01:00
.prettierignore transfer-out: transfer out 2023-04-25 12:01:25 +01:00
.prettierrc transfer-out: transfer out 2023-04-25 12:01:25 +01:00
.yarnrc.yml lite: tweak lockfile name 2023-04-25 12:01:38 +01:00
CODE_OF_CONDUCT.md transfer-out: transfer out 2023-04-25 12:01:25 +01:00
CONTRIBUTING.md transfer-out: transfer out 2023-04-25 12:01:25 +01:00
LICENSE transfer-out: transfer out 2023-04-25 12:01:25 +01:00
README.md Alex/test (#1202) 2023-04-25 17:17:31 +01:00
lazy.config.ts derived presence state (#1204) 2023-04-27 18:03:19 +00:00
lerna.json transfer-out: transfer out 2023-04-25 12:01:25 +01:00
package.json derived presence state (#1204) 2023-04-27 18:03:19 +00:00
public-yarn.lock derived presence state (#1204) 2023-04-27 18:03:19 +00:00

README.md

tldraw-lite

test test

tldraw