@dxos/echo-solid 0.8.4-main.ef1bc66f44 → 0.8.4-main.fcfe5033a5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/echo-solid",
3
- "version": "0.8.4-main.ef1bc66f44",
3
+ "version": "0.8.4-main.fcfe5033a5",
4
4
  "description": "Solid.js integration for ECHO.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -30,19 +30,19 @@
30
30
  "dependencies": {
31
31
  "@effect-atom/atom": "^0.5.1",
32
32
  "@solid-primitives/utils": "^6.3.2",
33
- "@dxos/echo": "0.8.4-main.ef1bc66f44",
34
- "@dxos/echo-atom": "0.8.4-main.ef1bc66f44",
35
- "@dxos/effect-atom-solid": "0.8.4-main.ef1bc66f44"
33
+ "@dxos/echo": "0.8.4-main.fcfe5033a5",
34
+ "@dxos/echo-atom": "0.8.4-main.fcfe5033a5",
35
+ "@dxos/effect-atom-solid": "0.8.4-main.fcfe5033a5"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@solidjs/testing-library": "^0.8.10",
39
- "solid-js": "^1.9.9",
39
+ "solid-js": "^1.9.11",
40
40
  "vite-plugin-solid": "^2.11.10",
41
41
  "vitest": "3.2.4",
42
- "@dxos/echo-db": "0.8.4-main.ef1bc66f44"
42
+ "@dxos/echo-db": "0.8.4-main.fcfe5033a5"
43
43
  },
44
44
  "peerDependencies": {
45
- "solid-js": "^1.9.9"
45
+ "solid-js": "^1.9.11"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"
@@ -8,8 +8,8 @@ import { describe, expect, test } from 'vitest';
8
8
 
9
9
  import type { Entity } from '@dxos/echo';
10
10
  import { Obj } from '@dxos/echo';
11
- import { TestSchema } from '@dxos/echo/testing';
12
11
  import { createObject } from '@dxos/echo-db';
12
+ import { TestSchema } from '@dxos/echo/testing';
13
13
  import { Registry } from '@dxos/effect-atom-solid';
14
14
  import { RegistryProvider } from '@dxos/effect-atom-solid';
15
15
 
@@ -87,8 +87,8 @@ describe('useObject', () => {
87
87
  expect(getByTestId('value').textContent).toBe('Test');
88
88
 
89
89
  // Update the property via Obj.change.
90
- Obj.change(obj, (o) => {
91
- o.name = 'Updated';
90
+ Obj.change(obj, (obj) => {
91
+ obj.name = 'Updated';
92
92
  });
93
93
 
94
94
  // Wait for reactivity to update.
@@ -119,8 +119,8 @@ describe('useObject', () => {
119
119
  expect(getByTestId('name').textContent).toBe('Test');
120
120
 
121
121
  // Update a property via Obj.change.
122
- Obj.change(obj, (o) => {
123
- o.name = 'Updated';
122
+ Obj.change(obj, (obj) => {
123
+ obj.name = 'Updated';
124
124
  });
125
125
 
126
126
  // Wait for reactivity to update.
@@ -150,8 +150,8 @@ describe('useObject', () => {
150
150
  expect(result).toBe('Test');
151
151
 
152
152
  // Update a different property via Obj.change.
153
- Obj.change(obj, (o) => {
154
- o.email = 'newemail@example.com';
153
+ Obj.change(obj, (obj) => {
154
+ obj.email = 'newemail@example.com';
155
155
  });
156
156
 
157
157
  // Name should still be 'Test'.
package/src/useObject.ts CHANGED
@@ -160,20 +160,20 @@ export function useObject<T extends Obj.Unknown, K extends keyof T>(
160
160
  return;
161
161
  }
162
162
 
163
- Obj.change(obj, (o: any) => {
163
+ Obj.change(obj, (obj: any) => {
164
164
  if (typeof updateOrValue === 'function') {
165
- const returnValue = (updateOrValue as (obj: unknown) => unknown)(property !== undefined ? o[property] : o);
165
+ const returnValue = (updateOrValue as (obj: unknown) => unknown)(property !== undefined ? obj[property] : obj);
166
166
  if (returnValue !== undefined) {
167
167
  if (property === undefined) {
168
168
  throw new Error('Cannot re-assign the entire object');
169
169
  }
170
- o[property] = returnValue;
170
+ obj[property] = returnValue;
171
171
  }
172
172
  } else {
173
173
  if (property === undefined) {
174
174
  throw new Error('Cannot re-assign the entire object');
175
175
  }
176
- o[property] = updateOrValue;
176
+ obj[property] = updateOrValue;
177
177
  }
178
178
  });
179
179
  };
@@ -7,8 +7,8 @@ import { type JSX, createSignal } from 'solid-js';
7
7
  import { afterEach, beforeEach, describe, expect, test } from 'vitest';
8
8
 
9
9
  import { Filter, Obj, Query } from '@dxos/echo';
10
- import { TestSchema } from '@dxos/echo/testing';
11
10
  import { EchoTestBuilder } from '@dxos/echo-db/testing';
11
+ import { TestSchema } from '@dxos/echo/testing';
12
12
 
13
13
  import { useQuery } from './useQuery';
14
14
 
@@ -7,8 +7,8 @@ import { type JSX, createMemo } from 'solid-js';
7
7
  import { afterEach, beforeEach, describe, expect, test } from 'vitest';
8
8
 
9
9
  import { Type } from '@dxos/echo';
10
- import { TestSchema } from '@dxos/echo/testing';
11
10
  import { EchoTestBuilder } from '@dxos/echo-db/testing';
11
+ import { TestSchema } from '@dxos/echo/testing';
12
12
 
13
13
  import { useSchema } from './useSchema';
14
14
 
@@ -100,7 +100,7 @@ describe('useSchema', () => {
100
100
  // The runtime registry query subscription doesn't fire when schemas are registered.
101
101
  // See: packages/core/echo/echo-db/src/proxy-db/runtime-schema-registry.ts:57
102
102
  let schemaAccessor: (() => any) | undefined;
103
- const typename = 'example.com/type/Person';
103
+ const typename = 'com.example.type.person';
104
104
 
105
105
  function TestComponent() {
106
106
  const schema = useSchema(db, typename);
package/src/useSchema.ts CHANGED
@@ -16,7 +16,7 @@ type MaybeAccessor<T> = T | Accessor<T>;
16
16
  * @param typename - The schema typename to query (can be reactive)
17
17
  * @returns An accessor that returns the current schema or undefined
18
18
  */
19
- export const useSchema = <T extends Type.Entity.Any = Type.Entity.Any>(
19
+ export const useSchema = <T extends Type.AnyEntity = Type.AnyEntity>(
20
20
  db?: MaybeAccessor<Database.Database | undefined>,
21
21
  typename?: MaybeAccessor<string | undefined>,
22
22
  ): Accessor<T | undefined> => {