Skip to content

Commit

Permalink
feat: Initialize runtime exports at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
ebariche committed Dec 6, 2022
1 parent a860abf commit 83f5da7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/Uno.UI/ts/ExportManager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Uno.UI {

export class ExportManager {

public static async initialize(): Promise<void> {

if ((<any>Module).getAssemblyExports !== undefined) {
const unoExports = await (<any>Module).getAssemblyExports("Uno");
const unoUIExports = await (<any>Module).getAssemblyExports("Uno.UI");

(<any>globalThis).DotnetExports = { Uno: unoExports, UnoUI: unoUIExports };
}
}
}
}
2 changes: 1 addition & 1 deletion src/Uno.UI/ts/WindowManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace Uno.UI {
private static buildReadyPromise(): Promise<boolean> {
return new Promise<boolean>(resolve => {
Promise.all(
[WindowManager.buildSplashScreen()]
[WindowManager.buildSplashScreen(), ExportManager.initialize()]
).then(() => resolve(true))
});
}
Expand Down

0 comments on commit 83f5da7

Please sign in to comment.