fix: clarify which mobx libs are not compatible with compiler #32570
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.
Summary
Right now,
react-compiler-healthcheck
flagsmobx
as a "known incompatible library". But it's not precisely MobX that's incompatible. It's the observer HOC that comes frommobx-react
andmobx-react-lite
.I've been working on mst-use-observable, which makes MobX-State-Tree compatible with the compiler. However, projects that use
mobx-state-tree
andmst-use-observable
will still depend onmobx
as a dependency.And there have been efforts in the past to write a hook for observability. So it's possible that MobX could become compatible, so long as authors access it with a hook, rather than the HOC.
I would like to propose updating the health check to be a little more precise and flag the HOC dependencies, rather than MobX itself.
Thanks in advance for your consideration!
How did you test this change?
npx react-compiler-healthcheck
shouldn't flag onmobx
in dependencies, but will formobx-react-lite
andmobx-react
.Test suites, formatting, linting, all passed.