Skip to content

Commit b1f0ff1

Browse files
authored
[infra] Remove last deprecated ponyfillGlobal usage (#18003)
1 parent 7b9a58a commit b1f0ff1

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

packages/x-license/src/utils/licenseInfo.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
1-
import { ponyfillGlobal } from '@mui/utils';
2-
31
/**
42
* @ignore - do not document.
53
*/
64
export interface MuiLicenseInfo {
75
key: string | undefined;
86
}
97

8+
declare namespace globalThis {
9+
// eslint-disable-next-line no-underscore-dangle, @typescript-eslint/naming-convention
10+
let __MUI_LICENSE_INFO__: MuiLicenseInfo;
11+
}
12+
1013
// Store the license information in a global, so it can be shared
1114
// when module duplication occurs. The duplication of the modules can happen
1215
// if using multiple version of MUI X at the same time of the bundler
1316
// decide to duplicate to improve the size of the chunks.
1417
// eslint-disable-next-line no-underscore-dangle
15-
ponyfillGlobal.__MUI_LICENSE_INFO__ = ponyfillGlobal.__MUI_LICENSE_INFO__ || {
18+
globalThis.__MUI_LICENSE_INFO__ = globalThis.__MUI_LICENSE_INFO__ || {
1619
key: undefined,
1720
};
1821

1922
export class LicenseInfo {
2023
private static getLicenseInfo() {
2124
// eslint-disable-next-line no-underscore-dangle
22-
return ponyfillGlobal.__MUI_LICENSE_INFO__;
25+
return globalThis.__MUI_LICENSE_INFO__;
2326
}
2427

2528
public static getLicenseKey(): MuiLicenseInfo['key'] {

test/utils/licenseRelease.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
import { ponyfillGlobal } from '@mui/utils';
2-
31
// eslint-disable-next-line no-underscore-dangle
4-
ponyfillGlobal.__MUI_RELEASE_INFO__ = 'MTU5NjMxOTIwMDAwMA=='; // 2020-08-02
2+
globalThis.__MUI_RELEASE_INFO__ = 'MTU5NjMxOTIwMDAwMA=='; // 2020-08-02

0 commit comments

Comments
 (0)