Skip to content

refactor(core): remove version placeholder workaround #16231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions src/material/core/common-behaviors/common-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@
* found in the LICENSE file at https://angular.io/license
*/

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 {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');

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';

/** Injection token that configures whether the Material sanity checks are enabled. */
export const MATERIAL_SANITY_CHECKS = new InjectionToken<boolean>('mat-sanity-checks', {
Expand Down Expand Up @@ -114,9 +108,9 @@ export class MatCommonModule {

/** Checks whether the material version matches the cdk version */
private _checkCdkVersionMatch(): void {
if (VERSION.full !== CDK_VERSION.full) {
if (MAT_VERSION.full !== CDK_VERSION.full) {
console.warn(
'The Angular Material version (' + VERSION.full + ') does not match ' +
'The Angular Material version (' + MAT_VERSION.full + ') does not match ' +
'the Angular CDK version (' + CDK_VERSION.full + ').\n' +
'Please ensure the versions of these two packages exactly match.'
);
Expand Down