diff --git a/.changeset/hoist-node-env-check-esm-builds.md b/.changeset/hoist-node-env-check-esm-builds.md deleted file mode 100644 index 97a9c2187..000000000 --- a/.changeset/hoist-node-env-check-esm-builds.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"mobx": patch -"mobx-react": patch -"mobx-react-lite": patch ---- - -perf: evaluate `NODE_ENV` once at module scope in the env-agnostic esm bundles (`dist/.esm.js` and `dist/.mjs`) instead of at every `__DEV__` call site. `process.env` is an exotic object in Node, so each check performed a real environment lookup on hot paths; consumers that execute these files as-is (Node ESM, vitest, SSR) see roughly 10x faster observable writes in dev mode. All env-set artifacts and bundler output are unchanged. diff --git a/.changeset/observable-set-replace-events.md b/.changeset/observable-set-replace-events.md deleted file mode 100644 index 159df9c6d..000000000 --- a/.changeset/observable-set-replace-events.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"mobx": patch ---- - -Fix `ObservableSet.replace` emitting spurious `delete`/`add` events (and triggering reactions) for values that are unchanged. It now only fires `delete` for removed values and `add` for newly added ones, mirroring `ObservableMap.replace`. - -Note: because `replace` no longer clears and re-adds every value, the iteration order after `replace` changes in a (subtle but observable) way. Surviving values now keep their original relative position and newly added values are appended, instead of the whole set being reordered to match the argument. For example, `set(["a", "b", "c"]).replace(["d", "b", "a"])` previously iterated as `d, b, a`, and now iterates as `a, b, d`. This is arguably the more correct behavior (unchanged values are genuinely unchanged), but if you relied on `replace` reordering the set to match its argument, you may need to adjust. diff --git a/packages/mobx-react-lite/CHANGELOG.md b/packages/mobx-react-lite/CHANGELOG.md index 4ac39062d..11fdde76f 100644 --- a/packages/mobx-react-lite/CHANGELOG.md +++ b/packages/mobx-react-lite/CHANGELOG.md @@ -1,5 +1,11 @@ # mobx-react-lite +## 5.0.2 + +### Patch Changes + +- [`ec1b708026c1578e1c1f6c7bd90be18b26f7ce85`](https://github.com/mobxjs/mobx/commit/ec1b708026c1578e1c1f6c7bd90be18b26f7ce85) [#4695](https://github.com/mobxjs/mobx/pull/4695) Thanks [@gesposito](https://github.com/gesposito)! - perf: evaluate `NODE_ENV` once at module scope in the env-agnostic esm bundles (`dist/.esm.js` and `dist/.mjs`) instead of at every `__DEV__` call site. `process.env` is an exotic object in Node, so each check performed a real environment lookup on hot paths; consumers that execute these files as-is (Node ESM, vitest, SSR) see roughly 10x faster observable writes in dev mode. All env-set artifacts and bundler output are unchanged. + ## 5.0.1 ### Patch Changes diff --git a/packages/mobx-react-lite/package.json b/packages/mobx-react-lite/package.json index 9ac0029c1..85b6d8e87 100644 --- a/packages/mobx-react-lite/package.json +++ b/packages/mobx-react-lite/package.json @@ -1,6 +1,6 @@ { "name": "mobx-react-lite", - "version": "5.0.1", + "version": "5.0.2", "description": "Lightweight React bindings for MobX based on function components and Hooks", "source": "src/index.ts", "type": "commonjs", @@ -58,7 +58,7 @@ "react": "^18 || ^19" }, "devDependencies": { - "mobx": "^7.0.1" + "mobx": "^7.0.2" }, "keywords": [ "mobx", diff --git a/packages/mobx-react/CHANGELOG.md b/packages/mobx-react/CHANGELOG.md index 68a0a12fc..5b876b98e 100644 --- a/packages/mobx-react/CHANGELOG.md +++ b/packages/mobx-react/CHANGELOG.md @@ -1,5 +1,14 @@ # mobx-react +## 10.0.1 + +### Patch Changes + +- [`ec1b708026c1578e1c1f6c7bd90be18b26f7ce85`](https://github.com/mobxjs/mobx/commit/ec1b708026c1578e1c1f6c7bd90be18b26f7ce85) [#4695](https://github.com/mobxjs/mobx/pull/4695) Thanks [@gesposito](https://github.com/gesposito)! - perf: evaluate `NODE_ENV` once at module scope in the env-agnostic esm bundles (`dist/.esm.js` and `dist/.mjs`) instead of at every `__DEV__` call site. `process.env` is an exotic object in Node, so each check performed a real environment lookup on hot paths; consumers that execute these files as-is (Node ESM, vitest, SSR) see roughly 10x faster observable writes in dev mode. All env-set artifacts and bundler output are unchanged. + +- Updated dependencies [[`ec1b708026c1578e1c1f6c7bd90be18b26f7ce85`](https://github.com/mobxjs/mobx/commit/ec1b708026c1578e1c1f6c7bd90be18b26f7ce85)]: + - mobx-react-lite@5.0.2 + ## 10.0.0 ### Major Changes diff --git a/packages/mobx-react/package.json b/packages/mobx-react/package.json index a07016432..118a24227 100644 --- a/packages/mobx-react/package.json +++ b/packages/mobx-react/package.json @@ -1,6 +1,6 @@ { "name": "mobx-react", - "version": "10.0.0", + "version": "10.0.1", "description": "React bindings for MobX. Create fully reactive components.", "source": "src/index.ts", "type": "commonjs", @@ -55,15 +55,15 @@ }, "homepage": "https://mobx.js.org", "dependencies": { - "mobx-react-lite": "^5.0.0" + "mobx-react-lite": "^5.0.2" }, "peerDependencies": { "mobx": "^7.0.0", "react": "^18 || ^19" }, "devDependencies": { - "mobx": "^7.0.0", - "mobx-react-lite": "^5.0.0" + "mobx": "^7.0.2", + "mobx-react-lite": "^5.0.2" }, "keywords": [ "mobx", diff --git a/packages/mobx/CHANGELOG.md b/packages/mobx/CHANGELOG.md index 9c84cbbce..7a33afde1 100644 --- a/packages/mobx/CHANGELOG.md +++ b/packages/mobx/CHANGELOG.md @@ -1,5 +1,15 @@ # mobx +## 7.0.2 + +### Patch Changes + +- [`ec1b708026c1578e1c1f6c7bd90be18b26f7ce85`](https://github.com/mobxjs/mobx/commit/ec1b708026c1578e1c1f6c7bd90be18b26f7ce85) [#4695](https://github.com/mobxjs/mobx/pull/4695) Thanks [@gesposito](https://github.com/gesposito)! - perf: evaluate `NODE_ENV` once at module scope in the env-agnostic esm bundles (`dist/.esm.js` and `dist/.mjs`) instead of at every `__DEV__` call site. `process.env` is an exotic object in Node, so each check performed a real environment lookup on hot paths; consumers that execute these files as-is (Node ESM, vitest, SSR) see roughly 10x faster observable writes in dev mode. All env-set artifacts and bundler output are unchanged. + +- [`6d8b5fa6c7596d7e5b16e55e3121d81c0c5bb21a`](https://github.com/mobxjs/mobx/commit/6d8b5fa6c7596d7e5b16e55e3121d81c0c5bb21a) [#4672](https://github.com/mobxjs/mobx/pull/4672) Thanks [@chatman-media](https://github.com/chatman-media)! - Fix `ObservableSet.replace` emitting spurious `delete`/`add` events (and triggering reactions) for values that are unchanged. It now only fires `delete` for removed values and `add` for newly added ones, mirroring `ObservableMap.replace`. + + Note: because `replace` no longer clears and re-adds every value, the iteration order after `replace` changes in a (subtle but observable) way. Surviving values now keep their original relative position and newly added values are appended, instead of the whole set being reordered to match the argument. For example, `set(["a", "b", "c"]).replace(["d", "b", "a"])` previously iterated as `d, b, a`, and now iterates as `a, b, d`. This is arguably the more correct behavior (unchanged values are genuinely unchanged), but if you relied on `replace` reordering the set to match its argument, you may need to adjust. + ## 7.0.1 ### Patch Changes diff --git a/packages/mobx/package.json b/packages/mobx/package.json index 447973a6c..438c1467c 100644 --- a/packages/mobx/package.json +++ b/packages/mobx/package.json @@ -1,6 +1,6 @@ { "name": "mobx", - "version": "7.0.1", + "version": "7.0.2", "description": "Simple, scalable state management.", "source": "src/mobx.ts", "type": "commonjs",