-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Add support for updatedTypes in metadata updates #55347
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ | |
/// For framework use only. | ||
/// </summary> | ||
[JSInvokable(nameof(ApplyHotReloadDelta))] | ||
public static void ApplyHotReloadDelta(string moduleIdString, byte[] metadataDelta, byte[] ilDelta, byte[] pdbBytes) | ||
public static void ApplyHotReloadDelta(string moduleIdString, byte[] metadataDelta, byte[] ilDelta, byte[] pdbBytes, int[] updatedTypes) | ||
Check failure on line 46 in src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs Azure Pipelines / aspnetcore-ci (Build Build: Linux Musl ARM)src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs#L46
Check failure on line 46 in src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs Azure Pipelines / aspnetcore-ci (Build Build: Linux Musl ARM64)src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs#L46
Check failure on line 46 in src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs Azure Pipelines / aspnetcore-ci (Build Build: Linux x64)src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs#L46
Check failure on line 46 in src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs Azure Pipelines / aspnetcore-ci (Build Build: Linux Musl x64)src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs#L46
Check failure on line 46 in src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs Azure Pipelines / aspnetcore-ci (Build Build: Linux ARM)src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs#L46
Check failure on line 46 in src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs Azure Pipelines / aspnetcore-quarantined-pr (Tests: Ubuntu x64)src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs#L46
Check failure on line 46 in src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs Azure Pipelines / aspnetcore-ci (Build Build: Linux ARM64)src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs#L46
Check failure on line 46 in src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs Azure Pipelines / aspnetcore-ci (Build Test: Ubuntu x64)src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs#L46
Check failure on line 46 in src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs Azure Pipelines / aspnetcore-ci (Build Build: macOS arm64)src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs#L46
Check failure on line 46 in src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs Azure Pipelines / aspnetcore-ci (Build Test: macOS)src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs#L46
Check failure on line 46 in src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs Azure Pipelines / aspnetcore-quarantined-pr (Tests: macOS)src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs#L46
Check failure on line 46 in src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs Azure Pipelines / aspnetcore-ci (Build Build: macOS x64)src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs#L46
Check failure on line 46 in src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs Azure Pipelines / aspnetcore-quarantined-prsrc/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs#L46
Check failure on line 46 in src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs Azure Pipelines / aspnetcore-quarantined-prsrc/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs#L46
Check failure on line 46 in src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs Azure Pipelines / aspnetcore-cisrc/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs#L46
Check failure on line 46 in src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs Azure Pipelines / aspnetcore-cisrc/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs#L46
|
||
{ | ||
// Analyzer has a bug where it doesn't handle ConditionalAttribute: https://github.com/dotnet/roslyn/issues/63464 | ||
#pragma warning disable IDE0200 // Remove unnecessary lambda expression | ||
|
@@ -56,6 +56,7 @@ | |
_updateDeltas[0].MetadataDelta = metadataDelta; | ||
_updateDeltas[0].ILDelta = ilDelta; | ||
_updateDeltas[0].PdbBytes = pdbBytes; | ||
_updateDeltas[0].UpdatedTypes = updatedTypes; | ||
|
||
_hotReloadAgent.ApplyDeltas(_updateDeltas); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how the public API policy works here. The JS invoker will likely be able to invoke the method without a type, but there may be a need for a separate method that matches previous versions of VS (which injects the browserlink payload).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than having two separate methods, could we allow the
updatedTypes
parameter to be anint[]?
? It seems like this logic should still work even if the updated types are not provided by the scripts injected by the SDK. And we could make updatedBlazor._internal.applyHotReload
implementation passupdatedTypes ?? null
in the call todispatcher.invokeDotNetStaticMethod
.This is technically a breaking API change, but that should be fine in this case because the API is meant for framework use only (customers should not be relying on it).
If you are able to open the solution in VS, there should be a codefix to update the
PublicAPI.*.txt
files to reflect the public API changes. If you don't have this set up, I'd be happy to update those files and add the changes to this PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review! I was indeed able to run the code fix, it added an entry in the unshipped file.