Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[compiler] Type inference for tagged template literals #30869

Merged
merged 2 commits into from
Sep 4, 2024

Commits on Sep 4, 2024

  1. [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]
    josephsavona committed Sep 4, 2024
    Configuration menu
    Copy the full SHA
    bea8495 View commit details
    Browse the repository at this point in the history
  2. 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]
    josephsavona committed Sep 4, 2024
    Configuration menu
    Copy the full SHA
    fbf79e0 View commit details
    Browse the repository at this point in the history