-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
In my opinion people expect deeply proxied objects that can intercept reads and writes to work identically to JS objects, with basically the only difference being that the proxy is aware of every read and write that goes through the proxied object.
Stores created with createMutable break that assumption in some ways that I think can cause bugs, and in ways that are not documented, in case the present behavior is intentional, so I think the following issues should be addressed:
- Setting a property to
undefineddeletes the property. That's just not what plain objects do. Repro: https://playground.solidjs.com/anonymous/b3976972-e6bb-42ef-8481-dc07bb203009 - A bunch of extra properties are attached to proxied objects. I don't think any detectable edits to the object that the user didn't explicitly perform should be performed, in particular in this case we can use WeakMaps instead. Repro: https://playground.solidjs.com/anonymous/577681f3-d496-4354-97f2-51bff69025f9
- Some interceptable writes are not intercepted, kinda creating a hole in the "observer membrane". Ideally this should get fixed to make
createMutablework more predictably and reliably. In particular thedefinePropertyproxy trap is not implemented, soObject.definePropertyis not intercepted. Repro: https://playground.solidjs.com/anonymous/aea88d65-fea3-4cb8-a53a-56402667d0af
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request