tempest.games 0.2.69 → 0.2.71

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.
@@ -10173,7 +10173,9 @@ var markDone = (store, key) => {
10173
10173
  }
10174
10174
  store.operation.done.add(key);
10175
10175
  };
10176
- function dispatchOrDeferStateUpdate(target, state, { oldValue, newValue }, stateIsNewlyCreated, family) {
10176
+ function dispatchOrDeferStateUpdate(target, state, proto2, stateIsNewlyCreated, family) {
10177
+ const { oldValue, newValue } = proto2;
10178
+ const hasOldValue = `oldValue` in proto2;
10177
10179
  const token = deposit(state);
10178
10180
  if (stateIsNewlyCreated && family) {
10179
10181
  state.subject.next({ newValue });
@@ -10206,10 +10208,14 @@ function dispatchOrDeferStateUpdate(target, state, { oldValue, newValue }, state
10206
10208
  return;
10207
10209
  }
10208
10210
  const { key, subject, type: type2 } = state;
10209
- const update = {
10210
- oldValue: isTransceiver(oldValue) ? oldValue.READONLY_VIEW : oldValue,
10211
- newValue: isTransceiver(newValue) ? newValue.READONLY_VIEW : newValue
10212
- };
10211
+ let update;
10212
+ if (hasOldValue)
10213
+ update = {
10214
+ oldValue: isTransceiver(oldValue) ? oldValue.READONLY_VIEW : oldValue,
10215
+ newValue: isTransceiver(newValue) ? newValue.READONLY_VIEW : newValue
10216
+ };
10217
+ else
10218
+ update = { newValue: isTransceiver(newValue) ? newValue.READONLY_VIEW : newValue };
10213
10219
  if (isRootStore(target)) {
10214
10220
  switch (type2) {
10215
10221
  case `mutable_atom`:
@@ -10245,13 +10251,29 @@ function dispatchOrDeferStateUpdate(target, state, { oldValue, newValue }, state
10245
10251
  }
10246
10252
  }
10247
10253
  }
10254
+ var UNSET = Symbol(`UNSET`);
10248
10255
  var setAtom = (target, atom, next2) => {
10249
- const oldValue = readOrComputeValue(target, atom, `mut`);
10250
- let newValue = become(next2, oldValue);
10256
+ let oldValue;
10257
+ let newValue;
10258
+ if (isFn(next2)) {
10259
+ const prev = readOrComputeValue(target, atom, `mut`);
10260
+ oldValue = prev;
10261
+ newValue = next2(prev);
10262
+ } else {
10263
+ if (target.valueMap.has(atom.key))
10264
+ oldValue = readFromCache(target, atom, `mut`);
10265
+ else if (atom.type === `atom` && !isFn(atom.default))
10266
+ oldValue = atom.default;
10267
+ else
10268
+ oldValue = UNSET;
10269
+ newValue = next2;
10270
+ }
10251
10271
  target.logger.info(`\u2B50`, `atom`, atom.key, `setting value`, newValue);
10252
10272
  newValue = writeToCache(target, atom, newValue);
10253
10273
  markDone(target, atom.key);
10254
10274
  evictDownstreamFromAtom(target, atom);
10275
+ if (oldValue === UNSET)
10276
+ return { newValue };
10255
10277
  return {
10256
10278
  oldValue,
10257
10279
  newValue
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tempest.games",
3
- "version": "0.2.69",
3
+ "version": "0.2.71",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,7 +36,7 @@
36
36
  "drizzle-orm": "0.44.7",
37
37
  "motion": "12.23.24",
38
38
  "nanoid": "5.1.6",
39
- "openai": "6.8.0",
39
+ "openai": "6.8.1",
40
40
  "postgres": "3.4.7",
41
41
  "react": "19.2.0",
42
42
  "react-dom": "19.2.0",
@@ -45,7 +45,7 @@
45
45
  "safegen": "0.8.1",
46
46
  "socket.io": "4.8.1",
47
47
  "socket.io-client": "4.8.1",
48
- "atom.io": "0.44.1",
48
+ "atom.io": "0.44.3",
49
49
  "safedeposit": "0.1.2",
50
50
  "treetrunks": "0.1.5"
51
51
  },
@@ -57,7 +57,7 @@
57
57
  "@types/node": "24.10.0",
58
58
  "@types/react": "19.2.2",
59
59
  "@types/react-dom": "19.2.2",
60
- "@vitejs/plugin-react": "npm:@vitejs/plugin-react-swc@4.2.0",
60
+ "@vitejs/plugin-react": "npm:@vitejs/plugin-react-swc@4.2.1",
61
61
  "concurrently": "9.2.1",
62
62
  "cors": "2.8.5",
63
63
  "cross-env": "10.1.0",
@@ -68,10 +68,10 @@
68
68
  "globals": "16.5.0",
69
69
  "rimraf": "6.1.0",
70
70
  "sass-embedded": "1.93.3",
71
- "vite": "7.1.12",
71
+ "vite": "7.2.0",
72
72
  "vite-tsconfig-paths": "5.1.4",
73
73
  "vitest": "4.0.7",
74
- "flightdeck": "0.2.93",
74
+ "flightdeck": "0.2.95",
75
75
  "varmint": "0.5.10"
76
76
  },
77
77
  "scripts": {