Skip to content

Commit

Permalink
refactor: extract polyfill and polyfill-like code to an optional modu…
Browse files Browse the repository at this point in the history
…le (#5752)

* refactor: extract polyfill and polyfill-like code to an optional module

* Change files

* fix: correct build break in fast-foundation from removing $global

* fix: update templates to use classList and fix classList bug

* Change files

* feat: require trusted types for bindings to innerHtml & move core policy

* fix: bug that arises when there are real trusted types

* refactor: minor internal cleanup in the polyfills

* fix: remove polyfill external module dependency

Co-authored-by: EisenbergEffect <[email protected]>
  • Loading branch information
EisenbergEffect and EisenbergEffect committed Apr 12, 2022
1 parent 1cf461d commit ab8e75d
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions packages/web-components/fast-element/src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ const propConfig = {
writable: false,
};

if ($global.FAST === void 0) {
Reflect.defineProperty($global, "FAST", {
if (globalThis.FAST === void 0) {
Reflect.defineProperty(globalThis, "FAST", {
value: Object.create(null),
...propConfig,
});
Expand All @@ -64,7 +64,7 @@ if ($global.FAST === void 0) {
* The FAST global.
* @internal
*/
export const FAST = $global.FAST;
export const FAST: FASTGlobal = globalThis.FAST;

if (FAST.getById === void 0) {
const storage = Object.create(null);
Expand All @@ -83,17 +83,6 @@ if (FAST.getById === void 0) {
});
}

/**
* Core services shared across FAST instances.
* @internal
*/
export const enum KernelServiceId {
updateQueue = 1,
observable = 2,
contextEvent = 3,
elementRegistry = 4,
}

/**
* A readonly, empty array.
* @remarks
Expand Down

0 comments on commit ab8e75d

Please sign in to comment.