chromelyapps / Chromely

Build Cross Platform HTML Desktop Apps on .NET using native GUI, HTML5, JavaScript, CSS, Owin, AspNetCore (MVC, RazorPages, Blazor)
MIT License
2.98k stars 279 forks source link

Migration guide to v5.1 #261

Closed xplicit closed 3 years ago

xplicit commented 3 years ago

Trying to update Chromely to the latest version and have found huge amount of breaking changes. Is there a guide how to migrate to the latest version of chromely?

For example not full list of breaking changes:

CommandAttritute(Route="") => CommandActionAttribute(RouteKey="")
HttpGetAttribute(Route="") => RequestAttribute(RouteKey="")
plus change params for RequestAction:
ChromelyRequest -> IChromelyRequest
ChromelyResponse -> IChromelyResponse

CefLifespanHandler -> DefaultLifespanHandler

FramelessWinAPIHost -> ChromelyWinFramelessHost. 
Now it Becomes internal and we cannot override WndProc and other methods. 
How to override methods of ChromelyWinFrameless host? 
UPD: Fixed in the latest commits

AppBuilder.UseContainer<> is missing 
(how to get access to container before running app, to add some required sevices?)
UPD: Fixed in the latest commits, new method is AppBuilder.UseServices(ServiceCollection services)

RegisterEventHandler(container, CefEventKey.ConsoleMessage, new ChromelyEventHandler<ConsoleMessageEventArgs>(CefEventKey.ConsoleMessage, OnConsoleMessage));  =>  ????

IChromelySchemeHandlerFactory => ???
IChromelyCustomHandler => ???

ExternalRequestSchemeHandlerFactory => DefaultExternalRequestSchemeHandlerFactory

IChromelyNativeHost.Close -> IChromelyNativeHost.HostClose

I am going to update the list during fixing incompatibilities issues...

mattkol commented 3 years ago

@xplicit

FramelessWinAPIHost -> ChromelyWinFramelessHost. Now it Becomes internal and we cannot override WndProc and other methods. How to override methods of ChromelyWinFrameless host?

This must have been overlooked it should be public as ChromelyWinHost.

mattkol commented 3 years ago

Trying to update Chromely to the latest version and have found huge amount of breaking changes. Is there a guide how to migrate to the latest version of chromely?

No official guide, but there should be enough info: Upgrade to v5.1 - Changes to DI, Logger; CefSharp, .NET 5 Support Documentation Demos.

xplicit commented 3 years ago

Thanks for making classes public. What about returning back analogue of AppBuilder.UseContainer<>? Something like AppBuilder.UseServices(ServiceCollection services) So we could use our own services instead of empty service collection which is created at this line

https://github.com/chromelyapps/Chromely/blob/master/src/Chromely.Core/AppBuilder.cs#L96

mattkol commented 3 years ago

What about returning back analogue of AppBuilder.UseContainer<>? Something like AppBuilder.UseServices(ServiceColelction services) So we could use our own services instead on empty service collection which is created at this line

Sure, good idea 👍

xplicit commented 3 years ago

Thank you! I was able to migrate to v5.1, solution is compiling now and I was able to see our React application inside of Chromely. Have a some issues with FramelessWindow, I'll look more deeper and post an another issue if it's related to changes in Chromely.