diff --git a/.changeset/fix-minified-error-link.md b/.changeset/fix-minified-error-link.md deleted file mode 100644 index ac68f01ee..000000000 --- a/.changeset/fix-minified-error-link.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"mobx": patch ---- - -Shorten minified error URL to reduce production bundle size. diff --git a/.changeset/mobx-7-react-10.md b/.changeset/mobx-7-react-10.md deleted file mode 100644 index 689438503..000000000 --- a/.changeset/mobx-7-react-10.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -"mobx": major -"mobx-react-lite": major -"mobx-react": major ---- - -Release MobX 7, mobx-react-lite 5, and mobx-react 10. - -Bundle sizes are down: ESM prod 17.02 KiB gzip -> 13.96 KiB gzip; a minimal tree-shaken example is 10.32 KiB gzip now. - -It removes long-deprecated compatibility paths and keeps the React bindings split between `mobx-react-lite` for function components and `mobx-react` for class-component support. - -## MobX 7 - -MobX 7 is a cleanup release focused on the modern runtime and decorator model. - -- MobX now always uses Proxy-backed observable objects and arrays. The ES5/non-proxy fallback has been removed. -- `configure({ useProxies: ... })` is no longer supported. -- `{ proxy: false }` options for `observable`, `observable.object`, and `observable.array` are no longer supported. -- Legacy decorators are no longer supported. -- Namespaced annotation and comparer properties now use named exports to reduce bundle size: - -| Removed API | Replacement | -| --------------------- | ------------------- | -| `observable.ref` | `observableRef` | -| `observable.shallow` | `observableShallow` | -| `observable.deep` | `observableDeep` | -| `observable.struct` | `observableStruct` | -| `computed.struct` | `computedStruct` | -| `action.bound` | `actionBound` | -| `flow.bound` | `flowBound` | -| `comparer.identity` | `compareIdentity` | -| `comparer.default` | `compareDefault` | -| `comparer.structural` | `compareStructural` | -| `comparer.shallow` | `compareShallow` | - -- The public `trace` API and its related runtime support have been removed. Use `toJS`, `getDependencyTree`, `getObserverTree`, `spy` or `mobx-log` package for debugging. - -## mobx-react-lite 5 and mobx-react 10 - -mobx-react-lite 5 and mobx-react 10 require MobX 7 and React 18 or later. - -`mobx-react-lite` remains the function-component package. `mobx-react` remains a thin wrapper around `mobx-react-lite` that adds class component and Stage 3 `@observer` class decorator support. - -- Keep function-component imports on `mobx-react-lite` if you do not need class component support. -- Use `mobx-react` when you need class components or `@observer` class decorators. -- `mobx-react-lite` supports function components and `forwardRef`; `mobx-react` delegates function components to `mobx-react-lite` and handles classes itself. -- Remove React batching imports, including the stale React Native batching deep import. React 18+ renderers handle batching. - -The recommended public React binding surface for both packages is: - -- `observer` -- `Observer` -- `useLocalObservable` -- `enableStaticRendering` -- `isUsingStaticRendering` - -The following APIs have been removed from the React binding packages: - -- `Provider`, `inject`, and `MobXProviderContext`; use `React.createContext` directly. -- `disposeOnUnmount`; dispose reactions in `componentWillUnmount` or return cleanup functions from `useEffect`. -- `PropTypes`; use TypeScript or the regular `prop-types` package. -- `useObserver`; wrap components with `observer` or use ``. -- `useLocalStore`; use `useLocalObservable`. -- `useAsObservableSource`; synchronize values from props into local observable state explicitly. -- `useStaticRendering`; use `enableStaticRendering`. -- `observerBatching`, `isObserverBatched`, `batchingForReactDom`, `batchingOptOut`, and `batchingForReactNative`; remove these imports because React 18+ renderers handle batching. -- Deprecated `observer(fn, { forwardRef: true })`; pass an already-created `React.forwardRef(...)` component to `observer` instead. -- Legacy function-component `contextTypes` handling. diff --git a/packages/mobx-react-lite/CHANGELOG.md b/packages/mobx-react-lite/CHANGELOG.md index f86b625aa..67bf3e54b 100644 --- a/packages/mobx-react-lite/CHANGELOG.md +++ b/packages/mobx-react-lite/CHANGELOG.md @@ -1,5 +1,73 @@ # mobx-react-lite +## 5.0.0 + +### Major Changes + +- [`1926c69f53168619d688f348aa587e8f3ae579ae`](https://github.com/mobxjs/mobx/commit/1926c69f53168619d688f348aa587e8f3ae579ae) [#4671](https://github.com/mobxjs/mobx/pull/4671) Thanks [@kubk](https://github.com/kubk)! - Release MobX 7, mobx-react-lite 5, and mobx-react 10. + + Bundle sizes are down: ESM prod 17.02 KiB gzip -> 13.96 KiB gzip; a minimal tree-shaken example is 10.32 KiB gzip now. + + It removes long-deprecated compatibility paths and keeps the React bindings split between `mobx-react-lite` for function components and `mobx-react` for class-component support. + + ## MobX 7 + + MobX 7 is a cleanup release focused on the modern runtime and decorator model. + + - MobX now always uses Proxy-backed observable objects and arrays. The ES5/non-proxy fallback has been removed. + - `configure({ useProxies: ... })` is no longer supported. + - `{ proxy: false }` options for `observable`, `observable.object`, and `observable.array` are no longer supported. + - Legacy decorators are no longer supported. + - Namespaced annotation and comparer properties now use named exports to reduce bundle size: + + | Removed API | Replacement | + | --------------------- | ------------------- | + | `observable.ref` | `observableRef` | + | `observable.shallow` | `observableShallow` | + | `observable.deep` | `observableDeep` | + | `observable.struct` | `observableStruct` | + | `computed.struct` | `computedStruct` | + | `action.bound` | `actionBound` | + | `flow.bound` | `flowBound` | + | `comparer.identity` | `compareIdentity` | + | `comparer.default` | `compareDefault` | + | `comparer.structural` | `compareStructural` | + | `comparer.shallow` | `compareShallow` | + + - The public `trace` API and its related runtime support have been removed. Use `toJS`, `getDependencyTree`, `getObserverTree`, `spy` or `mobx-log` package for debugging. + + ## mobx-react-lite 5 and mobx-react 10 + + mobx-react-lite 5 and mobx-react 10 require MobX 7 and React 18 or later. + + `mobx-react-lite` remains the function-component package. `mobx-react` remains a thin wrapper around `mobx-react-lite` that adds class component and Stage 3 `@observer` class decorator support. + + - Keep function-component imports on `mobx-react-lite` if you do not need class component support. + - Use `mobx-react` when you need class components or `@observer` class decorators. + - `mobx-react-lite` supports function components and `forwardRef`; `mobx-react` delegates function components to `mobx-react-lite` and handles classes itself. + - Remove React batching imports, including the stale React Native batching deep import. React 18+ renderers handle batching. + + The recommended public React binding surface for both packages is: + + - `observer` + - `Observer` + - `useLocalObservable` + - `enableStaticRendering` + - `isUsingStaticRendering` + + The following APIs have been removed from the React binding packages: + + - `Provider`, `inject`, and `MobXProviderContext`; use `React.createContext` directly. + - `disposeOnUnmount`; dispose reactions in `componentWillUnmount` or return cleanup functions from `useEffect`. + - `PropTypes`; use TypeScript or the regular `prop-types` package. + - `useObserver`; wrap components with `observer` or use ``. + - `useLocalStore`; use `useLocalObservable`. + - `useAsObservableSource`; synchronize values from props into local observable state explicitly. + - `useStaticRendering`; use `enableStaticRendering`. + - `observerBatching`, `isObserverBatched`, `batchingForReactDom`, `batchingOptOut`, and `batchingForReactNative`; remove these imports because React 18+ renderers handle batching. + - Deprecated `observer(fn, { forwardRef: true })`; pass an already-created `React.forwardRef(...)` component to `observer` instead. + - Legacy function-component `contextTypes` handling. + ## 4.1.1 ### Patch Changes diff --git a/packages/mobx-react-lite/package.json b/packages/mobx-react-lite/package.json index 8df75e7d4..a2a95b413 100644 --- a/packages/mobx-react-lite/package.json +++ b/packages/mobx-react-lite/package.json @@ -1,6 +1,6 @@ { "name": "mobx-react-lite", - "version": "4.1.1", + "version": "5.0.0", "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": "^6.15.0" + "mobx": "^7.0.0" }, "keywords": [ "mobx", diff --git a/packages/mobx-react/CHANGELOG.md b/packages/mobx-react/CHANGELOG.md index aa4a34cf6..68a0a12fc 100644 --- a/packages/mobx-react/CHANGELOG.md +++ b/packages/mobx-react/CHANGELOG.md @@ -1,5 +1,78 @@ # mobx-react +## 10.0.0 + +### Major Changes + +- [`1926c69f53168619d688f348aa587e8f3ae579ae`](https://github.com/mobxjs/mobx/commit/1926c69f53168619d688f348aa587e8f3ae579ae) [#4671](https://github.com/mobxjs/mobx/pull/4671) Thanks [@kubk](https://github.com/kubk)! - Release MobX 7, mobx-react-lite 5, and mobx-react 10. + + Bundle sizes are down: ESM prod 17.02 KiB gzip -> 13.96 KiB gzip; a minimal tree-shaken example is 10.32 KiB gzip now. + + It removes long-deprecated compatibility paths and keeps the React bindings split between `mobx-react-lite` for function components and `mobx-react` for class-component support. + + ## MobX 7 + + MobX 7 is a cleanup release focused on the modern runtime and decorator model. + + - MobX now always uses Proxy-backed observable objects and arrays. The ES5/non-proxy fallback has been removed. + - `configure({ useProxies: ... })` is no longer supported. + - `{ proxy: false }` options for `observable`, `observable.object`, and `observable.array` are no longer supported. + - Legacy decorators are no longer supported. + - Namespaced annotation and comparer properties now use named exports to reduce bundle size: + + | Removed API | Replacement | + | --------------------- | ------------------- | + | `observable.ref` | `observableRef` | + | `observable.shallow` | `observableShallow` | + | `observable.deep` | `observableDeep` | + | `observable.struct` | `observableStruct` | + | `computed.struct` | `computedStruct` | + | `action.bound` | `actionBound` | + | `flow.bound` | `flowBound` | + | `comparer.identity` | `compareIdentity` | + | `comparer.default` | `compareDefault` | + | `comparer.structural` | `compareStructural` | + | `comparer.shallow` | `compareShallow` | + + - The public `trace` API and its related runtime support have been removed. Use `toJS`, `getDependencyTree`, `getObserverTree`, `spy` or `mobx-log` package for debugging. + + ## mobx-react-lite 5 and mobx-react 10 + + mobx-react-lite 5 and mobx-react 10 require MobX 7 and React 18 or later. + + `mobx-react-lite` remains the function-component package. `mobx-react` remains a thin wrapper around `mobx-react-lite` that adds class component and Stage 3 `@observer` class decorator support. + + - Keep function-component imports on `mobx-react-lite` if you do not need class component support. + - Use `mobx-react` when you need class components or `@observer` class decorators. + - `mobx-react-lite` supports function components and `forwardRef`; `mobx-react` delegates function components to `mobx-react-lite` and handles classes itself. + - Remove React batching imports, including the stale React Native batching deep import. React 18+ renderers handle batching. + + The recommended public React binding surface for both packages is: + + - `observer` + - `Observer` + - `useLocalObservable` + - `enableStaticRendering` + - `isUsingStaticRendering` + + The following APIs have been removed from the React binding packages: + + - `Provider`, `inject`, and `MobXProviderContext`; use `React.createContext` directly. + - `disposeOnUnmount`; dispose reactions in `componentWillUnmount` or return cleanup functions from `useEffect`. + - `PropTypes`; use TypeScript or the regular `prop-types` package. + - `useObserver`; wrap components with `observer` or use ``. + - `useLocalStore`; use `useLocalObservable`. + - `useAsObservableSource`; synchronize values from props into local observable state explicitly. + - `useStaticRendering`; use `enableStaticRendering`. + - `observerBatching`, `isObserverBatched`, `batchingForReactDom`, `batchingOptOut`, and `batchingForReactNative`; remove these imports because React 18+ renderers handle batching. + - Deprecated `observer(fn, { forwardRef: true })`; pass an already-created `React.forwardRef(...)` component to `observer` instead. + - Legacy function-component `contextTypes` handling. + +### Patch Changes + +- Updated dependencies [[`1926c69f53168619d688f348aa587e8f3ae579ae`](https://github.com/mobxjs/mobx/commit/1926c69f53168619d688f348aa587e8f3ae579ae)]: + - mobx-react-lite@5.0.0 + ## 9.2.2 ### Patch Changes diff --git a/packages/mobx-react/package.json b/packages/mobx-react/package.json index 46a2274ef..a07016432 100644 --- a/packages/mobx-react/package.json +++ b/packages/mobx-react/package.json @@ -1,6 +1,6 @@ { "name": "mobx-react", - "version": "9.2.2", + "version": "10.0.0", "description": "React bindings for MobX. Create fully reactive components.", "source": "src/index.ts", "type": "commonjs", @@ -62,8 +62,8 @@ "react": "^18 || ^19" }, "devDependencies": { - "mobx": "^6.15.0", - "mobx-react-lite": "^4.1.1" + "mobx": "^7.0.0", + "mobx-react-lite": "^5.0.0" }, "keywords": [ "mobx", diff --git a/packages/mobx/CHANGELOG.md b/packages/mobx/CHANGELOG.md index 102c06c0f..b22b79769 100644 --- a/packages/mobx/CHANGELOG.md +++ b/packages/mobx/CHANGELOG.md @@ -1,5 +1,77 @@ # mobx +## 7.0.0 + +### Major Changes + +- [`1926c69f53168619d688f348aa587e8f3ae579ae`](https://github.com/mobxjs/mobx/commit/1926c69f53168619d688f348aa587e8f3ae579ae) [#4671](https://github.com/mobxjs/mobx/pull/4671) Thanks [@kubk](https://github.com/kubk)! - Release MobX 7, mobx-react-lite 5, and mobx-react 10. + + Bundle sizes are down: ESM prod 17.02 KiB gzip -> 13.96 KiB gzip; a minimal tree-shaken example is 10.32 KiB gzip now. + + It removes long-deprecated compatibility paths and keeps the React bindings split between `mobx-react-lite` for function components and `mobx-react` for class-component support. + + ## MobX 7 + + MobX 7 is a cleanup release focused on the modern runtime and decorator model. + + - MobX now always uses Proxy-backed observable objects and arrays. The ES5/non-proxy fallback has been removed. + - `configure({ useProxies: ... })` is no longer supported. + - `{ proxy: false }` options for `observable`, `observable.object`, and `observable.array` are no longer supported. + - Legacy decorators are no longer supported. + - Namespaced annotation and comparer properties now use named exports to reduce bundle size: + + | Removed API | Replacement | + | --------------------- | ------------------- | + | `observable.ref` | `observableRef` | + | `observable.shallow` | `observableShallow` | + | `observable.deep` | `observableDeep` | + | `observable.struct` | `observableStruct` | + | `computed.struct` | `computedStruct` | + | `action.bound` | `actionBound` | + | `flow.bound` | `flowBound` | + | `comparer.identity` | `compareIdentity` | + | `comparer.default` | `compareDefault` | + | `comparer.structural` | `compareStructural` | + | `comparer.shallow` | `compareShallow` | + + - The public `trace` API and its related runtime support have been removed. Use `toJS`, `getDependencyTree`, `getObserverTree`, `spy` or `mobx-log` package for debugging. + + ## mobx-react-lite 5 and mobx-react 10 + + mobx-react-lite 5 and mobx-react 10 require MobX 7 and React 18 or later. + + `mobx-react-lite` remains the function-component package. `mobx-react` remains a thin wrapper around `mobx-react-lite` that adds class component and Stage 3 `@observer` class decorator support. + + - Keep function-component imports on `mobx-react-lite` if you do not need class component support. + - Use `mobx-react` when you need class components or `@observer` class decorators. + - `mobx-react-lite` supports function components and `forwardRef`; `mobx-react` delegates function components to `mobx-react-lite` and handles classes itself. + - Remove React batching imports, including the stale React Native batching deep import. React 18+ renderers handle batching. + + The recommended public React binding surface for both packages is: + + - `observer` + - `Observer` + - `useLocalObservable` + - `enableStaticRendering` + - `isUsingStaticRendering` + + The following APIs have been removed from the React binding packages: + + - `Provider`, `inject`, and `MobXProviderContext`; use `React.createContext` directly. + - `disposeOnUnmount`; dispose reactions in `componentWillUnmount` or return cleanup functions from `useEffect`. + - `PropTypes`; use TypeScript or the regular `prop-types` package. + - `useObserver`; wrap components with `observer` or use ``. + - `useLocalStore`; use `useLocalObservable`. + - `useAsObservableSource`; synchronize values from props into local observable state explicitly. + - `useStaticRendering`; use `enableStaticRendering`. + - `observerBatching`, `isObserverBatched`, `batchingForReactDom`, `batchingOptOut`, and `batchingForReactNative`; remove these imports because React 18+ renderers handle batching. + - Deprecated `observer(fn, { forwardRef: true })`; pass an already-created `React.forwardRef(...)` component to `observer` instead. + - Legacy function-component `contextTypes` handling. + +### Patch Changes + +- [`979d267d569734dc3cb969ed1880ed68bb79f1b5`](https://github.com/mobxjs/mobx/commit/979d267d569734dc3cb969ed1880ed68bb79f1b5) [#4677](https://github.com/mobxjs/mobx/pull/4677) Thanks [@kubk](https://github.com/kubk)! - Shorten minified error URL to reduce production bundle size. + ## 6.16.1 ### Patch Changes diff --git a/packages/mobx/package.json b/packages/mobx/package.json index bd49219ce..d7a1ed869 100644 --- a/packages/mobx/package.json +++ b/packages/mobx/package.json @@ -1,6 +1,6 @@ { "name": "mobx", - "version": "6.16.1", + "version": "7.0.0", "description": "Simple, scalable state management.", "source": "src/mobx.ts", "type": "commonjs",