Skip to content

Commit

Permalink
Merge pull request #26 from hotwired/migrate-to-new-domain
Browse files Browse the repository at this point in the history
Move to hotwire-native-demo and remove some Turbolinks 5 references
  • Loading branch information
olivaresf authored Sep 23, 2024
2 parents fc8e698 + 23b5ae3 commit 2afff27
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
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
Expand Up @@ -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:

Expand Down
18 changes: 0 additions & 18 deletions Tests/Turbo/SessionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2afff27

Please sign in to comment.