jazz-tools 0.20.5 → 0.20.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
 
2
- > jazz-tools@0.20.5 build /home/runner/_work/jazz/jazz/packages/jazz-tools
2
+ > jazz-tools@0.20.6 build /home/runner/_work/jazz/jazz/packages/jazz-tools
3
3
  > tsup && pnpm types && pnpm build:svelte && pnpm build:better-auth-svelte
4
4
 
5
5
  CLI Building entry: {"index":"src/index.ts","testing":"src/testing.ts","tools/ssr":"src/tools/ssr/index.ts"}
@@ -109,110 +109,110 @@
109
109
  ESM Build start
110
110
  ESM dist/tiptap/index.js 564.00 B
111
111
  ESM dist/tiptap/index.js.map 1.21 KB
112
- ESM ⚡️ Build success in 37ms
112
+ ESM ⚡️ Build success in 35ms
113
113
  ESM dist/worker/index.js 3.45 KB
114
- ESM dist/worker/napi-crypto.js 110.00 B
115
114
  ESM dist/worker/edge-wasm.js 259.00 B
115
+ ESM dist/worker/napi-crypto.js 110.00 B
116
116
  ESM dist/worker/index.js.map 6.97 KB
117
- ESM dist/worker/napi-crypto.js.map 162.00 B
118
117
  ESM dist/worker/edge-wasm.js.map 505.00 B
119
- ESM ⚡️ Build success in 38ms
118
+ ESM dist/worker/napi-crypto.js.map 162.00 B
119
+ ESM ⚡️ Build success in 34ms
120
120
  ESM dist/better-auth/auth/client.js 4.54 KB
121
- ESM dist/better-auth/auth/react.js 813.00 B
122
121
  ESM dist/better-auth/auth/server.js 8.40 KB
122
+ ESM dist/better-auth/auth/react.js 813.00 B
123
123
  ESM dist/better-auth/auth/client.js.map 8.44 KB
124
- ESM dist/better-auth/auth/react.js.map 2.07 KB
125
124
  ESM dist/better-auth/auth/server.js.map 15.40 KB
126
- ESM ⚡️ Build success in 32ms
125
+ ESM dist/better-auth/auth/react.js.map 2.07 KB
126
+ ESM ⚡️ Build success in 29ms
127
127
  ESM dist/media/index.js 236.00 B
128
- ESM dist/media/index.browser.js 2.79 KB
129
128
  ESM dist/media/index.native.js 4.04 KB
130
- ESM dist/media/chunk-IRL3KNPO.js 6.70 KB
131
129
  ESM dist/media/index.server.js 2.95 KB
130
+ ESM dist/media/chunk-IRL3KNPO.js 6.70 KB
131
+ ESM dist/media/index.browser.js 2.79 KB
132
132
  ESM dist/media/index.js.map 71.00 B
133
- ESM dist/media/index.browser.js.map 6.15 KB
133
+ ESM dist/media/index.server.js.map 6.37 KB
134
134
  ESM dist/media/index.native.js.map 8.17 KB
135
135
  ESM dist/media/chunk-IRL3KNPO.js.map 17.00 KB
136
- ESM dist/media/index.server.js.map 6.37 KB
137
- ESM ⚡️ Build success in 40ms
138
- ESM dist/react-core/chunk-UOYH6JFJ.js 189.00 B
139
- ESM dist/react-core/testing.js 904.00 B
140
- ESM dist/react-core/index.js 17.87 KB
141
- ESM dist/react-core/chunk-UOYH6JFJ.js.map 363.00 B
142
- ESM dist/react-core/testing.js.map 1.34 KB
143
- ESM dist/react-core/index.js.map 58.59 KB
144
- ESM ⚡️ Build success in 38ms
136
+ ESM dist/media/index.browser.js.map 6.15 KB
137
+ ESM ⚡️ Build success in 37ms
145
138
  ESM dist/expo/index.js 4.70 KB
146
139
  ESM dist/expo/testing.js 112.00 B
147
140
  ESM dist/expo/polyfills.js 858.00 B
148
- ESM dist/expo/index.js.map 10.26 KB
149
141
  ESM dist/expo/testing.js.map 168.00 B
142
+ ESM dist/expo/index.js.map 10.26 KB
150
143
  ESM dist/expo/polyfills.js.map 1.61 KB
151
- ESM ⚡️ Build success in 47ms
144
+ ESM ⚡️ Build success in 40ms
152
145
  ESM dist/browser/index.js 15.96 KB
153
146
  ESM dist/browser/index.js.map 34.06 KB
154
- ESM ⚡️ Build success in 58ms
147
+ ESM ⚡️ Build success in 52ms
148
+ ESM dist/react-core/index.js 17.87 KB
149
+ ESM dist/react-core/testing.js 904.00 B
150
+ ESM dist/react-core/chunk-UOYH6JFJ.js 189.00 B
151
+ ESM dist/react-core/index.js.map 58.59 KB
152
+ ESM dist/react-core/testing.js.map 1.34 KB
153
+ ESM dist/react-core/chunk-UOYH6JFJ.js.map 363.00 B
154
+ ESM ⚡️ Build success in 51ms
155
155
  ESM dist/better-auth/database-adapter/index.js 26.65 KB
156
156
  ESM dist/better-auth/database-adapter/index.js.map 58.27 KB
157
- ESM ⚡️ Build success in 66ms
158
- ESM dist/react/index.js 26.02 KB
159
- ESM dist/react/testing.js 122.00 B
160
- ESM dist/react/ssr.js 693.00 B
161
- ESM dist/react/index.js.map 55.45 KB
162
- ESM dist/react/testing.js.map 165.00 B
163
- ESM dist/react/ssr.js.map 1.10 KB
164
- ESM ⚡️ Build success in 70ms
165
- ESM dist/react-native-core/index.js 34.14 KB
166
- ESM dist/react-native-core/testing.js 119.00 B
167
- ESM dist/react-native-core/index.js.map 68.45 KB
168
- ESM dist/react-native-core/testing.js.map 175.00 B
169
- ESM ⚡️ Build success in 86ms
170
- ESM dist/prosemirror/index.js 77.76 KB
171
- ESM dist/prosemirror/index.js.map 307.20 KB
172
- ESM ⚡️ Build success in 90ms
157
+ ESM ⚡️ Build success in 57ms
158
+ ESM dist/react-native/index.js 36.68 KB
173
159
  ESM dist/react-native/testing.js 120.00 B
174
160
  ESM dist/react-native/polyfills.js 858.00 B
175
- ESM dist/react-native/index.js 36.68 KB
161
+ ESM dist/react-native/index.js.map 74.00 KB
176
162
  ESM dist/react-native/polyfills.js.map 1.61 KB
177
163
  ESM dist/react-native/testing.js.map 176.00 B
178
- ESM dist/react-native/index.js.map 74.00 KB
179
- ESM ⚡️ Build success in 90ms
180
- ESM dist/inspector/standalone.js 12.61 KB
164
+ ESM ⚡️ Build success in 62ms
165
+ ESM dist/prosemirror/index.js 77.76 KB
166
+ ESM dist/prosemirror/index.js.map 307.20 KB
167
+ ESM ⚡️ Build success in 71ms
168
+ ESM dist/react-native-core/index.js 34.14 KB
169
+ ESM dist/react-native-core/testing.js 119.00 B
170
+ ESM dist/react-native-core/index.js.map 68.45 KB
171
+ ESM dist/react-native-core/testing.js.map 175.00 B
172
+ ESM ⚡️ Build success in 73ms
173
+ ESM dist/react/testing.js 122.00 B
174
+ ESM dist/react/ssr.js 693.00 B
175
+ ESM dist/react/index.js 26.02 KB
176
+ ESM dist/react/testing.js.map 165.00 B
177
+ ESM dist/react/ssr.js.map 1.10 KB
178
+ ESM dist/react/index.js.map 55.45 KB
179
+ ESM ⚡️ Build success in 73ms
181
180
  ESM dist/inspector/index.js 37.49 KB
181
+ ESM dist/inspector/standalone.js 12.61 KB
182
182
  ESM dist/inspector/chunk-6JPVMI3V.js 130.10 KB
183
183
  ESM dist/inspector/standalone.js.map 20.11 KB
184
184
  ESM dist/inspector/index.js.map 63.80 KB
185
185
  ESM dist/inspector/chunk-6JPVMI3V.js.map 225.43 KB
186
- ESM ⚡️ Build success in 103ms
187
- ESM dist/tools/ssr.js 156.00 B
188
- ESM dist/testing.js 8.56 KB
186
+ ESM ⚡️ Build success in 80ms
189
187
  ESM dist/index.js 32.17 KB
190
188
  ESM dist/chunk-K4D7IMFM.js 690.00 B
189
+ ESM dist/tools/ssr.js 156.00 B
191
190
  ESM dist/chunk-ZQWSQH6L.js 945.00 B
191
+ ESM dist/testing.js 8.56 KB
192
192
  ESM dist/chunk-HBWUGW37.js 237.48 KB
193
- ESM dist/tools/ssr.js.map 71.00 B
194
- ESM dist/testing.js.map 16.22 KB
195
193
  ESM dist/index.js.map 65.34 KB
196
194
  ESM dist/chunk-K4D7IMFM.js.map 1.10 KB
195
+ ESM dist/tools/ssr.js.map 71.00 B
197
196
  ESM dist/chunk-ZQWSQH6L.js.map 71.00 B
197
+ ESM dist/testing.js.map 16.22 KB
198
198
  ESM dist/chunk-HBWUGW37.js.map 558.55 KB
199
- ESM ⚡️ Build success in 139ms
199
+ ESM ⚡️ Build success in 113ms
200
200
  ESM dist/inspector/register-custom-element.js 305.00 B
201
- ESM dist/inspector/register-custom-element.js.map 445.00 B
202
201
  ESM dist/inspector/custom-element-TJNWN4WC.js 1.64 MB
202
+ ESM dist/inspector/register-custom-element.js.map 445.00 B
203
203
  ESM dist/inspector/custom-element-TJNWN4WC.js.map 2.52 MB
204
- ESM ⚡️ Build success in 168ms
204
+ ESM ⚡️ Build success in 141ms
205
205
 
206
- > jazz-tools@0.20.5 types /home/runner/_work/jazz/jazz/packages/jazz-tools
206
+ > jazz-tools@0.20.6 types /home/runner/_work/jazz/jazz/packages/jazz-tools
207
207
  > tsc --outDir dist
208
208
 
209
209
 
210
- > jazz-tools@0.20.5 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
210
+ > jazz-tools@0.20.6 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
211
211
  > rm -rf dist/svelte && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json
212
212
 
213
213
  src/svelte -> dist/svelte
214
214
 
215
- > jazz-tools@0.20.5 build:better-auth-svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
215
+ > jazz-tools@0.20.6 build:better-auth-svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
216
216
  > mkdir -p dist/better-auth/auth && svelte-package -i src/better-auth/auth -o dist/better-auth/auth-temp --tsconfig tsconfig.svelte.json && cp dist/better-auth/auth-temp/svelte.svelte dist/better-auth/auth/svelte.svelte && cp dist/better-auth/auth-temp/svelte.svelte.d.ts dist/better-auth/auth/svelte.d.ts && rm -rf dist/better-auth/auth-temp
217
217
 
218
218
  src/better-auth/auth -> dist/better-auth/auth-temp
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # jazz-tools
2
2
 
3
+ ## 0.20.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [cdf8274]
8
+ - cojson@0.20.6
9
+ - cojson-storage-indexeddb@0.20.6
10
+ - cojson-transport-ws@0.20.6
11
+
3
12
  ## 0.20.5
4
13
 
5
14
  ### Patch Changes
package/package.json CHANGED
@@ -196,7 +196,7 @@
196
196
  },
197
197
  "type": "module",
198
198
  "license": "MIT",
199
- "version": "0.20.5",
199
+ "version": "0.20.6",
200
200
  "dependencies": {
201
201
  "@manuscripts/prosemirror-recreate-steps": "^0.1.4",
202
202
  "@scure/base": "1.2.1",
@@ -213,9 +213,9 @@
213
213
  "prosemirror-transform": "^1.9.0",
214
214
  "use-sync-external-store": "^1.5.0",
215
215
  "zod": "4.1.11",
216
- "cojson": "0.20.5",
217
- "cojson-storage-indexeddb": "0.20.5",
218
- "cojson-transport-ws": "0.20.5"
216
+ "cojson": "0.20.6",
217
+ "cojson-storage-indexeddb": "0.20.6",
218
+ "cojson-transport-ws": "0.20.6"
219
219
  },
220
220
  "devDependencies": {
221
221
  "@scure/bip39": "^1.3.0",
@@ -1025,4 +1025,71 @@ describe("useCoState", () => {
1025
1025
  assertLoaded(result.current);
1026
1026
  expect(result.current.value).toBe("test");
1027
1027
  });
1028
+
1029
+ it("should render without infinite re-renders when accessing 2-level nested unresolved co-values", async () => {
1030
+ const account = await createJazzTestAccount({
1031
+ isCurrentActiveAccount: true,
1032
+ });
1033
+
1034
+ // 3-level schema: Organization -> Project -> Task
1035
+ const Task = co.map({
1036
+ title: z.string(),
1037
+ });
1038
+
1039
+ const Project = co.map({
1040
+ name: z.string(),
1041
+ task: co.optional(Task),
1042
+ });
1043
+
1044
+ const Organization = co.map({
1045
+ name: z.string(),
1046
+ project: co.optional(Project),
1047
+ });
1048
+
1049
+ const org = Organization.create({
1050
+ name: "Test Org",
1051
+ project: Project.create({
1052
+ name: "Test Project",
1053
+ task: Task.create({ title: "Test Task" }),
1054
+ }),
1055
+ });
1056
+
1057
+ let renderCount = 0;
1058
+
1059
+ const { result } = renderHook(
1060
+ () => {
1061
+ renderCount++;
1062
+ const orgState = useCoState(Organization, org.$jazz.id, {
1063
+ resolve: {
1064
+ project: {},
1065
+ },
1066
+ });
1067
+
1068
+ // Access 2-level nested unresolved co-values
1069
+ if (orgState.$isLoaded) {
1070
+ const project = orgState.project;
1071
+ if (project?.$isLoaded) {
1072
+ // This should not cause infinite re-renders
1073
+ const _ = project.task;
1074
+ }
1075
+ }
1076
+
1077
+ return orgState;
1078
+ },
1079
+ {
1080
+ account,
1081
+ },
1082
+ );
1083
+
1084
+ await waitFor(() => {
1085
+ assertLoaded(result.current);
1086
+ expect(result.current.name).toBe("Test Org");
1087
+ });
1088
+
1089
+ // Wait a bit to ensure no additional re-renders occur
1090
+ await new Promise((resolve) => setTimeout(resolve, 100));
1091
+
1092
+ // Should not have excessive re-renders
1093
+ expect(renderCount).toBeLessThan(10);
1094
+ });
1028
1095
  });