diff --git a/packages/mgt-element/src/components/baseComponent.ts b/packages/mgt-element/src/components/baseComponent.ts index 19a4d5544c..c27bfa804e 100644 --- a/packages/mgt-element/src/components/baseComponent.ts +++ b/packages/mgt-element/src/components/baseComponent.ts @@ -11,6 +11,7 @@ import { ProviderState } from '../providers/IProvider'; import { Providers } from '../providers/Providers'; import { LocalizationHelper } from '../utils/LocalizationHelper'; import { PACKAGE_VERSION } from '../utils/version'; +import { emitDeprecationWarning } from '../utils/deprecationWarning'; /** * Defines media query based on component width @@ -128,6 +129,7 @@ export abstract class MgtBaseComponent extends LitElement { constructor() { super(); + emitDeprecationWarning(); this.handleDirectionChanged(); this.handleLocalizationChanged(); } diff --git a/packages/mgt-element/src/components/baseTaskComponent.ts b/packages/mgt-element/src/components/baseTaskComponent.ts index ae25c97bfa..428d8c1269 100644 --- a/packages/mgt-element/src/components/baseTaskComponent.ts +++ b/packages/mgt-element/src/components/baseTaskComponent.ts @@ -13,6 +13,7 @@ import { ProviderState } from '../providers/IProvider'; import { Providers } from '../providers/Providers'; import { LocalizationHelper } from '../utils/LocalizationHelper'; import { PACKAGE_VERSION } from '../utils/version'; +import { emitDeprecationWarning } from '../utils/deprecationWarning'; import { ComponentMediaQuery } from './baseComponent'; /** @@ -96,6 +97,7 @@ export abstract class MgtBaseTaskComponent extends LitElement { constructor() { super(); + emitDeprecationWarning(); this.handleDirectionChanged(); this.handleLocalizationChanged(); } diff --git a/packages/mgt-element/src/utils/deprecationWarning.ts b/packages/mgt-element/src/utils/deprecationWarning.ts new file mode 100644 index 0000000000..e181543178 --- /dev/null +++ b/packages/mgt-element/src/utils/deprecationWarning.ts @@ -0,0 +1,33 @@ +/** + * ------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. + * See License in the project root for license information. + * ------------------------------------------------------------------------------------------- + */ + +let hasWarned = false; + +/** + * Emits a one-time console warning informing consumers that the + * Microsoft Graph Toolkit has been retired. + * + * The warning is emitted at most once per runtime, and any failure to + * write to the console is swallowed so this can never break a host app. + */ +export const emitDeprecationWarning = (): void => { + if (hasWarned) { + return; + } + hasWarned = true; + + try { + console.warn( + '🦒: The Microsoft Graph Toolkit was retired on August 28, 2026 and is no longer maintained. ' + + 'This package will receive no further updates. ' + + 'If you would like to continue using or maintaining MGT, you are welcome to fork the repository: ' + + 'https://github.com/microsoftgraph/microsoft-graph-toolkit' + ); + } catch { + // Never allow logging to break a host application. + } +};