mobx-react-lite
Advanced tools
Comparing version 3.1.4 to 3.1.5
# mobx-react-lite | ||
## 3.1.5 | ||
### Patch Changes | ||
- [`01a050f7`](https://github.com/mobxjs/mobx/commit/01a050f7603183e6833b7fd948adb4fbe1437f5a) Thanks [@FredyC](https://github.com/FredyC)! - Fix use of react-dom vs react-native | ||
The `es` folder content is compiled only without transpilation to keep `utils/reactBatchedUpdates` which exists in DOM and RN versions. The bundled `esm` is still kept around too, especially the prod/dev ones that should be utilized in modern browser environments. | ||
## 3.1.4 | ||
@@ -4,0 +12,0 @@ |
@@ -1,1 +0,29 @@ | ||
export * from "../dist/mobxreactlite.esm.development.js" | ||
import "./utils/assertEnvironment"; | ||
import { unstable_batchedUpdates as batch } from "./utils/reactBatchedUpdates"; | ||
import { observerBatching } from "./utils/observerBatching"; | ||
import { useDeprecated } from "./utils/utils"; | ||
import { useObserver as useObserverOriginal } from "./useObserver"; | ||
import { enableStaticRendering } from "./staticRendering"; | ||
observerBatching(batch); | ||
export { isUsingStaticRendering, enableStaticRendering } from "./staticRendering"; | ||
export { observer } from "./observer"; | ||
export { Observer } from "./ObserverComponent"; | ||
export { useLocalObservable } from "./useLocalObservable"; | ||
export { useLocalStore } from "./useLocalStore"; | ||
export { useAsObservableSource } from "./useAsObservableSource"; | ||
export { resetCleanupScheduleForTests as clearTimers } from "./utils/reactionCleanupTracking"; | ||
export function useObserver(fn, baseComponentName) { | ||
if (baseComponentName === void 0) { baseComponentName = "observed"; } | ||
if ("production" !== process.env.NODE_ENV) { | ||
useDeprecated("[mobx-react-lite] 'useObserver(fn)' is deprecated. Use `<Observer>{fn}</Observer>` instead, or wrap the entire component in `observer`."); | ||
} | ||
return useObserverOriginal(fn, baseComponentName); | ||
} | ||
export { isObserverBatched, observerBatching } from "./utils/observerBatching"; | ||
export function useStaticRendering(enable) { | ||
if ("production" !== process.env.NODE_ENV) { | ||
console.warn("[mobx-react-lite] 'useStaticRendering' is deprecated, use 'enableStaticRendering' instead"); | ||
} | ||
enableStaticRendering(enable); | ||
} | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,44 @@ | ||
// For the compatibility with current major, should be removed in next one | ||
export * from "../dist/mobxreactlite.cjs.development.js" | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.useStaticRendering = exports.observerBatching = exports.isObserverBatched = exports.useObserver = exports.clearTimers = exports.useAsObservableSource = exports.useLocalStore = exports.useLocalObservable = exports.Observer = exports.observer = exports.enableStaticRendering = exports.isUsingStaticRendering = void 0; | ||
require("./utils/assertEnvironment"); | ||
var reactBatchedUpdates_1 = require("./utils/reactBatchedUpdates"); | ||
var observerBatching_1 = require("./utils/observerBatching"); | ||
var utils_1 = require("./utils/utils"); | ||
var useObserver_1 = require("./useObserver"); | ||
var staticRendering_1 = require("./staticRendering"); | ||
observerBatching_1.observerBatching(reactBatchedUpdates_1.unstable_batchedUpdates); | ||
var staticRendering_2 = require("./staticRendering"); | ||
Object.defineProperty(exports, "isUsingStaticRendering", { enumerable: true, get: function () { return staticRendering_2.isUsingStaticRendering; } }); | ||
Object.defineProperty(exports, "enableStaticRendering", { enumerable: true, get: function () { return staticRendering_2.enableStaticRendering; } }); | ||
var observer_1 = require("./observer"); | ||
Object.defineProperty(exports, "observer", { enumerable: true, get: function () { return observer_1.observer; } }); | ||
var ObserverComponent_1 = require("./ObserverComponent"); | ||
Object.defineProperty(exports, "Observer", { enumerable: true, get: function () { return ObserverComponent_1.Observer; } }); | ||
var useLocalObservable_1 = require("./useLocalObservable"); | ||
Object.defineProperty(exports, "useLocalObservable", { enumerable: true, get: function () { return useLocalObservable_1.useLocalObservable; } }); | ||
var useLocalStore_1 = require("./useLocalStore"); | ||
Object.defineProperty(exports, "useLocalStore", { enumerable: true, get: function () { return useLocalStore_1.useLocalStore; } }); | ||
var useAsObservableSource_1 = require("./useAsObservableSource"); | ||
Object.defineProperty(exports, "useAsObservableSource", { enumerable: true, get: function () { return useAsObservableSource_1.useAsObservableSource; } }); | ||
var reactionCleanupTracking_1 = require("./utils/reactionCleanupTracking"); | ||
Object.defineProperty(exports, "clearTimers", { enumerable: true, get: function () { return reactionCleanupTracking_1.resetCleanupScheduleForTests; } }); | ||
function useObserver(fn, baseComponentName) { | ||
if (baseComponentName === void 0) { baseComponentName = "observed"; } | ||
if ("production" !== process.env.NODE_ENV) { | ||
utils_1.useDeprecated("[mobx-react-lite] 'useObserver(fn)' is deprecated. Use `<Observer>{fn}</Observer>` instead, or wrap the entire component in `observer`."); | ||
} | ||
return useObserver_1.useObserver(fn, baseComponentName); | ||
} | ||
exports.useObserver = useObserver; | ||
var observerBatching_2 = require("./utils/observerBatching"); | ||
Object.defineProperty(exports, "isObserverBatched", { enumerable: true, get: function () { return observerBatching_2.isObserverBatched; } }); | ||
Object.defineProperty(exports, "observerBatching", { enumerable: true, get: function () { return observerBatching_2.observerBatching; } }); | ||
function useStaticRendering(enable) { | ||
if ("production" !== process.env.NODE_ENV) { | ||
console.warn("[mobx-react-lite] 'useStaticRendering' is deprecated, use 'enableStaticRendering' instead"); | ||
} | ||
staticRendering_1.enableStaticRendering(enable); | ||
} | ||
exports.useStaticRendering = useStaticRendering; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "mobx-react-lite", | ||
"version": "3.1.4", | ||
"version": "3.1.5", | ||
"description": "Lightweight React bindings for MobX based on React 16.8+ and Hooks", | ||
@@ -11,4 +11,4 @@ "source": "src/index.ts", | ||
"jsnext:main": "dist/mobxreactlite.esm.production.min.js", | ||
"module": "dist/mobxreactlite.esm.js", | ||
"react-native": "dist/mobxreactlite.esm.js", | ||
"module": "es/index.js", | ||
"react-native": "es/index.js", | ||
"types": "dist/index.d.ts", | ||
@@ -73,6 +73,8 @@ "typings": "dist/index.d.ts", | ||
"build:test": "yarn build --target test", | ||
"build:cjs": "tsc --project tsconfig.build.cjs.json", | ||
"build:es": "tsc --project tsconfig.build.es.json", | ||
"test": "jest", | ||
"test:size": "yarn import-size --report . observer useLocalObservable", | ||
"prepublish": "yarn build --target publish" | ||
"prepublish": "yarn build --target publish && yarn build:cjs && yarn build:es" | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
467126
136
3918
0
22