Closed maraisr closed 1 year ago
I see it's because use-sync-external-store
has peer dep, and it's not optional.
We could mark it as peer dep, but that would require react users to install it. (some new package managers can do it automatically.)
Curious, how "bad" is it to install react
for you?
thank you for your time. appreciate the response. But no thank you, installing react is an insurmountable sin I do not wish to commit.
Does --legacy-peer-deps
option help? Otherwise, patch-package
might be a last resort.
use-sync-external-store
is only used in your react submodule — can that not be an optional peer dependency as it rightly is?
It could. (Theoretically, same applies to proxy-compare
which is only meaningfully used in react
. vanilla
part is meaningless without it.)
It's just a matter of usability. If we remove use-sync-external-store
from the dependency, 99.9% of users would have to re-install it. note valtio
depends on it.
Say, 1% of users is using valtio/vanilla
, and probably only one tenth would actually have a trouble with the react peer dependency.
I feel like a dummy react library would help in your case. or dummy use-sync-external-store
.
btw, we will be removing it in the future version.
Oh this is fantastic news, looking forward to it!
By the future version, I meant v2 with React >= 18 requirement. It won't happen very soon.
Hi 👋🏻
We are using valtio in a context where react isnt used. So exclusively the
/vanilla
package.But NPM is throwing an install warning for us:
Believe its because valtio requires
use-sync-external-store
which has a peer dep on react, which we do not want.https://github.com/pmndrs/valtio/blob/7fe26c2a8ff2df8a5b8df019f8878dbf48e40876/package.json#LL140C18-L140C18
Perhaps there is an alternative to valtio that doesnt depend on react?