[compiler] rebase #32285 (#34102)
Redo of #32285 which was created with ghstack and is tedious to rebase with sapling. DiffTrain build for [d3b26b2953c7e780abaa49f422c53fd4cda08e47](https://github.com/facebook/react/commit/d3b26b2953c7e780abaa49f422c53fd4cda08e47)
J
josephsavona committed
313c51425ee64c8a793c2f5bdf5415cfa7c75113
Parent: a6b6ccf