mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
I quickly experimented with enabling support for get/set syntax. This confirmed my suspicion that these won't be safe without additional work. The "set" fixture example shows how we assume PropertyStore is only a Store effect on the object, but with a setter it needs to be modeled as an arbitrary mutation. If we were to support getters and setters I think we'd need to: * Support `this` syntax (maybe limited to just within object methods) * Enforce that getters cannot mutate any free variables, cannot mutate `this` * Enforce that setters cannot mutate any free variables (but allow mutating `this`). In other words, enforce that you're using getters/setters in a reasonable way that matches our modeling (get is a read, set is a store to the object). [ghstack-poisoned]
React Compiler
React Compiler is a compiler that optimizes React applications, ensuring that only the minimal parts of components and hooks will re-render when state changes. The compiler also validates that components and hooks follow the Rules of React.
More information about the design and architecture of the compiler are covered in the Design Goals.
More information about developing the compiler itself is covered in the Development Guide.