diff --git a/Demo/AppDelegate.swift b/Demo/AppDelegate.swift index 88ef513..4f6a359 100644 --- a/Demo/AppDelegate.swift +++ b/Demo/AppDelegate.swift @@ -6,7 +6,7 @@ import Strada class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { #if DEBUG - TurboLog.debugLoggingEnabled = true +// TurboLog.debugLoggingEnabled = true Strada.config.debugLoggingEnabled = true #endif diff --git a/Demo/Demo.swift b/Demo/Demo.swift index 33b223c..16a7511 100644 --- a/Demo/Demo.swift +++ b/Demo/Demo.swift @@ -4,11 +4,12 @@ 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 local = URL(string: "http://localhost:45678")! + static let local = URL(string: "http://localhost:3000/")! + static let noRedirect = URL(string: "http://localhost:3000/home/page_1")! static let turbolinks5Local = URL(string: "http://localhost:45678?turbolinks=1")! /// Update this to choose which demo is run static var current: URL { - basic + local } } diff --git a/Demo/Demo.xcodeproj/project.pbxproj b/Demo/Demo.xcodeproj/project.pbxproj index 62ffeba..8bfec32 100644 --- a/Demo/Demo.xcodeproj/project.pbxproj +++ b/Demo/Demo.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -21,7 +21,7 @@ E226F7822AB1B7F20059D594 /* Strada in Frameworks */ = {isa = PBXBuildFile; productRef = E226F7812AB1B7F20059D594 /* Strada */; }; E226F7842AB1BBF30059D594 /* TurboWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E226F7832AB1BBF30059D594 /* TurboWebViewController.swift */; }; E226F7872AB1BE030059D594 /* WKWebViewConfiguration+App.swift in Sources */ = {isa = PBXBuildFile; fileRef = E226F7862AB1BE030059D594 /* WKWebViewConfiguration+App.swift */; }; - E226F78A2AB1BF880059D594 /* FormComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = E226F7892AB1BF880059D594 /* FormComponent.swift */; }; + E226F78A2AB1BF880059D594 /* HelloComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = E226F7892AB1BF880059D594 /* HelloComponent.swift */; }; E226F78C2AB1CE2E0059D594 /* BridgeComponent+App.swift in Sources */ = {isa = PBXBuildFile; fileRef = E226F78B2AB1CE2E0059D594 /* BridgeComponent+App.swift */; }; E226F78E2AB1D2C20059D594 /* MenuComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = E226F78D2AB1D2C20059D594 /* MenuComponent.swift */; }; E226F7902AB1D7260059D594 /* OverflowMenuComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = E226F78F2AB1D7260059D594 /* OverflowMenuComponent.swift */; }; @@ -57,7 +57,7 @@ CB4FB650273AE23B00119FD3 /* TurboNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TurboNavigationController.swift; sourceTree = ""; }; E226F7832AB1BBF30059D594 /* TurboWebViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TurboWebViewController.swift; sourceTree = ""; }; E226F7862AB1BE030059D594 /* WKWebViewConfiguration+App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WKWebViewConfiguration+App.swift"; sourceTree = ""; }; - E226F7892AB1BF880059D594 /* FormComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormComponent.swift; sourceTree = ""; }; + E226F7892AB1BF880059D594 /* HelloComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelloComponent.swift; sourceTree = ""; }; E226F78B2AB1CE2E0059D594 /* BridgeComponent+App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BridgeComponent+App.swift"; sourceTree = ""; }; E226F78D2AB1D2C20059D594 /* MenuComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuComponent.swift; sourceTree = ""; }; E226F78F2AB1D7260059D594 /* OverflowMenuComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OverflowMenuComponent.swift; sourceTree = ""; }; @@ -151,7 +151,7 @@ isa = PBXGroup; children = ( E226F78B2AB1CE2E0059D594 /* BridgeComponent+App.swift */, - E226F7892AB1BF880059D594 /* FormComponent.swift */, + E226F7892AB1BF880059D594 /* HelloComponent.swift */, E226F78D2AB1D2C20059D594 /* MenuComponent.swift */, E226F78F2AB1D7260059D594 /* OverflowMenuComponent.swift */, ); @@ -240,7 +240,7 @@ E226F7842AB1BBF30059D594 /* TurboWebViewController.swift in Sources */, C153F03525784BEA00926D30 /* NumbersViewController.swift in Sources */, C153F0082578057900926D30 /* AppDelegate.swift in Sources */, - E226F78A2AB1BF880059D594 /* FormComponent.swift in Sources */, + E226F78A2AB1BF880059D594 /* HelloComponent.swift in Sources */, E226F78C2AB1CE2E0059D594 /* BridgeComponent+App.swift in Sources */, CB4FB651273AE23B00119FD3 /* TurboNavigationController.swift in Sources */, E226F7872AB1BE030059D594 /* WKWebViewConfiguration+App.swift in Sources */, diff --git a/Demo/Demo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Demo/Demo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 4a5d77f..314ddd7 100644 --- a/Demo/Demo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Demo/Demo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,30 +1,12 @@ { "pins" : [ { - "identity" : "cwlcatchexception", + "identity" : "embassy", "kind" : "remoteSourceControl", - "location" : "https://github.com/mattgallagher/CwlCatchException.git", + "location" : "https://github.com/envoy/Embassy.git", "state" : { - "revision" : "3b123999de19bf04905bc1dfdb76f817b0f2cc00", - "version" : "2.1.2" - } - }, - { - "identity" : "cwlpreconditiontesting", - "kind" : "remoteSourceControl", - "location" : "https://github.com/mattgallagher/CwlPreconditionTesting.git", - "state" : { - "revision" : "a23ded2c91df9156628a6996ab4f347526f17b6b", - "version" : "2.1.2" - } - }, - { - "identity" : "nimble", - "kind" : "remoteSourceControl", - "location" : "https://github.com/quick/nimble", - "state" : { - "revision" : "1f3bde57bde12f5e7b07909848c071e9b73d6edc", - "version" : "10.0.0" + "revision" : "8469f2c1b334a7c1c3566e2cb2f97826c7cca898", + "version" : "4.1.6" } }, { @@ -36,15 +18,6 @@ "version" : "9.1.0" } }, - { - "identity" : "quick", - "kind" : "remoteSourceControl", - "location" : "https://github.com/quick/quick", - "state" : { - "revision" : "f9d519828bb03dfc8125467d8f7b93131951124c", - "version" : "5.0.1" - } - }, { "identity" : "strada-ios", "kind" : "remoteSourceControl", @@ -53,15 +26,6 @@ "branch" : "main", "revision" : "3f8e6a0a07d2361bb3a64a6e6a945124eed20ccf" } - }, - { - "identity" : "swifter", - "kind" : "remoteSourceControl", - "location" : "https://github.com/httpswift/swifter.git", - "state" : { - "revision" : "9483a5d459b45c3ffd059f7b55f9638e268632fd", - "version" : "1.5.0" - } } ], "version" : 2 diff --git a/Demo/Strada/HelloComponent.swift b/Demo/Strada/HelloComponent.swift new file mode 100644 index 0000000..19718dc --- /dev/null +++ b/Demo/Strada/HelloComponent.swift @@ -0,0 +1,13 @@ +import Foundation +import Strada +import UIKit + +/// Bridge component to display a submit button in the native toolbar, +/// which will submit the form on the page when tapped. +final class FormComponent: BridgeComponent { + override class var name: String { "hello" } + + override func onReceive(message: Message) { + reply(to: "connect") + } +}