From 7f742114d303f52215567dce08eac82a7b4b9f5d Mon Sep 17 00:00:00 2001 From: mmalerba Date: Mon, 10 Jun 2019 10:41:14 -0700 Subject: [PATCH] Revert "refactor(core): remove version placeholder workaround" (#16246) This reverts commit 2b375151f796723afc44c08b7a61778d96009191. --- .../core/common-behaviors/common-module.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/material/core/common-behaviors/common-module.ts b/src/material/core/common-behaviors/common-module.ts index e14956878a3..b546dc011c9 100644 --- a/src/material/core/common-behaviors/common-module.ts +++ b/src/material/core/common-behaviors/common-module.ts @@ -6,11 +6,17 @@ * found in the LICENSE file at https://angular.io/license */ -import {VERSION as CDK_VERSION} from '@angular/cdk'; +import {NgModule, InjectionToken, Optional, Inject, isDevMode, Version} from '@angular/core'; +import {HammerLoader, HAMMER_LOADER} from '@angular/platform-browser'; import {BidiModule} from '@angular/cdk/bidi'; -import {Inject, InjectionToken, isDevMode, NgModule, Optional} from '@angular/core'; -import {HAMMER_LOADER, HammerLoader} from '@angular/platform-browser'; -import {VERSION as MAT_VERSION} from '../version'; +import {VERSION as CDK_VERSION} from '@angular/cdk'; + +// Private version constant to circumvent test/build issues, +// i.e. avoid core to depend on the @angular/material primary entry-point +// Can be removed once the Material primary entry-point no longer +// re-exports all secondary entry-points +const VERSION = new Version('0.0.0-PLACEHOLDER'); + /** Injection token that configures whether the Material sanity checks are enabled. */ export const MATERIAL_SANITY_CHECKS = new InjectionToken('mat-sanity-checks', { @@ -108,9 +114,9 @@ export class MatCommonModule { /** Checks whether the material version matches the cdk version */ private _checkCdkVersionMatch(): void { - if (MAT_VERSION.full !== CDK_VERSION.full) { + if (VERSION.full !== CDK_VERSION.full) { console.warn( - 'The Angular Material version (' + MAT_VERSION.full + ') does not match ' + + 'The Angular Material version (' + VERSION.full + ') does not match ' + 'the Angular CDK version (' + CDK_VERSION.full + ').\n' + 'Please ensure the versions of these two packages exactly match.' );