Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to hotwire-native-demo and remove some Turbolinks 5 references #26

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions Demo/Demo.swift
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import Foundation

struct Demo {
static let basic = URL(string: "https://turbo-native-demo.glitch.me")!
static let turbolinks5 = URL(string: "https://turbo-native-demo.glitch.me?turbolinks=1")!

static let remote = URL(string: "https://hotwire-native-demo.dev/")!
static let local = URL(string: "http://localhost:45678")!
static let turbolinks5Local = URL(string: "http://localhost:45678?turbolinks=1")!

/// Update this to choose which demo is run
static var current: URL {
basic
remote
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@

## Requirements

Hotwire Native iOS is written in Swift 5.3 and requires iOS 14 or higher. It supports web apps using either Turbo 7 or Turbolinks 5.
Hotwire Native iOS is written in Swift 5.3 and requires iOS 14 or higher. It supports web apps using Turbo 7.

**Note:** You should understand how Turbo works with web applications in the browser before attempting to use Hotwire Native. See the [Turbo 7 documentation](https://github.com/hotwired/turbo) for details. Ensure that your web app sets the `window.Turbo` global variable as it's required by the native apps:

18 changes: 0 additions & 18 deletions Tests/Turbo/SessionTests.swift
Original file line number Diff line number Diff line change
@@ -106,24 +106,6 @@ class SessionTests: XCTestCase {
XCTAssertEqual(error as? TurboError, TurboError.pageLoadFailure)
}

func test_coldBootVisit_Turbolinks5Compatibility_loadsThePageAndSetsTheAdapter() async throws {
await visit("/turbolinks")

XCTAssertTrue(sessionDelegate.sessionDidLoadWebViewCalled)

let result = try await session.webView.evaluateJavaScript("Turbolinks.controller.adapter === window.turboNative")
XCTAssertTrue(try XCTUnwrap(result as? Bool))
}

func test_coldBootVisit_Turbolinks5_3Compatibility_loadsThePageAndSetsTheAdapter() async throws {
await visit("/turbolinks-5.3")

XCTAssertTrue(sessionDelegate.sessionDidLoadWebViewCalled)

let result = try await session.webView.evaluateJavaScript("Turbolinks.controller.adapter === window.turboNative")
XCTAssertTrue(try XCTUnwrap(result as? Bool))
}

// MARK: - Server

@MainActor