@dxos/react-client 2.15.7 → 2.16.1

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.
Files changed (45) hide show
  1. package/.rush/temp/package-deps_build:test.json +11 -12
  2. package/.rush/temp/shrinkwrap-deps.json +8 -7
  3. package/README.md +4 -4
  4. package/dist/src/containers/ClientInitializer.d.ts +8 -2
  5. package/dist/src/containers/ClientInitializer.d.ts.map +1 -1
  6. package/dist/src/containers/ClientInitializer.js +4 -7
  7. package/dist/src/containers/ClientInitializer.js.map +1 -1
  8. package/dist/src/containers/ClientProvider.d.ts +1 -2
  9. package/dist/src/containers/ClientProvider.d.ts.map +1 -1
  10. package/dist/src/containers/ClientProvider.js +2 -1
  11. package/dist/src/containers/ClientProvider.js.map +1 -1
  12. package/dist/src/containers/ClientProvider.test.js +3 -3
  13. package/dist/src/containers/ClientProvider.test.js.map +1 -1
  14. package/dist/src/containers/ProfileInitializer.d.ts +1 -2
  15. package/dist/src/containers/ProfileInitializer.d.ts.map +1 -1
  16. package/dist/src/containers/ProfileInitializer.js +2 -1
  17. package/dist/src/containers/ProfileInitializer.js.map +1 -1
  18. package/dist/src/containers/index.d.ts +3 -3
  19. package/dist/src/containers/index.d.ts.map +1 -1
  20. package/dist/src/containers/index.js +12 -9
  21. package/dist/src/containers/index.js.map +1 -1
  22. package/dist/src/hooks/client/useClient.d.ts.map +1 -1
  23. package/dist/src/hooks/client/useClient.js +2 -2
  24. package/dist/src/hooks/client/useClient.js.map +1 -1
  25. package/dist/src/hooks/client/useConfig.d.ts.map +1 -1
  26. package/dist/src/hooks/client/useConfig.js +2 -2
  27. package/dist/src/hooks/client/useConfig.js.map +1 -1
  28. package/dist/stories/helpers/ContactsSelector.js +1 -1
  29. package/dist/stories/helpers/ContactsSelector.js.map +1 -1
  30. package/dist/tsconfig.tsbuildinfo +1 -1
  31. package/package.json +9 -8
  32. package/react-client.build.log +5 -5
  33. package/src/containers/ClientInitializer.tsx +9 -4
  34. package/src/containers/ClientProvider.test.tsx +1 -1
  35. package/src/containers/ClientProvider.tsx +1 -3
  36. package/src/containers/ProfileInitializer.tsx +1 -3
  37. package/src/containers/index.ts +3 -3
  38. package/src/hooks/client/useClient.ts +2 -1
  39. package/src/hooks/client/useConfig.ts +2 -1
  40. package/stories/helpers/ContactsSelector.tsx +1 -1
  41. package/dist/src/util.d.ts +0 -2
  42. package/dist/src/util.d.ts.map +0 -1
  43. package/dist/src/util.js +0 -11
  44. package/dist/src/util.js.map +0 -1
  45. package/src/util.ts +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-client",
3
- "version": "2.15.7",
3
+ "version": "2.16.1",
4
4
  "description": "React client API",
5
5
  "keywords": [],
6
6
  "license": "AGPL-3.0",
@@ -16,17 +16,18 @@
16
16
  "test": "toolchain test"
17
17
  },
18
18
  "dependencies": {
19
- "@dxos/async": "2.15.7",
20
- "@dxos/client": "2.15.7",
21
- "@dxos/credentials": "2.15.7",
22
- "@dxos/crypto": "2.15.7",
23
- "@dxos/echo-db": "2.15.7",
24
- "@dxos/util": "2.15.7",
19
+ "@dxos/async": "2.16.1",
20
+ "@dxos/client": "2.16.1",
21
+ "@dxos/credentials": "2.16.1",
22
+ "@dxos/crypto": "2.16.1",
23
+ "@dxos/echo-db": "2.16.1",
24
+ "@dxos/util": "2.16.1",
25
25
  "@types/debug": "^4.1.1",
26
26
  "assert": "^2.0.0",
27
27
  "debug": "^4.1.1",
28
28
  "react-display-name": "^0.2.5",
29
- "use-subscription": "^1.4.1"
29
+ "use-subscription": "^1.4.1",
30
+ "@dxos/debug": "2.16.1"
30
31
  },
31
32
  "devDependencies": {
32
33
  "@babel/cli": "^7.0.0",
@@ -2,10 +2,10 @@ Invoking: toolchain build:test
2
2
 
3
3
 
4
4
  typescript
5
- OK in 7004 ms
5
+ OK in 5186 ms
6
6
 
7
7
  eslint
8
- OK in 6390 ms
8
+ OK in 4856 ms
9
9
 
10
10
  jest
11
11
  PASS tests/config.test.ts
@@ -16,8 +16,8 @@ PASS src/containers/ClientProvider.test.tsx
16
16
  Test Suites: 4 passed, 4 total
17
17
  Tests: 8 passed, 8 total
18
18
  Snapshots: 0 total
19
- Time: 4.111 s
19
+ Time: 3.327 s
20
20
  Ran all test suites.
21
- OK in 4779 ms
21
+ OK in 3906 ms
22
22
 
23
- CHECK COMPLETE in 18178 ms
23
+ CHECK COMPLETE in 13953 ms
@@ -8,7 +8,14 @@ import { Client, ClientConfig } from '@dxos/client';
8
8
  import { MaybePromise } from '@dxos/util';
9
9
 
10
10
  import { ErrorComponentProps, ErrorBoundary, ErrorCallbackType } from '../components';
11
- import ClientProvider from './ClientProvider';
11
+ import { ClientProvider } from './ClientProvider';
12
+
13
+ interface ClientLoaderProps {
14
+ children?: ReactNode
15
+ config?: ClientConfig | (() => MaybePromise<ClientConfig>)
16
+ onInit?: (client: Client) => void
17
+ loaderComponent?: React.ComponentType
18
+ }
12
19
 
13
20
  interface ClientLoaderProps {
14
21
  children?: ReactNode
@@ -68,7 +75,7 @@ interface ClientInitializerProps {
68
75
  * incorporating a top-level ErrorBoundary.
69
76
  */
70
77
  // TODO(burdon): Rename.
71
- const ClientInitializer = ({
78
+ export const ClientInitializer = ({
72
79
  children,
73
80
  config = {},
74
81
  onError,
@@ -114,5 +121,3 @@ const ClientInitializer = ({
114
121
  </ErrorBoundary>
115
122
  );
116
123
  };
117
-
118
- export default ClientInitializer;
@@ -9,7 +9,7 @@ import React from 'react';
9
9
  import { Client } from '@dxos/client';
10
10
 
11
11
  import { useClient } from '../hooks';
12
- import ClientProvider from './ClientProvider';
12
+ import { ClientProvider } from './ClientProvider';
13
13
 
14
14
  const TestComponent = () => {
15
15
  const client = useClient();
@@ -17,7 +17,7 @@ export interface ClientProviderProps {
17
17
  * Root component that provides the DXOS client instance to child components.
18
18
  * To be used with `useClient` hook.
19
19
  */
20
- const ClientProvider = ({ client, children }: ClientProviderProps) => {
20
+ export const ClientProvider = ({ client, children }: ClientProviderProps) => {
21
21
  useEffect(() => {
22
22
  (window as any).__DXOS__ = client.getDevtoolsContext();
23
23
  }, []);
@@ -28,5 +28,3 @@ const ClientProvider = ({ client, children }: ClientProviderProps) => {
28
28
  </ClientContext.Provider>
29
29
  );
30
30
  };
31
-
32
- export default ClientProvider;
@@ -11,7 +11,7 @@ import { useClient, useProfile } from '../hooks';
11
11
  * @deprecated
12
12
  */
13
13
  // TODO(burdon): Testing-only.
14
- const ProfileInitializer = ({ children }: { children: React.ReactNode }) => {
14
+ export const ProfileInitializer = ({ children }: { children: React.ReactNode }) => {
15
15
  const client = useClient();
16
16
  const profile = useProfile();
17
17
 
@@ -27,5 +27,3 @@ const ProfileInitializer = ({ children }: { children: React.ReactNode }) => {
27
27
 
28
28
  return <>{children}</>;
29
29
  };
30
-
31
- export default ProfileInitializer;
@@ -2,6 +2,6 @@
2
2
  // Copyright 2020 DXOS.org
3
3
  //
4
4
 
5
- export { default as ClientInitializer } from './ClientInitializer';
6
- export { default as ClientProvider } from './ClientProvider';
7
- export { default as ProfileInitializer } from './ProfileInitializer';
5
+ export * from './ClientInitializer';
6
+ export * from './ClientProvider';
7
+ export * from './ProfileInitializer';
@@ -4,7 +4,8 @@
4
4
 
5
5
  import { useContext } from 'react';
6
6
 
7
- import { raise } from '../../util';
7
+ import { raise } from '@dxos/debug';
8
+
8
9
  import { ClientContext } from './context';
9
10
 
10
11
  /**
@@ -4,7 +4,8 @@
4
4
 
5
5
  import { useContext } from 'react';
6
6
 
7
- import { raise } from '../../util';
7
+ import { raise } from '@dxos/debug';
8
+
8
9
  import { ClientContext } from './context';
9
10
 
10
11
  /**
@@ -24,7 +24,7 @@ export const ContactsSelector = ({ contacts, selected = '', onSelect }: {
24
24
  labelId='contact-select-label'
25
25
  onChange={(event: SelectChangeEvent) => onSelect(event.target.value)}
26
26
  >
27
- <MenuItem value=''>N/A</MenuItem>
27
+ <MenuItem value=''>-</MenuItem>
28
28
  {contacts.map(contact => (
29
29
  <MenuItem key={contact.publicKey.toHex()} value={contact.publicKey.toHex()}>
30
30
  {contact.displayName}
@@ -1,2 +0,0 @@
1
- export declare function raise(error: Error): never;
2
- //# sourceMappingURL=util.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAIA,wBAAgB,KAAK,CAAE,KAAK,EAAE,KAAK,GAAG,KAAK,CAE1C"}
package/dist/src/util.js DELETED
@@ -1,11 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2020 DXOS.org
4
- //
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.raise = void 0;
7
- function raise(error) {
8
- throw error;
9
- }
10
- exports.raise = raise;
11
- //# sourceMappingURL=util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,SAAgB,KAAK,CAAE,KAAY;IACjC,MAAM,KAAK,CAAC;AACd,CAAC;AAFD,sBAEC"}
package/src/util.ts DELETED
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2020 DXOS.org
3
- //
4
-
5
- export function raise (error: Error): never {
6
- throw error;
7
- }