micronaut-projects / micronaut-views

Micronaut Integration with Server Side View Rendering
Apache License 2.0
28 stars 32 forks source link

any plan to support live views? #23

Open avierr opened 4 years ago

avierr commented 4 years ago

most frameworks support this:

Erlang Phoenix https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html

PHP Laravel https://laravel-livewire.com/

C# RazorPages https://docs.microsoft.com/en-us/aspnet/core/razor-pages/?view=aspnetcore-3.0&tabs=visual-studio

graemerocher commented 4 years ago

First I have heard of it. Can you point to any Java frameworks that do?

avierr commented 4 years ago

I don't think any Java Frameworks do that yet, Github uses a similar technology as well(if you look at any page and view the AJAX requests), The biggest benefit being not having to touch Javascript(and gazillion dependencies) and not having to manually write AJAX calls for majority of the UI work which makes it really productive.

I'll try and make some prototype and see If can figure things out for the java environment.

benmccann commented 4 years ago

I'm not sure most frameworks support it. Just just three to my knowledge. (Btw, I think you meant Blazor and not Razor Pages).

I hadn't heard of it until this post, but basically all state is kept on the server and updates are passed to the client through a web socket. I haven't used any of these solutions, but I'd imagine you need to create more than a view layer because you would need a state management system on the server-side.

Introducing web sockets seems like a complication. What if a server goes down? The Laravel implementation is different and doesn't use web sockets. I'd be curious what the tradeoffs are there

I imagine performance is an issue on high latency connections with this type of setup. I expect develop productivity is higher if you're doing a lot of ajax, but don't have many interactive components. That's because it also seems like a leaky abstraction since you still need to call out to JS for many things (e.g. if you want any interactive component like a drop-down, modal, datepicker, etc.)

Anyway, I imagine if you wanted to support this, the way to do it is build it in a new repo independent of Micronaut so it could be used by any Java web server and then create an integration library for Micronaut if necessary.

adrianomitre commented 3 years ago

Two more languages and frameworks that have implemented similar functionality: