Compare commits

...

22 Commits

Author SHA1 Message Date
Guido D'Orsi
b6c6a0ae64 fix: make the linkAccounts test utility wait for the accounts coValues to be synced 2025-03-27 22:24:28 +01:00
Guido D'Orsi
e000774b3b Merge pull request #1739 from garden-co/changeset-release/main
Version Packages
2025-03-27 18:45:09 +01:00
github-actions[bot]
6f6cf23bc8 Version Packages 2025-03-27 17:38:35 +00:00
Guido D'Orsi
77a718656c Merge pull request #1741 from garden-co/issue-1373
fix: fixes expected header to be sent in first message error
2025-03-27 18:35:27 +01:00
Guido D'Orsi
6c86c4f7ee fix: fixes expected header to be sent in first message error 2025-03-27 18:34:39 +01:00
Guido D'Orsi
72508332fb Merge pull request #1728 from garden-co/gio/update-otel-dep
chore: update @opentelemetry/api dependency
2025-03-27 18:29:38 +01:00
Guido D'Orsi
0ac88b4c80 test: repro for expected header to be sent in first message 2025-03-27 17:41:01 +01:00
Trisha Lim
71b93909e6 fix(inspector): install clsx, remove lucide-react (#1737)
* install clsx

* remove lucide-react

* add changeset
2025-03-27 21:02:06 +07:00
Guido D'Orsi
f379fcc176 Merge pull request #1730 from garden-co/changeset-release/main
Version Packages
2025-03-27 11:49:13 +01:00
github-actions[bot]
d6ea4d4662 Version Packages 2025-03-27 10:37:27 +00:00
Guido D'Orsi
84b5dd8a0b Merge pull request #1719 from garden-co/feat/react-create-image
feat: re-export createImage on jazz-react
2025-03-27 11:35:02 +01:00
Guido D'Orsi
c730016572 Merge pull request #1726 from garden-co/fix/inspector-covalue-types
fix(inspector): CoFeeds and FileStreams are showing as "CoStream"
2025-03-27 11:32:53 +01:00
Guido D'Orsi
7677ca5240 Merge pull request #1735 from garden-co/feat/optimize-subscription-updates
fix: trigger a single update when loading a locally available list of items
2025-03-27 11:25:22 +01:00
Guido D'Orsi
cffe482f75 fix: apply the sync resolution on the ref access only during fullfillDepth to avoid issues with Svelte 2025-03-27 10:51:34 +01:00
Guido D'Orsi
4019918b2b feat: re-export createImage on jazz-react 2025-03-27 09:48:49 +01:00
Guido D'Orsi
a140f555ba fix: trigger a single update when loading a locally available list of items 2025-03-26 19:02:31 +01:00
Guido D'Orsi
7b0d10a293 Merge pull request #1734 from garden-co/feat/optimize-group-role
perf: optimize Group.roleOf getter and made the transactions validation incremental for CoMap and CoFeed
2025-03-26 17:58:40 +01:00
Giordano Ricci
9d0c9dc6ea chore: update @opentelemetry/api dependency 2025-03-25 15:20:34 +00:00
Trisha Lim
2c3761c8e8 add changeset 2025-03-25 18:52:16 +07:00
Trisha Lim
c91bcf9745 inspector: show CoStream as CoFeed 2025-03-25 18:32:37 +07:00
Trisha Lim
c1db6e087a reuse use-resolve-covalue 2025-03-25 18:31:14 +07:00
Trisha Lim
9d8cc194e0 inspector: show files as FileStream instead of CoStream 2025-03-25 18:30:45 +07:00
132 changed files with 1469 additions and 489 deletions

View File

@@ -1,5 +0,0 @@
---
"cojson": patch
---
Performance: optimize Group.roleOf getter and made the transactions validation incremental for CoMap and CoFeed

View File

@@ -0,0 +1,5 @@
---
"jazz-tools": patch
---
Make the linkAccounts test utility wait for the accounts coValues to be synced

View File

@@ -1,5 +0,0 @@
---
"cojson": patch
---
Throw an error when the user tries to load an invalid or undefined id

View File

@@ -1,5 +0,0 @@
---
"jazz-tools": patch
---
Export CoFeedEntry type

View File

@@ -1,5 +1,25 @@
# chat-rn-clerk
## 1.0.89
### Patch Changes
- jazz-react-native@0.11.8
- jazz-react-native-auth-clerk@0.11.8
- jazz-tools@0.11.8
- jazz-react-native-media-images@0.11.8
## 1.0.88
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-react-native@0.11.7
- jazz-react-native-auth-clerk@0.11.7
- jazz-react-native-media-images@0.11.7
## 1.0.87
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "chat-rn-clerk",
"main": "index.js",
"version": "1.0.87",
"version": "1.0.89",
"scripts": {
"build": "expo export -p ios",
"start": "expo start",

View File

@@ -1,5 +1,21 @@
# chat-rn
## 1.0.85
### Patch Changes
- jazz-react-native@0.11.8
- jazz-tools@0.11.8
## 1.0.84
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-react-native@0.11.7
## 1.0.83
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "chat-rn",
"version": "1.0.83",
"version": "1.0.85",
"main": "index.js",
"scripts": {
"build": "expo export -p ios",

View File

@@ -1,5 +1,23 @@
# chat-vue
## 0.0.70
### Patch Changes
- jazz-browser@0.11.8
- jazz-tools@0.11.8
- jazz-vue@0.11.8
## 0.0.69
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-browser@0.11.7
- jazz-vue@0.11.7
## 0.0.68
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "chat-vue",
"version": "0.0.68",
"version": "0.0.70",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,26 @@
# jazz-example-chat
## 0.0.167
### Patch Changes
- Updated dependencies [71b9390]
- jazz-inspector@0.11.8
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.0.166
### Patch Changes
- Updated dependencies [2c3761c]
- Updated dependencies [a140f55]
- Updated dependencies [4019918]
- Updated dependencies [2b0d1b0]
- jazz-inspector@0.11.7
- jazz-tools@0.11.7
- jazz-react@0.11.7
## 0.0.165
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-chat",
"private": true,
"version": "0.0.165",
"version": "0.0.167",
"type": "module",
"scripts": {
"dev": "vite",
@@ -15,7 +15,6 @@
"dependencies": {
"clsx": "^2.0.0",
"hash-slash": "workspace:*",
"jazz-browser-media-images": "workspace:*",
"jazz-inspector": "workspace:*",
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",

View File

@@ -1,5 +1,4 @@
import { createImage } from "jazz-browser-media-images";
import { useAccount, useCoState } from "jazz-react";
import { createImage, useAccount, useCoState } from "jazz-react";
import { Account, ID } from "jazz-tools";
import { useState } from "react";
import { Chat, Message } from "./schema.ts";

View File

@@ -1,5 +1,24 @@
# minimal-auth-clerk
## 0.0.66
### Patch Changes
- jazz-react@0.11.8
- jazz-react-auth-clerk@0.11.8
- jazz-tools@0.11.8
## 0.0.65
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [4019918]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-react@0.11.7
- jazz-react-auth-clerk@0.11.7
## 0.0.64
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "clerk",
"private": true,
"version": "0.0.64",
"version": "0.0.66",
"type": "module",
"scripts": {
"dev": "vite",
@@ -13,7 +13,7 @@
"dependencies": {
"@clerk/clerk-react": "^5.4.1",
"jazz-react": "workspace:*",
"jazz-react-auth-clerk": "workspace:0.11.6",
"jazz-react-auth-clerk": "workspace:0.11.8",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"

View File

@@ -1,5 +1,21 @@
# file-share-svelte
## 0.0.50
### Patch Changes
- jazz-svelte@0.11.8
- jazz-tools@0.11.8
## 0.0.49
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-svelte@0.11.7
## 0.0.48
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "file-share-svelte",
"version": "0.0.48",
"version": "0.0.50",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,22 @@
# jazz-tailwind-demo-auth-starter
## 0.0.6
### Patch Changes
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.0.5
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [4019918]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-react@0.11.7
## 0.0.4
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "filestream",
"private": true,
"version": "0.0.4",
"version": "0.0.6",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,22 @@
# form
## 0.1.8
### Patch Changes
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.1.7
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [4019918]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-react@0.11.7
## 0.1.6
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "form",
"private": true,
"version": "0.1.6",
"version": "0.1.8",
"type": "module",
"scripts": {
"dev": "vite",
@@ -12,7 +12,6 @@
},
"dependencies": {
"hash-slash": "workspace:*",
"jazz-browser-media-images": "workspace:*",
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"react": "^18.3.1",

View File

@@ -1,5 +1,22 @@
# image-upload
## 0.0.64
### Patch Changes
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.0.63
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [4019918]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-react@0.11.7
## 0.0.62
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "image-upload",
"private": true,
"version": "0.0.62",
"version": "0.0.64",
"type": "module",
"scripts": {
"dev": "vite",
@@ -11,7 +11,6 @@
"format-and-lint:fix": "biome check . --write"
},
"dependencies": {
"jazz-browser-media-images": "workspace:*",
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"react": "^18.3.1",

View File

@@ -1,5 +1,4 @@
import { createImage } from "jazz-browser-media-images";
import { ProgressiveImg, useAccount } from "jazz-react";
import { ProgressiveImg, createImage, useAccount } from "jazz-react";
import { ChangeEvent, useEffect, useRef, useState } from "react";
export default function ImageUpload() {

View File

@@ -1,5 +1,28 @@
# jazz-example-inspector
## 0.0.117
### Patch Changes
- Updated dependencies [71b9390]
- Updated dependencies [6c86c4f]
- Updated dependencies [9d0c9dc]
- jazz-inspector@0.11.8
- cojson@0.11.8
- cojson-transport-ws@0.11.8
## 0.0.116
### Patch Changes
- 2c3761c: fix: CoFeed and FileStream are showing as CoStream
- Updated dependencies [2c3761c]
- Updated dependencies [2b94bc8]
- Updated dependencies [2957362]
- jazz-inspector@0.11.7
- cojson@0.11.7
- cojson-transport-ws@0.11.7
## 0.0.115
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-inspector-app",
"private": true,
"version": "0.0.115",
"version": "0.0.117",
"type": "module",
"scripts": {
"dev": "vite",
@@ -13,8 +13,8 @@
"dependencies": {
"jazz-inspector": "workspace:*",
"clsx": "^2.0.0",
"cojson": "workspace:0.11.6",
"cojson-transport-ws": "workspace:0.11.6",
"cojson": "workspace:0.11.8",
"cojson-transport-ws": "workspace:0.11.8",
"hash-slash": "workspace:0.2.2",
"lucide-react": "^0.274.0",
"react": "^18.3.1",

View File

@@ -17,9 +17,9 @@ import {
PageStack,
Select,
} from "jazz-inspector";
import { resolveCoValue, useResolvedCoValue } from "jazz-inspector";
import React, { useState, useEffect } from "react";
import { usePagePath } from "./use-page-path";
import { resolveCoValue, useResolvedCoValue } from "./use-resolve-covalue";
interface Account {
id: CoID<RawAccount>;

View File

@@ -1,216 +0,0 @@
import { CoID, LocalNode, RawBinaryCoStream, RawCoValue } from "cojson";
import { useEffect, useState } from "react";
export type CoJsonType = "comap" | "costream" | "colist";
export type ExtendedCoJsonType = "image" | "record" | "account" | "group";
type JSON = string | number | boolean | null | JSON[] | { [key: string]: JSON };
type JSONObject = { [key: string]: JSON };
type ResolvedImageDefinition = {
originalSize: [number, number];
placeholderDataURL?: string;
[res: `${number}x${number}`]: RawBinaryCoStream["id"];
};
// Type guard for browser image
export const isBrowserImage = (
coValue: JSONObject,
): coValue is ResolvedImageDefinition => {
return "originalSize" in coValue && "placeholderDataURL" in coValue;
};
export type ResolvedGroup = {
readKey: string;
[key: string]: JSON;
};
export const isGroup = (coValue: JSONObject): coValue is ResolvedGroup => {
return "readKey" in coValue;
};
export type ResolvedAccount = {
profile: {
name: string;
};
[key: string]: JSON;
};
export const isAccount = (coValue: JSONObject): coValue is ResolvedAccount => {
return isGroup(coValue) && "profile" in coValue;
};
export async function resolveCoValue(
coValueId: CoID<RawCoValue>,
node: LocalNode,
): Promise<
| {
value: RawCoValue;
snapshot: JSONObject;
type: CoJsonType | null;
extendedType: ExtendedCoJsonType | undefined;
}
| {
value: undefined;
snapshot: "unavailable";
type: null;
extendedType: undefined;
}
> {
const value = await node.load(coValueId);
if (value === "unavailable") {
return {
value: undefined,
snapshot: "unavailable",
type: null,
extendedType: undefined,
};
}
const snapshot = value.toJSON() as JSONObject;
const type = value.type as CoJsonType;
// Determine extended type
let extendedType: ExtendedCoJsonType | undefined;
if (type === "comap") {
if (isBrowserImage(snapshot)) {
extendedType = "image";
} else if (isAccount(snapshot)) {
extendedType = "account";
} else if (isGroup(snapshot)) {
extendedType = "group";
} else {
// This check is a bit of a hack
// There might be a better way to do this
const children = Object.values(snapshot).slice(0, 10);
if (
children.every((c) => typeof c === "string" && c.startsWith("co_")) &&
children.length > 3
) {
extendedType = "record";
}
}
}
return {
value,
snapshot,
type,
extendedType,
};
}
function subscribeToCoValue(
coValueId: CoID<RawCoValue>,
node: LocalNode,
callback: (result: Awaited<ReturnType<typeof resolveCoValue>>) => void,
) {
return node.subscribe(coValueId, (value) => {
if (value === "unavailable") {
callback({
value: undefined,
snapshot: "unavailable",
type: null,
extendedType: undefined,
});
} else {
const snapshot = value.toJSON() as JSONObject;
const type = value.type as CoJsonType;
let extendedType: ExtendedCoJsonType | undefined;
if (type === "comap") {
if (isBrowserImage(snapshot)) {
extendedType = "image";
} else if (isAccount(snapshot)) {
extendedType = "account";
} else if (isGroup(snapshot)) {
extendedType = "group";
} else {
const children = Object.values(snapshot).slice(0, 10);
if (
children.every(
(c) => typeof c === "string" && c.startsWith("co_"),
) &&
children.length > 3
) {
extendedType = "record";
}
}
}
callback({
value,
snapshot,
type,
extendedType,
});
}
});
}
export function useResolvedCoValue(
coValueId: CoID<RawCoValue>,
node: LocalNode,
) {
const [result, setResult] =
useState<Awaited<ReturnType<typeof resolveCoValue>>>();
useEffect(() => {
let isMounted = true;
const unsubscribe = subscribeToCoValue(coValueId, node, (newResult) => {
if (isMounted) {
setResult(newResult);
}
});
return () => {
isMounted = false;
unsubscribe();
};
}, [coValueId, node]);
return (
result || {
value: undefined,
snapshot: undefined,
type: undefined,
extendedType: undefined,
}
);
}
export function useResolvedCoValues(
coValueIds: CoID<RawCoValue>[],
node: LocalNode,
) {
const [results, setResults] = useState<
Awaited<ReturnType<typeof resolveCoValue>>[]
>([]);
useEffect(() => {
let isMounted = true;
const unsubscribes: (() => void)[] = [];
coValueIds.forEach((coValueId, index) => {
const unsubscribe = subscribeToCoValue(coValueId, node, (newResult) => {
if (isMounted) {
setResults((prevResults) => {
const newResults = [...prevResults];
newResults[index] = newResult;
return newResults;
});
}
});
unsubscribes.push(unsubscribe);
});
return () => {
isMounted = false;
unsubscribes.forEach((unsubscribe) => unsubscribe());
};
}, [coValueIds, node]);
return results;
}

View File

@@ -0,0 +1,3 @@
VITE_CURSOR_FEED_ID=multi-cursors-250425-1708
VITE_GROUP_ID=co_zXE8C8sd9QxEbxnt3neRvFRPFUc
VITE_OLD_CURSOR_AGE_SECONDS=36000

View File

@@ -0,0 +1,18 @@
# multi-cursors
## 0.0.60
### Patch Changes
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.0.59
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [4019918]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-react@0.11.7

View File

@@ -1,7 +1,7 @@
{
"name": "multi-cursors",
"private": true,
"version": "0.0.58",
"version": "0.0.60",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,24 @@
# multiauth
## 0.0.7
### Patch Changes
- jazz-react@0.11.8
- jazz-react-auth-clerk@0.11.8
- jazz-tools@0.11.8
## 0.0.6
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [4019918]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-react@0.11.7
- jazz-react-auth-clerk@0.11.7
## 0.0.5
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "multiauth",
"private": true,
"version": "0.0.5",
"version": "0.0.7",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,26 @@
# jazz-example-musicplayer
## 0.0.88
### Patch Changes
- Updated dependencies [71b9390]
- jazz-inspector@0.11.8
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.0.87
### Patch Changes
- Updated dependencies [2c3761c]
- Updated dependencies [a140f55]
- Updated dependencies [4019918]
- Updated dependencies [2b0d1b0]
- jazz-inspector@0.11.7
- jazz-tools@0.11.7
- jazz-react@0.11.7
## 0.0.86
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-music-player",
"private": true,
"version": "0.0.86",
"version": "0.0.88",
"type": "module",
"scripts": {
"dev": "vite",
@@ -22,8 +22,8 @@
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"jazz-inspector": "workspace:*",
"jazz-react": "workspace:0.11.6",
"jazz-tools": "workspace:0.11.6",
"jazz-react": "workspace:0.11.8",
"jazz-tools": "workspace:0.11.8",
"lucide-react": "^0.274.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",

View File

@@ -1,5 +1,22 @@
# organization
## 0.0.60
### Patch Changes
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.0.59
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [4019918]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-react@0.11.7
## 0.0.58
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "organization",
"private": true,
"version": "0.0.58",
"version": "0.0.60",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,17 @@
# passkey-svelte
## 0.0.54
### Patch Changes
- jazz-svelte@0.11.8
## 0.0.53
### Patch Changes
- jazz-svelte@0.11.7
## 0.0.52
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "passkey-svelte",
"version": "0.0.52",
"version": "0.0.54",
"type": "module",
"private": true,
"scripts": {

View File

@@ -1,5 +1,22 @@
# minimal-auth-passkey
## 0.0.65
### Patch Changes
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.0.64
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [4019918]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-react@0.11.7
## 0.0.63
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "passkey",
"private": true,
"version": "0.0.63",
"version": "0.0.65",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,22 @@
# passphrase
## 0.0.62
### Patch Changes
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.0.61
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [4019918]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-react@0.11.7
## 0.0.60
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "passphrase",
"private": true,
"version": "0.0.60",
"version": "0.0.62",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,22 @@
# jazz-password-manager
## 0.0.86
### Patch Changes
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.0.85
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [4019918]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-react@0.11.7
## 0.0.84
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-password-manager",
"private": true,
"version": "0.0.84",
"version": "0.0.86",
"type": "module",
"scripts": {
"dev": "vite",
@@ -12,8 +12,8 @@
"clean-install": "rm -rf node_modules pnpm-lock.yaml && pnpm install"
},
"dependencies": {
"jazz-react": "workspace:0.11.6",
"jazz-tools": "workspace:0.11.6",
"jazz-react": "workspace:0.11.8",
"jazz-tools": "workspace:0.11.8",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.41.5",

View File

@@ -1,5 +1,22 @@
# jazz-example-pets
## 0.0.184
### Patch Changes
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.0.183
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [4019918]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-react@0.11.7
## 0.0.182
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-pets",
"private": true,
"version": "0.0.182",
"version": "0.0.184",
"type": "module",
"scripts": {
"dev": "vite",
@@ -19,9 +19,8 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"jazz-browser-media-images": "workspace:0.11.6",
"jazz-react": "workspace:0.11.6",
"jazz-tools": "workspace:0.11.6",
"jazz-react": "workspace:0.11.8",
"jazz-tools": "workspace:0.11.8",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",
"react": "^18.3.1",
@@ -41,7 +40,7 @@
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.20",
"is-ci": "^3.0.1",
"jazz-run": "workspace:0.11.6",
"jazz-run": "workspace:0.11.8",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.2",

View File

@@ -1,10 +1,8 @@
import { createImage } from "jazz-browser-media-images";
/* eslint-disable react-hooks/exhaustive-deps */
import { ChangeEvent, useCallback, useState } from "react";
import { useNavigate } from "react-router";
import { ProgressiveImg } from "jazz-react";
import { useAccount, useCoState } from "jazz-react";
import { createImage, useAccount, useCoState } from "jazz-react";
import { CoMap, Group, ID, ImageDefinition, co } from "jazz-tools";
import { PetPost, PetReactions } from "./1_schema";
import { Button, Input } from "./basicComponents";

View File

@@ -1,5 +1,22 @@
# reactions
## 0.0.64
### Patch Changes
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.0.63
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [4019918]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-react@0.11.7
## 0.0.62
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "reactions",
"private": true,
"version": "0.0.62",
"version": "0.0.64",
"type": "module",
"scripts": {
"dev": "vite",
@@ -12,7 +12,6 @@
},
"dependencies": {
"hash-slash": "workspace:*",
"jazz-browser-media-images": "workspace:*",
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"react": "^18.3.1",

View File

@@ -1,5 +1,23 @@
# todo-vue
## 0.0.68
### Patch Changes
- jazz-browser@0.11.8
- jazz-tools@0.11.8
- jazz-vue@0.11.8
## 0.0.67
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-browser@0.11.7
- jazz-vue@0.11.7
## 0.0.66
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "todo-vue",
"version": "0.0.66",
"version": "0.0.68",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,22 @@
# jazz-example-todo
## 0.0.183
### Patch Changes
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.0.182
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [4019918]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-react@0.11.7
## 0.0.181
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-todo",
"private": true,
"version": "0.0.181",
"version": "0.0.183",
"type": "module",
"scripts": {
"dev": "vite",
@@ -16,8 +16,8 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"jazz-react": "workspace:0.11.6",
"jazz-tools": "workspace:0.11.6",
"jazz-react": "workspace:0.11.8",
"jazz-tools": "workspace:0.11.8",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",
"react": "^18.3.1",

View File

@@ -1,5 +1,26 @@
# version-history
## 0.0.61
### Patch Changes
- Updated dependencies [71b9390]
- jazz-inspector@0.11.8
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.0.60
### Patch Changes
- Updated dependencies [2c3761c]
- Updated dependencies [a140f55]
- Updated dependencies [4019918]
- Updated dependencies [2b0d1b0]
- jazz-inspector@0.11.7
- jazz-tools@0.11.7
- jazz-react@0.11.7
## 0.0.59
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "version-history",
"private": true,
"version": "0.0.59",
"version": "0.0.61",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,23 @@
# cojson-storage-indexeddb
## 0.11.8
### Patch Changes
- Updated dependencies [6c86c4f]
- Updated dependencies [9d0c9dc]
- cojson@0.11.8
- cojson-storage@0.11.8
## 0.11.7
### Patch Changes
- Updated dependencies [2b94bc8]
- Updated dependencies [2957362]
- cojson@0.11.7
- cojson-storage@0.11.7
## 0.11.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "cojson-storage-indexeddb",
"version": "0.11.6",
"version": "0.11.8",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,23 @@
# cojson-storage-sqlite
## 0.11.8
### Patch Changes
- Updated dependencies [6c86c4f]
- Updated dependencies [9d0c9dc]
- cojson@0.11.8
- cojson-storage@0.11.8
## 0.11.7
### Patch Changes
- Updated dependencies [2b94bc8]
- Updated dependencies [2957362]
- cojson@0.11.7
- cojson-storage@0.11.7
## 0.11.6
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "cojson-storage-rn-sqlite",
"type": "module",
"version": "0.11.6",
"version": "0.11.8",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",

View File

@@ -1,5 +1,23 @@
# cojson-storage-sqlite
## 0.11.8
### Patch Changes
- Updated dependencies [6c86c4f]
- Updated dependencies [9d0c9dc]
- cojson@0.11.8
- cojson-storage@0.11.8
## 0.11.7
### Patch Changes
- Updated dependencies [2b94bc8]
- Updated dependencies [2957362]
- cojson@0.11.7
- cojson-storage@0.11.7
## 0.11.6
### Patch Changes

View File

@@ -1,13 +1,13 @@
{
"name": "cojson-storage-sqlite",
"type": "module",
"version": "0.11.6",
"version": "0.11.8",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",
"dependencies": {
"better-sqlite3": "^11.7.0",
"cojson": "workspace:0.11.6",
"cojson": "workspace:0.11.8",
"cojson-storage": "workspace:*"
},
"devDependencies": {

View File

@@ -1,5 +1,21 @@
# cojson-storage
## 0.11.8
### Patch Changes
- Updated dependencies [6c86c4f]
- Updated dependencies [9d0c9dc]
- cojson@0.11.8
## 0.11.7
### Patch Changes
- Updated dependencies [2b94bc8]
- Updated dependencies [2957362]
- cojson@0.11.7
## 0.11.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "cojson-storage",
"version": "0.11.6",
"version": "0.11.8",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,21 @@
# cojson-transport-nodejs-ws
## 0.11.8
### Patch Changes
- Updated dependencies [6c86c4f]
- Updated dependencies [9d0c9dc]
- cojson@0.11.8
## 0.11.7
### Patch Changes
- Updated dependencies [2b94bc8]
- Updated dependencies [2957362]
- cojson@0.11.7
## 0.11.6
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "cojson-transport-ws",
"type": "module",
"version": "0.11.6",
"version": "0.11.8",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",

View File

@@ -1,5 +1,19 @@
# cojson
## 0.11.8
### Patch Changes
- 6c86c4f: Fix "Expected header to be sent in first message error" on sync
- 9d0c9dc: Update @opentelemetry/api dependency
## 0.11.7
### Patch Changes
- 2b94bc8: Performance: optimize Group.roleOf getter and made the transactions validation incremental for CoMap and CoFeed
- 2957362: Throw an error when the user tries to load an invalid or undefined id
## 0.11.6
### Patch Changes

View File

@@ -25,9 +25,9 @@
},
"type": "module",
"license": "MIT",
"version": "0.11.6",
"version": "0.11.8",
"devDependencies": {
"@opentelemetry/sdk-metrics": "^1.29.0",
"@opentelemetry/sdk-metrics": "^2.0.0",
"typescript": "~5.6.2",
"vitest": "3.0.5"
},
@@ -35,7 +35,7 @@
"@noble/ciphers": "^0.1.3",
"@noble/curves": "^1.3.0",
"@noble/hashes": "^1.4.0",
"@opentelemetry/api": "^1.0.0",
"@opentelemetry/api": "^1.9.0",
"@scure/base": "1.2.1",
"jazz-crypto-rs": "0.0.6",
"neverthrow": "^7.0.1",

View File

@@ -277,6 +277,7 @@ export class LocalNode {
});
}
// TODO: What if the loading fails because in the previous loadCoValueCore call the Peer with the covalue was skipped?
return entry.getCoValue();
}

View File

@@ -528,12 +528,36 @@ export class SyncManager {
let coValue: CoValueCore;
/**
* The new content might come while the coValue is loading or is not loaded yet.
*
* This might happen when we restart the server because:
* - The client known state assumes that the coValue is available on the server
* - The server might not have loaded the coValue yet because it was not requested
*
* In this case we need to load the coValue from the storage or other peers.
*
* If this load fails we send a correction request, because the client has the wrong assumption that
* we have the coValue while we don't.
*/
if (entry.state.type !== "available" && !msg.header) {
await this.local.loadCoValueCore(msg.id, peer.id);
}
if (entry.state.type !== "available") {
if (!msg.header) {
logger.error("Expected header to be sent in first message", {
coValueId: msg.id,
peerId: peer.id,
peerRole: peer.role,
this.trySendToPeer(peer, {
action: "known",
isCorrection: true,
id: msg.id,
header: false,
sessions: {},
}).catch((e) => {
logger.error("Error sending known state correction", {
peerId: peer.id,
peerRole: peer.role,
err: e,
});
});
return;
}

View File

@@ -1,5 +1,27 @@
# jazz-browser-media-images
## 0.11.8
### Patch Changes
- Updated dependencies [6c86c4f]
- Updated dependencies [9d0c9dc]
- cojson@0.11.8
- jazz-browser@0.11.8
- jazz-tools@0.11.8
## 0.11.7
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [2b94bc8]
- Updated dependencies [2957362]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- cojson@0.11.7
- jazz-browser@0.11.7
## 0.11.6
### Patch Changes

View File

@@ -1,14 +1,14 @@
{
"name": "jazz-auth-clerk",
"version": "0.11.6",
"version": "0.11.8",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",
"dependencies": {
"cojson": "workspace:0.11.6",
"jazz-browser": "workspace:0.11.6",
"jazz-tools": "workspace:0.11.6"
"cojson": "workspace:0.11.8",
"jazz-browser": "workspace:0.11.8",
"jazz-tools": "workspace:0.11.8"
},
"scripts": {
"format-and-lint": "biome check .",

View File

@@ -1,5 +1,21 @@
# jazz-browser-media-images
## 0.11.8
### Patch Changes
- jazz-browser@0.11.8
- jazz-tools@0.11.8
## 0.11.7
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-browser@0.11.7
## 0.11.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-browser-media-images",
"version": "0.11.6",
"version": "0.11.8",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -8,8 +8,8 @@
"dependencies": {
"@types/image-blob-reduce": "^4.1.1",
"image-blob-reduce": "^4.1.0",
"jazz-browser": "workspace:0.11.6",
"jazz-tools": "workspace:0.11.6",
"jazz-browser": "workspace:0.11.8",
"jazz-tools": "workspace:0.11.8",
"pica": "^9.0.1",
"typescript": "~5.6.2"
},

View File

@@ -1,5 +1,29 @@
# jazz-browser
## 0.11.8
### Patch Changes
- Updated dependencies [6c86c4f]
- Updated dependencies [9d0c9dc]
- cojson@0.11.8
- cojson-storage-indexeddb@0.11.8
- cojson-transport-ws@0.11.8
- jazz-tools@0.11.8
## 0.11.7
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [2b94bc8]
- Updated dependencies [2957362]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- cojson@0.11.7
- cojson-storage-indexeddb@0.11.7
- cojson-transport-ws@0.11.7
## 0.11.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-browser",
"version": "0.11.6",
"version": "0.11.8",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,29 @@
# jazz-inspector
## 0.11.8
### Patch Changes
- 71b9390: install clsx, remove lucide-react
- Updated dependencies [6c86c4f]
- Updated dependencies [9d0c9dc]
- cojson@0.11.8
- jazz-react-core@0.11.8
- jazz-tools@0.11.8
## 0.11.7
### Patch Changes
- 2c3761c: fix: CoFeed and FileStream are showing as CoStream
- Updated dependencies [a140f55]
- Updated dependencies [2b94bc8]
- Updated dependencies [2957362]
- Updated dependencies [2b0d1b0]
- jazz-react-core@0.11.7
- jazz-tools@0.11.7
- cojson@0.11.7
## 0.11.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-inspector",
"version": "0.11.6",
"version": "0.11.8",
"type": "module",
"main": "./dist/app.js",
"types": "./dist/app.d.ts",
@@ -19,10 +19,10 @@
"@twind/core": "^1.1.3",
"@twind/preset-autoprefix": "^1.0.7",
"@twind/preset-tailwind": "^1.1.4",
"clsx": "^2.0.0",
"cojson": "workspace:*",
"jazz-react-core": "workspace:*",
"jazz-tools": "workspace:*",
"lucide-react": "^0.274.0"
"jazz-tools": "workspace:*"
},
"peerDependencies": {
"react": "^17.0.0 || ^18.0.0 || ^19.0.0"

View File

@@ -10,4 +10,9 @@ export { Input } from "./ui/input.js";
export { Select } from "./ui/select.js";
export { Icon } from "./ui/icon.js";
export {
resolveCoValue,
useResolvedCoValue,
} from "./viewer/use-resolve-covalue.js";
export type { PageInfo } from "./viewer/types.js";

View File

@@ -1,25 +1,10 @@
import {
CheckIcon,
ChevronDown,
ChevronRight,
ClipboardIcon,
LinkIcon,
type LucideIcon,
TrashIcon,
UserIcon,
XIcon,
} from "lucide-react";
import { classNames } from "../utils.js";
import { ChevronDownIcon } from "./icons/chevron-down-icon.js";
import { DeleteIcon } from "./icons/delete-icon.js";
const icons = {
auth: UserIcon,
check: CheckIcon,
chevronRight: ChevronRight,
chevronDown: ChevronDown,
close: XIcon,
copy: ClipboardIcon,
delete: TrashIcon,
link: LinkIcon,
chevronDown: ChevronDownIcon,
delete: DeleteIcon,
};
// copied from tailwind line height https://tailwindcss.com/docs/font-size
@@ -59,17 +44,15 @@ const strokeWidths = {
export function Icon({
name,
icon,
size = "md",
className,
...svgProps
}: {
name?: string;
icon?: LucideIcon;
size?: keyof typeof sizes;
className?: string;
} & React.SVGProps<SVGSVGElement>) {
if (!icon && (!name || !icons.hasOwnProperty(name))) {
if (!name || !icons.hasOwnProperty(name)) {
throw new Error(`Icon not found: ${name}`);
}

View File

@@ -0,0 +1,16 @@
export function ChevronDownIcon(props: React.SVGProps<SVGSVGElement>) {
return (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinejoin="round"
>
<path d="m6 9 6 6 6-6" />
</svg>
);
}

View File

@@ -0,0 +1,19 @@
export function DeleteIcon(props: React.SVGProps<SVGSVGElement>) {
return (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinejoin="round"
className="lucide lucide-trash-icon lucide-trash"
>
<path d="M3 6h18" />
<path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" />
<path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" />
</svg>
);
}

View File

@@ -1,4 +1,4 @@
import { classNames } from "./utils.js";
import { classNames } from "../../utils.js";
export function LinkIcon() {
return (

View File

@@ -25,7 +25,7 @@ function isBinaryStreamStart(item: unknown): item is BinaryStreamStart {
);
}
function detectCoStreamType(value: RawCoStream | RawBinaryCoStream) {
export function detectCoStreamType(value: RawCoStream | RawBinaryCoStream) {
const firstKey = Object.keys(value.items)[0];
if (!firstKey)
return {

View File

@@ -1,13 +1,13 @@
import { CoID, LocalNode, RawCoValue } from "cojson";
import type { JsonObject } from "cojson";
import { useMemo, useState } from "react";
import { LinkIcon } from "../link-icon.js";
import { Button } from "../ui/button.js";
import { Icon } from "../ui/icon.js";
import { classNames } from "../utils.js";
import { PageInfo } from "./types.js";
import { useResolvedCoValues } from "./use-resolve-covalue.js";
import { ValueRenderer } from "./value-renderer.js";
import { classNames } from "../utils.js";
export function TableView({
data,
node,
@@ -87,7 +87,7 @@ export function TableView({
])
}
>
<LinkIcon />
<Icon name="link" />
</Button>
</td>
{keys.map((key) => (

View File

@@ -18,10 +18,11 @@ export const TypeIcon = ({
record: "{} Record",
image: "🖼️ Image",
comap: "{} CoMap",
costream: "≋ CoStream",
costream: "≋ CoFeed",
colist: "☰ CoList",
account: "👤 Account",
group: "👥 Group",
file: "📃 FileStream",
};
const iconKey = extendedType || type;

View File

@@ -1,8 +1,20 @@
import { CoID, LocalNode, RawBinaryCoStream, RawCoValue } from "cojson";
import {
CoID,
LocalNode,
RawBinaryCoStream,
RawCoStream,
RawCoValue,
} from "cojson";
import { useEffect, useState } from "react";
import { detectCoStreamType } from "./co-stream-view.js";
export type CoJsonType = "comap" | "costream" | "colist";
export type ExtendedCoJsonType = "image" | "record" | "account" | "group";
export type ExtendedCoJsonType =
| "image"
| "record"
| "account"
| "group"
| "file";
type JSON = string | number | boolean | null | JSON[] | { [key: string]: JSON };
type JSONObject = { [key: string]: JSON };
@@ -138,6 +150,12 @@ function subscribeToCoValue(
extendedType = "record";
}
}
} else if (type === "costream") {
const coStream = detectCoStreamType(value as RawCoStream);
if (coStream.type === "binary") {
extendedType = "file";
}
}
callback({

View File

@@ -1,7 +1,7 @@
import { CoID, JsonValue, LocalNode, RawCoValue } from "cojson";
import React, { useEffect, useState } from "react";
import { LinkIcon } from "../link-icon.js";
import { Button } from "../ui/button.js";
import { Icon } from "../ui/icon.js";
import { classNames } from "../utils.js";
import {
isBrowserImage,
@@ -35,7 +35,7 @@ export function ValueRenderer({
const content = (
<>
{json}
{onCoIDClick && <LinkIcon />}
{onCoIDClick && <Icon name="link" />}
</>
);

View File

@@ -1,5 +1,27 @@
# jazz-autosub
## 0.11.8
### Patch Changes
- Updated dependencies [6c86c4f]
- Updated dependencies [9d0c9dc]
- cojson@0.11.8
- cojson-transport-ws@0.11.8
- jazz-tools@0.11.8
## 0.11.7
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [2b94bc8]
- Updated dependencies [2957362]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- cojson@0.11.7
- cojson-transport-ws@0.11.7
## 0.11.6
### Patch Changes

View File

@@ -5,7 +5,7 @@
"types": "dist/index.d.ts",
"type": "module",
"license": "MIT",
"version": "0.11.6",
"version": "0.11.8",
"dependencies": {
"cojson": "workspace:*",
"cojson-transport-ws": "workspace:*",

View File

@@ -1,5 +1,32 @@
# jazz-browser-media-images
## 0.11.8
### Patch Changes
- Updated dependencies [6c86c4f]
- Updated dependencies [9d0c9dc]
- cojson@0.11.8
- jazz-auth-clerk@0.11.8
- jazz-browser@0.11.8
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.11.7
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [2b94bc8]
- Updated dependencies [4019918]
- Updated dependencies [2957362]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- cojson@0.11.7
- jazz-react@0.11.7
- jazz-auth-clerk@0.11.7
- jazz-browser@0.11.7
## 0.11.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react-auth-clerk",
"version": "0.11.6",
"version": "0.11.8",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,26 @@
# jazz-react-core
## 0.11.8
### Patch Changes
- Updated dependencies [6c86c4f]
- Updated dependencies [9d0c9dc]
- cojson@0.11.8
- jazz-tools@0.11.8
## 0.11.7
### Patch Changes
- a140f55: Bugfix: Trigger a single update when loading a locally available list of items
- Updated dependencies [a140f55]
- Updated dependencies [2b94bc8]
- Updated dependencies [2957362]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- cojson@0.11.7
## 0.11.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react-core",
"version": "0.11.6",
"version": "0.11.8",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,7 +1,7 @@
// @vitest-environment happy-dom
import { cojsonInternals } from "cojson";
import { CoMap, CoValue, ID, co } from "jazz-tools";
import { CoList, CoMap, CoValue, ID, co } from "jazz-tools";
import { beforeEach, describe, expect, expectTypeOf, it } from "vitest";
import { useCoState } from "../index.js";
import { createJazzTestAccount, setupJazzTestSync } from "../testing.js";
@@ -197,4 +197,40 @@ describe("useCoState", () => {
expect(result.current?.value).toBeUndefined();
});
it("should only render twice when loading a list of values", async () => {
class TestMap extends CoMap {
value = co.string;
}
class TestList extends CoList.Of(co.ref(TestMap)) {}
const account = await createJazzTestAccount({
isCurrentActiveAccount: true,
});
const list = TestList.create([
TestMap.create({ value: "1" }),
TestMap.create({ value: "2" }),
TestMap.create({ value: "3" }),
TestMap.create({ value: "4" }),
TestMap.create({ value: "5" }),
]);
let renderCount = 0;
renderHook(
() => {
renderCount++;
useCoState(TestList, list.id, [{}]);
},
{
account,
},
);
await new Promise((resolve) => setTimeout(resolve, 100));
expect(renderCount).toBe(2);
});
});

View File

@@ -15,7 +15,7 @@ describe("useInboxSender", () => {
const account = await createJazzTestAccount();
const inboxReceiver = await createJazzTestAccount();
linkAccounts(account, inboxReceiver);
await linkAccounts(account, inboxReceiver);
const { result } = renderHook(
() => experimental_useInboxSender<TestMap, TestMap>(inboxReceiver.id),

View File

@@ -1,5 +1,29 @@
# jazz-react-native-auth-clerk
## 0.11.8
### Patch Changes
- Updated dependencies [6c86c4f]
- Updated dependencies [9d0c9dc]
- cojson@0.11.8
- jazz-auth-clerk@0.11.8
- jazz-react-native@0.11.8
- jazz-tools@0.11.8
## 0.11.7
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [2b94bc8]
- Updated dependencies [2957362]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- cojson@0.11.7
- jazz-react-native@0.11.7
- jazz-auth-clerk@0.11.7
## 0.11.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react-native-auth-clerk",
"version": "0.11.6",
"version": "0.11.8",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,19 @@
# jazz-browser-media-images
## 0.11.8
### Patch Changes
- jazz-tools@0.11.8
## 0.11.7
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
## 0.11.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react-native-media-images",
"version": "0.11.6",
"version": "0.11.8",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

Some files were not shown because too many files have changed in this diff Show More