angular/packages/compiler/src/render3
Pete Bacon Darwin 3923201f95 refactor(compiler-cli): change how partial-linkers are matched to declaration versions (#41578)
Previously, it was not possible to block a partial-linker from trying to
process a declaration that was defined in a newer version of Angular than
that of the partial-linker. For example, if a partial-linker was published as
part of version 12.0.0, there was no way for a partially-compiled declaration
compiled via version 13.0.0 to tell the 12.0.0 linker that it would be invalid
to attempt to process it.

This commit adds a new `minVersion` property to partial-declarations, which is
interpreted as the "minimum partial-linker version" that can process this
declaration. When selecting a partial-linker for such a declaration, the known
linker version ranges are checked to find the most recent linker whose version
range has an overlap with the interpreted declaration range.

This approach allows us to set a minimum version for a declaration, which
can inform an old partial-linker that will it not be able to accurately
process the declaration.

Note that any pre-release part to versions are ignored in this selection
process.

The file-linker can be configured, via the `unknownDeclarationVersionHandling`
property of `LinkerOptions`, to handle such a situation in one of three ways:

- `error` - the version mismatch is a fatal error
- `warn` - a warning is sent to the logger but the most recent partial-linker
  will attempt to process the declaration anyway.
- `ignore` - the most recent partial-linker will, silently, attempt to process
  the declaration.

The default is to throw an error.

Closes #41497

PR Close #41578
2021-04-14 11:00:40 -07:00
..
partial refactor(compiler-cli): change how partial-linkers are matched to declaration versions (#41578) 2021-04-14 11:00:40 -07:00
view refactor(compiler): fix typo (#41316) 2021-04-07 13:57:12 -07:00
r3_ast.ts refactor(compiler): option to include html comments in ParsedTemplate (#41251) 2021-03-29 15:16:26 -07:00
r3_class_metadata_compiler.ts refactor(compiler-cli): introduce declaration function to declare class metadata (#41200) 2021-04-12 10:41:17 -07:00
r3_factory.ts refactor(compiler): rename R3FactoryTarget to FactoryTarget (#41231) 2021-03-30 16:46:37 -07:00
r3_identifiers.ts refactor(compiler-cli): introduce declaration function to declare class metadata (#41200) 2021-04-12 10:41:17 -07:00
r3_injector_compiler.ts refactor(compiler): use ɵɵInjectorDeclaration rather than ɵɵInjectorDef in compiled output (#41119) 2021-03-22 08:57:18 -07:00
r3_jit.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
r3_module_compiler.ts refactor(core): rename ...WithMeta types to ...Declaration and alias to unknown (#41119) 2021-03-22 08:57:18 -07:00
r3_pipe_compiler.ts refactor(core): rename ...WithMeta types to ...Declaration and alias to unknown (#41119) 2021-03-22 08:57:18 -07:00
r3_template_transform.ts refactor(compiler): option to include html comments in ParsedTemplate (#41251) 2021-03-29 15:16:26 -07:00
util.ts refactor(compiler-cli): implement ɵɵngDeclareNgModule and ɵɵngDeclareInjector (#41080) 2021-03-15 13:26:51 -07:00