jazz-react-native 0.10.5 → 0.10.7

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,4 +1,4 @@
1
1
 
2
- > jazz-react-native@0.10.5 build /home/runner/_work/jazz/jazz/packages/jazz-react-native
2
+ > jazz-react-native@0.10.7 build /home/runner/_work/jazz/jazz/packages/jazz-react-native
3
3
  > rm -rf ./dist && tsc --sourceMap --outDir dist
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # jazz-browser
2
2
 
3
+ ## 0.10.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 1136d9b: Fixed isAuthenticated out-of-sync with the account state during the logOut and authenticate flows
8
+ - Updated dependencies [0f83320]
9
+ - Updated dependencies [012022d]
10
+ - Updated dependencies [1136d9b]
11
+ - Updated dependencies [1e625f3]
12
+ - Updated dependencies [0eed228]
13
+ - cojson@0.10.7
14
+ - jazz-react-core@0.10.7
15
+ - jazz-tools@0.10.7
16
+ - cojson-storage-rn-sqlite@0.8.65
17
+ - cojson-transport-ws@0.10.7
18
+
19
+ ## 0.10.6
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies [1d71ca1]
24
+ - Updated dependencies [5c76e37]
25
+ - Updated dependencies [ada802b]
26
+ - jazz-react-core@0.10.6
27
+ - cojson@0.10.6
28
+ - jazz-tools@0.10.6
29
+ - cojson-storage-rn-sqlite@0.8.64
30
+ - cojson-transport-ws@0.10.6
31
+
3
32
  ## 0.10.5
4
33
 
5
34
  ### Patch Changes
package/README.md CHANGED
@@ -25,9 +25,10 @@ npx expo prebuild
25
25
  ### Install dependencies
26
26
 
27
27
  ```bash
28
- npx expo install expo-linking expo-secure-store expo-file-system @react-native-community/netinfo @bam.tech/react-native-image-resizer @azure/core-asynciterator-polyfill
28
+ npx expo install expo-linking expo-secure-store expo-file-system @react-native-community/netinfo @bam.tech/react-native-image-resizer
29
+
30
+ npm i -S @azure/core-asynciterator-polyfill react-native-url-polyfill readable-stream react-native-get-random-values @craftzdog/react-native-buffer @op-engineering/op-sqlite
29
31
 
30
- npm i -S react-native-polyfill-globals react-native-url-polyfill web-streams-polyfill base-64 text-encoding react-native-fetch-api react-native-get-random-values buffer
31
32
 
32
33
  npm i -D @babel/plugin-transform-class-static-block
33
34
 
@@ -35,6 +36,8 @@ npm i -S jazz-tools jazz-react-native jazz-react-native-media-images
35
36
 
36
37
  ```
37
38
 
39
+ > note: Hermes has added support for `atob` and `btoa` in React Native 0.74. If you are using earlier versions, you may also need to polyfill `atob` and `btoa` in your `package.json` . Packages to try include `text-encoding` and `base-64`, and you can drop `@bacons/text-decoder`.
40
+
38
41
  ### Fix Incompatible Dependencies
39
42
 
40
43
  ```bash
@@ -135,14 +138,19 @@ module.exports = function (api) {
135
138
  Create a file `polyfills.js` at the project root with the following content:
136
139
 
137
140
  ```js
138
- import "react-native-polyfill-globals/auto";
139
- import "@azure/core-asynciterator-polyfill";
140
- import { ReadableStream } from "web-streams-polyfill/ponyfill/es6";
141
- import { polyfillGlobal } from "react-native/Libraries/Utilities/PolyfillFunctions";
142
- import { Buffer } from "buffer";
143
-
144
- polyfillGlobal("Buffer", () => Buffer);
145
- polyfillGlobal("ReadableStream", () => ReadableStream);
141
+ import { polyfillGlobal } from 'react-native/Libraries/Utilities/PolyfillFunctions';
142
+
143
+ import { Buffer } from '@craftzdog/react-native-buffer';
144
+ polyfillGlobal('Buffer', () => Buffer);
145
+
146
+ import { ReadableStream } from 'readable-stream';
147
+ polyfillGlobal('ReadableStream', () => ReadableStream);
148
+
149
+ import '@azure/core-asynciterator-polyfill';
150
+
151
+ import '@bacons/text-decoder/install';
152
+
153
+ import 'react-native-get-random-values';
146
154
  ```
147
155
 
148
156
  Update `index.js` based on whether you are using expo-router or not:
@@ -26,7 +26,7 @@ export class ReactNativeContextManager extends JazzContextManager {
26
26
  CryptoProvider: props.CryptoProvider,
27
27
  });
28
28
  }
29
- this.updateContext(props, currentContext);
29
+ await this.updateContext(props, currentContext, authProps);
30
30
  }
31
31
  propsChanged(props) {
32
32
  if (!this.props) {
@@ -1 +1 @@
1
- {"version":3,"file":"ReactNativeContextManager.js","sourceRoot":"","sources":["../src/ReactNativeContextManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,GAGnB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAEL,4BAA4B,EAC5B,iCAAiC,GAClC,MAAM,eAAe,CAAC;AAavB,MAAM,OAAO,yBAEX,SAAQ,kBAAqD;IAC7D,KAAK,CAAC,aAAa,CACjB,KAAmC,EACnC,SAAuC;QAEvC,IAAI,cAAc,CAAC;QAEnB,uEAAuE;QACvE,yEAAyE;QACzE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;YACpB,cAAc,GAAG,MAAM,iCAAiC,CAAC;gBACvD,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;gBACzC,cAAc,EAAE,KAAK,CAAC,cAAc;aACrC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,cAAc,GAAG,MAAM,4BAA4B,CAAM;gBACvD,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,aAAa,EAAE,KAAK,CAAC,aAAa;gBAClC,WAAW,EAAE,SAAS,EAAE,WAAW;gBACnC,eAAe,EAAE,SAAS,EAAE,eAAe;gBAC3C,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;gBAC5C,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;gBACzC,cAAc,EAAE,KAAK,CAAC,cAAc;aACrC,CAAC,CAAC;QACL,CAAC;QAED,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;IAC5C,CAAC;IAED,YAAY,CAAC,KAAmC;QAC9C,IAA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Ae;gBAC3C,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;gBAC5C,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;gBACzC,cAAc,EAAE,KAAK,CAAC,cAAc;aACrC,CAAC,CAAC;QACL,CAAC;QAED,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC;IAC7D,CAAC;IAED,YAAY,CAAC,KAAmC;QAC9C,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,CACL,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI;YACxC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI;YACxC,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS,CACzC,CAAC;IACJ,CAAC;CACF"}
package/dist/provider.js CHANGED
@@ -1,4 +1,4 @@
1
- import { JazzAuthContext, JazzContext } from "jazz-react-core";
1
+ import { JazzContext, JazzContextManagerContext } from "jazz-react-core";
2
2
  import React, { useEffect, useRef } from "react";
3
3
  import { ReactNativeContextManager } from "./ReactNativeContextManager.js";
4
4
  import { setupKvStore } from "./platform.js";
@@ -37,9 +37,9 @@ export function JazzProvider({ children, guestMode, sync, storage, AccountSchema
37
37
  };
38
38
  }, []);
39
39
  return (<JazzContext.Provider value={value}>
40
- <JazzAuthContext.Provider value={contextManager.getAuthSecretStorage()}>
40
+ <JazzContextManagerContext.Provider value={contextManager}>
41
41
  {value && children}
42
- </JazzAuthContext.Provider>
42
+ </JazzContextManagerContext.Provider>
43
43
  </JazzContext.Provider>);
44
44
  }
45
45
  function useRefCallback(callback) {
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe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,EACD,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAc,CAAC,CACzC,EACD,GAAG,EAAE,CAAC,cAAc,CAAC,eAAe,EAAE,EACtC,GAAG,EAAE,CAAC,cAAc,CAAC,eAAe,EAAE,CACvC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,2EAA2E;QAC3E,0EAA0E;QAC1E,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa;YAAE,OAAO;QAEnD,OAAO,GAAG,EAAE;YACV,cAAc,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CACjC;MAAA,CAAC,yBAAyB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CACxD;QAAA,CAAC,KAAK,IAAI,QAAQ,CACpB;MAAA,EAAE,yBAAyB,CAAC,QAAQ,CACtC;IAAA,EAAE,WAAW,CAAC,QAAQ,CAAC,CACxB,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAoC,QAAY;IACrE,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC3C,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC;IAC/B,OAAO,MAAM,CACX,CAAC,GAAG,IAAmB,EAAiB,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,CAC1E,CAAC,OAAO,CAAC;AACZ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jazz-react-native",
3
- "version": "0.10.5",
3
+ "version": "0.10.7",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -26,12 +26,13 @@
26
26
  "license": "MIT",
27
27
  "dependencies": {
28
28
  "@scure/base": "1.2.1",
29
+ "react-native-nitro-modules": "0.21.0",
29
30
  "react-native-quick-crypto": "1.0.0-beta.12",
30
- "cojson": "0.10.4",
31
- "cojson-storage-rn-sqlite": "0.8.63",
32
- "cojson-transport-ws": "0.10.4",
33
- "jazz-react-core": "0.10.5",
34
- "jazz-tools": "0.10.5"
31
+ "cojson": "0.10.7",
32
+ "cojson-storage-rn-sqlite": "0.8.65",
33
+ "cojson-transport-ws": "0.10.7",
34
+ "jazz-react-core": "0.10.7",
35
+ "jazz-tools": "0.10.7"
35
36
  },
36
37
  "peerDependencies": {
37
38
  "@react-native-community/netinfo": "*",
@@ -56,7 +56,7 @@ export class ReactNativeContextManager<
56
56
  });
57
57
  }
58
58
 
59
- this.updateContext(props, currentContext);
59
+ await this.updateContext(props, currentContext, authProps);
60
60
  }
61
61
 
62
62
  propsChanged(props: JazzContextManagerProps<Acc>) {
package/src/provider.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import { JazzAuthContext, JazzContext } from "jazz-react-core";
1
+ import { JazzContext, JazzContextManagerContext } from "jazz-react-core";
2
2
  import { Account, JazzContextType, KvStore } from "jazz-tools";
3
3
  import React, { useEffect, useRef } from "react";
4
4
  import { JazzContextManagerProps } from "./ReactNativeContextManager.js";
@@ -80,9 +80,9 @@ export function JazzProvider<Acc extends Account = RegisteredAccount>({
80
80
 
81
81
  return (
82
82
  <JazzContext.Provider value={value}>
83
- <JazzAuthContext.Provider value={contextManager.getAuthSecretStorage()}>
83
+ <JazzContextManagerContext.Provider value={contextManager}>
84
84
  {value && children}
85
- </JazzAuthContext.Provider>
85
+ </JazzContextManagerContext.Provider>
86
86
  </JazzContext.Provider>
87
87
  );
88
88
  }