Closed pastelmind closed 12 months ago
The latest updates on your projects. Learn more about Vercel for Git βοΈ
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
valtio | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Jul 24, 2023 4:35am |
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 63b9cf647657d366fb219bca5993f72e9d82b268:
Sandbox | Source |
---|---|
React | Configuration |
React Typescript | Configuration |
React Browserify | Configuration |
React Snowpack | Configuration |
React Parcel | Configuration |
May fix https://github.com/pmndrs/valtio/discussions/764 (but we need confirmation from actual RN users)
Is it now confirmed with https://github.com/pmndrs/valtio/discussions/764#discussioncomment-6531628 ?
May fix #764 (but we need confirmation from actual RN users)
Is it now confirmed with #764 (reply in thread) ?
I believe so.
Vote for this, when it could be merged?
Is it worth reverting? Maybe the bug will be fixed in Hermes earlier.
It makes sense to revert as we didn't know such a limitation when we merged and released. I don't disagree that this is a reasonable addition, but my assumption was it didn't hurt at all.
https://github.com/pmndrs/valtio/pull/760#pullrequestreview-1538331597
Not sure if there are pitfalls, but this should be harmless for normal (plain objects) usage, except for the bundle size increase.
So, there is an unexpected pitfall and it's harmful for some users.
yeah, and there are a lot of ppl stuck in certain RN versions. And there is no timeframe for fixing this in hermes and even if it's fixed then it would still require people to upgrade to latest version
This reverts commit c0bda5afd2780fb929656a87bcc9e16bcf189fd8.
Due to what I presume is a bug in the Hermes engine, React Native projects cannot use Valtio 1.11.0. Let's revert #760 to support existing React Native users.
Related Issues or Discussions
Fixes #765 May fix #764 (but we need confirmation from actual RN users)
Summary
This reverts #760 (c0bda5afd2780fb929656a87bcc9e16bcf189fd8). The following pattern (described in detail at #759) is no longer explicitly supported:
To work around this, we can explicitly set the field in the constructor, which properly invokes the
set
proxy trap:Alternatively, you can configure your transpiler to use 'set' semantics for class fields (e.g.
useDefineForClassFields: false
. (Personally I advise against this, because it deviates from the modern ECMAScript spec)Check List
yarn run prettier
for formatting code and docs