GithubHelp home page GithubHelp logo

router's Introduction

Hi there 👋

router's People

Contributors

carson-katri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

router's Issues

Path translation?

The standard for names in Swift is camelCase, but most websites use kebab-case for URL components. I see three different ways to reconcile this:

  1. Stick to camelCase URLs. This means the URLs are likely case sensitive and it would be obvious from the URL that this was not a regular web app.
  2. Automatically translate the route names to kebab-case. This would provide standard web app behavior.
  3. Allow users to somehow specify custom path components for a given route, overriding the default.

I think a combination of 2 and 3 would be best, providing sensible defaults while allowing users to potentially port existing URLs over to Tokamak, but I’m willing to have my mind changed!

NavigationView integration

I'm not sure how this would work yet, but it would be great if the router either supported the native NavigationView and NavigationLink types or introduced new RoutableNavigation and RoutableLink (names to bikeshed) types that behaved in a similar way with support for NavigationView layout and transitions. Maybe it is supported already? I haven't had a chance to explore the source code yet, feel free to close this then.

Cant seem to install package

Updating https://github.com/carson-katri/router
Updating https://github.com/wickwirew/Runtime
Updating https://github.com/swiftwasm/JavaScriptKit.git
Updating https://github.com/TokamakUI/Tokamak
Updating https://github.com/TokamakUI/OpenCombine.git
Updating https://github.com/swiftwasm/OpenCombineJS.git
Everything is already up-to-date
[1/55] Compiling OpenCombine DebugHook.swift
/Users/jimmyhoughjr/Documents/nscbr/.build/checkouts/router/Sources/Router/Helpers/EnvironmentObject+exists.swift:1:8: error: no such module 'SwiftUI'
import SwiftUI
^
[2/69] Compiling OpenCombine FilterProducer.swift
/Users/jimmyhoughjr/Documents/nscbr/.build/checkouts/router/Sources/Router/Helpers/EnvironmentObject+exists.swift:1:8: error: no such module 'SwiftUI'
import SwiftUI
^
[3/120] Compiling OpenCombine ConnectablePublisher.swift
/Users/jimmyhoughjr/Documents/nscbr/.build/checkouts/router/Sources/Router/Helpers/EnvironmentObject+exists.swift:1:8: error: no such module 'SwiftUI'
import SwiftUI
^
[4/120] Compiling OpenCombine CurrentValueSubject.swift
/Users/jimmyhoughjr/Documents/nscbr/.build/checkouts/router/Sources/Router/Helpers/EnvironmentObject+exists.swift:1:8: error: no such module 'SwiftUI'
import SwiftUI
^
[5/120] Compiling OpenCombine Codable.swift
/Users/jimmyhoughjr/Documents/nscbr/.build/checkouts/router/Sources/Router/Helpers/EnvironmentObject+exists.swift:1:8: error: no such module 'SwiftUI'
import SwiftUI
^
[6/120] Compiling OpenCombine CombineIdentifier.swift
/Users/jimmyhoughjr/Documents/nscbr/.build/checkouts/router/Sources/Router/Helpers/EnvironmentObject+exists.swift:1:8: error: no such module 'SwiftUI'
import SwiftUI
^
[7/120] Compiling OpenCombine AnySubscriber.swift
/Users/jimmyhoughjr/Documents/nscbr/.build/checkouts/router/Sources/Router/Helpers/EnvironmentObject+exists.swift:1:8: error: no such module 'SwiftUI'
import SwiftUI
^
[8/120] Compiling OpenCombine Cancellable.swift
/Users/jimmyhoughjr/Documents/nscbr/.build/checkouts/router/Sources/Router/Helpers/EnvironmentObject+exists.swift:1:8: error: no such module 'SwiftUI'
import SwiftUI
^
[9/120] Compiling OpenCombine CustomCombineIdentifierConvertible.swift
/Users/jimmyhoughjr/Documents/nscbr/.build/checkouts/router/Sources/Router/Helpers/EnvironmentObject+exists.swift:1:8: error: no such module 'SwiftUI'
import SwiftUI
^
[10/120] Compiling OpenCombine Future.swift
/Users/jimmyhoughjr/Documents/nscbr/.build/checkouts/router/Sources/Router/Helpers/EnvironmentObject+exists.swift:1:8: error: no such module 'SwiftUI'
import SwiftUI
^
[11/120] Compiling OpenCombine AnyCancellable.swift
/Users/jimmyhoughjr/Documents/nscbr/.build/checkouts/router/Sources/Router/Helpers/EnvironmentObject+exists.swift:1:8: error: no such module 'SwiftUI'
import SwiftUI
^
[12/120] Compiling OpenCombine AnyPublisher.swift
/Users/jimmyhoughjr/Documents/nscbr/.build/checkouts/router/Sources/Router/Helpers/EnvironmentObject+exists.swift:1:8: error: no such module 'SwiftUI'
import SwiftUI
^
[13/120] Compiling OpenCombine ConduitBase.swift
/Users/jimmyhoughjr/Documents/nscbr/.build/checkouts/router/Sources/Router/Helpers/EnvironmentObject+exists.swift:1:8: error: no such module 'SwiftUI'
import SwiftUI
^
[14/120] Compiling OpenCombine ConduitList.swift
/Users/jimmyhoughjr/Documents/nscbr/.build/checkouts/router/Sources/Router/Helpers/EnvironmentObject+exists.swift:1:8: error: no such module 'SwiftUI'
import SwiftUI

Provide activeRoute Binding

This would, for instance, allow setting the WindowGroup title based on the current Route:

struct MyApp : App {
  @State private var activeRoute: AppRoutes = .defaultRoute
  var body: some Scene {
    WindowGroup(title(for: activeRoute)) {
      Router(activeRoute: $activeRoute) {
        ...
      }
    }
  }
}

Can also open the possibility of navigating programmatically:

struct MyApp : App {
  @State private var activeRoute: AppRoutes = .defaultRoute
  var body: some Scene {
    WindowGroup {
      Router(activeRoute: $activeRoute) {
        ...
      }
    }.onOpenUrl {
      activeRoute = ...
    }
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.