Skip to content

Commit

Permalink
chore: move clear globalLoading logic to resetFederationGlobalInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
2heal1 committed Nov 6, 2024
1 parent b4a4469 commit a62ac79
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions packages/node/src/utils/hot-reload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ export const performReload = async (
gs.entryChunkCache.clear();
}

Object.keys(helpers.global.globalLoading).forEach((key) => {
delete helpers.global.globalLoading[key];
});
//@ts-ignore
gs.__FEDERATION__.__INSTANCES__.map((i: any) => {
//@ts-ignore
Expand Down
4 changes: 4 additions & 0 deletions packages/runtime/src/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ export function resetFederationGlobalInfo(): void {
globalThis.__FEDERATION__.moduleInfo = {};
globalThis.__FEDERATION__.__SHARE__ = {};
globalThis.__FEDERATION__.__MANIFEST_LOADING__ = {};

Object.keys(globalLoading).forEach((key) => {
delete globalLoading[key];
});
}

export function getGlobalFederationInstance(
Expand Down
3 changes: 0 additions & 3 deletions packages/runtime/src/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
globalLoading,
nativeGlobal,
resetFederationGlobalInfo,
getGlobalFederationInstance,
Expand Down Expand Up @@ -33,7 +32,6 @@ const ShareUtils: IShareUtils = {
interface IGlobalUtils {
Global: typeof Global;
nativeGlobal: typeof global;
globalLoading: typeof globalLoading;
resetFederationGlobalInfo: typeof resetFederationGlobalInfo;
getGlobalFederationInstance: typeof getGlobalFederationInstance;
setGlobalFederationInstance: typeof setGlobalFederationInstance;
Expand All @@ -55,7 +53,6 @@ interface IGlobalUtils {
const GlobalUtils: IGlobalUtils = {
Global,
nativeGlobal,
globalLoading,
resetFederationGlobalInfo,
getGlobalFederationInstance,
setGlobalFederationInstance,
Expand Down

0 comments on commit a62ac79

Please sign in to comment.