Closed michaelaflores closed 4 years ago
The observerBatchingOptOut
is deprecated and won't be used anymore. PR welcome to remove its export from this lib.
@FredyC I wouldn't mind picking this up -- I don't actually see where it's used in this current version of mobx-react though, I seem to turn up no results for observerBatchingOptOut
. Any chance you could point me to a good place to look? Seems like you all are actually using batchingOptOut
here so I'm surprised this error occurs.
I am surprised as well. The 6.3.0 should indeed work correctly. Are you sure you are not running into some NPM/Yarn caching issues?
https://unpkg.com/browse/mobx-react@6.3.0/dist/mobxreact.esm.js
No mention of observerBatchingOptOut
here.
@FredyC good point. I'm going to double check and report back.
@FredyC we are encountering this issue on our CI server with no yarn caching enabled. We had no issues until ~3days ago and have not (knowingly) updated any dependencies....
@JamesRamm And do you have 6.3.0? Do you commit yarn.lock
? The change happened in the underlying mobx-react-lite
, but with a lock file it should keep the old version.
@FredyC yarn.lock is not committed - but our mobx-react version is pinned to 6.2.2 You are suggesting that updating to 6.3.0 should fix this?
Yea well, without a lock file it means that the underlying mobx-react-lite
will be always updated to the last version and that's what caused your issue. Generally, I would recommend you to commit yarn.lock if you want a stable CI environment. Even with pinning versions you never know if transient dependencies are pinned too (usually they are not). Upgrading to 6.3.0 should fix this problem.
@FredyC verified this problem existed between the mouse and keyboard, 6.3.0 does indeed work as expected. Thanks for your help. 👍
Intended outcome
Using mobx-react 6.3.0, and running a build of an app consuming it, should work.
Actual outcome
I believe what's happening is that if you run this install fresh, you'll get MobX-react-lite @ 2.2.1, which doesn't have this export. They have a related issue for something else they removed but not for this particular export. At any rate, I think mobx-react should have this sub-dependency locked to a known working version in its package json so that consumers don't pick up accidental breaking changes.
How to reproduce the issue
npm install mobx-react@6.3.0
Versions