Skip to content

Conversation

@coolsoftwaretyler
Copy link
Contributor

Summary

Right now, react-compiler-healthcheck flags mobx as a "known incompatible library". But it's not precisely MobX that's incompatible. It's the observer HOC that comes from mobx-react and mobx-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 and mst-use-observable will still depend on mobx 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 on mobx in dependencies, but will for mobx-react-lite and mobx-react.

Test suites, formatting, linting, all passed.

@coolsoftwaretyler coolsoftwaretyler changed the title fix: clarify what mobx libs are not compatible with compiler fix: clarify which mobx libs are not compatible with compiler Mar 11, 2025
@poteto
Copy link
Member

poteto commented Mar 13, 2025

Thanks!

@poteto poteto merged commit ef06b54 into facebook:main Mar 13, 2025
21 checks passed
github-actions bot pushed a commit that referenced this pull request Mar 13, 2025
## Summary

Right now, `react-compiler-healthcheck` flags `mobx` as a "known
incompatible library". But it's not precisely *MobX* that's
incompatible. It's the observer HOC that comes from `mobx-react` and
`mobx-react-lite`.

I've been working on
[mst-use-observable](https://github.com/coolsoftwaretyler/mst-use-observable),
which makes MobX-State-Tree compatible with the compiler. However,
projects that use `mobx-state-tree` and `mst-use-observable` will still
depend on `mobx` as a dependency.

And there [have been efforts in the past to write a hook for
observability](mobxjs/mobx#2566). 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 on `mobx` in
dependencies, but will for `mobx-react-lite` and `mobx-react`.

Test suites, formatting, linting, all passed.

---------

Co-authored-by: lauren <poteto@users.noreply.github.com>

DiffTrain build for [ef06b54](ef06b54)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants