-
-
Notifications
You must be signed in to change notification settings - Fork 349
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Well, and what do you think about the deprecation strategy for the current approach? |
I think this is a cool approach, alleviating some tooling issues! As a hint, we could maybe detect and warn during the first render that no scheduler has been set at all. (and maybe even provide a noop scheduler if for some reason observer is used without react-dom or native) |
I am still a bit concerned about the deprecation strategy. Or do you think that removing RN specific bundle with a next major without any sort of warning is ok? It's probably not that big change on the consumer side, that's true.
Wouldn't that be kinda obtrusive? Most people probably don't need it and bugging them to even set noop one feels like a nuisance. |
imho most people does need it at some point, as not using this will lead at
random to really confusion semantics / /bugs when an update causes both a
parent and child should update, and they don't do it in order. So I quite
disagree with the premise ("most people don't need it"). It is imho simply
a requirement for mobx-react to run correctly and predictable. The fact
that it doesn't cause a bug in all projects (or even in most, if you stick
to causing updates from event handlers), doesn't mean it's a random opt-in
optimization; its not just an optimization, its a change in semantics.
Figuring out afterwards why something doesn't work here, and why components
are updating in the incorrect order, is way way harder, than blindly
configuring this correctly upfront.
…On Sun, Jan 12, 2020 at 10:53 PM Daniel K. ***@***.***> wrote:
I am still a bit concerned about the deprecation strategy. Or do you think
that removing RN specific bundle with a next major without any sort of
warning is ok? It's probably not that big change on the consumer side,
that's true.
As a hint, we could maybe detect and warn during the first render that no
scheduler has been set at all.
Wouldn't that be kinda obtrusive? Most people probably don't need it and
bugging them to even set noop one feels like a nuisance.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#787?email_source=notifications&email_token=AAN4NBCYLV4V5ZT7I6NUWPDQ5ONQDA5CNFSM4JAW3RZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIXGPTA#issuecomment-573466572>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBAI64CYFH7DQNOIJ5LQ5ONQDANCNFSM4JAW3RZA>
.
|
Alright, I seem to have misunderstood the problem at hand. I even call it optimization in mobx-react-lite docs. It would be nice if you can create some small writeup of the implication of (not) using it. We could then link it from that hint so people can make educated decision and not just a guess. |
Short summary (I think you can confirm this by disabling it in the mobx-react repo and running the unit tests, some should break). For example this test: https://github.com/mobxjs/mobx-react/blob/master/test/observer.test.js#L639 The idea is:
Hope that helps! |
Thank you for the write-up, I need to dive into it and try it out and then I will add explanation in some form to mobx-react-docz site. However, I am thinking there might be a small flaw to this solution - UMD. Since it's not an optimization as I first thought, it's probably viable to have that included in UMD build which would not have an option to do it. But I wonder if people using UMD actually do need it. I cannot think of reasons why would someone use UMD for serious app development. What do you think? |
138a533
to
a7b70c2
Compare
a7b70c2
to
31b1bc8
Compare
Mostly just reexport of the mobxjs/mobx-react-lite#214.
In some distant future when 7.0 comes out, we can remove react-native specific bundle. Although it would be nice to somehow deprecate it now. Ideas?