hotwired / turbo-ios

iOS framework for making Turbo native apps
MIT License
897 stars 88 forks source link

Demo doesn't work below iOS 16.4 #208

Closed careilly closed 6 months ago

careilly commented 6 months ago

(And neither does my app, which is my real problem - only tried it with the demo because I wanted to see if I could isolate what was going on.)

On building the demo and launching it into the simulator on versions below 16.4 I get the following screen:

Simulator Screenshot - iPhone 12 15 5 - 2024-05-09 at 15 40 45

and the following log. It works on 16.4+

2024-05-09 15:27:03.210028+0100 Turbo Demo[20520:5011767] [ViewportSizing] maximumViewportInset cannot be larger than frame
2024-05-09 15:27:03.210089+0100 Turbo Demo[20520:5011767] [ViewportSizing] minimumViewportInset cannot be larger than frame
2024-05-09 15:27:03.226637+0100 Turbo Demo[20520:5011767] [ViewportSizing] maximumViewportInset cannot be larger than frame
2024-05-09 15:27:03.226701+0100 Turbo Demo[20520:5011767] [ViewportSizing] minimumViewportInset cannot be larger than frame
2024-05-09 14:27:03 +0000 [Session] visit ["location": https://turbo-native-demo.glitch.me, "reload": false, "options": Turbo.VisitOptions(action: Turbo.VisitAction.replace, response: nil)]
2024-05-09 14:27:03 +0000 [ColdBootVisit] startVisit https://turbo-native-demo.glitch.me [:]
2024-05-09 15:27:03.270309+0100 Turbo Demo[20520:5011767] [Strada] bridgeDestinationViewDidLoad: https://turbo-native-demo.glitch.me
2024-05-09 15:27:03.270525+0100 Turbo Demo[20520:5011767] [Strada] bridgeDestinationViewWillAppear: https://turbo-native-demo.glitch.me
2024-05-09 15:27:03.310252+0100 Turbo Demo[20520:5011767] [Strada] bridgeDestinationViewDidAppear: https://turbo-native-demo.glitch.me
2024-05-09 14:27:34 +0000 [Bridge] ← pageLoad
Failed ["timestamp": 1715264854086] [:]
2024-05-09 14:27:34 +0000 [ColdBootVisit] cancelVisit https://turbo-native-demo.glitch.me [:]

Nothing in that log says anything relevant to me and I don't see how it's related to the .inspectable change in 16.4.

Xcode Version 15.3 (15E204a)

careilly commented 6 months ago

And the problem is that the demo doesn't include the es-module-shims needed to make it work on older Safari or WebViews.

Neither did my web app, which has been upgraded over several versions of Rails/Turbolink/Turbo.

joemasilotti commented 6 months ago

Thanks for the report! Feel free to open a PR that adds the shims to the demo app.

udit-ltim commented 3 months ago

Hi @careilly , I am also facing the same issue. Can you please help me with steps to fix this.

I am using Xcode 15.4 and trying to run on Simulator iPhone 15 , 17.2.

Simulator Screenshot - iPhone 15 - 2024-08-16 at 11 08 53

Console Logs -

Failed to resolve host network app id

[Session] visit ["options": Turbo.VisitOptions(action: Turbo.VisitAction.replace, response: nil), "reload": false, "location": https://turbo-native-demo.glitch.me?turbolinks=1]

[ColdBootVisit] startVisit https://turbo-native-demo.glitch.me?turbolinks=1 [:] bridgeDestinationViewDidLoad: https://turbo-native-demo.glitch.me?turbolinks=1 bridgeDestinationViewWillAppear: https://turbo-native-demo.glitch.me?turbolinks=1 bridgeDestinationViewDidAppear: https://turbo-native-demo.glitch.me?turbolinks=1 0x104810a18 - [pageProxyID=6, webPageID=7, PID=21387] WebPageProxy::didFailProvisionalLoadForFrame: frameID=1, isMainFrame=1, domain=NSURLErrorDomain, code=-1202, isMainFrame=1, willInternallyHandleFailure=0

@joemasilotti Is there any any PR for the fix?

careilly commented 3 months ago

Whoops, this fell off my radar.

You need to make sure you include the shims in the layout your app is using.

<script async src="https://ga.jspm.io/npm:es-module-shims@1.8.2/dist/es-module-shims.js" data-turbo-track="reload"></script>

Was the quick fix I used at the time.

But that doesn't look like the same issue - you're having a certificate or proxy problem, not a lack of shims.

udit-ltim commented 3 months ago

Thanks @careilly .

So I will not be able to test the demo App. Right? As I can not make the changes on the web part of this demo app which is using https://turbo-native-demo.glitch.me/?turbolinks=1 I have to create my own app in order to test and play with it?

Or is there a way I can run the demo App...