There were three options being made available to users of the linker: - ` enableI18nLegacyMessageIdFormat` - `i18nNormalizeLineEndingsInICUs` - ` i18nUseExternalIds` None of these should actually be configurable at linking time because partially-linked libraries have tighter restrictions on what i18n options can be used. This commit removes those options from the `LinkerOptions` interface. It was considered to add a check for backwards compatibilty to ensure that if these options were being passed, and were different to the expected defaults, we would throw an informative error. But from looking at the Angular CLI (the only known client of the linker) it has never been setting these options so they have already always been set to the defaults. BREAKING CHANGE: Linked libraries no longer generate legacy i18n message ids. Any downstream application that provides translations for these messages, will need to migrate their message ids using the `localize-migrate` command line tool. Closes #40673 PR Close #41554
35 lines
919 B
TypeScript
35 lines
919 B
TypeScript
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
/**
|
|
* Options to configure the linking behavior.
|
|
*/
|
|
export interface LinkerOptions {
|
|
/**
|
|
* Whether to use source-mapping to compute the original source for external templates.
|
|
* The default is `true`.
|
|
*/
|
|
sourceMapping: boolean;
|
|
|
|
/**
|
|
* This option tells the linker to generate information used by a downstream JIT compiler.
|
|
*
|
|
* Specifically, in JIT mode, NgModule definitions must describe the `declarations`, `imports`,
|
|
* `exports`, etc, which are otherwise not needed.
|
|
*/
|
|
linkerJitMode: boolean;
|
|
}
|
|
|
|
/**
|
|
* The default linker options to use if properties are not provided.
|
|
*/
|
|
export const DEFAULT_LINKER_OPTIONS: LinkerOptions = {
|
|
sourceMapping: true,
|
|
linkerJitMode: false,
|
|
};
|