@isograph/react 0.0.0-main-4adb5045 → 0.0.0-main-82400fb8
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/.turbo/turbo-compile-libs.log +1 -1
- package/dist/core/FragmentReference.d.ts +1 -1
- package/dist/core/FragmentReference.d.ts.map +1 -1
- package/dist/core/FragmentReference.js +2 -2
- package/dist/core/IsographEnvironment.d.ts +7 -5
- package/dist/core/IsographEnvironment.d.ts.map +1 -1
- package/dist/core/IsographEnvironment.js +5 -4
- package/dist/core/cache.d.ts +5 -18
- package/dist/core/cache.d.ts.map +1 -1
- package/dist/core/cache.js +6 -218
- package/dist/core/componentCache.d.ts +2 -2
- package/dist/core/componentCache.d.ts.map +1 -1
- package/dist/core/componentCache.js +1 -26
- package/dist/core/entrypoint.d.ts +2 -2
- package/dist/core/entrypoint.d.ts.map +1 -1
- package/dist/core/garbageCollection.d.ts +2 -2
- package/dist/core/garbageCollection.d.ts.map +1 -1
- package/dist/core/getOrCreateCacheForArtifact.d.ts +8 -0
- package/dist/core/getOrCreateCacheForArtifact.d.ts.map +1 -0
- package/dist/core/getOrCreateCacheForArtifact.js +40 -0
- package/dist/core/logging.d.ts +8 -8
- package/dist/core/logging.d.ts.map +1 -1
- package/dist/core/makeNetworkRequest.d.ts +3 -3
- package/dist/core/makeNetworkRequest.d.ts.map +1 -1
- package/dist/core/makeNetworkRequest.js +3 -2
- package/dist/core/optimisticProxy.d.ts.map +1 -1
- package/dist/core/optimisticProxy.js +2 -1
- package/dist/core/read.d.ts +3 -3
- package/dist/core/read.d.ts.map +1 -1
- package/dist/core/startUpdate.d.ts.map +1 -1
- package/dist/core/startUpdate.js +2 -1
- package/dist/core/subscribe.d.ts +8 -0
- package/dist/core/subscribe.d.ts.map +1 -0
- package/dist/core/subscribe.js +127 -0
- package/dist/core/util.d.ts +7 -0
- package/dist/core/util.d.ts.map +1 -1
- package/dist/core/util.js +26 -0
- package/dist/core/writeData.d.ts +7 -0
- package/dist/core/writeData.d.ts.map +1 -0
- package/dist/core/writeData.js +36 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -5
- package/dist/loadable-hooks/useConnectionSpecPagination.d.ts +3 -3
- package/dist/loadable-hooks/useConnectionSpecPagination.d.ts.map +1 -1
- package/dist/loadable-hooks/useConnectionSpecPagination.js +2 -2
- package/dist/loadable-hooks/useSkipLimitPagination.d.ts +3 -3
- package/dist/loadable-hooks/useSkipLimitPagination.d.ts.map +1 -1
- package/dist/loadable-hooks/useSkipLimitPagination.js +2 -2
- package/dist/react/createIsographEnvironment.d.ts +4 -0
- package/dist/react/createIsographEnvironment.d.ts.map +1 -0
- package/dist/react/createIsographEnvironment.js +8 -0
- package/dist/react/maybeUnwrapNetworkRequest.d.ts +4 -0
- package/dist/react/maybeUnwrapNetworkRequest.d.ts.map +1 -0
- package/dist/react/maybeUnwrapNetworkRequest.js +14 -0
- package/dist/react/useLazyReference.d.ts.map +1 -1
- package/dist/react/useLazyReference.js +2 -2
- package/dist/react/useReadAndSubscribe.d.ts +4 -2
- package/dist/react/useReadAndSubscribe.d.ts.map +1 -1
- package/dist/react/useReadAndSubscribe.js +31 -2
- package/dist/react/useRerenderOnChange.d.ts +2 -2
- package/dist/react/useRerenderOnChange.d.ts.map +1 -1
- package/dist/react/useRerenderOnChange.js +2 -2
- package/dist/react/useResult.d.ts +2 -4
- package/dist/react/useResult.d.ts.map +1 -1
- package/dist/react/useResult.js +3 -13
- package/package.json +4 -4
- package/src/core/FragmentReference.ts +2 -2
- package/src/core/IsographEnvironment.ts +26 -10
- package/src/core/cache.ts +14 -360
- package/src/core/componentCache.ts +8 -43
- package/src/core/entrypoint.ts +2 -2
- package/src/core/garbageCollection.ts +5 -5
- package/src/core/getOrCreateCacheForArtifact.ts +86 -0
- package/src/core/logging.ts +10 -10
- package/src/core/makeNetworkRequest.ts +8 -8
- package/src/core/optimisticProxy.ts +2 -5
- package/src/core/read.ts +13 -13
- package/src/core/startUpdate.ts +1 -1
- package/src/core/subscribe.ts +195 -0
- package/src/core/util.ts +26 -0
- package/src/core/writeData.ts +79 -0
- package/src/index.ts +3 -4
- package/src/loadable-hooks/useConnectionSpecPagination.ts +5 -5
- package/src/loadable-hooks/useSkipLimitPagination.ts +5 -5
- package/src/react/createIsographEnvironment.ts +23 -0
- package/src/react/maybeUnwrapNetworkRequest.ts +17 -0
- package/src/react/useLazyReference.ts +2 -4
- package/src/react/useReadAndSubscribe.ts +53 -5
- package/src/react/useRerenderOnChange.ts +3 -3
- package/src/react/useResult.ts +6 -24
- package/src/tests/garbageCollection.test.ts +3 -6
- package/src/tests/meNameSuccessor.ts +1 -1
- package/src/tests/nodeQuery.ts +1 -1
- package/src/tests/normalizeData.test.ts +5 -3
- package/src/tests/optimisticProxy.test.ts +5 -3
- package/src/tests/startUpdate.test.ts +5 -7
- package/vitest.config.ts +5 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RetainedQuery } from '../core/garbageCollection';
|
|
2
2
|
import { ROOT_ID } from '../core/IsographEnvironment';
|
|
3
3
|
import { wrapResolvedValue } from '../core/PromiseWrapper';
|
|
4
|
-
import { iso } from '
|
|
4
|
+
import { iso } from '@iso';
|
|
5
5
|
|
|
6
6
|
export const meNameField = iso(`
|
|
7
7
|
field Query.meNameSuccessor {
|
package/src/tests/nodeQuery.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RetainedQuery } from '../core/garbageCollection';
|
|
2
2
|
import { ROOT_ID } from '../core/IsographEnvironment';
|
|
3
3
|
import { wrapResolvedValue } from '../core/PromiseWrapper';
|
|
4
|
-
import { iso } from '
|
|
4
|
+
import { iso } from '@iso';
|
|
5
5
|
|
|
6
6
|
// TODO investigate why this can't be in garbageCollection.test.ts without
|
|
7
7
|
// typescript incorrectly thinking it is referenced in its own initializer
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import { iso } from '@iso';
|
|
1
2
|
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
|
2
|
-
|
|
3
|
+
|
|
3
4
|
import {
|
|
4
|
-
createIsographEnvironment,
|
|
5
5
|
createIsographStore,
|
|
6
6
|
ROOT_ID,
|
|
7
7
|
type BaseStoreLayerData,
|
|
8
8
|
} from '../core/IsographEnvironment';
|
|
9
|
+
import { normalizeData } from '../core/cache';
|
|
10
|
+
import { getOrCreateCacheForArtifact } from '../core/getOrCreateCacheForArtifact';
|
|
9
11
|
import {
|
|
10
12
|
readButDoNotEvaluate,
|
|
11
13
|
type WithEncounteredRecords,
|
|
12
14
|
} from '../core/read';
|
|
13
|
-
import {
|
|
15
|
+
import { createIsographEnvironment } from '../react/createIsographEnvironment';
|
|
14
16
|
import type { Query__subquery__param } from './__isograph/Query/subquery/param_type';
|
|
15
17
|
|
|
16
18
|
let store: ReturnType<typeof createIsographStore>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { type EncounteredIds } from '../core/cache';
|
|
3
4
|
import {
|
|
4
|
-
createIsographEnvironment,
|
|
5
5
|
createIsographStore,
|
|
6
6
|
type IsographEnvironment,
|
|
7
7
|
type StoreLayerData,
|
|
@@ -15,8 +15,10 @@ import {
|
|
|
15
15
|
type OptimisticStoreLayer,
|
|
16
16
|
type StoreLayer,
|
|
17
17
|
} from '../core/optimisticProxy';
|
|
18
|
+
import { callSubscriptions } from '../core/subscribe';
|
|
19
|
+
import { createIsographEnvironment } from '../react/createIsographEnvironment';
|
|
18
20
|
|
|
19
|
-
vi.mock(import('../core/
|
|
21
|
+
vi.mock(import('../core/subscribe'), { spy: true });
|
|
20
22
|
|
|
21
23
|
const CHANGES = new Map([['Query', new Set(['__ROOT'])]]);
|
|
22
24
|
const NO_CHANGES = new Map();
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
+
import { iso } from '@iso';
|
|
1
2
|
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
|
2
|
-
|
|
3
|
+
|
|
3
4
|
import type { ExtractUpdatableData } from '../core/FragmentReference';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
ROOT_ID,
|
|
7
|
-
type BaseStoreLayerData,
|
|
8
|
-
} from '../core/IsographEnvironment';
|
|
5
|
+
import { getOrCreateCacheForArtifact } from '../core/getOrCreateCacheForArtifact';
|
|
6
|
+
import { ROOT_ID, type BaseStoreLayerData } from '../core/IsographEnvironment';
|
|
9
7
|
import { createUpdatableProxy } from '../core/startUpdate';
|
|
10
|
-
import {
|
|
8
|
+
import { createIsographEnvironment } from '../react/createIsographEnvironment';
|
|
11
9
|
import type { Query__linkedUpdate__param } from './__isograph/Query/linkedUpdate/param_type';
|
|
12
10
|
import type { Query__startUpdate__param } from './__isograph/Query/startUpdate/param_type';
|
|
13
11
|
|