dotnet / MobileBlazorBindings

Experimental Mobile Blazor Bindings - Build native and hybrid mobile apps with Blazor
MIT License
1.2k stars 152 forks source link

Question: HostBuilder and Dynamic Content #268

Open michaelstonis opened 3 years ago

michaelstonis commented 3 years ago

Is it possible to provide dynamic content to a HostBuilder and restart the host service?

This is essentially the workflow that I am interested in.

The feature that this would provide is something similar to CodePush on ReactNative.

My assumption is that this is not possible due to linking, code generation, etc. for mobile, but it would be pretty cool.

Eilon commented 3 years ago

Hmm very interesting question. I think that some devices, in particular iOS devices, wouldn't allow that due to dynamic code restrictions. But if you have a device where you have more control, such as on Windows or perhaps Android, I think you could do something similar to that by throwing away an entire BlazorWebView and its associated host, and creating everything new whenever you want to "reload".

Eilon commented 3 years ago

And that was specifically about web content in hybrid apps.

For native apps I'm less sure but it might be a similar story. It would certainly take some experimentation to play with it and see what works and what doesn't.

jspuij commented 3 years ago

There is hope for iOS: https://9to5mac.com/2020/11/06/ios-14-2-brings-jit-compilation-support-which-enables-emulation-apps-at-full-performance/

Still not possible for Store apps, but who knows, .net core might be allowed to JIT in the future. Since they have the fastest single core performance on iphones even compared to intel desktops or servers, performance is not really an argument anymore ;-)