opshot 0.6.0 → 0.6.1
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/README.md +1 -1
- package/dist/{chunk-4JZIOHSP.js → chunk-DOMSA2X7.js} +1 -1
- package/dist/{createMutableState-DJ9dmpR-.d.ts → createMutableState-320Vm2AI.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/react.d.ts +1 -1
- package/dist/react.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -130,7 +130,7 @@ It can't track:
|
|
|
130
130
|
- Own function properties on class instances
|
|
131
131
|
- Non-writable properties that hold an object
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
`strict: true` throws when opshot meets one of these, naming the value that caused it; `strict: false` stores the value untracked. It defaults to true in development and false in production.
|
|
134
134
|
|
|
135
135
|
## Tracked collections
|
|
136
136
|
|
|
@@ -639,7 +639,7 @@ function createMutableState(properties, options) {
|
|
|
639
639
|
if (Object.isFrozen(incoming)) return properties;
|
|
640
640
|
const root = rawOf(incoming);
|
|
641
641
|
if (handleOf(incoming) !== void 0) return proxyOf(incoming);
|
|
642
|
-
const strict = options?.strict !==
|
|
642
|
+
const strict = options?.strict ?? process.env.NODE_ENV !== "production";
|
|
643
643
|
const exempt = !strict || isUnsafeMarked(root);
|
|
644
644
|
const handle = {
|
|
645
645
|
root,
|
|
@@ -17,7 +17,7 @@ interface MutableStateOptions {
|
|
|
17
17
|
*/
|
|
18
18
|
readonly emitOn?: EmissionScheduler;
|
|
19
19
|
/**
|
|
20
|
-
* When true, throws at a dangerous edge, at the cause. Defaults to
|
|
20
|
+
* When true, throws at a dangerous edge, at the cause. Defaults to `process.env.NODE_ENV !== "production"`, so development throws and production tracks what it can.
|
|
21
21
|
*/
|
|
22
22
|
readonly strict?: boolean;
|
|
23
23
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { E as EmissionScheduler, M as MutableStateOptions, c as createMutableState } from './createMutableState-
|
|
1
|
+
export { E as EmissionScheduler, M as MutableStateOptions, c as createMutableState } from './createMutableState-320Vm2AI.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Returns a stable identity key for a value.
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { addressOf, flushWindow, requireHandle, isSameIdentity } from './chunk-
|
|
2
|
-
export { batch, createMutableState, identify, ignore, isSameIdentity, isState, subscribe, unsafeTrack } from './chunk-
|
|
1
|
+
import { addressOf, flushWindow, requireHandle, isSameIdentity } from './chunk-DOMSA2X7.js';
|
|
2
|
+
export { batch, createMutableState, identify, ignore, isSameIdentity, isState, subscribe, unsafeTrack } from './chunk-DOMSA2X7.js';
|
|
3
3
|
|
|
4
4
|
// src/tracked/facadeGuard.ts
|
|
5
5
|
var assertMutableFacade = (facade, mutationKey) => {
|
package/dist/react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType, FC } from 'react';
|
|
2
|
-
import { M as MutableStateOptions } from './createMutableState-
|
|
2
|
+
import { M as MutableStateOptions } from './createMutableState-320Vm2AI.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Wraps a component so it re-renders only when fields it read change.
|
package/dist/react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createMutableState, handlesOf, subscribe, proxyOf, isState, isSameIdentity, rawOf, addressOf, versionOf, isDangerousKind, classifyValue, peelReadProxy, recordOf, registerReadProxyTarget, walkDataEntries, isTrackedEntry, isObjectLike } from './chunk-
|
|
1
|
+
import { createMutableState, handlesOf, subscribe, proxyOf, isState, isSameIdentity, rawOf, addressOf, versionOf, isDangerousKind, classifyValue, peelReadProxy, recordOf, registerReadProxyTarget, walkDataEntries, isTrackedEntry, isObjectLike } from './chunk-DOMSA2X7.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { memo, useState, useReducer, useRef, useEffect, createElement, useLayoutEffect } from 'react';
|
|
4
4
|
|
package/package.json
CHANGED