@wovin/core 0.0.9-RC2 → 0.0.9-RC3

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Logger,
3
3
  encodeApplogAndGetCid
4
- } from "./chunk-2J7BWXZ3.min.js";
4
+ } from "./chunk-PG6EJTCU.min.js";
5
5
  import {
6
6
  arrayIfSingle,
7
7
  require_typebox
@@ -4657,8 +4657,8 @@ function checkIfStateModificationsAreAllowed(atom) {
4657
4657
  if (false) {
4658
4658
  return;
4659
4659
  }
4660
- var hasObservers2 = atom.observers_.size > 0;
4661
- if (!globalState.allowStateChanges && (hasObservers2 || globalState.enforceActions === "always")) {
4660
+ var hasObservers = atom.observers_.size > 0;
4661
+ if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === "always")) {
4662
4662
  console.warn("[MobX] " + (globalState.enforceActions ? "Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: " : "Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: ") + atom.name_);
4663
4663
  }
4664
4664
  }
@@ -4857,12 +4857,6 @@ function isolateGlobalState() {
4857
4857
  function getGlobalState() {
4858
4858
  return globalState;
4859
4859
  }
4860
- function hasObservers(observable2) {
4861
- return observable2.observers_ && observable2.observers_.size > 0;
4862
- }
4863
- function getObservers(observable2) {
4864
- return observable2.observers_;
4865
- }
4866
4860
  function addObserver(observable2, node) {
4867
4861
  observable2.observers_.add(node);
4868
4862
  if (observable2.lowestObserverState_ > node.dependenciesState_) {
@@ -5503,18 +5497,6 @@ function nodeToDependencyTree(node) {
5503
5497
  }
5504
5498
  return result;
5505
5499
  }
5506
- function getObserverTree(thing, property2) {
5507
- return nodeToObserverTree(getAtom(thing, property2));
5508
- }
5509
- function nodeToObserverTree(node) {
5510
- var result = {
5511
- name: node.name_
5512
- };
5513
- if (hasObservers(node)) {
5514
- result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);
5515
- }
5516
- return result;
5517
- }
5518
5500
  function unique(list) {
5519
5501
  return Array.from(new Set(list));
5520
5502
  }
@@ -7752,18 +7734,6 @@ if (!new class {
7752
7734
  xyz;
7753
7735
  }().hasOwnProperty("xyz"))
7754
7736
  throw new Error("Transpiler is not configured correctly");
7755
- var enableSpy = () => {
7756
- return window.disableSpy = spy((event) => {
7757
- VERBOSE(`[mobx]`, event);
7758
- });
7759
- };
7760
- if (typeof window === "object") {
7761
- window.getDependencyTree = getDependencyTree;
7762
- window.getObserverTree = getObserverTree;
7763
- window.getAtom = getAtom;
7764
- window.getDebugName = getDebugName;
7765
- window.enableSpy = enableSpy;
7766
- }
7767
7737
  var createDebugName = ({ caller, thread, pattern, args }) => {
7768
7738
  args = args || pattern;
7769
7739
  const str = `${untracked(() => thread?.name ? thread.name + " | " : "")}${caller ?? "caller?"}${args ? `{${typeof args === "string" ? args : wrapper_default(args)}}` : ""}`;
@@ -10303,12 +10273,27 @@ function assertOnlyCurrent(thread) {
10303
10273
  }
10304
10274
  var simpleApplogMapper = function simpleApplogMapper2(thread, logMapper, opts = {}) {
10305
10275
  const mappedTo = /* @__PURE__ */ new Map();
10306
- const mapLogs = (applogs, thread2) => applogs.map((log) => {
10307
- const mapped = logMapper(log, thread2);
10308
- const finalized = finalizeApplogForInsert(mapped, {});
10309
- mappedTo.set(log.cid, finalized);
10310
- return finalized;
10311
- });
10276
+ const mapLogs = (applogs, thread2) => {
10277
+ const ts = dateNowIso();
10278
+ return applogs.map((log) => {
10279
+ const mapped = logMapper(log, thread2);
10280
+ let mapTo2;
10281
+ if (mapped === log) {
10282
+ mapTo2 = log;
10283
+ } else {
10284
+ if (mapped.cid === log.cid) {
10285
+ delete mapped.cid;
10286
+ }
10287
+ mapTo2 = finalizeApplogForInsert(mapped, {
10288
+ ts,
10289
+ threadForPv: null
10290
+ // ? should not be inferred, right?
10291
+ });
10292
+ }
10293
+ mappedTo.set(log.cid, mapTo2);
10294
+ return mapTo2;
10295
+ });
10296
+ };
10312
10297
  const handleUpdateEvent = (event) => {
10313
10298
  let mappedEvent;
10314
10299
  if (isInitEvent(event)) {
@@ -10893,4 +10878,4 @@ lodash-es/lodash.js:
10893
10878
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
10894
10879
  *)
10895
10880
  */
10896
- //# sourceMappingURL=chunk-IFQLMJQZ.min.js.map
10881
+ //# sourceMappingURL=chunk-QXKFFDHN.min.js.map