@warp-drive/core 5.9.0-beta.1 → 5.9.0-beta.3
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/dist/-private-BL9zXgJB.js +3530 -0
- package/dist/-private-BL9zXgJB.js.map +1 -0
- package/dist/{-private-DMzvF_Q6.js → -private-Cxa8cMBj.js} +2 -2
- package/dist/-private-Cxa8cMBj.js.map +1 -0
- package/dist/{unpkg/dev-deprecated/-private-DL4tfrv9.js → -private-xK1KgxZJ.js} +2 -2
- package/dist/{-private-b1g4dhl0.js.map → -private-xK1KgxZJ.js.map} +1 -1
- package/{declarations/concepts-LHsLJZMl.d.ts → dist/concepts-DFldVwEM.d.ts} +2 -2
- package/{declarations/concepts-LHsLJZMl.d.ts.map → dist/concepts-DFldVwEM.d.ts.map} +1 -1
- package/dist/configure.js +1 -1
- package/dist/graph/-private.d.ts +2 -0
- package/dist/graph/-private.js +46 -33
- package/dist/graph/-private.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/{declarations/internal-Cz-893zD.d.ts → dist/internal-DtWOpxrR.d.ts} +2763 -2271
- package/dist/internal-DtWOpxrR.d.ts.map +1 -0
- package/dist/reactive/-private.d.ts +2 -0
- package/dist/reactive/-private.js +1 -1
- package/dist/reactive.d.ts +2 -0
- package/dist/reactive.js +3 -3
- package/{declarations → dist}/record-D3QQcaIR.d.ts.map +1 -1
- package/dist/{request--vRFALbQ.js → request-z2NByNx0.js} +2 -2
- package/dist/request-z2NByNx0.js.map +1 -0
- package/dist/request.d.ts +2 -0
- package/dist/request.js +1 -1
- package/dist/signals/-leaked.d.ts +1060 -0
- package/dist/signals/-leaked.d.ts.map +1 -0
- package/dist/signals/-leaked.js +2 -2
- package/dist/{src-Dex_phWI.js → src-s5HHjglV.js} +192 -53
- package/dist/src-s5HHjglV.js.map +1 -0
- package/dist/store/-private.d.ts +2 -0
- package/dist/store/-private.js +1 -1
- package/dist/store-DNF9Rgoh.js.map +1 -1
- package/dist/store.d.ts +2 -0
- package/{declarations → dist}/types/-private.d.ts +1 -1
- package/{declarations → dist}/types/-private.d.ts.map +1 -1
- package/dist/types/-private.js +1 -1
- package/dist/types/cache.d.ts +2 -0
- package/dist/types/record.js.map +1 -1
- package/dist/types/request.d.ts +2 -0
- package/dist/types/request.js +1 -1
- package/dist/types/request.js.map +1 -1
- package/dist/types/runtime.js +1 -1
- package/dist/types/schema/concepts.d.ts +2 -0
- package/dist/types/schema/fields.js.map +1 -1
- package/dist/types/schema/schema-service.d.ts +2 -0
- package/dist/types/symbols.js +1 -1
- package/dist/types/symbols.js.map +1 -1
- package/{declarations → dist}/types.d.ts +1 -1
- package/dist/{-private-b1g4dhl0.js → unpkg/dev/-private-BGCYELwo.js} +2 -2
- package/dist/unpkg/{dev-deprecated/-private-DL4tfrv9.js.map → dev/-private-BGCYELwo.js.map} +1 -1
- package/dist/unpkg/{dev-deprecated/-private-2RfQ2761.js → dev/-private-DhiS6yOR.js} +2 -2
- package/dist/unpkg/dev/-private-DhiS6yOR.js.map +1 -0
- package/dist/unpkg/dev/-private-pNQae3qH.js +3519 -0
- package/dist/unpkg/dev/-private-pNQae3qH.js.map +1 -0
- package/dist/unpkg/dev/configure.js +1 -1
- package/dist/unpkg/dev/graph/-private.js +46 -33
- package/dist/unpkg/dev/graph/-private.js.map +1 -1
- package/dist/unpkg/dev/index.js +1 -1
- package/dist/unpkg/dev/reactive/-private.js +1 -1
- package/dist/unpkg/dev/reactive.js +3 -3
- package/dist/unpkg/{dev-deprecated/request-DAuXbfYi.js → dev/request-BbbzRou7.js} +2 -2
- package/dist/unpkg/dev/request-BbbzRou7.js.map +1 -0
- package/dist/unpkg/dev/request.js +1 -1
- package/dist/unpkg/dev/{runtime-EoVKAhTv.js → runtime-DoDtzXJb.js} +2 -2
- package/dist/unpkg/dev/runtime-DoDtzXJb.js.map +1 -0
- package/dist/unpkg/dev/signals/-leaked.js +2 -2
- package/dist/unpkg/dev/{src-Bxlr_vue.js → src-Cf7NXXR2.js} +194 -55
- package/dist/unpkg/dev/src-Cf7NXXR2.js.map +1 -0
- package/dist/unpkg/dev/store/-private.js +1 -1
- package/dist/unpkg/{dev-deprecated/store-TcP2H4Af.js → dev/store-DamE3C4y.js} +2 -2
- package/dist/unpkg/dev/store-DamE3C4y.js.map +1 -0
- package/dist/unpkg/dev/store.js +1 -1
- package/dist/unpkg/dev/types/-private.js +1 -1
- package/dist/unpkg/dev/types/record.js.map +1 -1
- package/dist/unpkg/dev/types/request.js +1 -1
- package/dist/unpkg/dev/types/request.js.map +1 -1
- package/dist/unpkg/dev/types/runtime.js +1 -1
- package/dist/unpkg/dev/types/schema/fields.js.map +1 -1
- package/dist/unpkg/dev/types/symbols.js +1 -1
- package/dist/unpkg/dev/types/symbols.js.map +1 -1
- package/dist/unpkg/{dev/-private-DL4tfrv9.js → dev-deprecated/-private-BGCYELwo.js} +2 -2
- package/dist/unpkg/{prod/-private-Z9i0icpE.js.map → dev-deprecated/-private-BGCYELwo.js.map} +1 -1
- package/dist/unpkg/{dev/-private-2RfQ2761.js → dev-deprecated/-private-DhiS6yOR.js} +2 -2
- package/dist/unpkg/dev-deprecated/-private-DhiS6yOR.js.map +1 -0
- package/dist/unpkg/dev-deprecated/-private-pNQae3qH.js +3519 -0
- package/dist/unpkg/dev-deprecated/-private-pNQae3qH.js.map +1 -0
- package/dist/unpkg/dev-deprecated/configure.js +1 -1
- package/dist/unpkg/dev-deprecated/graph/-private.js +47 -34
- package/dist/unpkg/dev-deprecated/graph/-private.js.map +1 -1
- package/dist/unpkg/dev-deprecated/index.js +1 -1
- package/dist/unpkg/dev-deprecated/reactive/-private.js +1 -1
- package/dist/unpkg/dev-deprecated/reactive.js +3 -3
- package/dist/unpkg/{dev/request-DAuXbfYi.js → dev-deprecated/request-BbbzRou7.js} +2 -2
- package/dist/unpkg/dev-deprecated/request-BbbzRou7.js.map +1 -0
- package/dist/unpkg/dev-deprecated/request.js +1 -1
- package/dist/unpkg/dev-deprecated/{runtime-BacZMq1r.js → runtime-CPL2BGgT.js} +2 -2
- package/dist/unpkg/dev-deprecated/runtime-CPL2BGgT.js.map +1 -0
- package/dist/unpkg/dev-deprecated/signals/-leaked.js +2 -2
- package/dist/unpkg/dev-deprecated/{src-DEl2Ca3T.js → src-CSuFUXv4.js} +195 -56
- package/dist/unpkg/dev-deprecated/src-CSuFUXv4.js.map +1 -0
- package/dist/unpkg/dev-deprecated/store/-private.js +1 -1
- package/dist/unpkg/{dev/store-DmiFvT1B.js → dev-deprecated/store-Bsdz5mRe.js} +2 -2
- package/dist/unpkg/dev-deprecated/store-Bsdz5mRe.js.map +1 -0
- package/dist/unpkg/dev-deprecated/store.js +1 -1
- package/dist/unpkg/dev-deprecated/types/-private.js +1 -1
- package/dist/unpkg/dev-deprecated/types/record.js.map +1 -1
- package/dist/unpkg/dev-deprecated/types/request.js +1 -1
- package/dist/unpkg/dev-deprecated/types/request.js.map +1 -1
- package/dist/unpkg/dev-deprecated/types/runtime.js +1 -1
- package/dist/unpkg/dev-deprecated/types/schema/fields.js.map +1 -1
- package/dist/unpkg/dev-deprecated/types/symbols.js +1 -1
- package/dist/unpkg/dev-deprecated/types/symbols.js.map +1 -1
- package/dist/unpkg/prod/-private-8gd8hbwm.js +22 -0
- package/dist/unpkg/{prod-deprecated/-private-Z9i0icpE.js.map → prod/-private-8gd8hbwm.js.map} +1 -1
- package/dist/unpkg/prod/{-private-BK71-uXR.js → -private-B6aLbrgV.js} +2 -2
- package/dist/unpkg/prod/-private-B6aLbrgV.js.map +1 -0
- package/dist/unpkg/prod/-private-ggVX_Iob.js +3294 -0
- package/dist/unpkg/prod/-private-ggVX_Iob.js.map +1 -0
- package/dist/unpkg/prod/configure.js +1 -1
- package/dist/unpkg/prod/graph/-private.js +45 -32
- package/dist/unpkg/prod/graph/-private.js.map +1 -1
- package/dist/unpkg/prod/index.js +1 -1
- package/dist/unpkg/prod/reactive/-private.js +1 -1
- package/dist/unpkg/prod/reactive.js +3 -3
- package/dist/unpkg/prod/{request-BcJNzSgv.js → request-BoeppjDj.js} +2 -2
- package/dist/unpkg/prod/request-BoeppjDj.js.map +1 -0
- package/dist/unpkg/prod/request.js +1 -1
- package/dist/unpkg/prod/signals/-leaked.js +2 -2
- package/dist/unpkg/prod/{src-Dzz-j6pp.js → src-C0wuASrN.js} +196 -53
- package/dist/unpkg/prod/src-C0wuASrN.js.map +1 -0
- package/dist/unpkg/prod/store/-private.js +1 -1
- package/dist/unpkg/prod/store-BWhmb7Ob.js.map +1 -1
- package/dist/unpkg/prod/types/-private.js +1 -1
- package/dist/unpkg/prod/types/record.js.map +1 -1
- package/dist/unpkg/prod/types/request.js +1 -1
- package/dist/unpkg/prod/types/request.js.map +1 -1
- package/dist/unpkg/prod/types/runtime.js +1 -1
- package/dist/unpkg/prod/types/schema/fields.js.map +1 -1
- package/dist/unpkg/prod/types/symbols.js +1 -1
- package/dist/unpkg/prod/types/symbols.js.map +1 -1
- package/dist/unpkg/prod-deprecated/{-private-Z9i0icpE.js → -private-8gd8hbwm.js} +2 -2
- package/dist/unpkg/{dev/-private-DL4tfrv9.js.map → prod-deprecated/-private-8gd8hbwm.js.map} +1 -1
- package/dist/unpkg/prod-deprecated/{-private-BK71-uXR.js → -private-B6aLbrgV.js} +2 -2
- package/dist/unpkg/prod-deprecated/-private-B6aLbrgV.js.map +1 -0
- package/dist/unpkg/prod-deprecated/-private-ggVX_Iob.js +3294 -0
- package/dist/unpkg/prod-deprecated/-private-ggVX_Iob.js.map +1 -0
- package/dist/unpkg/prod-deprecated/configure.js +1 -1
- package/dist/unpkg/prod-deprecated/graph/-private.js +46 -35
- package/dist/unpkg/prod-deprecated/graph/-private.js.map +1 -1
- package/dist/unpkg/prod-deprecated/index.js +1 -1
- package/dist/unpkg/prod-deprecated/reactive/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/reactive.js +3 -3
- package/dist/unpkg/prod-deprecated/{request-BcJNzSgv.js → request-BoeppjDj.js} +2 -2
- package/dist/unpkg/prod-deprecated/request-BoeppjDj.js.map +1 -0
- package/dist/unpkg/prod-deprecated/request.js +1 -1
- package/dist/unpkg/prod-deprecated/signals/-leaked.js +2 -2
- package/dist/unpkg/prod-deprecated/{src-BOifHFQ5.js → src-BXOgNqmz.js} +197 -54
- package/dist/unpkg/prod-deprecated/src-BXOgNqmz.js.map +1 -0
- package/dist/unpkg/prod-deprecated/store/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/store-BWhmb7Ob.js.map +1 -1
- package/dist/unpkg/prod-deprecated/types/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/types/record.js.map +1 -1
- package/dist/unpkg/prod-deprecated/types/request.js +1 -1
- package/dist/unpkg/prod-deprecated/types/request.js.map +1 -1
- package/dist/unpkg/prod-deprecated/types/runtime.js +1 -1
- package/dist/unpkg/prod-deprecated/types/schema/fields.js.map +1 -1
- package/dist/unpkg/prod-deprecated/types/symbols.js +1 -1
- package/dist/unpkg/prod-deprecated/types/symbols.js.map +1 -1
- package/package.json +15 -19
- package/declarations/graph/-private.d.ts +0 -2
- package/declarations/index.d.ts +0 -2
- package/declarations/internal-Cz-893zD.d.ts.map +0 -1
- package/declarations/reactive/-private.d.ts +0 -2
- package/declarations/reactive.d.ts +0 -2
- package/declarations/request.d.ts +0 -2
- package/declarations/signals/-leaked.d.ts +0 -63
- package/declarations/signals/-leaked.d.ts.map +0 -1
- package/declarations/store/-private.d.ts +0 -2
- package/declarations/store.d.ts +0 -8358
- package/declarations/store.d.ts.map +0 -1
- package/declarations/types/cache.d.ts +0 -2
- package/declarations/types/request.d.ts +0 -2
- package/declarations/types/schema/concepts.d.ts +0 -2
- package/declarations/types/schema/schema-service.d.ts +0 -2
- package/dist/-private-DMzvF_Q6.js.map +0 -1
- package/dist/-private-HjaQ1wp1.js +0 -1695
- package/dist/-private-HjaQ1wp1.js.map +0 -1
- package/dist/request--vRFALbQ.js.map +0 -1
- package/dist/src-Dex_phWI.js.map +0 -1
- package/dist/unpkg/dev/-private-2RfQ2761.js.map +0 -1
- package/dist/unpkg/dev/-private-CM1zxNws.js +0 -1684
- package/dist/unpkg/dev/-private-CM1zxNws.js.map +0 -1
- package/dist/unpkg/dev/request-DAuXbfYi.js.map +0 -1
- package/dist/unpkg/dev/runtime-EoVKAhTv.js.map +0 -1
- package/dist/unpkg/dev/src-Bxlr_vue.js.map +0 -1
- package/dist/unpkg/dev/store-DmiFvT1B.js.map +0 -1
- package/dist/unpkg/dev-deprecated/-private-2RfQ2761.js.map +0 -1
- package/dist/unpkg/dev-deprecated/-private-CM1zxNws.js +0 -1684
- package/dist/unpkg/dev-deprecated/-private-CM1zxNws.js.map +0 -1
- package/dist/unpkg/dev-deprecated/request-DAuXbfYi.js.map +0 -1
- package/dist/unpkg/dev-deprecated/runtime-BacZMq1r.js.map +0 -1
- package/dist/unpkg/dev-deprecated/src-DEl2Ca3T.js.map +0 -1
- package/dist/unpkg/dev-deprecated/store-TcP2H4Af.js.map +0 -1
- package/dist/unpkg/prod/-private-BK71-uXR.js.map +0 -1
- package/dist/unpkg/prod/-private-TNaS5Piv.js +0 -1494
- package/dist/unpkg/prod/-private-TNaS5Piv.js.map +0 -1
- package/dist/unpkg/prod/-private-Z9i0icpE.js +0 -22
- package/dist/unpkg/prod/request-BcJNzSgv.js.map +0 -1
- package/dist/unpkg/prod/src-Dzz-j6pp.js.map +0 -1
- package/dist/unpkg/prod-deprecated/-private-BK71-uXR.js.map +0 -1
- package/dist/unpkg/prod-deprecated/-private-TNaS5Piv.js +0 -1494
- package/dist/unpkg/prod-deprecated/-private-TNaS5Piv.js.map +0 -1
- package/dist/unpkg/prod-deprecated/request-BcJNzSgv.js.map +0 -1
- package/dist/unpkg/prod-deprecated/src-BOifHFQ5.js.map +0 -1
- /package/{declarations → dist}/aliases-BWYW5EhX.d.ts +0 -0
- /package/{declarations → dist}/aliases-BWYW5EhX.d.ts.map +0 -0
- /package/{declarations → dist}/build-config/babel-macros.d.ts +0 -0
- /package/{declarations → dist}/build-config/canary-features.d.ts +0 -0
- /package/{declarations → dist}/build-config/debugging.d.ts +0 -0
- /package/{declarations → dist}/build-config/deprecations.d.ts +0 -0
- /package/{declarations → dist}/build-config/env.d.ts +0 -0
- /package/{declarations → dist}/build-config/macros.d.ts +0 -0
- /package/{declarations → dist}/build-config.d.ts +0 -0
- /package/{declarations → dist}/change-C7kqv2kW.d.ts +0 -0
- /package/{declarations → dist}/change-C7kqv2kW.d.ts.map +0 -0
- /package/{declarations → dist}/configure-B_F639tN.d.ts +0 -0
- /package/{declarations → dist}/configure-B_F639tN.d.ts.map +0 -0
- /package/{declarations → dist}/configure.d.ts +0 -0
- /package/{declarations → dist}/document-BEn91SwT.d.ts +0 -0
- /package/{declarations → dist}/document-BEn91SwT.d.ts.map +0 -0
- /package/{declarations → dist}/error-50OSEhsF.d.ts +0 -0
- /package/{declarations → dist}/error-50OSEhsF.d.ts.map +0 -0
- /package/{declarations → dist}/fields-FM7peCiM.d.ts +0 -0
- /package/{declarations → dist}/fields-FM7peCiM.d.ts.map +0 -0
- /package/{declarations → dist}/graph-DLqYXP2z.d.ts +0 -0
- /package/{declarations → dist}/graph-DLqYXP2z.d.ts.map +0 -0
- /package/{declarations → dist}/identifier-DQnqOSJK.d.ts +0 -0
- /package/{declarations → dist}/identifier-DQnqOSJK.d.ts.map +0 -0
- /package/{declarations → dist}/json-api-raw-C5APJHHB.d.ts +0 -0
- /package/{declarations → dist}/json-api-raw-C5APJHHB.d.ts.map +0 -0
- /package/{declarations → dist}/mutations-CqtoGB4t.d.ts +0 -0
- /package/{declarations → dist}/mutations-CqtoGB4t.d.ts.map +0 -0
- /package/{declarations → dist}/operations-D1qA6r0_.d.ts +0 -0
- /package/{declarations → dist}/operations-D1qA6r0_.d.ts.map +0 -0
- /package/{declarations → dist}/params-DrEx3bf8.d.ts +0 -0
- /package/{declarations → dist}/params-DrEx3bf8.d.ts.map +0 -0
- /package/{declarations → dist}/raw-D5hnjiq7.d.ts +0 -0
- /package/{declarations → dist}/raw-D5hnjiq7.d.ts.map +0 -0
- /package/{declarations → dist}/record-D3QQcaIR.d.ts +0 -0
- /package/{declarations → dist}/relationship-CmHzMPKf.d.ts +0 -0
- /package/{declarations → dist}/relationship-CmHzMPKf.d.ts.map +0 -0
- /package/{declarations → dist}/symbols-DjRDCeX0.d.ts +0 -0
- /package/{declarations → dist}/symbols-DjRDCeX0.d.ts.map +0 -0
- /package/{declarations → dist}/types/cache/aliases.d.ts +0 -0
- /package/{declarations → dist}/types/cache/change.d.ts +0 -0
- /package/{declarations → dist}/types/cache/mutations.d.ts +0 -0
- /package/{declarations → dist}/types/cache/operations.d.ts +0 -0
- /package/{declarations → dist}/types/cache/relationship.d.ts +0 -0
- /package/{declarations → dist}/types/graph.d.ts +0 -0
- /package/{declarations → dist}/types/identifier.d.ts +0 -0
- /package/{declarations → dist}/types/json/raw.d.ts +0 -0
- /package/{declarations → dist}/types/params.d.ts +0 -0
- /package/{declarations → dist}/types/record.d.ts +0 -0
- /package/{declarations → dist}/types/runtime.d.ts +0 -0
- /package/{declarations → dist}/types/runtime.d.ts.map +0 -0
- /package/{declarations → dist}/types/schema/fields.d.ts +0 -0
- /package/{declarations → dist}/types/schema/fields.type-test.d.ts +0 -0
- /package/{declarations → dist}/types/spec/document.d.ts +0 -0
- /package/{declarations → dist}/types/spec/error.d.ts +0 -0
- /package/{declarations → dist}/types/spec/json-api-raw.d.ts +0 -0
- /package/{declarations → dist}/types/symbols.d.ts +0 -0
- /package/{declarations → dist}/types/utils.d.ts +0 -0
- /package/{declarations → dist}/utils/string.d.ts +0 -0
- /package/{declarations → dist}/utils/string.d.ts.map +0 -0
- /package/{declarations → dist}/utils-BtURiy8l.d.ts +0 -0
- /package/{declarations → dist}/utils-BtURiy8l.d.ts.map +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as setTransient, r as peekTransient, t as getOrSetGlobal } from "../-private-
|
|
2
|
-
import { t as getGlobalConfig } from "../runtime-
|
|
1
|
+
import { a as setTransient, r as peekTransient, t as getOrSetGlobal } from "../-private-DhiS6yOR.js";
|
|
2
|
+
import { t as getGlobalConfig } from "../runtime-CPL2BGgT.js";
|
|
3
3
|
|
|
4
4
|
//#region src/graph/-private/coerce-id.ts
|
|
5
5
|
function coerceId(id) {
|
|
@@ -138,7 +138,7 @@ function removeIdentifierCompletelyFromRelationship(graph, relationship, value,
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
/** Notifies the store that a relationship has changed, provided the relationship has been accessed and is not currently being removed. */
|
|
141
|
-
function notifyChange(graph, relationship) {
|
|
141
|
+
function notifyChange(graph, relationship, channel) {
|
|
142
142
|
if (!relationship.accessed) return;
|
|
143
143
|
const resourceKey = relationship.identifier;
|
|
144
144
|
const key = relationship.definition.key;
|
|
@@ -147,7 +147,7 @@ function notifyChange(graph, relationship) {
|
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
149
|
if (getGlobalConfig().WarpDrive.debug.LOG_GRAPH || globalThis.getWarpDriveRuntimeConfig().debug.LOG_GRAPH) console.log(`Graph: notifying relationship change for ${String(resourceKey)} ${key}`);
|
|
150
|
-
graph.store.notifyChange(resourceKey, "relationships", key);
|
|
150
|
+
graph.store.notifyChange(resourceKey, "relationships", key, channel);
|
|
151
151
|
}
|
|
152
152
|
/**
|
|
153
153
|
* Asserts (dev-only) that a pushed relationship data payload conforms to the JSON:API resource
|
|
@@ -685,7 +685,7 @@ function replaceRelatedRecordsLocal(graph, op, isRemote) {
|
|
|
685
685
|
relationship.additions = diff.add;
|
|
686
686
|
relationship.removals = diff.del;
|
|
687
687
|
relationship.localState = diff.finalState;
|
|
688
|
-
if (becameDirty && !wasDirty) notifyChange(graph, relationship);
|
|
688
|
+
if (becameDirty && !wasDirty) notifyChange(graph, relationship, "local");
|
|
689
689
|
}
|
|
690
690
|
function replaceRelatedRecordsRemote(graph, op, isRemote) {
|
|
691
691
|
const resourceKeys = op.value;
|
|
@@ -750,7 +750,8 @@ function replaceRelatedRecordsRemote(graph, op, isRemote) {
|
|
|
750
750
|
}
|
|
751
751
|
if (deprecationInfo.triggered) console.warn(`WarpDrive is changing the default semantics of updates to the remote state of relationships.\n\nThe following local state was cleared from the <${relationship.identifier.type}>.${relationship.definition.key} hasMany relationship but will not be once this deprecation is resolved by opting into the new behavior:\n\n\tAdded: [${deprecationInfo.additions.map((i) => i.lid).join(", ")}]\n\tRemoved: [${deprecationInfo.removals.map((i) => i.lid).join(", ")}]`);
|
|
752
752
|
}
|
|
753
|
-
if (
|
|
753
|
+
if (diff.remoteOrderChanged) flushCanonical(graph, relationship, "remote");
|
|
754
|
+
if (diff.changed) flushCanonical(graph, relationship, "local");
|
|
754
755
|
}
|
|
755
756
|
function addToInverse(graph, resourceKey, key, value, isRemote) {
|
|
756
757
|
const relationship = graph.get(resourceKey, key);
|
|
@@ -766,11 +767,12 @@ function addToInverse(graph, resourceKey, key, value, isRemote) {
|
|
|
766
767
|
graph._addToTransaction(relationship);
|
|
767
768
|
if (relationship.remoteState !== null) removeFromInverse(graph, relationship.remoteState, relationship.definition.inverseKey, resourceKey, isRemote);
|
|
768
769
|
relationship.remoteState = value;
|
|
770
|
+
notifyChange(graph, relationship);
|
|
769
771
|
}
|
|
770
772
|
if (relationship.localState !== value) {
|
|
771
773
|
if (!isRemote && relationship.localState) removeFromInverse(graph, relationship.localState, relationship.definition.inverseKey, resourceKey, isRemote);
|
|
772
774
|
relationship.localState = value;
|
|
773
|
-
notifyChange(graph, relationship);
|
|
775
|
+
if (!isRemote) notifyChange(graph, relationship, "local");
|
|
774
776
|
}
|
|
775
777
|
} else if (isHasMany(relationship)) {
|
|
776
778
|
if (isRemote) {
|
|
@@ -787,7 +789,7 @@ function addToInverse(graph, resourceKey, key, value, isRemote) {
|
|
|
787
789
|
}
|
|
788
790
|
} else {
|
|
789
791
|
if (!relationship.isDirty && !relationship.localState) relationship.localState = [];
|
|
790
|
-
if (_add(graph, resourceKey, relationship, value, null, isRemote)) notifyChange(graph, relationship);
|
|
792
|
+
if (_add(graph, resourceKey, relationship, value, null, isRemote)) notifyChange(graph, relationship, "local");
|
|
791
793
|
}
|
|
792
794
|
} else if (isRemote) {
|
|
793
795
|
if (!relationship.remoteMembers.has(value)) {
|
|
@@ -807,23 +809,24 @@ function removeFromInverse(graph, resourceKey, key, value, isRemote) {
|
|
|
807
809
|
if (isRemote) {
|
|
808
810
|
graph._addToTransaction(relationship);
|
|
809
811
|
relationship.remoteState = null;
|
|
812
|
+
notifyChange(graph, relationship);
|
|
810
813
|
}
|
|
811
814
|
if (relationship.localState === value) {
|
|
812
815
|
relationship.localState = null;
|
|
813
|
-
notifyChange(graph, relationship);
|
|
816
|
+
if (!isRemote) notifyChange(graph, relationship, "local");
|
|
814
817
|
}
|
|
815
818
|
} else if (isHasMany(relationship)) {
|
|
816
819
|
if (isRemote) {
|
|
817
820
|
graph._addToTransaction(relationship);
|
|
818
821
|
if (_removeRemote(relationship, value)) notifyChange(graph, relationship);
|
|
819
|
-
} else if (_removeLocal(relationship, value)) notifyChange(graph, relationship);
|
|
822
|
+
} else if (_removeLocal(relationship, value)) notifyChange(graph, relationship, "local");
|
|
820
823
|
} else if (isRemote) {
|
|
821
824
|
relationship.remoteMembers.delete(value);
|
|
822
825
|
relationship.localMembers.delete(value);
|
|
823
826
|
} else if (value && relationship.localMembers.has(value)) relationship.localMembers.delete(value);
|
|
824
827
|
}
|
|
825
|
-
function flushCanonical(graph, rel) {
|
|
826
|
-
if (rel.accessed) graph._scheduleLocalSync(rel);
|
|
828
|
+
function flushCanonical(graph, rel, channel) {
|
|
829
|
+
if (rel.accessed) graph._scheduleLocalSync(rel, channel);
|
|
827
830
|
}
|
|
828
831
|
|
|
829
832
|
//#endregion
|
|
@@ -847,7 +850,7 @@ function replaceRelatedRecord(graph, op, isRemote = false) {
|
|
|
847
850
|
else if (localState !== op.value && relationship.definition.resetOnRemoteUpdate !== false) {
|
|
848
851
|
relationship.localState = existingState;
|
|
849
852
|
console.warn(`WarpDrive is changing the default semantics of updates to the remote state of relationships.\n\nThe following local state was cleared from the <${relationship.identifier.type}>.${relationship.definition.key} belongsTo relationship but will not be once this deprecation is resolved:\n\n\t${localState ? "Added: " + localState.lid + "\n " : ""}${existingState ? "Removed: " + existingState.lid : ""}`);
|
|
850
|
-
notifyChange(graph, relationship);
|
|
853
|
+
notifyChange(graph, relationship, "local");
|
|
851
854
|
}
|
|
852
855
|
}
|
|
853
856
|
return;
|
|
@@ -873,17 +876,15 @@ function replaceRelatedRecord(graph, op, isRemote = false) {
|
|
|
873
876
|
addToInverse(graph, op.value, definition.inverseKey, op.record, isRemote);
|
|
874
877
|
}
|
|
875
878
|
if (isRemote) {
|
|
879
|
+
notifyChange(graph, relationship);
|
|
876
880
|
const { localState, remoteState } = relationship;
|
|
877
881
|
if (localState && checkIfNew(graph._realStore, localState) && !remoteState) return;
|
|
878
|
-
if (localState !== remoteState && localState === existingState)
|
|
879
|
-
|
|
880
|
-
notifyChange(graph, relationship);
|
|
881
|
-
} else if (localState !== remoteState && localState !== existingState && relationship.definition.resetOnRemoteUpdate !== false) {
|
|
882
|
+
if (localState !== remoteState && localState === existingState) relationship.localState = remoteState;
|
|
883
|
+
else if (localState !== remoteState && localState !== existingState && relationship.definition.resetOnRemoteUpdate !== false) {
|
|
882
884
|
relationship.localState = remoteState;
|
|
883
885
|
console.warn(`WarpDrive is changing the default semantics of updates to the remote state of relationships.\n\nThe following local state was cleared from the <${relationship.identifier.type}>.${relationship.definition.key} belongsTo relationship but will not be once this deprecation is resolved:\n\n\t${localState ? "Added: " + localState.lid + "\n " : ""}${existingState ? "Removed: " + existingState.lid : ""}`);
|
|
884
|
-
notifyChange(graph, relationship);
|
|
885
886
|
}
|
|
886
|
-
} else notifyChange(graph, relationship);
|
|
887
|
+
} else notifyChange(graph, relationship, "local");
|
|
887
888
|
}
|
|
888
889
|
|
|
889
890
|
//#endregion
|
|
@@ -1380,7 +1381,7 @@ function addToRelatedRecords(graph, op, isRemote) {
|
|
|
1380
1381
|
if (!relationship.isDirty && !relationship.localState) relationship.localState = [];
|
|
1381
1382
|
if (Array.isArray(value)) for (let i = 0; i < value.length; i++) addRelatedRecord(graph, relationship, record, value[i], index !== void 0 ? index + i : null, isRemote);
|
|
1382
1383
|
else addRelatedRecord(graph, relationship, record, value, index ?? null, isRemote);
|
|
1383
|
-
notifyChange(graph, relationship);
|
|
1384
|
+
notifyChange(graph, relationship, isRemote ? void 0 : "local");
|
|
1384
1385
|
}
|
|
1385
1386
|
function addRelatedRecord(graph, relationship, record, value, index, isRemote) {
|
|
1386
1387
|
((test) => {
|
|
@@ -1410,11 +1411,16 @@ function mergeInRelationship(graph, rel, op) {
|
|
|
1410
1411
|
else mergeImplicit(graph, rel, op);
|
|
1411
1412
|
}
|
|
1412
1413
|
function mergeBelongsTo(graph, rel, op) {
|
|
1413
|
-
|
|
1414
|
+
let changed = false;
|
|
1415
|
+
if (rel.remoteState === op.record) {
|
|
1416
|
+
rel.remoteState = op.value;
|
|
1417
|
+
changed = true;
|
|
1418
|
+
}
|
|
1414
1419
|
if (rel.localState === op.record) {
|
|
1415
1420
|
rel.localState = op.value;
|
|
1416
|
-
|
|
1421
|
+
changed = true;
|
|
1417
1422
|
}
|
|
1423
|
+
if (changed) notifyChange(graph, rel);
|
|
1418
1424
|
}
|
|
1419
1425
|
function mergeHasMany(graph, rel, op) {
|
|
1420
1426
|
if (rel.remoteMembers.has(op.record)) {
|
|
@@ -1473,7 +1479,7 @@ function removeFromRelatedRecords(graph, op, isRemote) {
|
|
|
1473
1479
|
})(isHasMany(relationship));
|
|
1474
1480
|
if (Array.isArray(value)) for (let i = 0; i < value.length; i++) removeRelatedRecord(graph, record, relationship, value[i], op.index ?? null, isRemote);
|
|
1475
1481
|
else removeRelatedRecord(graph, record, relationship, value, op.index ?? null, isRemote);
|
|
1476
|
-
notifyChange(graph, relationship);
|
|
1482
|
+
notifyChange(graph, relationship, isRemote ? void 0 : "local");
|
|
1477
1483
|
}
|
|
1478
1484
|
function removeRelatedRecord(graph, record, relationship, value, index, isRemote) {
|
|
1479
1485
|
((test) => {
|
|
@@ -1645,8 +1651,11 @@ var Graph = class {
|
|
|
1645
1651
|
* {@link Graph.push} but not yet flushed into the graph by {@link Graph._flushRemoteQueue}.
|
|
1646
1652
|
*/
|
|
1647
1653
|
/**
|
|
1648
|
-
* The
|
|
1649
|
-
*
|
|
1654
|
+
* The {@link CollectionEdge}s that have changes pending notification, scheduled via
|
|
1655
|
+
* {@link Graph._scheduleLocalSync} and drained by {@link Graph._flushLocalQueue}, each
|
|
1656
|
+
* mapped to the {@link NotificationChannel} the notification should be scoped to —
|
|
1657
|
+
* `null` when it must reach every subscriber (scheduled unscoped, or scheduled for
|
|
1658
|
+
* both channels).
|
|
1650
1659
|
*/
|
|
1651
1660
|
/**
|
|
1652
1661
|
* The identifier of the current remote-update transaction, or `null` when no transaction is
|
|
@@ -1672,7 +1681,7 @@ var Graph = class {
|
|
|
1672
1681
|
hasMany: void 0,
|
|
1673
1682
|
deletions: []
|
|
1674
1683
|
};
|
|
1675
|
-
this._updatedRelationships = /* @__PURE__ */ new
|
|
1684
|
+
this._updatedRelationships = /* @__PURE__ */ new Map();
|
|
1676
1685
|
this._transaction = null;
|
|
1677
1686
|
this._removing = null;
|
|
1678
1687
|
this.silenceNotifications = false;
|
|
@@ -2004,12 +2013,16 @@ var Graph = class {
|
|
|
2004
2013
|
}
|
|
2005
2014
|
}
|
|
2006
2015
|
/**
|
|
2007
|
-
* Marks a {@link CollectionEdge} as having
|
|
2008
|
-
*
|
|
2009
|
-
*
|
|
2016
|
+
* Marks a {@link CollectionEdge} as having changes that need to be notified on the given
|
|
2017
|
+
* {@link NotificationChannel} (omitted = unscoped, reaching every subscriber), and schedules
|
|
2018
|
+
* a flush of the sync queue (see {@link Graph._flushLocalQueue}) if one is not already
|
|
2019
|
+
* pending. Scheduling the same edge for both channels (or once unscoped) coalesces into a
|
|
2020
|
+
* single unscoped notification.
|
|
2010
2021
|
*/
|
|
2011
|
-
_scheduleLocalSync(relationship) {
|
|
2012
|
-
this._updatedRelationships
|
|
2022
|
+
_scheduleLocalSync(relationship, channel) {
|
|
2023
|
+
const pending = this._updatedRelationships;
|
|
2024
|
+
if (!pending.has(relationship)) pending.set(relationship, channel ?? null);
|
|
2025
|
+
else if (pending.get(relationship) !== (channel ?? null)) pending.set(relationship, null);
|
|
2013
2026
|
if (!this._willSyncLocal) {
|
|
2014
2027
|
this._willSyncLocal = true;
|
|
2015
2028
|
getStore(this.store)._schedule("sync", () => this._flushLocalQueue());
|
|
@@ -2062,13 +2075,13 @@ var Graph = class {
|
|
|
2062
2075
|
if (!this._willSyncLocal) return;
|
|
2063
2076
|
if (this.silenceNotifications) {
|
|
2064
2077
|
this.silenceNotifications = false;
|
|
2065
|
-
this._updatedRelationships = /* @__PURE__ */ new
|
|
2078
|
+
this._updatedRelationships = /* @__PURE__ */ new Map();
|
|
2066
2079
|
return;
|
|
2067
2080
|
}
|
|
2068
2081
|
this._willSyncLocal = false;
|
|
2069
2082
|
const updated = this._updatedRelationships;
|
|
2070
|
-
this._updatedRelationships = /* @__PURE__ */ new
|
|
2071
|
-
updated.forEach((rel) => notifyChange(this, rel));
|
|
2083
|
+
this._updatedRelationships = /* @__PURE__ */ new Map();
|
|
2084
|
+
updated.forEach((channel, rel) => notifyChange(this, rel, channel ?? void 0));
|
|
2072
2085
|
}
|
|
2073
2086
|
/**
|
|
2074
2087
|
* Tears down the graph: clears all tracked identifiers/edges, removes it from the global
|