Compare commits

...

33 Commits

Author SHA1 Message Date
Anselm
641f1dbfbe Release 2024-06-03 17:33:59 +01:00
Anselm
58d9a104d6 Fix CoMaps not initialising properly when passing too many init options 2024-06-03 17:33:24 +01:00
Anselm
7b9d24c8ef Release 2024-06-01 17:25:06 +02:00
Anselm Eickhoff
4225fdd537 Merge pull request #200 from gdorsi/main
fix: improve compatibility with React compiler and concurrent features
2024-06-01 17:24:17 +02:00
Anselm
9fdc91c6de Add changeset 2024-06-01 17:23:18 +02:00
Anselm
93d8c85e5c Formatting 2024-06-01 17:22:38 +02:00
Anselm
929cddc3c3 Release 2024-06-01 17:13:02 +02:00
Anselm
e0bc63f016 Provide way to create accounts as another account 2024-06-01 17:12:42 +02:00
Anselm
b29ac306ea Release 2024-06-01 14:00:50 +02:00
Anselm
e8e883f4d6 Ability to add seed accounts to DemoAuth 2024-06-01 14:00:26 +02:00
Guido D'Orsi
3325ff1cd6 fix: make Jazz react compiler ready 2024-05-31 10:19:33 +02:00
Anselm
4fe14f03b4 Formatting fixes 2024-05-31 09:13:25 +02:00
Anselm
90e2a661e4 Very last fix 2024-05-31 09:00:56 +02:00
Anselm
6ed53ecb79 Last fixes 2024-05-31 08:59:41 +02:00
Anselm
c18775766c More fixes 2024-05-31 08:56:11 +02:00
Anselm
4bb3a6209a Doc fixes 2024-05-31 08:44:45 +02:00
Anselm
0f44a547a4 Lots more guide progress 2024-05-28 17:10:59 +01:00
Anselm
1e2f6d8f14 Release 2024-05-26 20:44:05 +01:00
Anselm Eickhoff
7e5b176930 Merge pull request #199 from tobiaslins/implement-loading-ui
Implement basic `loading` component that is rendered when migrations …
2024-05-26 20:40:00 +01:00
Anselm
b420eab503 Fix type for Provider 2024-05-26 20:37:55 +01:00
Tobias Lins
b370e2e14e Merge branch 'main' into implement-loading-ui 2024-05-26 20:48:38 +02:00
Tobias Lins
1fabee297d Implement basic loading component that is rendered when migrations are running or jazz not ready yet 2024-05-26 20:46:52 +02:00
Anselm
484dc460c5 Lots of doc progress 2024-05-26 17:39:16 +01:00
Anselm
0cb8756124 Fix lint error 2024-05-26 16:16:25 +01:00
Anselm
95d0f0221b Release 2024-05-26 16:15:18 +01:00
Anselm
0c9c0fcd60 Clean up loading & subscription API 2024-05-26 16:14:01 +01:00
Anselm
8be0dd133c Doc improvements 2024-05-26 16:13:25 +01:00
Anselm
e68e0ada0d Chage hero grid 2024-05-25 21:27:20 +01:00
Anselm
49a7349e4d Update copyright year 2024-05-25 21:27:11 +01:00
Anselm
979c7241a4 Guide progress, licenses 2024-05-25 20:54:53 +01:00
Anselm
e011e4a049 Add local-first conf badge 2024-05-25 19:46:36 +01:00
Anselm
92bccf5974 Release 2024-05-25 17:08:37 +01:00
Anselm
2c1d6dcb8f Fix type signature / depth of useCoState 2024-05-25 17:07:41 +01:00
67 changed files with 3861 additions and 2346 deletions

19
LICENSE.txt Normal file
View File

@@ -0,0 +1,19 @@
Copyright 2024, Garden Computing, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,5 +1,57 @@
# jazz-example-chat
## 0.0.55
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.8
- jazz-react@0.7.8
## 0.0.54
### Patch Changes
- Updated dependencies [9fdc91c]
- jazz-react@0.7.7
## 0.0.53
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.6
- jazz-react@0.7.6
## 0.0.52
### Patch Changes
- Updated dependencies
- jazz-react@0.7.5
## 0.0.51
### Patch Changes
- Updated dependencies
- jazz-react@0.7.4
## 0.0.50
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.3
- jazz-react@0.7.3
## 0.0.49
### Patch Changes
- Updated dependencies
- jazz-react@0.7.2
## 0.0.48
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-chat",
"private": true,
"version": "0.0.48",
"version": "0.0.55",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -2,11 +2,11 @@ import { ID } from 'jazz-tools';
import { Chat, Message, useCoState } from './app.tsx';
export function ChatScreen(props: { chatID: ID<Chat> }) {
const chat = useCoState(Chat, props.chatID);
const chat = useCoState(Chat, props.chatID, [{}]);
return chat ? <div className='w-full max-w-xl h-full flex flex-col items-stretch'>
{chat.length > 0
? chat.map((msg) => msg && <ChatBubble msg={msg} key={msg.id} />)
? chat.map((msg) => <ChatBubble msg={msg} key={msg.id} />)
: <div className='m-auto text-sm'>(Empty chat)</div>}
<ChatInput onSubmit={(text) => {
chat.push(

View File

@@ -1,475 +1,531 @@
# jazz-example-pets
## 0.0.73
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.8
- jazz-browser-media-images@0.7.8
- jazz-react@0.7.8
## 0.0.72
### Patch Changes
- Updated dependencies [9fdc91c]
- jazz-react@0.7.7
## 0.0.71
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.6
- jazz-browser-media-images@0.7.6
- jazz-react@0.7.6
## 0.0.70
### Patch Changes
- Updated dependencies
- jazz-react@0.7.5
- jazz-browser-media-images@0.7.5
## 0.0.69
### Patch Changes
- Updated dependencies
- jazz-react@0.7.4
## 0.0.68
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.3
- jazz-browser-media-images@0.7.3
- jazz-react@0.7.3
## 0.0.67
### Patch Changes
- Updated dependencies
- jazz-react@0.7.2
## 0.0.66
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.1
- jazz-browser-media-images@0.7.1
- jazz-react@0.7.1
- Updated dependencies
- jazz-tools@0.7.1
- jazz-browser-media-images@0.7.1
- jazz-react@0.7.1
## 0.0.65
### Patch Changes
- Updated dependencies [8636319]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [96c494f]
- Updated dependencies [59c18c3]
- Updated dependencies [19f52b7]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [d8fe2b1]
- Updated dependencies [19004b4]
- Updated dependencies [a78f168]
- Updated dependencies [52675c9]
- Updated dependencies [129e2c1]
- Updated dependencies [6d49e9b]
- Updated dependencies [1cfa279]
- Updated dependencies [704af7d]
- Updated dependencies [e97f730]
- Updated dependencies [460478f]
- Updated dependencies [6b0418f]
- Updated dependencies [e299c3e]
- Updated dependencies [ed5643a]
- Updated dependencies [bde684f]
- Updated dependencies [c4151fc]
- Updated dependencies [63374cc]
- Updated dependencies [01ac646]
- Updated dependencies [a5e68a4]
- Updated dependencies [8636319]
- Updated dependencies [952982e]
- Updated dependencies [1a35307]
- Updated dependencies [5fa277c]
- Updated dependencies [60d5ca2]
- Updated dependencies [21771c4]
- Updated dependencies [77c2b56]
- Updated dependencies [63374cc]
- Updated dependencies [d2e03ff]
- Updated dependencies [354bdcd]
- Updated dependencies [ece35b3]
- Updated dependencies [60d5ca2]
- Updated dependencies [69ac514]
- Updated dependencies [f8a5c46]
- Updated dependencies [f0f6f1b]
- Updated dependencies [e5eed5b]
- Updated dependencies [1a44f87]
- Updated dependencies [627d895]
- Updated dependencies [1200aae]
- Updated dependencies [63374cc]
- Updated dependencies [ece35b3]
- Updated dependencies [38d4410]
- Updated dependencies [85d2b62]
- Updated dependencies [fd86c11]
- Updated dependencies [52675c9]
- jazz-tools@0.7.0
- jazz-browser-media-images@0.7.0
- jazz-react@0.7.0
- Updated dependencies [8636319]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [96c494f]
- Updated dependencies [59c18c3]
- Updated dependencies [19f52b7]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [d8fe2b1]
- Updated dependencies [19004b4]
- Updated dependencies [a78f168]
- Updated dependencies [52675c9]
- Updated dependencies [129e2c1]
- Updated dependencies [6d49e9b]
- Updated dependencies [1cfa279]
- Updated dependencies [704af7d]
- Updated dependencies [e97f730]
- Updated dependencies [460478f]
- Updated dependencies [6b0418f]
- Updated dependencies [e299c3e]
- Updated dependencies [ed5643a]
- Updated dependencies [bde684f]
- Updated dependencies [c4151fc]
- Updated dependencies [63374cc]
- Updated dependencies [01ac646]
- Updated dependencies [a5e68a4]
- Updated dependencies [8636319]
- Updated dependencies [952982e]
- Updated dependencies [1a35307]
- Updated dependencies [5fa277c]
- Updated dependencies [60d5ca2]
- Updated dependencies [21771c4]
- Updated dependencies [77c2b56]
- Updated dependencies [63374cc]
- Updated dependencies [d2e03ff]
- Updated dependencies [354bdcd]
- Updated dependencies [ece35b3]
- Updated dependencies [60d5ca2]
- Updated dependencies [69ac514]
- Updated dependencies [f8a5c46]
- Updated dependencies [f0f6f1b]
- Updated dependencies [e5eed5b]
- Updated dependencies [1a44f87]
- Updated dependencies [627d895]
- Updated dependencies [1200aae]
- Updated dependencies [63374cc]
- Updated dependencies [ece35b3]
- Updated dependencies [38d4410]
- Updated dependencies [85d2b62]
- Updated dependencies [fd86c11]
- Updated dependencies [52675c9]
- jazz-tools@0.7.0
- jazz-browser-media-images@0.7.0
- jazz-react@0.7.0
## 0.0.65-alpha.42
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.42
- jazz-browser-media-images@0.7.0-alpha.40
- jazz-react@0.7.0-alpha.42
- Updated dependencies
- jazz-tools@0.7.0-alpha.42
- jazz-browser-media-images@0.7.0-alpha.40
- jazz-react@0.7.0-alpha.42
## 0.0.65-alpha.41
### Patch Changes
- jazz-tools@0.7.0-alpha.41
- jazz-browser-media-images@0.7.0-alpha.39
- jazz-react@0.7.0-alpha.41
- jazz-tools@0.7.0-alpha.41
- jazz-browser-media-images@0.7.0-alpha.39
- jazz-react@0.7.0-alpha.41
## 0.0.65-alpha.40
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.40
- Updated dependencies
- jazz-react@0.7.0-alpha.40
## 0.0.65-alpha.39
### Patch Changes
- jazz-react@0.7.0-alpha.39
- jazz-tools@0.7.0-alpha.39
- jazz-browser-media-images@0.7.0-alpha.38
- jazz-react@0.7.0-alpha.39
- jazz-tools@0.7.0-alpha.39
- jazz-browser-media-images@0.7.0-alpha.38
## 0.0.65-alpha.38
### Patch Changes
- Updated dependencies
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.38
- jazz-react@0.7.0-alpha.38
- jazz-browser-media-images@0.7.0-alpha.37
- Updated dependencies
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.38
- jazz-react@0.7.0-alpha.38
- jazz-browser-media-images@0.7.0-alpha.37
## 0.0.65-alpha.37
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.37
- jazz-browser-media-images@0.7.0-alpha.36
- jazz-tools@0.7.0-alpha.37
- Updated dependencies
- jazz-react@0.7.0-alpha.37
- jazz-browser-media-images@0.7.0-alpha.36
- jazz-tools@0.7.0-alpha.37
## 0.0.65-alpha.36
### Patch Changes
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [6b0418f]
- Updated dependencies [1a35307]
- jazz-tools@0.7.0-alpha.36
- jazz-react@0.7.0-alpha.36
- jazz-browser-media-images@0.7.0-alpha.35
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [6b0418f]
- Updated dependencies [1a35307]
- jazz-tools@0.7.0-alpha.36
- jazz-react@0.7.0-alpha.36
- jazz-browser-media-images@0.7.0-alpha.35
## 0.0.65-alpha.35
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.35
- jazz-react@0.7.0-alpha.35
- jazz-browser-media-images@0.7.0-alpha.34
- Updated dependencies
- jazz-tools@0.7.0-alpha.35
- jazz-react@0.7.0-alpha.35
- jazz-browser-media-images@0.7.0-alpha.34
## 0.0.65-alpha.34
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.34
- jazz-browser-media-images@0.7.0-alpha.33
- jazz-react@0.7.0-alpha.34
- Updated dependencies
- jazz-tools@0.7.0-alpha.34
- jazz-browser-media-images@0.7.0-alpha.33
- jazz-react@0.7.0-alpha.34
## 0.0.65-alpha.33
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.33
- Updated dependencies
- jazz-react@0.7.0-alpha.33
## 0.0.65-alpha.32
### Patch Changes
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.32
- jazz-react@0.7.0-alpha.32
- jazz-browser-media-images@0.7.0-alpha.32
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.32
- jazz-react@0.7.0-alpha.32
- jazz-browser-media-images@0.7.0-alpha.32
## 0.0.65-alpha.31
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.31
- jazz-browser-media-images@0.7.0-alpha.31
- jazz-react@0.7.0-alpha.31
- Updated dependencies
- jazz-tools@0.7.0-alpha.31
- jazz-browser-media-images@0.7.0-alpha.31
- jazz-react@0.7.0-alpha.31
## 0.0.65-alpha.30
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.30
- jazz-browser-media-images@0.7.0-alpha.30
- jazz-react@0.7.0-alpha.30
- Updated dependencies
- jazz-tools@0.7.0-alpha.30
- jazz-browser-media-images@0.7.0-alpha.30
- jazz-react@0.7.0-alpha.30
## 0.0.65-alpha.29
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.29
- jazz-browser-media-images@0.7.0-alpha.29
- jazz-react@0.7.0-alpha.29
- Updated dependencies
- jazz-tools@0.7.0-alpha.29
- jazz-browser-media-images@0.7.0-alpha.29
- jazz-react@0.7.0-alpha.29
## 0.0.65-alpha.28
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.28
- jazz-browser-media-images@0.7.0-alpha.28
- jazz-react@0.7.0-alpha.28
- Updated dependencies
- jazz-tools@0.7.0-alpha.28
- jazz-browser-media-images@0.7.0-alpha.28
- jazz-react@0.7.0-alpha.28
## 0.0.65-alpha.27
### Patch Changes
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.27
- jazz-browser-media-images@0.7.0-alpha.27
- jazz-react@0.7.0-alpha.27
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.27
- jazz-browser-media-images@0.7.0-alpha.27
- jazz-react@0.7.0-alpha.27
## 0.0.65-alpha.26
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.26
- jazz-browser-media-images@0.7.0-alpha.26
- jazz-react@0.7.0-alpha.26
- Updated dependencies
- jazz-tools@0.7.0-alpha.26
- jazz-browser-media-images@0.7.0-alpha.26
- jazz-react@0.7.0-alpha.26
## 0.0.65-alpha.25
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.25
- jazz-browser-media-images@0.7.0-alpha.25
- jazz-react@0.7.0-alpha.25
- Updated dependencies
- jazz-tools@0.7.0-alpha.25
- jazz-browser-media-images@0.7.0-alpha.25
- jazz-react@0.7.0-alpha.25
## 0.0.65-alpha.24
### Patch Changes
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.24
- jazz-browser-media-images@0.7.0-alpha.24
- jazz-react@0.7.0-alpha.24
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.24
- jazz-browser-media-images@0.7.0-alpha.24
- jazz-react@0.7.0-alpha.24
## 0.0.65-alpha.23
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.23
- jazz-browser-media-images@0.7.0-alpha.23
- jazz-react@0.7.0-alpha.23
- Updated dependencies
- jazz-tools@0.7.0-alpha.23
- jazz-browser-media-images@0.7.0-alpha.23
- jazz-react@0.7.0-alpha.23
## 0.0.65-alpha.22
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.22
- jazz-browser-media-images@0.7.0-alpha.22
- jazz-react@0.7.0-alpha.22
- Updated dependencies
- jazz-tools@0.7.0-alpha.22
- jazz-browser-media-images@0.7.0-alpha.22
- jazz-react@0.7.0-alpha.22
## 0.0.65-alpha.21
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.21
- jazz-tools@0.7.0-alpha.21
- jazz-browser-media-images@0.7.0-alpha.21
- Updated dependencies
- jazz-react@0.7.0-alpha.21
- jazz-tools@0.7.0-alpha.21
- jazz-browser-media-images@0.7.0-alpha.21
## 0.0.65-alpha.20
### Patch Changes
- Updated dependencies
- Updated dependencies
- jazz-react@0.7.0-alpha.20
- jazz-tools@0.7.0-alpha.20
- jazz-browser-media-images@0.7.0-alpha.20
- Updated dependencies
- Updated dependencies
- jazz-react@0.7.0-alpha.20
- jazz-tools@0.7.0-alpha.20
- jazz-browser-media-images@0.7.0-alpha.20
## 0.0.65-alpha.19
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.19
- jazz-browser-media-images@0.7.0-alpha.19
- jazz-react@0.7.0-alpha.19
- Updated dependencies
- jazz-tools@0.7.0-alpha.19
- jazz-browser-media-images@0.7.0-alpha.19
- jazz-react@0.7.0-alpha.19
## 0.0.65-alpha.18
### Patch Changes
- jazz-browser-media-images@0.7.0-alpha.18
- jazz-react@0.7.0-alpha.18
- jazz-browser-media-images@0.7.0-alpha.18
- jazz-react@0.7.0-alpha.18
## 0.0.65-alpha.17
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.17
- jazz-browser-media-images@0.7.0-alpha.17
- jazz-react@0.7.0-alpha.17
- Updated dependencies
- jazz-tools@0.7.0-alpha.17
- jazz-browser-media-images@0.7.0-alpha.17
- jazz-react@0.7.0-alpha.17
## 0.0.65-alpha.16
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.16
- jazz-browser-media-images@0.7.0-alpha.16
- jazz-react@0.7.0-alpha.16
- Updated dependencies
- jazz-tools@0.7.0-alpha.16
- jazz-browser-media-images@0.7.0-alpha.16
- jazz-react@0.7.0-alpha.16
## 0.0.65-alpha.15
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.15
- jazz-browser-media-images@0.7.0-alpha.15
- jazz-react@0.7.0-alpha.15
- Updated dependencies
- jazz-tools@0.7.0-alpha.15
- jazz-browser-media-images@0.7.0-alpha.15
- jazz-react@0.7.0-alpha.15
## 0.0.65-alpha.14
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.14
- jazz-browser-media-images@0.7.0-alpha.14
- jazz-react@0.7.0-alpha.14
- Updated dependencies
- jazz-tools@0.7.0-alpha.14
- jazz-browser-media-images@0.7.0-alpha.14
- jazz-react@0.7.0-alpha.14
## 0.0.65-alpha.13
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.13
- jazz-browser-media-images@0.7.0-alpha.13
- jazz-react@0.7.0-alpha.13
- Updated dependencies
- jazz-tools@0.7.0-alpha.13
- jazz-browser-media-images@0.7.0-alpha.13
- jazz-react@0.7.0-alpha.13
## 0.0.65-alpha.12
### Patch Changes
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.12
- jazz-react@0.7.0-alpha.12
- jazz-tools@0.7.0-alpha.12
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.12
- jazz-react@0.7.0-alpha.12
- jazz-tools@0.7.0-alpha.12
## 0.0.65-alpha.11
### Patch Changes
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.11
- jazz-react@0.7.0-alpha.11
- jazz-tools@0.7.0-alpha.11
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.11
- jazz-react@0.7.0-alpha.11
- jazz-tools@0.7.0-alpha.11
## 0.0.65-alpha.10
### Patch Changes
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.10
- jazz-react@0.7.0-alpha.10
- jazz-tools@0.7.0-alpha.10
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.10
- jazz-react@0.7.0-alpha.10
- jazz-tools@0.7.0-alpha.10
## 0.0.65-alpha.9
### Patch Changes
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.9
- jazz-react@0.7.0-alpha.9
- jazz-tools@0.7.0-alpha.9
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.9
- jazz-react@0.7.0-alpha.9
- jazz-tools@0.7.0-alpha.9
## 0.0.65-alpha.8
### Patch Changes
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.8
- jazz-react@0.7.0-alpha.8
- jazz-tools@0.7.0-alpha.8
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.8
- jazz-react@0.7.0-alpha.8
- jazz-tools@0.7.0-alpha.8
## 0.0.65-alpha.7
### Patch Changes
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.7
- jazz-react@0.7.0-alpha.7
- jazz-tools@0.7.0-alpha.7
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.7
- jazz-react@0.7.0-alpha.7
- jazz-tools@0.7.0-alpha.7
## 0.0.65-alpha.6
### Patch Changes
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.6
- jazz-react@0.7.0-alpha.6
- jazz-tools@0.7.0-alpha.6
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.6
- jazz-react@0.7.0-alpha.6
- jazz-tools@0.7.0-alpha.6
## 0.0.65-alpha.5
### Patch Changes
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.5
- jazz-react@0.7.0-alpha.5
- jazz-tools@0.7.0-alpha.5
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.5
- jazz-react@0.7.0-alpha.5
- jazz-tools@0.7.0-alpha.5
## 0.0.65-alpha.4
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.4
- jazz-browser-media-images@0.7.0-alpha.4
- jazz-react@0.7.0-alpha.4
- Updated dependencies
- jazz-tools@0.7.0-alpha.4
- jazz-browser-media-images@0.7.0-alpha.4
- jazz-react@0.7.0-alpha.4
## 0.0.65-alpha.3
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.3
- jazz-browser-media-images@0.7.0-alpha.3
- jazz-react@0.7.0-alpha.3
- Updated dependencies
- jazz-tools@0.7.0-alpha.3
- jazz-browser-media-images@0.7.0-alpha.3
- jazz-react@0.7.0-alpha.3
## 0.0.65-alpha.2
### Patch Changes
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.2
- jazz-react@0.7.0-alpha.2
- jazz-tools@0.7.0-alpha.2
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.2
- jazz-react@0.7.0-alpha.2
- jazz-tools@0.7.0-alpha.2
## 0.0.65-alpha.1
### Patch Changes
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.1
- jazz-react@0.7.0-alpha.1
- jazz-tools@0.7.0-alpha.1
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.1
- jazz-react@0.7.0-alpha.1
- jazz-tools@0.7.0-alpha.1
## 0.0.65-alpha.0
### Patch Changes
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.0
- jazz-react@0.7.0-alpha.0
- jazz-tools@0.7.0-alpha.0
- Updated dependencies
- jazz-browser-media-images@0.7.0-alpha.0
- jazz-react@0.7.0-alpha.0
- jazz-tools@0.7.0-alpha.0
## 0.0.64
### Patch Changes
- Updated dependencies
- jazz-browser-media-images@0.6.0
- Updated dependencies
- jazz-browser-media-images@0.6.0
## 0.0.63
### Patch Changes
- Updated dependencies
- jazz-browser-media-images@0.5.0
- jazz-react@0.5.0
- jazz-react-auth-local@0.4.16
- Updated dependencies
- jazz-browser-media-images@0.5.0
- jazz-react@0.5.0
- jazz-react-auth-local@0.4.16

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-pets",
"private": true,
"version": "0.0.66",
"version": "0.0.73",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -43,7 +43,7 @@ export class PetAccount extends Account {
profile = co.ref(Profile);
root = co.ref(PetAccountRoot);
migrate(creationProps?: { name: string }) {
migrate(this: PetAccount, creationProps?: { name: string }) {
super.migrate(creationProps);
if (!this._refs.root) {
this.root = PetAccountRoot.create(
@@ -52,7 +52,6 @@ export class PetAccount extends Account {
},
{ owner: this },
);
console.log("Created root", this.root);
}
}
}

View File

@@ -42,7 +42,7 @@ ReactDOM.createRoot(document.getElementById("root")!).render(
<ThemeProvider>
<TitleAndLogo name={appName} />
<div className="flex flex-col h-full items-center justify-start gap-10 pt-10 pb-10 px-5">
<Jazz.Provider>
<Jazz.Provider loading={<div>Loading</div>}>
<App />
</Jazz.Provider>
</div>

View File

@@ -1,424 +1,476 @@
# jazz-example-todo
## 0.0.72
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.8
- jazz-react@0.7.8
## 0.0.71
### Patch Changes
- Updated dependencies [9fdc91c]
- jazz-react@0.7.7
## 0.0.70
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.6
- jazz-react@0.7.6
## 0.0.69
### Patch Changes
- Updated dependencies
- jazz-react@0.7.5
## 0.0.68
### Patch Changes
- Updated dependencies
- jazz-react@0.7.4
## 0.0.67
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.3
- jazz-react@0.7.3
## 0.0.66
### Patch Changes
- Updated dependencies
- jazz-react@0.7.2
## 0.0.65
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.1
- jazz-react@0.7.1
- Updated dependencies
- jazz-tools@0.7.1
- jazz-react@0.7.1
## 0.0.64
### Patch Changes
- Updated dependencies [8636319]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [96c494f]
- Updated dependencies [59c18c3]
- Updated dependencies [19f52b7]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [d8fe2b1]
- Updated dependencies [19004b4]
- Updated dependencies [a78f168]
- Updated dependencies [52675c9]
- Updated dependencies [129e2c1]
- Updated dependencies [6d49e9b]
- Updated dependencies [1cfa279]
- Updated dependencies [704af7d]
- Updated dependencies [e97f730]
- Updated dependencies [460478f]
- Updated dependencies [6b0418f]
- Updated dependencies [e299c3e]
- Updated dependencies [ed5643a]
- Updated dependencies [bde684f]
- Updated dependencies [c4151fc]
- Updated dependencies [63374cc]
- Updated dependencies [01ac646]
- Updated dependencies [a5e68a4]
- Updated dependencies [8636319]
- Updated dependencies [952982e]
- Updated dependencies [1a35307]
- Updated dependencies [5fa277c]
- Updated dependencies [60d5ca2]
- Updated dependencies [21771c4]
- Updated dependencies [77c2b56]
- Updated dependencies [63374cc]
- Updated dependencies [d2e03ff]
- Updated dependencies [354bdcd]
- Updated dependencies [ece35b3]
- Updated dependencies [60d5ca2]
- Updated dependencies [69ac514]
- Updated dependencies [f8a5c46]
- Updated dependencies [f0f6f1b]
- Updated dependencies [e5eed5b]
- Updated dependencies [1a44f87]
- Updated dependencies [627d895]
- Updated dependencies [1200aae]
- Updated dependencies [63374cc]
- Updated dependencies [ece35b3]
- Updated dependencies [38d4410]
- Updated dependencies [85d2b62]
- Updated dependencies [fd86c11]
- Updated dependencies [52675c9]
- jazz-tools@0.7.0
- jazz-react@0.7.0
- Updated dependencies [8636319]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [96c494f]
- Updated dependencies [59c18c3]
- Updated dependencies [19f52b7]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [d8fe2b1]
- Updated dependencies [19004b4]
- Updated dependencies [a78f168]
- Updated dependencies [52675c9]
- Updated dependencies [129e2c1]
- Updated dependencies [6d49e9b]
- Updated dependencies [1cfa279]
- Updated dependencies [704af7d]
- Updated dependencies [e97f730]
- Updated dependencies [460478f]
- Updated dependencies [6b0418f]
- Updated dependencies [e299c3e]
- Updated dependencies [ed5643a]
- Updated dependencies [bde684f]
- Updated dependencies [c4151fc]
- Updated dependencies [63374cc]
- Updated dependencies [01ac646]
- Updated dependencies [a5e68a4]
- Updated dependencies [8636319]
- Updated dependencies [952982e]
- Updated dependencies [1a35307]
- Updated dependencies [5fa277c]
- Updated dependencies [60d5ca2]
- Updated dependencies [21771c4]
- Updated dependencies [77c2b56]
- Updated dependencies [63374cc]
- Updated dependencies [d2e03ff]
- Updated dependencies [354bdcd]
- Updated dependencies [ece35b3]
- Updated dependencies [60d5ca2]
- Updated dependencies [69ac514]
- Updated dependencies [f8a5c46]
- Updated dependencies [f0f6f1b]
- Updated dependencies [e5eed5b]
- Updated dependencies [1a44f87]
- Updated dependencies [627d895]
- Updated dependencies [1200aae]
- Updated dependencies [63374cc]
- Updated dependencies [ece35b3]
- Updated dependencies [38d4410]
- Updated dependencies [85d2b62]
- Updated dependencies [fd86c11]
- Updated dependencies [52675c9]
- jazz-tools@0.7.0
- jazz-react@0.7.0
## 0.0.64-alpha.42
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.42
- jazz-react@0.7.0-alpha.42
- Updated dependencies
- jazz-tools@0.7.0-alpha.42
- jazz-react@0.7.0-alpha.42
## 0.0.64-alpha.41
### Patch Changes
- jazz-tools@0.7.0-alpha.41
- jazz-react@0.7.0-alpha.41
- jazz-tools@0.7.0-alpha.41
- jazz-react@0.7.0-alpha.41
## 0.0.64-alpha.40
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.40
- Updated dependencies
- jazz-react@0.7.0-alpha.40
## 0.0.64-alpha.39
### Patch Changes
- jazz-react@0.7.0-alpha.39
- jazz-tools@0.7.0-alpha.39
- jazz-react@0.7.0-alpha.39
- jazz-tools@0.7.0-alpha.39
## 0.0.64-alpha.38
### Patch Changes
- Updated dependencies
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.38
- jazz-react@0.7.0-alpha.38
- Updated dependencies
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.38
- jazz-react@0.7.0-alpha.38
## 0.0.64-alpha.37
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.37
- jazz-tools@0.7.0-alpha.37
- Updated dependencies
- jazz-react@0.7.0-alpha.37
- jazz-tools@0.7.0-alpha.37
## 0.0.64-alpha.36
### Patch Changes
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [6b0418f]
- Updated dependencies [1a35307]
- jazz-tools@0.7.0-alpha.36
- jazz-react@0.7.0-alpha.36
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [6b0418f]
- Updated dependencies [1a35307]
- jazz-tools@0.7.0-alpha.36
- jazz-react@0.7.0-alpha.36
## 0.0.64-alpha.35
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.35
- jazz-react@0.7.0-alpha.35
- Updated dependencies
- jazz-tools@0.7.0-alpha.35
- jazz-react@0.7.0-alpha.35
## 0.0.64-alpha.34
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.34
- jazz-react@0.7.0-alpha.34
- Updated dependencies
- jazz-tools@0.7.0-alpha.34
- jazz-react@0.7.0-alpha.34
## 0.0.64-alpha.33
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.33
- Updated dependencies
- jazz-react@0.7.0-alpha.33
## 0.0.64-alpha.32
### Patch Changes
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.32
- jazz-react@0.7.0-alpha.32
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.32
- jazz-react@0.7.0-alpha.32
## 0.0.64-alpha.31
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.31
- jazz-react@0.7.0-alpha.31
- Updated dependencies
- jazz-tools@0.7.0-alpha.31
- jazz-react@0.7.0-alpha.31
## 0.0.64-alpha.30
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.30
- jazz-react@0.7.0-alpha.30
- Updated dependencies
- jazz-tools@0.7.0-alpha.30
- jazz-react@0.7.0-alpha.30
## 0.0.64-alpha.29
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.29
- jazz-react@0.7.0-alpha.29
- Updated dependencies
- jazz-tools@0.7.0-alpha.29
- jazz-react@0.7.0-alpha.29
## 0.0.64-alpha.28
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.28
- jazz-react@0.7.0-alpha.28
- Updated dependencies
- jazz-tools@0.7.0-alpha.28
- jazz-react@0.7.0-alpha.28
## 0.0.64-alpha.27
### Patch Changes
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.27
- jazz-react@0.7.0-alpha.27
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.27
- jazz-react@0.7.0-alpha.27
## 0.0.64-alpha.26
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.26
- jazz-react@0.7.0-alpha.26
- Updated dependencies
- jazz-tools@0.7.0-alpha.26
- jazz-react@0.7.0-alpha.26
## 0.0.64-alpha.25
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.25
- jazz-react@0.7.0-alpha.25
- Updated dependencies
- jazz-tools@0.7.0-alpha.25
- jazz-react@0.7.0-alpha.25
## 0.0.64-alpha.24
### Patch Changes
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.24
- jazz-react@0.7.0-alpha.24
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.24
- jazz-react@0.7.0-alpha.24
## 0.0.64-alpha.23
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.23
- jazz-react@0.7.0-alpha.23
- Updated dependencies
- jazz-tools@0.7.0-alpha.23
- jazz-react@0.7.0-alpha.23
## 0.0.64-alpha.22
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.22
- jazz-react@0.7.0-alpha.22
- Updated dependencies
- jazz-tools@0.7.0-alpha.22
- jazz-react@0.7.0-alpha.22
## 0.0.64-alpha.21
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.21
- jazz-tools@0.7.0-alpha.21
- Updated dependencies
- jazz-react@0.7.0-alpha.21
- jazz-tools@0.7.0-alpha.21
## 0.0.64-alpha.20
### Patch Changes
- Updated dependencies
- Updated dependencies
- jazz-react@0.7.0-alpha.20
- jazz-tools@0.7.0-alpha.20
- Updated dependencies
- Updated dependencies
- jazz-react@0.7.0-alpha.20
- jazz-tools@0.7.0-alpha.20
## 0.0.64-alpha.19
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.19
- jazz-react@0.7.0-alpha.19
- Updated dependencies
- jazz-tools@0.7.0-alpha.19
- jazz-react@0.7.0-alpha.19
## 0.0.64-alpha.18
### Patch Changes
- jazz-react@0.7.0-alpha.18
- jazz-react@0.7.0-alpha.18
## 0.0.64-alpha.17
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.17
- jazz-react@0.7.0-alpha.17
- Updated dependencies
- jazz-tools@0.7.0-alpha.17
- jazz-react@0.7.0-alpha.17
## 0.0.64-alpha.16
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.16
- jazz-react@0.7.0-alpha.16
- Updated dependencies
- jazz-tools@0.7.0-alpha.16
- jazz-react@0.7.0-alpha.16
## 0.0.64-alpha.15
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.15
- jazz-react@0.7.0-alpha.15
- Updated dependencies
- jazz-tools@0.7.0-alpha.15
- jazz-react@0.7.0-alpha.15
## 0.0.64-alpha.14
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.14
- jazz-react@0.7.0-alpha.14
- Updated dependencies
- jazz-tools@0.7.0-alpha.14
- jazz-react@0.7.0-alpha.14
## 0.0.64-alpha.13
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.13
- jazz-react@0.7.0-alpha.13
- Updated dependencies
- jazz-tools@0.7.0-alpha.13
- jazz-react@0.7.0-alpha.13
## 0.0.64-alpha.12
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.12
- jazz-tools@0.7.0-alpha.12
- Updated dependencies
- jazz-react@0.7.0-alpha.12
- jazz-tools@0.7.0-alpha.12
## 0.0.64-alpha.11
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.11
- jazz-tools@0.7.0-alpha.11
- Updated dependencies
- jazz-react@0.7.0-alpha.11
- jazz-tools@0.7.0-alpha.11
## 0.0.64-alpha.10
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.10
- jazz-tools@0.7.0-alpha.10
- Updated dependencies
- jazz-react@0.7.0-alpha.10
- jazz-tools@0.7.0-alpha.10
## 0.0.64-alpha.9
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.9
- jazz-tools@0.7.0-alpha.9
- Updated dependencies
- jazz-react@0.7.0-alpha.9
- jazz-tools@0.7.0-alpha.9
## 0.0.64-alpha.8
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.8
- jazz-tools@0.7.0-alpha.8
- Updated dependencies
- jazz-react@0.7.0-alpha.8
- jazz-tools@0.7.0-alpha.8
## 0.0.64-alpha.7
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.7
- jazz-tools@0.7.0-alpha.7
- Updated dependencies
- jazz-react@0.7.0-alpha.7
- jazz-tools@0.7.0-alpha.7
## 0.0.64-alpha.6
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.6
- jazz-tools@0.7.0-alpha.6
- Updated dependencies
- jazz-react@0.7.0-alpha.6
- jazz-tools@0.7.0-alpha.6
## 0.0.64-alpha.5
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.5
- jazz-tools@0.7.0-alpha.5
- Updated dependencies
- jazz-react@0.7.0-alpha.5
- jazz-tools@0.7.0-alpha.5
## 0.0.64-alpha.4
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.4
- jazz-react@0.7.0-alpha.4
- Updated dependencies
- jazz-tools@0.7.0-alpha.4
- jazz-react@0.7.0-alpha.4
## 0.0.64-alpha.3
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.3
- jazz-react@0.7.0-alpha.3
- Updated dependencies
- jazz-tools@0.7.0-alpha.3
- jazz-react@0.7.0-alpha.3
## 0.0.64-alpha.2
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.2
- jazz-tools@0.7.0-alpha.2
- Updated dependencies
- jazz-react@0.7.0-alpha.2
- jazz-tools@0.7.0-alpha.2
## 0.0.64-alpha.1
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.1
- jazz-tools@0.7.0-alpha.1
- Updated dependencies
- jazz-react@0.7.0-alpha.1
- jazz-tools@0.7.0-alpha.1
## 0.0.64-alpha.0
### Patch Changes
- Updated dependencies
- jazz-react@0.7.0-alpha.0
- cojson@0.7.0-alpha.0
- Updated dependencies
- jazz-react@0.7.0-alpha.0
- cojson@0.7.0-alpha.0
## 0.0.63
### Patch Changes
- Updated dependencies
- jazz-react@0.5.0
- jazz-react-auth-local@0.4.16
- Updated dependencies
- jazz-react@0.5.0
- jazz-react-auth-local@0.4.16

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-todo",
"private": true,
"version": "0.0.65",
"version": "0.0.72",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -39,7 +39,7 @@ export class TodoAccount extends Account {
/** The account migration is run on account creation and on every log-in.
* You can use it to set up the account root and any other initial CoValues you need.
*/
migrate(creationProps?: { name: string }) {
migrate(this: TodoAccount, creationProps?: { name: string }) {
super.migrate(creationProps);
if (!this._refs.root) {
this.root = TodoAccountRoot.create(

View File

@@ -1,17 +1,18 @@
import { Slogan } from "@/components/forMdx";
import { JazzLogo } from "@/components/logos";
<h1 id="guide">Learn some Jazz.</h1>
<Slogan>Build an issue tracking app with distributed state.</Slogan>
<h1 id="guide">Learn some <JazzLogo className="h-[1.3em] relative -top-0.5 inline-block -ml-[0.1em] -mr-[0.1em]"/></h1>
<Slogan>Build an issue tracker with distributed state.</Slogan>
Our issues app will be quite simple, but it will have team collaboration. <span className="text-nowrap">**Let's call it... &ldquo;Circular.&rdquo;**</span>
We'll build everything **step-by-step,** in typical, immediately usable stages. We'll explore many important things Jazz does &mdash; so **follow along** or **just pick things out.**
<h2 id="setup">Project Setup</h2>
<h2 id="guide-setup">Project Setup</h2>
1. Create a project from a generic Vite starter template:
1. Create a project called "circular" from a generic Vite starter template:
{/* prettier-ignore */}
```bash
npx degit gardencmp/vite-ts-react-tailwind circular
cd circular
@@ -29,33 +30,36 @@ We'll build everything **step-by-step,** in typical, immediately usable stages.
<small>(in a new terminal window):</small>
{/* prettier-ignore */}
```bash
cd circular
npm install jazz-tools jazz-react
```
3. Set up a Jazz context, by modifying `src/main.tsx`:
```tsx subtle=1,2,3,4,13,15,16,17,19
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { JazzReact } from "jazz-react";
3. Modify `src/main.tsx` to set up a Jazz context:
{/* prettier-ignore */}
```tsx
import React from "react"; // old
import ReactDOM from "react-dom/client"; // old
import App from "./App.tsx"; // old
import "./index.css"; // old
import { createJazzReactContext, DemoAuth } from "jazz-react";
// old
const Jazz = createJazzReactContext({
auth: DemoAuth({ appName: "Circular" }),
peer: "wss://mesh.jazz.tools/?key=you@example.com", // <- put your email here to receive a proper API key for later
peer: "wss://mesh.jazz.tools/?key=you@example.com", // <- put your email here to get a proper API key later
});
export const { useAccount, useCoState } = Jazz;
ReactDOM.createRoot(document.getElementById("root")!).render(
// old
ReactDOM.createRoot(document.getElementById("root")!).render( // old
<Jazz.Provider>
<React.StrictMode>
<App />
</React.StrictMode>
<React.StrictMode> // old
{" "}// old
<App /> // old
</React.StrictMode>{" "}// old
</Jazz.Provider>,
);
); // old
```
This sets Jazz up, extracts app-specific hooks for later, and wraps our app in the provider.
@@ -75,7 +79,7 @@ We can
- **edit** CoValues, from anywhere, by mutating them like local state
- **subscribe to edits** in CoValues, whether they're local or remote
<h3 id="first-schema">Declaring our own CoValues</h3>
<h3 id="declaring-covalues">Declaring our own CoValues</h3>
To make our own CoValues, we first need to declare a schema for them. Think of a schema as a combination of TypeScript types and runtime type information.
@@ -96,16 +100,17 @@ export class Issue extends CoMap {
TODO: explain what's happening
<h3>Reading from CoValues</h3>
<h3 id="reading-covalues">Reading from CoValues</h3>
CoValues are designed to be read like simple local JSON state. Let's see how we can read from an Issue by building a component to render one.
Create a new file `src/components/Issue.tsx` and add the following:
{/* prettier-ignore */}
```tsx
import { Issue } from "../schema";
export function IssueComponent({ issue }, { issue: Issue }) {
export function IssueComponent({ issue }: { issue: Issue }) {
return (
<div className="grid grid-cols-6 text-sm border-r border-b [&>*]:p-2 [&>*]:border-l [&>*]:border-t">
<h2>{issue.title}</h2>
@@ -119,42 +124,44 @@ export function IssueComponent({ issue }, { issue: Issue }) {
Simple enough!
<h3>Creating CoValues</h3>
<h3 id="creating-covalues">Creating CoValues</h3>
To actually see an Issue, we have to create one. This is where things start to get interesting...
Let's modify `src/App.tsx` to prepare for creating an Issue and then rendering it:
```tsx subtle=5,13,14,15
import { useState, useCallback } from "react";
{/* prettier-ignore */}
```tsx
import { useState } from "react";
import { Issue } from "./schema";
import { IssueComponent } from "./components/Issue";
function App() {
import { IssueComponent } from "./components/Issue.tsx";
// old
function App() {// old
const [issue, setIssue] = useState<Issue>();
// old
if (issue) {
return <IssueComponent issue={issue} />;
} else {
return <button>Create Issue</button>;
}
}
export default App;
} // old
// old
export default App; // old
```
Now, finally, let's implement creating an issue:
```tsx subtle=1,2,3,5,6,8,23,24,25,27,28,29,30
import { useState } from "react";
import { Issue } from "./schema";
import { IssueComponent } from "./components/Issue";
{/* prettier-ignore */}
```tsx
import { useState } from "react"; // old
import { Issue } from "./schema"; // old
import { IssueComponent } from "./components/Issue.tsx"; // old
import { useAccount } from "./main";
function App() {
// old
function App() {// old
const { me } = useAccount();
const [issue, setIssue] = useState<Issue>();
const [issue, setIssue] = useState<Issue>(); // old
// old
const createIssue = () => {
const newIssue = Issue.create(
{
@@ -167,20 +174,20 @@ function App() {
);
setIssue(newIssue);
};
if (issue) {
return <IssueComponent issue={issue} />;
} else {
return <button onClick={createIssue}>Create Issue</button>;
}
}
export default App;
// old
if (issue) {// old
return <IssueComponent issue={issue} />; // old
} else { // old
return <button onClick={createIssue}>Create Issue</button>; // old
} // old
} // old
// old
export default App; // old
```
Now you should be able to create a new issue by clicking the button and then see it rendered.
🏁 Now you should be able to create a new issue by clicking the button and then see it rendered!
<div className="text-xs uppercase text-stone-400 dark:text-stone-600 tracking-wider">
<div className="text-xs uppercase text-stone-400 dark:text-stone-600 tracking-wider -mb-3">
Preview
</div>
<div className="p-3 md:-mx-3 rounded border border-stone-100 dark:border-stone-900 bg-white dark:bg-black not-prose">
@@ -202,7 +209,7 @@ We'll already notice one interesting thing here:
We'll make use of both of these facts in a bit, but for now let's start with local editing and subscribing.
<h3>Editing CoValues and subscribing to edits</h3>
<h3 id="editing-and-subscription">Editing CoValues and subscribing to edits</h3>
Since we're the owner of the CoValue, we should be able to edit it, right?
@@ -216,49 +223,52 @@ This is exactly what the `useCoState` hook is for!
Let's modify `src/App.tsx`:
```tsx subtle=1,2,3,4,5,6,7,12,13,14,15,16,17,18,19,20,21,23,25,26,27,28,29,30,32
import { useState } from "react";
import { Issue } from "./schema";
import { IssueComponent } from "./components/Issue";
import { useAccount } from "./main";
function App() {
const { me } = useAccount();
{/* prettier-ignore */}
```tsx
import { useState } from "react"; // old
import { Issue } from "./schema"; // old
import { IssueComponent } from "./components/Issue.tsx"; // old
import { useAccount, useCoState } from "./main";
import { ID } from "jazz-tools"
// old
function App() { // old
const { me } = useAccount(); // old
const [issueID, setIssueID] = useState<ID<Issue>>();
// old
const issue = useCoState(Issue, issueID);
const createIssue = () => {
const newIssue = Issue.create(
{
title: "Buy terrarium",
description: "Make sure it's big enough for 10 snails.",
estimate: 5,
status: "backlog",
},
{ owner: me },
);
// old
const createIssue = () => {// old
const newIssue = Issue.create(// old
{ // old
title: "Buy terrarium", // old
description: "Make sure it's big enough for 10 snails.", // old
estimate: 5, // old
status: "backlog", // old
}, // old
{ owner: me }, // old
); // old
setIssueID(newIssue.id);
};
if (issue) {
return <IssueComponent issue={issue} />;
} else {
return <button onClick={createIssue}>Create Issue</button>;
}
}
export default App;
}; // old
// old
if (issue) { // old
return <IssueComponent issue={issue} />; // old
} else { // old
return <button onClick={createIssue}>Create Issue</button>; // old
} // old
} // old
// old
export default App; // old
```
And now for the exciting part! Let's make `src/components/Issue.tsx` an editing component.
```tsx subtle=1,3,4,5,28,29,30,31
import { Issue } from "../schema";
export function IssueComponent({ issue }, { issue: Issue }) {
return (
<div className="grid grid-cols-6 text-sm border-r border-b [&>*]:p-2 [&>*]:border-l [&>*]:border-t">
{/* prettier-ignore */}
```tsx
import { Issue } from "../schema"; // old
// old
export function IssueComponent({ issue }: { issue: Issue }) { // old
return ( // old
<div className="grid grid-cols-6 text-sm border-r border-b [&>*]:p-2 [&>*]:border-l [&>*]:border-t"> // old
<input type="text"
value={issue.title}
onChange={(event) => { issue.title = event.target.value }}/>
@@ -279,14 +289,14 @@ export function IssueComponent({ issue }, { issue: Issue }) {
>
<option value="backlog">Backlog</option>
<option value="in progress">In Progress</option>
<option value="done">Done</options>
<option value="done">Done</option>
</select>
</div>
);
}
</div> // old
); // old
} // old
```
<div className="text-xs uppercase text-stone-400 dark:text-stone-600 tracking-wider">
<div className="text-xs uppercase text-stone-400 dark:text-stone-600 tracking-wider -mb-3">
Preview
</div>
<div className="p-3 md:-mx-3 rounded border border-stone-100 dark:border-stone-900 bg-white dark:bg-black not-prose">
@@ -309,25 +319,31 @@ export function IssueComponent({ issue }, { issue: Issue }) {
</div>
</div>
🏁 Now you should be able to edit the issue after creating it!
You'll immediately notice that we're doing something non-idiomatic for React: we mutate the issue directly, by assigning to its properties.
This works because CoValues intercept these edits, update their local view accordingly (React doesn't really care after rendering) and then notify subscribers of the change, who will receive a fresh, updated view of the CoValue.
This works because CoValues
<aside className="text-sm border rounded px-4 my-4 max-w-3xl [&_pre]:mx-0">
<h4 className="not-prose text-base py-2 mb-3 -mx-4 px-4 border-b">💡 A Quick Overview of Subscribing to CoValues</h4>
- intercept these edits
- update their local view accordingly (React doesn't really care after rendering)
- notify subscribers of the change (who will receive a fresh, updated view of the CoValue)
<aside className="text-sm border border-stone-300 dark:border-stone-700 rounded px-4 my-4 max-w-3xl [&_pre]:mx-0">
<h4 className="not-prose text-base py-2 mb-3 -mx-4 px-4 border-b border-stone-300 dark:border-stone-700">💡 A Quick Overview of Subscribing to CoValues</h4>
There are three main ways to subscribe to a CoValue:
1. Directly on an instance:
```ts
const unsub = issue.subscribe((updatedIssue) => console.log(updatedIssue));
const unsub = issue.subscribe([], (updatedIssue) => console.log(updatedIssue));
```
2. If you only have an ID (this will load the issue if needed):
```ts
const unsub = Issue.subscribe(issueID, { as: me }, (updatedIssue) => {
const unsub = Issue.subscribe(issueID, me, [], (updatedIssue) => {
console.log(updatedIssue);
});
```
@@ -344,7 +360,7 @@ This works because CoValues intercept these edits, update their local view accor
const { me } = useAccount();
const [value, setValue] = useState<V>();
useEffect(() => Schema.subscribe(id, { as: me }, setValue), [id]);
useEffect(() => Schema.subscribe(id, me, [], setValue), [id]);
return value;
}
@@ -352,24 +368,303 @@ This works because CoValues intercept these edits, update their local view accor
</aside>
We have one subscriber on our Issue, with `useCoState` in `src/App.tsx`, which will cause the `App` component and its children to re-render whenever the Issue changes.
We have one subscriber on our Issue, with `useCoState` in `src/App.tsx`, which will cause the `App` component and its children **to** re-render whenever the Issue changes.
<h3>Automatic local & cloud persistence</h3>
<h3 id="persistence">Automatic local & cloud persistence</h3>
So far our Issue CoValues just looked like ephemeral local state. We'll now start exploring the first main feature that makes CoValues special: **automatic persistence.**
<span className="text-amber-500">
🚧 OH NO - This is as far as we've written the Guide. 🚧
</span>
{" -> "}
<a href="https://github.com/gardencmp/jazz/issues/186">Complain on GitHub</a>
Actually, all the Issue CoValues we've created so far **have already been automatically persisted** to the cloud and locally - but we loose track of their ID after a reload.
<h3>Remote sync</h3>
So let's store the ID in window URL state and make sure our useState is in sync with that.
{/* prettier-ignore */}
```tsx
import { useState } from "react"; // old
import { Issue } from "./schema"; // old
import { IssueComponent } from "./components/Issue.tsx"; // old
import { useAccount, useCoState } from "./main"; // old
import { ID } from "jazz-tools" // old
// old
function App() { // old
const { me } = useAccount(); // old
const [issueID, setIssueID] = useState<ID<Issue> | undefined>(
(window.location.search?.replace("?issue=", "") || undefined) as ID<Issue> | undefined,
);
// old
const issue = useCoState(Issue, issueID); // old
// old
const createIssue = () => {// old
const newIssue = Issue.create(// old
{ // old
title: "Buy terrarium", // old
description: "Make sure it's big enough for 10 snails.", // old
estimate: 5, // old
status: "backlog", // old
}, // old
{ owner: me }, // old
); // old
setIssueID(newIssue.id); // old
window.history.pushState({}, "", `?issue=${newIssue.id}`);
}; // old
// old
if (issue) { // old
return <IssueComponent issue={issue} />; // old
} else { // old
return <button onClick={createIssue}>Create Issue</button>; // old
} // old
} // old
// old
export default App; // old
```
🏁 Now you should be able to create an issue, edit it, reload the page, and still see the same issue.
<h3 id="remote-sync">Remote sync</h3>
To see that sync is also already working, try the following:
- copy the URL to a new tab in the same browser window and see the same issue
- edit the issue and see the changes reflected in the other tab!
This works because we load the issue as the same account that created it and owns it (remember setting `{ owner: me }`?).
We'll learn more about access control in "Groups & Permissions", but for now let's build a super simple way of sharing an Issue by just making it publicly readable & writable.
All we have to do is create a new group to own each new issue and add "everyone" as a "writer":
{/* prettier-ignore */}
```tsx
import { useState } from "react"; // old
import { Issue } from "./schema"; // old
import { IssueComponent } from "./components/Issue.tsx"; // old
import { useAccount, useCoState } from "./main"; // old
import { ID, Group } from "jazz-tools"
// old
function App() { // old
const { me } = useAccount(); // old
const [issueID, setIssueID] = useState<ID<Issue> | undefined>(// old
(window.location.search?.replace("?issue=", "") || undefined) as ID<Issue> | undefined,// old
); // old
// old
const issue = useCoState(Issue, issueID); // old
// old
const createIssue = () => { // old
const group = Group.create({ owner: me });
group.addMember("everyone", "writer");
// old
const newIssue = Issue.create( // old
{ // old
title: "Buy terrarium", // old
description: "Make sure it's big enough for 10 snails.", // old
estimate: 5, // old
status: "backlog", // old
}, // old
{ owner: group },
); // old
setIssueID(newIssue.id); // old
window.history.pushState({}, "", `?issue=${newIssue.id}`); // old
}; // old
// old
if (issue) { // old
return <IssueComponent issue={issue} />; // old
} else { // old
return <button onClick={createIssue}>Create Issue</button>; // old
} // old
} // old
// old
export default App; // old
```
🏁 Now you should be able to open the Issue (with its unique URL) on another device or browser, or send it to a friend and you should be able to **edit it together in realtime!**
This concludes our intro to the essence of CoValues. Hopefully you're starting to have a feeling for how CoValues behave and how they're magically available everywhere.
<h2 id="refs-and-on-demand-subscribe">Refs & Auto-Subscribe</h2>
Now let's have a look at how to compose CoValues into more complex structures and build a whole app around them.
Let's extend our two data model to include "Projects" which have a list of tasks and some properties of their own.
Using plain objects, you would probably type a Project like this:
```ts
type Project = {
name: string;
issues: Issue[];
};
```
In order to create this more complex structure in a fully collaborative way, we're going to need _references_ that allow us to nest or link CoValues.
Add the following to `src/schema.ts`:
```ts
import { CoMap, CoList, co } from "jazz-tools";
// old
export class Issue extends CoMap { // old
title = co.string; // old
description = co.string; // old
estimate = co.number; // old
status? = co.literal("backlog", "in progress", "done"); // old
} // old
// old
export class ListOfIssues extends CoList.Of(co.ref(Issue)) {}
export class Project extends CoMap {
name = co.string;
issues = co.ref(ListOfIssues);
}
```
Now let's change things up a bit in terms of components as well.
First, we'll change `App.tsx` to create and render `Project`s instead of `Issue`s. (We'll move the `useCoState` into the `ProjectComponent` we'll create in a second).
{/* prettier-ignore */}
```tsx
import { useState } from "react"; // old
import { Project, ListOfIssues } from "./schema";
import { ProjectComponent } from "./components/Project.tsx";
import { useAccount } from "./main";
import { ID, Group } from "jazz-tools"
// old
function App() { // old
const { me } = useAccount(); // old
const [projectID, setProjectID] = useState<ID<Project> | undefined>(
(window.location.search?.replace("?project=", "") || undefined) as ID<Project> | undefined,// old
);
// old
const issue = useCoState(Issue, issueID); // *bin*
// old
const createProject = () => {
const group = Group.create({ owner: me });
group.addMember("everyone", "writer");
const newProject = Project.create(
{
name: "New Project",
issues: ListOfIssues.create([], { owner: group })
},
{ owner: group },
);
setProjectID(newProject.id);
window.history.pushState({}, "", `?project=${newProject.id}`);
};
// old
if (projectID) {
return <ProjectComponent projectID={projectID} />;
} else {
return <button onClick={createProject}>Create Project</button>;
}
} // old
// old
export default App; // old
```
Now we'll actually create the `ProjectComponent` that renders a `Project` and its `Issue`s.
Create a new file `src/components/Project.tsx` and add the following:
{/* prettier-ignore */}
```tsx
import { ID } from "jazz-tools";
import { Project, Issue } from "../schema";
import { IssueComponent } from "./Issue.tsx";
import { useCoState } from "../main";
export function ProjectComponent({ projectID }: { projectID: ID<Project> }) {
const project = useCoState(Project, projectID);
const createAndAddIssue = () => {
project?.issues?.push(Issue.create({
title: "",
description: "",
estimate: 0,
status: "backlog",
}, { owner: project._owner }));
};
return project ? (
<div>
<h1>{project.name}</h1>
<div className="border-r border-b">
{project.issues?.map((issue) => (
issue && <IssueComponent key={issue.id} issue={issue} />
))}
<button onClick={createAndAddIssue}>Create Issue</button>
</div>
</div>
) : (
<div>Loading project...</div>
);
}
```
🏁 Now you should be able to create a project, add issues to it, share it, and edit it collaboratively!
Two things to note here:
- We create a new Issue like before, and then push it into the `issues` list of the Project. By setting the `owner` to the Project's owner, we ensure that the Issue has the same access rights as the project itself.
- We only need to use `useCoState` on the Project, and the nested `ListOfIssues` and each `Issue` will be **automatically loaded and subscribed to when we access them.**
- However, because either the `Project`, `ListOfIssues`, or each `Issue` might not be loaded yet, we have to check for them being defined.
The load-and-subscribe-on-access is a convenient way to have your rendering drive data loading (including in nested components!) and lets you quickly chuck UIs together without worrying too much about the shape of all data you'll need.
But you can also take more precise control over loading by defining a minimum-depth to load in `useCoState`:
{/* prettier-ignore */}
```tsx
import { ID } from "jazz-tools";// old
import { Project, Issue } from "../schema"; // old
import { IssueComponent } from "./Issue.tsx"; // old
import { useCoState } from "../main"; // old
// old
export function ProjectComponent({ projectID }: { projectID: ID<Project> }) {// old
const project = useCoState(Project, projectID, { issues: [{}] });
const createAndAddIssue = () => {// old
project?.issues.push(Issue.create({
title: "",// old
description: "",// old
estimate: 0,// old
status: "backlog",// old
}, { owner: project._owner }));// old
};// old
// old
return project ? (// old
<div>// old
<h1>{project.name}</h1>// old
<div className="border-r border-b">// old
{project.issues.map((issue) => (
<IssueComponent key={issue.id} issue={issue} />
))}// old
<button onClick={createAndAddIssue}>Create Issue</button>// old
</div>// old
</div>// old
) : (// old
<div>Loading project...</div>// old
);// old
}// old
```
The loading-depth spec `{ issues: [{}] }` means "in `Project`, load `issues` and load each item in `issues` shallowly". (Since an `Issue` doesn't have any further references, "shallowly" actually means all its properties will be available).
- Now, we can get rid of a lot of coniditional accesses because we know that once `project` is loaded, `project.issues` and each `Issue` in it will be loaded as well.
- This also results in only one rerender and visual update when everything is loaded, which is faster (especially for long lists) and gives you more control over the loading UX.
TODO: explainer about not loaded vs not set/defined and `_refs` basics
<div className="text-amber-500 mt-52">
🚧 OH NO - This is as far as we've written the Guide. 🚧
</div>
{" -> "}
<a href="https://github.com/gardencmp/jazz/issues/186">Complain on GitHub</a>
<h2 id="groups-and-permissions">Groups & Permissions</h2>
<h2 id="accounts-and-migrations">Accounts & Migrations</h2>
<h2 id="auth-accounts-and-migrations">Auth, Accounts & Migrations</h2>
<h2 id="backend-workers">Backend Workers</h2>
<h2 id="edits-and-time-travel">Edit Metadata & Time Travel</h2>
<h2 id="backend-workers">Backend Workers</h2>

View File

@@ -1,6 +1,7 @@
import { DocNav } from "@/components/docs/nav";
import { PackageDocs } from "@/components/docs/packageDocs";
import Guide from "./guide.mdx";
import { Prose } from "@/components/forMdx";
export const metadata = {
title: "jazz - Docs",
@@ -10,44 +11,50 @@ export const metadata = {
export default function Page() {
return (
<>
<div className="hidden md:block bg-stone-100 dark:bg-stone-900 p-4 rounded-xl sticky overflow-y-scroll overscroll-contain w-[16rem] h-[calc(100dvh-8rem)] -mb-[calc(100dvh-8rem)] top-[6rem] mr-10 prose-sm prose-ul:pl-1 prose-ul:ml-1 prose-li:my-2 prose-li:leading-tight prose-ul:list-['-']">
<div className="hidden md:block bg-stone-100 dark:bg-stone-900 text-stone-700 dark:text-stone-300 p-4 rounded-xl sticky overflow-y-scroll overscroll-contain w-[16rem] h-[calc(100dvh-8rem)] -mb-[calc(100dvh-8rem)] top-[6rem] mr-10 prose-sm prose-ul:pl-1 prose-ul:ml-1 prose-li:my-2 prose-li:leading-tight prose-ul:list-['-']">
<DocNav />
</div>
<div className="md:ml-[20rem]">
<Guide />
<div className="md:ml-[20rem] text-base">
<Prose className="prose">
<Guide />
<h1 id="faq">FAQ</h1>
<p>
<span className="text-amber-500">
🚧 OH NO - We don&apos;t have any FAQ yet. 🚧
</span>{" "}
{"->"}{" "}
<a href="https://github.com/gardencmp/jazz/issues/187">
Complain on GitHub
</a>
</p>
<div className="xl:-mr-[calc(50vw-40rem)]">
<h1>API Reference</h1>
<h1 id="faq">FAQ</h1>
<p>
<span className="text-amber-500">
🚧 OH NO - These docs are still highly
work-in-progress. 🚧
🚧 OH NO - We don&apos;t have any FAQ yet. 🚧
</span>{" "}
{"->"}{" "}
<a href="https://github.com/gardencmp/jazz/issues/188">
<a href="https://github.com/gardencmp/jazz/issues/187">
Complain on GitHub
</a>
</p>
</Prose>
<div className="xl:-mr-[calc(50vw-40rem)]">
<Prose>
<h1>API Reference</h1>
<p>
<span className="text-amber-500">
🚧 OH NO - These docs are still highly
work-in-progress. 🚧
</span>{" "}
{"->"}{" "}
<a href="https://github.com/gardencmp/jazz/issues/188">
Complain on GitHub
</a>
</p>
</Prose>
<div className="text-stone-800 dark:text-stone-200">
<PackageDocs package="jazz-tools" />
<PackageDocs package="jazz-react" />
<PackageDocs package="jazz-browser" />
<PackageDocs package="jazz-browser-media-images" />
<PackageDocs package="jazz-nodejs" />
</div>
</div>
</div>
</>

View File

@@ -394,12 +394,12 @@ body {
--shiki-color-text: #606060;
--shiki-color-background: transparent;
--shiki-token-constant: #00a5a5;
--shiki-token-string: #1aa245;
--shiki-token-string: #4e3a2c;
--shiki-token-comment: #aaa;
--shiki-token-keyword: #7b8bff;
--shiki-token-parameter: #ff9800;
--shiki-token-function: #445dd7;
--shiki-token-string-expression: #1aa245;
--shiki-token-string-expression: #38a35f;
--shiki-token-punctuation: #969696;
--shiki-token-link: #1aa245;
}
@@ -407,7 +407,7 @@ body {
.dark body {
--shiki-color-text: #d1d1d1;
--shiki-token-constant: #2dc9c9;
--shiki-token-string: #ffab70;
--shiki-token-string: #feb179;
--shiki-token-comment: #6b737c;
--shiki-token-keyword: #7b8bff;
--shiki-token-parameter: #ff9800;

View File

@@ -101,22 +101,7 @@ export default function RootLayout({
docNav={<DocNav />}
/>
<main className="flex min-h-screen flex-col p-8 max-w-[80rem] w-full [&_*]:scroll-mt-[6rem]">
<article
className={[
"prose lg:prose-lg max-w-none prose-stone dark:prose-invert",
"prose-headings:font-display",
"prose-h1:text-5xl lg:prose-h1:text-6xl prose-h1:font-medium prose-h1:tracking-tighter",
"prose-h2:text-2xl lg:prose-h2:text-3xl prose-h2:font-medium prose-h2:tracking-tight",
"prose-p:max-w-3xl prose-p:leading-snug",
"prose-strong:font-medium",
"prose-code:font-normal prose-code:leading-tight prose-code:before:content-none prose-code:after:content-none prose-code:bg-stone-100 prose-code:dark:bg-stone-900 prose-code:p-1 prose-code:-my-1 prose-code:rounded",
"prose-pre:max-w-3xl prose-pre:text-[0.8em] prose-pre:leading-[1.3] prose-pre:-mt-4 prose-pre:my-4 prose-pre:px-3 prose-pre:py-2 md:prose-pre:-mx-3 prose-pre:bg-stone-100 dark:prose-pre:bg-stone-900",
"prose-inner-code:font-normal prose-inner-code:text-[1em]",
].join(" ")}
>
{children}
</article>
{children}
</main>
<footer className="flex z-10 mt-10 min-h-[15rem] -mb-20 bg-stone-100 dark:bg-stone-900 text-stone-600 dark:text-stone-400 w-full justify-center">
<div className="p-8 max-w-[80rem] w-full grid grid-cols-3 md:grid-cols-4 lg:grid-cols-7 gap-8 max-sm:mb-12">

View File

@@ -4,6 +4,7 @@ import {
GridCard,
GridItem,
ComingSoonBadge,
Prose,
} from "@/components/forMdx";
export const metadata = {
@@ -13,6 +14,8 @@ export const metadata = {
<div className="md:pt-20" />
<Prose>
# Sync & Storage Mesh
<Slogan>The first Collaboration Delivery Network.</Slogan>
@@ -251,3 +254,5 @@ Costs:
</div>
</GridCard>
</Grid>
</Prose>

View File

@@ -7,8 +7,9 @@ import {
MultiplayerIcon,
ResponsiveIframe,
ComingSoonBadge,
Prose
} from "@/components/forMdx";
import { JazzLogo } from "@/components/logos";
import { JazzLogo, LocalFirstConfLogo } from "@/components/logos";
import {
WorkflowIcon,
UploadCloudIcon,
@@ -18,12 +19,21 @@ import {
UsersIcon,
FileLock2Icon,
HardDriveDownloadIcon,
KeyRoundIcon
} from "lucide-react";
import { App_tsx, ChatScreen_tsx } from "@/codeSamples/examples/chat/src";
import Link from "next/link";
<div className="md:pt-20" />
<Prose>
<a href="https://app.localfirstconf.com/schedule/conference/every-app-secretly-wants-to-be-local-first" className="-mt-8 md:-mt-20 float-right top-[5rem] right-4 border border-stone-700 dark:border-stone-300 rounded flex gap-3 items-center px-4 py-2 mb-4 rotate-2 md:rotate-6 no-underline hover:scale-105 transition-transform">
<div className="text-sm font-bold uppercase">See you in Berlin<br/>May 30-31!</div>
<LocalFirstConfLogo className="w-24"/>
</a>
# Instant sync.
<Slogan>A new way to build apps with distributed state.</Slogan>
@@ -32,12 +42,12 @@ import Link from "next/link";
<GridFeature icon={<MonitorSmartphoneIcon strokeWidth={1} strokeLinecap="butt" size={40}/>}>Cross-device sync</GridFeature>
<GridFeature icon={<MultiplayerIcon strokeWidth={1} strokeLinecap="butt" size={40}/>}>Real-time multiplayer</GridFeature>
<GridFeature icon={<UsersIcon strokeWidth={1} strokeLinecap="butt" size={40}/>}>Team/social features</GridFeature>
<GridFeature icon={<FileLock2Icon strokeWidth={1} strokeLinecap="butt" size={40}/>}>Precise permissions</GridFeature>
{/* <GridFeature icon={<WorkflowIcon strokeWidth={1} strokeLinecap="butt" size={40}/>}>On-demand granular datafetching</GridFeature> */}
<GridFeature icon={<FileLock2Icon strokeWidth={1} strokeLinecap="butt" size={40}/>}>Built-in permissions</GridFeature>
<GridFeature icon={<UploadCloudIcon strokeWidth={1} strokeLinecap="butt" size={40}/>}>Cloud sync & storage</GridFeature>
<GridFeature icon={<HardDriveDownloadIcon strokeWidth={1} strokeLinecap="butt" size={40}/>}>On-device storage</GridFeature>
<GridFeature icon={<PlaneIcon strokeWidth={1} strokeLinecap="butt" size={40}/>}>Full offline support</GridFeature>
<GridFeature icon={<GaugeIcon strokeWidth={1} strokeLinecap="butt" size={40}/>}>Instant UI updates</GridFeature>
<GridFeature icon={<KeyRoundIcon strokeWidth={1} strokeLinecap="butt" size={40}/>}>E2EE & signatures</GridFeature>
<div className="col-start-1 row-start-1 row-span-2 col-span-2 px-4 md:px-6 text-base">
<h2 className="not-prose text-2xl font-medium tracking-tight mt-3 md:mt-5 mb-6">Hard things are easy now.</h2>
@@ -270,3 +280,5 @@ Jazz Mesh is currently free &mdash; and it's set up as the default sync & storag
- <Link href="https://discord.gg/utDMjHYg42" target="_blank">
Join our Discord
</Link>
</Prose>

View File

@@ -6,7 +6,7 @@ import { PackageIcon } from "lucide-react";
export function DocNav() {
return (
<>
<p className="mt-0 not-prose font-medium">
<p className="mt-0 font-medium">
<DocNavLink href="#guide">Guide</DocNavLink>
</p>
@@ -20,38 +20,38 @@ export function DocNav() {
</DocNavLink>
<ul>
<li>
<DocNavLink href="#intro-to-covalues">
<DocNavLink href="#declaring-covalues">
Declaration
</DocNavLink>
</li>
<li>
<DocNavLink href="#intro-to-covalues">
<DocNavLink href="#reading-covalues">
Reading
</DocNavLink>
</li>
<li>
<DocNavLink href="#intro-to-covalues">
<DocNavLink href="#creating-covalues">
Creation
</DocNavLink>
</li>
<li>
<DocNavLink href="#intro-to-covalues">
<DocNavLink href="#editing-and-subscription">
Editing & Subscription
</DocNavLink>
</li>
<li>
<DocNavLink href="#intro-to-covalues">
<DocNavLink href="#persistence">
Persistence
</DocNavLink>
</li>
<li>
<DocNavLink href="#intro-to-covalues">
<DocNavLink href="#remote-sync">
Remote Sync
</DocNavLink>
</li>
<li>
<DocNavLink href="#intro-to-covalues">
Public Sharing
<DocNavLink href="#simple-public-sharing">
Simple Public Sharing
</DocNavLink>
</li>
</ul>
@@ -67,8 +67,13 @@ export function DocNav() {
</DocNavLink>
</li>
<li>
<DocNavLink href="#accounts-and-migrations">
Accounts & Migrations
<DocNavLink href="#auth-accounts-and-migrations">
Auth, Accounts & Migrations
</DocNavLink>
</li>
<li>
<DocNavLink href="#edits-and-time-travel">
Edit Metadata & Time Travel
</DocNavLink>
</li>
<li>
@@ -100,7 +105,7 @@ export async function NavPackage({
return (
<>
<h2 className="text-sm not-prose mt-4 flex gap-1 items-center -mx-4 px-4 pt-4 border-t border-stone-200 dark:border-stone-800 ">
<h2 className="text-sm mt-4 flex gap-1 items-center -mx-4 px-4 pt-4 border-t border-stone-200 dark:border-stone-800 ">
<code className="font-bold">{packageName}</code>{" "}
<PackageIcon size={15} strokeWidth={1.5} />
</h2>
@@ -123,7 +128,7 @@ export async function NavPackage({
<>
<a
key={child.id}
className="inline-block not-prose px-1 m-0.5 bg-stone-200 dark:bg-stone-800 rounded opacity-70 hover:opacity-100 cursor-pointer"
className="text-sm inline-block px-2 m-0.5 text-stone-800 dark:text-stone-200 bg-stone-200 dark:bg-stone-800 rounded opacity-70 hover:opacity-100 cursor-pointer"
href={`#${packageName}/${child.name}`}
>
<code>{child.name}</code>
@@ -150,7 +155,7 @@ export function DocNavLink({
return (
<a
href={href}
className="not-prose hover:text-black dark:hover:text-white"
className="hover:text-black dark:hover:text-white py-1 hover:transition-colors"
>
{children}
</a>

View File

@@ -5,6 +5,7 @@ import {
SignatureReflection,
SomeType,
TypeContext,
TypeParameterReflection,
} from "typedoc";
import {
ClassOrInterface,
@@ -115,13 +116,18 @@ function RenderTypeAlias({
inPackage: string;
child: DeclarationReflection;
}) {
const typeParameters = child.typeParameters?.map(
(tParam) =>
tParam.name +
(tParam.type ? ` extends ${printType(tParam.type)}` : ""),
);
return (
<div className="mt-4">
<h4 className="not-prose" id={inPackage + "/" + child.name}>
<Highlight>{`type ${child.name}`}</Highlight>
</h4>
<p className="not-prose text-sm ml-4">
<Highlight>{`type ${child.name} = ${printType(
<Highlight>{`type ${child.name}${typeParameters?.length && `<${typeParameters?.join(", ")}>`} = ${printType(
child.type,
)}`}</Highlight>
</p>
@@ -144,13 +150,34 @@ function RenderClassOrInterface({
classOrInterface: DeclarationReflection;
}) {
const commentSummary = classOrInterface.comment?.summary;
const typeParamsWithConstraints = printTypeParamsWithConstraints(
classOrInterface.typeParameters,
);
return (
<ClassOrInterface
inPackage={inPackage}
name={classOrInterface.name}
doc={renderSummary(commentSummary)}
isInterface={classOrInterface.kind === ReflectionKind.Interface}
typeParameters={
classOrInterface.typeParameters?.length
? "<" +
classOrInterface.typeParameters
.map((tParam) => tParam.name)
.join(", ") +
">"
: ""
}
>
{typeParamsWithConstraints.length > 0 && (
<div className="text-sm -mt-4">
<Highlight
hide={[0, 1 + typeParamsWithConstraints.length]}
>{`class Thing<\n${typeParamsWithConstraints.join(
",\n",
)}\n]> {}`}</Highlight>
</div>
)}
{classOrInterface.categories?.map((category) => (
<div key={category.title}>
<PropCategory
@@ -186,7 +213,10 @@ function RenderClassOrInterface({
function renderSummary(commentSummary: CommentDisplayPart[] | undefined) {
return commentSummary?.map((part, idx) =>
part.kind === "text" ? (
<span key={idx}>{part.text}</span>
<span key={idx}>{part.text.split("\n").map((line, i, lines) => <>
{line}
{i !== lines.length - 1 && <br />}
</>)}</span>
) : part.kind === "inline-tag" ? (
<code key={idx}>
{part.tag} {part.text}
@@ -222,6 +252,9 @@ function RenderProp({
<FnDecl
key={signature.id}
signature={printSimplePropSignature(prop, klass, signature)}
typeParams={printTypeParamsWithConstraints(
signature.typeParameters,
)}
paramTypes={printParamsWithTypes(signature)}
returnType={printType(signature.type)}
doc={renderSummary(signature.comment?.summary)}
@@ -267,15 +300,7 @@ function printSimpleSignature(
return `${item.name}${
signature.typeParameters?.length
? "<" +
signature.typeParameters
.map(
(tParam) =>
tParam.name +
(tParam.type
? " extends " + printType(tParam.type)
: ""),
)
.join(", ") +
signature.typeParameters.map((tParam) => tParam.name).join(", ") +
">"
: ""
}(${printParams(signature)?.join(", ")})`;
@@ -283,18 +308,23 @@ function printSimpleSignature(
function printParams(signature: SignatureReflection) {
return (
signature.parameters?.map((param) =>
param.name === "__namedParameters" &&
param.type?.type === "reflection"
? "{ " +
param.type.declaration.children
?.map(
(child) =>
child.name + (child.flags.isOptional ? "?" : ""),
)
.join(", ") +
" }"
: param.name + (param.defaultValue ? "?" : ""),
signature.parameters?.flatMap((param) =>
param.name === "this"
? []
: [
param.name === "__namedParameters" &&
param.type?.type === "reflection"
? "{ " +
param.type.declaration.children
?.map(
(child) =>
child.name +
(child.flags.isOptional ? "?" : ""),
)
.join(", ") +
" }"
: param.name + (param.defaultValue ? "?" : ""),
],
) || []
);
}
@@ -311,6 +341,18 @@ function printParamsWithTypes(signature: SignatureReflection) {
);
}
function printTypeParamsWithConstraints(
typeParams: TypeParameterReflection[] | undefined,
): string[] {
return (
typeParams?.flatMap((tParam) =>
tParam.type
? [`${tParam.name} extends ${printType(tParam.type)}`]
: [],
) || []
);
}
function printType(type: SomeType | undefined): string {
if (!type) return "NO TYPE";
if (type.type === "reflection") {

View File

@@ -43,12 +43,14 @@ export async function Highlight({
export function ClassOrInterface({
inPackage,
name,
typeParameters,
children,
doc,
isInterface,
}: {
inPackage: string;
name: string;
typeParameters?: string;
children: ReactNode;
doc: ReactNode;
isInterface?: boolean;
@@ -66,7 +68,9 @@ export function ClassOrInterface({
<h4 className="peer sticky top-0 pt-[0.5rem] md:top-[2.5rem] md:pt-[3rem] bg-stone-50 dark:bg-stone-950 z-20">
<a href={"#" + inPackage + "/" + name}>
<Highlight>
{(isInterface ? "interface " : "class ") + name}
{(isInterface ? "interface " : "class ") +
name +
typeParameters}
</Highlight>
</a>
</h4>
@@ -131,12 +135,14 @@ export function PropDecl({
export function FnDecl({
signature,
typeParams,
paramTypes,
returnType,
doc,
example,
}: {
signature: string;
typeParams: string[];
paramTypes: string[];
returnType: string;
doc: ReactNode;
@@ -150,7 +156,16 @@ export function FnDecl({
<Highlight>{returnType}</Highlight>
</span>
</div>
<div className="ml-4 mt-2 text-xs opacity-75 flex">
<div className="ml-4 mt-2 text-xs opacity-75 flex flex-col gap-2">
{typeParams.length > 0 && (
<div>
<Highlight
hide={[0, 1 + typeParams.length]}
>{`class Thing<\n${typeParams.join(
",\n",
)}\n]> {}`}</Highlight>
</div>
)}
{paramTypes.length > 0 && (
<div>
<Highlight

View File

@@ -1,3 +1,24 @@
export function Prose(props: { children: ReactNode, className?: string }) {
return (
<div
className={[
"max-w-none prose-stone dark:prose-invert",
"prose-headings:font-display",
"prose-h1:text-5xl lg:prose-h1:text-6xl prose-h1:font-medium prose-h1:tracking-tighter",
"prose-h2:text-2xl lg:prose-h2:text-3xl prose-h2:font-medium prose-h2:tracking-tight",
"prose-p:max-w-3xl prose-p:leading-snug",
"prose-strong:font-medium",
"prose-code:font-normal prose-code:leading-tight prose-code:before:content-none prose-code:after:content-none prose-code:bg-stone-100 prose-code:dark:bg-stone-900 prose-code:p-1 prose-code:rounded",
"prose-pre:text-black dark:prose-pre:text-white prose-pre:max-w-3xl prose-pre:text-[0.8em] prose-pre:leading-[1.3] prose-pre:-mt-2 prose-pre:my-4 prose-pre:px-10 prose-pre:py-2 prose-pre:-mx-10 prose-pre:bg-transparent",
"[&_pre_.line]:relative [&_pre_.line]:min-h-[1.3em] [&_pre_.lineNo]:text-[0.75em] [&_pre_.lineNo]:text-stone-300 [&_pre_.lineNo]:dark:text-stone-700 [&_pre_.lineNo]:absolute [&_pre_.lineNo]:text-right [&_pre_.lineNo]:w-8 [&_pre_.lineNo]:-left-10 [&_pre_.lineNo]:top-[0.3em] [&_pre_.lineNo]:select-none",
props.className || "prose lg:prose-lg"
].join(" ")}
>
{props.children}
</div>
);
}
export function Slogan(props: { children: ReactNode; small?: boolean }) {
return (
<div

File diff suppressed because one or more lines are too long

View File

@@ -41,21 +41,31 @@ function highlightPlugin() {
"css-variables",
);
// match a meta tag like `subtle=0,1,2,3` and parse out the line numbers
const subtleTag = node.meta && node.meta.match(/subtle=\S+/);
const subtle =
subtleTag && subtleTag[0].split("=")[1].split(",").map(Number);
let lineNo = -1;
node.type = "html";
node.value = `<pre><code class="not-prose">${lines
.map((line, lineI) =>
line
.map(
(token) =>
`<span style="color: ${token.color};${subtle?.includes(lineI + 1) ? "opacity: 0.3;" : ""}">${escape(token.content)}</span>`,
)
.join(""),
)
.map((line) => {
const isSubduedLine = line.some((token) =>
token.content.includes("// old"),
);
const isBinnedLine = line.some((token) =>
token.content.includes("// *bin*"),
);
if (!isBinnedLine) {
lineNo++;
}
return (
`<span class="line" style="${isBinnedLine ? "opacity: 0.3; text-decoration: line-through; user-select: none" : ""}"><div class="lineNo" style="${isSubduedLine ? "opacity: 0.3;" : ""}${isBinnedLine ? "color: red;" : ""}">${node.lang === "bash" ? ">" : isBinnedLine ? "✕" : (lineNo + 1)}</div>` +
line
.map(
(token) =>
`<span style="color: ${isBinnedLine ? "red" : token.color};${isSubduedLine ? "opacity: 0.3;" : ""}">${escape(token.content.replace("// old", "").replace("// *bin*", ""))}</span>`,
)
.join("") +
"</span>"
);
})
.join("\n")}</code></pre>`;
node.children = [];
return SKIP;

View File

@@ -95,9 +95,6 @@ const config: Config = {
plugins: [
tailwindCSSAnimate,
typography(),
typography({
className: "prose-inner",
}),
],
};
export default config;

View File

@@ -0,0 +1,19 @@
Copyright 2024, Garden Computing, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,19 @@
Copyright 2024, Garden Computing, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,19 @@
Copyright 2024, Garden Computing, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,4 +1,4 @@
Copyright 2023, Garden Computing, Inc.
Copyright 2024, Garden Computing, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -0,0 +1,19 @@
Copyright 2024, Garden Computing, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,454 +1,485 @@
# jazz-browser-media-images
## 0.7.8
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.8
- jazz-browser@0.7.8
## 0.7.6
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.6
- jazz-browser@0.7.6
## 0.7.5
### Patch Changes
- Updated dependencies
- jazz-browser@0.7.5
## 0.7.3
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.3
- jazz-browser@0.7.3
## 0.7.1
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.1
- jazz-browser@0.7.1
- Updated dependencies
- jazz-tools@0.7.1
- jazz-browser@0.7.1
## 0.7.0
### Minor Changes
- e299c3e: New simplified API
- e299c3e: New simplified API
### Patch Changes
- 59c18c3: CoMap fix
- c4151fc: Support stricter TS lint rules
- 952982e: Consistent proxy based API
- d2e03ff: Fix variance of ID.\_\_type
- 354bdcd: Even friendlier for subclassing CoMap
- 69ac514: Use effect schema much less
- f0f6f1b: Clean up API more & re-add jazz-nodejs
- 1a44f87: Refactoring
- 627d895: Get rid of Co namespace
- 85d2b62: More subclass-friendly types in CoMap
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [96c494f]
- Updated dependencies [59c18c3]
- Updated dependencies [19f52b7]
- Updated dependencies [8636319]
- Updated dependencies [d8fe2b1]
- Updated dependencies [19004b4]
- Updated dependencies [a78f168]
- Updated dependencies [52675c9]
- Updated dependencies [129e2c1]
- Updated dependencies [1cfa279]
- Updated dependencies [704af7d]
- Updated dependencies [460478f]
- Updated dependencies [6b0418f]
- Updated dependencies [e299c3e]
- Updated dependencies [ed5643a]
- Updated dependencies [bde684f]
- Updated dependencies [c4151fc]
- Updated dependencies [63374cc]
- Updated dependencies [01ac646]
- Updated dependencies [a5e68a4]
- Updated dependencies [daee49c]
- Updated dependencies [952982e]
- Updated dependencies [1a35307]
- Updated dependencies [5fa277c]
- Updated dependencies [60d5ca2]
- Updated dependencies [21771c4]
- Updated dependencies [77c2b56]
- Updated dependencies [63374cc]
- Updated dependencies [d2e03ff]
- Updated dependencies [354bdcd]
- Updated dependencies [60d5ca2]
- Updated dependencies [69ac514]
- Updated dependencies [f8a5c46]
- Updated dependencies [f0f6f1b]
- Updated dependencies [e5eed5b]
- Updated dependencies [1a44f87]
- Updated dependencies [627d895]
- Updated dependencies [1200aae]
- Updated dependencies [63374cc]
- Updated dependencies [ece35b3]
- Updated dependencies [38d4410]
- Updated dependencies [85d2b62]
- Updated dependencies [fd86c11]
- Updated dependencies [52675c9]
- jazz-tools@0.7.0
- jazz-browser@0.7.0
- 59c18c3: CoMap fix
- c4151fc: Support stricter TS lint rules
- 952982e: Consistent proxy based API
- d2e03ff: Fix variance of ID.\_\_type
- 354bdcd: Even friendlier for subclassing CoMap
- 69ac514: Use effect schema much less
- f0f6f1b: Clean up API more & re-add jazz-nodejs
- 1a44f87: Refactoring
- 627d895: Get rid of Co namespace
- 85d2b62: More subclass-friendly types in CoMap
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [96c494f]
- Updated dependencies [59c18c3]
- Updated dependencies [19f52b7]
- Updated dependencies [8636319]
- Updated dependencies [d8fe2b1]
- Updated dependencies [19004b4]
- Updated dependencies [a78f168]
- Updated dependencies [52675c9]
- Updated dependencies [129e2c1]
- Updated dependencies [1cfa279]
- Updated dependencies [704af7d]
- Updated dependencies [460478f]
- Updated dependencies [6b0418f]
- Updated dependencies [e299c3e]
- Updated dependencies [ed5643a]
- Updated dependencies [bde684f]
- Updated dependencies [c4151fc]
- Updated dependencies [63374cc]
- Updated dependencies [01ac646]
- Updated dependencies [a5e68a4]
- Updated dependencies [daee49c]
- Updated dependencies [952982e]
- Updated dependencies [1a35307]
- Updated dependencies [5fa277c]
- Updated dependencies [60d5ca2]
- Updated dependencies [21771c4]
- Updated dependencies [77c2b56]
- Updated dependencies [63374cc]
- Updated dependencies [d2e03ff]
- Updated dependencies [354bdcd]
- Updated dependencies [60d5ca2]
- Updated dependencies [69ac514]
- Updated dependencies [f8a5c46]
- Updated dependencies [f0f6f1b]
- Updated dependencies [e5eed5b]
- Updated dependencies [1a44f87]
- Updated dependencies [627d895]
- Updated dependencies [1200aae]
- Updated dependencies [63374cc]
- Updated dependencies [ece35b3]
- Updated dependencies [38d4410]
- Updated dependencies [85d2b62]
- Updated dependencies [fd86c11]
- Updated dependencies [52675c9]
- jazz-tools@0.7.0
- jazz-browser@0.7.0
## 0.7.0-alpha.40
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.42
- jazz-browser@0.7.0-alpha.42
- Updated dependencies
- jazz-tools@0.7.0-alpha.42
- jazz-browser@0.7.0-alpha.42
## 0.7.0-alpha.39
### Patch Changes
- jazz-tools@0.7.0-alpha.41
- jazz-browser@0.7.0-alpha.41
- jazz-tools@0.7.0-alpha.41
- jazz-browser@0.7.0-alpha.41
## 0.7.0-alpha.38
### Patch Changes
- jazz-browser@0.7.0-alpha.39
- jazz-tools@0.7.0-alpha.39
- jazz-browser@0.7.0-alpha.39
- jazz-tools@0.7.0-alpha.39
## 0.7.0-alpha.37
### Patch Changes
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.38
- jazz-browser@0.7.0-alpha.38
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.38
- jazz-browser@0.7.0-alpha.38
## 0.7.0-alpha.36
### Patch Changes
- Updated dependencies
- jazz-browser@0.7.0-alpha.37
- jazz-tools@0.7.0-alpha.37
- Updated dependencies
- jazz-browser@0.7.0-alpha.37
- jazz-tools@0.7.0-alpha.37
## 0.7.0-alpha.35
### Patch Changes
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [6b0418f]
- Updated dependencies [1a35307]
- jazz-browser@0.7.0-alpha.36
- jazz-tools@0.7.0-alpha.36
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [6b0418f]
- Updated dependencies [1a35307]
- jazz-browser@0.7.0-alpha.36
- jazz-tools@0.7.0-alpha.36
## 0.7.0-alpha.34
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.35
- jazz-browser@0.7.0-alpha.35
- Updated dependencies
- jazz-tools@0.7.0-alpha.35
- jazz-browser@0.7.0-alpha.35
## 0.7.0-alpha.33
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.34
- jazz-browser@0.7.0-alpha.34
- Updated dependencies
- jazz-tools@0.7.0-alpha.34
- jazz-browser@0.7.0-alpha.34
## 0.7.0-alpha.32
### Patch Changes
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.32
- jazz-browser@0.7.0-alpha.32
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.32
- jazz-browser@0.7.0-alpha.32
## 0.7.0-alpha.31
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.31
- jazz-browser@0.7.0-alpha.31
- Updated dependencies
- jazz-tools@0.7.0-alpha.31
- jazz-browser@0.7.0-alpha.31
## 0.7.0-alpha.30
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.30
- jazz-browser@0.7.0-alpha.30
- Updated dependencies
- jazz-tools@0.7.0-alpha.30
- jazz-browser@0.7.0-alpha.30
## 0.7.0-alpha.29
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.29
- jazz-browser@0.7.0-alpha.29
- Updated dependencies
- jazz-tools@0.7.0-alpha.29
- jazz-browser@0.7.0-alpha.29
## 0.7.0-alpha.28
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.28
- jazz-browser@0.7.0-alpha.28
- Updated dependencies
- jazz-tools@0.7.0-alpha.28
- jazz-browser@0.7.0-alpha.28
## 0.7.0-alpha.27
### Patch Changes
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.27
- jazz-browser@0.7.0-alpha.27
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.27
- jazz-browser@0.7.0-alpha.27
## 0.7.0-alpha.26
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.26
- jazz-browser@0.7.0-alpha.26
- Updated dependencies
- jazz-tools@0.7.0-alpha.26
- jazz-browser@0.7.0-alpha.26
## 0.7.0-alpha.25
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.25
- jazz-browser@0.7.0-alpha.25
- Updated dependencies
- jazz-tools@0.7.0-alpha.25
- jazz-browser@0.7.0-alpha.25
## 0.7.0-alpha.24
### Patch Changes
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.24
- jazz-browser@0.7.0-alpha.24
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.24
- jazz-browser@0.7.0-alpha.24
## 0.7.0-alpha.23
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.23
- jazz-browser@0.7.0-alpha.23
- Updated dependencies
- jazz-tools@0.7.0-alpha.23
- jazz-browser@0.7.0-alpha.23
## 0.7.0-alpha.22
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.22
- jazz-browser@0.7.0-alpha.22
- Updated dependencies
- jazz-tools@0.7.0-alpha.22
- jazz-browser@0.7.0-alpha.22
## 0.7.0-alpha.21
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.21
- jazz-browser@0.7.0-alpha.21
- Updated dependencies
- jazz-tools@0.7.0-alpha.21
- jazz-browser@0.7.0-alpha.21
## 0.7.0-alpha.20
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.20
- jazz-browser@0.7.0-alpha.20
- Updated dependencies
- jazz-tools@0.7.0-alpha.20
- jazz-browser@0.7.0-alpha.20
## 0.7.0-alpha.19
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.19
- jazz-browser@0.7.0-alpha.19
- Updated dependencies
- jazz-tools@0.7.0-alpha.19
- jazz-browser@0.7.0-alpha.19
## 0.7.0-alpha.18
### Patch Changes
- Updated dependencies
- jazz-browser@0.7.0-alpha.18
- Updated dependencies
- jazz-browser@0.7.0-alpha.18
## 0.7.0-alpha.17
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.17
- jazz-browser@0.7.0-alpha.17
- Updated dependencies
- jazz-tools@0.7.0-alpha.17
- jazz-browser@0.7.0-alpha.17
## 0.7.0-alpha.16
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.16
- jazz-browser@0.7.0-alpha.16
- Updated dependencies
- jazz-tools@0.7.0-alpha.16
- jazz-browser@0.7.0-alpha.16
## 0.7.0-alpha.15
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.15
- jazz-browser@0.7.0-alpha.15
- Updated dependencies
- jazz-tools@0.7.0-alpha.15
- jazz-browser@0.7.0-alpha.15
## 0.7.0-alpha.14
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.14
- jazz-browser@0.7.0-alpha.14
- Updated dependencies
- jazz-tools@0.7.0-alpha.14
- jazz-browser@0.7.0-alpha.14
## 0.7.0-alpha.13
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.13
- jazz-browser@0.7.0-alpha.13
- Updated dependencies
- jazz-tools@0.7.0-alpha.13
- jazz-browser@0.7.0-alpha.13
## 0.7.0-alpha.12
### Patch Changes
- Fix variance of ID.\_\_type
- Updated dependencies
- jazz-browser@0.7.0-alpha.12
- jazz-tools@0.7.0-alpha.12
- Fix variance of ID.\_\_type
- Updated dependencies
- jazz-browser@0.7.0-alpha.12
- jazz-tools@0.7.0-alpha.12
## 0.7.0-alpha.11
### Patch Changes
- Support stricter TS lint rules
- Updated dependencies
- jazz-browser@0.7.0-alpha.11
- jazz-tools@0.7.0-alpha.11
- Support stricter TS lint rules
- Updated dependencies
- jazz-browser@0.7.0-alpha.11
- jazz-tools@0.7.0-alpha.11
## 0.7.0-alpha.10
### Patch Changes
- Clean up API more & re-add jazz-nodejs
- Updated dependencies
- jazz-browser@0.7.0-alpha.10
- jazz-tools@0.7.0-alpha.10
- Clean up API more & re-add jazz-nodejs
- Updated dependencies
- jazz-browser@0.7.0-alpha.10
- jazz-tools@0.7.0-alpha.10
## 0.7.0-alpha.9
### Patch Changes
- Even friendlier for subclassing CoMap
- Updated dependencies
- jazz-browser@0.7.0-alpha.9
- jazz-tools@0.7.0-alpha.9
- Even friendlier for subclassing CoMap
- Updated dependencies
- jazz-browser@0.7.0-alpha.9
- jazz-tools@0.7.0-alpha.9
## 0.7.0-alpha.8
### Patch Changes
- More subclass-friendly types in CoMap
- Updated dependencies
- jazz-browser@0.7.0-alpha.8
- jazz-tools@0.7.0-alpha.8
- More subclass-friendly types in CoMap
- Updated dependencies
- jazz-browser@0.7.0-alpha.8
- jazz-tools@0.7.0-alpha.8
## 0.7.0-alpha.7
### Patch Changes
- Consistent proxy based API
- Updated dependencies
- jazz-browser@0.7.0-alpha.7
- jazz-tools@0.7.0-alpha.7
- Consistent proxy based API
- Updated dependencies
- jazz-browser@0.7.0-alpha.7
- jazz-tools@0.7.0-alpha.7
## 0.7.0-alpha.6
### Patch Changes
- CoMap fix
- Updated dependencies
- jazz-browser@0.7.0-alpha.6
- jazz-tools@0.7.0-alpha.6
- CoMap fix
- Updated dependencies
- jazz-browser@0.7.0-alpha.6
- jazz-tools@0.7.0-alpha.6
## 0.7.0-alpha.5
### Patch Changes
- Refactoring
- Updated dependencies
- jazz-browser@0.7.0-alpha.5
- jazz-tools@0.7.0-alpha.5
- Refactoring
- Updated dependencies
- jazz-browser@0.7.0-alpha.5
- jazz-tools@0.7.0-alpha.5
## 0.7.0-alpha.4
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.4
- jazz-browser@0.7.0-alpha.4
- Updated dependencies
- jazz-tools@0.7.0-alpha.4
- jazz-browser@0.7.0-alpha.4
## 0.7.0-alpha.3
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.3
- jazz-browser@0.7.0-alpha.3
- Updated dependencies
- jazz-tools@0.7.0-alpha.3
- jazz-browser@0.7.0-alpha.3
## 0.7.0-alpha.2
### Patch Changes
- Get rid of Co namespace
- Updated dependencies
- jazz-browser@0.7.0-alpha.2
- jazz-tools@0.7.0-alpha.2
- Get rid of Co namespace
- Updated dependencies
- jazz-browser@0.7.0-alpha.2
- jazz-tools@0.7.0-alpha.2
## 0.7.0-alpha.1
### Patch Changes
- Use effect schema much less
- Updated dependencies
- jazz-browser@0.7.0-alpha.1
- jazz-tools@0.7.0-alpha.1
- Use effect schema much less
- Updated dependencies
- jazz-browser@0.7.0-alpha.1
- jazz-tools@0.7.0-alpha.1
## 0.7.0-alpha.0
### Minor Changes
- New simplified API
- New simplified API
### Patch Changes
- Updated dependencies
- jazz-browser@0.7.0-alpha.0
- jazz-tools@0.7.0-alpha.0
- Updated dependencies
- jazz-browser@0.7.0-alpha.0
- jazz-tools@0.7.0-alpha.0
## 0.6.0
### Minor Changes
- Parametrize BrowserImage for maxWidth
- Parametrize BrowserImage for maxWidth
## 0.5.1
### Patch Changes
- Updated dependencies
- jazz-autosub@0.6.0
- jazz-browser@0.6.0
- cojson@0.6.0
- Updated dependencies
- jazz-autosub@0.6.0
- jazz-browser@0.6.0
- cojson@0.6.0
## 0.5.0
### Minor Changes
- Adding a lot of performance improvements to cojson, add a stresstest for the twit example and make that run smoother in a lot of ways.
- Adding a lot of performance improvements to cojson, add a stresstest for the twit example and make that run smoother in a lot of ways.
### Patch Changes
- Updated dependencies
- jazz-autosub@0.5.0
- jazz-browser@0.5.0
- cojson@0.5.0
- Updated dependencies
- jazz-autosub@0.5.0
- jazz-browser@0.5.0
- cojson@0.5.0

View File

@@ -0,0 +1,19 @@
Copyright 2024, Garden Computing, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-browser-media-images",
"version": "0.7.1",
"version": "0.7.8",
"type": "module",
"main": "dist/index.js",
"types": "src/index.ts",

View File

@@ -1,493 +1,520 @@
# jazz-browser
## 0.7.8
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.8
## 0.7.6
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.6
## 0.7.5
### Patch Changes
- Ability to add seed accounts to DemoAuth
## 0.7.3
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.3
## 0.7.1
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.1
- Updated dependencies
- jazz-tools@0.7.1
## 0.7.0
### Minor Changes
- e299c3e: New simplified API
- e299c3e: New simplified API
### Patch Changes
- 1a35307: WIP working-ish version of LSM storage
- 59c18c3: CoMap fix
- 8636319: Implement deep loading, simplify API
- d8fe2b1: Expose experimental OPFS storage
- c4151fc: Support stricter TS lint rules
- daee49c: Add missing @scure/bip39 dep
- 952982e: Consistent proxy based API
- d2e03ff: Fix variance of ID.\_\_type
- 354bdcd: Even friendlier for subclassing CoMap
- 60d5ca2: Clean up exports
- 69ac514: Use effect schema much less
- f0f6f1b: Clean up API more & re-add jazz-nodejs
- 1a44f87: Refactoring
- 627d895: Get rid of Co namespace
- 85d2b62: More subclass-friendly types in CoMap
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [96c494f]
- Updated dependencies [59c18c3]
- Updated dependencies [19f52b7]
- Updated dependencies [8636319]
- Updated dependencies [d8fe2b1]
- Updated dependencies [19004b4]
- Updated dependencies [a78f168]
- Updated dependencies [1200aae]
- Updated dependencies [52675c9]
- Updated dependencies [129e2c1]
- Updated dependencies [1cfa279]
- Updated dependencies [704af7d]
- Updated dependencies [1a35307]
- Updated dependencies [460478f]
- Updated dependencies [6b0418f]
- Updated dependencies [e299c3e]
- Updated dependencies [ed5643a]
- Updated dependencies [bde684f]
- Updated dependencies [bf0f8ec]
- Updated dependencies [c4151fc]
- Updated dependencies [63374cc]
- Updated dependencies [8636319]
- Updated dependencies [01ac646]
- Updated dependencies [a5e68a4]
- Updated dependencies [952982e]
- Updated dependencies [1a35307]
- Updated dependencies [5fa277c]
- Updated dependencies [60d5ca2]
- Updated dependencies [21771c4]
- Updated dependencies [77c2b56]
- Updated dependencies [63374cc]
- Updated dependencies [d2e03ff]
- Updated dependencies [354bdcd]
- Updated dependencies [60d5ca2]
- Updated dependencies [69ac514]
- Updated dependencies [f8a5c46]
- Updated dependencies [f0f6f1b]
- Updated dependencies [e5eed5b]
- Updated dependencies [1a44f87]
- Updated dependencies [627d895]
- Updated dependencies [1200aae]
- Updated dependencies [63374cc]
- Updated dependencies [ece35b3]
- Updated dependencies [38d4410]
- Updated dependencies [85d2b62]
- Updated dependencies [fd86c11]
- Updated dependencies [52675c9]
- jazz-tools@0.7.0
- cojson@0.7.0
- cojson-storage-indexeddb@0.7.0
- 1a35307: WIP working-ish version of LSM storage
- 59c18c3: CoMap fix
- 8636319: Implement deep loading, simplify API
- d8fe2b1: Expose experimental OPFS storage
- c4151fc: Support stricter TS lint rules
- daee49c: Add missing @scure/bip39 dep
- 952982e: Consistent proxy based API
- d2e03ff: Fix variance of ID.\_\_type
- 354bdcd: Even friendlier for subclassing CoMap
- 60d5ca2: Clean up exports
- 69ac514: Use effect schema much less
- f0f6f1b: Clean up API more & re-add jazz-nodejs
- 1a44f87: Refactoring
- 627d895: Get rid of Co namespace
- 85d2b62: More subclass-friendly types in CoMap
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [96c494f]
- Updated dependencies [59c18c3]
- Updated dependencies [19f52b7]
- Updated dependencies [8636319]
- Updated dependencies [d8fe2b1]
- Updated dependencies [19004b4]
- Updated dependencies [a78f168]
- Updated dependencies [1200aae]
- Updated dependencies [52675c9]
- Updated dependencies [129e2c1]
- Updated dependencies [1cfa279]
- Updated dependencies [704af7d]
- Updated dependencies [1a35307]
- Updated dependencies [460478f]
- Updated dependencies [6b0418f]
- Updated dependencies [e299c3e]
- Updated dependencies [ed5643a]
- Updated dependencies [bde684f]
- Updated dependencies [bf0f8ec]
- Updated dependencies [c4151fc]
- Updated dependencies [63374cc]
- Updated dependencies [8636319]
- Updated dependencies [01ac646]
- Updated dependencies [a5e68a4]
- Updated dependencies [952982e]
- Updated dependencies [1a35307]
- Updated dependencies [5fa277c]
- Updated dependencies [60d5ca2]
- Updated dependencies [21771c4]
- Updated dependencies [77c2b56]
- Updated dependencies [63374cc]
- Updated dependencies [d2e03ff]
- Updated dependencies [354bdcd]
- Updated dependencies [60d5ca2]
- Updated dependencies [69ac514]
- Updated dependencies [f8a5c46]
- Updated dependencies [f0f6f1b]
- Updated dependencies [e5eed5b]
- Updated dependencies [1a44f87]
- Updated dependencies [627d895]
- Updated dependencies [1200aae]
- Updated dependencies [63374cc]
- Updated dependencies [ece35b3]
- Updated dependencies [38d4410]
- Updated dependencies [85d2b62]
- Updated dependencies [fd86c11]
- Updated dependencies [52675c9]
- jazz-tools@0.7.0
- cojson@0.7.0
- cojson-storage-indexeddb@0.7.0
## 0.7.0-alpha.42
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.42
- cojson@0.7.0-alpha.42
- cojson-storage-indexeddb@0.7.0-alpha.42
- Updated dependencies
- jazz-tools@0.7.0-alpha.42
- cojson@0.7.0-alpha.42
- cojson-storage-indexeddb@0.7.0-alpha.42
## 0.7.0-alpha.41
### Patch Changes
- jazz-tools@0.7.0-alpha.41
- jazz-tools@0.7.0-alpha.41
## 0.7.0-alpha.39
### Patch Changes
- Updated dependencies
- cojson@0.7.0-alpha.39
- cojson-storage-indexeddb@0.7.0-alpha.39
- jazz-tools@0.7.0-alpha.39
- Updated dependencies
- cojson@0.7.0-alpha.39
- cojson-storage-indexeddb@0.7.0-alpha.39
- jazz-tools@0.7.0-alpha.39
## 0.7.0-alpha.38
### Patch Changes
- Implement deep loading, simplify API
- Updated dependencies
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.38
- cojson@0.7.0-alpha.38
- cojson-storage-indexeddb@0.7.0-alpha.38
- Implement deep loading, simplify API
- Updated dependencies
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.38
- cojson@0.7.0-alpha.38
- cojson-storage-indexeddb@0.7.0-alpha.38
## 0.7.0-alpha.37
### Patch Changes
- Expose experimental OPFS storage
- Updated dependencies
- cojson@0.7.0-alpha.37
- cojson-storage-indexeddb@0.7.0-alpha.37
- jazz-tools@0.7.0-alpha.37
- Expose experimental OPFS storage
- Updated dependencies
- cojson@0.7.0-alpha.37
- cojson-storage-indexeddb@0.7.0-alpha.37
- jazz-tools@0.7.0-alpha.37
## 0.7.0-alpha.36
### Patch Changes
- 1a35307: WIP working-ish version of LSM storage
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [6b0418f]
- Updated dependencies [1a35307]
- cojson@0.7.0-alpha.36
- jazz-tools@0.7.0-alpha.36
- 1a35307: WIP working-ish version of LSM storage
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [6b0418f]
- Updated dependencies [1a35307]
- cojson@0.7.0-alpha.36
- jazz-tools@0.7.0-alpha.36
## 0.7.0-alpha.35
### Patch Changes
- Updated dependencies
- Updated dependencies
- cojson@0.7.0-alpha.35
- jazz-tools@0.7.0-alpha.35
- cojson-storage-indexeddb@0.7.0-alpha.35
- Updated dependencies
- Updated dependencies
- cojson@0.7.0-alpha.35
- jazz-tools@0.7.0-alpha.35
- cojson-storage-indexeddb@0.7.0-alpha.35
## 0.7.0-alpha.34
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.34
- Updated dependencies
- jazz-tools@0.7.0-alpha.34
## 0.7.0-alpha.32
### Patch Changes
- Clean up exports
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.32
- Clean up exports
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.32
## 0.7.0-alpha.31
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.31
- Updated dependencies
- jazz-tools@0.7.0-alpha.31
## 0.7.0-alpha.30
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.30
- Updated dependencies
- jazz-tools@0.7.0-alpha.30
## 0.7.0-alpha.29
### Patch Changes
- Updated dependencies
- cojson-storage-indexeddb@0.7.0-alpha.29
- jazz-tools@0.7.0-alpha.29
- cojson@0.7.0-alpha.29
- Updated dependencies
- cojson-storage-indexeddb@0.7.0-alpha.29
- jazz-tools@0.7.0-alpha.29
- cojson@0.7.0-alpha.29
## 0.7.0-alpha.28
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.28
- cojson@0.7.0-alpha.28
- cojson-storage-indexeddb@0.7.0-alpha.28
- Updated dependencies
- jazz-tools@0.7.0-alpha.28
- cojson@0.7.0-alpha.28
- cojson-storage-indexeddb@0.7.0-alpha.28
## 0.7.0-alpha.27
### Patch Changes
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.27
- cojson@0.7.0-alpha.27
- cojson-storage-indexeddb@0.7.0-alpha.27
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.27
- cojson@0.7.0-alpha.27
- cojson-storage-indexeddb@0.7.0-alpha.27
## 0.7.0-alpha.26
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.26
- Updated dependencies
- jazz-tools@0.7.0-alpha.26
## 0.7.0-alpha.25
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.25
- Updated dependencies
- jazz-tools@0.7.0-alpha.25
## 0.7.0-alpha.24
### Patch Changes
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.24
- cojson@0.7.0-alpha.24
- cojson-storage-indexeddb@0.7.0-alpha.24
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.24
- cojson@0.7.0-alpha.24
- cojson-storage-indexeddb@0.7.0-alpha.24
## 0.7.0-alpha.23
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.23
- Updated dependencies
- jazz-tools@0.7.0-alpha.23
## 0.7.0-alpha.22
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.22
- Updated dependencies
- jazz-tools@0.7.0-alpha.22
## 0.7.0-alpha.21
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.21
- Updated dependencies
- jazz-tools@0.7.0-alpha.21
## 0.7.0-alpha.20
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.20
- Updated dependencies
- jazz-tools@0.7.0-alpha.20
## 0.7.0-alpha.19
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.19
- Updated dependencies
- jazz-tools@0.7.0-alpha.19
## 0.7.0-alpha.18
### Patch Changes
- Add missing @scure/bip39 dep
- Add missing @scure/bip39 dep
## 0.7.0-alpha.17
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.17
- Updated dependencies
- jazz-tools@0.7.0-alpha.17
## 0.7.0-alpha.16
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.16
- Updated dependencies
- jazz-tools@0.7.0-alpha.16
## 0.7.0-alpha.15
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.15
- Updated dependencies
- jazz-tools@0.7.0-alpha.15
## 0.7.0-alpha.14
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.14
- Updated dependencies
- jazz-tools@0.7.0-alpha.14
## 0.7.0-alpha.13
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.13
- Updated dependencies
- jazz-tools@0.7.0-alpha.13
## 0.7.0-alpha.12
### Patch Changes
- Fix variance of ID.\_\_type
- Updated dependencies
- jazz-tools@0.7.0-alpha.12
- Fix variance of ID.\_\_type
- Updated dependencies
- jazz-tools@0.7.0-alpha.12
## 0.7.0-alpha.11
### Patch Changes
- Support stricter TS lint rules
- Updated dependencies
- cojson-storage-indexeddb@0.7.0-alpha.11
- jazz-tools@0.7.0-alpha.11
- cojson@0.7.0-alpha.11
- Support stricter TS lint rules
- Updated dependencies
- cojson-storage-indexeddb@0.7.0-alpha.11
- jazz-tools@0.7.0-alpha.11
- cojson@0.7.0-alpha.11
## 0.7.0-alpha.10
### Patch Changes
- Clean up API more & re-add jazz-nodejs
- Updated dependencies
- cojson-storage-indexeddb@0.7.0-alpha.10
- jazz-tools@0.7.0-alpha.10
- cojson@0.7.0-alpha.10
- Clean up API more & re-add jazz-nodejs
- Updated dependencies
- cojson-storage-indexeddb@0.7.0-alpha.10
- jazz-tools@0.7.0-alpha.10
- cojson@0.7.0-alpha.10
## 0.7.0-alpha.9
### Patch Changes
- Even friendlier for subclassing CoMap
- Updated dependencies
- jazz-tools@0.7.0-alpha.9
- Even friendlier for subclassing CoMap
- Updated dependencies
- jazz-tools@0.7.0-alpha.9
## 0.7.0-alpha.8
### Patch Changes
- More subclass-friendly types in CoMap
- Updated dependencies
- jazz-tools@0.7.0-alpha.8
- More subclass-friendly types in CoMap
- Updated dependencies
- jazz-tools@0.7.0-alpha.8
## 0.7.0-alpha.7
### Patch Changes
- Consistent proxy based API
- Updated dependencies
- cojson-storage-indexeddb@0.6.4-alpha.4
- jazz-tools@0.7.0-alpha.7
- cojson@0.7.0-alpha.7
- Consistent proxy based API
- Updated dependencies
- cojson-storage-indexeddb@0.6.4-alpha.4
- jazz-tools@0.7.0-alpha.7
- cojson@0.7.0-alpha.7
## 0.7.0-alpha.6
### Patch Changes
- CoMap fix
- Updated dependencies
- jazz-tools@0.7.0-alpha.6
- CoMap fix
- Updated dependencies
- jazz-tools@0.7.0-alpha.6
## 0.7.0-alpha.5
### Patch Changes
- Refactoring
- Updated dependencies
- cojson-storage-indexeddb@0.6.4-alpha.3
- jazz-tools@0.7.0-alpha.5
- cojson@0.7.0-alpha.5
- Refactoring
- Updated dependencies
- cojson-storage-indexeddb@0.6.4-alpha.3
- jazz-tools@0.7.0-alpha.5
- cojson@0.7.0-alpha.5
## 0.7.0-alpha.4
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.4
- Updated dependencies
- jazz-tools@0.7.0-alpha.4
## 0.7.0-alpha.3
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.3
- Updated dependencies
- jazz-tools@0.7.0-alpha.3
## 0.7.0-alpha.2
### Patch Changes
- Get rid of Co namespace
- Updated dependencies
- cojson-storage-indexeddb@0.6.4-alpha.2
- jazz-tools@0.7.0-alpha.2
- Get rid of Co namespace
- Updated dependencies
- cojson-storage-indexeddb@0.6.4-alpha.2
- jazz-tools@0.7.0-alpha.2
## 0.7.0-alpha.1
### Patch Changes
- Use effect schema much less
- Updated dependencies
- cojson-storage-indexeddb@0.6.4-alpha.1
- jazz-tools@0.7.0-alpha.1
- cojson@0.7.0-alpha.1
- Use effect schema much less
- Updated dependencies
- cojson-storage-indexeddb@0.6.4-alpha.1
- jazz-tools@0.7.0-alpha.1
- cojson@0.7.0-alpha.1
## 0.7.0-alpha.0
### Minor Changes
- New simplified API
- New simplified API
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.0
- cojson@0.7.0-alpha.0
- cojson-storage-indexeddb@0.6.4-alpha.0
- Updated dependencies
- jazz-tools@0.7.0-alpha.0
- cojson@0.7.0-alpha.0
- cojson-storage-indexeddb@0.6.4-alpha.0
## 0.6.3
### Patch Changes
- Fix migration changes being lost on loaded account
- Updated dependencies
- cojson@0.6.6
- Fix migration changes being lost on loaded account
- Updated dependencies
- cojson@0.6.6
## 0.6.2
### Patch Changes
- Fix loading of accounts
- Updated dependencies
- cojson@0.6.5
- jazz-autosub@0.6.1
- Fix loading of accounts
- Updated dependencies
- cojson@0.6.5
- jazz-autosub@0.6.1
## 0.6.1
### Patch Changes
- IndexedDB & timer perf improvements
- Updated dependencies
- cojson@0.6.4
- cojson-storage-indexeddb@0.6.1
- IndexedDB & timer perf improvements
- Updated dependencies
- cojson@0.6.4
- cojson-storage-indexeddb@0.6.1
## 0.6.0
### Minor Changes
- Make addMember and removeMember take loaded Accounts instead of just IDs
- Make addMember and removeMember take loaded Accounts instead of just IDs
### Patch Changes
- Updated dependencies
- cojson-storage-indexeddb@0.6.0
- jazz-autosub@0.6.0
- cojson@0.6.0
- Updated dependencies
- cojson-storage-indexeddb@0.6.0
- jazz-autosub@0.6.0
- cojson@0.6.0
## 0.5.1
### Patch Changes
- Allow account migrations to be async
- Updated dependencies
- cojson@0.5.2
- Allow account migrations to be async
- Updated dependencies
- cojson@0.5.2
## 0.5.0
### Minor Changes
- Adding a lot of performance improvements to cojson, add a stresstest for the twit example and make that run smoother in a lot of ways.
- Adding a lot of performance improvements to cojson, add a stresstest for the twit example and make that run smoother in a lot of ways.
### Patch Changes
- Updated dependencies
- cojson-storage-indexeddb@0.5.0
- jazz-autosub@0.5.0
- cojson@0.5.0
- Updated dependencies
- cojson-storage-indexeddb@0.5.0
- jazz-autosub@0.5.0
- cojson@0.5.0

View File

@@ -0,0 +1,19 @@
Copyright 2024, Garden Computing, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-browser",
"version": "0.7.1",
"version": "0.7.8",
"type": "module",
"main": "dist/index.js",
"types": "src/index.ts",

View File

@@ -15,7 +15,27 @@ export class BrowserDemoAuth<Acc extends Account> implements AuthProvider<Acc> {
public accountSchema: CoValueClass<Acc> & typeof Account,
public driver: BrowserDemoAuth.Driver,
public appName: string,
) {}
seedAccounts?: {
[name: string]: {
accountID: ID<Account>;
accountSecret: AgentSecret;
};
},
) {
for (const [name, credentials] of Object.entries(seedAccounts || {})) {
const storageData = JSON.stringify(
credentials satisfies StorageData,
);
if (!(localStorage["demo-auth-existing-users"]?.split(",") as string[] | undefined)?.includes(name)) {
localStorage["demo-auth-existing-users"] = localStorage[
"demo-auth-existing-users"
]
? localStorage["demo-auth-existing-users"] + "," + name
: name;
}
localStorage["demo-auth-existing-users-" + name] = storageData;
}
}
async createOrLoadAccount(
getSessionFor: SessionProvider,

View File

@@ -1,427 +1,448 @@
# jazz-autosub
## 0.7.8
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.8
## 0.7.6
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.6
## 0.7.3
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.3
## 0.7.1
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.1
- Updated dependencies
- jazz-tools@0.7.1
## 0.7.0
### Patch Changes
- 19f52b7: Fixed bug with newRandomSessionID being called before crypto was ready
- 8636319: Implement deep loading, simplify API
- 60d5ca2: Simplify jazz-nodejs
- c4151fc: Support stricter TS lint rules
- d2e03ff: Fix variance of ID.\_\_type
- f0f6f1b: Clean up API more & re-add jazz-nodejs
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [96c494f]
- Updated dependencies [59c18c3]
- Updated dependencies [19f52b7]
- Updated dependencies [8636319]
- Updated dependencies [d8fe2b1]
- Updated dependencies [19004b4]
- Updated dependencies [a78f168]
- Updated dependencies [1200aae]
- Updated dependencies [52675c9]
- Updated dependencies [129e2c1]
- Updated dependencies [1cfa279]
- Updated dependencies [704af7d]
- Updated dependencies [1a35307]
- Updated dependencies [460478f]
- Updated dependencies [6b0418f]
- Updated dependencies [e299c3e]
- Updated dependencies [ed5643a]
- Updated dependencies [bde684f]
- Updated dependencies [bf0f8ec]
- Updated dependencies [c4151fc]
- Updated dependencies [63374cc]
- Updated dependencies [8636319]
- Updated dependencies [01ac646]
- Updated dependencies [a5e68a4]
- Updated dependencies [952982e]
- Updated dependencies [1a35307]
- Updated dependencies [5fa277c]
- Updated dependencies [60d5ca2]
- Updated dependencies [21771c4]
- Updated dependencies [77c2b56]
- Updated dependencies [63374cc]
- Updated dependencies [d2e03ff]
- Updated dependencies [354bdcd]
- Updated dependencies [60d5ca2]
- Updated dependencies [69ac514]
- Updated dependencies [f8a5c46]
- Updated dependencies [f0f6f1b]
- Updated dependencies [e5eed5b]
- Updated dependencies [1a44f87]
- Updated dependencies [627d895]
- Updated dependencies [1200aae]
- Updated dependencies [63374cc]
- Updated dependencies [ece35b3]
- Updated dependencies [38d4410]
- Updated dependencies [85d2b62]
- Updated dependencies [fd86c11]
- Updated dependencies [52675c9]
- Updated dependencies [a423eee]
- jazz-tools@0.7.0
- cojson@0.7.0
- cojson-transport-nodejs-ws@0.7.0
- 19f52b7: Fixed bug with newRandomSessionID being called before crypto was ready
- 8636319: Implement deep loading, simplify API
- 60d5ca2: Simplify jazz-nodejs
- c4151fc: Support stricter TS lint rules
- d2e03ff: Fix variance of ID.\_\_type
- f0f6f1b: Clean up API more & re-add jazz-nodejs
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [96c494f]
- Updated dependencies [59c18c3]
- Updated dependencies [19f52b7]
- Updated dependencies [8636319]
- Updated dependencies [d8fe2b1]
- Updated dependencies [19004b4]
- Updated dependencies [a78f168]
- Updated dependencies [1200aae]
- Updated dependencies [52675c9]
- Updated dependencies [129e2c1]
- Updated dependencies [1cfa279]
- Updated dependencies [704af7d]
- Updated dependencies [1a35307]
- Updated dependencies [460478f]
- Updated dependencies [6b0418f]
- Updated dependencies [e299c3e]
- Updated dependencies [ed5643a]
- Updated dependencies [bde684f]
- Updated dependencies [bf0f8ec]
- Updated dependencies [c4151fc]
- Updated dependencies [63374cc]
- Updated dependencies [8636319]
- Updated dependencies [01ac646]
- Updated dependencies [a5e68a4]
- Updated dependencies [952982e]
- Updated dependencies [1a35307]
- Updated dependencies [5fa277c]
- Updated dependencies [60d5ca2]
- Updated dependencies [21771c4]
- Updated dependencies [77c2b56]
- Updated dependencies [63374cc]
- Updated dependencies [d2e03ff]
- Updated dependencies [354bdcd]
- Updated dependencies [60d5ca2]
- Updated dependencies [69ac514]
- Updated dependencies [f8a5c46]
- Updated dependencies [f0f6f1b]
- Updated dependencies [e5eed5b]
- Updated dependencies [1a44f87]
- Updated dependencies [627d895]
- Updated dependencies [1200aae]
- Updated dependencies [63374cc]
- Updated dependencies [ece35b3]
- Updated dependencies [38d4410]
- Updated dependencies [85d2b62]
- Updated dependencies [fd86c11]
- Updated dependencies [52675c9]
- Updated dependencies [a423eee]
- jazz-tools@0.7.0
- cojson@0.7.0
- cojson-transport-nodejs-ws@0.7.0
## 0.7.0-alpha.42
### Patch Changes
- Fixed bug with newRandomSessionID being called before crypto was ready
- Updated dependencies
- jazz-tools@0.7.0-alpha.42
- cojson@0.7.0-alpha.42
- cojson-transport-nodejs-ws@0.7.0-alpha.42
- Fixed bug with newRandomSessionID being called before crypto was ready
- Updated dependencies
- jazz-tools@0.7.0-alpha.42
- cojson@0.7.0-alpha.42
- cojson-transport-nodejs-ws@0.7.0-alpha.42
## 0.7.0-alpha.41
### Patch Changes
- Updated dependencies
- cojson-transport-nodejs-ws@0.7.0-alpha.41
- jazz-tools@0.7.0-alpha.41
- Updated dependencies
- cojson-transport-nodejs-ws@0.7.0-alpha.41
- jazz-tools@0.7.0-alpha.41
## 0.7.0-alpha.39
### Patch Changes
- Updated dependencies
- cojson@0.7.0-alpha.39
- cojson-transport-nodejs-ws@0.7.0-alpha.39
- jazz-tools@0.7.0-alpha.39
- Updated dependencies
- cojson@0.7.0-alpha.39
- cojson-transport-nodejs-ws@0.7.0-alpha.39
- jazz-tools@0.7.0-alpha.39
## 0.7.0-alpha.38
### Patch Changes
- Implement deep loading, simplify API
- Updated dependencies
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.38
- cojson@0.7.0-alpha.38
- cojson-transport-nodejs-ws@0.7.0-alpha.38
- Implement deep loading, simplify API
- Updated dependencies
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.38
- cojson@0.7.0-alpha.38
- cojson-transport-nodejs-ws@0.7.0-alpha.38
## 0.7.0-alpha.37
### Patch Changes
- Updated dependencies
- cojson@0.7.0-alpha.37
- cojson-transport-nodejs-ws@0.7.0-alpha.37
- jazz-tools@0.7.0-alpha.37
- Updated dependencies
- cojson@0.7.0-alpha.37
- cojson-transport-nodejs-ws@0.7.0-alpha.37
- jazz-tools@0.7.0-alpha.37
## 0.7.0-alpha.36
### Patch Changes
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [6b0418f]
- Updated dependencies [1a35307]
- cojson@0.7.0-alpha.36
- jazz-tools@0.7.0-alpha.36
- cojson-transport-nodejs-ws@0.7.0-alpha.36
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [6b0418f]
- Updated dependencies [1a35307]
- cojson@0.7.0-alpha.36
- jazz-tools@0.7.0-alpha.36
- cojson-transport-nodejs-ws@0.7.0-alpha.36
## 0.7.0-alpha.35
### Patch Changes
- Updated dependencies
- Updated dependencies
- cojson@0.7.0-alpha.35
- jazz-tools@0.7.0-alpha.35
- cojson-transport-nodejs-ws@0.7.0-alpha.35
- Updated dependencies
- Updated dependencies
- cojson@0.7.0-alpha.35
- jazz-tools@0.7.0-alpha.35
- cojson-transport-nodejs-ws@0.7.0-alpha.35
## 0.7.0-alpha.34
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.34
- Updated dependencies
- jazz-tools@0.7.0-alpha.34
## 0.7.0-alpha.32
### Patch Changes
- Simplify jazz-nodejs
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.32
- Simplify jazz-nodejs
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.32
## 0.7.0-alpha.31
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.31
- Updated dependencies
- jazz-tools@0.7.0-alpha.31
## 0.7.0-alpha.30
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.30
- Updated dependencies
- jazz-tools@0.7.0-alpha.30
## 0.7.0-alpha.29
### Patch Changes
- Updated dependencies
- cojson-transport-nodejs-ws@0.7.0-alpha.29
- jazz-tools@0.7.0-alpha.29
- cojson@0.7.0-alpha.29
- Updated dependencies
- cojson-transport-nodejs-ws@0.7.0-alpha.29
- jazz-tools@0.7.0-alpha.29
- cojson@0.7.0-alpha.29
## 0.7.0-alpha.28
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.28
- cojson@0.7.0-alpha.28
- cojson-transport-nodejs-ws@0.7.0-alpha.28
- Updated dependencies
- jazz-tools@0.7.0-alpha.28
- cojson@0.7.0-alpha.28
- cojson-transport-nodejs-ws@0.7.0-alpha.28
## 0.7.0-alpha.27
### Patch Changes
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.27
- cojson@0.7.0-alpha.27
- cojson-transport-nodejs-ws@0.7.0-alpha.27
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.27
- cojson@0.7.0-alpha.27
- cojson-transport-nodejs-ws@0.7.0-alpha.27
## 0.7.0-alpha.26
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.26
- Updated dependencies
- jazz-tools@0.7.0-alpha.26
## 0.7.0-alpha.25
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.25
- Updated dependencies
- jazz-tools@0.7.0-alpha.25
## 0.7.0-alpha.24
### Patch Changes
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.24
- cojson@0.7.0-alpha.24
- cojson-transport-nodejs-ws@0.7.0-alpha.24
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.24
- cojson@0.7.0-alpha.24
- cojson-transport-nodejs-ws@0.7.0-alpha.24
## 0.7.0-alpha.23
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.23
- Updated dependencies
- jazz-tools@0.7.0-alpha.23
## 0.7.0-alpha.22
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.22
- Updated dependencies
- jazz-tools@0.7.0-alpha.22
## 0.7.0-alpha.21
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.21
- Updated dependencies
- jazz-tools@0.7.0-alpha.21
## 0.7.0-alpha.20
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.20
- Updated dependencies
- jazz-tools@0.7.0-alpha.20
## 0.7.0-alpha.19
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.19
- Updated dependencies
- jazz-tools@0.7.0-alpha.19
## 0.7.0-alpha.17
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.17
- Updated dependencies
- jazz-tools@0.7.0-alpha.17
## 0.7.0-alpha.16
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.16
- Updated dependencies
- jazz-tools@0.7.0-alpha.16
## 0.7.0-alpha.15
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.15
- Updated dependencies
- jazz-tools@0.7.0-alpha.15
## 0.7.0-alpha.14
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.14
- Updated dependencies
- jazz-tools@0.7.0-alpha.14
## 0.7.0-alpha.13
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.13
- Updated dependencies
- jazz-tools@0.7.0-alpha.13
## 0.7.0-alpha.12
### Patch Changes
- Fix variance of ID.\_\_type
- Updated dependencies
- jazz-tools@0.7.0-alpha.12
- Fix variance of ID.\_\_type
- Updated dependencies
- jazz-tools@0.7.0-alpha.12
## 0.7.0-alpha.11
### Patch Changes
- Support stricter TS lint rules
- Updated dependencies
- cojson-transport-nodejs-ws@0.7.0-alpha.11
- jazz-tools@0.7.0-alpha.11
- cojson@0.7.0-alpha.11
- Support stricter TS lint rules
- Updated dependencies
- cojson-transport-nodejs-ws@0.7.0-alpha.11
- jazz-tools@0.7.0-alpha.11
- cojson@0.7.0-alpha.11
## 0.7.0-alpha.10
### Patch Changes
- Clean up API more & re-add jazz-nodejs
- Updated dependencies
- cojson-transport-nodejs-ws@0.7.0-alpha.10
- jazz-tools@0.7.0-alpha.10
- cojson@0.7.0-alpha.10
- Clean up API more & re-add jazz-nodejs
- Updated dependencies
- cojson-transport-nodejs-ws@0.7.0-alpha.10
- jazz-tools@0.7.0-alpha.10
- cojson@0.7.0-alpha.10
## 0.6.5-alpha.2
### Patch Changes
- Updated dependencies
- cojson-transport-nodejs-ws@0.5.2-alpha.2
- jazz-tools@0.7.0-alpha.2
- Updated dependencies
- cojson-transport-nodejs-ws@0.5.2-alpha.2
- jazz-tools@0.7.0-alpha.2
## 0.6.5-alpha.1
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.1
- cojson@0.7.0-alpha.1
- cojson-transport-nodejs-ws@0.5.2-alpha.1
- Updated dependencies
- jazz-tools@0.7.0-alpha.1
- cojson@0.7.0-alpha.1
- cojson-transport-nodejs-ws@0.5.2-alpha.1
## 0.6.5-alpha.0
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.0
- cojson@0.7.0-alpha.0
- cojson-transport-nodejs-ws@0.5.2-alpha.0
- Updated dependencies
- jazz-tools@0.7.0-alpha.0
- cojson@0.7.0-alpha.0
- cojson-transport-nodejs-ws@0.5.2-alpha.0
## 0.6.4
### Patch Changes
- Fix migration changes being lost on loaded account
- Updated dependencies
- cojson@0.6.6
- Fix migration changes being lost on loaded account
- Updated dependencies
- cojson@0.6.6
## 0.6.3
### Patch Changes
- IndexedDB & timer perf improvements
- Updated dependencies
- cojson@0.6.4
- IndexedDB & timer perf improvements
- Updated dependencies
- cojson@0.6.4
## 0.6.2
### Patch Changes
- Add peersToLoadFrom for node creation as well
- Updated dependencies
- cojson@0.6.2
- Add peersToLoadFrom for node creation as well
- Updated dependencies
- cojson@0.6.2
## 0.6.1
### Patch Changes
- Fix wrong import from cojson
- Fix wrong import from cojson
## 0.6.0
### Minor Changes
- Make addMember and removeMember take loaded Accounts instead of just IDs
- Make addMember and removeMember take loaded Accounts instead of just IDs
### Patch Changes
- Updated dependencies
- jazz-autosub@0.6.0
- cojson@0.6.0
- cojson-transport-nodejs-ws@0.5.1
- Updated dependencies
- jazz-autosub@0.6.0
- cojson@0.6.0
- cojson-transport-nodejs-ws@0.5.1
## 0.5.3
### Patch Changes
- Allow account migrations to be async
- Updated dependencies
- cojson@0.5.2
- Allow account migrations to be async
- Updated dependencies
- cojson@0.5.2
## 0.5.2
### Patch Changes
- Expose migration for jazz-nodejs
- Expose migration for jazz-nodejs
## 0.5.1
### Patch Changes
- First version of jazz-nodejs
- First version of jazz-nodejs
## 0.5.0
### Minor Changes
- Adding a lot of performance improvements to cojson, add a stresstest for the twit example and make that run smoother in a lot of ways.
- Adding a lot of performance improvements to cojson, add a stresstest for the twit example and make that run smoother in a lot of ways.
### Patch Changes
- Updated dependencies
- cojson@0.5.0
- Updated dependencies
- cojson@0.5.0

View File

@@ -1,4 +1,4 @@
Copyright 2023, Garden Computing, Inc.
Copyright 2024, Garden Computing, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -5,7 +5,7 @@
"types": "src/index.ts",
"type": "module",
"license": "MIT",
"version": "0.7.1",
"version": "0.7.8",
"dependencies": {
"cojson": "workspace:*",
"cojson-transport-nodejs-ws": "workspace:*",

View File

@@ -1,528 +1,578 @@
# jazz-react
## 0.7.8
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.8
- jazz-browser@0.7.8
## 0.7.7
### Patch Changes
- 9fdc91c: Improve compatibility with React compiler and concurrent features
## 0.7.6
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.6
- jazz-browser@0.7.6
## 0.7.5
### Patch Changes
- Ability to add seed accounts to DemoAuth
- Updated dependencies
- jazz-browser@0.7.5
## 0.7.4
### Patch Changes
- Expose auth loading state in a simple way
## 0.7.3
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.3
- jazz-browser@0.7.3
## 0.7.2
### Patch Changes
- Fix type signature / depth of useCoState
## 0.7.1
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.1
- jazz-browser@0.7.1
- Updated dependencies
- jazz-tools@0.7.1
- jazz-browser@0.7.1
## 0.7.0
### Minor Changes
- e299c3e: New simplified API
- e299c3e: New simplified API
### Patch Changes
- 59c18c3: CoMap fix
- 8636319: Implement deep loading, simplify API
- 1a35307: Use fresh subscribe context for useProgressiveImg
- d8fe2b1: Expose experimental OPFS storage
- 6d49e9b: Fix Provider params
- 704af7d: Add maxWidth option for loading images
- e97f730: Fix useAccount
- 6b0418f: Fix image resolution loading
- c4151fc: Support stricter TS lint rules
- 8636319: Only load each image resolution once
- 952982e: Consistent proxy based API
- d2e03ff: Fix variance of ID.\_\_type
- 354bdcd: Even friendlier for subclassing CoMap
- ece35b3: Fix subscription to account in useAccount
- 60d5ca2: Clean up exports
- 69ac514: Use effect schema much less
- f0f6f1b: Clean up API more & re-add jazz-nodejs
- 1a44f87: Refactoring
- 627d895: Get rid of Co namespace
- 85d2b62: More subclass-friendly types in CoMap
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [96c494f]
- Updated dependencies [59c18c3]
- Updated dependencies [19f52b7]
- Updated dependencies [8636319]
- Updated dependencies [d8fe2b1]
- Updated dependencies [19004b4]
- Updated dependencies [a78f168]
- Updated dependencies [1200aae]
- Updated dependencies [52675c9]
- Updated dependencies [129e2c1]
- Updated dependencies [1cfa279]
- Updated dependencies [704af7d]
- Updated dependencies [1a35307]
- Updated dependencies [460478f]
- Updated dependencies [6b0418f]
- Updated dependencies [e299c3e]
- Updated dependencies [ed5643a]
- Updated dependencies [bde684f]
- Updated dependencies [bf0f8ec]
- Updated dependencies [c4151fc]
- Updated dependencies [63374cc]
- Updated dependencies [8636319]
- Updated dependencies [01ac646]
- Updated dependencies [a5e68a4]
- Updated dependencies [daee49c]
- Updated dependencies [952982e]
- Updated dependencies [1a35307]
- Updated dependencies [5fa277c]
- Updated dependencies [60d5ca2]
- Updated dependencies [21771c4]
- Updated dependencies [77c2b56]
- Updated dependencies [63374cc]
- Updated dependencies [d2e03ff]
- Updated dependencies [354bdcd]
- Updated dependencies [60d5ca2]
- Updated dependencies [69ac514]
- Updated dependencies [f8a5c46]
- Updated dependencies [f0f6f1b]
- Updated dependencies [e5eed5b]
- Updated dependencies [1a44f87]
- Updated dependencies [627d895]
- Updated dependencies [1200aae]
- Updated dependencies [63374cc]
- Updated dependencies [ece35b3]
- Updated dependencies [38d4410]
- Updated dependencies [85d2b62]
- Updated dependencies [fd86c11]
- Updated dependencies [52675c9]
- jazz-tools@0.7.0
- jazz-browser@0.7.0
- cojson@0.7.0
- 59c18c3: CoMap fix
- 8636319: Implement deep loading, simplify API
- 1a35307: Use fresh subscribe context for useProgressiveImg
- d8fe2b1: Expose experimental OPFS storage
- 6d49e9b: Fix Provider params
- 704af7d: Add maxWidth option for loading images
- e97f730: Fix useAccount
- 6b0418f: Fix image resolution loading
- c4151fc: Support stricter TS lint rules
- 8636319: Only load each image resolution once
- 952982e: Consistent proxy based API
- d2e03ff: Fix variance of ID.\_\_type
- 354bdcd: Even friendlier for subclassing CoMap
- ece35b3: Fix subscription to account in useAccount
- 60d5ca2: Clean up exports
- 69ac514: Use effect schema much less
- f0f6f1b: Clean up API more & re-add jazz-nodejs
- 1a44f87: Refactoring
- 627d895: Get rid of Co namespace
- 85d2b62: More subclass-friendly types in CoMap
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [96c494f]
- Updated dependencies [59c18c3]
- Updated dependencies [19f52b7]
- Updated dependencies [8636319]
- Updated dependencies [d8fe2b1]
- Updated dependencies [19004b4]
- Updated dependencies [a78f168]
- Updated dependencies [1200aae]
- Updated dependencies [52675c9]
- Updated dependencies [129e2c1]
- Updated dependencies [1cfa279]
- Updated dependencies [704af7d]
- Updated dependencies [1a35307]
- Updated dependencies [460478f]
- Updated dependencies [6b0418f]
- Updated dependencies [e299c3e]
- Updated dependencies [ed5643a]
- Updated dependencies [bde684f]
- Updated dependencies [bf0f8ec]
- Updated dependencies [c4151fc]
- Updated dependencies [63374cc]
- Updated dependencies [8636319]
- Updated dependencies [01ac646]
- Updated dependencies [a5e68a4]
- Updated dependencies [daee49c]
- Updated dependencies [952982e]
- Updated dependencies [1a35307]
- Updated dependencies [5fa277c]
- Updated dependencies [60d5ca2]
- Updated dependencies [21771c4]
- Updated dependencies [77c2b56]
- Updated dependencies [63374cc]
- Updated dependencies [d2e03ff]
- Updated dependencies [354bdcd]
- Updated dependencies [60d5ca2]
- Updated dependencies [69ac514]
- Updated dependencies [f8a5c46]
- Updated dependencies [f0f6f1b]
- Updated dependencies [e5eed5b]
- Updated dependencies [1a44f87]
- Updated dependencies [627d895]
- Updated dependencies [1200aae]
- Updated dependencies [63374cc]
- Updated dependencies [ece35b3]
- Updated dependencies [38d4410]
- Updated dependencies [85d2b62]
- Updated dependencies [fd86c11]
- Updated dependencies [52675c9]
- jazz-tools@0.7.0
- jazz-browser@0.7.0
- cojson@0.7.0
## 0.7.0-alpha.42
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.42
- cojson@0.7.0-alpha.42
- jazz-browser@0.7.0-alpha.42
- Updated dependencies
- jazz-tools@0.7.0-alpha.42
- cojson@0.7.0-alpha.42
- jazz-browser@0.7.0-alpha.42
## 0.7.0-alpha.41
### Patch Changes
- jazz-tools@0.7.0-alpha.41
- jazz-browser@0.7.0-alpha.41
- jazz-tools@0.7.0-alpha.41
- jazz-browser@0.7.0-alpha.41
## 0.7.0-alpha.40
### Patch Changes
- Fix useAccount
- Fix useAccount
## 0.7.0-alpha.39
### Patch Changes
- Updated dependencies
- cojson@0.7.0-alpha.39
- jazz-browser@0.7.0-alpha.39
- jazz-tools@0.7.0-alpha.39
- Updated dependencies
- cojson@0.7.0-alpha.39
- jazz-browser@0.7.0-alpha.39
- jazz-tools@0.7.0-alpha.39
## 0.7.0-alpha.38
### Patch Changes
- Implement deep loading, simplify API
- Only load each image resolution once
- Updated dependencies
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.38
- jazz-browser@0.7.0-alpha.38
- cojson@0.7.0-alpha.38
- Implement deep loading, simplify API
- Only load each image resolution once
- Updated dependencies
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.38
- jazz-browser@0.7.0-alpha.38
- cojson@0.7.0-alpha.38
## 0.7.0-alpha.37
### Patch Changes
- Expose experimental OPFS storage
- Updated dependencies
- jazz-browser@0.7.0-alpha.37
- cojson@0.7.0-alpha.37
- jazz-tools@0.7.0-alpha.37
- Expose experimental OPFS storage
- Updated dependencies
- jazz-browser@0.7.0-alpha.37
- cojson@0.7.0-alpha.37
- jazz-tools@0.7.0-alpha.37
## 0.7.0-alpha.36
### Patch Changes
- 1a35307: Use fresh subscribe context for useProgressiveImg
- 6b0418f: Fix image resolution loading
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [6b0418f]
- Updated dependencies [1a35307]
- jazz-browser@0.7.0-alpha.36
- cojson@0.7.0-alpha.36
- jazz-tools@0.7.0-alpha.36
- 1a35307: Use fresh subscribe context for useProgressiveImg
- 6b0418f: Fix image resolution loading
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [6b0418f]
- Updated dependencies [1a35307]
- jazz-browser@0.7.0-alpha.36
- cojson@0.7.0-alpha.36
- jazz-tools@0.7.0-alpha.36
## 0.7.0-alpha.35
### Patch Changes
- Updated dependencies
- Updated dependencies
- cojson@0.7.0-alpha.35
- jazz-tools@0.7.0-alpha.35
- jazz-browser@0.7.0-alpha.35
- Updated dependencies
- Updated dependencies
- cojson@0.7.0-alpha.35
- jazz-tools@0.7.0-alpha.35
- jazz-browser@0.7.0-alpha.35
## 0.7.0-alpha.34
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.34
- jazz-browser@0.7.0-alpha.34
- Updated dependencies
- jazz-tools@0.7.0-alpha.34
- jazz-browser@0.7.0-alpha.34
## 0.7.0-alpha.33
### Patch Changes
- Fix Provider params
- Fix Provider params
## 0.7.0-alpha.32
### Patch Changes
- Clean up exports
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.32
- jazz-browser@0.7.0-alpha.32
- Clean up exports
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.32
- jazz-browser@0.7.0-alpha.32
## 0.7.0-alpha.31
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.31
- jazz-browser@0.7.0-alpha.31
- Updated dependencies
- jazz-tools@0.7.0-alpha.31
- jazz-browser@0.7.0-alpha.31
## 0.7.0-alpha.30
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.30
- jazz-browser@0.7.0-alpha.30
- Updated dependencies
- jazz-tools@0.7.0-alpha.30
- jazz-browser@0.7.0-alpha.30
## 0.7.0-alpha.29
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.29
- cojson@0.7.0-alpha.29
- jazz-browser@0.7.0-alpha.29
- Updated dependencies
- jazz-tools@0.7.0-alpha.29
- cojson@0.7.0-alpha.29
- jazz-browser@0.7.0-alpha.29
## 0.7.0-alpha.28
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.28
- cojson@0.7.0-alpha.28
- jazz-browser@0.7.0-alpha.28
- Updated dependencies
- jazz-tools@0.7.0-alpha.28
- cojson@0.7.0-alpha.28
- jazz-browser@0.7.0-alpha.28
## 0.7.0-alpha.27
### Patch Changes
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.27
- cojson@0.7.0-alpha.27
- jazz-browser@0.7.0-alpha.27
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.27
- cojson@0.7.0-alpha.27
- jazz-browser@0.7.0-alpha.27
## 0.7.0-alpha.26
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.26
- jazz-browser@0.7.0-alpha.26
- Updated dependencies
- jazz-tools@0.7.0-alpha.26
- jazz-browser@0.7.0-alpha.26
## 0.7.0-alpha.25
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.25
- jazz-browser@0.7.0-alpha.25
- Updated dependencies
- jazz-tools@0.7.0-alpha.25
- jazz-browser@0.7.0-alpha.25
## 0.7.0-alpha.24
### Patch Changes
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.24
- cojson@0.7.0-alpha.24
- jazz-browser@0.7.0-alpha.24
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.24
- cojson@0.7.0-alpha.24
- jazz-browser@0.7.0-alpha.24
## 0.7.0-alpha.23
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.23
- jazz-browser@0.7.0-alpha.23
- Updated dependencies
- jazz-tools@0.7.0-alpha.23
- jazz-browser@0.7.0-alpha.23
## 0.7.0-alpha.22
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.22
- jazz-browser@0.7.0-alpha.22
- Updated dependencies
- jazz-tools@0.7.0-alpha.22
- jazz-browser@0.7.0-alpha.22
## 0.7.0-alpha.21
### Patch Changes
- Add maxWidth option for loading images
- Updated dependencies
- jazz-tools@0.7.0-alpha.21
- jazz-browser@0.7.0-alpha.21
- Add maxWidth option for loading images
- Updated dependencies
- jazz-tools@0.7.0-alpha.21
- jazz-browser@0.7.0-alpha.21
## 0.7.0-alpha.20
### Patch Changes
- Fix subscription to account in useAccount
- Updated dependencies
- jazz-tools@0.7.0-alpha.20
- jazz-browser@0.7.0-alpha.20
- Fix subscription to account in useAccount
- Updated dependencies
- jazz-tools@0.7.0-alpha.20
- jazz-browser@0.7.0-alpha.20
## 0.7.0-alpha.19
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.19
- jazz-browser@0.7.0-alpha.19
- Updated dependencies
- jazz-tools@0.7.0-alpha.19
- jazz-browser@0.7.0-alpha.19
## 0.7.0-alpha.18
### Patch Changes
- Updated dependencies
- jazz-browser@0.7.0-alpha.18
- Updated dependencies
- jazz-browser@0.7.0-alpha.18
## 0.7.0-alpha.17
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.17
- jazz-browser@0.7.0-alpha.17
- Updated dependencies
- jazz-tools@0.7.0-alpha.17
- jazz-browser@0.7.0-alpha.17
## 0.7.0-alpha.16
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.16
- jazz-browser@0.7.0-alpha.16
- Updated dependencies
- jazz-tools@0.7.0-alpha.16
- jazz-browser@0.7.0-alpha.16
## 0.7.0-alpha.15
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.15
- jazz-browser@0.7.0-alpha.15
- Updated dependencies
- jazz-tools@0.7.0-alpha.15
- jazz-browser@0.7.0-alpha.15
## 0.7.0-alpha.14
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.14
- jazz-browser@0.7.0-alpha.14
- Updated dependencies
- jazz-tools@0.7.0-alpha.14
- jazz-browser@0.7.0-alpha.14
## 0.7.0-alpha.13
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.13
- jazz-browser@0.7.0-alpha.13
- Updated dependencies
- jazz-tools@0.7.0-alpha.13
- jazz-browser@0.7.0-alpha.13
## 0.7.0-alpha.12
### Patch Changes
- Fix variance of ID.\_\_type
- Updated dependencies
- jazz-browser@0.7.0-alpha.12
- jazz-tools@0.7.0-alpha.12
- Fix variance of ID.\_\_type
- Updated dependencies
- jazz-browser@0.7.0-alpha.12
- jazz-tools@0.7.0-alpha.12
## 0.7.0-alpha.11
### Patch Changes
- Support stricter TS lint rules
- Updated dependencies
- jazz-browser@0.7.0-alpha.11
- jazz-tools@0.7.0-alpha.11
- cojson@0.7.0-alpha.11
- Support stricter TS lint rules
- Updated dependencies
- jazz-browser@0.7.0-alpha.11
- jazz-tools@0.7.0-alpha.11
- cojson@0.7.0-alpha.11
## 0.7.0-alpha.10
### Patch Changes
- Clean up API more & re-add jazz-nodejs
- Updated dependencies
- jazz-browser@0.7.0-alpha.10
- jazz-tools@0.7.0-alpha.10
- cojson@0.7.0-alpha.10
- Clean up API more & re-add jazz-nodejs
- Updated dependencies
- jazz-browser@0.7.0-alpha.10
- jazz-tools@0.7.0-alpha.10
- cojson@0.7.0-alpha.10
## 0.7.0-alpha.9
### Patch Changes
- Even friendlier for subclassing CoMap
- Updated dependencies
- jazz-browser@0.7.0-alpha.9
- jazz-tools@0.7.0-alpha.9
- Even friendlier for subclassing CoMap
- Updated dependencies
- jazz-browser@0.7.0-alpha.9
- jazz-tools@0.7.0-alpha.9
## 0.7.0-alpha.8
### Patch Changes
- More subclass-friendly types in CoMap
- Updated dependencies
- jazz-browser@0.7.0-alpha.8
- jazz-tools@0.7.0-alpha.8
- More subclass-friendly types in CoMap
- Updated dependencies
- jazz-browser@0.7.0-alpha.8
- jazz-tools@0.7.0-alpha.8
## 0.7.0-alpha.7
### Patch Changes
- Consistent proxy based API
- Updated dependencies
- jazz-browser@0.7.0-alpha.7
- jazz-tools@0.7.0-alpha.7
- cojson@0.7.0-alpha.7
- Consistent proxy based API
- Updated dependencies
- jazz-browser@0.7.0-alpha.7
- jazz-tools@0.7.0-alpha.7
- cojson@0.7.0-alpha.7
## 0.7.0-alpha.6
### Patch Changes
- CoMap fix
- Updated dependencies
- jazz-browser@0.7.0-alpha.6
- jazz-tools@0.7.0-alpha.6
- CoMap fix
- Updated dependencies
- jazz-browser@0.7.0-alpha.6
- jazz-tools@0.7.0-alpha.6
## 0.7.0-alpha.5
### Patch Changes
- Refactoring
- Updated dependencies
- jazz-browser@0.7.0-alpha.5
- jazz-tools@0.7.0-alpha.5
- cojson@0.7.0-alpha.5
- Refactoring
- Updated dependencies
- jazz-browser@0.7.0-alpha.5
- jazz-tools@0.7.0-alpha.5
- cojson@0.7.0-alpha.5
## 0.7.0-alpha.4
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.4
- jazz-browser@0.7.0-alpha.4
- Updated dependencies
- jazz-tools@0.7.0-alpha.4
- jazz-browser@0.7.0-alpha.4
## 0.7.0-alpha.3
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.3
- jazz-browser@0.7.0-alpha.3
- Updated dependencies
- jazz-tools@0.7.0-alpha.3
- jazz-browser@0.7.0-alpha.3
## 0.7.0-alpha.2
### Patch Changes
- Get rid of Co namespace
- Updated dependencies
- jazz-browser@0.7.0-alpha.2
- jazz-tools@0.7.0-alpha.2
- Get rid of Co namespace
- Updated dependencies
- jazz-browser@0.7.0-alpha.2
- jazz-tools@0.7.0-alpha.2
## 0.7.0-alpha.1
### Patch Changes
- Use effect schema much less
- Updated dependencies
- jazz-browser@0.7.0-alpha.1
- jazz-tools@0.7.0-alpha.1
- cojson@0.7.0-alpha.1
- Use effect schema much less
- Updated dependencies
- jazz-browser@0.7.0-alpha.1
- jazz-tools@0.7.0-alpha.1
- cojson@0.7.0-alpha.1
## 0.7.0-alpha.0
### Minor Changes
- New simplified API
- New simplified API
### Patch Changes
- Updated dependencies
- jazz-browser@0.7.0-alpha.0
- jazz-tools@0.7.0-alpha.0
- cojson@0.7.0-alpha.0
- Updated dependencies
- jazz-browser@0.7.0-alpha.0
- jazz-tools@0.7.0-alpha.0
- cojson@0.7.0-alpha.0
## 0.5.4
### Patch Changes
- Fix migration changes being lost on loaded account
- Updated dependencies
- cojson@0.6.6
- jazz-browser@0.6.3
- Fix migration changes being lost on loaded account
- Updated dependencies
- cojson@0.6.6
- jazz-browser@0.6.3
## 0.5.3
### Patch Changes
- Fix loading of accounts
- Updated dependencies
- cojson@0.6.5
- jazz-browser@0.6.2
- Fix loading of accounts
- Updated dependencies
- cojson@0.6.5
- jazz-browser@0.6.2
## 0.5.2
### Patch Changes
- IndexedDB & timer perf improvements
- Updated dependencies
- cojson@0.6.4
- jazz-browser@0.6.1
- IndexedDB & timer perf improvements
- Updated dependencies
- cojson@0.6.4
- jazz-browser@0.6.1
## 0.5.1
### Patch Changes
- Updated dependencies
- jazz-browser@0.6.0
- cojson@0.6.0
- Updated dependencies
- jazz-browser@0.6.0
- cojson@0.6.0
## 0.5.0
### Minor Changes
- Adding a lot of performance improvements to cojson, add a stresstest for the twit example and make that run smoother in a lot of ways.
- Adding a lot of performance improvements to cojson, add a stresstest for the twit example and make that run smoother in a lot of ways.
### Patch Changes
- Updated dependencies
- jazz-browser@0.5.0
- cojson@0.5.0
- Updated dependencies
- jazz-browser@0.5.0
- cojson@0.5.0

View File

@@ -0,0 +1,19 @@
Copyright 2024, Garden Computing, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react",
"version": "0.7.1",
"version": "0.7.8",
"type": "module",
"main": "dist/index.js",
"types": "src/index.ts",

View File

@@ -1,7 +1,8 @@
import { ReactNode, useMemo, useState } from "react";
import { ReactNode, useEffect, useMemo, useState } from "react";
import { BrowserDemoAuth } from "jazz-browser";
import { Account, CoValueClass } from "jazz-tools";
import { Account, CoValueClass, ID } from "jazz-tools";
import { ReactAuthHook } from "./auth.js";
import { AgentSecret } from "cojson";
/** @category Auth Providers */
export function DemoAuth<Acc extends Account = Account>({
@@ -9,13 +10,15 @@ export function DemoAuth<Acc extends Account = Account>({
appName,
appHostname,
Component = DemoAuth.BasicUI,
seedAccounts
}: {
accountSchema?: CoValueClass<Acc> & typeof Account;
appName: string;
appHostname?: string;
Component?: DemoAuth.Component;
seedAccounts?: {[name: string]: {accountID: ID<Account>, accountSecret: AgentSecret}}
}): ReactAuthHook<Acc> {
return function useLocalAuth() {
return function useLocalAuth(setJazzAuthState) {
const [authState, setAuthState] = useState<
| { state: "loading" }
| {
@@ -29,6 +32,10 @@ export function DemoAuth<Acc extends Account = Account>({
const [logOutCounter, setLogOutCounter] = useState(0);
useEffect(() => {
setJazzAuthState(authState.state);
}, [authState]);
const auth = useMemo(() => {
return new BrowserDemoAuth<Acc>(
accountSchema,
@@ -53,8 +60,9 @@ export function DemoAuth<Acc extends Account = Account>({
},
},
appName,
seedAccounts
);
}, [appName, appHostname, logOutCounter]);
}, [appName, appHostname, logOutCounter, seedAccounts]);
const AuthUI =
authState.state === "ready"

View File

@@ -1,4 +1,4 @@
import { useMemo, useState, ReactNode } from "react";
import { useMemo, useState, ReactNode, useEffect } from "react";
import { BrowserPasskeyAuth } from "jazz-browser";
import { Account, CoValueClass } from "jazz-tools";
import { ReactAuthHook } from "./auth.js";
@@ -15,7 +15,7 @@ export function PasskeyAuth<Acc extends Account>({
appHostname?: string;
Component?: PasskeyAuth.Component;
}): ReactAuthHook<Acc> {
return function useLocalAuth() {
return function useLocalAuth(setJazzAuthState) {
const [authState, setAuthState] = useState<
| { state: "loading" }
| {
@@ -26,6 +26,10 @@ export function PasskeyAuth<Acc extends Account>({
| { state: "signedIn"; logOut: () => void }
>({ state: "loading" });
useEffect(() => {
setJazzAuthState(authState.state);
}, [authState]);
const [logOutCounter, setLogOutCounter] = useState(0);
const auth = useMemo(() => {

View File

@@ -1,4 +1,4 @@
import { useMemo, useState, ReactNode } from "react";
import { useMemo, useState, ReactNode, useEffect } from "react";
import { BrowserPassphraseAuth } from "jazz-browser";
import { generateMnemonic } from "@scure/bip39";
import { cojsonInternals } from "cojson";
@@ -19,7 +19,7 @@ export function PassphraseAuth<Acc extends Account>({
wordlist: string[];
Component?: PassphraseAuth.Component;
}): ReactAuthHook<Acc> {
return function useLocalAuth() {
return function useLocalAuth(setJazzAuthState) {
const [authState, setAuthState] = useState<
| { state: "loading" }
| {
@@ -32,6 +32,10 @@ export function PassphraseAuth<Acc extends Account>({
const [logOutCounter, setLogOutCounter] = useState(0);
useEffect(() => {
setJazzAuthState(authState.state);
}, [authState]);
const auth = useMemo(() => {
return new BrowserPassphraseAuth<Acc>(
accountSchema,

View File

@@ -2,8 +2,12 @@ import React from "react";
import { AuthProvider } from "jazz-browser";
import { Account } from "jazz-tools";
export type AuthState = "loading" | "ready" | "signedIn";
/** @category Auth Providers */
export type ReactAuthHook<Acc extends Account> = () => {
export type ReactAuthHook<Acc extends Account> = (
setJazzAuthState: (state: AuthState) => void,
) => {
auth: AuthProvider<Acc>;
AuthUI: React.ReactNode;
logOut?: () => void;

View File

@@ -1,4 +1,4 @@
import React, { useEffect, useRef, useState } from "react";
import React, { useEffect, useState } from "react";
import {
consumeInviteLinkFromWindowLocation,
createJazzBrowserContext,
@@ -11,12 +11,13 @@ import {
DeeplyLoaded,
DepthsIn,
ID,
subscribeToCoValue,
} from "jazz-tools";
import { ReactAuthHook } from "./auth/auth.js";
import { AuthState, ReactAuthHook } from "./auth/auth.js";
/** @category Context & Hooks */
export function createJazzReactContext<Acc extends Account>({
auth: authHook,
auth: useAuthHook,
peer,
storage = "indexedDB",
}: {
@@ -32,10 +33,16 @@ export function createJazzReactContext<Acc extends Account>({
| undefined
>(undefined);
function Provider({ children }: { children: React.ReactNode }) {
function Provider({
children,
loading,
}: {
children: React.ReactNode;
loading?: React.ReactNode;
}) {
const [me, setMe] = useState<Acc | undefined>();
const { auth, AuthUI, logOut } = authHook();
const [authState, setAuthState] = useState<AuthState>("loading");
const { auth, AuthUI, logOut } = useAuthHook(setAuthState);
useEffect(() => {
let done: (() => void) | undefined = undefined;
@@ -73,7 +80,8 @@ export function createJazzReactContext<Acc extends Account>({
return (
<>
{me && logOut ? (
{authState === "loading" ? loading : null}
{authState === "signedIn" && me && logOut ? (
<JazzContext.Provider
value={{
me,
@@ -82,9 +90,8 @@ export function createJazzReactContext<Acc extends Account>({
>
{children}
</JazzContext.Provider>
) : (
AuthUI
)}
) : null}
{authState === "ready" && AuthUI}
</>
);
}
@@ -114,30 +121,26 @@ export function createJazzReactContext<Acc extends Account>({
};
}
function useCoState<V extends CoValue, D extends DepthsIn<V>>(
function useCoState<V extends CoValue, D>(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Schema: { new (...args: any[]): V } & CoValueClass,
Schema: CoValueClass<V>,
id: ID<V> | undefined,
depth: D = [] as D,
depth: D & DepthsIn<V> = [] as D & DepthsIn<V>,
): DeeplyLoaded<V, D> | undefined {
// for some reason (at least in React 18) - if we use state directly,
// some updates get swallowed/UI doesn't update
const [_, setUpdates] = useState<number>(0);
const state = useRef<DeeplyLoaded<V, D> | undefined>(undefined);
const [state, setState] = useState<{
value: DeeplyLoaded<V, D> | undefined;
}>({ value: undefined });
const me = React.useContext(JazzContext)?.me;
useEffect(() => {
if (!id || !me) return;
return Schema.subscribe(id, me, depth, (update) => {
state.current = update as DeeplyLoaded<V, D>;
setUpdates((u) => {
return u + 1;
});
return subscribeToCoValue(Schema, id, me, depth, (value) => {
setState({ value });
});
}, [Schema, id, me]);
return state.current;
return state.value;
}
function useAcceptInvite<V extends CoValue>({
@@ -180,6 +183,7 @@ export interface JazzReactContext<Acc extends Account> {
/** @category Provider Component */
Provider: React.FC<{
children: React.ReactNode;
loading?: React.ReactNode;
}>;
/** @category Hooks */
@@ -196,11 +200,11 @@ export interface JazzReactContext<Acc extends Account> {
};
/** @category Hooks */
useCoState<V extends CoValue, D extends DepthsIn<V>>(
useCoState<V extends CoValue, D>(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Schema: { new (...args: any[]): V } & CoValueClass,
id: ID<V> | undefined,
depth?: D,
depth?: D & DepthsIn<V>,
): DeeplyLoaded<V, D> | undefined;
/** @category Hooks */

View File

@@ -14,7 +14,7 @@ export function useProgressiveImg({
useEffect(() => {
let lastHighestRes: string | undefined;
if (!image) return;
const unsub = ImageDefinition.subscribe(image, {}, (update) => {
const unsub = image.subscribe({}, (update) => {
const highestRes = update?.highestResAvailable({ maxWidth });
if (highestRes) {
if (highestRes.res !== lastHighestRes) {

View File

@@ -1,398 +1,419 @@
# jazz-autosub
## 0.7.8
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.8
## 0.7.6
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.6
## 0.7.3
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.3
## 0.7.1
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.1
- Updated dependencies
- jazz-tools@0.7.1
## 0.7.0
### Patch Changes
- 5b188ec: Ensure accounts are synced after creation
- fd86c11: Extract jazz cli into jazz-run package
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [96c494f]
- Updated dependencies [59c18c3]
- Updated dependencies [19f52b7]
- Updated dependencies [8636319]
- Updated dependencies [d8fe2b1]
- Updated dependencies [19004b4]
- Updated dependencies [a78f168]
- Updated dependencies [1200aae]
- Updated dependencies [52675c9]
- Updated dependencies [129e2c1]
- Updated dependencies [1cfa279]
- Updated dependencies [704af7d]
- Updated dependencies [1a35307]
- Updated dependencies [460478f]
- Updated dependencies [6b0418f]
- Updated dependencies [e299c3e]
- Updated dependencies [ed5643a]
- Updated dependencies [bde684f]
- Updated dependencies [bf0f8ec]
- Updated dependencies [c4151fc]
- Updated dependencies [63374cc]
- Updated dependencies [8636319]
- Updated dependencies [01ac646]
- Updated dependencies [a5e68a4]
- Updated dependencies [952982e]
- Updated dependencies [1a35307]
- Updated dependencies [5fa277c]
- Updated dependencies [60d5ca2]
- Updated dependencies [21771c4]
- Updated dependencies [77c2b56]
- Updated dependencies [63374cc]
- Updated dependencies [d2e03ff]
- Updated dependencies [354bdcd]
- Updated dependencies [60d5ca2]
- Updated dependencies [69ac514]
- Updated dependencies [f8a5c46]
- Updated dependencies [f0f6f1b]
- Updated dependencies [e5eed5b]
- Updated dependencies [1a44f87]
- Updated dependencies [627d895]
- Updated dependencies [1200aae]
- Updated dependencies [63374cc]
- Updated dependencies [ece35b3]
- Updated dependencies [38d4410]
- Updated dependencies [85d2b62]
- Updated dependencies [fd86c11]
- Updated dependencies [52675c9]
- Updated dependencies [a423eee]
- jazz-tools@0.7.0
- cojson@0.7.0
- cojson-transport-nodejs-ws@0.7.0
- 5b188ec: Ensure accounts are synced after creation
- fd86c11: Extract jazz cli into jazz-run package
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [8636319]
- Updated dependencies [1a35307]
- Updated dependencies [96c494f]
- Updated dependencies [59c18c3]
- Updated dependencies [19f52b7]
- Updated dependencies [8636319]
- Updated dependencies [d8fe2b1]
- Updated dependencies [19004b4]
- Updated dependencies [a78f168]
- Updated dependencies [1200aae]
- Updated dependencies [52675c9]
- Updated dependencies [129e2c1]
- Updated dependencies [1cfa279]
- Updated dependencies [704af7d]
- Updated dependencies [1a35307]
- Updated dependencies [460478f]
- Updated dependencies [6b0418f]
- Updated dependencies [e299c3e]
- Updated dependencies [ed5643a]
- Updated dependencies [bde684f]
- Updated dependencies [bf0f8ec]
- Updated dependencies [c4151fc]
- Updated dependencies [63374cc]
- Updated dependencies [8636319]
- Updated dependencies [01ac646]
- Updated dependencies [a5e68a4]
- Updated dependencies [952982e]
- Updated dependencies [1a35307]
- Updated dependencies [5fa277c]
- Updated dependencies [60d5ca2]
- Updated dependencies [21771c4]
- Updated dependencies [77c2b56]
- Updated dependencies [63374cc]
- Updated dependencies [d2e03ff]
- Updated dependencies [354bdcd]
- Updated dependencies [60d5ca2]
- Updated dependencies [69ac514]
- Updated dependencies [f8a5c46]
- Updated dependencies [f0f6f1b]
- Updated dependencies [e5eed5b]
- Updated dependencies [1a44f87]
- Updated dependencies [627d895]
- Updated dependencies [1200aae]
- Updated dependencies [63374cc]
- Updated dependencies [ece35b3]
- Updated dependencies [38d4410]
- Updated dependencies [85d2b62]
- Updated dependencies [fd86c11]
- Updated dependencies [52675c9]
- Updated dependencies [a423eee]
- jazz-tools@0.7.0
- cojson@0.7.0
- cojson-transport-nodejs-ws@0.7.0
## 0.7.0-alpha.42
### Patch Changes
- Updated dependencies
- jazz-tools@0.7.0-alpha.42
- cojson@0.7.0-alpha.42
- cojson-transport-nodejs-ws@0.7.0-alpha.42
- Updated dependencies
- jazz-tools@0.7.0-alpha.42
- cojson@0.7.0-alpha.42
- cojson-transport-nodejs-ws@0.7.0-alpha.42
## 0.7.0-alpha.41
### Patch Changes
- Updated dependencies
- cojson-transport-nodejs-ws@0.7.0-alpha.41
- jazz-tools@0.7.0-alpha.41
- Updated dependencies
- cojson-transport-nodejs-ws@0.7.0-alpha.41
- jazz-tools@0.7.0-alpha.41
## 0.7.0-alpha.39
### Patch Changes
- Updated dependencies
- cojson@0.7.0-alpha.39
- cojson-transport-nodejs-ws@0.7.0-alpha.39
- jazz-tools@0.7.0-alpha.39
- Updated dependencies
- cojson@0.7.0-alpha.39
- cojson-transport-nodejs-ws@0.7.0-alpha.39
- jazz-tools@0.7.0-alpha.39
## 0.7.0-alpha.38
### Patch Changes
- Updated dependencies
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.38
- cojson@0.7.0-alpha.38
- cojson-transport-nodejs-ws@0.7.0-alpha.38
- Updated dependencies
- Updated dependencies
- Updated dependencies
- Updated dependencies
- jazz-tools@0.7.0-alpha.38
- cojson@0.7.0-alpha.38
- cojson-transport-nodejs-ws@0.7.0-alpha.38
## 0.7.0-alpha.37
### Patch Changes
- Updated dependencies
- cojson@0.7.0-alpha.37
- cojson-transport-nodejs-ws@0.7.0-alpha.37
- jazz-tools@0.7.0-alpha.37
- Updated dependencies
- cojson@0.7.0-alpha.37
- cojson-transport-nodejs-ws@0.7.0-alpha.37
- jazz-tools@0.7.0-alpha.37
## 0.7.0-alpha.36
### Patch Changes
- Ensure accounts are synced after creation
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [6b0418f]
- Updated dependencies [1a35307]
- cojson@0.7.0-alpha.36
- jazz-tools@0.7.0-alpha.36
- cojson-transport-nodejs-ws@0.7.0-alpha.36
- Ensure accounts are synced after creation
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- Updated dependencies [6b0418f]
- Updated dependencies [1a35307]
- cojson@0.7.0-alpha.36
- jazz-tools@0.7.0-alpha.36
- cojson-transport-nodejs-ws@0.7.0-alpha.36
## 0.7.0-alpha.35
### Patch Changes
- Updated dependencies
- Updated dependencies
- cojson@0.7.0-alpha.35
- jazz-tools@0.7.0-alpha.35
- cojson-transport-nodejs-ws@0.7.0-alpha.35
- Updated dependencies
- Updated dependencies
- cojson@0.7.0-alpha.35
- jazz-tools@0.7.0-alpha.35
- cojson-transport-nodejs-ws@0.7.0-alpha.35
## 0.7.0-alpha.34
### Patch Changes
- Extract jazz cli into jazz-run package
- Updated dependencies
- jazz-tools@0.7.0-alpha.34
- Extract jazz cli into jazz-run package
- Updated dependencies
- jazz-tools@0.7.0-alpha.34
## 0.7.0-alpha.32
### Patch Changes
- Introduce jazz-tools CLI
- Clean up exports
- Introduce jazz-tools CLI
- Clean up exports
## 0.7.0-alpha.31
### Patch Changes
- Get rid of self generics, new create syntax
- Get rid of self generics, new create syntax
## 0.7.0-alpha.30
### Patch Changes
- CoValue casting & auto-subbing \_owner
- CoValue casting & auto-subbing \_owner
## 0.7.0-alpha.29
### Patch Changes
- Reintroduce changes from main
- Updated dependencies
- cojson@0.7.0-alpha.29
- Reintroduce changes from main
- Updated dependencies
- cojson@0.7.0-alpha.29
## 0.7.0-alpha.28
### Patch Changes
- Implement profile visibility based on groups & new migration signature
- Updated dependencies
- cojson@0.7.0-alpha.28
- Implement profile visibility based on groups & new migration signature
- Updated dependencies
- cojson@0.7.0-alpha.28
## 0.7.0-alpha.27
### Patch Changes
- Fix CoList.splice / RawCoList.append
- Fix Costream[...].all
- Updated dependencies
- cojson@0.7.0-alpha.27
- Fix CoList.splice / RawCoList.append
- Fix Costream[...].all
- Updated dependencies
- cojson@0.7.0-alpha.27
## 0.7.0-alpha.26
### Patch Changes
- Fix CoMap.Record.toJSON()
- Fix CoMap.Record.toJSON()
## 0.7.0-alpha.25
### Patch Changes
- Make Account -> Profile a lazy ref schema
- Make Account -> Profile a lazy ref schema
## 0.7.0-alpha.24
### Patch Changes
- Relax types of CoMap.\_schema
- Fix schema of Account & Group
- Make sure delete on CoMaps deletes keys
- Updated dependencies
- cojson@0.7.0-alpha.24
- Relax types of CoMap.\_schema
- Fix schema of Account & Group
- Make sure delete on CoMaps deletes keys
- Updated dependencies
- cojson@0.7.0-alpha.24
## 0.7.0-alpha.23
### Patch Changes
- CoMap fixes and improvements
- CoMap fixes and improvements
## 0.7.0-alpha.22
### Patch Changes
- Fix CoMap \_refs for co.items
- Fix CoMap \_refs for co.items
## 0.7.0-alpha.21
### Patch Changes
- Add maxWidth option for loading images
- Add maxWidth option for loading images
## 0.7.0-alpha.20
### Patch Changes
- Make fast-check a direct dependency to help dev time resolution
- Make fast-check a direct dependency to help dev time resolution
## 0.7.0-alpha.19
### Patch Changes
- More precise imports from @effect/schema
- More precise imports from @effect/schema
## 0.7.0-alpha.17
### Patch Changes
- Use effect 3.0
- Use effect 3.0
## 0.7.0-alpha.16
### Patch Changes
- Make CoMaps even more subclassable
- Make CoMaps even more subclassable
## 0.7.0-alpha.15
### Patch Changes
- More superclass-compatible CoMaps
- More superclass-compatible CoMaps
## 0.7.0-alpha.14
### Patch Changes
- Fix CoStream types
- Fix CoStream types
## 0.7.0-alpha.13
### Patch Changes
- Add .all to CoStreamEntry
- Add .all to CoStreamEntry
## 0.7.0-alpha.12
### Patch Changes
- Fix variance of ID.\_\_type
- Fix variance of ID.\_\_type
## 0.7.0-alpha.11
### Patch Changes
- Support stricter TS lint rules
- Updated dependencies
- cojson@0.7.0-alpha.11
- Support stricter TS lint rules
- Updated dependencies
- cojson@0.7.0-alpha.11
## 0.7.0-alpha.10
### Patch Changes
- Clean up API more & re-add jazz-nodejs
- Updated dependencies
- cojson@0.7.0-alpha.10
- Clean up API more & re-add jazz-nodejs
- Updated dependencies
- cojson@0.7.0-alpha.10
## 0.7.0-alpha.9
### Patch Changes
- Even friendlier for subclassing CoMap
- Even friendlier for subclassing CoMap
## 0.7.0-alpha.8
### Patch Changes
- More subclass-friendly types in CoMap
- More subclass-friendly types in CoMap
## 0.7.0-alpha.7
### Patch Changes
- Consistent proxy based API
- Updated dependencies
- cojson@0.7.0-alpha.7
- Consistent proxy based API
- Updated dependencies
- cojson@0.7.0-alpha.7
## 0.7.0-alpha.6
### Patch Changes
- CoMap fix
- CoMap fix
## 0.7.0-alpha.5
### Patch Changes
- Refactoring
- Updated dependencies
- cojson@0.7.0-alpha.5
- Refactoring
- Updated dependencies
- cojson@0.7.0-alpha.5
## 0.7.0-alpha.4
### Patch Changes
- Make refs on list more precise
- Make refs on list more precise
## 0.7.0-alpha.3
### Patch Changes
- Make refs type more precise
- Make refs type more precise
## 0.7.0-alpha.2
### Patch Changes
- Get rid of Co namespace
- Get rid of Co namespace
## 0.7.0-alpha.1
### Patch Changes
- Use effect schema much less
- Updated dependencies
- cojson@0.7.0-alpha.1
- Use effect schema much less
- Updated dependencies
- cojson@0.7.0-alpha.1
## 0.7.0-alpha.0
### Minor Changes
- New simplified API
- New simplified API
### Patch Changes
- Updated dependencies
- cojson@0.7.0-alpha.0
- Updated dependencies
- cojson@0.7.0-alpha.0
## 0.6.1
### Patch Changes
- Fix loading of accounts
- Updated dependencies
- cojson@0.6.5
- Fix loading of accounts
- Updated dependencies
- cojson@0.6.5
## 0.6.0
### Minor Changes
- Make addMember and removeMember take loaded Accounts instead of just IDs
- Make addMember and removeMember take loaded Accounts instead of just IDs
### Patch Changes
- Updated dependencies
- cojson@0.6.0
- Updated dependencies
- cojson@0.6.0
## 0.5.0
### Minor Changes
- Adding a lot of performance improvements to cojson, add a stresstest for the twit example and make that run smoother in a lot of ways.
- Adding a lot of performance improvements to cojson, add a stresstest for the twit example and make that run smoother in a lot of ways.
### Patch Changes
- Updated dependencies
- cojson@0.5.0
- Updated dependencies
- cojson@0.5.0

View File

@@ -1,4 +1,4 @@
Copyright 2023, Garden Computing, Inc.
Copyright 2024, Garden Computing, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -3,7 +3,7 @@
"bin": "./dist/index.js",
"type": "module",
"license": "MIT",
"version": "0.7.1",
"version": "0.7.8",
"scripts": {
"lint": "eslint . --ext ts,tsx",
"format": "prettier --write './src/**/*.{ts,tsx}'",

View File

@@ -1,400 +1,418 @@
# jazz-autosub
## 0.7.8
### Patch Changes
- Fix CoMaps not initialising properly when passing too many init options
## 0.7.6
### Patch Changes
- Provide way to create accounts as another account
## 0.7.3
### Patch Changes
- Clean up loading & subscription API
## 0.7.1
### Patch Changes
- Add runtime option for optional refs
- Add runtime option for optional refs
## 0.7.0
### Minor Changes
- e299c3e: New simplified API
- e299c3e: New simplified API
### Patch Changes
- 8636319: Fix infinite recursion in subscriptionScope
- 8636319: Fix type of init param for CoMap.create
- 1a35307: Implement first devtools formatters
- 96c494f: Implement profile visibility based on groups & new migration signature
- 59c18c3: CoMap fix
- 19f52b7: Fixed bug with newRandomSessionID being called before crypto was ready
- 8636319: Implement deep loading, simplify API
- 19004b4: Add .all to CoStreamEntry
- a78f168: Make Account -> Profile a lazy ref schema
- 52675c9: Fix CoList.splice / RawCoList.append
- 129e2c1: More precise imports from @effect/schema
- 1cfa279: More superclass-compatible CoMaps
- 704af7d: Add maxWidth option for loading images
- 460478f: Use effect 3.0
- 6b0418f: Fix image resolution loading
- ed5643a: Fix CoMap \_refs for co.items
- bde684f: CoValue casting & auto-subbing \_owner
- c4151fc: Support stricter TS lint rules
- 63374cc: Relax types of CoMap.\_schema
- 01ac646: Make CoMaps even more subclassable
- a5e68a4: Make refs type more precise
- 952982e: Consistent proxy based API
- 1a35307: Add ability to declare minimum required data in subscribe & Improve property access tracing
- 5fa277c: Fix CoMap.Record.toJSON()
- 60d5ca2: Introduce jazz-tools CLI
- 21771c4: Reintroduce changes from main
- 77c2b56: Get rid of self generics, new create syntax
- 63374cc: Fix schema of Account & Group
- d2e03ff: Fix variance of ID.\_\_type
- 354bdcd: Even friendlier for subclassing CoMap
- 60d5ca2: Clean up exports
- 69ac514: Use effect schema much less
- f8a5c46: Fix CoStream types
- f0f6f1b: Clean up API more & re-add jazz-nodejs
- e5eed5b: Make refs on list more precise
- 1a44f87: Refactoring
- 627d895: Get rid of Co namespace
- 1200aae: Cache CoValue proxies
- 63374cc: Make sure delete on CoMaps deletes keys
- ece35b3: Make fast-check a direct dependency to help dev time resolution
- 38d4410: CoMap fixes and improvements
- 85d2b62: More subclass-friendly types in CoMap
- fd86c11: Extract jazz cli into jazz-run package
- 52675c9: Fix Costream[...].all
- Updated dependencies [1a35307]
- Updated dependencies [96c494f]
- Updated dependencies [19f52b7]
- Updated dependencies [d8fe2b1]
- Updated dependencies [1200aae]
- Updated dependencies [52675c9]
- Updated dependencies [1a35307]
- Updated dependencies [e299c3e]
- Updated dependencies [bf0f8ec]
- Updated dependencies [c4151fc]
- Updated dependencies [8636319]
- Updated dependencies [952982e]
- Updated dependencies [21771c4]
- Updated dependencies [69ac514]
- Updated dependencies [f0f6f1b]
- Updated dependencies [1a44f87]
- Updated dependencies [627d895]
- Updated dependencies [63374cc]
- Updated dependencies [a423eee]
- cojson@0.7.0
- cojson-transport-nodejs-ws@0.7.0
- 8636319: Fix infinite recursion in subscriptionScope
- 8636319: Fix type of init param for CoMap.create
- 1a35307: Implement first devtools formatters
- 96c494f: Implement profile visibility based on groups & new migration signature
- 59c18c3: CoMap fix
- 19f52b7: Fixed bug with newRandomSessionID being called before crypto was ready
- 8636319: Implement deep loading, simplify API
- 19004b4: Add .all to CoStreamEntry
- a78f168: Make Account -> Profile a lazy ref schema
- 52675c9: Fix CoList.splice / RawCoList.append
- 129e2c1: More precise imports from @effect/schema
- 1cfa279: More superclass-compatible CoMaps
- 704af7d: Add maxWidth option for loading images
- 460478f: Use effect 3.0
- 6b0418f: Fix image resolution loading
- ed5643a: Fix CoMap \_refs for co.items
- bde684f: CoValue casting & auto-subbing \_owner
- c4151fc: Support stricter TS lint rules
- 63374cc: Relax types of CoMap.\_schema
- 01ac646: Make CoMaps even more subclassable
- a5e68a4: Make refs type more precise
- 952982e: Consistent proxy based API
- 1a35307: Add ability to declare minimum required data in subscribe & Improve property access tracing
- 5fa277c: Fix CoMap.Record.toJSON()
- 60d5ca2: Introduce jazz-tools CLI
- 21771c4: Reintroduce changes from main
- 77c2b56: Get rid of self generics, new create syntax
- 63374cc: Fix schema of Account & Group
- d2e03ff: Fix variance of ID.\_\_type
- 354bdcd: Even friendlier for subclassing CoMap
- 60d5ca2: Clean up exports
- 69ac514: Use effect schema much less
- f8a5c46: Fix CoStream types
- f0f6f1b: Clean up API more & re-add jazz-nodejs
- e5eed5b: Make refs on list more precise
- 1a44f87: Refactoring
- 627d895: Get rid of Co namespace
- 1200aae: Cache CoValue proxies
- 63374cc: Make sure delete on CoMaps deletes keys
- ece35b3: Make fast-check a direct dependency to help dev time resolution
- 38d4410: CoMap fixes and improvements
- 85d2b62: More subclass-friendly types in CoMap
- fd86c11: Extract jazz cli into jazz-run package
- 52675c9: Fix Costream[...].all
- Updated dependencies [1a35307]
- Updated dependencies [96c494f]
- Updated dependencies [19f52b7]
- Updated dependencies [d8fe2b1]
- Updated dependencies [1200aae]
- Updated dependencies [52675c9]
- Updated dependencies [1a35307]
- Updated dependencies [e299c3e]
- Updated dependencies [bf0f8ec]
- Updated dependencies [c4151fc]
- Updated dependencies [8636319]
- Updated dependencies [952982e]
- Updated dependencies [21771c4]
- Updated dependencies [69ac514]
- Updated dependencies [f0f6f1b]
- Updated dependencies [1a44f87]
- Updated dependencies [627d895]
- Updated dependencies [63374cc]
- Updated dependencies [a423eee]
- cojson@0.7.0
- cojson-transport-nodejs-ws@0.7.0
## 0.7.0-alpha.42
### Patch Changes
- Fixed bug with newRandomSessionID being called before crypto was ready
- Updated dependencies
- cojson@0.7.0-alpha.42
- cojson-transport-nodejs-ws@0.7.0-alpha.42
- Fixed bug with newRandomSessionID being called before crypto was ready
- Updated dependencies
- cojson@0.7.0-alpha.42
- cojson-transport-nodejs-ws@0.7.0-alpha.42
## 0.7.0-alpha.41
### Patch Changes
- Updated dependencies
- cojson-transport-nodejs-ws@0.7.0-alpha.41
- Updated dependencies
- cojson-transport-nodejs-ws@0.7.0-alpha.41
## 0.7.0-alpha.39
### Patch Changes
- Updated dependencies
- cojson@0.7.0-alpha.39
- cojson-transport-nodejs-ws@0.7.0-alpha.39
- Updated dependencies
- cojson@0.7.0-alpha.39
- cojson-transport-nodejs-ws@0.7.0-alpha.39
## 0.7.0-alpha.38
### Patch Changes
- Fix infinite recursion in subscriptionScope
- Fix type of init param for CoMap.create
- Implement deep loading, simplify API
- Updated dependencies
- cojson@0.7.0-alpha.38
- cojson-transport-nodejs-ws@0.7.0-alpha.38
- Fix infinite recursion in subscriptionScope
- Fix type of init param for CoMap.create
- Implement deep loading, simplify API
- Updated dependencies
- cojson@0.7.0-alpha.38
- cojson-transport-nodejs-ws@0.7.0-alpha.38
## 0.7.0-alpha.37
### Patch Changes
- Updated dependencies
- cojson@0.7.0-alpha.37
- cojson-transport-nodejs-ws@0.7.0-alpha.37
- Updated dependencies
- cojson@0.7.0-alpha.37
- cojson-transport-nodejs-ws@0.7.0-alpha.37
## 0.7.0-alpha.36
### Patch Changes
- 1a35307: Implement first devtools formatters
- 6b0418f: Fix image resolution loading
- 1a35307: Add ability to declare minimum required data in subscribe & Improve property access tracing
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- cojson@0.7.0-alpha.36
- cojson-transport-nodejs-ws@0.7.0-alpha.36
- 1a35307: Implement first devtools formatters
- 6b0418f: Fix image resolution loading
- 1a35307: Add ability to declare minimum required data in subscribe & Improve property access tracing
- Updated dependencies [1a35307]
- Updated dependencies [1a35307]
- cojson@0.7.0-alpha.36
- cojson-transport-nodejs-ws@0.7.0-alpha.36
## 0.7.0-alpha.35
### Patch Changes
- Cache CoValue proxies
- Updated dependencies
- cojson@0.7.0-alpha.35
- cojson-transport-nodejs-ws@0.7.0-alpha.35
- Cache CoValue proxies
- Updated dependencies
- cojson@0.7.0-alpha.35
- cojson-transport-nodejs-ws@0.7.0-alpha.35
## 0.7.0-alpha.34
### Patch Changes
- Extract jazz cli into jazz-run package
- Extract jazz cli into jazz-run package
## 0.7.0-alpha.32
### Patch Changes
- Introduce jazz-tools CLI
- Clean up exports
- Introduce jazz-tools CLI
- Clean up exports
## 0.7.0-alpha.31
### Patch Changes
- Get rid of self generics, new create syntax
- Get rid of self generics, new create syntax
## 0.7.0-alpha.30
### Patch Changes
- CoValue casting & auto-subbing \_owner
- CoValue casting & auto-subbing \_owner
## 0.7.0-alpha.29
### Patch Changes
- Reintroduce changes from main
- Updated dependencies
- cojson@0.7.0-alpha.29
- Reintroduce changes from main
- Updated dependencies
- cojson@0.7.0-alpha.29
## 0.7.0-alpha.28
### Patch Changes
- Implement profile visibility based on groups & new migration signature
- Updated dependencies
- cojson@0.7.0-alpha.28
- Implement profile visibility based on groups & new migration signature
- Updated dependencies
- cojson@0.7.0-alpha.28
## 0.7.0-alpha.27
### Patch Changes
- Fix CoList.splice / RawCoList.append
- Fix Costream[...].all
- Updated dependencies
- cojson@0.7.0-alpha.27
- Fix CoList.splice / RawCoList.append
- Fix Costream[...].all
- Updated dependencies
- cojson@0.7.0-alpha.27
## 0.7.0-alpha.26
### Patch Changes
- Fix CoMap.Record.toJSON()
- Fix CoMap.Record.toJSON()
## 0.7.0-alpha.25
### Patch Changes
- Make Account -> Profile a lazy ref schema
- Make Account -> Profile a lazy ref schema
## 0.7.0-alpha.24
### Patch Changes
- Relax types of CoMap.\_schema
- Fix schema of Account & Group
- Make sure delete on CoMaps deletes keys
- Updated dependencies
- cojson@0.7.0-alpha.24
- Relax types of CoMap.\_schema
- Fix schema of Account & Group
- Make sure delete on CoMaps deletes keys
- Updated dependencies
- cojson@0.7.0-alpha.24
## 0.7.0-alpha.23
### Patch Changes
- CoMap fixes and improvements
- CoMap fixes and improvements
## 0.7.0-alpha.22
### Patch Changes
- Fix CoMap \_refs for co.items
- Fix CoMap \_refs for co.items
## 0.7.0-alpha.21
### Patch Changes
- Add maxWidth option for loading images
- Add maxWidth option for loading images
## 0.7.0-alpha.20
### Patch Changes
- Make fast-check a direct dependency to help dev time resolution
- Make fast-check a direct dependency to help dev time resolution
## 0.7.0-alpha.19
### Patch Changes
- More precise imports from @effect/schema
- More precise imports from @effect/schema
## 0.7.0-alpha.17
### Patch Changes
- Use effect 3.0
- Use effect 3.0
## 0.7.0-alpha.16
### Patch Changes
- Make CoMaps even more subclassable
- Make CoMaps even more subclassable
## 0.7.0-alpha.15
### Patch Changes
- More superclass-compatible CoMaps
- More superclass-compatible CoMaps
## 0.7.0-alpha.14
### Patch Changes
- Fix CoStream types
- Fix CoStream types
## 0.7.0-alpha.13
### Patch Changes
- Add .all to CoStreamEntry
- Add .all to CoStreamEntry
## 0.7.0-alpha.12
### Patch Changes
- Fix variance of ID.\_\_type
- Fix variance of ID.\_\_type
## 0.7.0-alpha.11
### Patch Changes
- Support stricter TS lint rules
- Updated dependencies
- cojson@0.7.0-alpha.11
- Support stricter TS lint rules
- Updated dependencies
- cojson@0.7.0-alpha.11
## 0.7.0-alpha.10
### Patch Changes
- Clean up API more & re-add jazz-nodejs
- Updated dependencies
- cojson@0.7.0-alpha.10
- Clean up API more & re-add jazz-nodejs
- Updated dependencies
- cojson@0.7.0-alpha.10
## 0.7.0-alpha.9
### Patch Changes
- Even friendlier for subclassing CoMap
- Even friendlier for subclassing CoMap
## 0.7.0-alpha.8
### Patch Changes
- More subclass-friendly types in CoMap
- More subclass-friendly types in CoMap
## 0.7.0-alpha.7
### Patch Changes
- Consistent proxy based API
- Updated dependencies
- cojson@0.7.0-alpha.7
- Consistent proxy based API
- Updated dependencies
- cojson@0.7.0-alpha.7
## 0.7.0-alpha.6
### Patch Changes
- CoMap fix
- CoMap fix
## 0.7.0-alpha.5
### Patch Changes
- Refactoring
- Updated dependencies
- cojson@0.7.0-alpha.5
- Refactoring
- Updated dependencies
- cojson@0.7.0-alpha.5
## 0.7.0-alpha.4
### Patch Changes
- Make refs on list more precise
- Make refs on list more precise
## 0.7.0-alpha.3
### Patch Changes
- Make refs type more precise
- Make refs type more precise
## 0.7.0-alpha.2
### Patch Changes
- Get rid of Co namespace
- Get rid of Co namespace
## 0.7.0-alpha.1
### Patch Changes
- Use effect schema much less
- Updated dependencies
- cojson@0.7.0-alpha.1
- Use effect schema much less
- Updated dependencies
- cojson@0.7.0-alpha.1
## 0.7.0-alpha.0
### Minor Changes
- New simplified API
- New simplified API
### Patch Changes
- Updated dependencies
- cojson@0.7.0-alpha.0
- Updated dependencies
- cojson@0.7.0-alpha.0
## 0.6.1
### Patch Changes
- Fix loading of accounts
- Updated dependencies
- cojson@0.6.5
- Fix loading of accounts
- Updated dependencies
- cojson@0.6.5
## 0.6.0
### Minor Changes
- Make addMember and removeMember take loaded Accounts instead of just IDs
- Make addMember and removeMember take loaded Accounts instead of just IDs
### Patch Changes
- Updated dependencies
- cojson@0.6.0
- Updated dependencies
- cojson@0.6.0
## 0.5.0
### Minor Changes
- Adding a lot of performance improvements to cojson, add a stresstest for the twit example and make that run smoother in a lot of ways.
- Adding a lot of performance improvements to cojson, add a stresstest for the twit example and make that run smoother in a lot of ways.
### Patch Changes
- Updated dependencies
- cojson@0.5.0
- Updated dependencies
- cojson@0.5.0

View File

@@ -1,4 +1,4 @@
Copyright 2023, Garden Computing, Inc.
Copyright 2024, Garden Computing, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -5,7 +5,7 @@
"types": "./src/index.ts",
"type": "module",
"license": "MIT",
"version": "0.7.1",
"version": "0.7.8",
"dependencies": {
"@effect/schema": "^0.66.16",
"cojson": "workspace:*",

View File

@@ -1,4 +1,4 @@
import { LocalNode } from "cojson";
import { LocalNode, cojsonInternals } from "cojson";
import type {
AgentSecret,
CoID,
@@ -11,7 +11,7 @@ import type {
RawControlledAccount,
SessionID,
} from "cojson";
import { Context } from "effect";
import { Context, Effect, Stream } from "effect";
import type {
CoMap,
CoValue,
@@ -19,8 +19,10 @@ import type {
Schema,
ID,
RefEncoded,
ClassOf,
RefIfCoValue,
DeeplyLoaded,
DepthsIn,
UnavailableError,
} from "../internal.js";
import {
Group,
@@ -31,13 +33,16 @@ import {
SchemaInit,
inspect,
subscriptionsScopes,
loadCoValue,
loadCoValueEf,
subscribeToCoValue,
subscribeToCoValueEf,
ensureCoValueLoaded,
subscribeToExistingCoValue,
} from "../internal.js";
/** @category Identity & Permissions */
export class Account
extends CoValueBase
implements CoValue<"Account", RawAccount | RawControlledAccount>
{
export class Account extends CoValueBase implements CoValue {
declare id: ID<this>;
declare _type: "Account";
declare _raw: RawAccount | RawControlledAccount;
@@ -52,7 +57,10 @@ export class Account
}
static {
this._schema = {
profile: { ref: () => Profile, optional: false } satisfies Schema,
profile: {
ref: () => Profile,
optional: false,
} satisfies RefEncoded<Profile>,
root: "json" satisfies Schema,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as any;
@@ -151,12 +159,12 @@ export class Account
inviteSecret,
);
return coValueClass.load(valueID, this as Account, []);
return loadCoValue(coValueClass, valueID, this as Account, []);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
}
static async create<A extends Account>(
this: ClassOf<A> & typeof Account,
this: CoValueClass<A> & typeof Account,
options: {
creationProps: { name: string };
initialAgentSecret?: AgentSecret;
@@ -179,7 +187,7 @@ export class Account
}
static async become<A extends Account>(
this: ClassOf<A> & typeof Account,
this: CoValueClass<A> & typeof Account,
options: {
accountID: ID<Account>;
accountSecret: AgentSecret;
@@ -206,7 +214,33 @@ export class Account
return this.fromNode(node) as A;
}
static fromNode<A extends Account>(this: ClassOf<A>, node: LocalNode): A {
static createAs<A extends Account>(
this: CoValueClass<A> & typeof Account,
as: Account,
options: {
creationProps: { name: string };
},
) {
// TODO: is there a cleaner way to do this?
const connectedPeers = cojsonInternals.connectedPeers(
"creatingAccount",
"createdAccount",
{ peer1role: "server", peer2role: "client" },
);
as._raw.core.node.syncManager.addPeer(connectedPeers[1]);
return this.create<A>({
creationProps: options.creationProps,
crypto: as._raw.core.node.crypto,
peersToLoadFrom: [connectedPeers[0]],
});
}
static fromNode<A extends Account>(
this: CoValueClass<A>,
node: LocalNode,
): A {
return new this({
fromRaw: node.account as RawControlledAccount,
}) as A;
@@ -224,7 +258,10 @@ export class Account
return this.toJSON();
}
migrate(creationProps?: { name: string }): void | Promise<void> {
migrate(
this: Account,
creationProps?: { name: string },
): void | Promise<void> {
if (creationProps) {
const profileGroup = Group.create({ owner: this });
profileGroup.addMember("everyone", "reader");
@@ -234,6 +271,62 @@ export class Account
);
}
}
/** @category Subscription & Loading */
static load<A extends Account, Depth>(
this: CoValueClass<A>,
id: ID<A>,
as: Account,
depth: Depth & DepthsIn<A>,
): Promise<DeeplyLoaded<A, Depth> | undefined> {
return loadCoValue(this, id, as, depth);
}
/** @category Subscription & Loading */
static loadEf<A extends Account, Depth>(
this: CoValueClass<A>,
id: ID<A>,
depth: Depth & DepthsIn<A>,
): Effect.Effect<DeeplyLoaded<A, Depth>, UnavailableError, AccountCtx> {
return loadCoValueEf<A, Depth>(this, id, depth);
}
/** @category Subscription & Loading */
static subscribe<A extends Account, Depth>(
this: CoValueClass<A>,
id: ID<A>,
as: Account,
depth: Depth & DepthsIn<A>,
listener: (value: DeeplyLoaded<A, Depth>) => void,
): () => void {
return subscribeToCoValue<A, Depth>(this, id, as, depth, listener);
}
/** @category Subscription & Loading */
static subscribeEf<A extends Account, Depth>(
this: CoValueClass<A>,
id: ID<A>,
depth: Depth & DepthsIn<A>,
): Stream.Stream<DeeplyLoaded<A, Depth>, UnavailableError, AccountCtx> {
return subscribeToCoValueEf<A, Depth>(this, id, depth);
}
/** @category Subscription & Loading */
ensureLoaded<A extends Account, Depth>(
this: A,
depth: Depth & DepthsIn<A>,
): Promise<DeeplyLoaded<A, Depth> | undefined> {
return ensureCoValueLoaded(this, depth);
}
/** @category Subscription & Loading */
subscribe<A extends Account, Depth>(
this: A,
depth: Depth & DepthsIn<A>,
listener: (value: DeeplyLoaded<A, Depth>) => void,
): () => void {
return subscribeToExistingCoValue(this, depth, listener);
}
}
export const AccountAndGroupProxyHandler: ProxyHandler<Account | Group> = {

View File

@@ -6,31 +6,68 @@ import type {
SchemaFor,
ID,
RefEncoded,
ClassOf,
UnCo,
CoValueClass,
DepthsIn,
DeeplyLoaded,
UnavailableError,
AccountCtx,
CoValueFromRaw,
} from "../internal.js";
import {
Account,
CoValueBase,
Group,
InitValues,
ItemsSym,
Ref,
SchemaInit,
co,
ensureCoValueLoaded,
inspect,
isRefEncoded,
loadCoValue,
loadCoValueEf,
makeRefs,
subscribeToCoValue,
subscribeToCoValueEf,
subscribeToExistingCoValue,
} from "../internal.js";
import { encodeSync, decodeSync } from "@effect/schema/Schema";
import { Effect, Stream } from "effect";
/** @category CoValues */
/**
* CoLists are collaborative versions of plain arrays.
*
* * @categoryDescription Content
* You can access items on a `CoList` as if they were normal items on a plain array, using `[]` notation, etc.
*
* Since `CoList` is a subclass of `Array`, you can use all the normal array methods like `push`, `pop`, `splice`, etc.
*
* ```ts
* colorList[0];
* colorList[3] = "yellow";
* colorList.push("Kawazaki Green");
* colorList.splice(1, 1);
* ```
*
* @category CoValues
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export class CoList<Item = any>
extends Array<Item>
implements CoValue<"CoList", RawCoList>
{
export class CoList<Item = any> extends Array<Item> implements CoValue {
/**
* Declare a `CoList` by subclassing `CoList.Of(...)` and passing the item schema using `co`.
*
* @example
* ```ts
* class ColorList extends CoList.Of(
* co.string
* ) {}
* class AnimalList extends CoList.Of(
* co.ref(Animal)
* ) {}
* ```
*
* @category Declaration
*/
static Of<Item>(item: Item): typeof CoList<Item> {
// TODO: cache superclass for item class
return class CoListOf extends CoList<Item> {
@@ -38,36 +75,62 @@ export class CoList<Item = any>
};
}
/** @deprecated Use UPPERCASE `CoList.Of` instead! */
/**
* @ignore
* @deprecated Use UPPERCASE `CoList.Of` instead! */
static of(..._args: never): never {
throw new Error("Can't use Array.of with CoLists");
}
/**
* The ID of this `CoList`
* @category Content */
id!: ID<this>;
/** @category Type Helpers */
_type!: "CoList";
static {
this.prototype._type = "CoList";
}
/** @category Internals */
_raw!: RawCoList;
/** @category Internals */
_instanceID!: string;
/** @internal This is only a marker type and doesn't exist at runtime */
[ItemsSym]!: Item;
/** @internal */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
static _schema: any;
/** @internal */
get _schema(): {
[ItemsSym]: SchemaFor<Item>;
} {
return (this.constructor as typeof CoList)._schema;
}
/** @category Collaboration */
get _owner(): Account | Group {
return this._raw.group instanceof RawAccount
? Account.fromRaw(this._raw.group)
: Group.fromRaw(this._raw.group);
}
/** @category Content */
/**
* If a `CoList`'s items are a `co.ref(...)`, you can use `coList._refs[i]` to access
* the `Ref` instead of the potentially loaded/null value.
*
* This allows you to always get the ID or load the value manually.
*
* @example
* ```ts
* animals._refs[0].id; // => ID<Animal>
* animals._refs[0].value;
* // => Animal | null
* const animal = await animals._refs[0].load();
* ```
*
* @category Content
**/
get _refs(): {
[idx: number]: Exclude<Item, null> extends CoValue
? Ref<UnCo<Exclude<Item, null>>>
@@ -108,17 +171,14 @@ export class CoList<Item = any>
return Account.fromNode(this._raw.core.node);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[InitValues]?: any;
static get [Symbol.species]() {
return Array;
}
constructor(
options:
| { init: Item[]; owner: Account | Group }
| { fromRaw: RawCoList },
| { fromRaw: RawCoList }
| undefined
) {
super();
@@ -127,12 +187,7 @@ export class CoList<Item = any>
enumerable: false,
});
if ("owner" in options) {
this[InitValues] = {
init: options.init,
owner: options.owner,
};
} else if ("fromRaw" in options) {
if (options && "fromRaw" in options) {
Object.defineProperties(this, {
id: {
value: options.fromRaw.id,
@@ -145,17 +200,48 @@ export class CoList<Item = any>
return new Proxy(this, CoListProxyHandler as ProxyHandler<this>);
}
/**
* Create a new CoList with the given initial values and owner.
*
* The owner (a Group or Account) determines access rights to the CoMap.
*
* The CoList will immediately be persisted and synced to connected peers.
*
* @example
* ```ts
* const colours = ColorList.create(
* ["red", "green", "blue"],
* { owner: me }
* );
* const animals = AnimalList.create(
* [cat, dog, fish],
* { owner: me }
* );
* ```
*
* @category Creation
**/
static create<L extends CoList>(
this: ClassOf<L>,
this: CoValueClass<L>,
items: UnCo<L[number]>[],
options: { owner: Account | Group },
) {
return new this({ init: items, owner: options.owner });
const instance = new this({ init: items, owner: options.owner });
const raw = options.owner._raw.createList(
toRawItems(items, instance._schema[ItemsSym]),
);
Object.defineProperties(instance, {
id: {
value: raw.id,
enumerable: false,
},
_raw: { value: raw, enumerable: false },
});
return instance;
}
push(...items: Item[]): number;
/** @private For exact type compatibility with Array superclass */
push(...items: Item[]): number;
push(...items: Item[]): number {
for (const item of toRawItems(
items as Item[],
@@ -167,9 +253,6 @@ export class CoList<Item = any>
return this._raw.entries().length;
}
unshift(...items: Item[]): number;
/** @private For exact type compatibility with Array superclass */
unshift(...items: Item[]): number;
unshift(...items: Item[]): number {
for (const item of toRawItems(
items as Item[],
@@ -240,18 +323,15 @@ export class CoList<Item = any>
return this.toJSON();
}
/** @category Internals */
static fromRaw<V extends CoList>(
this: ClassOf<V> & typeof CoList,
this: CoValueClass<V> & typeof CoList,
raw: RawCoList,
) {
return new this({ fromRaw: raw });
}
static load = CoValueBase.load as CoValueClass["load"];
static loadEf = CoValueBase.loadEf as CoValueClass["loadEf"];
static subscribe = CoValueBase.subscribe as CoValueClass["subscribe"];
static subscribeEf = CoValueBase.subscribeEf as CoValueClass["subscribeEf"];
/** @internal */
static schema<V extends CoList>(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this: { new (...args: any): V } & typeof CoList,
@@ -260,6 +340,143 @@ export class CoList<Item = any>
this._schema ||= {};
Object.assign(this._schema, def);
}
/**
* Load a `CoList` with a given ID, as a given account.
*
* `depth` specifies if item CoValue references should be loaded as well before resolving.
* The `DeeplyLoaded` return type guarantees that corresponding referenced CoValues are loaded to the specified depth.
*
* You can pass `[]` or for shallowly loading only this CoList, or `[itemDepth]` for recursively loading referenced CoValues.
*
* Check out the `load` methods on `CoMap`/`CoList`/`CoStream`/`Group`/`Account` to see which depth structures are valid to nest.
*
* @example
* ```ts
* const animalsWithVets =
* await ListOfAnimals.load(
* "co_zdsMhHtfG6VNKt7RqPUPvUtN2Ax",
* me,
* [{ vet: {} }]
* );
* ```
*
* @category Subscription & Loading
*/
static load<L extends CoList, Depth>(
this: CoValueClass<L>,
id: ID<L>,
as: Account,
depth: Depth & DepthsIn<L>,
): Promise<DeeplyLoaded<L, Depth> | undefined> {
return loadCoValue(this, id, as, depth);
}
/**
* Effectful version of `CoList.load()`.
*
* Needs to be run inside an `AccountCtx` context.
*
* @category Subscription & Loading
*/
static loadEf<L extends CoList, Depth>(
this: CoValueClass<L>,
id: ID<L>,
depth: Depth & DepthsIn<L>,
): Effect.Effect<DeeplyLoaded<L, Depth>, UnavailableError, AccountCtx> {
return loadCoValueEf<L, Depth>(this, id, depth);
}
/**
* Load and subscribe to a `CoList` with a given ID, as a given account.
*
* Automatically also subscribes to updates to all referenced/nested CoValues as soon as they are accessed in the listener.
*
* `depth` specifies if item CoValue references should be loaded as well before calling `listener` for the first time.
* The `DeeplyLoaded` return type guarantees that corresponding referenced CoValues are loaded to the specified depth.
*
* You can pass `[]` or for shallowly loading only this CoList, or `[itemDepth]` for recursively loading referenced CoValues.
*
* Check out the `load` methods on `CoMap`/`CoList`/`CoStream`/`Group`/`Account` to see which depth structures are valid to nest.
*
* Returns an unsubscribe function that you should call when you no longer need updates.
*
* Also see the `useCoState` hook to reactively subscribe to a CoValue in a React component.
*
* @example
* ```ts
* const unsub = ListOfAnimals.subscribe(
* "co_zdsMhHtfG6VNKt7RqPUPvUtN2Ax",
* me,
* { vet: {} },
* (animalsWithVets) => console.log(animalsWithVets)
* );
* ```
*
* @category Subscription & Loading
*/
static subscribe<L extends CoList, Depth>(
this: CoValueClass<L>,
id: ID<L>,
as: Account,
depth: Depth & DepthsIn<L>,
listener: (value: DeeplyLoaded<L, Depth>) => void,
): () => void {
return subscribeToCoValue<L, Depth>(this, id, as, depth, listener);
}
/**
* Effectful version of `CoList.subscribe()` that returns a stream of updates.
*
* Needs to be run inside an `AccountCtx` context.
*
* @category Subscription & Loading
*/
static subscribeEf<L extends CoList, Depth>(
this: CoValueClass<L>,
id: ID<L>,
depth: Depth & DepthsIn<L>,
): Stream.Stream<DeeplyLoaded<L, Depth>, UnavailableError, AccountCtx> {
return subscribeToCoValueEf<L, Depth>(this, id, depth);
}
/**
* Given an already loaded `CoList`, ensure that items are loaded to the specified depth.
*
* Works like `CoList.load()`, but you don't need to pass the ID or the account to load as again.
*
* @category Subscription & Loading
*/
ensureLoaded<L extends CoList, Depth>(
this: L,
depth: Depth & DepthsIn<L>,
): Promise<DeeplyLoaded<L, Depth> | undefined> {
return ensureCoValueLoaded(this, depth);
}
/**
* Given an already loaded `CoList`, subscribe to updates to the `CoList` and ensure that items are loaded to the specified depth.
*
* Works like `CoList.subscribe()`, but you don't need to pass the ID or the account to load as again.
*
* Returns an unsubscribe function that you should call when you no longer need updates.
*
* @category Subscription & Loading
**/
subscribe<L extends CoList, Depth>(
this: L,
depth: Depth & DepthsIn<L>,
listener: (value: DeeplyLoaded<L, Depth>) => void,
): () => void {
return subscribeToExistingCoValue(this, depth, listener);
}
/** @category Type Helpers */
castAs<Cl extends CoValueClass & CoValueFromRaw<CoValue>>(
cl: Cl,
): InstanceType<Cl> {
return cl.fromRaw(this._raw) as InstanceType<Cl>;
}
}
function toRawItems<Item>(items: Item[], itemDescriptor: Schema) {
@@ -276,24 +493,6 @@ function toRawItems<Item>(items: Item[], itemDescriptor: Schema) {
return rawItems;
}
function init(list: CoList) {
if (list[InitValues]) {
const { init, owner } = list[InitValues];
const raw = owner._raw.createList(
toRawItems(init, list._schema[ItemsSym]),
);
Object.defineProperties(list, {
id: {
value: raw.id,
enumerable: false,
},
_raw: { value: raw, enumerable: false },
});
delete list[InitValues];
}
}
const CoListProxyHandler: ProxyHandler<CoList> = {
get(target, key, receiver) {
if (typeof key === "string" && !isNaN(+key)) {
@@ -329,7 +528,6 @@ const CoListProxyHandler: ProxyHandler<CoList> = {
(target.constructor as typeof CoList)._schema ||= {};
(target.constructor as typeof CoList)._schema[ItemsSym] =
value[SchemaInit];
init(target);
return true;
}
if (typeof key === "string" && !isNaN(+key)) {
@@ -358,7 +556,6 @@ const CoListProxyHandler: ProxyHandler<CoList> = {
(target.constructor as typeof CoList)._schema ||= {};
(target.constructor as typeof CoList)._schema[ItemsSym] =
descriptor.value[SchemaInit];
init(target);
return true;
} else {
return Reflect.defineProperty(target, key, descriptor);

View File

@@ -9,7 +9,11 @@ import type {
RefEncoded,
IfCo,
RefIfCoValue,
ClassOf,
DepthsIn,
DeeplyLoaded,
UnavailableError,
AccountCtx,
CoValueClass,
} from "../internal.js";
import {
Account,
@@ -20,9 +24,15 @@ import {
makeRefs,
subscriptionsScopes,
ItemsSym,
InitValues,
isRefEncoded,
loadCoValue,
loadCoValueEf,
subscribeToCoValue,
subscribeToCoValueEf,
ensureCoValueLoaded,
subscribeToExistingCoValue,
} from "../internal.js";
import { Effect, Stream } from "effect";
type CoMapEdit<V> = {
value?: V;
@@ -31,17 +41,14 @@ type CoMapEdit<V> = {
madeAt: Date;
};
type InitValuesFor<C extends CoMap> = {
init: Simplify<CoMapInit<C>>;
owner: Account | Group;
};
/**
* CoMaps are collaborative versions of plain objects, mapping string-like keys to values.
*
* @categoryDescription Declaration
* Declare your own CoMap schemas by subclassing `CoMap` and assigning field schemas with `co`.
*
* Optional `co.ref(...)` fields must be marked with `{ optional: true }`.
*
* ```ts
* import { co, CoMap } from "jazz-tools";
*
@@ -49,6 +56,7 @@ type InitValuesFor<C extends CoMap> = {
* name = co.string;
* age = co.number;
* pet = co.ref(Animal);
* car = co.ref(Car, { optional: true });
* }
* ```
*
@@ -66,7 +74,7 @@ type InitValuesFor<C extends CoMap> = {
*
* @category CoValues
* */
export class CoMap extends CoValueBase implements CoValue<"CoMap", RawCoMap> {
export class CoMap extends CoValueBase implements CoValue {
/**
* The ID of this `CoMap`
* @category Content */
@@ -92,17 +100,19 @@ export class CoMap extends CoValueBase implements CoValue<"CoMap", RawCoMap> {
/**
* If property `prop` is a `co.ref(...)`, you can use `coMaps._refs.prop` to access
* the `Ref` instead of the potentially loaded/null value.
*
* This allows you to always get the ID or load the value manually.
*
* @example
* ```ts
* person._refs.pet.id; // => ID<Animal>
* person._refs.pet.value;
* // => Animal | undefined
* // => Animal | null
* const pet = await person._refs.pet.load();
* ```
*
* @category Content */
* @category Content
**/
get _refs(): {
[Key in CoKeys<this>]: IfCo<this[Key], RefIfCoValue<this[Key]>>;
} {
@@ -161,10 +171,14 @@ export class CoMap extends CoValueBase implements CoValue<"CoMap", RawCoMap> {
: undefined,
by:
rawEdit.by &&
new Ref(rawEdit.by as ID<Account>, target._loadedAs, {
ref: Account,
optional: false,
}).accessFrom(
new Ref<Account>(
rawEdit.by as ID<Account>,
target._loadedAs,
{
ref: Account,
optional: false,
},
).accessFrom(
target,
"_edits." + key.toString() + ".by",
),
@@ -181,44 +195,66 @@ export class CoMap extends CoValueBase implements CoValue<"CoMap", RawCoMap> {
return Account.fromNode(this._raw.core.node);
}
/** @internal */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[InitValues]?: any;
/** @internal */
constructor(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
options: { fromRaw: RawCoMap } | { init: any; owner: Account | Group },
options: { fromRaw: RawCoMap } | undefined
) {
super();
if ("owner" in options) {
this[InitValues] = {
init: options.init,
owner: options.owner,
} as InitValuesFor<this>;
} else if ("fromRaw" in options) {
Object.defineProperties(this, {
id: {
value: options.fromRaw.id as unknown as ID<this>,
enumerable: false,
},
_raw: { value: options.fromRaw, enumerable: false },
});
} else {
throw new Error("Invalid CoMap constructor arguments");
if (options) {
if ("fromRaw" in options) {
Object.defineProperties(this, {
id: {
value: options.fromRaw.id as unknown as ID<this>,
enumerable: false,
},
_raw: { value: options.fromRaw, enumerable: false },
});
} else {
throw new Error("Invalid CoMap constructor arguments");
}
}
return new Proxy(this, CoMapProxyHandler as ProxyHandler<this>);
}
/** @category Creation */
/**
* Create a new CoMap with the given initial values and owner.
*
* The owner (a Group or Account) determines access rights to the CoMap.
*
* The CoMap will immediately be persisted and synced to connected peers.
*
* @example
* ```ts
* const person = Person.create({
* name: "Alice",
* age: 42,
* pet: cat,
* }, { owner: friendGroup });
* ```
*
* @category Creation
**/
static create<M extends CoMap>(
this: ClassOf<M>,
this: CoValueClass<M>,
init: Simplify<CoMapInit<M>>,
options: { owner: Account | Group },
) {
return new this({ init, owner: options.owner });
const instance = new this();
const raw = instance.rawFromInit(
init,
options.owner,
);
Object.defineProperties(instance, {
id: {
value: raw.id,
enumerable: false,
},
_raw: { value: raw, enumerable: false },
});
return instance;
}
toJSON() {
@@ -269,6 +305,10 @@ export class CoMap extends CoValueBase implements CoValue<"CoMap", RawCoMap> {
key as keyof typeof this._schema
] || this._schema[ItemsSym]) as Schema;
if (!descriptor) {
continue;
}
if (descriptor === "json") {
rawInit[key] = initValue as JsonValue;
} else if (isRefEncoded(descriptor)) {
@@ -286,7 +326,24 @@ export class CoMap extends CoValueBase implements CoValue<"CoMap", RawCoMap> {
return rawOwner.createMap(rawInit);
}
/** @category Declaration */
/**
* Declare a Record-like CoMap schema, by extending `CoMap.Record(...)` and passing the value schema using `co`. Keys are always `string`.
*
* @example
* ```ts
* import { co, CoMap } from "jazz-tools";
*
* class ColorToFruitMap extends CoMap.Record(
* co.ref(Fruit)
* ) {}
*
* // assume we have map: ColorToFruitMap
* // and strawberry: Fruit
* map["red"] = strawberry;
* ```
*
* @category Declaration
*/
static Record<Value>(value: IfCo<Value, Value>) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
class RecordLikeCoMap extends CoMap {
@@ -297,6 +354,135 @@ export class CoMap extends CoValueBase implements CoValue<"CoMap", RawCoMap> {
return RecordLikeCoMap;
}
/**
* Load a `CoMap` with a given ID, as a given account.
*
* `depth` specifies which (if any) fields that reference other CoValues to load as well before resolving.
* The `DeeplyLoaded` return type guarantees that corresponding referenced CoValues are loaded to the specified depth.
*
* You can pass `[]` or `{}` for shallowly loading only this CoMap, or `{ fieldA: depthA, fieldB: depthB }` for recursively loading referenced CoValues.
*
* Check out the `load` methods on `CoMap`/`CoList`/`CoStream`/`Group`/`Account` to see which depth structures are valid to nest.
*
* @example
* ```ts
* const person = await Person.load(
* "co_zdsMhHtfG6VNKt7RqPUPvUtN2Ax",
* me,
* { pet: {} }
* );
* ```
*
* @category Subscription & Loading
*/
static load<M extends CoMap, Depth>(
this: CoValueClass<M>,
id: ID<M>,
as: Account,
depth: Depth & DepthsIn<M>,
): Promise<DeeplyLoaded<M, Depth> | undefined> {
return loadCoValue(this, id, as, depth);
}
/**
* Effectful version of `CoMap.load()`.
*
* Needs to be run inside an `AccountCtx` context.
*
* @category Subscription & Loading
*/
static loadEf<M extends CoMap, Depth>(
this: CoValueClass<M>,
id: ID<M>,
depth: Depth & DepthsIn<M>,
): Effect.Effect<DeeplyLoaded<M, Depth>, UnavailableError, AccountCtx> {
return loadCoValueEf<M, Depth>(this, id, depth);
}
/**
* Load and subscribe to a `CoMap` with a given ID, as a given account.
*
* Automatically also subscribes to updates to all referenced/nested CoValues as soon as they are accessed in the listener.
*
* `depth` specifies which (if any) fields that reference other CoValues to load as well before calling `listener` for the first time.
* The `DeeplyLoaded` return type guarantees that corresponding referenced CoValues are loaded to the specified depth.
*
* You can pass `[]` or `{}` for shallowly loading only this CoMap, or `{ fieldA: depthA, fieldB: depthB }` for recursively loading referenced CoValues.
*
* Check out the `load` methods on `CoMap`/`CoList`/`CoStream`/`Group`/`Account` to see which depth structures are valid to nest.
*
* Returns an unsubscribe function that you should call when you no longer need updates.
*
* Also see the `useCoState` hook to reactively subscribe to a CoValue in a React component.
*
* @example
* ```ts
* const unsub = Person.subscribe(
* "co_zdsMhHtfG6VNKt7RqPUPvUtN2Ax",
* me,
* { pet: {} },
* (person) => console.log(person)
* );
* ```
*
* @category Subscription & Loading
*/
static subscribe<M extends CoMap, Depth>(
this: CoValueClass<M>,
id: ID<M>,
as: Account,
depth: Depth & DepthsIn<M>,
listener: (value: DeeplyLoaded<M, Depth>) => void,
): () => void {
return subscribeToCoValue<M, Depth>(this, id, as, depth, listener);
}
/**
* Effectful version of `CoMap.subscribe()` that returns a stream of updates.
*
* Needs to be run inside an `AccountCtx` context.
*
* @category Subscription & Loading
*/
static subscribeEf<M extends CoMap, Depth>(
this: CoValueClass<M>,
id: ID<M>,
depth: Depth & DepthsIn<M>,
): Stream.Stream<DeeplyLoaded<M, Depth>, UnavailableError, AccountCtx> {
return subscribeToCoValueEf<M, Depth>(this, id, depth);
}
/**
* Given an already loaded `CoMap`, ensure that the specified fields are loaded to the specified depth.
*
* Works like `CoMap.load()`, but you don't need to pass the ID or the account to load as again.
*
* @category Subscription & Loading
*/
ensureLoaded<M extends CoMap, Depth>(
this: M,
depth: Depth & DepthsIn<M>,
): Promise<DeeplyLoaded<M, Depth> | undefined> {
return ensureCoValueLoaded(this, depth);
}
/**
* Given an already loaded `CoMap`, subscribe to updates to the `CoMap` and ensure that the specified fields are loaded to the specified depth.
*
* Works like `CoMap.subscribe()`, but you don't need to pass the ID or the account to load as again.
*
* Returns an unsubscribe function that you should call when you no longer need updates.
*
* @category Subscription & Loading
**/
subscribe<M extends CoMap, Depth>(
this: M,
depth: Depth & DepthsIn<M>,
listener: (value: DeeplyLoaded<M, Depth>) => void,
): () => void {
return subscribeToExistingCoValue(this, depth, listener);
}
}
export type CoKeys<Map extends object> = Exclude<
@@ -310,30 +496,6 @@ export type CoMapInit<Map extends object> = {
: IfCo<Map[Key], Key>]: Map[Key];
} & { [Key in CoKeys<Map> as IfCo<Map[Key], Key>]?: Map[Key] };
function tryInit(map: CoMap) {
if (
map[InitValues] &&
(map._schema[ItemsSym] ||
Object.keys(map[InitValues].init).every(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(key) => (map._schema as any)[key],
))
) {
const raw = map.rawFromInit(
map[InitValues].init,
map[InitValues].owner,
);
Object.defineProperties(map, {
id: {
value: raw.id,
enumerable: false,
},
_raw: { value: raw, enumerable: false },
});
delete map[InitValues];
}
}
// TODO: cache handlers per descriptor for performance?
const CoMapProxyHandler: ProxyHandler<CoMap> = {
get(target, key, receiver) {
@@ -376,7 +538,6 @@ const CoMapProxyHandler: ProxyHandler<CoMap> = {
(target.constructor as typeof CoMap)._schema ||= {};
(target.constructor as typeof CoMap)._schema[key] =
value[SchemaInit];
tryInit(target);
return true;
}
@@ -407,7 +568,6 @@ const CoMapProxyHandler: ProxyHandler<CoMap> = {
(target.constructor as typeof CoMap)._schema ||= {};
(target.constructor as typeof CoMap)._schema[key as string] =
attributes.value[SchemaInit];
tryInit(target);
return true;
} else {
return Reflect.defineProperty(target, key, attributes);

View File

@@ -16,8 +16,12 @@ import type {
Group,
ID,
IfCo,
ClassOf,
UnCo,
AccountCtx,
CoValueClass,
DeeplyLoaded,
DepthsIn,
UnavailableError,
} from "../internal.js";
import {
ItemsSym,
@@ -26,11 +30,17 @@ import {
Ref,
inspect,
co,
InitValues,
SchemaInit,
isRefEncoded,
loadCoValue,
loadCoValueEf,
subscribeToCoValue,
subscribeToCoValueEf,
ensureCoValueLoaded,
subscribeToExistingCoValue,
} from "../internal.js";
import { encodeSync, decodeSync } from "@effect/schema/Schema";
import { Effect, Stream } from "effect";
export type CoStreamEntry<Item> = SingleCoStreamEntry<Item> & {
all: IterableIterator<SingleCoStreamEntry<Item>>;
@@ -46,10 +56,7 @@ export type SingleCoStreamEntry<Item> = {
/** @category CoValues */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export class CoStream<Item = any>
extends CoValueBase
implements CoValue<"CoStream", RawCoStream>
{
export class CoStream<Item = any> extends CoValueBase implements CoValue {
static Of<Item>(item: IfCo<Item, Item>): typeof CoStream<Item> {
return class CoStreamOf extends CoStream<Item> {
[co.items] = item;
@@ -85,9 +92,6 @@ export class CoStream<Item = any>
return this.perSession[this._loadedAs.sessionID!];
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[InitValues]?: any;
constructor(
options:
| { init: Item[]; owner: Account | Group }
@@ -95,7 +99,7 @@ export class CoStream<Item = any>
) {
super();
if ("fromRaw" in options) {
if (options && "fromRaw" in options) {
Object.defineProperties(this, {
id: {
value: options.fromRaw.id,
@@ -103,22 +107,31 @@ export class CoStream<Item = any>
},
_raw: { value: options.fromRaw, enumerable: false },
});
} else {
this[InitValues] = {
init: options.init,
owner: options.owner,
};
}
return new Proxy(this, CoStreamProxyHandler as ProxyHandler<this>);
}
static create<S extends CoStream>(
this: ClassOf<S>,
this: CoValueClass<S>,
init: S extends CoStream<infer Item> ? UnCo<Item>[] : never,
options: { owner: Account | Group },
) {
return new this({ init, owner: options.owner });
const instance = new this({ init, owner: options.owner });
const raw = options.owner._raw.createStream();
Object.defineProperties(instance, {
id: {
value: raw.id,
enumerable: false,
},
_raw: { value: raw, enumerable: false },
});
if (init) {
instance.push(...init);
}
return instance;
}
push(...items: Item[]) {
@@ -178,6 +191,62 @@ export class CoStream<Item = any>
this._schema ||= {};
Object.assign(this._schema, def);
}
/** @category Subscription & Loading */
static load<S extends CoStream, Depth>(
this: CoValueClass<S>,
id: ID<S>,
as: Account,
depth: Depth & DepthsIn<S>,
): Promise<DeeplyLoaded<S, Depth> | undefined> {
return loadCoValue(this, id, as, depth);
}
/** @category Subscription & Loading */
static loadEf<S extends CoStream, Depth>(
this: CoValueClass<S>,
id: ID<S>,
depth: Depth & DepthsIn<S>,
): Effect.Effect<DeeplyLoaded<S, Depth>, UnavailableError, AccountCtx> {
return loadCoValueEf<S, Depth>(this, id, depth);
}
/** @category Subscription & Loading */
static subscribe<S extends CoStream, Depth>(
this: CoValueClass<S>,
id: ID<S>,
as: Account,
depth: Depth & DepthsIn<S>,
listener: (value: DeeplyLoaded<S, Depth>) => void,
): () => void {
return subscribeToCoValue<S, Depth>(this, id, as, depth, listener);
}
/** @category Subscription & Loading */
static subscribeEf<S extends CoStream, Depth>(
this: CoValueClass<S>,
id: ID<S>,
depth: Depth & DepthsIn<S>,
): Stream.Stream<DeeplyLoaded<S, Depth>, UnavailableError, AccountCtx> {
return subscribeToCoValueEf<S, Depth>(this, id, depth);
}
/** @category Subscription & Loading */
ensureLoaded<S extends CoStream, Depth>(
this: S,
depth: Depth & DepthsIn<S>,
): Promise<DeeplyLoaded<S, Depth> | undefined> {
return ensureCoValueLoaded(this, depth);
}
/** @category Subscription & Loading */
subscribe<S extends CoStream, Depth>(
this: S,
depth: Depth & DepthsIn<S>,
listener: (value: DeeplyLoaded<S, Depth>) => void,
): () => void {
return subscribeToExistingCoValue(this, depth, listener);
}
}
function entryFromRawEntry<Item>(
@@ -253,27 +322,6 @@ function entryFromRawEntry<Item>(
};
}
function init(stream: CoStream) {
const init = stream[InitValues];
if (!init) return;
const raw = init.owner._raw.createStream();
Object.defineProperties(stream, {
id: {
value: raw.id,
enumerable: false,
},
_raw: { value: raw, enumerable: false },
});
if (init.init) {
stream.push(...init.init);
}
delete stream[InitValues];
}
export const CoStreamProxyHandler: ProxyHandler<CoStream> = {
get(target, key, receiver) {
if (typeof key === "string" && key.startsWith("co_")) {
@@ -327,7 +375,6 @@ export const CoStreamProxyHandler: ProxyHandler<CoStream> = {
(target.constructor as typeof CoStream)._schema ||= {};
(target.constructor as typeof CoStream)._schema[ItemsSym] =
value[SchemaInit];
init(target);
return true;
} else {
return Reflect.set(target, key, value, receiver);
@@ -343,7 +390,6 @@ export const CoStreamProxyHandler: ProxyHandler<CoStream> = {
(target.constructor as typeof CoStream)._schema ||= {};
(target.constructor as typeof CoStream)._schema[ItemsSym] =
descriptor.value[SchemaInit];
init(target);
return true;
} else {
return Reflect.defineProperty(target, key, descriptor);
@@ -437,10 +483,7 @@ const CoStreamPerSessionProxyHandler = (
});
/** @category CoValues */
export class BinaryCoStream
extends CoValueBase
implements CoValue<"BinaryCoStream", RawBinaryCoStream>
{
export class BinaryCoStream extends CoValueBase implements CoValue {
declare id: ID<this>;
declare _type: "BinaryCoStream";
declare _raw: RawBinaryCoStream;
@@ -476,7 +519,7 @@ export class BinaryCoStream
}
static create<S extends BinaryCoStream>(
this: ClassOf<S>,
this: CoValueClass<S>,
options: { owner: Account | Group },
) {
return new this(options);
@@ -584,4 +627,60 @@ export class BinaryCoStream
[inspect]() {
return this.toJSON();
}
/** @category Subscription & Loading */
static load<B extends BinaryCoStream, Depth>(
this: CoValueClass<B>,
id: ID<B>,
as: Account,
depth: Depth & DepthsIn<B>,
): Promise<DeeplyLoaded<B, Depth> | undefined> {
return loadCoValue(this, id, as, depth);
}
/** @category Subscription & Loading */
static loadEf<B extends BinaryCoStream, Depth>(
this: CoValueClass<B>,
id: ID<B>,
depth: Depth & DepthsIn<B>,
): Effect.Effect<DeeplyLoaded<B, Depth>, UnavailableError, AccountCtx> {
return loadCoValueEf<B, Depth>(this, id, depth);
}
/** @category Subscription & Loading */
static subscribe<B extends BinaryCoStream, Depth>(
this: CoValueClass<B>,
id: ID<B>,
as: Account,
depth: Depth & DepthsIn<B>,
listener: (value: DeeplyLoaded<B, Depth>) => void,
): () => void {
return subscribeToCoValue<B, Depth>(this, id, as, depth, listener);
}
/** @category Subscription & Loading */
static subscribeEf<B extends BinaryCoStream, Depth>(
this: CoValueClass<B>,
id: ID<B>,
depth: Depth & DepthsIn<B>,
): Stream.Stream<DeeplyLoaded<B, Depth>, UnavailableError, AccountCtx> {
return subscribeToCoValueEf<B, Depth>(this, id, depth);
}
/** @category Subscription & Loading */
ensureLoaded<B extends BinaryCoStream, Depth>(
this: B,
depth: Depth & DepthsIn<B>,
): Promise<DeeplyLoaded<B, Depth> | undefined> {
return ensureCoValueLoaded(this, depth);
}
/** @category Subscription & Loading */
subscribe<B extends BinaryCoStream, Depth>(
this: B,
depth: Depth & DepthsIn<B>,
listener: (value: DeeplyLoaded<B, Depth>) => void,
): () => void {
return subscribeToExistingCoValue(this, depth, listener);
}
}

View File

@@ -1,5 +1,15 @@
import type { AccountID, Everyone, RawGroup, Role } from "cojson";
import type { CoValue, ID, RefEncoded, Schema, ClassOf } from "../internal.js";
import type {
CoValue,
ID,
RefEncoded,
Schema,
AccountCtx,
CoValueClass,
DeeplyLoaded,
DepthsIn,
UnavailableError,
} from "../internal.js";
import {
Account,
CoMap,
@@ -9,7 +19,14 @@ import {
isControlledAccount,
AccountAndGroupProxyHandler,
MembersSym,
loadCoValue,
loadCoValueEf,
subscribeToCoValue,
subscribeToCoValueEf,
ensureCoValueLoaded,
subscribeToExistingCoValue,
} from "../internal.js";
import { Effect, Stream } from "effect";
/** @category Identity & Permissions */
export class Profile extends CoMap {
@@ -17,7 +34,7 @@ export class Profile extends CoMap {
}
/** @category Identity & Permissions */
export class Group extends CoValueBase implements CoValue<"Group", RawGroup> {
export class Group extends CoValueBase implements CoValue {
declare id: ID<this>;
declare _type: "Group";
static {
@@ -41,7 +58,7 @@ export class Group extends CoValueBase implements CoValue<"Group", RawGroup> {
[MembersSym]: {
ref: () => Account,
optional: false,
} satisfies Schema,
} satisfies RefEncoded<Account>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as any;
Object.defineProperty(this.prototype, "_schema", {
@@ -97,7 +114,7 @@ export class Group extends CoValueBase implements CoValue<"Group", RawGroup> {
const initOwner = options.owner;
if (!initOwner) throw new Error("No owner provided");
if (
initOwner instanceof Account &&
initOwner._type === "Account" &&
isControlledAccount(initOwner)
) {
const rawOwner = initOwner._raw;
@@ -124,7 +141,7 @@ export class Group extends CoValueBase implements CoValue<"Group", RawGroup> {
}
static create<G extends Group>(
this: ClassOf<G>,
this: CoValueClass<G>,
options: { owner: Account },
) {
return new this(options);
@@ -170,4 +187,60 @@ export class Group extends CoValueBase implements CoValue<"Group", RawGroup> {
};
});
}
/** @category Subscription & Loading */
static load<G extends Group, Depth>(
this: CoValueClass<G>,
id: ID<G>,
as: Account,
depth: Depth & DepthsIn<G>,
): Promise<DeeplyLoaded<G, Depth> | undefined> {
return loadCoValue(this, id, as, depth);
}
/** @category Subscription & Loading */
static loadEf<G extends Group, Depth>(
this: CoValueClass<G>,
id: ID<G>,
depth: Depth & DepthsIn<G>,
): Effect.Effect<DeeplyLoaded<G, Depth>, UnavailableError, AccountCtx> {
return loadCoValueEf<G, Depth>(this, id, depth);
}
/** @category Subscription & Loading */
static subscribe<G extends Group, Depth>(
this: CoValueClass<G>,
id: ID<G>,
as: Account,
depth: Depth & DepthsIn<G>,
listener: (value: DeeplyLoaded<G, Depth>) => void,
): () => void {
return subscribeToCoValue<G, Depth>(this, id, as, depth, listener);
}
/** @category Subscription & Loading */
static subscribeEf<G extends Group, Depth>(
this: CoValueClass<G>,
id: ID<G>,
depth: Depth & DepthsIn<G>,
): Stream.Stream<DeeplyLoaded<G, Depth>, UnavailableError, AccountCtx> {
return subscribeToCoValueEf<G, Depth>(this, id, depth);
}
/** @category Subscription & Loading */
ensureLoaded<G extends Group, Depth>(
this: G,
depth: Depth & DepthsIn<G>,
): Promise<DeeplyLoaded<G, Depth> | undefined> {
return ensureCoValueLoaded(this, depth);
}
/** @category Subscription & Loading */
subscribe<G extends Group, Depth>(
this: G,
depth: Depth & DepthsIn<G>,
listener: (value: DeeplyLoaded<G, Depth>) => void,
): () => void {
return subscribeToExistingCoValue(this, depth, listener);
}
}

View File

@@ -13,74 +13,29 @@ import {
} from "../internal.js";
import { fulfillsDepth } from "./deepLoading.js";
export type ClassOf<T> = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
new (...args: any[]): T;
};
/** @category Abstract interfaces */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface CoValueClass<Value extends CoValue = CoValue, Init = any> {
new (init: Init, options: { owner: Account | Group }): Value;
export interface CoValueClass<Value extends CoValue = CoValue> {
/** @ignore */
fromRaw(raw: Value["_raw"]): Value;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
new (...args: any[]): Value;
}
/** @category Subscription & Loading */
load<V extends Value, Depth>(
this: ClassOf<V>,
id: ID<V>,
as: Account,
depth: Depth & DepthsIn<V>,
): Promise<DeeplyLoaded<V, Depth> | undefined>;
/** @category Subscription & Loading */
load<V extends Value, Depth>(
this: ClassOf<V>,
existing: V,
depth: Depth & DepthsIn<V>,
): Promise<DeeplyLoaded<V, Depth> | undefined>;
/** @category Subscription & Loading */
loadEf<V extends Value, Depth>(
this: ClassOf<V>,
id: ID<V>,
depth: Depth & DepthsIn<V>,
): Effect.Effect<DeeplyLoaded<V, Depth>, UnavailableError, AccountCtx>;
/** @category Subscription & Loading */
subscribe<V extends Value, Depth>(
this: ClassOf<V>,
id: ID<V>,
as: Account,
depth: Depth & DepthsIn<V>,
listener: (value: DeeplyLoaded<V, Depth>) => void,
): () => void;
subscribe<V extends Value, Depth>(
this: ClassOf<V>,
existing: V,
depth: Depth & DepthsIn<V>,
listener: (value: DeeplyLoaded<V, Depth>) => void,
): () => void;
/** @category Subscription & Loading */
subscribeEf<V extends Value, Depth>(
this: ClassOf<V>,
id: ID<V>,
depth: Depth & DepthsIn<V>,
): Stream.Stream<DeeplyLoaded<V, Depth>, UnavailableError, AccountCtx>;
export interface CoValueFromRaw<V extends CoValue> {
fromRaw(raw: V["_raw"]): V;
}
/** @category Abstract interfaces */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface CoValue<Type extends string = string, Raw = any> {
export interface CoValue {
/** @category Content */
readonly id: ID<this>;
/** @category Type Helpers */
_type: Type;
_type: string;
/** @category Collaboration */
_owner: Account | Group;
/** @category Internals */
_raw: Raw;
_raw: RawCoValue;
/** @internal */
readonly _loadedAs: Account;
/** @category Stringifying & Inspection */
@@ -96,8 +51,10 @@ export function isCoValue(value: any): value is CoValue {
return value && value._type !== undefined;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function isCoValueClass(value: any): value is CoValueClass {
export function isCoValueClass<V extends CoValue>(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value: any,
): value is CoValueClass<V> & CoValueFromRaw<V> {
return typeof value === "function" && value.fromRaw !== undefined;
}
@@ -111,6 +68,7 @@ export class CoValueBase implements CoValue {
id!: ID<this>;
_type!: string;
_raw!: RawCoValue;
/** @category Internals */
_instanceID!: string;
get _owner(): Account | Group {
@@ -142,156 +100,13 @@ export class CoValueBase implements CoValue {
}
/** @category Internals */
static fromRaw<V extends CoValue>(this: ClassOf<V>, raw: RawCoValue): V {
static fromRaw<V extends CoValue>(
this: CoValueClass<V>,
raw: RawCoValue,
): V {
return new this({ fromRaw: raw });
}
/** @category Subscription & Loading */
static load<V extends CoValue, Depth>(
this: ClassOf<V> & typeof CoValueBase,
id: ID<V>,
as: Account,
depth: Depth & DepthsIn<V>,
): Promise<DeeplyLoaded<V, Depth> | undefined>;
/** @category Subscription & Loading */
static load<V extends CoValue, Depth>(
this: ClassOf<V> & typeof CoValueBase,
existing: V,
depth: Depth & DepthsIn<V>,
): Promise<DeeplyLoaded<V, Depth> | undefined>;
static load<V extends CoValue, Depth>(
this: ClassOf<V> & typeof CoValueBase,
...args:
| [ID<V>, Account, Depth & DepthsIn<V>]
| [V, Depth & DepthsIn<V>]
): Promise<DeeplyLoaded<V, Depth> | undefined> {
const { id, as, depth } =
args.length === 3
? { id: args[0], as: args[1], depth: args[2] }
: { id: args[0].id, as: args[0]._loadedAs, depth: args[1] };
return Effect.runPromise(
this.loadEf(id, depth).pipe(
Effect.mapError(() => undefined),
Effect.merge,
Effect.provideService(AccountCtx, as),
),
);
}
/** @category Subscription & Loading */
static loadEf<V extends CoValue, Depth>(
this: ClassOf<V> & typeof CoValueBase,
id: ID<V>,
depth: Depth & DepthsIn<V>,
): Effect.Effect<DeeplyLoaded<V, Depth>, UnavailableError, AccountCtx> {
return this.subscribeEf(id, depth).pipe(
Stream.runHead,
Effect.andThen(
Effect.mapError((_noSuchElem) => "unavailable" as const),
),
);
}
/** @category Subscription & Loading */
static subscribe<V extends CoValue, Depth>(
this: ClassOf<V> & typeof CoValueBase,
id: ID<V>,
as: Account,
depth: Depth & DepthsIn<V>,
listener: (value: DeeplyLoaded<V, Depth>) => void,
): () => void;
static subscribe<V extends CoValue, Depth>(
this: ClassOf<V> & typeof CoValueBase,
existing: V,
depth: Depth & DepthsIn<V>,
listener: (value: DeeplyLoaded<V, Depth>) => void,
): () => void;
static subscribe<V extends CoValue, Depth>(
this: ClassOf<V> & typeof CoValueBase,
...args:
| [
ID<V>,
Account,
Depth & DepthsIn<V>,
(value: DeeplyLoaded<V, Depth>) => void,
]
| [V, Depth & DepthsIn<V>, (value: DeeplyLoaded<V, Depth>) => void]
): () => void {
const { id, as, depth, listener } =
args.length === 4
? {
id: args[0],
as: args[1],
depth: args[2],
listener: args[3],
}
: {
id: args[0].id,
as: args[0]._loadedAs,
depth: args[1],
listener: args[2],
};
void Effect.runPromise(
Effect.provideService(
this.subscribeEf(id, depth).pipe(
Stream.run(
Sink.forEach((update) =>
Effect.sync(() => listener(update)),
),
),
),
AccountCtx,
as,
),
);
return function unsubscribe() {};
}
/** @category Subscription & Loading */
static subscribeEf<V extends CoValue, Depth>(
this: ClassOf<V> & typeof CoValueBase,
id: ID<V>,
depth: Depth & DepthsIn<V>,
): Stream.Stream<DeeplyLoaded<V, Depth>, UnavailableError, AccountCtx> {
return AccountCtx.pipe(
Effect.andThen((account) =>
new Ref(id, account, {
ref: this as CoValueClass<V>,
optional: false,
}).loadEf(),
),
Stream.fromEffect,
Stream.flatMap((value: V) =>
Stream.asyncScoped<V, UnavailableError>((emit) =>
Effect.gen(this, function* (_) {
const subscription = new SubscriptionScope(
value,
this,
(update) => void emit.single(update as V),
);
yield* _(
Effect.addFinalizer(() =>
Effect.sync(() =>
subscription.unsubscribeAll(),
),
),
);
}),
),
),
Stream.filterMap((update: V) =>
Option.fromNullable(
fulfillsDepth(depth, update)
? (update as DeeplyLoaded<V, Depth>)
: undefined,
),
),
);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
toJSON(): object | any[] {
return {
@@ -305,13 +120,128 @@ export class CoValueBase implements CoValue {
return this.toJSON();
}
/** @category Type Helpers*/
as<C extends CoValueClass>(otherSchema: C): InstanceType<C> {
const cast = otherSchema.fromRaw(this._raw) as InstanceType<C>;
const subScope = subscriptionsScopes.get(this);
if (subScope) {
subscriptionsScopes.set(cast, subScope);
}
return cast;
/** @category Type Helpers */
castAs<Cl extends CoValueClass & CoValueFromRaw<CoValue>>(
cl: Cl,
): InstanceType<Cl> {
return cl.fromRaw(this._raw) as InstanceType<Cl>;
}
}
export function loadCoValue<V extends CoValue, Depth>(
cls: CoValueClass<V>,
id: ID<V>,
as: Account,
depth: Depth & DepthsIn<V>,
): Promise<DeeplyLoaded<V, Depth> | undefined> {
return Effect.runPromise(
loadCoValueEf(cls, id, depth).pipe(
Effect.mapError(() => undefined),
Effect.merge,
Effect.provideService(AccountCtx, as),
),
);
}
export function ensureCoValueLoaded<V extends CoValue, Depth>(
existing: V,
depth: Depth & DepthsIn<V>,
): Promise<DeeplyLoaded<V, Depth> | undefined> {
return loadCoValue(
existing.constructor as CoValueClass<V>,
existing.id,
existing._loadedAs,
depth,
);
}
export function loadCoValueEf<V extends CoValue, Depth>(
cls: CoValueClass<V>,
id: ID<V>,
depth: Depth & DepthsIn<V>,
): Effect.Effect<DeeplyLoaded<V, Depth>, UnavailableError, AccountCtx> {
return subscribeToCoValueEf(cls, id, depth).pipe(
Stream.runHead,
Effect.andThen(
Effect.mapError((_noSuchElem) => "unavailable" as const),
),
);
}
export function subscribeToCoValue<V extends CoValue, Depth>(
cls: CoValueClass<V>,
id: ID<V>,
as: Account,
depth: Depth & DepthsIn<V>,
listener: (value: DeeplyLoaded<V, Depth>) => void,
): () => void {
void Effect.runPromise(
Effect.provideService(
subscribeToCoValueEf(cls, id, depth).pipe(
Stream.run(
Sink.forEach((update) =>
Effect.sync(() => listener(update)),
),
),
),
AccountCtx,
as,
),
);
return function unsubscribe() {};
}
export function subscribeToExistingCoValue<V extends CoValue, Depth>(
existing: V,
depth: Depth & DepthsIn<V>,
listener: (value: DeeplyLoaded<V, Depth>) => void,
): () => void {
return subscribeToCoValue(
existing.constructor as CoValueClass<V>,
existing.id,
existing._loadedAs,
depth,
listener,
);
}
export function subscribeToCoValueEf<V extends CoValue, Depth>(
cls: CoValueClass<V>,
id: ID<V>,
depth: Depth & DepthsIn<V>,
): Stream.Stream<DeeplyLoaded<V, Depth>, UnavailableError, AccountCtx> {
return AccountCtx.pipe(
Effect.andThen((account) =>
new Ref(id, account, {
ref: cls,
optional: false,
}).loadEf(),
),
Stream.fromEffect,
Stream.flatMap((value: V) =>
Stream.asyncScoped<V, UnavailableError>((emit) =>
Effect.gen(function* (_) {
const subscription = new SubscriptionScope(
value,
cls as CoValueClass<V> & CoValueFromRaw<V>,
(update) => void emit.single(update as V),
);
yield* _(
Effect.addFinalizer(() =>
Effect.sync(() => subscription.unsubscribeAll()),
),
);
}),
),
),
Stream.filterMap((update: V) =>
Option.fromNullable(
fulfillsDepth(depth, update)
? (update as DeeplyLoaded<V, Depth>)
: undefined,
),
),
);
}

View File

@@ -3,6 +3,7 @@ import {
type CoValue,
type CoValueClass,
isCoValueClass,
CoValueFromRaw,
} from "../internal.js";
import type { Schema as EffectSchema, TypeId } from "@effect/schema/Schema";
@@ -96,11 +97,13 @@ export function instantiateRefEncoded<V extends CoValue>(
schema: RefEncoded<V>,
raw: RawCoValue,
): V {
return isCoValueClass(schema.ref)
return isCoValueClass<V>(schema.ref)
? schema.ref.fromRaw(raw)
: (schema.ref as (raw: RawCoValue) => CoValueClass<V>)(raw).fromRaw(
raw,
);
: (
schema.ref as (
raw: RawCoValue,
) => CoValueClass<V> & CoValueFromRaw<V>
)(raw).fromRaw(raw);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any

View File

@@ -2,9 +2,9 @@ import type { RawCoValue } from "cojson";
import type {
Account,
CoValue,
CoValueBase,
ID,
ClassOf,
CoValueClass,
CoValueFromRaw,
} from "../internal.js";
export const subscriptionsScopes = new WeakMap<
@@ -35,7 +35,7 @@ export class SubscriptionScope<Root extends CoValue> {
constructor(
root: Root,
rootSchema: ClassOf<Root> & typeof CoValueBase,
rootSchema: CoValueClass<Root> & CoValueFromRaw<Root>,
onUpdate: (newRoot: Root) => void,
) {
this.rootEntry = {

View File

@@ -1,9 +1,6 @@
export const SchemaInit = Symbol.for("SchemaInit");
export type SchemaInit = typeof SchemaInit;
export const InitValues = Symbol.for("InitValues");
export type InitValues = typeof InitValues;
export const ItemsSym = Symbol.for("items");
export type ItemsSym = typeof ItemsSym;

View File

@@ -17,7 +17,7 @@ export type { ID, CoValue } from "./internal.js";
export { Encoders, co } from "./internal.js";
export { CoMap } from "./internal.js";
export { CoMap, type CoMapInit } from "./internal.js";
export { CoList } from "./internal.js";
export { CoStream, BinaryCoStream } from "./internal.js";
export { Group, Profile } from "./internal.js";
@@ -25,3 +25,10 @@ export { Account, isControlledAccount } from "./internal.js";
export { ImageDefinition } from "./internal.js";
export { CoValueBase, type CoValueClass } from "./internal.js";
export type { DepthsIn, DeeplyLoaded } from "./internal.js";
export {
loadCoValue,
loadCoValueEf,
subscribeToCoValue,
subscribeToCoValueEf,
} from "./internal.js";

View File

@@ -52,6 +52,22 @@ describe("Simple CoMap operations", async () => {
expect(Object.keys(map)).toEqual(["color", "_height", "birthday"]);
});
test("Construction with too many things provided", () => {
const mapWithExtra = TestMap.create(
{
color: "red",
_height: 10,
birthday: birthday,
name: "Hermes",
extra: "extra",
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as any,
{ owner: me },
);
expect(mapWithExtra.color).toEqual("red");
})
describe("Mutation", () => {
test("assignment & deletion", () => {
map.color = "blue";

View File

@@ -180,7 +180,10 @@ class CustomAccount extends Account {
profile = co.ref(CustomProfile);
root = co.ref(TestMap);
async migrate(creationProps?: { name: string } | undefined) {
async migrate(
this: CustomAccount,
creationProps?: { name: string } | undefined,
) {
if (creationProps) {
this.profile = CustomProfile.create(
{
@@ -195,7 +198,7 @@ class CustomAccount extends Account {
);
}
const thisLoaded = await CustomAccount.load(this, {
const thisLoaded = await this.ensureLoaded({
profile: { stream: [] },
root: { list: [] },
});
@@ -219,7 +222,7 @@ test("Deep loading within account", async () => {
crypto: Crypto,
});
const meLoaded = await CustomAccount.load(me, {
const meLoaded = await me.ensureLoaded({
profile: { stream: [] },
root: { list: [] },
});

View File

@@ -13,7 +13,7 @@ describe("Custom accounts and groups", async () => {
profile = co.ref(CustomProfile);
root = co.ref(CoMap);
migrate(creationProps?: { name: string }) {
migrate(this: CustomAccount, creationProps?: { name: string }) {
if (creationProps) {
const profileGroup = Group.create({ owner: this });
profileGroup.addMember("everyone", "reader");
@@ -56,7 +56,7 @@ describe("Custom accounts and groups", async () => {
expect(group.nMembers).toBe(2);
await new Promise<void>((resolve) => {
CustomGroup.subscribe(group, {}, (update) => {
group.subscribe({}, (update) => {
const meAsMember = update.members.find((member) => {
return member.id === me.id && member.account?.profile;
});
@@ -77,7 +77,7 @@ describe("Custom accounts and groups", async () => {
const map = MyMap.create({ name: "test" }, { owner: group });
const meAsCastMember = map._owner
.as(CustomGroup)
.castAs(CustomGroup)
.members.find((member) => member.id === me.id);
expect(meAsCastMember?.account?.profile?.name).toBe(
"Hermes Puggington",
@@ -86,6 +86,6 @@ describe("Custom accounts and groups", async () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
expect((map._owner as any).nMembers).toBeUndefined();
expect(map._owner.as(CustomGroup).nMembers).toBe(2);
expect(map._owner.castAs(CustomGroup).nMembers).toBe(2);
});
});