Compare commits

...

13 Commits

Author SHA1 Message Date
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
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
110 changed files with 782 additions and 404 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

@@ -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,16 @@
# chat-rn-clerk
## 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.88",
"scripts": {
"build": "expo export -p ios",
"start": "expo start",

View File

@@ -1,5 +1,14 @@
# chat-rn
## 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.84",
"main": "index.js",
"scripts": {
"build": "expo export -p ios",

View File

@@ -1,5 +1,15 @@
# chat-vue
## 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.69",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,17 @@
# jazz-example-chat
## 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.166",
"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,16 @@
# minimal-auth-clerk
## 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.65",
"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.7",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"

View File

@@ -1,5 +1,14 @@
# file-share-svelte
## 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.49",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,15 @@
# jazz-tailwind-demo-auth-starter
## 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.5",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,15 @@
# form
## 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.7",
"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,15 @@
# image-upload
## 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.63",
"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,17 @@
# jazz-example-inspector
## 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.116",
"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.7",
"cojson-transport-ws": "workspace:0.11.7",
"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,11 @@
# multi-cursors
## 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.59",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,16 @@
# multiauth
## 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.6",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,17 @@
# jazz-example-musicplayer
## 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.87",
"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.7",
"jazz-tools": "workspace:0.11.7",
"lucide-react": "^0.274.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",

View File

@@ -1,5 +1,15 @@
# organization
## 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.59",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,11 @@
# passkey-svelte
## 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.53",
"type": "module",
"private": true,
"scripts": {

View File

@@ -1,5 +1,15 @@
# minimal-auth-passkey
## 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.64",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,15 @@
# passphrase
## 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.61",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,15 @@
# jazz-password-manager
## 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.85",
"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.7",
"jazz-tools": "workspace:0.11.7",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.41.5",

View File

@@ -1,5 +1,15 @@
# jazz-example-pets
## 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.183",
"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.7",
"jazz-tools": "workspace:0.11.7",
"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.7",
"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,15 @@
# reactions
## 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.63",
"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,15 @@
# todo-vue
## 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.67",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,15 @@
# jazz-example-todo
## 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.182",
"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.7",
"jazz-tools": "workspace:0.11.7",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",
"react": "^18.3.1",

View File

@@ -1,5 +1,17 @@
# version-history
## 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.60",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,14 @@
# cojson-storage-indexeddb
## 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.7",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,14 @@
# cojson-storage-sqlite
## 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.7",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",

View File

@@ -1,5 +1,14 @@
# cojson-storage-sqlite
## 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.7",
"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.7",
"cojson-storage": "workspace:*"
},
"devDependencies": {

View File

@@ -1,5 +1,13 @@
# cojson-storage
## 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.7",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,13 @@
# cojson-transport-nodejs-ws
## 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.7",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",

View File

@@ -1,5 +1,12 @@
# cojson
## 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,7 +25,7 @@
},
"type": "module",
"license": "MIT",
"version": "0.11.6",
"version": "0.11.7",
"devDependencies": {
"@opentelemetry/sdk-metrics": "^1.29.0",
"typescript": "~5.6.2",

View File

@@ -1,5 +1,17 @@
# jazz-browser-media-images
## 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.7",
"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.7",
"jazz-browser": "workspace:0.11.7",
"jazz-tools": "workspace:0.11.7"
},
"scripts": {
"format-and-lint": "biome check .",

View File

@@ -1,5 +1,14 @@
# jazz-browser-media-images
## 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.7",
"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.7",
"jazz-tools": "workspace:0.11.7",
"pica": "^9.0.1",
"typescript": "~5.6.2"
},

View File

@@ -1,5 +1,18 @@
# jazz-browser
## 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.7",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,18 @@
# jazz-inspector
## 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.7",
"type": "module",
"main": "./dist/app.js",
"types": "./dist/app.d.ts",

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

@@ -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

@@ -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,5 +1,17 @@
# jazz-autosub
## 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.7",
"dependencies": {
"cojson": "workspace:*",
"cojson-transport-ws": "workspace:*",

View File

@@ -1,5 +1,20 @@
# jazz-browser-media-images
## 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.7",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,17 @@
# jazz-react-core
## 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.7",
"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

@@ -1,5 +1,18 @@
# jazz-react-native-auth-clerk
## 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.7",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,13 @@
# jazz-browser-media-images
## 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.7",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,20 @@
# jazz-browser
## 0.11.7
### Patch Changes
- 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
- jazz-react-native-media-images@0.11.7
- cojson-storage-rn-sqlite@0.11.7
- cojson-transport-ws@0.11.7
## 0.11.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react-native",
"version": "0.11.6",
"version": "0.11.7",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -31,6 +31,7 @@
"cojson-transport-ws": "workspace:*",
"jazz-react-core": "workspace:*",
"jazz-tools": "workspace:*",
"jazz-react-native-media-images": "workspace:*",
"react-native-nitro-modules": "0.21.0",
"react-native-quick-crypto": "1.0.0-beta.12"
},

View File

@@ -1,5 +1,20 @@
# jazz-react
## 0.11.7
### Patch Changes
- 4019918: Re-export createImage from jazz-browser-media-images
- 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
- jazz-browser@0.11.7
- jazz-browser-media-images@0.11.7
## 0.11.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react",
"version": "0.11.6",
"version": "0.11.7",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -17,10 +17,11 @@
},
"dependencies": {
"@scure/bip39": "^1.3.0",
"cojson": "workspace:0.11.6",
"jazz-browser": "workspace:0.11.6",
"jazz-react-core": "workspace:*",
"jazz-tools": "workspace:0.11.6"
"cojson": "workspace:0.11.7",
"jazz-browser-media-images": "workspace:0.11.7",
"jazz-browser": "workspace:0.11.7",
"jazz-react-core": "workspace:0.11.7",
"jazz-tools": "workspace:0.11.7"
},
"devDependencies": {
"@testing-library/dom": "^10.4.0",

View File

@@ -14,3 +14,4 @@ export { createInviteLink, parseInviteLink } from "jazz-browser";
export * from "./auth/auth.js";
export * from "./media.js";
export { createImage } from "jazz-browser-media-images";

View File

@@ -1,5 +1,18 @@
# jazz-run
## 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-sqlite@0.11.7
- cojson-transport-ws@0.11.7
## 0.11.6
### Patch Changes

View File

@@ -3,7 +3,7 @@
"bin": "./dist/index.js",
"type": "module",
"license": "MIT",
"version": "0.11.6",
"version": "0.11.7",
"exports": {
"./startSyncServer": {
"import": "./dist/startSyncServer.js",
@@ -27,11 +27,11 @@
"@effect/printer-ansi": "^0.34.5",
"@effect/schema": "^0.71.1",
"@effect/typeclass": "^0.25.5",
"cojson": "workspace:0.11.6",
"cojson-storage-sqlite": "workspace:0.11.6",
"cojson-transport-ws": "workspace:0.11.6",
"cojson": "workspace:0.11.7",
"cojson-storage-sqlite": "workspace:0.11.7",
"cojson-transport-ws": "workspace:0.11.7",
"effect": "^3.6.5",
"jazz-tools": "workspace:0.11.6",
"jazz-tools": "workspace:0.11.7",
"ws": "^8.14.2"
},
"devDependencies": {

View File

@@ -1,5 +1,17 @@
# jazz-svelte
## 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,6 +1,6 @@
{
"name": "jazz-svelte",
"version": "0.11.6",
"version": "0.11.7",
"scripts": {
"dev": "vite dev",
"build": "vite build && npm run package",

View File

@@ -1,5 +1,15 @@
# jazz-tools
## 0.11.7
### Patch Changes
- a140f55: Bugfix: Trigger a single update when loading a locally available list of items
- 2b0d1b0: Export CoFeedEntry type
- Updated dependencies [2b94bc8]
- Updated dependencies [2957362]
- cojson@0.11.7
## 0.11.6
### Patch Changes

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