Compare commits

...

1 Commits

Author SHA1 Message Date
Guido D'Orsi
49ec4cccdc fix: mark AccountSchema as required prop 2025-06-11 19:03:13 +02:00
17 changed files with 40 additions and 3 deletions

View File

@@ -0,0 +1,10 @@
---
"jazz-browser": minor
"jazz-vue": minor
"jazz-expo": minor
"jazz-react": minor
"jazz-react-native": minor
"jazz-svelte": minor
---
Mark AccountSchema as required prop

View File

@@ -2,6 +2,7 @@
import { JazzProvider } from "jazz-react";
import { AuthProvider } from "jazz-react-auth-betterauth";
import { Account } from "jazz-tools";
import { type ReactNode, lazy } from "react";
const JazzDevTools =
@@ -16,6 +17,7 @@ const JazzDevTools =
export function JazzAndAuth({ children }: { children: ReactNode }) {
return (
<JazzProvider
AccountSchema={Account}
sync={{
peer: "wss://cloud.jazz.tools/?key=betterauth-example@garden.co",
}}

View File

@@ -1,4 +1,5 @@
import { JazzProvider } from "jazz-expo";
import { Account } from "jazz-tools";
import React, { StrictMode } from "react";
import { apiKey } from "./apiKey";
import ChatScreen from "./chat";
@@ -7,6 +8,7 @@ export default function App() {
return (
<StrictMode>
<JazzProvider
AccountSchema={Account}
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}

View File

@@ -4,6 +4,7 @@ import {
} from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { JazzProvider } from "jazz-react-native";
import { Account } from "jazz-tools";
import React, { StrictMode, useEffect, useState } from "react";
import { Linking } from "react-native";
import { apiKey } from "./apiKey";
@@ -50,6 +51,7 @@ function App() {
return (
<StrictMode>
<JazzProvider
AccountSchema={Account}
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}

View File

@@ -3,6 +3,7 @@ import { createApp, defineComponent, h } from "vue";
import App from "./App.vue";
import "./index.css";
import { apiKey } from "@/apiKey";
import { Account } from "jazz-tools";
import router from "./router";
const RootComponent = defineComponent({
@@ -12,6 +13,7 @@ const RootComponent = defineComponent({
h(
JazzProvider,
{
AccountSchema: Account,
sync: {
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
},

View File

@@ -3,7 +3,7 @@ import { getRandomUsername, inIframe, onChatLoad } from "@/util.ts";
import { useIframeHashRouter } from "hash-slash";
import { JazzInspector } from "jazz-inspector";
import { JazzProvider, useAccount } from "jazz-react";
import { Group } from "jazz-tools";
import { Account, Group } from "jazz-tools";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { ChatScreen } from "./chatScreen.tsx";
@@ -56,6 +56,7 @@ createRoot(document.getElementById("root")!).render(
<ThemeProvider>
<StrictMode>
<JazzProvider
AccountSchema={Account}
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}

View File

@@ -5,6 +5,7 @@ import App from "./App.tsx";
import "./index.css";
import { JazzInspector } from "jazz-inspector";
import { JazzProviderWithClerk } from "jazz-react-auth-clerk";
import { Account } from "jazz-tools";
import { ReactNode } from "react";
import { apiKey } from "./apiKey";
@@ -20,6 +21,7 @@ function JazzProvider({ children }: { children: ReactNode }) {
return (
<JazzProviderWithClerk
AccountSchema={Account}
clerk={clerk}
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,

View File

@@ -2,10 +2,12 @@
import { JazzInspector } from "jazz-inspector";
import { JazzProvider } from "jazz-react";
import { Account } from "jazz-tools";
export function Jazz({ children }: { children: React.ReactNode }) {
return (
<JazzProvider
AccountSchema={Account}
experimental_enableSSR
sync={{
peer: `wss://cloud.jazz.tools/`,

View File

@@ -1,8 +1,10 @@
import { JazzProvider } from "jazz-react";
import { Account } from "jazz-tools";
export function JazzAndAuth({ children }: { children: React.ReactNode }) {
return (
<JazzProvider
AccountSchema={Account}
sync={{
peer: "wss://cloud.jazz.tools/?key=jazz-paper-scissors@garden.co",
}}

View File

@@ -5,6 +5,7 @@ import ReactDOM from "react-dom/client";
import "./index.css";
import { apiKey } from "@/apiKey.ts";
import { JazzProvider } from "jazz-react";
import { Account } from "jazz-tools";
import { App } from "./app";
const rootElement = document.getElementById("app");
@@ -13,6 +14,7 @@ if (rootElement && !rootElement.innerHTML) {
root.render(
<StrictMode>
<JazzProvider
AccountSchema={Account}
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}

View File

@@ -1,11 +1,13 @@
<script lang="ts">
import { JazzProvider, PasskeyAuthBasicUI } from 'jazz-svelte';
import { apiKey } from '../apiKey';
import { Account } from 'jazz-tools';
let { children } = $props();
</script>
<JazzProvider
AccountSchema={Account}
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`
}}

View File

@@ -4,11 +4,13 @@ import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { Account } from "jazz-tools";
import { apiKey } from "./apiKey.ts";
function JazzAndAuth({ children }: { children: React.ReactNode }) {
return (
<JazzProvider
AccountSchema={Account}
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}

View File

@@ -4,6 +4,7 @@ import { StrictMode, useState } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { Account } from "jazz-tools";
import { wordlist } from "./wordlist.ts";
function PassphraseAuthBasicUI(props: {
@@ -141,6 +142,7 @@ function PassphraseAuthBasicUI(props: {
function JazzAndAuth({ children }: { children: React.ReactNode }) {
return (
<JazzProvider
AccountSchema={Account}
sync={{
peer: "wss://cloud.jazz.tools/?key=minimal-auth-passphrase-example@garden.co",
}}

View File

@@ -4,11 +4,13 @@ import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { Account } from "jazz-tools";
import { apiKey } from "./apiKey";
createRoot(document.getElementById("root")!).render(
<StrictMode>
<JazzProvider
AccountSchema={Account}
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}

View File

@@ -4,11 +4,13 @@ import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { JazzInspector } from "jazz-inspector";
import { Account } from "jazz-tools";
import { apiKey } from "./apiKey.ts";
createRoot(document.getElementById("root")!).render(
<StrictMode>
<JazzProvider
AccountSchema={Account}
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}

View File

@@ -29,7 +29,7 @@ export type JazzContextManagerProps<
anonymousAccount: InstanceOfSchema<S>,
) => Promise<void>;
storage?: BaseBrowserContextOptions["storage"];
AccountSchema?: S;
AccountSchema: S;
defaultProfileName?: string;
};

View File

@@ -50,7 +50,7 @@ export const JazzProvider = defineComponent({
type: Function as unknown as PropType<
(AccountClass<Account> & CoValueFromRaw<Account>) | AnyAccountSchema
>,
required: false,
required: true,
},
storage: {
type: String as PropType<"indexedDB">,