Compare commits

..

8 Commits

Author SHA1 Message Date
Guido D'Orsi
e0bc532345 Merge pull request #2321 from garden-co/changeset-release/main
Version Packages
2025-05-22 10:14:43 +02:00
github-actions[bot]
87e02c0516 Version Packages 2025-05-22 08:14:27 +00:00
Guido D'Orsi
405f9be7b9 Merge pull request #2320 from garden-co/fix-z-create
fix: fix coMap.create with optional references
2025-05-22 10:10:01 +02:00
Guido D'Orsi
c82bf737bf Merge pull request #2319 from garden-co/fix-z-enum
feat: export the co.loaded alias
2025-05-22 10:08:49 +02:00
Guido D'Orsi
91cbb2f9d4 fix: fix coMap.create with optional types 2025-05-22 09:58:44 +02:00
Guido D'Orsi
cfbba59c6d test: reproduce the create type errors 2025-05-21 20:44:04 +02:00
Guido D'Orsi
b1209e2e09 docs: bring co.loaded in the upgrade guide 2025-05-21 19:38:06 +02:00
Guido D'Orsi
20b3d88135 feat: export the co.loaded alias 2025-05-21 19:25:47 +02:00
121 changed files with 723 additions and 207 deletions

View File

@@ -1,5 +1,18 @@
# betterauth
## 0.1.9
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-betterauth-server-plugin@0.14.5
- jazz-inspector@0.14.5
- jazz-react@0.14.5
- jazz-react-auth-betterauth@0.14.5
- jazz-betterauth-client-plugin@0.14.5
## 0.1.8
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "betterauth",
"version": "0.1.8",
"version": "0.1.9",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,15 @@
# chat-rn-expo-clerk
## 1.0.128
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-expo@0.14.5
- jazz-react-native-media-images@0.14.5
## 1.0.127
### Patch Changes

View File

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

View File

@@ -1,5 +1,14 @@
# chat-rn-expo
## 1.0.115
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-expo@0.14.5
## 1.0.114
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "chat-rn-expo",
"version": "1.0.114",
"version": "1.0.115",
"main": "index.js",
"scripts": {
"build": "tsc --noEmit && expo export -p ios",

View File

@@ -1,5 +1,14 @@
# chat-rn
## 1.0.123
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react-native@0.14.5
## 1.0.122
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "chat-rn",
"version": "1.0.122",
"version": "1.0.123",
"main": "index.js",
"scripts": {
"android": "react-native run-android",

View File

@@ -1,5 +1,15 @@
# chat-vue
## 0.0.106
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-browser@0.14.5
- jazz-vue@0.14.5
## 0.0.105
### Patch Changes

View File

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

View File

@@ -1,5 +1,15 @@
# jazz-example-chat
## 0.0.204
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-inspector@0.14.5
- jazz-react@0.14.5
## 0.0.203
### Patch Changes

View File

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

View File

@@ -1,5 +1,5 @@
import { createImage, useAccount, useCoState } from "jazz-react";
import { Account, Loaded, co } from "jazz-tools";
import { Account, co } from "jazz-tools";
import { useState } from "react";
import { Chat, Message } from "./schema.ts";
import {
@@ -91,7 +91,7 @@ export function ChatScreen(props: { chatID: string }) {
function ChatBubble(props: {
me: Account;
msg: Loaded<typeof Message, { text: true }>;
msg: co.loaded<typeof Message, { text: true }>;
}) {
if (!props.me.canRead(props.msg) || !props.msg.text?.toString()) {
return (

View File

@@ -4,5 +4,7 @@ export const Message = co.map({
text: co.plainText(),
image: z.optional(co.image()),
});
export type Message = co.loaded<typeof Message>;
export const Chat = co.list(Message);
export type Chat = co.loaded<typeof Chat>;

View File

@@ -1,6 +1,6 @@
import clsx from "clsx";
import { ProgressiveImg } from "jazz-react";
import { CoPlainText, ImageDefinition, Loaded } from "jazz-tools";
import { CoPlainText, ImageDefinition } from "jazz-tools";
import { ImageIcon } from "lucide-react";
import { useId, useRef } from "react";
@@ -81,7 +81,7 @@ export function BubbleText(props: {
);
}
export function BubbleImage(props: { image: Loaded<typeof ImageDefinition> }) {
export function BubbleImage(props: { image: ImageDefinition }) {
return (
<ProgressiveImg image={props.image}>
{({ src }) => (

View File

@@ -2,8 +2,8 @@
// This is NOT needed to make the chat work
import { Chat } from "@/schema.ts";
import { Loaded } from "jazz-tools";
export function onChatLoad(chat: Loaded<typeof Chat>) {
export function onChatLoad(chat: Chat) {
if (window.parent) {
chat.waitForSync().then(() => {
window.parent.postMessage(

View File

@@ -1,5 +1,15 @@
# minimal-auth-clerk
## 0.0.103
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
- jazz-react-auth-clerk@0.14.5
## 0.0.102
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "clerk",
"private": true,
"version": "0.0.102",
"version": "0.0.103",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,15 @@
# file-share-svelte
## 0.0.88
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-inspector-element@0.14.5
- jazz-svelte@0.14.5
## 0.0.87
### Patch Changes

View File

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

View File

@@ -1,5 +1,15 @@
# jazz-tailwind-demo-auth-starter
## 0.0.43
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-inspector@0.14.5
- jazz-react@0.14.5
## 0.0.42
### Patch Changes

View File

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

View File

@@ -1,5 +1,14 @@
# form
## 0.1.44
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.1.43
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "form",
"private": true,
"version": "0.1.43",
"version": "0.1.44",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,14 @@
# image-upload
## 0.0.100
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.0.99
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "image-upload",
"private": true,
"version": "0.0.99",
"version": "0.0.100",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,11 @@
# jazz-example-inspector
## 0.0.153
### Patch Changes
- jazz-inspector@0.14.5
## 0.0.152
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-inspector-app",
"private": true,
"version": "0.0.152",
"version": "0.0.153",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -10,7 +10,7 @@ import { Input } from "@/components/ui/input";
import { WORKER_ID } from "@/constants";
import { JoinGameRequest, WaitingRoom } from "@/schema";
import { createFileRoute, redirect } from "@tanstack/react-router";
import { Group, InboxSender, type Loaded } from "jazz-tools";
import { Group, InboxSender } from "jazz-tools";
import { ClipboardCopyIcon, Loader2Icon } from "lucide-react";
import { useEffect, useState } from "react";
@@ -29,10 +29,7 @@ export const Route = createFileRoute(
throw redirect({ to: "/" });
}
if (!waitingRoom?.account1?.isMe) {
const sender = await InboxSender.load<
Loaded<typeof JoinGameRequest>,
Loaded<typeof WaitingRoom>
>(
const sender = await InboxSender.load<JoinGameRequest, WaitingRoom>(
WORKER_ID,
me,
// { account1: {}, account2: {}, me, game: {} },

View File

@@ -4,6 +4,7 @@ export const Player = co.map({
account: co.account(),
playSelection: z.optional(z.literal(["rock", "paper", "scissors"])),
});
export type Player = co.loaded<typeof Player>;
export const Game = co.map({
player1: Player,
@@ -12,12 +13,14 @@ export const Game = co.map({
player1Score: z.number(),
player2Score: z.number(),
});
export type Game = co.loaded<typeof Game>;
export const WaitingRoom = co.map({
account1: co.account(),
account2: z.optional(co.account()),
game: z.optional(Game),
});
export type WaitingRoom = co.loaded<typeof WaitingRoom>;
export const PlayIntent = co.map({
type: z.literal("play"),
@@ -25,20 +28,24 @@ export const PlayIntent = co.map({
player: z.literal(["player1", "player2"]),
playSelection: z.literal(["rock", "paper", "scissors"]),
});
export type PlayIntent = co.loaded<typeof PlayIntent>;
export const NewGameIntent = co.map({
type: z.literal("newGame"),
gameId: z.string(),
});
export type NewGameIntent = co.loaded<typeof NewGameIntent>;
export const CreateGameRequest = co.map({
type: z.literal("createGame"),
});
export type CreateGameRequest = co.loaded<typeof CreateGameRequest>;
export const JoinGameRequest = co.map({
type: z.literal("joinGame"),
waitingRoom: WaitingRoom,
});
export type JoinGameRequest = co.loaded<typeof JoinGameRequest>;
export const InboxMessage = z.discriminatedUnion([
PlayIntent,
@@ -46,3 +53,4 @@ export const InboxMessage = z.discriminatedUnion([
CreateGameRequest,
JoinGameRequest,
]);
export type InboxMessage = co.loaded<typeof InboxMessage>;

View File

@@ -7,7 +7,7 @@ import {
WaitingRoom,
} from "@/schema";
import { startWorker } from "jazz-nodejs";
import { Account, Group, type Loaded, co } from "jazz-tools";
import { Account, Group, co } from "jazz-tools";
import { determineWinner } from "./lib/utils";
if (!process.env.VITE_JAZZ_WORKER_ACCOUNT || !process.env.JAZZ_WORKER_SECRET) {
@@ -124,10 +124,7 @@ function createPlayer({ account }: CreatePlayerParams) {
return player;
}
async function handleNewGameIntent(
_: string,
message: Loaded<typeof NewGameIntent>,
) {
async function handleNewGameIntent(_: string, message: NewGameIntent) {
const gameId = message.gameId;
const game = await Game.load(gameId, {
@@ -152,7 +149,7 @@ async function handleNewGameIntent(
}
}
async function handlePlayIntent(_: string, message: Loaded<typeof PlayIntent>) {
async function handlePlayIntent(_: string, message: PlayIntent) {
// determine current player, update game with outcome
const gameId = message.gameId;
if (!gameId) {

View File

@@ -1,5 +1,14 @@
# multi-cursors
## 0.0.96
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.0.95
### Patch Changes

View File

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

View File

@@ -1,5 +1,15 @@
# multiauth
## 0.0.44
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
- jazz-react-auth-clerk@0.14.5
## 0.0.43
### Patch Changes

View File

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

View File

@@ -1,5 +1,15 @@
# jazz-example-musicplayer
## 0.0.125
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-inspector@0.14.5
- jazz-react@0.14.5
## 0.0.124
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-music-player",
"private": true,
"version": "0.0.124",
"version": "0.0.125",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -13,6 +13,7 @@ import { co, z } from "jazz-tools";
export const MusicTrackWaveform = co.map({
data: z.array(z.number()),
});
export type MusicTrackWaveform = co.loaded<typeof MusicTrackWaveform>;
export const MusicTrack = co.map({
/**
@@ -44,12 +45,13 @@ export const MusicTrack = co.map({
return z.optional(MusicTrack);
},
});
export type MusicTrack = co.loaded<typeof MusicTrack>;
export const Playlist = co.map({
title: z.string(),
tracks: co.list(MusicTrack), // CoList is the collaborative version of Array
});
export type Playlist = co.loaded<typeof Playlist>;
/** The account root is an app-specific per-user private `CoMap`
* where you can store top-level objects for that user */
export const MusicaAccountRoot = co.map({
@@ -69,7 +71,7 @@ export const MusicaAccountRoot = co.map({
exampleDataLoaded: z.optional(z.boolean()),
});
export type MusicaAccountRoot = co.loaded<typeof MusicaAccountRoot>;
export const MusicaAccount = co
.account({
/** the default user profile with a name */
@@ -97,5 +99,6 @@ export const MusicaAccount = co
});
}
});
export type MusicaAccount = co.loaded<typeof MusicaAccount>;
/** Walkthrough: Continue with ./2_main.tsx */

View File

@@ -1,5 +1,5 @@
import { getAudioFileData } from "@/lib/audio/getAudioFileData";
import { FileStream, Group, Loaded, co } from "jazz-tools";
import { FileStream, Group, co } from "jazz-tools";
import {
MusicTrack,
MusicTrackWaveform,
@@ -94,8 +94,8 @@ export async function createNewPlaylist() {
}
export async function addTrackToPlaylist(
playlist: Loaded<typeof Playlist>,
track: Loaded<typeof MusicTrack>,
playlist: Playlist,
track: MusicTrack,
) {
const alreadyAdded = playlist.tracks?.some(
(t) => t?.id === track.id || t?._refs.sourceTrack?.id === track.id,
@@ -118,8 +118,8 @@ export async function addTrackToPlaylist(
}
export async function removeTrackFromPlaylist(
playlist: Loaded<typeof Playlist>,
track: Loaded<typeof MusicTrack>,
playlist: Playlist,
track: MusicTrack,
) {
const notAdded = !playlist.tracks?.some(
(t) => t?.id === track.id || t?._refs.sourceTrack?.id === track.id,
@@ -142,21 +142,15 @@ export async function removeTrackFromPlaylist(
}
}
export async function updatePlaylistTitle(
playlist: Loaded<typeof Playlist>,
title: string,
) {
export async function updatePlaylistTitle(playlist: Playlist, title: string) {
playlist.title = title;
}
export async function updateMusicTrackTitle(
track: Loaded<typeof MusicTrack>,
title: string,
) {
export async function updateMusicTrackTitle(track: MusicTrack, title: string) {
track.title = title;
}
export async function updateActivePlaylist(playlist?: Loaded<typeof Playlist>) {
export async function updateActivePlaylist(playlist?: Playlist) {
const { root } = await MusicaAccount.getMe().ensureLoaded({
resolve: {
root: {
@@ -169,7 +163,7 @@ export async function updateActivePlaylist(playlist?: Loaded<typeof Playlist>) {
root.activePlaylist = playlist ?? root.rootPlaylist;
}
export async function updateActiveTrack(track: Loaded<typeof MusicTrack>) {
export async function updateActiveTrack(track: MusicTrack) {
const { root } = await MusicaAccount.getMe().ensureLoaded({
resolve: {
root: {},
@@ -180,7 +174,7 @@ export async function updateActiveTrack(track: Loaded<typeof MusicTrack>) {
}
export async function onAnonymousAccountDiscarded(
anonymousAccount: Loaded<typeof MusicaAccount>,
anonymousAccount: MusicaAccount,
) {
const { root: anonymousAccountRoot } = await anonymousAccount.ensureLoaded({
resolve: {

View File

@@ -2,7 +2,7 @@ import { MusicTrack, MusicaAccount, Playlist } from "@/1_schema";
import { usePlayMedia } from "@/lib/audio/usePlayMedia";
import { usePlayState } from "@/lib/audio/usePlayState";
import { useAccount } from "jazz-react";
import { FileStream, Loaded } from "jazz-tools";
import { FileStream } from "jazz-tools";
import { useRef, useState } from "react";
import { updateActivePlaylist, updateActiveTrack } from "./4_actions";
import { getNextTrack, getPrevTrack } from "./lib/getters";
@@ -22,7 +22,7 @@ export function useMediaPlayer() {
// Reference used to avoid out-of-order track loads
const lastLoadedTrackId = useRef<string | null>(null);
async function loadTrack(track: Loaded<typeof MusicTrack>) {
async function loadTrack(track: MusicTrack) {
lastLoadedTrackId.current = track.id;
setLoading(track.id);
@@ -64,10 +64,7 @@ export function useMediaPlayer() {
}
}
async function setActiveTrack(
track: Loaded<typeof MusicTrack>,
playlist?: Loaded<typeof Playlist>,
) {
async function setActiveTrack(track: MusicTrack, playlist?: Playlist) {
if (activeTrackId === track.id && lastLoadedTrackId.current !== null) {
playState.toggle();
return;

View File

@@ -1,5 +1,14 @@
# organization
## 0.0.96
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.0.95
### Patch Changes

View File

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

View File

@@ -1,5 +1,14 @@
# passkey-svelte
## 0.0.92
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-svelte@0.14.5
## 0.0.91
### Patch Changes

View File

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

View File

@@ -1,5 +1,14 @@
# minimal-auth-passkey
## 0.0.101
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.0.100
### Patch Changes

View File

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

View File

@@ -1,5 +1,14 @@
# passphrase
## 0.0.98
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.0.97
### Patch Changes

View File

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

View File

@@ -1,5 +1,14 @@
# jazz-password-manager
## 0.0.122
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.0.121
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-password-manager",
"private": true,
"version": "0.0.121",
"version": "0.0.122",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,14 @@
# jazz-example-pets
## 0.0.220
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.0.219
### Patch Changes

View File

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

View File

@@ -1,5 +1,14 @@
# reactions
## 0.0.100
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.0.99
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "reactions",
"private": true,
"version": "0.0.99",
"version": "0.0.100",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,15 @@
# richtext-tiptap
## 0.1.13
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
- jazz-richtext-tiptap@0.1.13
## 0.1.12
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "richtext-tiptap",
"private": true,
"version": "0.1.12",
"version": "0.1.13",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,15 @@
# richtext
## 0.0.90
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
- jazz-richtext-prosemirror@0.1.24
## 0.0.89
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "richtext",
"private": true,
"version": "0.0.89",
"version": "0.0.90",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,15 @@
# todo-vue
## 0.0.104
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-browser@0.14.5
- jazz-vue@0.14.5
## 0.0.103
### Patch Changes

View File

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

View File

@@ -1,5 +1,14 @@
# jazz-example-todo
## 0.0.219
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react@0.14.5
## 0.0.218
### Patch Changes

View File

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

View File

@@ -1,5 +1,15 @@
# version-history
## 0.0.98
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-inspector@0.14.5
- jazz-react@0.14.5
## 0.0.97
### Patch Changes

View File

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

View File

@@ -103,41 +103,14 @@ const Pet = co.map({
name: z.string(),
age: z.number(),
});
type Pet = co.loaded<typeof Pet>;
const Person = co.map({
name: z.string(),
age: z.number(),
pets: co.list(Pet),
});
function MyComponent({ id }: { id: string }) {
const person = useCoState(Person, id);
return person && <div>{person.name}</div>;
}
```
</CodeGroup>
...you now need to specify the type differently **when passing CoValues as a parameter** or
**whenever you need to refer to the type of a loaded CoValue instance:**
<CodeGroup>
```tsx twoslash
import React from "react";
// ---cut---
import { z, co, Loaded } from "jazz-tools"; // [!code ++]
import { useCoState } from "jazz-react";
const Pet = co.map({
name: z.string(),
age: z.number(),
});
const Person = co.map({
name: z.string(),
age: z.number(),
pets: co.list(Pet),
});
type Person = co.loaded<typeof Person>;
function MyComponent({ id }: { id: string }) {
const person = useCoState(Person, id);
@@ -145,31 +118,35 @@ function MyComponent({ id }: { id: string }) {
return person && <PersonName person={person} />;
}
function PersonName({ person }: { person: Loaded<typeof Person> }) { // [!code ++]
function PersonName({ person }: {
person: Person
}) {
return <div>{person.name}</div>;
}
```
</CodeGroup>
`Loaded` can also take a second argument to specify the loading depth of the expected CoValue, mirroring the `resolve` options for `useCoState`, `load`, `subscribe`, etc.
`co.loaded` can also take a second argument to specify the loading depth of the expected CoValue, mirroring the `resolve` options for `useCoState`, `load`, `subscribe`, etc.
<CodeGroup>
```tsx twoslash
import React from "react";
// ---cut---
import { z, co, Loaded } from "jazz-tools";
import { z, co } from "jazz-tools";
import { useCoState } from "jazz-react";
const Pet = co.map({
name: z.string(),
age: z.number(),
});
type Pet = co.loaded<typeof Pet>;
const Person = co.map({
name: z.string(),
age: z.number(),
pets: co.list(Pet),
});
type Person = co.loaded<typeof Person>;
function MyComponent({ id }: { id: string }) {
const personWithPets = useCoState(Person, id, {
@@ -180,7 +157,7 @@ function MyComponent({ id }: { id: string }) {
}
function PersonAndFirstPetName({ person }: {
person: Loaded<typeof Person, { pets: { $each: true } }> // [!code ++]
person: co.loaded<typeof Person, { pets: { $each: true } }> // [!code ++]
}) {
return <div>{person.name} & {person.pets[0].name}</div>;
}
@@ -205,12 +182,14 @@ const Pet = co.map({
name: z.string(),
age: z.number(),
});
type Pet = co.loaded<typeof Pet>;
const Person = co.map({
name: z.string(),
age: z.number(),
pets: co.list(Pet),
});
type Person = co.loaded<typeof Person>;
```
```svelte twoslash filename="app.svelte"
// @filename: app.svelte
@@ -227,37 +206,13 @@ const person = new CoState(Person, id);
```
</CodeGroup>
...you now need to specify the type differently **when passing CoValues as a parameter** or
**whenever you need to refer to the type of a loaded CoValue instance:**
`co.loaded` can also take a second argument to specify the loading depth of the expected CoValue, mirroring the `resolve` options for `CoState`, `load`, `subscribe`, etc.
<CodeGroup>
```svelte twoslash
<script lang="ts" module>
export type Props = {
person: Loaded<typeof Person>; // [!code ++]
};
</script>
<script lang="ts">
import { Person } from './schema';
let props: Props = $props();
</script>
<div>
{props.person.name}
</div>
```
</CodeGroup>
`Loaded` can also take a second argument to specify the loading depth of the expected CoValue, mirroring the `resolve` options for `CoState`, `load`, `subscribe`, etc.
<CodeGroup>
```svelte twoslash
<script lang="ts" module>
export type Props = {
person: Loaded<typeof Person, { pets: { $each: true } }>; // [!code ++]
person: co.loaded<typeof Person, { pets: { $each: true } }>; // [!code ++]
};
</script>
@@ -419,7 +374,7 @@ This means that you now need to rely on `useCoState` on them to load their using
<CodeGroup>
```tsx twoslash
import React from "react";
import { co, z, Loaded, Group } from "jazz-tools";
import { co, z, Group } from "jazz-tools";
import { useCoState } from "jazz-react";
const Pet = co.map({
@@ -442,7 +397,7 @@ export const MyAppAccount = co.account({
});
// ---cut---
function GroupMembers({ group }: { group: Loaded<typeof Group> }) {
function GroupMembers({ group }: { group: Group }) {
const members = group.members;
return (

View File

@@ -1,5 +1,15 @@
# jazz-auth-betterauth
## 0.14.5
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-browser@0.14.5
- jazz-betterauth-client-plugin@0.14.5
## 0.14.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-auth-betterauth",
"version": "0.14.4",
"version": "0.14.5",
"type": "module",
"main": "dist/index.js",
"types": "src/index.ts",

View File

@@ -1,5 +1,14 @@
# jazz-auth-clerk
## 0.14.5
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-browser@0.14.5
## 0.14.4
### Patch Changes

View File

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

View File

@@ -1,5 +1,11 @@
# jazz-betterauth-client-plugin
## 0.14.5
### Patch Changes
- jazz-betterauth-server-plugin@0.14.5
## 0.14.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-betterauth-client-plugin",
"version": "0.14.4",
"version": "0.14.5",
"type": "module",
"main": "dist/index.js",
"types": "src/index.ts",

View File

@@ -1,5 +1,14 @@
# jazz-betterauth-server-plugin
## 0.14.5
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-browser@0.14.5
## 0.14.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-betterauth-server-plugin",
"version": "0.14.4",
"version": "0.14.5",
"type": "module",
"main": "dist/index.js",
"types": "src/index.ts",

View File

@@ -1,5 +1,14 @@
# jazz-browser-media-images
## 0.14.5
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-browser@0.14.5
## 0.14.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-browser-media-images",
"version": "0.14.4",
"version": "0.14.5",
"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.14.4",
"jazz-tools": "workspace:0.14.4",
"jazz-browser": "workspace:0.14.5",
"jazz-tools": "workspace:0.14.5",
"pica": "^9.0.1"
},
"scripts": {

View File

@@ -1,5 +1,13 @@
# jazz-browser
## 0.14.5
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
## 0.14.4
### Patch Changes

View File

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

View File

@@ -1,5 +1,16 @@
# jazz-browser
## 0.14.5
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-auth-clerk@0.14.5
- jazz-react-core@0.14.5
- jazz-react-native-core@0.14.5
## 0.14.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-expo",
"version": "0.14.4",
"version": "0.14.5",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",

View File

@@ -1,5 +1,14 @@
# jazz-inspector-element
## 0.14.5
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-inspector@0.14.5
## 0.14.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-inspector-element",
"version": "0.14.4",
"version": "0.14.5",
"type": "module",
"main": "./dist/main.js",
"types": "./dist/main.d.ts",

View File

@@ -1,5 +1,14 @@
# jazz-inspector
## 0.14.5
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react-core@0.14.5
## 0.14.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-inspector",
"version": "0.14.4",
"version": "0.14.5",
"type": "module",
"main": "./dist/app.js",
"types": "./dist/app.d.ts",

View File

@@ -1,5 +1,13 @@
# jazz-autosub
## 0.14.5
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
## 0.14.4
### Patch Changes

View File

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

View File

@@ -1,5 +1,17 @@
# jazz-react-auth-betterauth
## 0.14.5
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-auth-betterauth@0.14.5
- jazz-browser@0.14.5
- jazz-react@0.14.5
- jazz-betterauth-client-plugin@0.14.5
## 0.14.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react-auth-betterauth",
"version": "0.14.4",
"version": "0.14.5",
"type": "module",
"main": "dist/index.js",
"types": "src/index.tsx",

View File

@@ -1,5 +1,16 @@
# jazz-browser-media-images
## 0.14.5
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-auth-clerk@0.14.5
- jazz-browser@0.14.5
- jazz-react@0.14.5
## 0.14.4
### Patch Changes

View File

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

View File

@@ -1,5 +1,13 @@
# jazz-react-core
## 0.14.5
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
## 0.14.4
### Patch Changes

View File

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

View File

@@ -1,5 +1,14 @@
# jazz-browser
## 0.14.5
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react-core@0.14.5
## 0.14.4
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-react-native-core",
"type": "module",
"version": "0.14.4",
"version": "0.14.5",
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist/index.js",

View File

@@ -1,5 +1,13 @@
# jazz-browser-media-images
## 0.14.5
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
## 0.14.4
### Patch Changes

View File

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

View File

@@ -1,5 +1,14 @@
# jazz-browser
## 0.14.5
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react-native-core@0.14.5
## 0.14.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react-native",
"version": "0.14.4",
"version": "0.14.5",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",

View File

@@ -1,5 +1,16 @@
# jazz-react
## 0.14.5
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-browser@0.14.5
- jazz-browser-media-images@0.14.5
- jazz-react-core@0.14.5
## 0.14.4
### Patch Changes

View File

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

View File

@@ -1,5 +1,14 @@
# jazz-richtext-prosemirror
## 0.1.24
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-browser@0.14.5
## 0.1.23
### Patch Changes

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