mediamonks / muban

A backend-agnostic framework to enhance server-rendered HTML using a modern webpack development setup.
https://mediamonks.github.io/muban/
39 stars 15 forks source link

Consider adding a page fetcher/swapper like Turbolinks #132

Open skulptur opened 4 years ago

skulptur commented 4 years ago

I haven't directly tested Turbolinks with Muban, but skimming over its documentation looked like it should work out-of-the-box. If that is the case, we could get a much better UX out of our websites with virtually no cost. I am willing to work on the PR if this feature is something we are considering a good fit for Muban.

ThaNarie commented 4 years ago

Funny enough we did similar things 7-8 years ago already before going to SPA route :)

We might need to be careful - If you read the docs, there are quite a few cases where manual intervention is needed to ignore certain turbolinks-behaviour because it would have resulted in unwanted scenarios (at least, different from what would happen in a normal browser).

A downside for me is the user of eval for executing inline script tags that are loaded through XHR. Although inline script tags should not be used at any case when using correct CSP setting.

It has my blessing if:

Luckily it can be turned off easily as well without any downsides, so could be worth a try in an existing project first.

ThijsTyZ commented 4 years ago

I wonder if this could lead to memory leaks when the JavaScript is not disposed properly.