-
-
Notifications
You must be signed in to change notification settings - Fork 852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: compatibility with Secure EcmaScript #914
Conversation
✔️ Deploy Preview for quizzical-lovelace-dcbd6a canceled. 🔨 Explore the source changes: f4a3964 🔍 Inspect the deploy log: https://app.netlify.com/sites/quizzical-lovelace-dcbd6a/deploys/622431e9317aa40007288174 |
using https://github.com/immerjs/immer/pull/914/files?diff=unified&w=1 hide white space will make this PR easier to review. |
thanks! looks ok in general, but could you elaborate a bit more what problem with secure EcmaScript this solves? (Or what that is). Also it might be a bit cleaner to convert it to single |
Pull Request Test Coverage Report for Build 1920713780Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Thanks for the reply. I have written a description about why this fix can resolve the problem, see MikeMcl/decimal.js-light#20 (comment) I will do the changes you requested tomorrow. |
@mweststrate hi! can you review this again? thanks! |
@Jack-Works I checked the proposal, but it is still in stage 1 and looks largely inactive for the last 2 years, so I don't see a reason to provide all other users with a slower and slightly less straightforward implementation atm? Typically only at stage 3 it becomes interesting for popular libs like immer to get involved. |
I don't think defineProperty will be slow... I think the |
patch-package is the perfect solution for cases like this. one-off, innocent looking changes for a single user has too many times come back to ruin the day later somewhere down the road for me in the past. Landing this PR would basically mean committing to not change any built-in objects with a prototype in the future, which is quite a blanket cheque. So saving the inconvenience of patch-package in an exotic setup is not a strong enough argument for a package that is used this widely imho. |
Please look again and consider reopening. The code in the proposed changes is simply better code than the code it replaces. The original code already uses a The situation of frozen prototypes is not obscure, and changing code to live better with them is not an obscure improvement. This affects
I do not understand this argument. By accepting this PR, you'd only be removing an incompatibility with frozen prototypes. This is no more a commitment to frozen prototypes than is any other code that is already compatible with frozen prototypes. |
@Jack-Works yes, that does seem strange! Do you understand why it does seem to work with |
@erights immer v10 is now compatible with ses. |
OMG thanks! |
Any clarification of the previous mysteries? Just curious. |
no idea, haven't inspected that since then |
Probably because we're using classes now rather than constructing
prototypes, due to targetting more modern JS versions
…On Wed, 19 Apr 2023, 11:50 Jack Works, ***@***.***> wrote:
Any clarification of the previous mysteries? Just curious.
no idea, haven't inspected that since then
—
Reply to this email directly, view it on GitHub
<#914 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBBNS2GJRGGQIAKKVT3XB6YM5ANCNFSM5PWN2SMQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I fixed it by replacing
Draft{Map, Set}.prototype.method =
toObject.defineProperty(...)