Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: restore metadata updated, include new pdb delta (backport #612) #613

Merged
merged 2 commits into from
Nov 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<Product>$(AssemblyName) ($(TargetFramework))</Product>
<DefaultLanguage>en-US</DefaultLanguage>
<LangVersion>8.0</LangVersion>
<LangVersion>11.0</LangVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Uno.Wasm.Bootstrap/ts/Uno/WebAssembly/Bootstrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,11 @@ namespace Uno.WebAssembly.Bootstrap {

this.setupRequire();
this.setupEmscriptenPreRun();
this.setupHotReload();
}

private setupHotReload() {
if (this._context.Module.ENVIRONMENT_IS_WEB && this.hasDebuggingEnabled()) {
this._hotReloadSupport = new HotReloadSupport(this._context);
this._hotReloadSupport = new HotReloadSupport(this._context, this._unoConfig);
}
}

Expand Down Expand Up @@ -271,6 +270,7 @@ namespace Uno.WebAssembly.Bootstrap {
private async mainInit(): Promise<void> {
try {
this.attachDebuggerHotkey();
this.setupHotReload();
this.timezoneSetup();

if (this._hotReloadSupport) {
Expand Down
13 changes: 8 additions & 5 deletions src/Uno.Wasm.Bootstrap/ts/Uno/WebAssembly/HotReloadSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

export class HotReloadSupport {
private _context?: DotnetPublicAPI;
private _unoConfig?: UnoConfig;

constructor(context: DotnetPublicAPI) {
constructor(context: DotnetPublicAPI, unoConfig: UnoConfig) {
this._context = context;
this._unoConfig = unoConfig;
}

public async initializeHotReload(): Promise<void> {

const webAppBasePath = this._unoConfig.environmentVariables["UNO_BOOTSTRAP_WEBAPP_BASE_PATH"];

// Take the place of the internal .NET for WebAssembly APIs for metadata updates coming
// from the "BrowserLink" feature.

Expand All @@ -25,7 +29,6 @@
},

applyExisting: async function (): Promise<void> {
const webAppBasePath = this._unoConfig.environmentVariables["UNO_BOOTSTRAP_WEBAPP_BASE_PATH"];

var hotreloadConfigResponse = await fetch(`/_framework/unohotreload`);

Expand Down Expand Up @@ -54,13 +57,13 @@
return this.getApplyUpdateCapabilitiesMethod();
},

applyHotReload: function (moduleId: any, metadataDelta: any, ilDelta: any) {
applyHotReload: function (moduleId: any, metadataDelta: any, ilDelta: any, pdbDelta: any) {
this.initialize();
return this.applyHotReloadDeltaMethod(moduleId, metadataDelta, ilDelta);
return this.applyHotReloadDeltaMethod(moduleId, metadataDelta, ilDelta, pdbDelta || "");
}
};
})((<any>window).Blazor || ((<any>window).Blazor = {}));

// Apply pending updates caused by a browser refresh
(<any>window).Blazor._internal.initialize(this._context.BINDING);
await (<any>window).Blazor._internal.applyExisting();
Expand Down
Loading