Repository navigation
v3.0.16
3.0.16 sends every object write that lands on the state, whatever the receiver, and makes writes on objects faster.
- An object proxy now has a
definePropertytrap, as array proxies have since 3.0.13.Object.defineProperty(state.obj, "a", { value: 1 })is sent likestate.obj.a = 1, and flags alone on a new key like a write ofundefined. 3.0.15 changed the object and sent nothing. - A write through an outer proxy with a
getPrototypeOforgetOwnPropertyDescriptortrap, such as a membrane, is sent once, like the same write on the proxy. 3.0.15 changed the object and sent nothing when the outer proxy had agetPrototypeOftrap. A setter reached through such a proxy follows the rule of the direct write. - Another proxy of the state as receiver,
Reflect.set(state.a, "x", 1, state.b), givesbthe write and sendsset b.x. 3.0.15 changed the rawband sent nothing. - A direct write to an object no longer passes the proxy as receiver, and the set trap no longer takes a fifth parameter: object writes are faster on Node and Bun.
- An object proxy remembers an outer proxy for each own key whose write through it landed, and writes that key directly from then on: a write through an outer proxy costs less than in 3.0.14. An outer proxy whose
definePropertyorgetOwnPropertyDescriptortrap later answers differently for that key is outside the supported input; itssettrap still runs on every write.
The upgrade guide has a 3.0.16 section. Every other write sends the same events as in 3.0.15.