turbolinks / turbolinks-ios

Native iOS adapter for building hybrid apps with Turbolinks 5
MIT License
881 stars 92 forks source link

Using with a Non-Turbolinks Web App #41

Closed onato closed 7 years ago

onato commented 8 years ago

I am looking at adopting Turbolinks for future projects. I have a couple of existing apps, however, that are not yet updated to use Turbolinks. I notice that at present WebView.js relies on Turbolinks.controller. I managed to get a page of a non-turbolinks web-app to load by stubbing out Turbolinks.

var Turbolinks = Turbolinks || {controller:{restorationIdentifier:location.href} };

Does it make sense to try and get turbolinks-ios working with a non-turbolinks web app or is this going to painful?

exalted commented 8 years ago

Feels like #27 ?

onato commented 8 years ago

Indeed, thanks.

…since this framework is tightly coupled to a web server using Turbolinks, I don't think it would make sense…

onato commented 8 years ago

I would be interested to know what is…

tightly coupled to a web server using Turbolinks

From what I can see, the use of one webview might be the issue? It seems that Turbolinks restores the webview to its previous state when we revisit a page.

zachwaugh commented 7 years ago

Sorry for leaving this open for months. All the internal APIs are built around Turbolinks.js, from the JavaScript adapter we inject into the page, to the restoration behavior as you mentioned, as well as all the events we listen to to know when a page was loaded/rendered/etc.

It's definitely possible that we could separate the two by having a generic Turbolinks-like protocol that other frameworks could adopt and reuse the single WebView behavior, but it's would be very low on our list, since we're only using Turbolinks.js for our apps currently.