Open jeromelaban opened 6 months ago
@jeromelabanGiven that https://github.com/dotnet/runtime/issues/93860 has been merged and you've confirmed Hot Reloading is working on that thread, do you have an expected release date for C# Markup Hot Reloading for iOS and Android apps?
@codesquatch Android should work better, though there's a fix that coming in the next release, iOS is still pending this specific issue.
@jeromelaban Appreciate the quick response. Unfortunately Hot Reloading is not working for me even on the Android simulator. I'm on Mac OS, VS Code with Uno Platform extension installed and used to build/debug on a Pixel_3a_API_34
. I'm using C# Markup instead of XAML for the UI.
Thanks. Note that hot reload on android only works when the debugger is not attached. We're waiting on this issue which should improve the story with the debugger on vscode (even if the issue is about VS windows).
What would you like to be added
C# Hot Reload for iOS/Catalyst fails with:
While this particular validation does not happen in Android, this fails with iOS/Catalyst.
This particular behavior is handled by the source generator here:
https://github.com/unoplatform/uno/blob/315067c12e3fb077483b5ed94e2bb612f07857b8/src/SourceGenerators/Uno.UI.SourceGenerators/NativeCtor/NativeCtorsGenerator.cs#L165-L166
And to work around it, we'll need to avoid using the
CreateNewOnMetadataUpdate
and rely on the newest Roslyn to handle lambda captures.Additional information
The only catch for this feature is MetadataUpdateHanders not being supported yet on VS 2022 for iOS/Android (this, this), and updatedTypes not working on wasm (this), which means we still need a way to detect updated types.
Possibly, we could generate internal
CreateNewOnMetadataUpdateAttribute
tagged empty types that mirror the original modified types, so that we can determine what was actually changed and raiseMetadataUpdateHandlers
in Partial Reload.Update: Android randomly fails for a similar reason, where duplicate types are not handled properly by the runtime.