@real-router/svelte 0.17.49 → 0.17.50

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.
@@ -257,16 +257,25 @@ export function shallowEqual(prev, next) {
257
257
  return false;
258
258
  }
259
259
  const prevKeys = objectKeys(prev);
260
- if (prevKeys.length !== objectKeys(next).length) {
260
+ const nextKeys = objectKeys(next);
261
+ if (prevKeys.length !== nextKeys.length) {
261
262
  return false;
262
263
  }
263
264
  const prevRecord = prev;
264
265
  const nextRecord = next;
265
266
  for (const key of prevKeys) {
266
- // hasOwnProperty guard: without it, a key missing in `next` reads as
267
- // `undefined` and falsely matches `prev[key] === undefined`. Same shape
268
- // as React's shallowEqual (packages/shared/shallowEqual.js).
269
- if (!Object.prototype.hasOwnProperty.call(next, key) ||
267
+ // ⚑ Membership is decided from the LIST the count produced, never from a
268
+ // second question put to the record (#2064; #1815 settled the same question
269
+ // for `recordsShallowEqual` in core). `Object.keys` is own AND enumerable
270
+ // while `hasOwnProperty` is own only — and on a Proxy it is whatever the
271
+ // `getOwnPropertyDescriptor` trap answers.
272
+ //
273
+ // ⚠ `key in next`, `Object.hasOwn` and `propertyIsEnumerable` are the same
274
+ // family, and none of them is the fix: each leaves a cell of this file's
275
+ // own suites red. `lint:membership` is the ratchet over the class.
276
+ //
277
+ // The second array is free: the count already built it and threw it away.
278
+ if (!nextKeys.includes(key) ||
270
279
  !Object.is(prevRecord[key], nextRecord[key])) {
271
280
  return false;
272
281
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@real-router/svelte",
3
- "version": "0.17.49",
3
+ "version": "0.17.50",
4
4
  "type": "module",
5
5
  "description": "Svelte 5 integration for Real-Router",
6
6
  "svelte": "./dist/index.js",
@@ -48,7 +48,7 @@
48
48
  "license": "MIT",
49
49
  "sideEffects": false,
50
50
  "dependencies": {
51
- "@real-router/core": "^0.126.0",
51
+ "@real-router/core": "^0.126.1",
52
52
  "@real-router/route-utils": "^0.3.1",
53
53
  "@real-router/sources": "^0.14.30"
54
54
  },