Phoenix LiveView and Pjax

phoenix
liveview
#1

Have anyone succeeded with Phoenix Live and Pjax (or other similar tool)? My point is that not all pages in my application require LiveView, but I would like it to not fully reload on each page change.

2 Likes

Phoenix LiveView is now... live!
#2

I think they should work together just fine. What have you tried?

3 Likes

#3

Ok, found it. I needed to disconnect while unloading and reconnect after load of the new page.

3 Likes

#4

I just started to migrate from Drab to pjax + LiveView. But currently LiveView is better suited for some use cases; updating a partial of pages interactively.

LiveView as a pjax isn’t ready since pushState is not supported. Turbolinks is actually more mature than LiveView in this area. Mobile support is as well. But in the long run I certain that the LiveView will replace the Turbolinks.

0 Likes

#5

I do not think that LiveView is at all meant to replace Pjax/Turbolinks. LiveView is (IMHO) meant to be “single page updater” not tool to handle multi page updates and content. And in that form I think that having both of these technologies to cooperate is quite easy and painless, so I do not see the problem with using both of them at the same time to handle everything.

1 Like

#6

So LiveView has no ambition to support SPA ?

0 Likes

#7

I have no idea, but form what I understand it isn’t meant to be „full fledged SPA framework” but rather mechanism for supporting „live view” components on the website.

0 Likes

#8

There have been two proposals so far, and the up to date one is here:

2 Likes

#9

This response is based on information given by @chrismccord 's talk at ElixirConf.eu:

  • LiveView has some clear limitations. For instance, it will not be able to work when the user is offline. So progressive web applications are the kind of things that LiveView will not work for. (See also the final paragraph before the summary of https://dockyard.com/blog/2018/12/12/phoenix-liveview-interactive-real-time-apps-no-need-to-write-javascript )
  • On the other hand, pushState-support is definitely something that will be added. Amongst other things because reflecting the state changes in the URL so that it can be bookmarked or shared is quite a common use case.
2 Likes