Skip to content

Commit

Permalink
feat: chunk flushing in delegates
Browse files Browse the repository at this point in the history
  • Loading branch information
ScriptedAlchemy committed Feb 9, 2023
1 parent 5e2375f commit f8b8af6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
11 changes: 6 additions & 5 deletions packages/utilities/src/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,14 @@ export const importDelegatedModule = async (
console.log('typeof',prop, typeof target[prop]);

if(typeof target[prop] === "function") {
return (()=>{
console.log('calling method');
return target[prop]
})();
return function() {
//@ts-ignore
if(global.usedChunks) global.usedChunks.add("adding-" + arg);
// eslint-disable-next-line prefer-rest-params
return target[prop](arguments)
}
}
//@ts-ignore
if(global.usedChunks) global.usedChunks.add("adding-" + arg);
return target[prop];
}
})
Expand Down
14 changes: 7 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1763,7 +1763,7 @@
version "0.0.0"
uid ""

"@module-federation/node@link:./dist/packages/nextjs-mf/dist/packages/nextjs-mf/dist/packages/nextjs-mf/dist/packages/node":
"@module-federation/node@link:./dist/packages/nextjs-mf/dist/packages/nextjs-mf/dist/packages/nextjs-mf/dist/packages/nextjs-mf/dist/packages/node":
version "0.0.0"
uid ""

Expand Down Expand Up @@ -2498,7 +2498,7 @@
resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.26.tgz#bb65bc0fff712c8ca3702d9c0adc59894ca54bae"
integrity sha512-UPe7S+MezD/S6cKBIc50TduGzmw6PBz1Ms5p+5wDLOKYNS/LSEM4iRmLwvePzP5X8mOyesXrsbwxLy8KHP65Yw==

"@swc/core@1.3.26", "@swc/core@^1.3.3":
"@swc/core@^1.3.3":
version "1.3.26"
resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.26.tgz#6f7fe6ad54eac7ecffbdfa75d5c4300e2f96b8f6"
integrity sha512-U7vEsaLn3IGg0XCRLJX/GTkK9WIfFHUX5USdrp1L2QD29sWPe25HqNndXmUR9KytzKmpDMNoUuHyiuhpVrnNeQ==
Expand Down Expand Up @@ -12636,16 +12636,16 @@ tsconfig-paths@^4.0.0, tsconfig-paths@^4.1.2:
minimist "^1.2.6"
strip-bom "^3.0.0"

tslib@2.4.0, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3"
integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==

tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0:
version "1.14.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==

tslib@^2.1.0, tslib@^2.3.0, tslib@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3"
integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==

tsscmp@1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb"
Expand Down

0 comments on commit f8b8af6

Please sign in to comment.