mobx-react 9.2.2 → 10.0.0
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/CHANGELOG.md +73 -0
- package/README.md +8 -264
- package/dist/index.d.ts +1 -6
- package/dist/mobxreact.cjs.development.js +101 -449
- package/dist/mobxreact.cjs.development.js.map +1 -1
- package/dist/mobxreact.cjs.production.min.js +1 -1
- package/dist/mobxreact.cjs.production.min.js.map +1 -1
- package/dist/mobxreact.esm.development.js +76 -405
- package/dist/mobxreact.esm.development.js.map +1 -1
- package/dist/mobxreact.esm.js +75 -404
- package/dist/mobxreact.esm.js.map +1 -1
- package/dist/mobxreact.esm.production.min.js +1 -1
- package/dist/mobxreact.esm.production.min.js.map +1 -1
- package/dist/mobxreact.mjs +338 -0
- package/dist/mobxreact.mjs.map +1 -0
- package/dist/mobxreact.umd.development.js +103 -450
- package/dist/mobxreact.umd.development.js.map +1 -1
- package/dist/mobxreact.umd.production.min.js +1 -1
- package/dist/mobxreact.umd.production.min.js.map +1 -1
- package/dist/utils/utils.d.ts +0 -8
- package/package.json +30 -20
- package/src/index.ts +3 -12
- package/src/observer.tsx +9 -8
- package/src/utils/utils.ts +0 -46
- package/batchingForReactDom.js +0 -1
- package/batchingForReactNative.js +0 -1
- package/batchingOptOut.js +0 -1
- package/dist/Provider.d.ts +0 -10
- package/dist/disposeOnUnmount.d.ts +0 -11
- package/dist/inject.d.ts +0 -6
- package/dist/propTypes.d.ts +0 -9
- package/dist/types/IStoresToProps.d.ts +0 -2
- package/dist/types/IValueMap.d.ts +0 -1
- package/dist/types/IWrappedComponent.d.ts +0 -4
- package/src/Provider.tsx +0 -29
- package/src/disposeOnUnmount.ts +0 -111
- package/src/inject.ts +0 -107
- package/src/propTypes.ts +0 -210
- package/src/types/IStoresToProps.ts +0 -7
- package/src/types/IValueMap.ts +0 -1
- package/src/types/IWrappedComponent.ts +0 -4
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { _allowStateChanges, Reaction, _getGlobalState, observable } from 'mobx';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { PureComponent, Component } from 'react';
|
|
4
|
+
import { isUsingStaticRendering, _observerFinalizationRegistry, observer as observer$1 } from 'mobx-react-lite';
|
|
5
|
+
export { Observer, _observerFinalizationRegistry, clearTimers, enableStaticRendering, isUsingStaticRendering, useLocalObservable } from 'mobx-react-lite';
|
|
6
|
+
|
|
7
|
+
function shallowEqual(objA, objB) {
|
|
8
|
+
//From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js
|
|
9
|
+
if (is(objA, objB)) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
const keysA = Object.keys(objA);
|
|
16
|
+
const keysB = Object.keys(objB);
|
|
17
|
+
if (keysA.length !== keysB.length) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
for (let i = 0; i < keysA.length; i++) {
|
|
21
|
+
if (!Object.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
function is(x, y) {
|
|
28
|
+
// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js
|
|
29
|
+
if (x === y) {
|
|
30
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
31
|
+
} else {
|
|
32
|
+
return x !== x && y !== y;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Utilities for patching componentWillUnmount, to make sure @disposeOnUnmount works correctly icm with user defined hooks
|
|
37
|
+
* and the handler provided by mobx-react
|
|
38
|
+
*/
|
|
39
|
+
const mobxMixins = /*#__PURE__*/Symbol("patchMixins");
|
|
40
|
+
const mobxPatchedDefinition = /*#__PURE__*/Symbol("patchedDefinition");
|
|
41
|
+
function getMixins(target, methodName) {
|
|
42
|
+
const mixins = target[mobxMixins] = target[mobxMixins] || {};
|
|
43
|
+
const methodMixins = mixins[methodName] = mixins[methodName] || {};
|
|
44
|
+
methodMixins.locks = methodMixins.locks || 0;
|
|
45
|
+
methodMixins.methods = methodMixins.methods || [];
|
|
46
|
+
return methodMixins;
|
|
47
|
+
}
|
|
48
|
+
function wrapper(realMethod, mixins, ...args) {
|
|
49
|
+
// locks are used to ensure that mixins are invoked only once per invocation, even on recursive calls
|
|
50
|
+
mixins.locks++;
|
|
51
|
+
try {
|
|
52
|
+
let retVal;
|
|
53
|
+
if (realMethod !== undefined && realMethod !== null) {
|
|
54
|
+
retVal = realMethod.apply(this, args);
|
|
55
|
+
}
|
|
56
|
+
return retVal;
|
|
57
|
+
} finally {
|
|
58
|
+
mixins.locks--;
|
|
59
|
+
if (mixins.locks === 0) {
|
|
60
|
+
mixins.methods.forEach(mx => {
|
|
61
|
+
mx.apply(this, args);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function wrapFunction(realMethod, mixins) {
|
|
67
|
+
const fn = function fn(...args) {
|
|
68
|
+
wrapper.call(this, realMethod, mixins, ...args);
|
|
69
|
+
};
|
|
70
|
+
return fn;
|
|
71
|
+
}
|
|
72
|
+
function patch(target, methodName, mixinMethod) {
|
|
73
|
+
const mixins = getMixins(target, methodName);
|
|
74
|
+
if (mixins.methods.indexOf(mixinMethod) < 0) {
|
|
75
|
+
mixins.methods.push(mixinMethod);
|
|
76
|
+
}
|
|
77
|
+
const oldDefinition = Object.getOwnPropertyDescriptor(target, methodName);
|
|
78
|
+
if (oldDefinition && oldDefinition[mobxPatchedDefinition]) {
|
|
79
|
+
// already patched definition, do not repatch
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const originalMethod = target[methodName];
|
|
83
|
+
const newDefinition = createDefinition(target, methodName, oldDefinition ? oldDefinition.enumerable : undefined, mixins, originalMethod);
|
|
84
|
+
Object.defineProperty(target, methodName, newDefinition);
|
|
85
|
+
}
|
|
86
|
+
function createDefinition(target, methodName, enumerable, mixins, originalMethod) {
|
|
87
|
+
let wrappedFunc = wrapFunction(originalMethod, mixins);
|
|
88
|
+
return {
|
|
89
|
+
// @ts-ignore
|
|
90
|
+
[mobxPatchedDefinition]: true,
|
|
91
|
+
get: function () {
|
|
92
|
+
return wrappedFunc;
|
|
93
|
+
},
|
|
94
|
+
set: function (value) {
|
|
95
|
+
if (this === target) {
|
|
96
|
+
wrappedFunc = wrapFunction(value, mixins);
|
|
97
|
+
} else {
|
|
98
|
+
// when it is an instance of the prototype/a child prototype patch that particular case again separately
|
|
99
|
+
// since we need to store separate values depending on wether it is the actual instance, the prototype, etc
|
|
100
|
+
// e.g. the method for super might not be the same as the method for the prototype which might be not the same
|
|
101
|
+
// as the method for the instance
|
|
102
|
+
const newDefinition = createDefinition(this, methodName, enumerable, mixins, value);
|
|
103
|
+
Object.defineProperty(this, methodName, newDefinition);
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
configurable: true,
|
|
107
|
+
enumerable: enumerable
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const administrationSymbol = /*#__PURE__*/Symbol("ObserverAdministration");
|
|
112
|
+
const isMobXReactObserverSymbol = /*#__PURE__*/Symbol("isMobXReactObserver");
|
|
113
|
+
let observablePropDescriptors;
|
|
114
|
+
if (process.env.NODE_ENV !== "production") {
|
|
115
|
+
observablePropDescriptors = {
|
|
116
|
+
props: /*#__PURE__*/createObservablePropDescriptor("props"),
|
|
117
|
+
state: /*#__PURE__*/createObservablePropDescriptor("state"),
|
|
118
|
+
context: /*#__PURE__*/createObservablePropDescriptor("context")
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function getAdministration(component) {
|
|
122
|
+
var _component$administra;
|
|
123
|
+
// We create administration lazily, because we can't patch constructor
|
|
124
|
+
// and the exact moment of initialization partially depends on React internals.
|
|
125
|
+
// At the time of writing this, the first thing invoked is one of the observable getter/setter (state/props/context).
|
|
126
|
+
return (_component$administra = component[administrationSymbol]) != null ? _component$administra : component[administrationSymbol] = {
|
|
127
|
+
reaction: null,
|
|
128
|
+
mounted: false,
|
|
129
|
+
reactionInvalidatedBeforeMount: false,
|
|
130
|
+
forceUpdate: null,
|
|
131
|
+
name: getDisplayName(component.constructor),
|
|
132
|
+
state: undefined,
|
|
133
|
+
props: undefined,
|
|
134
|
+
context: undefined
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function makeClassComponentObserver(componentClass) {
|
|
138
|
+
const {
|
|
139
|
+
prototype
|
|
140
|
+
} = componentClass;
|
|
141
|
+
if (componentClass[isMobXReactObserverSymbol]) {
|
|
142
|
+
const displayName = getDisplayName(componentClass);
|
|
143
|
+
throw new Error(`The provided component class (${displayName}) has already been declared as an observer component.`);
|
|
144
|
+
} else {
|
|
145
|
+
componentClass[isMobXReactObserverSymbol] = true;
|
|
146
|
+
}
|
|
147
|
+
if (prototype.componentWillReact) {
|
|
148
|
+
throw new Error("The componentWillReact life-cycle event is no longer supported");
|
|
149
|
+
}
|
|
150
|
+
if (componentClass["__proto__"] !== PureComponent) {
|
|
151
|
+
if (!prototype.shouldComponentUpdate) {
|
|
152
|
+
prototype.shouldComponentUpdate = observerSCU;
|
|
153
|
+
} else if (prototype.shouldComponentUpdate !== observerSCU) {
|
|
154
|
+
// n.b. unequal check, instead of existence check, as @observer might be on superclass as well
|
|
155
|
+
throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.");
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (process.env.NODE_ENV !== "production") {
|
|
159
|
+
Object.defineProperties(prototype, observablePropDescriptors);
|
|
160
|
+
}
|
|
161
|
+
const originalRender = prototype.render;
|
|
162
|
+
if (typeof originalRender !== "function") {
|
|
163
|
+
const displayName = getDisplayName(componentClass);
|
|
164
|
+
throw new Error(`[mobx-react] class component (${displayName}) is missing \`render\` method.` + `\n\`observer\` requires \`render\` being a function defined on prototype.` + `\n\`render = () => {}\` or \`render = function() {}\` is not supported.`);
|
|
165
|
+
}
|
|
166
|
+
prototype.render = function () {
|
|
167
|
+
Object.defineProperty(this, "render", {
|
|
168
|
+
// There is no safe way to replace render, therefore it's forbidden.
|
|
169
|
+
configurable: false,
|
|
170
|
+
writable: false,
|
|
171
|
+
value: isUsingStaticRendering() ? originalRender : createReactiveRender.call(this, originalRender)
|
|
172
|
+
});
|
|
173
|
+
return this.render();
|
|
174
|
+
};
|
|
175
|
+
const originalComponentDidMount = prototype.componentDidMount;
|
|
176
|
+
prototype.componentDidMount = function () {
|
|
177
|
+
if (process.env.NODE_ENV !== "production" && this.componentDidMount !== Object.getPrototypeOf(this).componentDidMount) {
|
|
178
|
+
const displayName = getDisplayName(componentClass);
|
|
179
|
+
throw new Error(`[mobx-react] \`observer(${displayName}).componentDidMount\` must be defined on prototype.` + `\n\`componentDidMount = () => {}\` or \`componentDidMount = function() {}\` is not supported.`);
|
|
180
|
+
}
|
|
181
|
+
// `componentDidMount` may not be called at all. React can abandon the instance after `render`.
|
|
182
|
+
// That's why we use finalization registry to dispose reaction created during render.
|
|
183
|
+
// Happens with `<Suspend>` see #3492
|
|
184
|
+
//
|
|
185
|
+
// `componentDidMount` can be called immediately after `componentWillUnmount` without calling `render` in between.
|
|
186
|
+
// Happens with `<StrictMode>`see #3395.
|
|
187
|
+
//
|
|
188
|
+
// If `componentDidMount` is called, it's guaranteed to run synchronously with render (similary to `useLayoutEffect`).
|
|
189
|
+
// Therefore we don't have to worry about external (observable) state being updated before mount (no state version checking).
|
|
190
|
+
//
|
|
191
|
+
// Things may change: "In the future, React will provide a feature that lets components preserve state between unmounts"
|
|
192
|
+
const admin = getAdministration(this);
|
|
193
|
+
admin.mounted = true;
|
|
194
|
+
// Component instance committed, prevent reaction disposal.
|
|
195
|
+
_observerFinalizationRegistry.unregister(this);
|
|
196
|
+
// We don't set forceUpdate before mount because it requires a reference to `this`,
|
|
197
|
+
// therefore `this` could NOT be garbage collected before mount,
|
|
198
|
+
// preventing reaction disposal by FinalizationRegistry and leading to memory leak.
|
|
199
|
+
// As an alternative we could have `admin.instanceRef = new WeakRef(this)`, but lets avoid it if possible.
|
|
200
|
+
admin.forceUpdate = () => this.forceUpdate();
|
|
201
|
+
if (!admin.reaction || admin.reactionInvalidatedBeforeMount) {
|
|
202
|
+
// Missing reaction:
|
|
203
|
+
// 1. Instance was unmounted (reaction disposed) and immediately remounted without running render #3395.
|
|
204
|
+
// 2. Reaction was disposed by finalization registry before mount. Shouldn't ever happen for class components:
|
|
205
|
+
// `componentDidMount` runs synchronously after render, but our registry are deferred (can't run in between).
|
|
206
|
+
// In any case we lost subscriptions to observables, so we have to create new reaction and re-render to resubscribe.
|
|
207
|
+
// The reaction will be created lazily by following render.
|
|
208
|
+
// Reaction invalidated before mount:
|
|
209
|
+
// 1. A descendant's `componenDidMount` invalidated it's parent #3730
|
|
210
|
+
admin.forceUpdate();
|
|
211
|
+
}
|
|
212
|
+
return originalComponentDidMount == null ? void 0 : originalComponentDidMount.apply(this, arguments);
|
|
213
|
+
};
|
|
214
|
+
// TODO@major Overly complicated "patch" is only needed to support the deprecated @disposeOnUnmount
|
|
215
|
+
patch(prototype, "componentWillUnmount", function () {
|
|
216
|
+
var _admin$reaction;
|
|
217
|
+
if (isUsingStaticRendering()) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
const admin = getAdministration(this);
|
|
221
|
+
(_admin$reaction = admin.reaction) == null || _admin$reaction.dispose();
|
|
222
|
+
admin.reaction = null;
|
|
223
|
+
admin.forceUpdate = null;
|
|
224
|
+
admin.mounted = false;
|
|
225
|
+
admin.reactionInvalidatedBeforeMount = false;
|
|
226
|
+
});
|
|
227
|
+
return componentClass;
|
|
228
|
+
}
|
|
229
|
+
// Generates a friendly name for debugging
|
|
230
|
+
function getDisplayName(componentClass) {
|
|
231
|
+
return componentClass.displayName || componentClass.name || "<component>";
|
|
232
|
+
}
|
|
233
|
+
function createReactiveRender(originalRender) {
|
|
234
|
+
const boundOriginalRender = originalRender.bind(this);
|
|
235
|
+
const admin = getAdministration(this);
|
|
236
|
+
function reactiveRender() {
|
|
237
|
+
if (!admin.reaction) {
|
|
238
|
+
// Create reaction lazily to support re-mounting #3395
|
|
239
|
+
admin.reaction = createReaction(admin);
|
|
240
|
+
if (!admin.mounted) {
|
|
241
|
+
// React can abandon this instance and never call `componentDidMount`/`componentWillUnmount`,
|
|
242
|
+
// we have to make sure reaction will be disposed.
|
|
243
|
+
_observerFinalizationRegistry.register(this, admin, this);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
let error = undefined;
|
|
247
|
+
let renderResult = undefined;
|
|
248
|
+
admin.reaction.track(() => {
|
|
249
|
+
try {
|
|
250
|
+
// TODO@major
|
|
251
|
+
// Optimization: replace with _allowStateChangesStart/End (not available in mobx@6.0.0)
|
|
252
|
+
renderResult = _allowStateChanges(false, boundOriginalRender);
|
|
253
|
+
} catch (e) {
|
|
254
|
+
error = e;
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
if (error) {
|
|
258
|
+
throw error;
|
|
259
|
+
}
|
|
260
|
+
return renderResult;
|
|
261
|
+
}
|
|
262
|
+
return reactiveRender;
|
|
263
|
+
}
|
|
264
|
+
function createReaction(admin) {
|
|
265
|
+
return new Reaction(`${admin.name}.render()`, () => {
|
|
266
|
+
if (!admin.mounted) {
|
|
267
|
+
// This is neccessary to avoid react warning about calling forceUpdate on component that isn't mounted yet.
|
|
268
|
+
// This happens when component is abandoned after render - our reaction is already created and reacts to changes.
|
|
269
|
+
// `componenDidMount` runs synchronously after `render`, so unlike functional component, there is no delay during which the reaction could be invalidated.
|
|
270
|
+
// However `componentDidMount` runs AFTER it's descendants' `componentDidMount`, which CAN invalidate the reaction, see #3730. Therefore remember and forceUpdate on mount.
|
|
271
|
+
admin.reactionInvalidatedBeforeMount = true;
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
try {
|
|
275
|
+
admin.forceUpdate == null || admin.forceUpdate();
|
|
276
|
+
} catch (error) {
|
|
277
|
+
var _admin$reaction2;
|
|
278
|
+
(_admin$reaction2 = admin.reaction) == null || _admin$reaction2.dispose();
|
|
279
|
+
admin.reaction = null;
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
function observerSCU(nextProps, nextState) {
|
|
284
|
+
if (isUsingStaticRendering()) {
|
|
285
|
+
console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side.");
|
|
286
|
+
}
|
|
287
|
+
// update on any state changes (as is the default)
|
|
288
|
+
if (this.state !== nextState) {
|
|
289
|
+
return true;
|
|
290
|
+
}
|
|
291
|
+
// update if props are shallowly not equal, inspired by PureRenderMixin
|
|
292
|
+
// we could return just 'false' here, and avoid the `skipRender` checks etc
|
|
293
|
+
// however, it is nicer if lifecycle events are triggered like usually,
|
|
294
|
+
// so we return true here if props are shallowly modified.
|
|
295
|
+
return !shallowEqual(this.props, nextProps);
|
|
296
|
+
}
|
|
297
|
+
function createObservablePropDescriptor(key) {
|
|
298
|
+
return {
|
|
299
|
+
configurable: true,
|
|
300
|
+
enumerable: true,
|
|
301
|
+
get() {
|
|
302
|
+
const admin = getAdministration(this);
|
|
303
|
+
const derivation = _getGlobalState().trackingDerivation;
|
|
304
|
+
if (derivation && derivation !== admin.reaction) {
|
|
305
|
+
throw new Error(`[mobx-react] Cannot read "${admin.name}.${key}" in a reactive context, as it isn't observable.
|
|
306
|
+
Please use component lifecycle method to copy the value into a local observable first.
|
|
307
|
+
See https://github.com/mobxjs/mobx/blob/main/packages/mobx-react/README.md#note-on-using-props-and-state-in-derivations`);
|
|
308
|
+
}
|
|
309
|
+
return admin[key];
|
|
310
|
+
},
|
|
311
|
+
set(value) {
|
|
312
|
+
getAdministration(this)[key] = value;
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function observer(component, context) {
|
|
318
|
+
if (context && context.kind !== "class") {
|
|
319
|
+
throw new Error("The @observer decorator can be used on classes only");
|
|
320
|
+
}
|
|
321
|
+
if (Object.prototype.isPrototypeOf.call(React.Component, component) || Object.prototype.isPrototypeOf.call(React.PureComponent, component)) {
|
|
322
|
+
// Class component
|
|
323
|
+
return makeClassComponentObserver(component);
|
|
324
|
+
} else {
|
|
325
|
+
// Function component
|
|
326
|
+
return observer$1(component);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
if (!Component) {
|
|
331
|
+
throw new Error("mobx-react requires React to be available");
|
|
332
|
+
}
|
|
333
|
+
if (!observable) {
|
|
334
|
+
throw new Error("mobx-react requires mobx to be available");
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export { observer };
|
|
338
|
+
//# sourceMappingURL=mobxreact.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobxreact.mjs","sources":["../src/utils/utils.ts","../src/observerClass.ts","../src/observer.tsx","../src/index.ts"],"sourcesContent":["export function shallowEqual(objA: any, objB: any): boolean {\n //From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js\n if (is(objA, objB)) {\n return true\n }\n if (typeof objA !== \"object\" || objA === null || typeof objB !== \"object\" || objB === null) {\n return false\n }\n const keysA = Object.keys(objA)\n const keysB = Object.keys(objB)\n if (keysA.length !== keysB.length) {\n return false\n }\n for (let i = 0; i < keysA.length; i++) {\n if (!Object.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false\n }\n }\n return true\n}\n\nfunction is(x: any, y: any): boolean {\n // From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y\n } else {\n return x !== x && y !== y\n }\n}\n\n/**\n * Utilities for patching componentWillUnmount, to make sure @disposeOnUnmount works correctly icm with user defined hooks\n * and the handler provided by mobx-react\n */\nconst mobxMixins = Symbol(\"patchMixins\")\nconst mobxPatchedDefinition = Symbol(\"patchedDefinition\")\n\nexport interface Mixins extends Record<string, any> {\n locks: number\n methods: Array<Function>\n}\n\nfunction getMixins(target: object, methodName: string): Mixins {\n const mixins = (target[mobxMixins] = target[mobxMixins] || {})\n const methodMixins = (mixins[methodName] = mixins[methodName] || {})\n methodMixins.locks = methodMixins.locks || 0\n methodMixins.methods = methodMixins.methods || []\n return methodMixins\n}\n\nfunction wrapper(realMethod: Function, mixins: Mixins, ...args: Array<any>) {\n // locks are used to ensure that mixins are invoked only once per invocation, even on recursive calls\n mixins.locks++\n\n try {\n let retVal\n if (realMethod !== undefined && realMethod !== null) {\n retVal = realMethod.apply(this, args)\n }\n\n return retVal\n } finally {\n mixins.locks--\n if (mixins.locks === 0) {\n mixins.methods.forEach(mx => {\n mx.apply(this, args)\n })\n }\n }\n}\n\nfunction wrapFunction(realMethod: Function, mixins: Mixins): (...args: Array<any>) => any {\n const fn = function (...args: Array<any>) {\n wrapper.call(this, realMethod, mixins, ...args)\n }\n return fn\n}\n\nexport function patch(target: object, methodName: string, mixinMethod: Function): void {\n const mixins = getMixins(target, methodName)\n\n if (mixins.methods.indexOf(mixinMethod) < 0) {\n mixins.methods.push(mixinMethod)\n }\n\n const oldDefinition = Object.getOwnPropertyDescriptor(target, methodName)\n if (oldDefinition && oldDefinition[mobxPatchedDefinition]) {\n // already patched definition, do not repatch\n return\n }\n\n const originalMethod = target[methodName]\n const newDefinition = createDefinition(\n target,\n methodName,\n oldDefinition ? oldDefinition.enumerable : undefined,\n mixins,\n originalMethod\n )\n\n Object.defineProperty(target, methodName, newDefinition)\n}\n\nfunction createDefinition(\n target: object,\n methodName: string,\n enumerable: any,\n mixins: Mixins,\n originalMethod: Function\n): PropertyDescriptor {\n let wrappedFunc = wrapFunction(originalMethod, mixins)\n\n return {\n // @ts-ignore\n [mobxPatchedDefinition]: true,\n get: function () {\n return wrappedFunc\n },\n set: function (value) {\n if (this === target) {\n wrappedFunc = wrapFunction(value, mixins)\n } else {\n // when it is an instance of the prototype/a child prototype patch that particular case again separately\n // since we need to store separate values depending on wether it is the actual instance, the prototype, etc\n // e.g. the method for super might not be the same as the method for the prototype which might be not the same\n // as the method for the instance\n const newDefinition = createDefinition(this, methodName, enumerable, mixins, value)\n Object.defineProperty(this, methodName, newDefinition)\n }\n },\n configurable: true,\n enumerable: enumerable\n }\n}\n","import { PureComponent, Component, ComponentClass, ClassAttributes } from \"react\"\nimport {\n _allowStateChanges,\n Reaction,\n _allowStateReadsStart,\n _allowStateReadsEnd,\n _getGlobalState\n} from \"mobx\"\nimport {\n isUsingStaticRendering,\n _observerFinalizationRegistry as observerFinalizationRegistry\n} from \"mobx-react-lite\"\nimport { shallowEqual, patch } from \"./utils/utils\"\n\nconst administrationSymbol = Symbol(\"ObserverAdministration\")\nconst isMobXReactObserverSymbol = Symbol(\"isMobXReactObserver\")\n\nlet observablePropDescriptors: PropertyDescriptorMap\nif (__DEV__) {\n observablePropDescriptors = {\n props: createObservablePropDescriptor(\"props\"),\n state: createObservablePropDescriptor(\"state\"),\n context: createObservablePropDescriptor(\"context\")\n }\n}\n\ntype ObserverAdministration = {\n reaction: Reaction | null // also serves as disposed flag\n forceUpdate: Function | null\n mounted: boolean // we could use forceUpdate as mounted flag\n reactionInvalidatedBeforeMount: boolean\n name: string\n // Used only on __DEV__\n props: any\n state: any\n context: any\n}\n\nfunction getAdministration(component: Component): ObserverAdministration {\n // We create administration lazily, because we can't patch constructor\n // and the exact moment of initialization partially depends on React internals.\n // At the time of writing this, the first thing invoked is one of the observable getter/setter (state/props/context).\n return (component[administrationSymbol] ??= {\n reaction: null,\n mounted: false,\n reactionInvalidatedBeforeMount: false,\n forceUpdate: null,\n name: getDisplayName(component.constructor as ComponentClass),\n state: undefined,\n props: undefined,\n context: undefined\n })\n}\n\nexport function makeClassComponentObserver(\n componentClass: ComponentClass<any, any>\n): ComponentClass<any, any> {\n const { prototype } = componentClass\n\n if (componentClass[isMobXReactObserverSymbol]) {\n const displayName = getDisplayName(componentClass)\n throw new Error(\n `The provided component class (${displayName}) has already been declared as an observer component.`\n )\n } else {\n componentClass[isMobXReactObserverSymbol] = true\n }\n\n if (prototype.componentWillReact) {\n throw new Error(\"The componentWillReact life-cycle event is no longer supported\")\n }\n if (componentClass[\"__proto__\"] !== PureComponent) {\n if (!prototype.shouldComponentUpdate) {\n prototype.shouldComponentUpdate = observerSCU\n } else if (prototype.shouldComponentUpdate !== observerSCU) {\n // n.b. unequal check, instead of existence check, as @observer might be on superclass as well\n throw new Error(\n \"It is not allowed to use shouldComponentUpdate in observer based components.\"\n )\n }\n }\n\n if (__DEV__) {\n Object.defineProperties(prototype, observablePropDescriptors)\n }\n\n const originalRender = prototype.render\n if (typeof originalRender !== \"function\") {\n const displayName = getDisplayName(componentClass)\n throw new Error(\n `[mobx-react] class component (${displayName}) is missing \\`render\\` method.` +\n `\\n\\`observer\\` requires \\`render\\` being a function defined on prototype.` +\n `\\n\\`render = () => {}\\` or \\`render = function() {}\\` is not supported.`\n )\n }\n\n prototype.render = function () {\n Object.defineProperty(this, \"render\", {\n // There is no safe way to replace render, therefore it's forbidden.\n configurable: false,\n writable: false,\n value: isUsingStaticRendering()\n ? originalRender\n : createReactiveRender.call(this, originalRender)\n })\n return this.render()\n }\n\n const originalComponentDidMount = prototype.componentDidMount\n prototype.componentDidMount = function () {\n if (__DEV__ && this.componentDidMount !== Object.getPrototypeOf(this).componentDidMount) {\n const displayName = getDisplayName(componentClass)\n throw new Error(\n `[mobx-react] \\`observer(${displayName}).componentDidMount\\` must be defined on prototype.` +\n `\\n\\`componentDidMount = () => {}\\` or \\`componentDidMount = function() {}\\` is not supported.`\n )\n }\n\n // `componentDidMount` may not be called at all. React can abandon the instance after `render`.\n // That's why we use finalization registry to dispose reaction created during render.\n // Happens with `<Suspend>` see #3492\n //\n // `componentDidMount` can be called immediately after `componentWillUnmount` without calling `render` in between.\n // Happens with `<StrictMode>`see #3395.\n //\n // If `componentDidMount` is called, it's guaranteed to run synchronously with render (similary to `useLayoutEffect`).\n // Therefore we don't have to worry about external (observable) state being updated before mount (no state version checking).\n //\n // Things may change: \"In the future, React will provide a feature that lets components preserve state between unmounts\"\n\n const admin = getAdministration(this)\n\n admin.mounted = true\n\n // Component instance committed, prevent reaction disposal.\n observerFinalizationRegistry.unregister(this)\n\n // We don't set forceUpdate before mount because it requires a reference to `this`,\n // therefore `this` could NOT be garbage collected before mount,\n // preventing reaction disposal by FinalizationRegistry and leading to memory leak.\n // As an alternative we could have `admin.instanceRef = new WeakRef(this)`, but lets avoid it if possible.\n admin.forceUpdate = () => this.forceUpdate()\n\n if (!admin.reaction || admin.reactionInvalidatedBeforeMount) {\n // Missing reaction:\n // 1. Instance was unmounted (reaction disposed) and immediately remounted without running render #3395.\n // 2. Reaction was disposed by finalization registry before mount. Shouldn't ever happen for class components:\n // `componentDidMount` runs synchronously after render, but our registry are deferred (can't run in between).\n // In any case we lost subscriptions to observables, so we have to create new reaction and re-render to resubscribe.\n // The reaction will be created lazily by following render.\n\n // Reaction invalidated before mount:\n // 1. A descendant's `componenDidMount` invalidated it's parent #3730\n\n admin.forceUpdate()\n }\n return originalComponentDidMount?.apply(this, arguments)\n }\n\n // TODO@major Overly complicated \"patch\" is only needed to support the deprecated @disposeOnUnmount\n patch(prototype, \"componentWillUnmount\", function () {\n if (isUsingStaticRendering()) {\n return\n }\n const admin = getAdministration(this)\n admin.reaction?.dispose()\n admin.reaction = null\n admin.forceUpdate = null\n admin.mounted = false\n admin.reactionInvalidatedBeforeMount = false\n })\n\n return componentClass\n}\n\n// Generates a friendly name for debugging\nfunction getDisplayName(componentClass: ComponentClass) {\n return componentClass.displayName || componentClass.name || \"<component>\"\n}\n\nfunction createReactiveRender(originalRender: any) {\n const boundOriginalRender = originalRender.bind(this)\n\n const admin = getAdministration(this)\n\n function reactiveRender() {\n if (!admin.reaction) {\n // Create reaction lazily to support re-mounting #3395\n admin.reaction = createReaction(admin)\n if (!admin.mounted) {\n // React can abandon this instance and never call `componentDidMount`/`componentWillUnmount`,\n // we have to make sure reaction will be disposed.\n observerFinalizationRegistry.register(this, admin, this)\n }\n }\n\n let error: unknown = undefined\n let renderResult = undefined\n admin.reaction.track(() => {\n try {\n // TODO@major\n // Optimization: replace with _allowStateChangesStart/End (not available in mobx@6.0.0)\n renderResult = _allowStateChanges(false, boundOriginalRender)\n } catch (e) {\n error = e\n }\n })\n if (error) {\n throw error\n }\n return renderResult\n }\n\n return reactiveRender\n}\n\nfunction createReaction(admin: ObserverAdministration) {\n return new Reaction(`${admin.name}.render()`, () => {\n if (!admin.mounted) {\n // This is neccessary to avoid react warning about calling forceUpdate on component that isn't mounted yet.\n // This happens when component is abandoned after render - our reaction is already created and reacts to changes.\n // `componenDidMount` runs synchronously after `render`, so unlike functional component, there is no delay during which the reaction could be invalidated.\n // However `componentDidMount` runs AFTER it's descendants' `componentDidMount`, which CAN invalidate the reaction, see #3730. Therefore remember and forceUpdate on mount.\n admin.reactionInvalidatedBeforeMount = true\n return\n }\n\n try {\n admin.forceUpdate?.()\n } catch (error) {\n admin.reaction?.dispose()\n admin.reaction = null\n }\n })\n}\n\nfunction observerSCU(nextProps: ClassAttributes<any>, nextState: any): boolean {\n if (isUsingStaticRendering()) {\n console.warn(\n \"[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side.\"\n )\n }\n // update on any state changes (as is the default)\n if (this.state !== nextState) {\n return true\n }\n // update if props are shallowly not equal, inspired by PureRenderMixin\n // we could return just 'false' here, and avoid the `skipRender` checks etc\n // however, it is nicer if lifecycle events are triggered like usually,\n // so we return true here if props are shallowly modified.\n return !shallowEqual(this.props, nextProps)\n}\n\nfunction createObservablePropDescriptor(key: \"props\" | \"state\" | \"context\") {\n return {\n configurable: true,\n enumerable: true,\n get() {\n const admin = getAdministration(this)\n const derivation = _getGlobalState().trackingDerivation\n if (derivation && derivation !== admin.reaction) {\n throw new Error(\n `[mobx-react] Cannot read \"${admin.name}.${key}\" in a reactive context, as it isn't observable.\n Please use component lifecycle method to copy the value into a local observable first.\n See https://github.com/mobxjs/mobx/blob/main/packages/mobx-react/README.md#note-on-using-props-and-state-in-derivations`\n )\n }\n return admin[key]\n },\n set(value) {\n getAdministration(this)[key] = value\n }\n }\n}\n","import * as React from \"react\"\nimport { observer as observerLite } from \"mobx-react-lite\"\n\nimport { makeClassComponentObserver } from \"./observerClass\"\nimport { IReactComponent } from \"./types/IReactComponent\"\n\n/**\n * Observer function / decorator\n */\nexport function observer<T extends IReactComponent>(\n component: T,\n context: ClassDecoratorContext\n): void\nexport function observer<T extends IReactComponent>(component: T): T\nexport function observer<T extends IReactComponent>(\n component: T,\n context?: ClassDecoratorContext\n): T {\n if (context && context.kind !== \"class\") {\n throw new Error(\"The @observer decorator can be used on classes only\")\n }\n\n if (\n Object.prototype.isPrototypeOf.call(React.Component, component) ||\n Object.prototype.isPrototypeOf.call(React.PureComponent, component)\n ) {\n // Class component\n return makeClassComponentObserver(component as React.ComponentClass<any, any>) as T\n } else {\n // Function component\n return observerLite(component as React.FunctionComponent<any>) as unknown as T\n }\n}\n","import { observable } from \"mobx\"\nimport { Component } from \"react\"\n\nif (!Component) {\n throw new Error(\"mobx-react requires React to be available\")\n}\n\nif (!observable) {\n throw new Error(\"mobx-react requires mobx to be available\")\n}\n\nexport {\n Observer,\n isUsingStaticRendering,\n enableStaticRendering,\n useLocalObservable,\n _observerFinalizationRegistry,\n clearTimers\n} from \"mobx-react-lite\"\n\nexport { observer } from \"./observer\"\n"],"names":["shallowEqual","objA","objB","is","keysA","Object","keys","keysB","length","i","hasOwnProperty","call","x","y","mobxMixins","Symbol","mobxPatchedDefinition","getMixins","target","methodName","mixins","methodMixins","locks","methods","wrapper","realMethod","args","retVal","undefined","apply","forEach","mx","wrapFunction","fn","patch","mixinMethod","indexOf","push","oldDefinition","getOwnPropertyDescriptor","originalMethod","newDefinition","createDefinition","enumerable","defineProperty","wrappedFunc","get","set","value","configurable","administrationSymbol","isMobXReactObserverSymbol","observablePropDescriptors","process","env","NODE_ENV","props","createObservablePropDescriptor","state","context","getAdministration","component","_component$administra","reaction","mounted","reactionInvalidatedBeforeMount","forceUpdate","name","getDisplayName","constructor","makeClassComponentObserver","componentClass","prototype","displayName","Error","componentWillReact","PureComponent","shouldComponentUpdate","observerSCU","defineProperties","originalRender","render","writable","isUsingStaticRendering","createReactiveRender","originalComponentDidMount","componentDidMount","getPrototypeOf","admin","observerFinalizationRegistry","unregister","arguments","_admin$reaction","dispose","boundOriginalRender","bind","reactiveRender","createReaction","register","error","renderResult","track","_allowStateChanges","e","Reaction","_admin$reaction2","nextProps","nextState","console","warn","key","derivation","_getGlobalState","trackingDerivation","observer","kind","isPrototypeOf","React","Component","observerLite","observable"],"mappings":";;;;;;AAAgB,SAAAA,YAAYA,CAACC,IAAS,EAAEC,IAAS,EAAA;AAC7C;AACA,EAAA,IAAIC,EAAE,CAACF,IAAI,EAAEC,IAAI,CAAC,EAAE;AAChB,IAAA,OAAO,IAAI,CAAA;AACf,GAAA;AACA,EAAA,IAAI,OAAOD,IAAI,KAAK,QAAQ,IAAIA,IAAI,KAAK,IAAI,IAAI,OAAOC,IAAI,KAAK,QAAQ,IAAIA,IAAI,KAAK,IAAI,EAAE;AACxF,IAAA,OAAO,KAAK,CAAA;AAChB,GAAA;AACA,EAAA,MAAME,KAAK,GAAGC,MAAM,CAACC,IAAI,CAACL,IAAI,CAAC,CAAA;AAC/B,EAAA,MAAMM,KAAK,GAAGF,MAAM,CAACC,IAAI,CAACJ,IAAI,CAAC,CAAA;AAC/B,EAAA,IAAIE,KAAK,CAACI,MAAM,KAAKD,KAAK,CAACC,MAAM,EAAE;AAC/B,IAAA,OAAO,KAAK,CAAA;AAChB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