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

Improve types for (un)compiled template results #4309

Merged
merged 3 commits into from
Nov 3, 2023

Commits on Oct 31, 2023

  1. Improve types for (un)compiled template results

    Adds two new types: `UncompiledTemplateResult` and `MaybeCompiledTemplateResult`. Currently `UncompiledTemplateResult` is the same as `TemplateResult`, and `MaybeCompiledTemplateResult` is the union of the compiled and uncompiled types.
    
    We'd like for code to be able to handle the `html` and `svg` functions returning a MaybeCompiledTemplateResult. Changing that type will be a major breaking change though, and we don't want to do a major version so quickly, but this lays the ground work, and provides future-compatible types that people can use when they want to be explicit about which type they mean, because while TemplateResult will change, MaybeCompiled, Uncompiled, and Compiled will all have the same meanings in the next major version.
    rictic committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    ffde4a2 View commit details
    Browse the repository at this point in the history
  2. Changeset

    rictic committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    691caab View commit details
    Browse the repository at this point in the history
  3. Add more comments.

    rictic committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    d4291a2 View commit details
    Browse the repository at this point in the history