Commit fbf79e0
committed
Update on "[compiler] Type inference for tagged template literals"
At Meta we have a pattern of using tagged template literals for features that are compiled away:
```
// Relay:
graphql`...graphql text...`
```
In many cases these tags produce a primitive value, and we can get even more optimal output if we can tell the compiler about these types. The new moduleTypeProvider gives us the ability to declare such types, this PR extends the compiler to use this type information for TaggedTemplateExpression values.
[ghstack-poisoned]File tree
10 files changed
+15
-549
lines changed- compiler/packages
- babel-plugin-react-compiler/src
- HIR
- __tests__/fixtures/compiler
- snap/src/sprout
10 files changed
+15
-549
lines changedLines changed: 13 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| |||
789 | 788 | | |
790 | 789 | | |
791 | 790 | | |
792 | | - | |
793 | 791 | | |
794 | | - | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
795 | 799 | | |
796 | 800 | | |
797 | 801 | | |
| |||
802 | 806 | | |
803 | 807 | | |
804 | 808 | | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
817 | 812 | | |
818 | 813 | | |
819 | 814 | | |
| |||
826 | 821 | | |
827 | 822 | | |
828 | 823 | | |
829 | | - | |
830 | 824 | | |
831 | 825 | | |
832 | 826 | | |
833 | 827 | | |
834 | | - | |
| 828 | + | |
835 | 829 | | |
836 | 830 | | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | | - | |
| 831 | + | |
846 | 832 | | |
847 | | - | |
848 | 833 | | |
849 | | - | |
| 834 | + | |
850 | 835 | | |
851 | 836 | | |
852 | 837 | | |
| |||
Lines changed: 0 additions & 123 deletions
This file was deleted.
Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 0 additions & 145 deletions
This file was deleted.
0 commit comments