Commit graph

99 commits

Author SHA1 Message Date
Kristiyan Kostadinov
8277906455 refactor(compiler): remove unused code
The `fullInheritane` flag from the metadata and the `CopyDefinitionFeature` that it controls appear to no longer be used since `fullInheritance` is always false. The feature appears to have been there to support ngcc which was removed some time ago.
2025-11-11 10:04:29 -08:00
Matthieu Riegler
04462ed67f refactor(compiler): Remove the interpolation config (#64071)
After #63474, we don't need that anymore.

PR Close #64071
2025-09-29 15:29:46 -04:00
Jessica Janiuk
221d5687ae Revert "refactor(compiler): Remove the interpolation config (#64071)" (#64110)
This reverts commit 768a09d3c3.

PR Close #64110
2025-09-26 15:16:53 -04:00
Matthieu Riegler
768a09d3c3 refactor(compiler): Remove the interpolation config (#64071)
After #63474, we don't need that anymore.

PR Close #64071
2025-09-26 12:36:50 -04:00
Kristiyan Kostadinov
3afd3046d7 refactor(compiler): track whether component has directive dependencies (#62096)
Adds a field to the directive's metadata tracking whether it has directive dependencies. Knowing this will allow the pipeline to decide whether to produce DOM-only or full instructions.

PR Close #62096
2025-06-23 14:24:09 +02:00
Alan Agius
e9fcbb8af1 fix(compiler): remove TypeScript from linker (#61618)
This commit removes the direct dependency on TypeScript within the linker, addressing a performance overhead that was adding between 500ms to 1s to compilation times for applications.

The primary cause of this overhead was the linker's direct reliance on TypeScript's which was caused by importing from barrel files. While convenient, barrel files are detrimental to code splitting and code motion. They force the bundling of all exported modules, even if only a subset is actually used.

By removing the usage of this barrel file and restructuring the imports to be more granular, we can avoid unnecessary TypeScript imports.
 Furthermore, TypeScript has now been changed to an optional peer dependency as using only the linker does not require TypeScript.

PR Close #61618
2025-05-26 08:46:00 +00:00
Kristiyan Kostadinov
abdb6e2945 refactor(compiler): allow binder to be created without matcher (#61018)
Currently to create an `R3TargetBinder`, we have to pass some sort of directive matcher, however we also have a couple of use cases where we use the binder to do analysis that's unrelated to directives (e.g. resolving the `@defer` blocks). In these cases having to create a dummy matcher adds some slight overhead and makes the code harder to reason about since it looks like directive matching may be happening.

These changes update the `R3TargetBinder` to allow for `null` to be passed as the directive matcher.

PR Close #61018
2025-04-29 21:06:10 +00:00
Kristiyan Kostadinov
bc9a067ef4 refactor(compiler-cli): add flag to enable selectorless (#60977)
Adds a private flag that we can use to enable selectorless as it's being developed.

PR Close #60977
2025-04-24 13:02:39 -07:00
Kristiyan Kostadinov
4559e125f0 refactor(compiler): generate debug location instruction (#58982)
Adds the logic that will generate the `ɵɵattachSourceLocations` instruction.

Fixes #42530.

PR Close #58982
2024-12-05 16:09:55 -08:00
hawkgs
0513fbc9fc docs: set syntax highlighting of code examples MD code blocks (#59026)
Set the syntax highlighting based on the code examples' language.

PR Close #59026
2024-12-04 17:30:28 +01:00
Alan Agius
7de7c52769 build: remove usages of useDefineForClassFields: false (#58297)
When setting `"useDefineForClassFields": false`, static fields are compiled within a block that relies on the `this` context. This output makes it more difficult for bundlers to treeshake and eliminate unused code.

PR Close #58297
2024-10-28 12:26:05 -07:00
Matthieu Riegler
a34090bc71 refactor(compiler): dynamic default for the partial compiler. (#58169)
Use `semver` in the partial compiler to decide on a default value

Co-authored-by: Alex Rickabaugh <alxhub@users.noreply.github.com>

PR Close #58169
2024-10-15 16:05:14 +00:00
Joey Perrott
9dbe6fc18b refactor: update license text to point to angular.dev (#57901)
Update license text to point to angular.dev instead of angular.io

PR Close #57901
2024-09-24 15:33:00 +02:00
Kristiyan Kostadinov
0a48d584f2 feat(core): add support for let syntax (#56715)
Enables the new `@let` syntax by default.

`@let` declarations are defined as:
1. The `@let` keyword.
2. Followed by one or more whitespaces.
3. Followed by a valid JavaScript name and zero or more whitespaces.
4. Followed by the `=` symbol and zero or more whitespaces.
5. Followed by an Angular expression which can be multi-line.
6. Terminated by the `;` symbol.

Example usage:
```
@let user = user$ | async;
@let greeting = user ? 'Hello, ' + user.name : 'Loading';
<h1>{{greeting}}</h1>
```

Fixes #15280.

PR Close #56715
2024-06-26 12:37:02 -07:00
Kristiyan Kostadinov
64990a50ed refactor(compiler): integrate let declarations into the template pipeline (#56299)
These changes integrate let declarations into the template pipeline. This involves a few operations:
* Producing a `declareLet` instruction call at creation time to initialize the declaration.
* Producing a `storeLet` instruction call in the place of the let declaration, including the necessary `advance` calls beforehand.
* For let declarations used within their declaration view, moving the `const` to be placed right after the `storeLet` call to ensure the their value has been computed.
* For let declarations that are _only_ used in their declaration view, removing the `storeLet` call and inlining the expression into the constant statement.

PR Close #56299
2024-06-20 08:48:52 -07:00
Joey Perrott
0d78a92431 refactor: migrate compiler-cli to prettier formatting (#55485)
Migrate formatting to prettier for compiler-cli from clang-format

PR Close #55485
2024-04-29 10:25:43 -07:00
Kristiyan Kostadinov
5bd188a394 feat(compiler-cli): add partial compilation support for deferred blocks (#54908)
Builds on top of the previous changes to add support for deferred blocks during partial compilation. To do this, the following changes had to be made:
* The metadata passed into `ɵɵngDeclareComponent` has an additional field called `deferBlockDependencies` which has an array of the dependency loading functions for each defer block in the template. During linking, the dependency functions are loaded by matching their template index to the index in the `deferBlockDependencies` array.
* There's a new `ɵɵngDeclareClassMetadataAsync` function that is created for components that have deferred dependencies. It gets transpiled to `setClassMetadataAsync` and works in the same way by capturing a dependency loading function and setting the metadata after the dependencies are resolved. It also has some extra fields for capturing the version which are standard in linker-generated code.
* Deferred import statements are now stripped in partial compilation mode, similar to full compilation.

PR Close #54908
2024-03-21 22:15:32 -07:00
Kristiyan Kostadinov
ffa217eabd refactor(compiler-cli): add method for extracting function parameters (#54908)
Updates the linker's AST host to add the ability to extract a function's parameters. This will be required for the next commits.

PR Close #54908
2024-03-21 22:15:30 -07:00
Kristiyan Kostadinov
102688bf83 refactor(compiler): widen type of resolver function (#54908)
Updates the type of the resolver function to be any `Expression` since JIT may receive a function reference rather than a `ArrowFunctionExpr`.

PR Close #54908
2024-03-21 22:15:30 -07:00
Paul Gschwendtner
0482b6b4c7 refactor(compiler-cli): update ImportGenerator abstraction for new manager (#54819)
`ImportGenerator` is the abstraction used by the translator functions to
insert imports for `ExternalExpr` in an AST-agnostic way.

This was built specifically for the linker which does not use any of the
complex import managers- but rather re-uses `ngImport` or uses
`ngImport.Bla`.

This commit also switches the linker AST-agnostic generator to follow
the new signatures. This was rather trivial.

PR Close #54819
2024-03-15 15:09:40 -07:00
Kristiyan Kostadinov
6ea208ee90 refactor(compiler-cli): move defer resolver compilation into compiler package (#54759)
Moves the logic that creates the defer resolver function into `@angular/compiler` for consistency with the rest of the compilation APIs. Also renames some of the symbols to make it clearer what they're used for.

PR Close #54759
2024-03-11 15:52:42 -07:00
Kristiyan Kostadinov
83932aa85e refactor(compiler): rework defer block analysis (#54759)
Currently we have the `deferrableDeclToImportDecl`, `deferBlocks`, `deferrableTypes` and `deferBlockDepsEmitMode` fields on the `R3ComponentMetadata` which is incorrect, because the interface is used both for JIT and AOT mode even though the information for those fields is AOT-specific. It will be problematic for partial compilation since the runtime will have a reference to the dependency loading function, but will not be able to provide any of the other information.

These changes make the following refactors:
1. It changes the defer-related information in `R3ComponentMetadata` to include only references to dependency functions which can be provided both in JIT and AOT.
2. Moves the AOT-specific defer analysis into the `ComponentResolutionData`.
3. Moves the construction the defer dependency function into the compilation phase of the `ComponentDecoratorHandler`.
4. Drops support for defer blocks from the `TemplateDefinitionBuilder`. This allows us to clean up some TDB-specific code and shouldn't have an effect on users since the TDB isn't used anymore.

PR Close #54759
2024-03-11 15:52:41 -07:00
Dylan Hunn
ef32b5322e refactor(compiler): Delete TemplateDefinitionBuilder and helpers (#54757)
`TemplateDefinitionBuilder` is the legacy template compiler, and was replaced by Template Pipeline as the default in v17.3.

This PR attempts to delete `TemplateDefinitionBuilder`, `ExpressionConverter`, and various helpers (i18n context, style builder, property visitors, etc).

Consider this a first pass: a lot of code has not yet been deleted (e.g. old TDB-specific test cases), and I'm sure I have missed additional helper code.

PR Close #54757
2024-03-08 16:51:01 -08:00
Andrew Scott
fb189c6997
Revert "refactor(compiler): rework defer block analysis (#54700)" (#54758)
This reverts commit eee620aa00.
2024-03-07 16:20:09 -08:00
Kristiyan Kostadinov
eee620aa00 refactor(compiler): rework defer block analysis (#54700)
Currently we have the `deferrableDeclToImportDecl`, `deferBlocks`, `deferrableTypes` and `deferBlockDepsEmitMode` fields on the `R3ComponentMetadata` which is incorrect, because the interface is used both for JIT and AOT mode even though the information for those fields is AOT-specific. It will be problematic for partial compilation since the runtime will have a reference to the dependency loading function, but will not be able to provide any of the other information.

These changes make the following refactors:
1. It changes the defer-related information in `R3ComponentMetadata` to include only references to dependency functions which can be provided both in JIT and AOT.
2. Moves the AOT-specific defer analysis into the `ComponentResolutionData`.
3. Moves the construction the defer dependency function into the compilation phase of the `ComponentDecoratorHandler`.
4. Drops support for defer blocks from the `TemplateDefinitionBuilder`. This allows us to clean up some TDB-specific code and shouldn't have an effect on users since the TDB isn't used anymore.

PR Close #54700
2024-03-07 12:40:44 -08:00
Dylan Hunn
1a6beae8a2 feat(compiler): Enable template pipeline by default. (#54571)
Template pipeline is now the default template compiler.

A pair of source map tests is failing, related to DI in JIT mode; I will fix and re-enable these during the preview period.

PR Close #54571
2024-02-23 11:15:36 -08:00
Joey Perrott
da7fbb40f0 fix(compiler-cli): detect when the linker is working in unpublished angular and widen supported versions (#54439)
When the linker is running using an unpublished version of angular, locally built, the version will be `0.0.0`.
When encountering this situation, the range that for the linker map support is considered to be `*.*.*` allowing
for the linker to work at build time with packages built with versioned angular.

Most notably this allows for us to properly use the linker in building our documentation site with the locally
built version of angular.

PR Close #54439
2024-02-14 15:43:22 -08:00
Dylan Hunn
47e6e84101 feat(compiler): Add a TSConfig option useTemplatePipeline (#54057)
The Template Pipeline is a brand new backend for the Angular compiler, replacing `TemplateDefinitionBuilder`. It generates the Ivy instructions corresponding to an input template (or host binding). The Template Pipeline has an all-new design based on an intermediate representation compiled over many phases, which will allow us to experiment with compiler changes more easily in the future.

With this commit, the template pipeline can now be enabled in any project via the `useTemplatePipeline` TSConfig option. However, it is still disabled by default.

PR Close #54057
2024-01-24 18:36:23 -05:00
Paul Gschwendtner
d4c84a97e8 refactor(compiler-cli): generate partial compilation output for signal-based queries (#53978)
This commit ensures that libraries can use signal-based queries, and the
partial compilation output will capture their metadata.

The linker is updated to support parsing this.

Two notes:

1. Older linker versions are not capable of parsing this, so the minimum
   version for signal-based queries is adjusted when such are used.
2. We only emit `isSignal` metadata for queries when signal queries are
   used. This enables libraries to continue supporting older linker
   versions, if signal-based queries are not used.

PR Close #53978
2024-01-23 10:24:36 +01:00
Andrew Kushnir
b0e0f0014e refactor(compiler): extra diagnostics for @defer in local compilation mode (#53899)
This commit adds extra logic to produce a diagnostic in case `@Component.deferredImports` contain types from imports that also bring eager symbols. This would result in retaining a regular import and generating a dynamic import, which would not allow to defer-load dependencies.

PR Close #53899
2024-01-17 10:46:15 -08:00
Andrew Kushnir
a2aa23d8b5 refactor(compiler): add support for internal deferredImports field (#53591)
This commit updates the logic to add support for internal `deferredImports` field in compiler.

PR Close #53591
2024-01-10 15:28:58 -08:00
Paul Gschwendtner
4b4941046c refactor(compiler-cli): support linking/parsing new partial output for signal inputs (#53808)
As we introduced the new partial output for signal inputs, we also need
to update the linker code to be able to parse this. This commit adds
this functionality.

In the follow-up commit, compliance tests for linking, partial output,
and full compilations are added.

PR Close #53808
2024-01-10 12:21:05 +00:00
Paul Gschwendtner
05ed60a0f9 refactor(compiler-cli): improve type safety of linker AST (#53808)
The linker AST is abstracted to be agnostic of the underlying
implementation AST. i.e. TS AST or Babel AST.

This abstraction also intends to provide some type-safety-ness to
parsing of various partial declarations. This commit improves type
safety further by fixing that `AstValue'`s were not checked for
assignability of `T`- potentially hiding issues/unaccounted values.

Additionally, we fix that `getObject()` does not properly narrow
union types to actual object literals. This happend because e.g. arrays
are of type `object`. We can improve type safety here. Using `Record`
did not help as an array would still assign to that.

PR Close #53808
2024-01-10 12:21:04 +00:00
Paul Gschwendtner
3e0e0b42fa refactor(compiler): emit signal input info in d.ts and generate partial compilation output (#53521)
This commit captures the metadata on whether an input is signal based or
not, in the `.d.ts` of directives and components. This exposes this
information to consumers of the directives. This is needed because
libraries may use signal inputs, and we need to know whether bound
inputs to this library are signal-based or not- so that we can generate
proper type-checking code (account for `InputSignal` or not).

Additionally, this commit introduces a new structure for the partial
compilation output of directive inputs. With the current emit, inputs
are captured in a data structure that is equivalent to the internal data
structure passed to `defineDirective` (the full compilation output).
This worked fine as we only captured a few strings, but in ends up
being a bad practice because partial compilation output should NOT
capture internal data structures that might be specific to a certian
Angular core version. Instead, we introduce a new "future proof"
structure that:

- can hold additional metadata in backwards-compatible ways, like
  `isSignal` or `isRequired`.
- can be parsed trivially using the `AstHost` for the linker, instead of
  having to unwrap/parse an array structure.

The new structure is only emitted when we discover that some inputs are
signal based (or ultimately end up configuring input flags). This is
done for backwards compatibility, so that libraries without signal
inputs remain compatible with older linker versions. In the future,
this might be the only emit.

Compliance tests for this follow in future commits, when the linker
portion is also in place. This commit specialices on the code
generation. With the linker, and compliance test infrastructure fixed
(that is broken right now), we can test the full integration.

PR Close #53521
2023-12-13 15:44:00 -08:00
Kristiyan Kostadinov
43e6fb0606 feat(core): enable block syntax (#51994)
Enables the new `@` block syntax by default by removing the `enabledBlockTypes` flags. There are still some internal flags that allow special use cases to opt out of the block syntax, like during XML parsing and when compiling older libraries (see #51979).

PR Close #51994
2023-10-03 15:26:05 -07:00
Kristiyan Kostadinov
9acd2ac98b fix(compiler): enable block syntax in the linker (#51979)
Adds some logic to enable parsing of block syntax in the linker. Note that the syntax is only enabled on code compiled with Angular v17 or later.

PR Close #51979
2023-10-03 11:48:13 -07:00
Kristiyan Kostadinov
7cce28ae9c refactor(compiler): extract deferred block trigger information (#51830)
Reworks the compiler to use the API introduced in #51816 to match triggers to the element nodes they point to. This will be used to generate the new instructions for `on interaction` and `prefetch on interaction`.

PR Close #51830
2023-09-22 12:17:54 -07:00
Andrew Kushnir
08992a5f2f refactor(compiler): compute the list of dependencies for defer blocks (#51162)
This commit brings the logic to calculate teh set of dependencies for each defer block. For each dependency we also identify whether it can be defer-loaded or not.

PR Close #51162
2023-08-01 11:50:05 -07:00
Payam Valadkhan
a15a56cb5d refactor(compiler): add a new interface for NgModule metadata to t rebase be used in local compilation mode (#50577)
The new interface is discrete-unioned with the existing interface to cover the cases for local and global (i.e., full and partial) compilation modes.

This change of interface required some adjustmeents cross repo which explains the changes made to other files.

PR Close #50577
2023-06-30 11:38:35 -07:00
Kristiyan Kostadinov
f6da091228 refactor(compiler): introduce compiler infrastructure for input transforms (#50225)
Adds the necessary compiler changes to support input transform functions. The compiler output has changed in the following ways:

### Directive handler
The directive handler now extracts a reference to the input transform function and it resolves the type of its first parameter. It also asserts that the type can be referenced in the compiled output and that it doesn't clash with any pre-existing `ngAcceptInputType_` members.

### .d.ts
In the generated declaration files the compiler now inserts an `ngAcceptInputType_` member for each input with a `transform` function. The member's type corresponds to the type of the first parameter of the function, e.g.

```typescript
// foo.directive.ts
@Directive()
export class Foo {
  @Input({transform: (incomingValue: string) => parseInt(incomingValue)}) value: number;
}

// foo.directive.d.ts
export class Foo {
  value: number;
  static ngAcceptInputType_value: string;
}
```

### Type check block
If an input has `transform` function, the TCB will use the type of its first parameter for the setter type. This uses the same infrastructure as the `ngAcceptInputType_` members.

### Directive declaration
The generated runtime directive declaration call now includes the `transform` function in the `inputs` map, if the input is being transformed. The function will be picked up by the runtime in the next commit to do the actual transformation.

```typescript
// foo.directive.ts
@Directive()
export class Foo {
  @Input({transform: (incomingValue: string) => parseInt(incomingValue)}) value: number;
}

// foo.directive.js
export class Foo {
  ɵdir = ɵɵdefineDirective({
    inputs: {
      value: ['value', 'value', incomingValue => parseInt(incomingValue)]
    }
  });
}
```

PR Close #50225
2023-05-22 14:48:02 +00:00
Andrew Scott
5214df4958 refactor(compiler-cli): Add signals to internal directive metadata (#49981)
This commit adds the `signals: boolean` property to the internal
directive/component metadata. This does not add it to the public API
yet, as the feature has no internal support other than compiler
detection.

PR Close #49981
2023-04-25 15:39:18 -07:00
JoostK
c20deb7e8d refactor(compiler-cli): only use a single type expression (#49136)
The concept of "internal" and "adjacent" type expression used to be necessary to support
ngcc, as it had to process downleveled class declarations using an IIFE, where the class
name within the IIFE could be different from the outer class name. With the removal of
ngcc we no longer need to make this distinction, so this commit removes these concepts
entirely.

PR Close #49136
2023-04-03 19:20:00 -07:00
Kristiyan Kostadinov
8f539c11f4 feat(compiler): add support for compile-time required inputs (#49468)
Adds support for marking a directive input as required. During template type checking, the compiler will verify that all required inputs have been specified and will raise a diagnostic if one or more are missing. Some specifics:
* Inputs are marked as required by passing an object literal with a `required: true` property to the `Input` decorator or into the `inputs` array.
* Required inputs imply that the directive can't work without them. This is why there's a new check that enforces that all required inputs of a host directive are exposed on the host.
* Required input diagnostics are reported through the `OutOfBandDiagnosticRecorder`, rather than generating a new structure in the TCB, because it allows us to provide a better error message.
* Currently required inputs are only supported during AOT compilation, because knowing which bindings are present during JIT can be tricky and may lead to increased bundle sizes.

Fixes #37706.

PR Close #49468
2023-03-20 13:10:30 +01:00
Andrew Scott
8d99ad0a39 Revert "feat(compiler): add support for compile-time required inputs (#49453)" (#49467)
This reverts commit 13dd614cd1.

This breaks a g3 Typescript compilation tests where diagnostics are
expected for a missing input in the component.

PR Close #49467
2023-03-17 18:29:14 +01:00
Kristiyan Kostadinov
13dd614cd1 feat(compiler): add support for compile-time required inputs (#49453)
Adds support for marking a directive input as required. During template type checking, the compiler will verify that all required inputs have been specified and will raise a diagnostic if one or more are missing. Some specifics:
* Inputs are marked as required by passing an object literal with a `required: true` property to the `Input` decorator or into the `inputs` array.
* Required inputs imply that the directive can't work without them. This is why there's a new check that enforces that all required inputs of a host directive are exposed on the host.
* Required input diagnostics are reported through the `OutOfBandDiagnosticRecorder`, rather than generating a new structure in the TCB, because it allows us to provide a better error message.
* Currently required inputs are only supported during AOT compilation, because knowing which bindings are present during JIT can be tricky and may lead to increased bundle sizes.

Fixes #37706.

PR Close #49453
2023-03-17 11:49:17 +01:00
Alex Rickabaugh
560b226a43 Revert "feat(compiler): add support for compile-time required inputs (#49304)" (#49449)
This reverts commit 1a6ca68154.

This breaks tests in google3 which might be depending on private APIs. We
need to update these tests before we can land this PR.

PR Close #49449
2023-03-16 10:38:04 -07:00
Kristiyan Kostadinov
1a6ca68154 feat(compiler): add support for compile-time required inputs (#49304)
Adds support for marking a directive input as required. During template type checking, the compiler will verify that all required inputs have been specified and will raise a diagnostic if one or more are missing. Some specifics:
* Inputs are marked as required by passing an object literal with a `required: true` property to the `Input` decorator or into the `inputs` array.
* Required inputs imply that the directive can't work without them. This is why there's a new check that enforces that all required inputs of a host directive are exposed on the host.
* Required input diagnostics are reported through the `OutOfBandDiagnosticRecorder`, rather than generating a new structure in the TCB, because it allows us to provide a better error message.
* Currently required inputs are only supported during AOT compilation, because knowing which bindings are present during JIT can be tricky and may lead to increased bundle sizes.

Fixes #37706.

PR Close #49304
2023-03-15 16:59:24 -07:00
Kristiyan Kostadinov
be97c87023 refactor(compiler): required inputs prerequisite refactors (#49333)
Based on the discussion in https://github.com/angular/angular/pull/49304#discussion_r1124732608. Reworks the compiler internals to allow for additional information about inputs to be stored. This is a prerequisite for required inputs.

PR Close #49333
2023-03-14 09:27:49 -07:00
Kristiyan Kostadinov
dd42974b07 feat(core): support TypeScript 4.9 (#48005)
Updates to TypeScript 4.9 and resolves some of the errors and deprecation warnings that showed up as a result.

PR Close #48005
2022-12-06 10:45:33 -08:00
Kristiyan Kostadinov
54ceed53e2 refactor(compiler): add support for host directives (#46868)
This is the compile-time implementation of the `hostDirectives` feature plus a little bit of runtime code to illustrate how the newly-generated code will plug into the runtime. It works by creating a call to the new `ɵɵHostDirectivesFeature` feature whenever a directive has a `hostDirectives` field. Afterwards `ɵɵHostDirectivesFeature` will patch a new function onto the directive definition that will be invoked during directive matching.

For example, if we take the following definition:

```ts
@Directive({
  hostDirectives: [HostA, {directive: HostB, inputs: ['input: alias']}]
})
class MyDir {}
```

Will compile to:

```js
MyDir.ɵdir = ɵɵdefineComponent({
  features: [ɵɵHostDirectivesFeature([HostA, {
    directive: HostB,
    inputs: {
      input: "alias"
    }
  }])]
});
```

The template type checking is implemented during directive matching by adding the host directives applied on the host to the array of matched directives whenever the host is matched in a template.

Relates to #8785.

PR Close #46868
2022-08-22 16:00:35 -07:00