Store instance handles in an internal map behind flag#35053
Store instance handles in an internal map behind flag#35053jackpope merged 1 commit intofacebook:mainfrom
Conversation
|
Comparing: 5a2205b...448b6a8 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
josephsavona
left a comment
There was a problem hiding this comment.
Left a couple comments but since everything is gated this seems fine to experiment with
| (parentNode: any)[internalContainerInstanceKey] || | ||
| internalInstanceMap.get(((parentNode: any): InstanceUnion)); |
There was a problem hiding this comment.
below you check internalInstanceMap first instead of the node itself, is it intentional to have different precedence in different places?
There was a problem hiding this comment.
In this version I've moved the main instance handle into the internal map but left the container instance handle on the node. So I'm mirroring the existing checks in terms of precedence. This one checks for container first while the other falls back to container.
| internalInstanceMap.get(((node: any): InstanceUnion)) || | ||
| (node: any)[internalContainerInstanceKey]; |
There was a problem hiding this comment.
compare to here for example
We already append `randomKey` to each handle name to prevent external libraries from accessing and relying on these internals. But more libraries recently have been getting around this by simply iterating over the element properties and using a `startsWith` check. This flag allows us to experiment with moving these handles to an internal map. This PR starts with the two most common internals, the props object and the fiber. We can consider moving additional properties such as the container root and others depending on perf results. DiffTrain build for [a44e750](a44e750)
We already append `randomKey` to each handle name to prevent external libraries from accessing and relying on these internals. But more libraries recently have been getting around this by simply iterating over the element properties and using a `startsWith` check. This flag allows us to experiment with moving these handles to an internal map. This PR starts with the two most common internals, the props object and the fiber. We can consider moving additional properties such as the container root and others depending on perf results. DiffTrain build for [a44e750](a44e750)
We already append `randomKey` to each handle name to prevent external libraries from accessing and relying on these internals. But more libraries recently have been getting around this by simply iterating over the element properties and using a `startsWith` check. This flag allows us to experiment with moving these handles to an internal map. This PR starts with the two most common internals, the props object and the fiber. We can consider moving additional properties such as the container root and others depending on perf results. DiffTrain build for [a44e750](facebook@a44e750)
We already append `randomKey` to each handle name to prevent external libraries from accessing and relying on these internals. But more libraries recently have been getting around this by simply iterating over the element properties and using a `startsWith` check. This flag allows us to experiment with moving these handles to an internal map. This PR starts with the two most common internals, the props object and the fiber. We can consider moving additional properties such as the container root and others depending on perf results. DiffTrain build for [a44e750](facebook@a44e750)
We already append
randomKeyto each handle name to prevent external libraries from accessing and relying on these internals. But more libraries recently have been getting around this by simply iterating over the element properties and using astartsWithcheck.This flag allows us to experiment with moving these handles to an internal map.
This PR starts with the two most common internals, the props object and the fiber. We can consider moving additional properties such as the container root and others depending on perf results.