From 793f31b9b3dbed334dd94c5fc29112a5252a08ae Mon Sep 17 00:00:00 2001 From: Olivier Combe Date: Wed, 16 Aug 2017 21:01:59 +0200 Subject: [PATCH] feat(common): add an empty DeprecatedI18NPipesModule module Adding an empty module to ease the migration to the i18n pipes. --- packages/common/src/common.ts | 2 +- packages/common/src/common_module.ts | 16 ++++++++++++++++ tools/public_api_guard/common/common.d.ts | 4 ++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/common/src/common.ts b/packages/common/src/common.ts index c4e7d3cb76..5e79a49ad1 100644 --- a/packages/common/src/common.ts +++ b/packages/common/src/common.ts @@ -14,7 +14,7 @@ export * from './location/index'; export {NgLocaleLocalization, NgLocalization} from './localization'; export {parseCookieValue as ɵparseCookieValue} from './cookie'; -export {CommonModule} from './common_module'; +export {CommonModule, DeprecatedI18NPipesModule} from './common_module'; export {NgClass, NgFor, NgForOf, NgForOfContext, NgIf, NgIfContext, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet, NgComponentOutlet} from './directives/index'; export {DOCUMENT} from './dom_tokens'; export {AsyncPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, JsonPipe, LowerCasePipe, CurrencyPipe, DecimalPipe, PercentPipe, SlicePipe, UpperCasePipe, TitleCasePipe} from './pipes/index'; diff --git a/packages/common/src/common_module.ts b/packages/common/src/common_module.ts index 7c80454f93..4a75bb4f39 100644 --- a/packages/common/src/common_module.ts +++ b/packages/common/src/common_module.ts @@ -29,3 +29,19 @@ import {COMMON_PIPES} from './pipes/index'; }) export class CommonModule { } + +/** + * I18N pipes are being changed to move away from using the JS Intl API. + * + * The former pipes relying on the Intl API will be moved to this module while the `CommonModule` + * will contain the new pipes that do not rely on Intl. + * + * As a first step this module is created empty to ease the migration. + * + * see https://github.com/angular/angular/pull/18284 + * + * @deprecated from v5 + */ +@NgModule({declarations: [], exports: []}) +export class DeprecatedI18NPipesModule { +} diff --git a/tools/public_api_guard/common/common.d.ts b/tools/public_api_guard/common/common.d.ts index 3160d61883..b0b8129927 100644 --- a/tools/public_api_guard/common/common.d.ts +++ b/tools/public_api_guard/common/common.d.ts @@ -33,6 +33,10 @@ export declare class DecimalPipe implements PipeTransform { transform(value: any, digits?: string): string | null; } +/** @deprecated */ +export declare class DeprecatedI18NPipesModule { +} + /** @stable */ export declare const DOCUMENT: InjectionToken;