Skip to content

Commit

Permalink
Add a HomeComponent to demo the Strada-ios bug
Browse files Browse the repository at this point in the history
  • Loading branch information
adampal committed Nov 26, 2023
1 parent c9d060f commit 443bc28
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 48 deletions.
2 changes: 1 addition & 1 deletion Demo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions Demo/Demo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
10 changes: 5 additions & 5 deletions Demo/Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand All @@ -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 */; };
Expand Down Expand Up @@ -57,7 +57,7 @@
CB4FB650273AE23B00119FD3 /* TurboNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TurboNavigationController.swift; sourceTree = "<group>"; };
E226F7832AB1BBF30059D594 /* TurboWebViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TurboWebViewController.swift; sourceTree = "<group>"; };
E226F7862AB1BE030059D594 /* WKWebViewConfiguration+App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WKWebViewConfiguration+App.swift"; sourceTree = "<group>"; };
E226F7892AB1BF880059D594 /* FormComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormComponent.swift; sourceTree = "<group>"; };
E226F7892AB1BF880059D594 /* HelloComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelloComponent.swift; sourceTree = "<group>"; };
E226F78B2AB1CE2E0059D594 /* BridgeComponent+App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BridgeComponent+App.swift"; sourceTree = "<group>"; };
E226F78D2AB1D2C20059D594 /* MenuComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuComponent.swift; sourceTree = "<group>"; };
E226F78F2AB1D7260059D594 /* OverflowMenuComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OverflowMenuComponent.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -151,7 +151,7 @@
isa = PBXGroup;
children = (
E226F78B2AB1CE2E0059D594 /* BridgeComponent+App.swift */,
E226F7892AB1BF880059D594 /* FormComponent.swift */,
E226F7892AB1BF880059D594 /* HelloComponent.swift */,
E226F78D2AB1D2C20059D594 /* MenuComponent.swift */,
E226F78F2AB1D7260059D594 /* OverflowMenuComponent.swift */,
);
Expand Down Expand Up @@ -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 */,
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
}
},
{
Expand All @@ -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",
Expand All @@ -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
Expand Down
13 changes: 13 additions & 0 deletions Demo/Strada/HelloComponent.swift
Original file line number Diff line number Diff line change
@@ -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")
}
}

0 comments on commit 443bc28

Please sign in to comment.