top | item 40874408

(no title)

yayr | 1 year ago

I find working with React and Mobx a breeze, also for complex apps. Not sure, why this has not been more widely adopted. It eliminates usually the need to use those mentioned unintuitive and error prone state handling mechanisms.

discuss

order

mittermayr|1 year ago

I optimized Mobx away by switching to "zustand" – it's another layer of simplification and I haven't had a project where it didn't work. Next to zero dependencies and it just "works". Mobx got me angry once they had too many breaking changes from 4 to 5 etc.

kecupochren|1 year ago

So much this. It's a perfect match for React. Let's you keep data/logic out of the components, 0 boilerplate, optimized renders (similar to what react compiler will do...).

You can even use tanstack-query to get all/most of its benefits. (by using its core package instead of react-query)

kabes|1 year ago

Yeah. I think mobx is often disregarded as mutable state goes against the react philosophy. Instead they somehow rather make monstrosities of codebases (redux anyone?) just to avoid it.

And mobx is really just signals everyone now loves automated via proxy objects.

refulgentis|1 year ago

My first real job was at FAANG with 2 co-technical leads with 0 reports and 3 people working with them.

They were iOS-specific, and called in to lead (and I was hired) after a sprint where not-iOS people had built an iOS app. It was pretty good!

The problem was, their heads had inflated so much that they had ascended to the heavens in terms of self-proclaimed computer scientist.

So they wasted months and months rewriting the app to have a Redux implementation in Objective-C, 4 years after Swift came out, and pitched it as a final solution to making the app reliable and dev velocity fast, as compared to that horrid codebase they had to inherit.

The relaunched app took 18 months, was missing features, had a 2/3 higher crash rate. And the core problem, network reliability, came down to them acting like the networking code was some prized expert-level thing only they could manage...but the issue was they re-implemented TCP and were blocking ACK packets on frame rendering. So it'd be really fast and normal then hit the ack queue limit, and only be able to send one packet every ~16 ms.

Just thinking out loud because it's very funny to find out Redux also ended up being too much in the JS community, and I hadn't heard till now.

But hey, our managers managers manager really liked that one video of that one stilted live replay the initial 6 months in demo could do.