micronaut-views icon indicating copy to clipboard operation
micronaut-views copied to clipboard

any plan to support live views?

Open solidpulse opened this issue 6 years ago • 4 comments
trafficstars

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

solidpulse avatar Nov 07 '19 17:11 solidpulse

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

graemerocher avatar Nov 08 '19 08:11 graemerocher

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.

solidpulse avatar Nov 08 '19 11:11 solidpulse

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.

benmccann avatar May 06 '20 02:05 benmccann

Two more languages and frameworks that have implemented similar functionality:

  • Django - https://github.com/edelvalle/reactor
  • Ruby on Rails - https://docs.stimulusreflex.com/

adrianomitre avatar Jul 28 '20 17:07 adrianomitre