@warp-drive-mirror/core 5.9.0-alpha.16 → 5.9.0-alpha.17

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.
@@ -1828,12 +1828,12 @@ function diffCollection(finalState, relationship, onAdd, onDel) {
1828
1828
  return _compare(priorLocalState, finalState, finalSet, remoteState, remoteMembers, onAdd, onDel, relationship.definition.resetOnRemoteUpdate);
1829
1829
  }
1830
1830
  function computeLocalState(storage) {
1831
- if (!storage.isDirty) {
1832
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
1833
- if (!test) {
1834
- throw new Error(`Expected localState to be present`);
1835
- }
1836
- })(Array.isArray(storage.localState)) : {};
1831
+ // When the edge is clean and we already have a materialized localState we can
1832
+ // return it directly. A clean edge can still have a `null` localState though:
1833
+ // dematerializing an inverse member (e.g. when a route reloads its model)
1834
+ // nulls out localState without dirtying the edge. In that case we fall through
1835
+ // and recompute from remoteState rather than asserting.
1836
+ if (!storage.isDirty && storage.localState) {
1837
1837
  return storage.localState;
1838
1838
  }
1839
1839
  const state = storage.remoteState.slice();
@@ -1,6 +1,6 @@
1
1
  import { macroCondition, getGlobalConfig } from '@embroider/macros';
2
2
  const name = "@warp-drive-mirror/core";
3
- const version = "5.9.0-alpha.16";
3
+ const version = "5.9.0-alpha.17";
4
4
 
5
5
  // in testing mode, we utilize globals to ensure only one copy exists of
6
6
  // these maps, due to bugs in ember-auto-import
@@ -1585,12 +1585,12 @@ function diffCollection(finalState, relationship, onAdd, onDel) {
1585
1585
  return _compare(priorLocalState, finalState, finalSet, remoteState, remoteMembers, onAdd, onDel, relationship.definition.resetOnRemoteUpdate);
1586
1586
  }
1587
1587
  function computeLocalState(storage) {
1588
- if (!storage.isDirty) {
1589
- (test => {
1590
- if (!test) {
1591
- throw new Error(`Expected localState to be present`);
1592
- }
1593
- })(Array.isArray(storage.localState));
1588
+ // When the edge is clean and we already have a materialized localState we can
1589
+ // return it directly. A clean edge can still have a `null` localState though:
1590
+ // dematerializing an inverse member (e.g. when a route reloads its model)
1591
+ // nulls out localState without dirtying the edge. In that case we fall through
1592
+ // and recompute from remoteState rather than asserting.
1593
+ if (!storage.isDirty && storage.localState) {
1594
1594
  return storage.localState;
1595
1595
  }
1596
1596
  const state = storage.remoteState.slice();
@@ -1,5 +1,5 @@
1
1
  const name = "@warp-drive-mirror/core";
2
- const version = "5.9.0-alpha.16";
2
+ const version = "5.9.0-alpha.17";
3
3
 
4
4
  // in testing mode, we utilize globals to ensure only one copy exists of
5
5
  // these maps, due to bugs in ember-auto-import
@@ -1780,12 +1780,12 @@ function diffCollection(finalState, relationship, onAdd, onDel) {
1780
1780
  return _compare(priorLocalState, finalState, finalSet, remoteState, remoteMembers, onAdd, onDel, relationship.definition.resetOnRemoteUpdate);
1781
1781
  }
1782
1782
  function computeLocalState(storage) {
1783
- if (!storage.isDirty) {
1784
- (test => {
1785
- if (!test) {
1786
- throw new Error(`Expected localState to be present`);
1787
- }
1788
- })(Array.isArray(storage.localState));
1783
+ // When the edge is clean and we already have a materialized localState we can
1784
+ // return it directly. A clean edge can still have a `null` localState though:
1785
+ // dematerializing an inverse member (e.g. when a route reloads its model)
1786
+ // nulls out localState without dirtying the edge. In that case we fall through
1787
+ // and recompute from remoteState rather than asserting.
1788
+ if (!storage.isDirty && storage.localState) {
1789
1789
  return storage.localState;
1790
1790
  }
1791
1791
  const state = storage.remoteState.slice();
@@ -1,5 +1,5 @@
1
1
  const name = "@warp-drive-mirror/core";
2
- const version = "5.9.0-alpha.16";
2
+ const version = "5.9.0-alpha.17";
3
3
 
4
4
  // in testing mode, we utilize globals to ensure only one copy exists of
5
5
  // these maps, due to bugs in ember-auto-import
@@ -979,7 +979,12 @@ function diffCollection(finalState, relationship, onAdd, onDel) {
979
979
  return _compare(priorLocalState, finalState, finalSet, remoteState, remoteMembers, onAdd, onDel, relationship.definition.resetOnRemoteUpdate);
980
980
  }
981
981
  function computeLocalState(storage) {
982
- if (!storage.isDirty) {
982
+ // When the edge is clean and we already have a materialized localState we can
983
+ // return it directly. A clean edge can still have a `null` localState though:
984
+ // dematerializing an inverse member (e.g. when a route reloads its model)
985
+ // nulls out localState without dirtying the edge. In that case we fall through
986
+ // and recompute from remoteState rather than asserting.
987
+ if (!storage.isDirty && storage.localState) {
983
988
  return storage.localState;
984
989
  }
985
990
  const state = storage.remoteState.slice();
@@ -1,5 +1,5 @@
1
1
  const name = "@warp-drive-mirror/core";
2
- const version = "5.9.0-alpha.16";
2
+ const version = "5.9.0-alpha.17";
3
3
 
4
4
  // in testing mode, we utilize globals to ensure only one copy exists of
5
5
  // these maps, due to bugs in ember-auto-import
@@ -1152,7 +1152,12 @@ function diffCollection(finalState, relationship, onAdd, onDel) {
1152
1152
  return _compare(priorLocalState, finalState, finalSet, remoteState, remoteMembers, onAdd, onDel, relationship.definition.resetOnRemoteUpdate);
1153
1153
  }
1154
1154
  function computeLocalState(storage) {
1155
- if (!storage.isDirty) {
1155
+ // When the edge is clean and we already have a materialized localState we can
1156
+ // return it directly. A clean edge can still have a `null` localState though:
1157
+ // dematerializing an inverse member (e.g. when a route reloads its model)
1158
+ // nulls out localState without dirtying the edge. In that case we fall through
1159
+ // and recompute from remoteState rather than asserting.
1160
+ if (!storage.isDirty && storage.localState) {
1156
1161
  return storage.localState;
1157
1162
  }
1158
1163
  const state = storage.remoteState.slice();
@@ -1,5 +1,5 @@
1
1
  const name = "@warp-drive-mirror/core";
2
- const version = "5.9.0-alpha.16";
2
+ const version = "5.9.0-alpha.17";
3
3
 
4
4
  // in testing mode, we utilize globals to ensure only one copy exists of
5
5
  // these maps, due to bugs in ember-auto-import
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warp-drive-mirror/core",
3
- "version": "5.9.0-alpha.16",
3
+ "version": "5.9.0-alpha.17",
4
4
  "description": "Core package for WarpDrive | All the Universal Basics",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -45,13 +45,13 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@embroider/macros": "^1.19.6",
48
- "@warp-drive-mirror/build-config": "5.9.0-alpha.16"
48
+ "@warp-drive-mirror/build-config": "5.9.0-alpha.17"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@babel/core": "^7.28.3",
52
52
  "@babel/plugin-transform-typescript": "^7.28.0",
53
53
  "@babel/preset-typescript": "^7.27.1",
54
- "@warp-drive/internal-config": "5.9.0-alpha.16",
54
+ "@warp-drive/internal-config": "5.9.0-alpha.17",
55
55
  "decorator-transforms": "^2.3.0",
56
56
  "ember-source": "~6.12.0",
57
57
  "expect-type": "^1.2.2",