-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
MobX 7 #4671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kubk
wants to merge
82
commits into
mobxjs:main
Choose a base branch
from
kubk:mobx-v7
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
MobX 7 #4671
Changes from all commits
Commits
Show all changes
82 commits
Select commit
Hold shift + click to select a range
a786288
Set up bundle check
kubk 1af94f9
Remove legacy MobX runtime support
kubk 8a41cac
Fold lite React bindings into mobx-react
kubk 21e3add
Remove mobx-react-lite workspace
kubk bded89d
Update docs for MobX 7
kubk 06f55fb
Restore actions docs from main
kubk 79a4fce
Clean up MobX 7 docs wording
kubk 7a468f7
Trim Proxy support docs wording
kubk fda8075
Refine installation guide wording
kubk 846b1d5
Remove redundant decorator cleanup note
kubk 1385f47
cleanup
kubk 5250ff6
Tighten MobX 7 migration guide
kubk 1a08071
cleanup
kubk e85070e
cleanup
kubk 303629b
cleanup
kubk c015884
cleanup
kubk fc1d127
cleanup
kubk 7fa2aad
stable formatting on installation
kubk 0157171
Restore migrated mobx-react-lite tests
kubk 9a4fb7c
Remove batching
kubk 92fd545
Add react batching tests
kubk ae82d15
cleanup test
kubk 65ac62e
Remove useless alias
kubk 37d6fe1
better changeset
kubk fd999c2
better changeset [skip ci]
kubk d4e727e
wording [skip ci]
kubk b92c9c8
Centralize mobx-react test cleanup
kubk 73cb627
Switch to plain rollup
kubk 80e06be
Bring back mobx-react-lite
kubk b247803
cleanup
kubk 59cfba0
Fix observer test type errors
kubk cc5edca
migration 7 cleanup [skip ci]
kubk f1eda94
cleanu p
kubk 7770107
Fix TS
kubk 581e837
clean up [skip ci]
kubk dc2ad2e
f [skip ci]
kubk e697863
cross update required deps
kubk 335bdce
f
kubk 42216aa
shorten diff
kubk 8a69572
cleanup
kubk 9ff6ee4
Potential fix for pull request finding
kubk e794298
Fix mobx-react test source import
kubk b4dd4ef
Fix copilot warning
kubk 484a506
Merge branch 'main' into mobx-v7
kubk 334d857
Shrink dev deps
kubk 51c0cda
Simplify test
kubk 4f52f08
don't deep-import mobx internals in size comparison script
kubk 2931a64
Fix MobX 7 peer dependency ranges
kubk d786df9
Update trace note
kubk efa2640
wording [skip ci]
kubk d93ac47
Simplify decorator types / factories
kubk 494d28d
Remove outdated errors
kubk f74e920
Correct cross deps + drop perf script param
kubk 493ab28
Version packages for MobX 7
kubk 05c7f4d
Remove the fallback for the old makeObservable usage without the seco…
kubk 4eca3b9
Fix alias
kubk feb47f4
Revert "Version packages for MobX 7"
kubk 2d31b3f
Keep prerelease dev deps installable
kubk 9389778
Address become observed feedback
kubk f582627
Hoist dev deps
kubk 07c4d22
Unify rollup config creation
kubk db9e001
All configs to .mjs
kubk 4e2267e
Clean up build
kubk 8cdd873
Even smaller bundle size
kubk 1b606a3
Move size check to the root
kubk 206d136
Fix check size CI
kubk 648a343
resurrect benchmarks in tests
kubk e08d360
Further reduce bundlesize
kubk 0c95480
Remove namespaced annotations / comparers
kubk 5f22cd4
Merge remote-tracking branch 'origin/main' into mobx-v7
kubk 7a8746f
reflect new bundlesize improvements
kubk f18b754
rename comparer* -> compare*
kubk a0c3035
upd changeset
kubk 021200b
clarify changeset [skip ci]
kubk dbd321f
clean up
kubk 17b89a8
Use assign alias to trim down the bundle
kubk 76f814e
Shorten errors & flow names in prod
kubk 8b1393c
drop unreachable branch
kubk 8eb4e1f
restore formatting
kubk 3b1a872
http isn't required
kubk fbbb0f1
Reduce tree-shaken Mobx size to ~10kb gzip
kubk 30eef8f
Merge branch 'main' into mobx-v7
kubk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| --- | ||
| "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 `<Observer>`. | ||
| - `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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.