Compare commits

..

41 Commits

Author SHA1 Message Date
Guido D'Orsi
23c3e5a125 Merge pull request #1456 from garden-co/changeset-release/main
Version Packages
2025-02-21 11:08:01 +01:00
github-actions[bot]
e3d75e5c97 Version Packages 2025-02-21 10:05:16 +00:00
Guido D'Orsi
7838075bd6 Merge pull request #1446 from garden-co/yubikey-asskey-support
feat: support external authenticators on passkey authentication
2025-02-21 11:02:04 +01:00
Guido D'Orsi
dd792bf0ca Merge pull request #1450 from garden-co/fix-missing-or-undefined-values
fix: improve subscribe behavoir on missing required and undeclared fields
2025-02-21 11:01:46 +01:00
Guido D'Orsi
233aae1deb fix: throw when a requested field on CoMap.Record is missing 2025-02-21 10:41:53 +01:00
Guido D'Orsi
153dc996a5 fix: catch errors on CoValueCore subscribers to avoid effects on the sync 2025-02-21 10:35:07 +01:00
Anselm Eickhoff
2b548c1758 Merge pull request #1442 from garden-co/jazz-734-add-docs-about-inspector
Add jazz inspector docs
2025-02-21 09:10:14 +00:00
Anselm Eickhoff
167b588553 Merge pull request #1455 from garden-co/jazz-738-table-of-contents-not-showing-in-upgrade-guides
Fix missing table of contents on upgrade guides
2025-02-21 09:09:18 +00:00
Anselm Eickhoff
424930d06d Merge pull request #1454 from garden-co/jazz-737-font-mono-doesnt-look-right-in-safari
Fix monospace font in safari
2025-02-21 09:08:07 +00:00
Giordano Ricci
d624a676d8 Merge pull request #1449 from garden-co/gio/docs/anchors-headings
add anchor to headings in mdx components
2025-02-21 10:05:05 +01:00
Trisha Lim
06f2af465d Fix missing table of contents on upgrade guides 2025-02-21 13:33:54 +07:00
Trisha Lim
c7332f84b9 Fix monospace font in safari 2025-02-21 11:39:22 +07:00
Trisha Lim
68fdbfbe94 Clean up 2025-02-21 11:22:32 +07:00
Trisha Lim
e98d0e0c7f Match # size with heading text 2025-02-21 11:19:45 +07:00
Trisha Lim
7efe89df31 Spacing and sizing adjustments 2025-02-21 10:56:51 +07:00
Guido D'Orsi
2fb6428ea1 fix: improve subscribe behavoir on missing required and undeclared fields 2025-02-20 20:05:36 +01:00
Giordano Ricci
5a8f5d8bc2 add anchor to headings in mdx components 2025-02-20 17:46:53 +00:00
Guido D'Orsi
2cc9daab37 test: add unsubscribe test 2025-02-20 18:02:03 +01:00
Guido D'Orsi
e0276f42ee Merge pull request #1448 from garden-co/revert-1445-gio/docs/add-profile-migration-example
Revert "docs: enrich migration example with profile"
2025-02-20 17:17:49 +01:00
Guido D'Orsi
363be52022 Revert "docs: enrich migration example with profile" 2025-02-20 17:17:35 +01:00
Guido D'Orsi
1e87fc7772 feat: support external authenticators on passkey authentication 2025-02-20 17:01:03 +01:00
Giordano Ricci
03ec5d3ec8 Merge pull request #1445 from garden-co/gio/docs/add-profile-migration-example
docs: enrich migration example with profile
2025-02-20 16:43:27 +01:00
Giordano Ricci
5f272ff6ba docs: enrich migration example with profile 2025-02-20 15:15:25 +00:00
Guido D'Orsi
12392424dd feat(llms-txt): add the music player example code 2025-02-20 21:14:57 +07:00
Guido D'Orsi
58eb3c0a98 test: fix the cloudflare test code 2025-02-20 14:55:05 +01:00
Guido D'Orsi
adf965d53d test: increase the timeout to 10s on the cloudflare integration test 2025-02-20 14:48:10 +01:00
Guido D'Orsi
3baa951bb9 Merge pull request #1424 from garden-co/changeset-release/main
Version Packages
2025-02-20 14:46:21 +01:00
github-actions[bot]
b726e31669 Version Packages 2025-02-20 13:44:04 +00:00
Guido D'Orsi
63bb31e0ad Merge pull request #1431 from garden-co/auth-state-sync
fix: isAuthenticated out-of-sync with the account state
2025-02-20 14:42:07 +01:00
Guido D'Orsi
d059460abd Merge pull request #1414 from garden-co/fix/examples-auth
Remove log out button in form and image upload example
2025-02-20 14:32:12 +01:00
Guido D'Orsi
ba81951331 test: fix the mobile e2e tests 2025-02-20 14:22:21 +01:00
Trisha Lim
07273f7ab8 Add jazz inspector docs 2025-02-20 19:17:06 +07:00
Guido D'Orsi
af8e6e3f82 chore: inline callbacks
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2025-02-20 13:05:05 +01:00
Guido D'Orsi
1136d9b744 chore: changeset 2025-02-20 12:01:35 +01:00
Guido D'Orsi
92e78dc262 chore: clean up debug code 2025-02-20 11:54:57 +01:00
Guido D'Orsi
03897a2689 fix: clean up AuthSecretStorage notification management and fix the tests 2025-02-20 11:45:25 +01:00
Guido D'Orsi
823f546028 test: cover the logOut and authenticate updates with tests 2025-02-20 11:45:24 +01:00
Guido D'Orsi
9bc54d1939 chore: clean up the useCoState code 2025-02-20 11:45:24 +01:00
Guido D'Orsi
30780c05f0 fix: initial fix for logIn/logOut state sync 2025-02-20 11:45:24 +01:00
Trisha Lim
243ab074eb Remove non-functional nav from image upload example 2025-02-18 20:21:55 +07:00
Trisha Lim
938f9256db Remove non-functional nav from form example 2025-02-18 15:31:53 +07:00
149 changed files with 2592 additions and 1062 deletions

View File

@@ -1,5 +0,0 @@
---
"cojson": patch
---
Use jazz-crypto-rs isomorphic bundle

View File

@@ -1,5 +0,0 @@
---
"cojson": patch
---
Improve error logging on sync errors

View File

@@ -1,5 +0,0 @@
---
"jazz-browser": patch
---
enable Cmd+J by default to launch inspector on dev

View File

@@ -1,8 +0,0 @@
---
"cojson-storage-indexeddb": patch
"cojson-storage-rn-sqlite": patch
"cojson-storage-sqlite": patch
"cojson-storage": patch
---
Improve rollback on error when failing to add new content

View File

@@ -1,9 +0,0 @@
---
"jazz-react-auth-clerk": patch
"jazz-auth-clerk": patch
"jazz-browser": patch
"jazz-react": patch
"jazz-tools": patch
---
Fixes clerk auth flow

View File

@@ -1,5 +0,0 @@
---
"jazz-nodejs": patch
---
Add crypto option to provide PureJSCrypto on the runtimes where wasm is not supported

View File

@@ -1,5 +1,26 @@
# chat-rn-clerk
## 1.0.73
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-react-native@0.10.8
- jazz-react-native-auth-clerk@0.10.8
- jazz-react-native-media-images@0.10.8
## 1.0.72
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react-native@0.10.7
- jazz-tools@0.10.7
- jazz-react-native-auth-clerk@0.10.7
- jazz-react-native-media-images@0.10.7
## 1.0.71
### Patch Changes

View File

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

View File

@@ -1,5 +1,22 @@
# chat-rn
## 1.0.70
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-react-native@0.10.8
## 1.0.69
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react-native@0.10.7
- jazz-tools@0.10.7
## 1.0.68
### Patch Changes

View File

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

View File

@@ -44,4 +44,5 @@ appId: com.jazz.chatrn
# logout
- tapOn: "Logout"
- assertVisible: "Anonymous user"
- assertVisible: "boorad"
- assertVisible: "bro, low key, it do be like that tho"

View File

@@ -1,5 +1,26 @@
# chat-vue
## 0.0.57
### Patch Changes
- Updated dependencies [1e87fc7]
- Updated dependencies [2fb6428]
- jazz-browser@0.10.8
- jazz-tools@0.10.8
- jazz-vue@0.10.8
## 0.0.56
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [bf76d79]
- Updated dependencies [0eed228]
- jazz-browser@0.10.7
- jazz-tools@0.10.7
- jazz-vue@0.10.7
## 0.0.55
### Patch Changes

View File

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

View File

@@ -1,5 +1,24 @@
# jazz-example-chat
## 0.0.153
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-react@0.10.8
- jazz-browser-media-images@0.10.8
## 0.0.152
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react@0.10.7
- jazz-tools@0.10.7
- jazz-browser-media-images@0.10.7
## 0.0.151
### Patch Changes

View File

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

View File

@@ -1,5 +1,24 @@
# minimal-auth-clerk
## 0.0.52
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-react@0.10.8
- jazz-react-auth-clerk@0.10.8
## 0.0.51
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react-auth-clerk@0.10.7
- jazz-react@0.10.7
- jazz-tools@0.10.7
## 0.0.50
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "clerk",
"private": true,
"version": "0.0.50",
"version": "0.0.52",
"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.10.6",
"jazz-react-auth-clerk": "workspace:0.10.8",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"

View File

@@ -1,5 +1,22 @@
# file-share-svelte
## 0.0.37
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-svelte@0.10.8
## 0.0.36
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-svelte@0.10.7
- jazz-tools@0.10.7
## 0.0.35
### Patch Changes

View File

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

View File

@@ -1,5 +1,24 @@
# form
## 0.0.48
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-react@0.10.8
- jazz-browser-media-images@0.10.8
## 0.0.47
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react@0.10.7
- jazz-tools@0.10.7
- jazz-browser-media-images@0.10.7
## 0.0.46
### Patch Changes

View File

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

View File

@@ -1,5 +1,4 @@
import { useIframeHashRouter } from "hash-slash";
import { useAccount } from "jazz-react";
import { ID } from "jazz-tools";
import { CreateOrder } from "./CreateOrder.tsx";
import { EditOrder } from "./EditOrder.tsx";
@@ -7,25 +6,10 @@ import { Orders } from "./Orders.tsx";
import { BubbleTeaOrder } from "./schema.ts";
function App() {
const { me, logOut } = useAccount();
const router = useIframeHashRouter();
return (
<>
<header>
<nav className="container py-2 border-b flex items-center justify-between">
<span>
You're logged in as <strong>{me?.profile?.name}</strong>
</span>
<button
className="bg-stone-100 py-1.5 px-3 text-sm rounded-md dark:bg-stone-900 dark:text-white"
onClick={() => logOut()}
>
Log out
</button>
</nav>
</header>
<main className="container py-8 space-y-8">
{router.route({
"/": () => <Orders />,

View File

@@ -1,5 +1,24 @@
# image-upload
## 0.0.50
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-react@0.10.8
- jazz-browser-media-images@0.10.8
## 0.0.49
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react@0.10.7
- jazz-tools@0.10.7
- jazz-browser-media-images@0.10.7
## 0.0.48
### Patch Changes

View File

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

View File

@@ -1,19 +1,8 @@
import { useAccount } from "jazz-react";
import ImageUpload from "./ImageUpload.tsx";
function App() {
const { me, logOut } = useAccount();
return (
<>
<header>
<nav className="container">
<span>
You're logged in as <strong>{me?.profile?.name}</strong>
</span>
<button onClick={() => logOut()}>Log out</button>
</nav>
</header>
<main className="container">
<ImageUpload />
</main>

View File

@@ -46,7 +46,12 @@ export default function ImageUpload() {
) : (
<div>
<label>Upload image</label>
<input ref={inputRef} type="file" onChange={onImageChange} />
<input
ref={inputRef}
type="file"
accept="image/png, image/jpeg, image/gif"
onChange={onImageChange}
/>
</div>
)}
</div>

View File

@@ -72,8 +72,7 @@ nav {
.container {
margin-right: auto;
margin-left: auto;
padding-right: 0.75rem;
padding-left: 0.75rem;
padding: 2rem 0.75rem;
max-width: 800px;
}

View File

@@ -1,5 +1,22 @@
# jazz-example-inspector
## 0.0.109
### Patch Changes
- Updated dependencies [153dc99]
- cojson@0.10.8
- cojson-transport-ws@0.10.8
## 0.0.108
### Patch Changes
- Updated dependencies [0f83320]
- Updated dependencies [012022d]
- cojson@0.10.7
- cojson-transport-ws@0.10.7
## 0.0.107
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-inspector-app",
"private": true,
"version": "0.0.107",
"version": "0.0.109",
"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",
"cojson": "workspace:0.10.6",
"cojson-transport-ws": "workspace:0.10.6",
"cojson": "workspace:0.10.8",
"cojson-transport-ws": "workspace:0.10.8",
"hash-slash": "workspace:0.2.2",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",

View File

@@ -1,5 +1,24 @@
# jazz-example-musicplayer
## 0.0.74
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-inspector@0.10.8
- jazz-react@0.10.8
## 0.0.73
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react@0.10.7
- jazz-tools@0.10.7
- jazz-inspector@0.10.7
## 0.0.72
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-music-player",
"private": true,
"version": "0.0.72",
"version": "0.0.74",
"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.10.6",
"jazz-tools": "workspace:0.10.6",
"jazz-react": "workspace:0.10.8",
"jazz-tools": "workspace:0.10.8",
"lucide-react": "^0.274.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",

View File

@@ -1,5 +1,22 @@
# organization
## 0.0.46
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-react@0.10.8
## 0.0.45
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react@0.10.7
- jazz-tools@0.10.7
## 0.0.44
### Patch Changes

View File

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

View File

@@ -1,5 +1,18 @@
# passkey-svelte
## 0.0.41
### Patch Changes
- jazz-svelte@0.10.8
## 0.0.40
### Patch Changes
- Updated dependencies [1136d9b]
- jazz-svelte@0.10.7
## 0.0.39
### Patch Changes

View File

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

View File

@@ -1,5 +1,22 @@
# minimal-auth-passkey
## 0.0.51
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-react@0.10.8
## 0.0.50
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react@0.10.7
- jazz-tools@0.10.7
## 0.0.49
### Patch Changes

View File

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

View File

@@ -1,5 +1,22 @@
# passphrase
## 0.0.48
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-react@0.10.8
## 0.0.47
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react@0.10.7
- jazz-tools@0.10.7
## 0.0.46
### Patch Changes

View File

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

View File

@@ -1,5 +1,22 @@
# jazz-password-manager
## 0.0.72
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-react@0.10.8
## 0.0.71
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react@0.10.7
- jazz-tools@0.10.7
## 0.0.70
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-password-manager",
"private": true,
"version": "0.0.70",
"version": "0.0.72",
"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.10.6",
"jazz-tools": "workspace:0.10.6",
"jazz-react": "workspace:0.10.8",
"jazz-tools": "workspace:0.10.8",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.41.5",

View File

@@ -1,5 +1,24 @@
# jazz-example-pets
## 0.0.170
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-react@0.10.8
- jazz-browser-media-images@0.10.8
## 0.0.169
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react@0.10.7
- jazz-tools@0.10.7
- jazz-browser-media-images@0.10.7
## 0.0.168
### Patch Changes

View File

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

View File

@@ -1,5 +1,24 @@
# reactions
## 0.0.50
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-react@0.10.8
- jazz-browser-media-images@0.10.8
## 0.0.49
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react@0.10.7
- jazz-tools@0.10.7
- jazz-browser-media-images@0.10.7
## 0.0.48
### Patch Changes

View File

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

View File

@@ -1,5 +1,26 @@
# todo-vue
## 0.0.55
### Patch Changes
- Updated dependencies [1e87fc7]
- Updated dependencies [2fb6428]
- jazz-browser@0.10.8
- jazz-tools@0.10.8
- jazz-vue@0.10.8
## 0.0.54
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [bf76d79]
- Updated dependencies [0eed228]
- jazz-browser@0.10.7
- jazz-tools@0.10.7
- jazz-vue@0.10.7
## 0.0.53
### Patch Changes

View File

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

View File

@@ -1,5 +1,22 @@
# jazz-example-todo
## 0.0.169
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-react@0.10.8
## 0.0.168
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react@0.10.7
- jazz-tools@0.10.7
## 0.0.167
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-todo",
"private": true,
"version": "0.0.167",
"version": "0.0.169",
"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.10.6",
"jazz-tools": "workspace:0.10.6",
"jazz-react": "workspace:0.10.8",
"jazz-tools": "workspace:0.10.8",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",
"react": "^18.3.1",

View File

@@ -1,5 +1,22 @@
# version-history
## 0.0.47
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-react@0.10.8
## 0.0.46
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react@0.10.7
- jazz-tools@0.10.7
## 0.0.45
### Patch Changes

View File

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

View File

@@ -14,6 +14,7 @@ import {
FolderArchiveIcon,
GaugeIcon,
GlobeIcon,
HashIcon,
ImageIcon,
LinkIcon,
LockKeyholeIcon,
@@ -53,6 +54,7 @@ const icons = {
encryption: LockKeyholeIcon,
faceId: ScanFace,
file: FileTextIcon,
hash: HashIcon,
help: MessageCircleQuestionIcon,
image: ImageIcon,
instant: GaugeIcon,

View File

@@ -136,6 +136,7 @@ const config = {
padding: "0.15rem 0.25rem",
borderRadius: "2px",
whiteSpace: "nowrap",
fontWeight: 400,
},
p: {
marginBottom: theme("spacing.3"),

View File

@@ -0,0 +1,39 @@
import { CodeGroup } from '@/components/forMdx'
# Jazz Inspector
[Jazz Inspector](https://inspector.jazz.tools) is a tool to visually inspect a Jazz account or other CoValues.
For now, you can get your account credentials from the `jazz-logged-in-secret` local storage key from within your Jazz app.
[https://inspector.jazz.tools](https://inspector.jazz.tools)
## Exporting current account to Inspector from your app
In development mode, you can launch the Inspector from your Jazz app to inspect your account by pressing `Cmd+J`.
## Embedding the Inspector widget into your app
Alternatively, you can embed the Inspector directly into your app, so you don't need to open a separate window.
Install the package.
<CodeGroup>
```sh
npm install jazz-inspector
```
</CodeGroup>
Render the component within your `JazzProvider`.
<CodeGroup>
```sh
import { JazzInspector } from "jazz-inspector";
<JazzProvider> // old
<JazzInspector />
</JazzProvider> // old
```
</CodeGroup>
Check out the [music player app](https://github.com/garden-co/jazz/blob/main/examples/music-player/src/2_main.tsx) for a full example.

View File

@@ -4,31 +4,24 @@ export const metadata = { title: "Jazz 0.10.0 is out!" };
# Jazz 0.10.0 is out!
<h2 className="not-prose text-sm text-stone-600 dark:text-stone-400 mb-5 pb-2 border-b">
11 February 2025
</h2>
For Jazz 0.10.0 we have been focusing on enhancing authentication to make it optional, more flexible and easier to use.
<div>
For Jazz 0.10.0 we have been focusing on enhancing authentication to make it optional, more flexible and easier to use.
The default is now anonymous auth, which means that you can build the functionality of your app first and figure out auth later. For users this means that they can start using your app right away on one device -- and once you integrate an auth method, users can sign up and their anonymous accounts are transparently upgraded to authenticated accounts that work across devices.
The default is now anonymous auth, which means that you can build the functionality of your app first and figure out auth later. For users this means that they can start using your app right away on one device -- and once you integrate an auth method, users can sign up and their anonymous accounts are transparently upgraded to authenticated accounts that work across devices.
There are also some other minor improvements that will make your Jazz experience even better!
There are also some other minor improvements that will make your Jazz experience even better!
<h3>What's new?</h3>
Here is what's changed in this release:
- [New authentication flow](#new-authentication-flow): Now with anonymous auth, redesigned to make Jazz easier to start with and be more flexible.
- [Local-only mode](#local-only-mode): Users can now explore your app in local-only mode before signing up.
- [Improvements on the loading APIs](#improved-loading-api); `ensureLoaded` now always returns a value and `useCoState` now returns `null` if the value is not found.
- [Jazz Workers on native WebSockets](#native-websocket-for-jazz-workers): Improves compatibility with a wider set of Javascript runtimes.
- [Group inheritance with role mapping](#group-inheritance): Groups can now inherit members from other groups with a fixed role.
- Support for Node 14 dropped on cojson.
- Bugfix: `Group.removeMember` now returns a promise.
- Now `cojson` and `jazz-tools` don't export directly the crypto providers anymore. Replace the import with `cojson/crypto/WasmCrypto` or `cojson/crypto/PureJSCrypto` depending on your use case.
</div>
## What's new?
Here is what's changed in this release:
- [New authentication flow](#new-authentication-flow): Now with anonymous auth, redesigned to make Jazz easier to start with and be more flexible.
- [Local-only mode](#local-only-mode): Users can now explore your app in local-only mode before signing up.
- [Improvements on the loading APIs](#improved-loading-api); `ensureLoaded` now always returns a value and `useCoState` now returns `null` if the value is not found.
- [Jazz Workers on native WebSockets](#native-websocket-for-jazz-workers): Improves compatibility with a wider set of Javascript runtimes.
- [Group inheritance with role mapping](#group-inheritance): Groups can now inherit members from other groups with a fixed role.
- Support for Node 14 dropped on cojson.
- Bugfix: `Group.removeMember` now returns a promise.
- Now `cojson` and `jazz-tools` don't export directly the crypto providers anymore. Replace the import with `cojson/crypto/WasmCrypto` or `cojson/crypto/PureJSCrypto` depending on your use case.
<h3 id="new-authentication-flow">New authentication flow</h3>
<div>
## New authentication flow
Up until now authentication has been the first part to figure out when building a Jazz app, and this was a stumbling block for many.
Now it is no longer required and setting up a Jazz app is as easy as writing this:
@@ -191,8 +184,8 @@ export function AuthButton() {
if (isAuthenticated) {
return (
<Button
variant="outline"
<Button
variant="outline"
onClick={logOut}
>
Sign out
@@ -224,8 +217,8 @@ export function AuthButton() {
if (isAuthenticated) {
return (
<Button
variant="outline"
<Button
variant="outline"
onPress={logOut}
>
Sign out
@@ -267,16 +260,16 @@ ReactDOM.createRoot(document.getElementById("root")!).render(
```
</CodeGroup>
</ContentByFramework>
For the changes related to the specific auth providers see the updated [authentication docs](/docs/authentication/overview).
</div>
<h3 id="local-only-mode">Local-only mode</h3>
<div>
For the changes related to the specific auth providers see the updated [authentication docs](/docs/authentication/overview).
## Local-only mode
If you are ok with data not being persisted on the sync server for anonymous users, you can now set your app to local-only depending on the user's authentication state.
With `sync.when` set to `"signedUp"` the app will work in local-only mode when the user is anonymous and unlock the multiplayer/multi-device features and cloud persistence when they sign up:
<CodeGroup>
```ts
```tsx
<JazzProvider
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
@@ -290,10 +283,9 @@ With `sync.when` set to `"signedUp"` the app will work in local-only mode when t
</CodeGroup>
You can control when Jazz will sync by switching the `when` config to `"always"` or `"never"`.
</div>
<h3 id="improved-loading-api">Improvements on the loading APIs</h3>
<div>
## Improvements on the loading APIs
Before 0.10.0 `ensureLoaded` was returning a nullable value forcing the Typescript code to always include null checks:
<CodeGroup>
```ts
@@ -336,17 +328,17 @@ if (value === null) {
return <div>Track not found</div>;
}
```
</CodeGroup>
</div>
</CodeGroup>
<h3 id="native-websocket-for-jazz-workers">Jazz Workers on native WebSockets</h3>
<div>
We have removed the dependency on `ws` and switched to the native WebSocket API for Jazz Workers.
## Jazz Workers on native WebSockets
This improves the compatibility with a wider set of Javascript runtimes adding drop-in support for Deno, Bun, Browsers and Cloudflare Durable Objects.
We have removed the dependency on `ws` and switched to the native WebSocket API for Jazz Workers.
If you are using a Node.js version lower than 22 you will need to install the `ws` package and provide the WebSocket constructor:
<CodeGroup>
This improves the compatibility with a wider set of Javascript runtimes adding drop-in support for Deno, Bun, Browsers and Cloudflare Durable Objects.
If you are using a Node.js version lower than 22 you will need to install the `ws` package and provide the WebSocket constructor:
<CodeGroup>
```ts
import { WebSocket } from "ws";
import { startWorker } from "jazz-nodejs";
@@ -355,24 +347,21 @@ const { worker } = await startWorker({
WebSocket,
});
```
</CodeGroup>
</div>
</CodeGroup>
<h3 id="group-inheritance">Group inheritance with role mapping</h3>
<div>
You can override the inherited role by passing a second argument to `extend`.
## Group inheritance with role mapping
You can override the inherited role by passing a second argument to `extend`.
This can be used to give users limited access to a child group:
<CodeGroup>
```ts
const organization = Group.create();
const billing = Group.create();
This can be used to give users limited access to a child group:
<CodeGroup>
```ts
const organization = Group.create();
const billing = Group.create();
billing.extend(organization, "reader");
```
</CodeGroup>
billing.extend(organization, "reader");
```
</CodeGroup>
This way the members of the organization can only read the billing data, even if they are admins in the organization group.
This way the members of the organization can only read the billing data, even if they are admins in the organization group.
More about the group inheritance can be found in the [dedicated docs page](/docs/groups/inheritance).
</div>
More about the group inheritance can be found in the [dedicated docs page](/docs/groups/inheritance).

View File

@@ -1,545 +0,0 @@
import { ContentByFramework, CodeGroup } from '@/components/forMdx'
export const metadata = { title: "Upgrade to Jazz 0.9.0" };
# Upgrade to Jazz 0.9.0
<h2 className="not-prose text-sm text-stone-600 dark:text-stone-400 mb-5 pb-2 border-b">
08 January 2025
</h2>
<ContentByFramework framework="react">
<div>
Version 0.9.0 simplifies the application setup and makes Jazz more intellisense friendly by
replacing the `createJazzReactApp` API with top-level imports.
We have also introduced some new API to make testing Jazz components a breeze. 🌬️
</div>
<h3>New provider setup</h3>
<div>
The `JazzProvider` is now imported from `jazz-react` instead of `createJazzReactApp`.
While `createJazzReactApp` was originally designed to setup strong typing for custom Account schemas in `useAccount`,
we found that this approach made the Jazz setup awkward and confusing for some users.
So we decided to remove `createJazzReactApp` step and to provide the types through namespace declarations:
</div>
<CodeGroup>
{/* prettier-ignore */}
```tsx
import { JazzProvider, usePasskeyAuth, PasskeyAuthBasicUI } from "jazz-react";
import { MyAppAccount } from "./schema";
// Remove these lines // *bin*
const Jazz = createJazzReactApp({ AccountSchema: MyAppAccount }); // *bin*
export const { useAccount, useCoState } = Jazz; // *bin*
export function JazzAndAuth({ children }: { children: React.ReactNode }) { // old
const [passkeyAuth, passKeyState] = usePasskeyAuth({ appName }); // old
return (
<>
{/* Replace Jazz.Provider with provider from jazz-react */}
<JazzProvider
auth={passkeyAuth} // old
peer="wss://cloud.jazz.tools/?key=you@example.com" // old
AccountSchema={MyAppAccount} {/* The custom Account schema is passed here */} // *add*
>
{children} // old
</JazzProvider>
<PasskeyAuthBasicUI state={passKeyState} /> // old
</> // old
);
}
// Register the Account schema so `useAccount` returns our custom `MyAppAccount`
declare module "jazz-react" { // *add*
interface Register { // *add*
Account: MyAppAccount; // *add*
} // *add*
} // *add*
```
</CodeGroup>
<h3>Top level imports for hooks</h3>
<div>
All Jazz hooks are now available as top-level imports from the `jazz-react` package.
This change improves IDE intellisense support and simplifies imports:
</div>
<CodeGroup>
{/* prettier-ignore */}
```tsx
// Replace local imports with "jazz-react" imports
import { useAccount } from "./main"; // *bin*
import { useAccount } from "jazz-react"; // *add*
export function Hello() {
const { me } = useAccount();
return (
<>
Hello {me.profile?.name}
</>
);
}
```
</CodeGroup>
<h3>New testing utilities</h3>
<div>
Removing `createJazzReactApp` also makes testing way easier!
We can now use `createJazzTestAccount` to setup accounts and testing data and pass it to
your components and hooks using `JazzTestProvider`:
</div>
<CodeGroup>
{/* prettier-ignore */}
```tsx
import { createJazzTestAccount, JazzTestProvider } from "jazz-react/testing";
import { renderHook } from "@testing-library/react"; // old
import { usePlaylist } from "./usePlaylist"; // old
import { Playlist, MusicAccount } from "./schema"; // old
test("should load the playlist", async () => {
// ✅ Create a test account with your schema
const account = await createJazzTestAccount({ AccountSchema: MusicAccount });
// ✅ Set up test data
const playlist = Playlist.create({
name: "My playlist",
}, account);
// ✅ Use JazzTestProvider in your tests
const { result } = renderHook(() => usePlaylist(playlist.id), {
wrapper: ({ children }) => (
<JazzTestProvider account={account}>
{children}
</JazzTestProvider>
),
});
// The result is resolved synchronously, so you can assert the value immediately
expect(result.current?.name).toBe("My playlist");
});
```
</CodeGroup>
</ContentByFramework>
<ContentByFramework framework="react-native">
<div>
Version 0.9.0 simplifies the application setup and makes Jazz more intellisense friendly by
replacing the `createJazzRNApp` API with top-level imports.
We have also introduced some new API to make testing Jazz components a breeze. 🌬️
</div>
<h3>New provider setup</h3>
<div>
The `JazzProvider` is now imported from `jazz-react-native` instead of `createJazzRNApp`.
While `createJazzRNApp` was originally designed to setup strong typing for custom Account schemas in `useAccount`,
we found that this approach made the Jazz setup awkward and confusing for some users.
So we decided to remove `createJazzRNApp` step and to provide the types through namespace declarations:
</div>
<CodeGroup>
{/* prettier-ignore */}
```tsx
import { JazzProvider, useDemoAuth, DemoAuthBasicUI } from "jazz-react-native";
import { MyAppAccount } from "./schema";
// Remove these lines // *bin*
const Jazz = createJazzRNApp({ AccountSchema: MyAppAccount }); // *bin*
export const { useAccount, useCoState } = Jazz; // *bin*
export function JazzAndAuth({ children }: { children: React.ReactNode }) { // old
const [auth, state] = useDemoAuth(); // old
return (
<>
{/* Replace Jazz.Provider with provider from jazz-react */}
<JazzProvider
auth={auth} // old
peer="wss://cloud.jazz.tools/?key=you@example.com" // old
AccountSchema={MyAppAccount} {/* The custom Account schema is passed here */}
>
{children} // old
</JazzProvider>
<DemoAuthBasicUI appName="My App" state={state} /> // old
</> // old
);
}
// Register the Account schema so `useAccount` returns our custom `MyAppAccount`
declare module "jazz-react-native" {
interface Register {
Account: MyAppAccount;
}
}
```
</CodeGroup>
<h3>Top level imports for hooks</h3>
<div>
All Jazz hooks are now available as top-level imports from the `jazz-react-native` package.
This change improves IDE intellisense support and simplifies imports:
</div>
<CodeGroup>
{/* prettier-ignore */}
```tsx
// Replace local imports with "jazz-react-native" imports
import { useAccount } from "./main"; // *bin*
import { useAccount } from "jazz-react-native"; // *add*
export function Hello() {
const { me } = useAccount();
return (
<>
Hello {me.profile?.name}
</>
);
}
```
</CodeGroup>
<h3>New testing utilities</h3>
<div>
Removing `createJazzRNApp` also makes testing way easier!
We can now use `createJazzTestAccount` to setup accounts and testing data and pass it to
your components and hooks using `JazzTestProvider`:
</div>
<CodeGroup>
{/* prettier-ignore */}
```tsx
import { createJazzTestAccount, JazzTestProvider } from "jazz-react-native/testing";
import { renderHook } from "@testing-library/react-native"; // old
import { usePlaylist } from "./usePlaylist"; // old
import { Playlist, MusicAccount } from "./schema"; // old
test("should load the playlist", async () => {
// ✅ Create a test account with your schema
const account = await createJazzTestAccount({ AccountSchema: MusicAccount });
// ✅ Set up test data
const playlist = Playlist.create({
name: "My playlist",
}, account);
// ✅ Use JazzTestProvider in your tests
const { result } = renderHook(() => usePlaylist(playlist.id), {
wrapper: ({ children }) => (
<JazzTestProvider account={account}>
{children}
</JazzTestProvider>
),
});
// The result is resolved synchronously, so you can assert the value immediately
expect(result.current?.name).toBe("My playlist");
});
```
</CodeGroup>
</ContentByFramework>
<ContentByFramework framework="svelte">
<div>
Version 0.9.0 simplifies the application setup and makes Jazz more intellisense friendly by
replacing the `createJazzApp` API with top-level imports.
We have also introduced some new API to make testing Jazz components a breeze. 🌬️
</div>
<h3>New provider setup</h3>
<div>
The `JazzProvider` is now imported from `jazz-svelte` instead of `createJazzApp`.
While `createJazzApp` was originally designed to setup strong typing for custom Account schemas in `useAccount`,
we found that this approach made the Jazz setup awkward and confusing for some users.
So we decided to remove `createJazzApp` step and to provide the types through namespace declarations:
</div>
<CodeGroup>
{/* prettier-ignore */}
```svelte
<!-- src/routes/+layout.svelte -->
<script lang="ts" module>
// Register the Account schema so `useAccount` returns our custom `MyAppAccount`
declare module 'jazz-svelte' {
interface Register {
Account: MyAccount;
}
}
</script>
<script lang="ts">
import { Provider } from '$lib/jazz'; // *bin*
import { JazzProvider } from 'jazz-svelte';
// Example configuration for authentication and peer connection
let auth = null; // Replace with your auth implementation
let peer = "wss://your-peer-endpoint";
// The custom Account schema is passed now as a prop
let AccountSchema = MyAccount;
</script>
<JazzProvider {auth} {peer} {AccountSchema}>
<App />
</JazzProvider>
```
</CodeGroup>
<h3>Top level imports for hooks</h3>
<div>
All Jazz hooks are now available as top-level imports from the `jazz-svelte` package.
This change improves IDE intellisense support and simplifies imports:
</div>
<CodeGroup>
{/* prettier-ignore */}
```svelte
<script lang="ts">
import { useAccount } from '$lib/jazz'; // *bin*
import { useAccount } from 'jazz-svelte'; // *add*
const { me } = useAccount();
</script>
<div>
Hello {me.profile?.name}
</div>
```
</CodeGroup>
<h3>New testing utilities</h3>
<div>
Removing `createJazzApp` also makes testing way easier!
We can now use `createJazzTestAccount` to setup accounts and testing data and pass it to
your components and hooks using `JazzTestProvider`:
</div>
<CodeGroup>
{/* prettier-ignore */}
```ts
import { useCoState } from "jazz-svelte";
import { createJazzTestAccount, JazzTestProvider } from "jazz-svelte/testing";
import { render } from "@testing-library/svelte"; // old
import { Playlist, MusicAccount } from "./schema"; // old
test("should load the playlist", async () => {
// ✅ Create a test account with your schema
const account = await createJazzTestAccount({ AccountSchema: MusicAccount });
// ✅ Set up test data
const playlist = Playlist.create({
name: "My playlist",
}, account);
// ✅ Use createJazzTestContext in your tests
render(PlaylistComponent, {
context: createJazzTestContext({ account: options.account }),
props: {
id: playlist.id,
},
});
expect(await screen.findByRole("heading", { name: "My playlist" })).toBeInTheDocument();
});
```
</CodeGroup>
</ContentByFramework>
<ContentByFramework framework="vue">
<div>
Version 0.9.0 simplifies the application setup and makes Jazz more intellisense friendly by
replacing the `createJazzVueApp` API with top-level imports.
We have also introduced some new API to make testing Jazz components a breeze. 🌬️
</div>
<h3>New provider setup</h3>
<div>
The `JazzProvider` is now imported from `jazz-vue` instead of `createJazzVueApp`.
While `createJazzReactApp` was originally designed to setup strong typing for custom Account schemas in `useAccount`,
we found that this approach made the Jazz setup awkward and confusing for some users.
So we decided to remove `createJazzReactApp` step and to provide the types through namespace declarations:
</div>
<CodeGroup>
{/* prettier-ignore */}
```typescript
import "./assets/main.css"; // old
import { DemoAuthBasicUI, useDemoAuth, JazzProvider } from "jazz-vue";
import { createApp, defineComponent, h } from "vue"; // old
import App from "./App.vue"; // old
import router from "./router"; // old
import { ToDoAccount } from "./schema"; // old
// Remove these lines // *bin*
const Jazz = createJazzVueApp<ToDoAccount>({ AccountSchema: ToDoAccount }); // *bin*
export const { useAccount, useCoState } = Jazz; // *bin*
const { JazzProvider } = Jazz; // *bin*
const RootComponent = defineComponent({ // old
name: "RootComponent", // old
setup() { // old
const { authMethod, state } = useDemoAuth(); // old
return () => [ // old
h( // old
JazzProvider, // old
{ // old
AccountSchema: ToDoAccount, // The custom Account schema is passed here now
auth: authMethod.value, // old
peer: "wss://cloud.jazz.tools/?key=vue-todo-example-jazz@garden.co", // old
}, // old
{ // old
default: () => h(App), // old
}, // old
), // old
state.state !== "signedIn" && // old
h(DemoAuthBasicUI, { // old
appName: "Jazz Vue Todo", // old
state, // old
}), // old
]; // old
}, // old
}); // old
// Register the Account schema so `useAccount` returns our custom `MyAppAccount`
declare module "jazz-vue" {
interface Register {
Account: ToDoAccount;
}
}
const app = createApp(RootComponent); // old
app.use(router); // old
app.mount("#app"); // old
```
</CodeGroup>
<h3>Top level imports for hooks</h3>
<div>
All Jazz hooks are now available as top-level imports from the `jazz-vue` package.
This change improves IDE intellisense support and simplifies imports:
</div>
<CodeGroup>
{/* prettier-ignore */}
```typescript
<template>
Hello {{ me.profile?.name }}
</template>
<script setup lang="ts">
// Replace local imports with "jazz-vue" imports
import { useAccount } from "./main"; // *bin*
import { useAccount } from "jazz-vue"; // *add*
const { me, logOut } = useAccount();
</script>
```
</CodeGroup>
<h3>New testing utilities</h3>
<div>
Removing `createJazzTestApp` also makes testing way easier!
We can now use `createJazzTestAccount` to setup accounts and testing data and pass it to
your components and hooks using `JazzTestProvider`:
</div>
<CodeGroup>
{/* prettier-ignore */}
```tsx
import { createJazzTestAccount, JazzTestProvider } from "jazz-vue/testing";
import { createApp, defineComponent, h } from "vue";
import { usePlaylist } from "./usePlaylist";
import { Playlist, MusicAccount } from "./schema"; // old
// This can be reused on other tests!
export const renderComposableWithJazz = <C extends (...args: any[]) => any>(
composable: C,
{ account }: { account: Account | { guest: AnonymousJazzAgent } },
) => {
let result;
const wrapper = defineComponent({
setup() {
result = composable();
// suppress missing template warning
return () => {};
},
});
// ✅ Use JazzTestProvider in your tests
const app = createApp({
setup() {
return () =>
h(
JazzTestProvider,
{
account,
},
{
default: () => h(wrapper),
},
);
},
});
app.mount(document.createElement("div"));
return [result, app] as [ReturnType<C>, ReturnType<typeof createApp>];
};
test("should load the playlist", async () => {
// ✅ Create a test account with your schema
const account = await createJazzTestAccount({ AccountSchema: MusicAccount });
// ✅ Set up test data
const playlist = Playlist.create({
name: "My playlist",
}, account);
// ✅ Set up test data
const { result } = renderComposableWithJazz(() => usePlaylist(playlist.id), {
account,
});
// The result is resolved synchronously, so you can assert the value immediately
expect(result?.name).toBe("My playlist");
});
```
</CodeGroup>
</ContentByFramework>

View File

@@ -0,0 +1,123 @@
import { ContentByFramework, CodeGroup } from '@/components/forMdx'
export const metadata = { title: "Upgrade to Jazz 0.9.0" };
# Upgrade to Jazz 0.9.0
Version 0.9.0 simplifies the application setup and makes Jazz more intellisense friendly by
replacing the `createJazzRNApp` API with top-level imports.
We have also introduced some new API to make testing Jazz components a breeze. 🌬️
## New provider setup
The `JazzProvider` is now imported from `jazz-react-native` instead of `createJazzRNApp`.
While `createJazzRNApp` was originally designed to setup strong typing for custom Account schemas in `useAccount`,
we found that this approach made the Jazz setup awkward and confusing for some users.
So we decided to remove `createJazzRNApp` step and to provide the types through namespace declarations:
<CodeGroup>
{/* prettier-ignore */}
```tsx
import { JazzProvider, useDemoAuth, DemoAuthBasicUI } from "jazz-react-native";
import { MyAppAccount } from "./schema";
// Remove these lines // *bin*
const Jazz = createJazzRNApp({ AccountSchema: MyAppAccount }); // *bin*
export const { useAccount, useCoState } = Jazz; // *bin*
export function JazzAndAuth({ children }: { children: React.ReactNode }) { // old
const [auth, state] = useDemoAuth(); // old
return (
<>
{/* Replace Jazz.Provider with provider from jazz-react */}
<JazzProvider
auth={auth} // old
peer="wss://cloud.jazz.tools/?key=you@example.com" // old
AccountSchema={MyAppAccount} {/* The custom Account schema is passed here */}
>
{children} // old
</JazzProvider>
<DemoAuthBasicUI appName="My App" state={state} /> // old
</> // old
);
}
// Register the Account schema so `useAccount` returns our custom `MyAppAccount`
declare module "jazz-react-native" {
interface Register {
Account: MyAppAccount;
}
}
```
</CodeGroup>
## Top level imports for hooks
All Jazz hooks are now available as top-level imports from the `jazz-react-native` package.
This change improves IDE intellisense support and simplifies imports:
<CodeGroup>
{/* prettier-ignore */}
```tsx
// Replace local imports with "jazz-react-native" imports
import { useAccount } from "./main"; // *bin*
import { useAccount } from "jazz-react-native"; // *add*
export function Hello() {
const { me } = useAccount();
return (
<>
Hello {me.profile?.name}
</>
);
}
```
</CodeGroup>
## New testing utilities
<div>
Removing `createJazzRNApp` also makes testing way easier!
We can now use `createJazzTestAccount` to setup accounts and testing data and pass it to
your components and hooks using `JazzTestProvider`:
</div>
<CodeGroup>
{/* prettier-ignore */}
```tsx
import { createJazzTestAccount, JazzTestProvider } from "jazz-react-native/testing";
import { renderHook } from "@testing-library/react-native"; // old
import { usePlaylist } from "./usePlaylist"; // old
import { Playlist, MusicAccount } from "./schema"; // old
test("should load the playlist", async () => {
// ✅ Create a test account with your schema
const account = await createJazzTestAccount({ AccountSchema: MusicAccount });
// ✅ Set up test data
const playlist = Playlist.create({
name: "My playlist",
}, account);
// ✅ Use JazzTestProvider in your tests
const { result } = renderHook(() => usePlaylist(playlist.id), {
wrapper: ({ children }) => (
<JazzTestProvider account={account}>
{children}
</JazzTestProvider>
),
});
// The result is resolved synchronously, so you can assert the value immediately
expect(result.current?.name).toBe("My playlist");
});
```
</CodeGroup>

View File

@@ -0,0 +1,120 @@
import { ContentByFramework, CodeGroup } from '@/components/forMdx'
export const metadata = { title: "Upgrade to Jazz 0.9.0" };
# Upgrade to Jazz 0.9.0
Version 0.9.0 simplifies the application setup and makes Jazz more intellisense friendly by
replacing the `createJazzReactApp` API with top-level imports.
We have also introduced some new API to make testing Jazz components a breeze. 🌬️
## New provider setup
The `JazzProvider` is now imported from `jazz-react` instead of `createJazzReactApp`.
While `createJazzReactApp` was originally designed to setup strong typing for custom Account schemas in `useAccount`,
we found that this approach made the Jazz setup awkward and confusing for some users.
So we decided to remove `createJazzReactApp` step and to provide the types through namespace declarations:
<CodeGroup>
{/* prettier-ignore */}
```tsx
import { JazzProvider, usePasskeyAuth, PasskeyAuthBasicUI } from "jazz-react";
import { MyAppAccount } from "./schema";
// Remove these lines // *bin*
const Jazz = createJazzReactApp({ AccountSchema: MyAppAccount }); // *bin*
export const { useAccount, useCoState } = Jazz; // *bin*
export function JazzAndAuth({ children }: { children: React.ReactNode }) { // old
const [passkeyAuth, passKeyState] = usePasskeyAuth({ appName }); // old
return (
<>
{/* Replace Jazz.Provider with provider from jazz-react */}
<JazzProvider
auth={passkeyAuth} // old
peer="wss://cloud.jazz.tools/?key=you@example.com" // old
AccountSchema={MyAppAccount} {/* The custom Account schema is passed here */} // *add*
>
{children} // old
</JazzProvider>
<PasskeyAuthBasicUI state={passKeyState} /> // old
</> // old
);
}
// Register the Account schema so `useAccount` returns our custom `MyAppAccount`
declare module "jazz-react" { // *add*
interface Register { // *add*
Account: MyAppAccount; // *add*
} // *add*
} // *add*
```
</CodeGroup>
## Top level imports for hooks
All Jazz hooks are now available as top-level imports from the `jazz-react` package.
This change improves IDE intellisense support and simplifies imports:
<CodeGroup>
{/* prettier-ignore */}
```tsx
// Replace local imports with "jazz-react" imports
import { useAccount } from "./main"; // *bin*
import { useAccount } from "jazz-react"; // *add*
export function Hello() {
const { me } = useAccount();
return (
<>
Hello {me.profile?.name}
</>
);
}
```
</CodeGroup>
## New testing utilities
Removing `createJazzReactApp` also makes testing way easier!
We can now use `createJazzTestAccount` to setup accounts and testing data and pass it to
your components and hooks using `JazzTestProvider`:
<CodeGroup>
{/* prettier-ignore */}
```tsx
import { createJazzTestAccount, JazzTestProvider } from "jazz-react/testing";
import { renderHook } from "@testing-library/react"; // old
import { usePlaylist } from "./usePlaylist"; // old
import { Playlist, MusicAccount } from "./schema"; // old
test("should load the playlist", async () => {
// ✅ Create a test account with your schema
const account = await createJazzTestAccount({ AccountSchema: MusicAccount });
// ✅ Set up test data
const playlist = Playlist.create({
name: "My playlist",
}, account);
// ✅ Use JazzTestProvider in your tests
const { result } = renderHook(() => usePlaylist(playlist.id), {
wrapper: ({ children }) => (
<JazzTestProvider account={account}>
{children}
</JazzTestProvider>
),
});
// The result is resolved synchronously, so you can assert the value immediately
expect(result.current?.name).toBe("My playlist");
});
```
</CodeGroup>

View File

@@ -0,0 +1,113 @@
import { ContentByFramework, CodeGroup } from '@/components/forMdx'
export const metadata = { title: "Upgrade to Jazz 0.9.0" };
# Upgrade to Jazz 0.9.0
Version 0.9.0 simplifies the application setup and makes Jazz more intellisense friendly by
replacing the `createJazzApp` API with top-level imports.
We have also introduced some new API to make testing Jazz components a breeze. 🌬️
## New provider setup
The `JazzProvider` is now imported from `jazz-svelte` instead of `createJazzApp`.
While `createJazzApp` was originally designed to setup strong typing for custom Account schemas in `useAccount`,
we found that this approach made the Jazz setup awkward and confusing for some users.
So we decided to remove `createJazzApp` step and to provide the types through namespace declarations:
<CodeGroup>
{/* prettier-ignore */}
```svelte
<!-- src/routes/+layout.svelte -->
<script lang="ts" module>
// Register the Account schema so `useAccount` returns our custom `MyAppAccount`
declare module 'jazz-svelte' {
interface Register {
Account: MyAccount;
}
}
</script>
<script lang="ts">
import { Provider } from '$lib/jazz'; // *bin*
import { JazzProvider } from 'jazz-svelte';
// Example configuration for authentication and peer connection
let auth = null; // Replace with your auth implementation
let peer = "wss://your-peer-endpoint";
// The custom Account schema is passed now as a prop
let AccountSchema = MyAccount;
</script>
<JazzProvider {auth} {peer} {AccountSchema}>
<App />
</JazzProvider>
```
</CodeGroup>
## Top level imports for hooks
<div>
All Jazz hooks are now available as top-level imports from the `jazz-svelte` package.
This change improves IDE intellisense support and simplifies imports:
</div>
<CodeGroup>
{/* prettier-ignore */}
```svelte
<script lang="ts">
import { useAccount } from '$lib/jazz'; // *bin*
import { useAccount } from 'jazz-svelte'; // *add*
const { me } = useAccount();
</script>
<div>
Hello {me.profile?.name}
</div>
```
</CodeGroup>
## New testing utilities
Removing `createJazzApp` also makes testing way easier!
We can now use `createJazzTestAccount` to setup accounts and testing data and pass it to
your components and hooks using `JazzTestProvider`:
<CodeGroup>
{/* prettier-ignore */}
```ts
import { useCoState } from "jazz-svelte";
import { createJazzTestAccount, JazzTestProvider } from "jazz-svelte/testing";
import { render } from "@testing-library/svelte"; // old
import { Playlist, MusicAccount } from "./schema"; // old
test("should load the playlist", async () => {
// ✅ Create a test account with your schema
const account = await createJazzTestAccount({ AccountSchema: MusicAccount });
// ✅ Set up test data
const playlist = Playlist.create({
name: "My playlist",
}, account);
// ✅ Use createJazzTestContext in your tests
render(PlaylistComponent, {
context: createJazzTestContext({ account: options.account }),
props: {
id: playlist.id,
},
});
expect(await screen.findByRole("heading", { name: "My playlist" })).toBeInTheDocument();
});
```
</CodeGroup>

View File

@@ -0,0 +1,165 @@
import { ContentByFramework, CodeGroup } from '@/components/forMdx'
export const metadata = { title: "Upgrade to Jazz 0.9.0" };
# Upgrade to Jazz 0.9.0
Version 0.9.0 simplifies the application setup and makes Jazz more intellisense friendly by
replacing the `createJazzVueApp` API with top-level imports.
We have also introduced some new API to make testing Jazz components a breeze. 🌬️
## New provider setup
The `JazzProvider` is now imported from `jazz-vue` instead of `createJazzVueApp`.
While `createJazzReactApp` was originally designed to setup strong typing for custom Account schemas in `useAccount`,
we found that this approach made the Jazz setup awkward and confusing for some users.
So we decided to remove `createJazzReactApp` step and to provide the types through namespace declarations:
<CodeGroup>
{/* prettier-ignore */}
```typescript
import "./assets/main.css"; // old
import { DemoAuthBasicUI, useDemoAuth, JazzProvider } from "jazz-vue";
import { createApp, defineComponent, h } from "vue"; // old
import App from "./App.vue"; // old
import router from "./router"; // old
import { ToDoAccount } from "./schema"; // old
// Remove these lines // *bin*
const Jazz = createJazzVueApp<ToDoAccount>({ AccountSchema: ToDoAccount }); // *bin*
export const { useAccount, useCoState } = Jazz; // *bin*
const { JazzProvider } = Jazz; // *bin*
const RootComponent = defineComponent({ // old
name: "RootComponent", // old
setup() { // old
const { authMethod, state } = useDemoAuth(); // old
return () => [ // old
h( // old
JazzProvider, // old
{ // old
AccountSchema: ToDoAccount, // The custom Account schema is passed here now
auth: authMethod.value, // old
peer: "wss://cloud.jazz.tools/?key=vue-todo-example-jazz@garden.co", // old
}, // old
{ // old
default: () => h(App), // old
}, // old
), // old
state.state !== "signedIn" && // old
h(DemoAuthBasicUI, { // old
appName: "Jazz Vue Todo", // old
state, // old
}), // old
]; // old
}, // old
}); // old
// Register the Account schema so `useAccount` returns our custom `MyAppAccount`
declare module "jazz-vue" {
interface Register {
Account: ToDoAccount;
}
}
const app = createApp(RootComponent); // old
app.use(router); // old
app.mount("#app"); // old
```
</CodeGroup>
## Top level imports for hooks
All Jazz hooks are now available as top-level imports from the `jazz-vue` package.
This change improves IDE intellisense support and simplifies imports:
<CodeGroup>
{/* prettier-ignore */}
```typescript
<template>
Hello {{ me.profile?.name }}
</template>
<script setup lang="ts">
// Replace local imports with "jazz-vue" imports
import { useAccount } from "./main"; // *bin*
import { useAccount } from "jazz-vue"; // *add*
const { me, logOut } = useAccount();
</script>
```
</CodeGroup>
## New testing utilities
Removing `createJazzTestApp` also makes testing way easier!
We can now use `createJazzTestAccount` to setup accounts and testing data and pass it to
your components and hooks using `JazzTestProvider`:
<CodeGroup>
{/* prettier-ignore */}
```tsx
import { createJazzTestAccount, JazzTestProvider } from "jazz-vue/testing";
import { createApp, defineComponent, h } from "vue";
import { usePlaylist } from "./usePlaylist";
import { Playlist, MusicAccount } from "./schema"; // old
// This can be reused on other tests!
export const renderComposableWithJazz = <C extends (...args: any[]) => any>(
composable: C,
{ account }: { account: Account | { guest: AnonymousJazzAgent } },
) => {
let result;
const wrapper = defineComponent({
setup() {
result = composable();
// suppress missing template warning
return () => {};
},
});
// ✅ Use JazzTestProvider in your tests
const app = createApp({
setup() {
return () =>
h(
JazzTestProvider,
{
account,
},
{
default: () => h(wrapper),
},
);
},
});
app.mount(document.createElement("div"));
return [result, app] as [ReturnType<C>, ReturnType<typeof createApp>];
};
test("should load the playlist", async () => {
// ✅ Create a test account with your schema
const account = await createJazzTestAccount({ AccountSchema: MusicAccount });
// ✅ Set up test data
const playlist = Playlist.create({
name: "My playlist",
}, account);
// ✅ Set up test data
const { result } = renderComposableWithJazz(() => usePlaylist(playlist.id), {
account,
});
// The result is resolved synchronously, so you can assert the value immediately
expect(result?.name).toBe("My playlist");
});
```
</CodeGroup>

View File

@@ -4,15 +4,9 @@ export const metadata = { title: "Upgrade to Jazz 0.9.0" };
# Jazz 0.9.8 - Without me!
<h2 className="not-prose text-sm text-stone-600 dark:text-stone-400 mb-5 pb-2 border-b">
14 January 2025
</h2>
We have simplified the API to make the "me" value always optional!
<div>
We have simplified the API to make the "me" value always optional!
This removes the need of using `useAccount` like the 90% of the time!
</div>
This removes the need of using `useAccount` like the 90% of the time!
<CodeGroup>
{/* prettier-ignore */}
@@ -20,6 +14,7 @@ export const metadata = { title: "Upgrade to Jazz 0.9.0" };
import { useState } from "react";
import { Issue } from "./schema";
import { IssueComponent } from "./components/Issue.tsx";
function App() {
const [issue, setIssue] = useState<Issue>();
@@ -43,9 +38,7 @@ export const metadata = { title: "Upgrade to Jazz 0.9.0" };
```
</CodeGroup>
<div>
This also applies to the load API:
</div>
This also applies to the load API:
<CodeGroup>
{/* prettier-ignore */}
@@ -54,9 +47,7 @@ export const metadata = { title: "Upgrade to Jazz 0.9.0" };
```
</CodeGroup>
<div>
And `Group.create`:
</div>
And `Group.create`:
<CodeGroup>
{/* prettier-ignore */}
@@ -67,8 +58,6 @@ export const metadata = { title: "Upgrade to Jazz 0.9.0" };
```
</CodeGroup>
<div>
Everything is backward compatible, so no upgrade steps are required.
With this Jazz API becomes way more lean and more is coming!
</div>

View File

@@ -4,46 +4,34 @@ export const metadata = { title: "Enable local persistence" };
# Enable local persistence
<h2 className="not-prose text-sm text-stone-600 dark:text-stone-400 mb-5 pb-2 border-b">
10 January 2025
</h2>
Version 0.9.2 introduces local persistence for React Native apps using SQLite.
<ContentByFramework framework="react-native">
<div>
Version 0.9.2 introduces local persistence for React Native apps using SQLite.
If you are upgrading from a version before 0.9.2, you need to enable local persistence by following the steps below.
If you are upgrading from a version before 0.9.2, you need to enable local persistence by following the steps below.
Local persistence will become the default in 0.10.0.
Local persistence will become the default in 0.10.0.
</div>
## Add the required dependencies
<h3>Add the required dependencies</h3>
As SQLite package we now use `@op-engineering/op-sqlite`.
<div>
As SQLite package we now use `@op-engineering/op-sqlite`.
To get local persistence working, you need to add `@op-engineering/op-sqlite` as a direct dependency to your project and run `npx pod-install`.
To get local persistence working, you need to add `@op-engineering/op-sqlite` as a direct dependency to your project and run `npx pod-install`.
</div>
## Update your JazzProvider to enable local persistence
<h3>Update your JazzProvider to enable local persistence</h3>
Local persistence is now disabled by default.
<div>
Local persistence is now disabled by default.
To enable it, you need to pass the `storage` option to the `JazzProvider` component:
To enable it, you need to pass the `storage` option to the `JazzProvider` component:
</div>
<CodeGroup>
```tsx
<JazzProvider
auth={auto}
storage="sqlite"
peer="wss://cloud.jazz.tools/?key=you@example.com"
AccountSchema={MyAppAccount}
>
<App />
</JazzProvider>
```
</CodeGroup>
</ContentByFramework>
<CodeGroup>
```tsx
<JazzProvider
auth={auto}
storage="sqlite"
peer="wss://cloud.jazz.tools/?key=you@example.com"
AccountSchema={MyAppAccount}
>
<App />
</JazzProvider>
```
</CodeGroup>

View File

@@ -0,0 +1,28 @@
"use client";
import { type ReactNode, useRef } from "react";
interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
children?: ReactNode;
}
export const Heading = ({ children, tag: Tag, ...props }: HeadingProps) => {
const linkRef = useRef<HTMLAnchorElement>(null);
return (
<Tag {...props} className="group">
<a
href={`#${props.id}`}
className="no-underline float-left absolute -ml-[1.25em] hidden sm:block opacity-0 group-hover:opacity-100 transition-opacity"
aria-label="Navigate to header"
ref={linkRef}
>
<span aria-hidden="true">#</span>
</a>
<span className="cursor-pointer" onClick={() => linkRef.current?.click()}>
{children}
</span>
</Tag>
);
};

View File

@@ -1,12 +1,10 @@
import { promises as fs } from "fs";
import path from "path";
import { Deserializer, ReflectionKind } from "typedoc";
import { DOC_SECTIONS, PACKAGES } from "./utils/config.mjs";
import {
getPackageDescription,
loadTypedocFiles,
writeDocsFile,
} from "./utils/index.mjs";
import { join } from "path";
import { readFile, readdir } from "fs/promises";
import { Deserializer } from "typedoc";
import { DOC_SECTIONS } from "./utils/config.mjs";
import { loadTypedocFiles, writeDocsFile } from "./utils/index.mjs";
function formatType(type) {
if (!type) return "unknown";
@@ -500,9 +498,90 @@ async function generateDetailedDocs(docs) {
"- [Examples](https://jazz.tools/examples): Code examples and tutorials\n",
);
const content = output.join("\n");
await writeDocsFile("llms.txt", content);
await writeDocsFile("llms-full.txt", content);
const outputWithExamples = [...output];
await readMusicExample(outputWithExamples);
await writeDocsFile("llms.txt", output.join("\n"));
await writeDocsFile("llms-full.txt", outputWithExamples.join("\n"));
}
/**
* @typedef {Object} FileContent
* @property {string} filepath - The relative path to the file
* @property {string} content - The content of the file
*/
/**
* Recursively loads all files from a directory and its subdirectories
* @param {string} directoryPath - The path to the directory to load
* @param {Object} options - Optional configuration
* @param {string[]} options.exclude - File patterns to exclude (e.g., ['*.md', '*.git'])
* @param {string} options.encoding - File encoding (default: 'utf-8')
* @returns {Promise<FileContent[]>} Array of filepath/content pairs
*/
async function loadDirectoryContent(directoryPath, options = {}) {
const { exclude = [], encoding = "utf-8" } = options;
async function processDirectory(currentPath) {
const results = [];
try {
const entries = await readdir(currentPath, { withFileTypes: true });
for (const entry of entries) {
const fullPath = join(currentPath, entry.name);
if (entry.isDirectory()) {
// Recursively process subdirectories
const subDirResults = await processDirectory(fullPath);
results.push(...subDirResults);
} else if (entry.isFile()) {
// Check if file should be excluded
const shouldExclude = exclude.some((pattern) => {
if (pattern.startsWith("*.")) {
const extension = pattern.slice(1);
return entry.name.endsWith(extension);
}
return entry.name === pattern;
});
if (!shouldExclude) {
try {
const content = await readFile(fullPath, { encoding });
results.push({
filepath: fullPath,
content: content,
});
} catch (error) {
console.error(`Error reading file ${fullPath}:`, error);
}
}
}
}
} catch (error) {
console.error(`Error reading directory ${currentPath}:`, error);
}
return results;
}
try {
return await processDirectory(directoryPath);
} catch (error) {
throw new Error(`Failed to load directory content: ${error.message}`);
}
}
async function readMusicExample(output) {
const files = await loadDirectoryContent(
path.join(process.cwd(), "../../examples/music-player/src"),
);
output.push("## Music Example\n\n");
for (const file of files) {
output.push(`### ${file.filepath}\n`);
output.push(`\`\`\`ts\n${file.content}\n\`\`\`\n`);
}
}
// Main execution

View File

@@ -29,6 +29,11 @@ export const docNavigationItems = [
href: "/docs/ai-tools",
done: 100,
},
{
name: "Inspector",
href: "/docs/inspector",
done: 100,
},
],
},
{

View File

@@ -1,16 +1,22 @@
import { DocsLink } from "@/components/docs/DocsLink";
import type { MDXComponents } from "mdx/types";
import { Heading } from "./components/docs/DocHeading";
export function useMDXComponents(components: MDXComponents): MDXComponents {
return {
a: (props) => <DocsLink {...props} />,
h2: (props) => <Heading tag="h2" {...props} />,
h3: (props) => <Heading tag="h3" {...props} />,
h4: (props) => <Heading tag="h4" {...props} />,
h5: (props) => <Heading tag="h5" {...props} />,
h6: (props) => <Heading tag="h6" {...props} />,
...components,
CodeWithInterpolation: ({
highlightedCode,
}: { highlightedCode: string }) => {
return <div dangerouslySetInnerHTML={{ __html: highlightedCode }} />;
},
};
} satisfies MDXComponents;
}
export function InterpolateInCode(replace: { [key: string]: string }) {

View File

@@ -1,5 +1,24 @@
# cojson-storage-indexeddb
## 0.10.8
### Patch Changes
- Updated dependencies [153dc99]
- cojson@0.10.8
- cojson-storage@0.10.8
## 0.10.7
### Patch Changes
- 1e625f3: Improve rollback on error when failing to add new content
- Updated dependencies [0f83320]
- Updated dependencies [012022d]
- Updated dependencies [1e625f3]
- cojson@0.10.7
- cojson-storage@0.10.7
## 0.10.6
### Patch Changes

View File

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

View File

@@ -1,5 +1,24 @@
# cojson-storage-sqlite
## 0.8.66
### Patch Changes
- Updated dependencies [153dc99]
- cojson@0.10.8
- cojson-storage@0.10.8
## 0.8.65
### Patch Changes
- 1e625f3: Improve rollback on error when failing to add new content
- Updated dependencies [0f83320]
- Updated dependencies [012022d]
- Updated dependencies [1e625f3]
- cojson@0.10.7
- cojson-storage@0.10.7
## 0.8.64
### Patch Changes

View File

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

View File

@@ -1,5 +1,24 @@
# cojson-storage-sqlite
## 0.10.8
### Patch Changes
- Updated dependencies [153dc99]
- cojson@0.10.8
- cojson-storage@0.10.8
## 0.10.7
### Patch Changes
- 1e625f3: Improve rollback on error when failing to add new content
- Updated dependencies [0f83320]
- Updated dependencies [012022d]
- Updated dependencies [1e625f3]
- cojson@0.10.7
- cojson-storage@0.10.7
## 0.10.6
### Patch Changes

View File

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

View File

@@ -1,5 +1,21 @@
# cojson-storage
## 0.10.8
### Patch Changes
- Updated dependencies [153dc99]
- cojson@0.10.8
## 0.10.7
### Patch Changes
- 1e625f3: Improve rollback on error when failing to add new content
- Updated dependencies [0f83320]
- Updated dependencies [012022d]
- cojson@0.10.7
## 0.10.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "cojson-storage",
"version": "0.10.6",
"version": "0.10.8",
"main": "dist/index.js",
"type": "module",
"types": "src/index.ts",

View File

@@ -1,5 +1,20 @@
# cojson-transport-nodejs-ws
## 0.10.8
### Patch Changes
- Updated dependencies [153dc99]
- cojson@0.10.8
## 0.10.7
### Patch Changes
- Updated dependencies [0f83320]
- Updated dependencies [012022d]
- cojson@0.10.7
## 0.10.6
### Patch Changes

View File

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

View File

@@ -1,5 +1,18 @@
# cojson
## 0.10.8
### Patch Changes
- 153dc99: Catch errors on CoValueCore subscribers to avoid effects on the sync
## 0.10.7
### Patch Changes
- 0f83320: Use jazz-crypto-rs isomorphic bundle
- 012022d: Improve error logging on sync errors
## 0.10.6
### Patch Changes

View File

@@ -25,7 +25,7 @@
},
"type": "module",
"license": "MIT",
"version": "0.10.6",
"version": "0.10.8",
"devDependencies": {
"@opentelemetry/sdk-metrics": "^1.29.0",
"typescript": "~5.6.2",

View File

@@ -35,6 +35,7 @@ import { CoValueKnownState, NewContentMessage } from "./sync.js";
import { accountOrAgentIDfromSessionID } from "./typeUtils/accountOrAgentIDfromSessionID.js";
import { expectGroup } from "./typeUtils/expectGroup.js";
import { isAccountID } from "./typeUtils/isAccountID.js";
import { parseError } from "./utils.js";
/**
In order to not block other concurrently syncing CoValues we introduce a maximum size of transactions,
@@ -326,7 +327,14 @@ export class CoValueCore {
if (notifyMode === "immediate") {
const content = this.getCurrentContent();
for (const listener of this.listeners) {
listener(content);
try {
listener(content);
} catch (e) {
logger.error(
"Error in listener for coValue " + this.id,
parseError(e),
);
}
}
} else {
if (!this.nextDeferredNotify) {
@@ -336,7 +344,14 @@ export class CoValueCore {
this.deferredUpdates = 0;
const content = this.getCurrentContent();
for (const listener of this.listeners) {
listener(content);
try {
listener(content);
} catch (e) {
logger.error(
"Error in listener for coValue " + this.id,
parseError(e),
);
}
}
resolve();
}, 0);

View File

@@ -7,6 +7,8 @@ import { LocalNode } from "../localNode.js";
import { Role } from "../permissions.js";
import {
createTestNode,
createTwoConnectedNodes,
loadCoValueOrFail,
randomAnonymousAccountAndSessionID,
} from "./testUtils.js";
@@ -221,3 +223,38 @@ test("creating a coValue with a group should't trigger automatically a content c
getCurrentContentSpy.mockRestore();
});
test("listeners are notified even if the previous listener threw an error", async () => {
const { node1, node2 } = await createTwoConnectedNodes("server", "server");
const group = node1.node.createGroup();
group.addMember("everyone", "writer");
const coMap = group.createMap();
const spy1 = vi.fn();
const spy2 = vi.fn();
coMap.subscribe(spy1);
coMap.subscribe(spy2);
spy1.mockImplementation(() => {
throw new Error("test");
});
const errorLog = vi.spyOn(console, "error").mockImplementation(() => {});
coMap.set("hello", "world");
expect(spy1).toHaveBeenCalledTimes(2);
expect(spy2).toHaveBeenCalledTimes(2);
expect(errorLog).toHaveBeenCalledTimes(1);
await coMap.core.waitForSync();
const mapOnNode2 = await loadCoValueOrFail(node2.node, coMap.id);
expect(mapOnNode2.get("hello")).toBe("world");
errorLog.mockRestore();
});

View File

@@ -4,6 +4,7 @@ import { ControlledAgent } from "../coValues/account.js";
import { WasmCrypto } from "../crypto/WasmCrypto.js";
import { expectGroup } from "../typeUtils/expectGroup.js";
import {
connectTwoPeers,
createTwoConnectedNodes,
groupWithTwoAdmins,
groupWithTwoAdminsHighLevel,
@@ -2029,9 +2030,13 @@ test("Can give write permissions to 'everyone' (high-level)", async () => {
.getCurrentContent(),
);
connectTwoPeers(group.core.node, childContent2.core.node, "server", "server");
// Ensure that the group is available to newAccount
await group.core.waitForSync();
expect(childContent2.get("foo")).toEqual("bar");
console.log("Before anon set");
childContent2.set("foo", "bar2", "private");
expect(childContent2.get("foo")).toEqual("bar2");
});

View File

@@ -0,0 +1,9 @@
export function parseError(e: unknown): {
message: string | null;
stack: string | null;
} {
return {
message: e instanceof Error ? e.message : null,
stack: e instanceof Error ? (e.stack ?? null) : null,
};
}

View File

@@ -1,5 +1,31 @@
# jazz-browser-media-images
## 0.10.8
### Patch Changes
- Updated dependencies [153dc99]
- Updated dependencies [1e87fc7]
- Updated dependencies [2fb6428]
- cojson@0.10.8
- jazz-browser@0.10.8
- jazz-tools@0.10.8
## 0.10.7
### Patch Changes
- 1136d9b: Fixed isAuthenticated out-of-sync with the account state during the logOut and authenticate flows
- 0eed228: Fixes clerk auth flow
- Updated dependencies [0f83320]
- Updated dependencies [012022d]
- Updated dependencies [1136d9b]
- Updated dependencies [bf76d79]
- Updated dependencies [0eed228]
- cojson@0.10.7
- jazz-browser@0.10.7
- jazz-tools@0.10.7
## 0.10.6
### Patch Changes

View File

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

View File

@@ -1,5 +1,24 @@
# jazz-browser-media-images
## 0.10.8
### Patch Changes
- Updated dependencies [1e87fc7]
- Updated dependencies [2fb6428]
- jazz-browser@0.10.8
- jazz-tools@0.10.8
## 0.10.7
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [bf76d79]
- Updated dependencies [0eed228]
- jazz-browser@0.10.7
- jazz-tools@0.10.7
## 0.10.6
### Patch Changes

View File

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

View File

@@ -1,5 +1,34 @@
# jazz-browser
## 0.10.8
### Patch Changes
- 1e87fc7: Support external authenticators on passkey auth
- Updated dependencies [153dc99]
- Updated dependencies [2fb6428]
- cojson@0.10.8
- jazz-tools@0.10.8
- cojson-storage-indexeddb@0.10.8
- cojson-transport-ws@0.10.8
## 0.10.7
### Patch Changes
- 1136d9b: Fixed isAuthenticated out-of-sync with the account state during the logOut and authenticate flows
- bf76d79: enable Cmd+J by default to launch inspector on dev
- 0eed228: Fixes clerk auth flow
- Updated dependencies [0f83320]
- Updated dependencies [012022d]
- Updated dependencies [1136d9b]
- Updated dependencies [1e625f3]
- Updated dependencies [0eed228]
- cojson@0.10.7
- jazz-tools@0.10.7
- cojson-storage-indexeddb@0.10.7
- cojson-transport-ws@0.10.7
## 0.10.6
### Patch Changes

View File

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

View File

@@ -64,7 +64,7 @@ export class JazzBrowserContextManager<
});
}
this.updateContext(props, currentContext);
await this.updateContext(props, currentContext, authProps);
}
propsChanged(props: JazzContextManagerProps<Acc>) {

View File

@@ -128,11 +128,17 @@ export class BrowserPasskeyAuth {
name: username + ` (${new Date().toLocaleString()})`,
displayName: username,
},
pubKeyCredParams: [{ alg: -7, type: "public-key" }],
pubKeyCredParams: [
{ alg: -7, type: "public-key" },
{ alg: -8, type: "public-key" },
{ alg: -37, type: "public-key" },
{ alg: -257, type: "public-key" },
],
authenticatorSelection: {
authenticatorAttachment: "platform",
authenticatorAttachment: "cross-platform",
requireResidentKey: true,
residentKey: "required",
userVerification: "preferred",
},
timeout: 60000,
attestation: "direct",
@@ -151,7 +157,9 @@ export class BrowserPasskeyAuth {
rpId: this.appHostname,
allowCredentials: [],
timeout: 60000,
userVerification: "preferred",
},
mediation: "optional",
});
return value as

View File

@@ -165,8 +165,6 @@ export async function createJazzBrowserContext<Acc extends Account>(
const authSecretStorage = options.authSecretStorage;
const credentials = options.credentials ?? (await authSecretStorage.get());
authSecretStorage.emitUpdate(credentials);
function handleAuthUpdate(isAuthenticated: boolean) {
if (isAuthenticated) {
toggleNetwork(true);
@@ -176,7 +174,7 @@ export async function createJazzBrowserContext<Acc extends Account>(
}
unsubscribeAuthUpdate = authSecretStorage.onUpdate(handleAuthUpdate);
handleAuthUpdate(authSecretStorage.isAuthenticated);
handleAuthUpdate(authSecretStorage.getIsAuthenticated(credentials));
}
const context = await createJazzContext({

View File

@@ -1,5 +1,27 @@
# jazz-inspector
## 0.10.8
### Patch Changes
- Updated dependencies [153dc99]
- Updated dependencies [2fb6428]
- cojson@0.10.8
- jazz-tools@0.10.8
- jazz-react-core@0.10.8
## 0.10.7
### Patch Changes
- Updated dependencies [0f83320]
- Updated dependencies [012022d]
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- cojson@0.10.7
- jazz-react-core@0.10.7
- jazz-tools@0.10.7
## 0.10.6
### Patch Changes

View File

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

View File

@@ -1,5 +1,28 @@
# jazz-autosub
## 0.10.8
### Patch Changes
- Updated dependencies [153dc99]
- Updated dependencies [2fb6428]
- cojson@0.10.8
- jazz-tools@0.10.8
- cojson-transport-ws@0.10.8
## 0.10.7
### Patch Changes
- b0c5572: Add crypto option to provide PureJSCrypto on the runtimes where wasm is not supported
- Updated dependencies [0f83320]
- Updated dependencies [012022d]
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- cojson@0.10.7
- jazz-tools@0.10.7
- cojson-transport-ws@0.10.7
## 0.10.6
### Patch Changes

View File

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

View File

@@ -1,5 +1,35 @@
# jazz-browser-media-images
## 0.10.8
### Patch Changes
- Updated dependencies [153dc99]
- Updated dependencies [1e87fc7]
- Updated dependencies [2fb6428]
- cojson@0.10.8
- jazz-browser@0.10.8
- jazz-tools@0.10.8
- jazz-auth-clerk@0.10.8
- jazz-react@0.10.8
## 0.10.7
### Patch Changes
- 1136d9b: Fixed isAuthenticated out-of-sync with the account state during the logOut and authenticate flows
- 0eed228: Fixes clerk auth flow
- Updated dependencies [0f83320]
- Updated dependencies [012022d]
- Updated dependencies [1136d9b]
- Updated dependencies [bf76d79]
- Updated dependencies [0eed228]
- cojson@0.10.7
- jazz-auth-clerk@0.10.7
- jazz-browser@0.10.7
- jazz-react@0.10.7
- jazz-tools@0.10.7
## 0.10.6
### Patch Changes

View File

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

View File

@@ -1,5 +1,26 @@
# jazz-react-core
## 0.10.8
### Patch Changes
- Updated dependencies [153dc99]
- Updated dependencies [2fb6428]
- cojson@0.10.8
- jazz-tools@0.10.8
## 0.10.7
### Patch Changes
- 1136d9b: Fixed isAuthenticated out-of-sync with the account state during the logOut and authenticate flows
- Updated dependencies [0f83320]
- Updated dependencies [012022d]
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- cojson@0.10.7
- jazz-tools@0.10.7
## 0.10.6
### Patch Changes

View File

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

View File

@@ -1,7 +1,7 @@
import { DemoAuth } from "jazz-tools";
import { useEffect, useMemo, useState } from "react";
import { useAuthSecretStorage, useJazzContext } from "../hooks.js";
import { useIsAuthenticated } from "./useIsAuthenticated.js";
import { useIsAuthenticated } from "../hooks.js";
/**
* `useDemoAuth` is a hook that provides a `JazzAuth` object for demo authentication.

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