@evolu/react-native 16.0.0 → 16.0.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.
@@ -1 +1 @@
1
- {"version":3,"file":"LockManager.d.ts","sourceRoot":"","sources":["../../src/LockManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAyQH;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,WAIzB,CAAC"}
1
+ {"version":3,"file":"LockManager.d.ts","sourceRoot":"","sources":["../../src/LockManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA2QH;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,WAIzB,CAAC"}
@@ -70,6 +70,7 @@ const createLockManagerPonyfill = ({ clientId = "in-memory-main-thread", } = {})
70
70
  }
71
71
  pendingRequest.signal?.removeEventListener("abort", pendingRequest.abort);
72
72
  pendingRequest.phase = "running";
73
+ // oxlint-disable-next-line unicorn/no-useless-promise-resolve-reject -- Normalizes generic T to Awaited<T> for the lock request contract.
73
74
  return Promise.resolve(pendingRequest.callback({ mode: pendingRequest.mode, name }));
74
75
  })
75
76
  .then((value) => {
@@ -144,6 +145,7 @@ const createLockManagerPonyfill = ({ clientId = "in-memory-main-thread", } = {})
144
145
  return Promise.reject(options.signal.reason);
145
146
  }
146
147
  if (options.ifAvailable && !canGrantImmediately(name, mode)) {
148
+ // oxlint-disable-next-line unicorn/no-useless-promise-resolve-reject -- Normalizes generic T to Awaited<T> for the lock request contract.
147
149
  return Promise.resolve().then(() => Promise.resolve(callback(null)));
148
150
  }
149
151
  return new Promise((resolve, reject) => {
@@ -1 +1 @@
1
- {"version":3,"file":"Polyfills.d.ts","sourceRoot":"","sources":["../../src/Polyfills.ts"],"names":[],"mappings":"AAmCA,qEAAqE;AACrE,eAAO,MAAM,gBAAgB,QAAO,IAKnC,CAAC"}
1
+ {"version":3,"file":"Polyfills.d.ts","sourceRoot":"","sources":["../../src/Polyfills.ts"],"names":[],"mappings":"AAkCA,qEAAqE;AACrE,eAAO,MAAM,gBAAgB,QAAO,IAKnC,CAAC"}
@@ -1,5 +1,4 @@
1
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
2
- /* eslint-disable @typescript-eslint/no-unsafe-call */
1
+ /* oxlint-disable typescript/no-unsafe-call, typescript/no-unsafe-member-access */
3
2
  import { installPolyfills as installCommonPolyfills } from "@evolu/common/polyfills";
4
3
  // @ts-expect-error Runtime polyfill package has no TypeScript declarations.
5
4
  import fromAsync from "array-from-async";
@@ -54,11 +53,13 @@ const installPromisePolyfills = () => {
54
53
  };
55
54
  const abortReasonBySignal = new WeakMap();
56
55
  const anyControllersBySignal = new WeakMap();
56
+ /* oxlint-disable evolu/no-unnecessary-global-this -- Patch the global object constructors even if realm lexical bindings shadow them. */
57
57
  const installAbortControllerPolyfills = () => {
58
58
  installAbortReasonPolyfill(globalThis.AbortController, globalThis.AbortSignal);
59
59
  installAbortSignalThrowIfAbortedPolyfill(globalThis.AbortSignal);
60
60
  installAbortSignalStaticMethods(globalThis.AbortController, globalThis.AbortSignal);
61
61
  };
62
+ /* oxlint-enable evolu/no-unnecessary-global-this */
62
63
  const installAbortReasonPolyfill = (abortController, abortSignal) => {
63
64
  if (!("reason" in abortSignal.prototype)) {
64
65
  Object.defineProperty(abortSignal.prototype, "reason", {
@@ -118,10 +119,12 @@ const installAbortSignalStaticMethods = (abortController, abortSignal) => {
118
119
  writable: true,
119
120
  value: (milliseconds) => {
120
121
  const controller = new abortController();
122
+ // oxlint-disable-next-line evolu/no-unnecessary-global-this -- Use the global object timer even if a realm lexical binding shadows it.
121
123
  const timeoutId = globalThis.setTimeout(() => {
122
124
  controller.abort(createTimeoutError(milliseconds));
123
125
  }, milliseconds);
124
126
  controller.signal.addEventListener("abort", () => {
127
+ // oxlint-disable-next-line evolu/no-unnecessary-global-this -- Clear the timer through the same global object API used to create it.
125
128
  globalThis.clearTimeout(timeoutId);
126
129
  }, { once: true });
127
130
  return controller.signal;
@@ -188,6 +191,7 @@ const createAnyControllersRegistry = (sourceSignal) => {
188
191
  sourceSignal.addEventListener("abort", onAbort, { once: true });
189
192
  return {
190
193
  add: (controller) => {
194
+ // oxlint-disable-next-line evolu/no-unnecessary-global-this -- Use the constructor on the global object even if a realm lexical binding shadows it.
191
195
  refs.push(new globalThis.WeakRef(controller));
192
196
  cleanup();
193
197
  },
@@ -211,6 +215,7 @@ const createAbortError = () => createNamedError("AbortError", "This operation wa
211
215
  const createNamedError = (name, message) => {
212
216
  if (typeof globalThis.DOMException === "function") {
213
217
  try {
218
+ // oxlint-disable-next-line evolu/no-unnecessary-global-this -- Construct the same global object DOMException verified by the feature check.
214
219
  return new globalThis.DOMException(message, name);
215
220
  }
216
221
  catch {
@@ -15,6 +15,7 @@ import { type DisposableRun, type RunCustomDeps } from "@evolu/common";
15
15
  *
16
16
  * ```ts
17
17
  * import {
18
+ * assertSame,
18
19
  * createConsole,
19
20
  * createConsoleFormatter,
20
21
  * ok,
@@ -30,7 +31,7 @@ import { type DisposableRun, type RunCustomDeps } from "@evolu/common";
30
31
  * await using run = createRun({ console });
31
32
  * const appPromise = run.ok(() => ok("started"));
32
33
  *
33
- * expect(await appPromise).toBe("started");
34
+ * assertSame(await appPromise, "started");
34
35
  * ```
35
36
  */
36
37
  export declare function createRun(): DisposableRun;
@@ -1 +1 @@
1
- {"version":3,"file":"Task.d.ts","sourceRoot":"","sources":["../../src/Task.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGL,KAAK,aAAa,EAElB,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,SAAS,IAAI,aAAa,CAAC;AAE3C,4EAA4E;AAC5E,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EACxC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,GACrB,aAAa,CAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"Task.d.ts","sourceRoot":"","sources":["../../src/Task.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGL,KAAK,aAAa,EAElB,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,SAAS,IAAI,aAAa,CAAC;AAE3C,4EAA4E;AAC5E,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EACxC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,GACrB,aAAa,CAAC,CAAC,CAAC,CAAC"}
package/dist/src/Task.js CHANGED
@@ -6,10 +6,13 @@
6
6
  import { createRun as createCommonRun, reportDefectAfterMicrotask, } from "@evolu/common";
7
7
  export function createRun(deps) {
8
8
  const reportDefect = (reported) => {
9
- if (globalThis.ErrorUtils)
9
+ if (globalThis.ErrorUtils) {
10
+ // oxlint-disable-next-line evolu/no-unnecessary-global-this -- Report through the React Native host API on the global object even if a realm lexical binding shadows it.
10
11
  globalThis.ErrorUtils.reportError(reported);
11
- else
12
+ }
13
+ else {
12
14
  reportDefectAfterMicrotask(reported);
15
+ }
13
16
  };
14
17
  return deps === undefined
15
18
  ? createCommonRun({ reportDefect })
@@ -5,10 +5,10 @@ import { View } from "react-native";
5
5
  import { SvgXml } from "react-native-svg";
6
6
  export const EvoluIdenticon = ({ id, size = 32, borderRadius = 3, style }) => {
7
7
  const svg = useMemo(() => createIdenticon(id, style), [id, style]);
8
- return id ? (_jsx(View, { style: {
8
+ return (_jsx(View, { style: {
9
9
  width: size,
10
10
  height: size,
11
11
  borderRadius,
12
12
  overflow: "hidden",
13
- }, children: _jsx(SvgXml, { xml: svg, width: size, height: size }) })) : null;
13
+ }, children: _jsx(SvgXml, { xml: svg, width: size, height: size }) }));
14
14
  };
@@ -1 +1 @@
1
- {"version":3,"file":"createExpoSqliteDriver.d.ts","sourceRoot":"","sources":["../../../src/sqlite-drivers/createExpoSqliteDriver.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,kBAAkB,EAExB,MAAM,eAAe,CAAC;AAOvB,eAAO,MAAM,sBAAsB,EAAE,kBA2ElC,CAAC"}
1
+ {"version":3,"file":"createExpoSqliteDriver.d.ts","sourceRoot":"","sources":["../../../src/sqlite-drivers/createExpoSqliteDriver.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,kBAAkB,EAExB,MAAM,eAAe,CAAC;AAQvB,eAAO,MAAM,sBAAsB,EAAE,kBA8ElC,CAAC"}
@@ -70,6 +70,7 @@ export const createExpoSqliteDriver = (name, options) => () => {
70
70
  return ok({
71
71
  exec: (query) => {
72
72
  const execStatement = (statement) => {
73
+ // Expo only reads the array, but its parameter type is mutable.
73
74
  const result = statement.executeSync(query.parameters);
74
75
  try {
75
76
  const rows = result.getAllSync();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evolu/react-native",
3
- "version": "16.0.0",
3
+ "version": "16.0.1",
4
4
  "description": "Evolu for React Native and Expo",
5
5
  "keywords": [
6
6
  "evolu",
@@ -53,6 +53,7 @@
53
53
  },
54
54
  "files": [
55
55
  "dist/src/**",
56
+ "!dist/**/*.test.*",
56
57
  "src/**",
57
58
  "README.md"
58
59
  ],
@@ -70,8 +71,12 @@
70
71
  "set.prototype.union": "^1.1.3"
71
72
  },
72
73
  "devDependencies": {
74
+ "@evolu/common": "8.8.0",
75
+ "@evolu/react": "11.0.2",
76
+ "@evolu/typescript-config": "0.1.1",
73
77
  "@expo/dom-webview": "57.0.1",
74
78
  "@react-native/metro-config": "0.86.2",
79
+ "@types/node": "^24.10.9",
75
80
  "@types/react": "^19.2.18",
76
81
  "@typescript/native": "npm:typescript@^7.0.2",
77
82
  "expo": "57.0.15",
@@ -82,10 +87,7 @@
82
87
  "react-native-reanimated": "4.5.1",
83
88
  "react-native-svg": "15.15.4",
84
89
  "react-native-worklets": "0.10.1",
85
- "typescript": "npm:@typescript/typescript6@^6.0.2",
86
- "@evolu/common": "8.3.3",
87
- "@evolu/react": "11.0.1",
88
- "@evolu/typescript-config": "0.0.2"
90
+ "typescript": "npm:@typescript/typescript6@^6.0.2"
89
91
  },
90
92
  "peerDependencies": {
91
93
  "@evolu/common": "^8.0.0",
@@ -115,7 +117,7 @@
115
117
  "access": "public"
116
118
  },
117
119
  "engines": {
118
- "node": ">=24.0.0"
120
+ "node": ">=24.20.0"
119
121
  },
120
122
  "sideEffects": false,
121
123
  "scripts": {
@@ -13,8 +13,9 @@ interface ErrorUtils {
13
13
  }
14
14
 
15
15
  declare global {
16
- // eslint-disable-next-line no-var
16
+ // var is required for a global declaration that matches the runtime binding.
17
17
  var ErrorUtils: ErrorUtils | undefined;
18
18
  }
19
19
 
20
+ // oxlint-disable-next-line unicorn/require-module-specifiers -- Marks this declaration file as a module so declare global is valid.
20
21
  export {};