SIGN IN SIGN UP
facebook / react UNCLAIMED

The library for web and native user interfaces.

0 0 0 JavaScript

[compiler] More fbt compatibility

In my previous PR I fixed some cases but broke others. So, new approach. Two phase algorithm:

* First pass is forward data flow to determine all usages of macros. This is necessary because many of Meta's macros have variants that can be accessed via properties, eg you can do `macro(...)` but also `macro.variant(...)`.
* Second pass is backwards data flow to find macro invocations (JSX and calls) and then merge their operands into the same scope as the macro call.

Still WIP, ideally `fbt.plural()` and `fbt.param()` would be treated as shallow, but if we do that then PromoteUsedTemporaries can sometimes promote temporaries (@mofeiz called it) just because there are other scopes in between the fbt.plural operand and fbt.plural call.
J
Joe Savona committed
dd0dab534ac54fd3eff640e1df2b0981ebe37abb
Parent: 1324e1b