Closed kubk closed 11 months ago
_allowStateChangesStart/End
The new decorators seem to be able to fit in a minor. Still, once they're out and stable for a while, it might be nice to push for a new major to remove the legacy decorators (and the makeObservable
based api's?) to have a single uniform mechanism and make everything a bit leaner
Closed in favor of https://github.com/mobxjs/mobx/issues/3796
Since next Mobx update might be major due to native decorators support, it makes sense to revisit the API and remove deprecated features. Removing deprecated features gives less code to support for maintainers. For example here while mocking console.log I had to support both
observer
anduseObserver
usage: https://github.com/mobxjs/mobx/blob/01432751d235da15fc861619563a08f1c9dfa623/packages/mobx-react-lite/__tests__/observer.test.tsx#L17Here is the list of deprecated API I've found:
batchingForReactDom.js
,batchingForReactNative.js
,batchingOptOut.js
: https://github.com/mobxjs/mobx/blob/01432751d235da15fc861619563a08f1c9dfa623/packages/mobx-react-lite/batchingForReactDom.js#L2isObserverBatched
since it's always returns true: https://github.com/mobxjs/mobx/blob/01432751d235da15fc861619563a08f1c9dfa623/packages/mobx-react-lite/src/utils/observerBatching.ts#L21options
argument inobserver
: https://github.com/mobxjs/mobx/blob/01432751d235da15fc861619563a08f1c9dfa623/packages/mobx-react-lite/src/observer.ts#L65flow
type checker support, types and tests since flow is no longer supported: https://github.com/mobxjs/mobx/issues/2792#issuecomment-775871814Feel free to add missing API 👍 Once we agreed, I'll start working on PR.