Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions packages/mgt-element/src/components/baseComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -128,6 +129,7 @@ export abstract class MgtBaseComponent extends LitElement {

constructor() {
super();
emitDeprecationWarning();
this.handleDirectionChanged();
this.handleLocalizationChanged();
}
Expand Down
2 changes: 2 additions & 0 deletions packages/mgt-element/src/components/baseTaskComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand Down Expand Up @@ -96,6 +97,7 @@ export abstract class MgtBaseTaskComponent extends LitElement {

constructor() {
super();
emitDeprecationWarning();
this.handleDirectionChanged();
this.handleLocalizationChanged();
}
Expand Down
33 changes: 33 additions & 0 deletions packages/mgt-element/src/utils/deprecationWarning.ts
Original file line number Diff line number Diff line change
@@ -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.
}
};
Loading