@isograph/react 0.0.0-main-3f26c9c8 → 0.0.0-main-84b67b62
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/IsographEnvironment.d.ts +9 -6
- package/dist/core/IsographEnvironment.d.ts.map +1 -1
- package/dist/core/IsographEnvironment.js +7 -1
- package/dist/core/cache.d.ts +2 -1
- package/dist/core/cache.d.ts.map +1 -1
- package/dist/core/cache.js +17 -27
- package/dist/core/check.d.ts.map +1 -1
- package/dist/core/check.js +10 -7
- package/dist/core/garbageCollection.d.ts +2 -1
- package/dist/core/garbageCollection.d.ts.map +1 -1
- package/dist/core/garbageCollection.js +21 -13
- package/dist/core/logging.d.ts +3 -2
- package/dist/core/logging.d.ts.map +1 -1
- package/dist/core/makeNetworkRequest.d.ts.map +1 -1
- package/dist/core/makeNetworkRequest.js +10 -1
- package/dist/core/optimisticProxy.d.ts +51 -0
- package/dist/core/optimisticProxy.d.ts.map +1 -0
- package/dist/core/optimisticProxy.js +372 -0
- package/dist/core/read.d.ts.map +1 -1
- package/dist/core/read.js +5 -4
- package/dist/core/startUpdate.d.ts +2 -1
- package/dist/core/startUpdate.d.ts.map +1 -1
- package/dist/core/startUpdate.js +31 -32
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/core/IsographEnvironment.ts +16 -6
- package/src/core/cache.ts +21 -14
- package/src/core/check.ts +11 -6
- package/src/core/garbageCollection.ts +27 -15
- package/src/core/logging.ts +2 -2
- package/src/core/makeNetworkRequest.ts +14 -1
- package/src/core/optimisticProxy.ts +510 -0
- package/src/core/read.ts +2 -1
- package/src/core/startUpdate.ts +44 -28
- package/src/index.ts +1 -1
- package/src/tests/garbageCollection.test.ts +2 -2
- package/src/tests/normalizeData.test.ts +5 -3
- package/src/tests/optimisticProxy.test.ts +860 -0
- package/src/tests/startUpdate.test.ts +7 -5
|
@@ -4,14 +4,14 @@ import type { ExtractUpdatableData } from '../core/FragmentReference';
|
|
|
4
4
|
import {
|
|
5
5
|
createIsographEnvironment,
|
|
6
6
|
ROOT_ID,
|
|
7
|
-
type
|
|
7
|
+
type BaseStoreLayerData,
|
|
8
8
|
} from '../core/IsographEnvironment';
|
|
9
9
|
import { createUpdatableProxy } from '../core/startUpdate';
|
|
10
10
|
import { iso } from './__isograph/iso';
|
|
11
11
|
import type { Query__linkedUpdate__param } from './__isograph/Query/linkedUpdate/param_type';
|
|
12
12
|
import type { Query__startUpdate__param } from './__isograph/Query/startUpdate/param_type';
|
|
13
13
|
|
|
14
|
-
const getDefaultStore = ():
|
|
14
|
+
const getDefaultStore = (): BaseStoreLayerData => ({
|
|
15
15
|
Query: {
|
|
16
16
|
[ROOT_ID]: {
|
|
17
17
|
node____id___0: {
|
|
@@ -88,6 +88,7 @@ describe('startUpdate', () => {
|
|
|
88
88
|
|
|
89
89
|
data = createUpdatableProxy(
|
|
90
90
|
environment,
|
|
91
|
+
environment.store,
|
|
91
92
|
item,
|
|
92
93
|
{
|
|
93
94
|
suspendIfInFlight: true,
|
|
@@ -100,7 +101,7 @@ describe('startUpdate', () => {
|
|
|
100
101
|
test('updates updatable scalar nested in updatable object', () => {
|
|
101
102
|
data.node!.asEconomist!.name = 'Updated Jeremy Bentham';
|
|
102
103
|
|
|
103
|
-
expect(environment.store).toMatchObject({
|
|
104
|
+
expect(environment.store.data).toMatchObject({
|
|
104
105
|
Economist: {
|
|
105
106
|
'0': {
|
|
106
107
|
name: 'Updated Jeremy Bentham',
|
|
@@ -126,7 +127,7 @@ describe('startUpdate', () => {
|
|
|
126
127
|
data.node = data.john_stuart_mill;
|
|
127
128
|
jeremy!.asEconomist!.name = 'Updated Jeremy Bentham';
|
|
128
129
|
|
|
129
|
-
expect(environment.store).toMatchObject({
|
|
130
|
+
expect(environment.store.data).toMatchObject({
|
|
130
131
|
Economist: {
|
|
131
132
|
'0': {
|
|
132
133
|
name: 'Updated Jeremy Bentham',
|
|
@@ -159,6 +160,7 @@ describe('startUpdate', () => {
|
|
|
159
160
|
|
|
160
161
|
data = createUpdatableProxy(
|
|
161
162
|
environment,
|
|
163
|
+
environment.store,
|
|
162
164
|
item,
|
|
163
165
|
{
|
|
164
166
|
suspendIfInFlight: true,
|
|
@@ -181,7 +183,7 @@ describe('startUpdate', () => {
|
|
|
181
183
|
test('updates scalar in cache', () => {
|
|
182
184
|
data.node!.asEconomist!.name = 'Foo';
|
|
183
185
|
|
|
184
|
-
expect(environment.store).toMatchObject({
|
|
186
|
+
expect(environment.store.data).toMatchObject({
|
|
185
187
|
Economist: {
|
|
186
188
|
0: {
|
|
187
189
|
name: 'Foo',
|