Highly experimental routing feature for Compose Web

Overview

RoutingCompose

Highly experimental routing feature for Compose Web

Install

This package is uploaded to GitHub Packages.

repositories {
    maven {
        url = uri("https://maven.pkg.github.com/hfhbd/*")
        credentials {
            username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
            password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
        }
    }
}

dependencies {
    implementation("app.softwork:routing-compose:0.0.1")
}

Usage

HashRouter(initRoute = "/users") {
    route("/users") {
        int { userID ->
            Text("User with $userID") 
        } 
        noMatch {
            Text("User list")
        }
    }
    noMatch {
        Text("Hello World")
    }
}
Comments
  • Validation failed in file StreamingJsonDecoder.kt

    Validation failed in file StreamingJsonDecoder.kt

    I am getting this error when including the dependency.

    > Task :compileDevelopmentExecutableKotlinJs FAILED
    e: java.lang.IllegalStateException: Validation failed in file StreamingJsonDecoder.kt
    	at org.jetbrains.kotlin.backend.common.IrValidator.error(IrValidator.kt:86)
    	at org.jetbrains.kotlin.backend.common.IrValidator.access$error(IrValidator.kt:64)
    	at org.jetbrains.kotlin.backend.common.IrValidator$elementChecker$1.invoke(IrValidator.kt:90)
    	at org.jetbrains.kotlin.backend.common.IrValidator$elementChecker$1.invoke(IrValidator.kt:90)
    	at org.jetbrains.kotlin.backend.common.CheckIrElementVisitor.ensureBound(CheckIrElementVisitor.kt:61)
    	at org.jetbrains.kotlin.backend.common.CheckIrElementVisitor.visitDeclarationReference(CheckIrElementVisitor.kt:302)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitMemberAccess(IrElementVisitorVoid.kt:170)
    	at org.jetbrains.kotlin.backend.common.CheckIrElementVisitor.visitMemberAccess(CheckIrElementVisitor.kt:24)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitFunctionAccess(IrElementVisitorVoid.kt:173)
    	at org.jetbrains.kotlin.backend.common.CheckIrElementVisitor.visitFunctionAccess(CheckIrElementVisitor.kt:319)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitConstructorCall(IrElementVisitorVoid.kt:179)
    	at org.jetbrains.kotlin.backend.common.CheckIrElementVisitor.visitConstructorCall(CheckIrElementVisitor.kt:24)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitConstructorCall(IrElementVisitorVoid.kt:180)
    	at org.jetbrains.kotlin.backend.common.CheckIrElementVisitor.visitConstructorCall(CheckIrElementVisitor.kt:24)
    	at org.jetbrains.kotlin.backend.common.CheckIrElementVisitor.visitConstructorCall(CheckIrElementVisitor.kt:24)
    	at org.jetbrains.kotlin.ir.expressions.IrConstructorCall.accept(IrConstructorCall.kt:20)
    	at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptVoid(IrVisitors.kt:11)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitElement(IrValidator.kt:93)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitExpression(IrElementVisitorVoid.kt:104)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitExpression(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitDeclarationReference(IrElementVisitorVoid.kt:140)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitDeclarationReference(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitMemberAccess(IrElementVisitorVoid.kt:170)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitMemberAccess(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitFunctionAccess(IrElementVisitorVoid.kt:173)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitFunctionAccess(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitConstructorCall(IrElementVisitorVoid.kt:179)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitConstructorCall(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitConstructorCall(IrElementVisitorVoid.kt:180)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitConstructorCall(IrValidator.kt:64)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitConstructorCall(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.expressions.IrConstructorCall.accept(IrConstructorCall.kt:20)
    	at org.jetbrains.kotlin.ir.expressions.IrThrow.acceptChildren(IrThrow.kt:18)
    	at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptChildrenVoid(IrVisitors.kt:15)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitElement(IrValidator.kt:94)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitExpression(IrElementVisitorVoid.kt:104)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitExpression(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitThrow(IrElementVisitorVoid.kt:258)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitThrow(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitThrow(IrElementVisitorVoid.kt:259)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitThrow(IrValidator.kt:64)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitThrow(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.expressions.IrThrow.accept(IrThrow.kt:15)
    	at org.jetbrains.kotlin.ir.expressions.IrContainerExpression.acceptChildren(IrContainerExpression.kt:20)
    	at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptChildrenVoid(IrVisitors.kt:15)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitElement(IrValidator.kt:94)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitExpression(IrElementVisitorVoid.kt:104)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitExpression(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitContainerExpression(IrElementVisitorVoid.kt:128)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitContainerExpression(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitBlock(IrElementVisitorVoid.kt:134)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitBlock(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitBlock(IrElementVisitorVoid.kt:135)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitBlock(IrValidator.kt:64)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitBlock(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.expressions.IrBlock.accept(IrBlock.kt:15)
    	at org.jetbrains.kotlin.ir.expressions.IrCatch.acceptChildren(IrCatch.kt:22)
    	at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptChildrenVoid(IrVisitors.kt:15)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitElement(IrValidator.kt:94)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitCatch(IrElementVisitorVoid.kt:243)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitCatch(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitCatch(IrElementVisitorVoid.kt:244)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitCatch(IrValidator.kt:64)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitCatch(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.expressions.IrCatch.accept(IrCatch.kt:18)
    	at org.jetbrains.kotlin.ir.expressions.IrTry.acceptChildren(IrTry.kt:23)
    	at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptChildrenVoid(IrVisitors.kt:15)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitElement(IrValidator.kt:94)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitExpression(IrElementVisitorVoid.kt:104)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitExpression(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitTry(IrElementVisitorVoid.kt:240)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitTry(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitTry(IrElementVisitorVoid.kt:241)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitTry(IrValidator.kt:64)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitTry(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.expressions.IrTry.accept(IrTry.kt:19)
    	at org.jetbrains.kotlin.ir.expressions.IrBlockBody.acceptChildren(IrBlockBody.kt:20)
    	at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptChildrenVoid(IrVisitors.kt:15)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitElement(IrValidator.kt:94)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitBody(IrElementVisitorVoid.kt:86)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitBody(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitBlockBody(IrElementVisitorVoid.kt:92)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitBlockBody(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitBlockBody(IrElementVisitorVoid.kt:93)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitBlockBody(IrValidator.kt:64)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitBlockBody(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.expressions.IrBlockBody.accept(IrBlockBody.kt:17)
    	at org.jetbrains.kotlin.ir.declarations.IrFunction.acceptChildren(IrFunction.kt:50)
    	at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptChildrenVoid(IrVisitors.kt:15)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitElement(IrValidator.kt:94)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitDeclaration(IrElementVisitorVoid.kt:40)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitDeclaration(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitFunction(IrElementVisitorVoid.kt:49)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitFunction(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitSimpleFunction(IrElementVisitorVoid.kt:52)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitSimpleFunction(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitSimpleFunction(IrElementVisitorVoid.kt:53)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitSimpleFunction(IrValidator.kt:64)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitSimpleFunction(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.declarations.IrSimpleFunction.accept(IrSimpleFunction.kt:28)
    	at org.jetbrains.kotlin.ir.declarations.IrClass.acceptChildren(IrClass.kt:50)
    	at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptChildrenVoid(IrVisitors.kt:15)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitElement(IrValidator.kt:94)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitDeclaration(IrElementVisitorVoid.kt:40)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitDeclaration(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitClass(IrElementVisitorVoid.kt:43)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitClass(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitClass(IrElementVisitorVoid.kt:44)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitClass(IrValidator.kt:64)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitClass(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.declarations.IrClass.accept(IrClass.kt:46)
    	at org.jetbrains.kotlin.ir.declarations.IrFile.acceptChildren(IrFile.kt:28)
    	at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptChildrenVoid(IrVisitors.kt:15)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitElement(IrValidator.kt:94)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitPackageFragment(IrElementVisitorVoid.kt:30)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitPackageFragment(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitFile(IrElementVisitorVoid.kt:37)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitFile(IrValidator.kt:71)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitFile(IrElementVisitorVoid.kt:38)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitFile(IrValidator.kt:64)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitFile(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.declarations.IrFile.accept(IrFile.kt:22)
    	at org.jetbrains.kotlin.ir.declarations.IrModuleFragment.acceptChildren(IrModuleFragment.kt:36)
    	at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptChildrenVoid(IrVisitors.kt:15)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitElement(IrValidator.kt:94)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitModuleFragment(IrElementVisitorVoid.kt:27)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitModuleFragment(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitModuleFragment(IrElementVisitorVoid.kt:28)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitModuleFragment(IrValidator.kt:64)
    	at org.jetbrains.kotlin.backend.common.IrValidator.visitModuleFragment(IrValidator.kt:64)
    	at org.jetbrains.kotlin.ir.declarations.IrModuleFragment.accept(IrModuleFragment.kt:30)
    	at org.jetbrains.kotlin.backend.common.phaser.DumperVerifierKt.validationCallback(DumperVerifier.kt:142)
    	at org.jetbrains.kotlin.backend.common.phaser.DumperVerifierKt.validationCallback$default(DumperVerifier.kt:134)
    	at org.jetbrains.kotlin.ir.backend.js.JsLoweringPhasesKt$validateIrBeforeLowering$1.invoke(JsLoweringPhases.kt:121)
    	at org.jetbrains.kotlin.ir.backend.js.JsLoweringPhasesKt$validateIrBeforeLowering$1.invoke(JsLoweringPhases.kt:120)
    	at org.jetbrains.kotlin.ir.backend.js.JsLoweringPhasesKt$makeCustomJsModulePhase$1.invoke(JsLoweringPhases.kt:61)
    	at org.jetbrains.kotlin.ir.backend.js.JsLoweringPhasesKt$makeCustomJsModulePhase$1.invoke(JsLoweringPhases.kt:53)
    	at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:96)
    	at org.jetbrains.kotlin.ir.backend.js.CompilerWithICKt.lowerPreservingTags(compilerWithIC.kt:115)
    	at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compileIr(compiler.kt:152)
    	at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile(compiler.kt:68)
    	at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile$default(compiler.kt:49)
    	at org.jetbrains.kotlin.cli.js.K2JsIrCompiler.doExecute(K2JsIrCompiler.kt:392)
    	at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:183)
    	at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:72)
    	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:94)
    	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:43)
    	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101)
    	at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1642)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    	at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
    	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
    	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
    	at java.base/java.security.AccessController.doPrivileged(Native Method)
    	at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    	at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
    	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
    	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
    	at java.base/java.security.AccessController.doPrivileged(Native Method)
    	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    	at java.base/java.lang.Thread.run(Thread.java:829)
    
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':compileDevelopmentExecutableKotlinJs'.
    > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
       > Internal compiler error. See log for more details
    

    gradle.properties

    kotlin.code.style=official
    kotlin.native.enableDependencyPropagation=false
    kotlin.js.webpack.major.version=4
    kotlin.js.webpack.port=4040
    kotlin.version=1.7.10
    agp.version=4.2.2
    compose.version=1.2.0-alpha01-dev770
    
    opened by Queatz 10
  • CompositionLocal LocalDensity not present

    CompositionLocal LocalDensity not present

    When I was using this library in a Web project, I got this error: CompositionLocal LocalDensity not present.

    Code:

    @Composable
    fun WebRouter() {
        HashRouter("/") {
            route("/") {
                Text("Hello World")
            }
        }
    }
    
    fun main() {
        renderComposable(rootElementId = "root") {
            Text("as")
            WebRouter()
        }
    }
    

    The exception threw in the Text in the router, the Text outside does not throw any exception.

    Why is it happening? Thanks.

    opened by xtexChooser 9
  • gradle build not working

    gradle build not working

    When I run ./gradlew build with implementation("app.softwork:routing-compose:0.1.7") in the dependencies, the app throws this error.

    > Task :compileKotlinJs FAILED
    e: Could not find "kotlin" in [C:\Users\emirs\AppData\Local\kotlin\daemon]
    e: java.lang.IllegalStateException: Could not find "kotlin" in [C:\Users\emirs\AppData\Local\kotlin\daemon]
            at org.jetbrains.kotlin.cli.js.K2JsIrCompilerKt$messageCollectorLogger$1.fatal(K2JsIrCompiler.kt:539)
            at org.jetbrains.kotlin.library.KotlinLibrarySearchPathResolver.resolve(SearchPathResolver.kt:175)
            at org.jetbrains.kotlin.library.SearchPathResolver$DefaultImpls.resolve$default(SearchPathResolver.kt:20)
            at org.jetbrains.kotlin.library.SearchPathResolverKt.resolve(SearchPathResolver.kt:29)
            at org.jetbrains.kotlin.library.resolver.impl.KotlinLibraryResolverImpl$resolveDependencies$2$2.invoke(KotlinLibraryResolverImpl.kt:122)
            at org.jetbrains.kotlin.library.resolver.impl.KotlinLibraryResolverImpl$resolveDependencies$2$2.invoke(KotlinLibraryResolverImpl.kt:122)
            at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210)
            at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:170)
            at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194)
            at kotlin.sequences.TransformingSequence$iterator$1.hasNext(Sequences.kt:214)
            at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:169)
            at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194)
            at kotlin.sequences.SequencesKt___SequencesKt.toCollection(_Sequences.kt:786)
            at kotlin.sequences.SequencesKt___SequencesKt.toMutableList(_Sequences.kt:816)
            at kotlin.sequences.SequencesKt___SequencesKt.toList(_Sequences.kt:807)
            at org.jetbrains.kotlin.library.resolver.impl.KotlinLibraryResolverImpl.resolveDependencies(KotlinLibraryResolverImpl.kt:135)
            at org.jetbrains.kotlin.library.resolver.impl.KotlinLibraryResolverImpl.resolveWithDependencies(KotlinLibraryResolverImpl.kt:44)
            at org.jetbrains.kotlin.ir.backend.js.JsLibraryResolverKt.jsResolveLibraries(JsLibraryResolver.kt:53)
            at org.jetbrains.kotlin.cli.js.K2JsIrCompiler.doExecute(K2JsIrCompiler.kt:186)
            at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:182)
            at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:75)
            at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:92)
            at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
            at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
            at org.jetbrains.kotlin.incremental.IncrementalJsCompilerRunner.runCompiler(IncrementalJsCompilerRunner.kt:191)
            at org.jetbrains.kotlin.incremental.IncrementalJsCompilerRunner.runCompiler(IncrementalJsCompilerRunner.kt:77)
            at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:358)
            at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally$default(IncrementalCompilerRunner.kt:300)
            at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl$rebuild(IncrementalCompilerRunner.kt:119)
            at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:170)
            at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:81)
            at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile$default(IncrementalCompilerRunner.kt:72)
            at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execJsIncrementalCompiler(CompileServiceImpl.kt:550)
            at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execJsIncrementalCompiler(CompileServiceImpl.kt:96)
            at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1745)
            at jdk.internal.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.base/java.lang.reflect.Method.invoke(Method.java:564)
            at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
            at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
            at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
            at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
            at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
            at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
            at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
            at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
            at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
            at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
            at java.base/java.lang.Thread.run(Thread.java:832)
    

    When I remove it, the error is gone.

    My complete build.gradle.kts file:

    import org.jetbrains.compose.compose
    
    plugins {
        kotlin("multiplatform") version "1.5.31"
        id("org.jetbrains.compose") version "1.0.0"
    }
    
    group = "me.emirs"
    version = "1.0"
    
    repositories {
        google()
        mavenCentral()
        maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
    }
    
    kotlin {
        js(IR) {
            browser {
                testTask {
                    testLogging.showStandardStreams = true
                    useKarma {
                        useChromeHeadless()
                        useFirefox()
                    }
                }
            }
            binaries.executable()
        }
        sourceSets {
            val jsMain by getting {
                dependencies {
                    implementation(compose.web.core)
                    implementation(compose.runtime)
                    implementation("app.softwork:routing-compose:0.1.7")
                }
            }
            val jsTest by getting {
                dependencies {
                    implementation(kotlin("test-js"))
                }
            }
        }
    }
    

    My Kotlin version is 213-1.6.10-release-944-IJ6461.79 and gradle version is 7.4.

    opened by MakufonSkifto 5
  • Query parameter support

    Query parameter support

    It would be great if the router could support query parameters and ignore them when making routing decisions, yet still expose them when route is matched. This would be great way to build permalinks with some preconfigured state (e.g. search/filter form).

    This should work for both, BrowserRouter (localhost:8080/route?param=true&param2=true) and HashRouter (localhost:8080/#/route?param=true&param2=true)

    Aditionally, arrays could be also supported and parsed properly (localhost:8080/#/route?arrayParam=one&arrayParam=two should result in value of "arrayParam" to setOf("one", "two"))

    opened by mpetuska 5
  • New library that integrates routine-compose.

    New library that integrates routine-compose.

    Hi I am developing a library for compose multiplatform that incorporates also some modules for navigation. I have recently added support for path-based navigation: I have incorporated a modified version of routing-compose: instead of integrating the router with the composition, I have separated it completely. Here you can see the documentation for the library. Is it ok the way I have cited the original code from routine-compose. Do you want me to add something else?

    opened by beyondeye 4
  • IllegalArgumentException: Route / cannot be empty. Use noMatch instead

    IllegalArgumentException: Route / cannot be empty. Use noMatch instead

    Hi! I just updated routing-compose from 0.1.9-dev670 to 0.2.3 and I have that IllegalArgumentException in the JS console and nothing is rendered in the webpage.

    This is my app:

    @Composable
    fun MainApp() {
      Router()
    }
    

    And the router:

    @Composable
    fun Router() {
      var locale by remember { mutableStateOf(Locale.FRENCH) }
    
      BrowserRouter(initPath = "/") {
        route("/") {
          LandingPage(locale)
        }
    
        route("/map") {
          MapPage(locale)
        }
    
        noMatch {
          Text("NO MATCH")
        }
      }
    }
    

    Anything that rings a bell? Not sure what is wrong here ๐Ÿ˜… It was working fine with 0.1.9 Thanks!

    opened by sebleclerc 4
  • `rest` route matcher

    `rest` route matcher

    I want to get the rest of a path from the given route, not matching if there aren't any more segments. For example:

    route("foo") {
       rest { path -> println(path) }
    }
    

    Would not match /foo or /foo/ (that would fall down to noMatch), would match /foo/bar and print bar, and would match /foo/bar/baz and print bar/baz (I'm not stuck on the slash placement).

    string is similar currently, but only matches a single path segment. noMatch matches these routes, but doesn't provide the sub-path (and has its own distinct semantics).

    opened by rnett 3
  • Cannot get route

    Cannot get route

    I have a BrowserRouter setup but can't get to navigate to a defined route.

    @Composable
    fun RouterComponent() {
      BrowserRouter(initRoute = "/") {
        route("/") {
          Text("ROOT ROOT")
        }
    
        route("/map") {
          Text("MAP MAP MAP")
        }
    
        noMatch {
          Text("NO MATCH \uD83D\uDE22")
        }
      }
    }
    

    When I load my page at url http://localhost:8081/ I see the root route. But then if I navigate to http://localhost:8081/map, I get a Cannot GET /map error. Does that sounds a bell?

    Thanks for the help ๐Ÿ˜„

    FYI, I did try and setup as a HashRouter and accessing url http://localhost:8081/#/map I do get resolved to my map route.

    opened by sebleclerc 3
  • Add BrowserRouter

    Add BrowserRouter

    • Adds BrowserRouter for leveraging routing through the History API.
    • Updates NavLink to route through whichever router is being leveraged using a CompositionLocal.

    Tested locally with a personal site I'm currently building.

    Left to-do (as part of this PR or I can add in a future one):

    • Add unit tests and integration test just like those for HashRouter.
    • Determine best way to route when navigating directly to a path. For SPAs, which I think most implementations of compose-web will be, this is usually handled on the server to return the same resource for any path /* in which this should handle this.

    @hfhbd let me know your thoughts!

    opened by rbro112 3
  • Add implementation variants

    Add implementation variants

    Hi. Thanks for this work.

    I have a problem adding this library to the desktop app, when I add implementation("app.softwork:routing-compose:LATEST")

    It requires web dependencies, for my project it's only a desktop app. I think it's helpful to add implementation variants by platform (web, desktop....)

    opened by ixiDev 2
  • Bump org.jetbrains.compose from 1.2.0-alpha01-dev731 to 1.2.0-alpha01-dev741

    Bump org.jetbrains.compose from 1.2.0-alpha01-dev731 to 1.2.0-alpha01-dev741

    Bumps org.jetbrains.compose from 1.2.0-alpha01-dev731 to 1.2.0-alpha01-dev741.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies java 
    opened by dependabot[bot] 2
  • Bump multiplatform from 1.7.20 to 1.8.0

    Bump multiplatform from 1.7.20 to 1.8.0

    Bumps multiplatform from 1.7.20 to 1.8.0.

    Release notes

    Sourced from multiplatform's releases.

    Kotlin 1.8.0

    Changelog

    Analysis API

    • KT-50255 Analysis API: Implement standalone mode for the Analysis API

    Analysis API. FIR

    • KT-54292 Symbol Light classes: implement PsiVariable.computeConstantValue for light field
    • KT-54293 Analysis API: fix constructor symbol creation when its accessed via type alias

    Android

    • KT-53342 TCS: New AndroidSourceSet layout for multiplatform
    • KT-53013 Increase AGP compile version in KGP to 4.1.3
    • KT-54013 Report error when using deprecated Kotlin Android Extensions compiler plugin
    • KT-53709 MPP, Android SSL2: Conflicting warnings for androidTest/kotlin source set folder

    Backend. Native. Debug

    • KT-53561 Invalid LLVM module: "inlinable function call in a function with debug info must have a !dbg location"

    Compiler

    New Features

    • KT-52817 Add @JvmSerializableLambda annotation to keep old behavior of non-invokedynamic lambdas
    • KT-54460 Implementation of non-local break and continue
    • KT-53916 Support Xcode 14 and new Objective-C frameworks in Kotlin/Native compiler
    • KT-32208 Generate method annotations into bytecode for suspend lambdas (on invokeSuspend)
    • KT-53438 Introduce a way to get SourceDebugExtension attribute value via JVMTI for profiler and coverage

    Performance Improvements

    • KT-53347 Get rid of excess allocations in parser
    • KT-53689 JVM: Optimize equality on class literals
    • KT-53119 Improve String Concatenation Lowering

    Fixes

    • KT-53465 Unnecessary checkcast to array of reified type is not optimized since Kotlin 1.6.20
    • KT-49658 NI: False negative TYPE_MISMATCH on nullable type with when
    • KT-48162 NON_VARARG_SPREAD isn't reported on *toTypedArray() call
    • KT-43493 NI: False negative: no compilation error "Operator '==' cannot be applied to 'Long' and 'Int'" is reported in builder inference lambdas
    • KT-54393 Change in behavior from 1.7.10 to 1.7.20 for java field override.
    • KT-55357 IllegalStateException when reading a class that delegates to a Java class with a definitely-not-null type with a flexible upper bound
    • KT-55068 Kotlin Gradle DSL: No mapping for symbol: VALUE_PARAMETER SCRIPT_IMPLICIT_RECEIVER on JVM IR backend
    • KT-51284 SAM conversion doesn't work if method has context receivers
    • KT-48532 Remove old JVM backend

    ... (truncated)

    Changelog

    Sourced from multiplatform's changelog.

    1.8.0

    Analysis API

    • KT-50255 Analysis API: Implement standalone mode for the Analysis API

    Analysis API. FIR

    • KT-54292 Symbol Light classes: implement PsiVariable.computeConstantValue for light field
    • KT-54293 Analysis API: fix constructor symbol creation when its accessed via type alias

    Android

    • KT-53342 TCS: New AndroidSourceSet layout for multiplatform
    • KT-53013 Increase AGP compile version in KGP to 4.1.3
    • KT-54013 Report error when using deprecated Kotlin Android Extensions compiler plugin
    • KT-53709 MPP, Android SSL2: Conflicting warnings for androidTest/kotlin source set folder

    Backend. Native. Debug

    • KT-53561 Invalid LLVM module: "inlinable function call in a function with debug info must have a !dbg location"

    Compiler

    New Features

    • KT-52817 Add @JvmSerializableLambda annotation to keep old behavior of non-invokedynamic lambdas
    • KT-54460 Implementation of non-local break and continue
    • KT-53916 Support Xcode 14 and new Objective-C frameworks in Kotlin/Native compiler
    • KT-32208 Generate method annotations into bytecode for suspend lambdas (on invokeSuspend)
    • KT-53438 Introduce a way to get SourceDebugExtension attribute value via JVMTI for profiler and coverage

    Performance Improvements

    • KT-53347 Get rid of excess allocations in parser
    • KT-53689 JVM: Optimize equality on class literals
    • KT-53119 Improve String Concatenation Lowering

    Fixes

    • KT-53465 Unnecessary checkcast to array of reified type is not optimized since Kotlin 1.6.20
    • KT-49658 NI: False negative TYPE_MISMATCH on nullable type with when
    • KT-48162 NON_VARARG_SPREAD isn't reported on *toTypedArray() call
    • KT-43493 NI: False negative: no compilation error "Operator '==' cannot be applied to 'Long' and 'Int'" is reported in builder inference lambdas
    • KT-54393 Change in behavior from 1.7.10 to 1.7.20 for java field override.
    • KT-55357 IllegalStateException when reading a class that delegates to a Java class with a definitely-not-null type with a flexible upper bound
    • KT-55068 Kotlin Gradle DSL: No mapping for symbol: VALUE_PARAMETER SCRIPT_IMPLICIT_RECEIVER on JVM IR backend
    • KT-51284 SAM conversion doesn't work if method has context receivers
    • KT-48532 Remove old JVM backend
    • KT-55065 Kotlin Gradle DSL: Reflection cannot find class data for lambda, produced by JVM IR backend

    ... (truncated)

    Commits
    • da1a843 Add ChangeLog for 1.8.0-RC2
    • d325cf8 Call additional publishToMavenLocal in maven build scripts and enable info
    • 0403d70 Don't leave Gradle daemons after build scripts
    • 52b225d Fix task module-name is not propagated to compiler arguments
    • d40ebc3 Specify versions-maven-plugin version explicitly
    • 2e829ed Fix version parsing crash on Gradle rich version string
    • f603c0e Scripting, IR: fix capturing of implicit receiver
    • 06cbf8f Scripting, tests: enable custom script tests with IR
    • d61cef0 Fix deserialization exception for DNN types from Java
    • ea33e72 JVM IR: script is a valid container for local delegated properties
    • Additional commits viewable in compare view

    Dependabot compatibility score

    You can trigger a rebase of this PR by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies java 
    opened by dependabot[bot] 0
  • How to implement animation while changing between the screens?

    How to implement animation while changing between the screens?

    Hello. Is it possible to implement some visual effects while navigating through the screens? I mean effects like fade, slide, scale and so on. Are there any extension points to do it by myself?

    opened by chipnesh 1
Releases(v0.2.10)
  • v0.2.10(Nov 8, 2022)

    Summary

    Just updating Compose to 1.2.1 and Kotlin to 1.7.20

    What's Changed

    • Bump app.cash.licensee from 1.5.0 to 1.6.0 by @dependabot in https://github.com/hfhbd/routing-compose/pull/245
    • Bump org.jetbrains.compose from 1.2.0 to 1.2.1 by @dependabot in https://github.com/hfhbd/routing-compose/pull/246
    • Bump multiplatform from 1.7.10 to 1.7.20 by @dependabot in https://github.com/hfhbd/routing-compose/pull/240

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.2.9...v0.2.10

    Source code(tar.gz)
    Source code(zip)
  • v0.2.9(Oct 12, 2022)

    What's Changed

    • Bump org.jetbrains.compose from 1.2.0-alpha01-dev770 to 1.2.0-alpha01-dev774 by @dependabot in https://github.com/hfhbd/routing-compose/pull/230
    • Bump kotlinx-uuid-core from 0.0.16 to 0.0.17 by @dependabot in https://github.com/hfhbd/routing-compose/pull/232
    • Bump org.jetbrains.compose from 1.2.0-alpha01-dev774 to 1.2.0-alpha01-dev778 by @dependabot in https://github.com/hfhbd/routing-compose/pull/233
    • Bump org.jetbrains.compose from 1.2.0-alpha01-dev778 to 1.2.0-beta01 by @dependabot in https://github.com/hfhbd/routing-compose/pull/237
    • Bump org.jetbrains.compose from 1.2.0-beta01 to 1.2.0-beta02-dev795 by @dependabot in https://github.com/hfhbd/routing-compose/pull/238
    • Bump org.jetbrains.compose from 1.2.0-beta02-dev795 to 1.2.0-beta02-dev798 by @dependabot in https://github.com/hfhbd/routing-compose/pull/239
    • Bump org.jetbrains.compose from 1.2.0-beta02-dev798 to 1.2.0-beta02 by @dependabot in https://github.com/hfhbd/routing-compose/pull/241
    • Bump org.jetbrains.compose from 1.2.0-beta02 to 1.2.0-rc01 by @dependabot in https://github.com/hfhbd/routing-compose/pull/243
    • Bump org.jetbrains.compose from 1.2.0-rc01 to 1.2.0 by @dependabot in https://github.com/hfhbd/routing-compose/pull/244

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.2.8...v0.2.9

    Source code(tar.gz)
    Source code(zip)
  • v0.2.8(Aug 26, 2022)

    Breaking Changes

    DesktopRouter, HashRouter, and BrowserRouter are now internal classes. Use the Composable functions instead. The reason is to prevent creating a new Router instance, which results in wrong navigation. Please create an issue with your use case if you need to instantiate a Router without actually adding it to the Composable hierarchy.

    What's Changed

    • Gradle update by @hfhbd in https://github.com/hfhbd/routing-compose/pull/212
    • Bump npm dependencies by @hfhbd in https://github.com/hfhbd/routing-compose/pull/213
    • Fix DesktopRouter when navigating back by @hfhbd in https://github.com/hfhbd/routing-compose/pull/217
    • Make HashRouter and BrowserRouter internal classes by @hfhbd in https://github.com/hfhbd/routing-compose/pull/218
    • Add licensee by @hfhbd in https://github.com/hfhbd/routing-compose/pull/219
    • Test if GradlePluginPortal mirrors mavenCentral by @hfhbd in https://github.com/hfhbd/routing-compose/pull/220
    • Remove useless binaries setting by @hfhbd in https://github.com/hfhbd/routing-compose/pull/222
    • Use new GitHub Pages action by @hfhbd in https://github.com/hfhbd/routing-compose/pull/223
    • Use new dependency review action by @hfhbd in https://github.com/hfhbd/routing-compose/pull/224
    • Test dependency review by @hfhbd in https://github.com/hfhbd/routing-compose/pull/225
    • Bump actions/configure-pages from 1 to 2 by @dependabot in https://github.com/hfhbd/routing-compose/pull/227
    • Bump org.jetbrains.compose from 1.2.0-alpha01-dev745 to 1.2.0-alpha01-dev770 by @dependabot in https://github.com/hfhbd/routing-compose/pull/228
    • Bump kotlinx-uuid-core from 0.0.15 to 0.0.16 by @dependabot in https://github.com/hfhbd/routing-compose/pull/229

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.2.7...v0.2.8

    Source code(tar.gz)
    Source code(zip)
  • v0.2.7(Jul 19, 2022)

    What's Changed

    • Update Docs.yml by @hfhbd in https://github.com/hfhbd/routing-compose/pull/199
    • Bump multiplatform from 1.7.0 to 1.7.10 by @dependabot in https://github.com/hfhbd/routing-compose/pull/202
    • Bump org.jetbrains.compose from 1.2.0-alpha01-dev741 to 1.2.0-alpha01-dev745 by @dependabot in https://github.com/hfhbd/routing-compose/pull/203
    • Bump kotlinx-coroutines-swing from 1.6.3 to 1.6.4 by @dependabot in https://github.com/hfhbd/routing-compose/pull/205
    • Bump detekt-formatting from 1.20.0 to 1.21.0 by @dependabot in https://github.com/hfhbd/routing-compose/pull/208
    • Bump io.gitlab.arturbosch.detekt from 1.20.0 to 1.21.0 by @dependabot in https://github.com/hfhbd/routing-compose/pull/207
    • fix: path contains more than 1 '?' delimiter with using parameters by @xtexChooser in https://github.com/hfhbd/routing-compose/pull/209

    New Contributors

    • @xtexChooser made their first contribution in https://github.com/hfhbd/routing-compose/pull/209

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.2.6...v0.2.7

    Source code(tar.gz)
    Source code(zip)
  • v0.2.6(Jul 7, 2022)

    Add Boolean parameter to attrs scope of NavLink

    Instead hardcoding active, it now possible to use the boolean lambda parameter for customization when the current path starts with to.

    NavLink(to = "/users", { isActive ->
      if (isActive) {
        classes("active")
      }
    }) {
      Text("Users")
    }
    

    What's Changed

    • Fix docs cleanup by @hfhbd in https://github.com/hfhbd/routing-compose/pull/198
    • Fix broken webpackCli... by @hfhbd in https://github.com/hfhbd/routing-compose/pull/200
    • Add Boolean parameter to attrs scope of NavLink by @hfhbd in https://github.com/hfhbd/routing-compose/pull/201

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.2.5...v0.2.6

    Source code(tar.gz)
    Source code(zip)
  • v0.2.5(Jul 6, 2022)

    What's Changed

    • Bump kotlinx-coroutines-swing from 1.6.2 to 1.6.3 by @dependabot in https://github.com/hfhbd/routing-compose/pull/189
    • Bump org.jetbrains.compose from 1.2.0-alpha01-dev716 to 1.2.0-alpha01-dev724 by @dependabot in https://github.com/hfhbd/routing-compose/pull/190
    • Demo: Fix webpack config for browser router by @hfhbd in https://github.com/hfhbd/routing-compose/pull/192
    • Bump org.jetbrains.compose from 1.2.0-alpha01-dev724 to 1.2.0-alpha01-dev725 by @dependabot in https://github.com/hfhbd/routing-compose/pull/191
    • Bump org.jetbrains.compose from 1.2.0-alpha01-dev725 to 1.2.0-alpha01-dev729 by @dependabot in https://github.com/hfhbd/routing-compose/pull/193
    • Bump org.jetbrains.compose from 1.2.0-alpha01-dev729 to 1.2.0-alpha01-dev731 by @dependabot in https://github.com/hfhbd/routing-compose/pull/194
    • Bump Compose and Kotlin to 1.7.0 by @hfhbd in https://github.com/hfhbd/routing-compose/pull/196
    • Bump kotlinx-uuid-core from 0.0.14 to 0.0.15 by @dependabot in https://github.com/hfhbd/routing-compose/pull/175

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.2.4...v0.2.5

    Source code(tar.gz)
    Source code(zip)
  • v0.2.4(Jun 20, 2022)

    What's Changed

    • Bump org.jetbrains.compose from 1.2.0-alpha01-dev709 to 1.2.0-alpha01-dev713 by @dependabot in https://github.com/hfhbd/routing-compose/pull/183
    • Bump org.jetbrains.compose from 1.2.0-alpha01-dev713 to 1.2.0-alpha01-dev716 by @dependabot in https://github.com/hfhbd/routing-compose/pull/184
    • Bump Gradle to 7.4.2 by @hfhbd in https://github.com/hfhbd/routing-compose/pull/187
    • Allow / as route by @hfhbd in https://github.com/hfhbd/routing-compose/pull/188

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.2.3...v0.2.4

    Source code(tar.gz)
    Source code(zip)
  • v0.2.3(Jun 11, 2022)

    Improved NavLink

    • It uses the href attribute results into a "real" link, thanks @SalomonBrys
    • Better active support for / and at the start of routing
    • Aligned attrs and content parameter by @SalomonBrys

    What's Changed

    • Demo: Hide redirect in answer by @hfhbd in https://github.com/hfhbd/routing-compose/pull/171
    • Dependabot: Support JetBrains Compose repo by @hfhbd in https://github.com/hfhbd/routing-compose/pull/172
    • Bump org.jetbrains.compose from 1.2.0-alpha01-dev686 to 1.2.0-alpha01-dev707 by @dependabot in https://github.com/hfhbd/routing-compose/pull/173
    • Bump org.jetbrains.compose from 1.2.0-alpha01-dev707 to 1.2.0-alpha01-dev709 by @dependabot in https://github.com/hfhbd/routing-compose/pull/176
    • NavLink for JS improvements by @SalomonBrys in https://github.com/hfhbd/routing-compose/pull/177
    • HashRouter: Fix routing to / after redirect by @hfhbd in https://github.com/hfhbd/routing-compose/pull/179
    • Fix initPath by @hfhbd in https://github.com/hfhbd/routing-compose/pull/181
    • Fix NavLink active with root path by @hfhbd in https://github.com/hfhbd/routing-compose/pull/182

    New Contributors

    • @SalomonBrys made their first contribution in https://github.com/hfhbd/routing-compose/pull/177

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.2.2...v0.2.3

    Source code(tar.gz)
    Source code(zip)
  • v0.2.2(Jun 6, 2022)

    What's Changed

    • Add redirect in noMatch handler by @hfhbd in https://github.com/hfhbd/routing-compose/pull/170

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.2.1...v0.2.2

    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Jun 6, 2022)

    What's Changed

    • Fix Docs generation by @hfhbd in https://github.com/hfhbd/routing-compose/pull/167
    • Fix Docs generation by @hfhbd in https://github.com/hfhbd/routing-compose/pull/168
    • Remove wrong prefix removing by @hfhbd in https://github.com/hfhbd/routing-compose/pull/169

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.2.0...v0.2.1

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Jun 6, 2022)

    Relative Routing and Redirecting

    You can now use relative routing and redirecting, and hide it from the history if you want.

    redirect("redirect", target = "users", hide = true)
    route("users) {
        NavLink(to = "./answer") {
            Text("Relative route to ./answer")
        }
        val router = Router.current
        Input(type = InputType.Button) {
            onClick {
                router.navigate("redirect", hide = true)
            }
            value("Navigate to /users. Check the url.")
        }
    }
    

    Breaking Changes

    • This release also renames NavBuilder to RouteBuilder.
    • HashRouter and BrowserRouter are classes, you must use val router = Router.current to get the current router.

    What's Changed

    • Bump NPM Dependencies by @hfhbd in https://github.com/hfhbd/routing-compose/pull/136
    • Bump actions/checkout from 2 to 3 by @dependabot in https://github.com/hfhbd/routing-compose/pull/137
    • Bump org.jetbrains.compose from 1.1.0 to 1.1.1 by @dependabot in https://github.com/hfhbd/routing-compose/pull/138
    • Bump npm packages by @hfhbd in https://github.com/hfhbd/routing-compose/pull/139
    • Flow clock by @hfhbd in https://github.com/hfhbd/routing-compose/pull/140
    • Bump kotlinx-coroutines-swing from 1.6.0 to 1.6.1 by @dependabot in https://github.com/hfhbd/routing-compose/pull/142
    • Bump actions/download-artifact from 2 to 3 by @dependabot in https://github.com/hfhbd/routing-compose/pull/146
    • Bump actions/setup-java from 2 to 3 by @dependabot in https://github.com/hfhbd/routing-compose/pull/144
    • Bump actions/upload-artifact from 2 to 3 by @dependabot in https://github.com/hfhbd/routing-compose/pull/145
    • Bump Kotlin to 1.6.21 by @hfhbd in https://github.com/hfhbd/routing-compose/pull/149
    • Bump org.jetbrains.compose from 0.0.0-on-rebase-12-apr-2022-dev670 to 1.2.0-alpha01-dev675 by @dependabot in https://github.com/hfhbd/routing-compose/pull/151
    • Add href to NavLink by @hfhbd in https://github.com/hfhbd/routing-compose/pull/154
    • Root attribute by @hfhbd in https://github.com/hfhbd/routing-compose/pull/155
    • Bump org.jetbrains.compose from 1.2.0-alpha01-dev675 to 1.2.0-alpha01-dev679 by @dependabot in https://github.com/hfhbd/routing-compose/pull/156
    • Implement relative routing by @hfhbd in https://github.com/hfhbd/routing-compose/pull/157
    • Bump org.jetbrains.compose from 1.2.0-alpha01-dev679 to 1.2.0-alpha01-dev683 by @dependabot in https://github.com/hfhbd/routing-compose/pull/159
    • Implement redirecting by @hfhbd in https://github.com/hfhbd/routing-compose/pull/160
    • Bump org.jetbrains.compose from 1.2.0-alpha01-dev683 to 1.2.0-alpha01-dev686 by @dependabot in https://github.com/hfhbd/routing-compose/pull/161
    • Fix grammar by @hfhbd in https://github.com/hfhbd/routing-compose/pull/162
    • Fix HashRouter new url by @hfhbd in https://github.com/hfhbd/routing-compose/pull/163
    • Bump kotlinx-coroutines-swing from 1.6.1 to 1.6.2 by @dependabot in https://github.com/hfhbd/routing-compose/pull/164
    • Add active class to NavLink by @hfhbd in https://github.com/hfhbd/routing-compose/pull/165
    • Add relative routing path support by @hfhbd in https://github.com/hfhbd/routing-compose/pull/166

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.1.8...v0.2.0

    Source code(tar.gz)
    Source code(zip)
  • v0.1.9-dev670(Apr 20, 2022)

    This release uses a dev build of Compose: 0.0.0-on-rebase-12-apr-2022-dev670!

    What's Changed

    • Bump NPM Dependencies by @hfhbd in https://github.com/hfhbd/routing-compose/pull/136
    • Bump actions/checkout from 2 to 3 by @dependabot in https://github.com/hfhbd/routing-compose/pull/137
    • Bump org.jetbrains.compose from 1.1.0 to 1.1.1 by @dependabot in https://github.com/hfhbd/routing-compose/pull/138
    • Bump npm packages by @hfhbd in https://github.com/hfhbd/routing-compose/pull/139
    • Flow clock by @hfhbd in https://github.com/hfhbd/routing-compose/pull/140
    • Bump kotlinx-coroutines-swing from 1.6.0 to 1.6.1 by @dependabot in https://github.com/hfhbd/routing-compose/pull/142
    • Bump actions/download-artifact from 2 to 3 by @dependabot in https://github.com/hfhbd/routing-compose/pull/146
    • Bump actions/setup-java from 2 to 3 by @dependabot in https://github.com/hfhbd/routing-compose/pull/144
    • Bump actions/upload-artifact from 2 to 3 by @dependabot in https://github.com/hfhbd/routing-compose/pull/145
    • Bump Kotlin to 1.6.21 by @hfhbd in https://github.com/hfhbd/routing-compose/pull/149

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.1.8...v0.1.9-dev670

    Source code(tar.gz)
    Source code(zip)
  • v0.1.8(Feb 24, 2022)

    What's Changed

    • Test: Match route when available after update by @hfhbd in https://github.com/hfhbd/routing-compose/pull/126
    • Create FUNDING.yml by @hfhbd in https://github.com/hfhbd/routing-compose/pull/134
    • Bump org.jetbrains.compose from 1.0.1 to 1.1.0 by @dependabot in https://github.com/hfhbd/routing-compose/pull/135

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.1.7...v0.1.8

    Source code(tar.gz)
    Source code(zip)
  • v0.1.7(Jan 30, 2022)

    What's Changed

    • Fix dark mode by @hfhbd in https://github.com/hfhbd/routing-compose/pull/123
    • Fix: Match route when available after update by @hfhbd in https://github.com/hfhbd/routing-compose/pull/125

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.1.6...v0.1.7

    Source code(tar.gz)
    Source code(zip)
  • v0.1.6(Jan 24, 2022)

    What's Changed

    • Bump Compose to 1.0.1 by @hfhbd in https://github.com/hfhbd/routing-compose/pull/119
    • Update README.md by @hfhbd in https://github.com/hfhbd/routing-compose/pull/120
    • BrowserRouter: Add missing query parameter support by @hfhbd in https://github.com/hfhbd/routing-compose/pull/122

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.1.5...v0.1.6

    Source code(tar.gz)
    Source code(zip)
  • v0.1.5(Dec 23, 2021)

    What's Changed

    • Add JS lock file by @hfhbd in https://github.com/hfhbd/routing-compose/pull/116
    • HashRouter: Support empty path by @hfhbd in https://github.com/hfhbd/routing-compose/pull/118

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.1.4...v0.1.5

    Source code(tar.gz)
    Source code(zip)
  • v0.1.4(Dec 14, 2021)

    What's Changed

    • Bump multiplatform from 1.5.31 to 1.6.10 by @dependabot in https://github.com/hfhbd/routing-compose/pull/102
    • Relax slash requirement in routes by @hfhbd in https://github.com/hfhbd/routing-compose/pull/115

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.1.3...v0.1.4

    Source code(tar.gz)
    Source code(zip)
  • v0.1.3(Dec 2, 2021)

    What's Changed

    • Bump org.jetbrains.compose 1.0.0 by @dependabot in https://github.com/hfhbd/routing-compose/pull/114

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.1.2...v0.1.3

    Source code(tar.gz)
    Source code(zip)
  • v0.1.2(Nov 22, 2021)

    What's Changed

    • Add query parameter support by @hfhbd in https://github.com/hfhbd/routing-compose/pull/108
    route("users") {
        val param: Map<String, List<String>>? = this.parameters?.map // null, if no parameters were send
    }
    
    • Bump org.jetbrains.compose from 1.0.0-beta6-dev464 to 1.0.0-beta6-dev474 by @dependabot in https://github.com/hfhbd/routing-compose/pull/107

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.1.1...v0.1.2

    Source code(tar.gz)
    Source code(zip)
  • v0.1.1(Nov 21, 2021)

    What's Changed

    • Rename const back to route by @hfhbd in https://github.com/hfhbd/routing-compose/pull/105
    • Bump org.jetbrains.compose to 1.0.0-beta6-dev464 by @dependabot in https://github.com/hfhbd/routing-compose/pull/103

    Full Changelog: https://github.com/hfhbd/routing-compose/compare/v0.1.0...v0.1.1

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Nov 9, 2021)

    This version allows you to use dynamic routing:

    route("foo") {
        if(something) {
            int {
                Text("something $it")
            }
        } 
        noMatch {
            Text("Enable something first")
        }
    }
    

    This feature is provided by native @Compose support. What does it mean? You can now use normal @Compose functions right in your routing code, no more Lazy<Int> and .value usages. And of course, a header or a footer is now simpler to use as before: directly in the route body.

    Also, the function names did change: there is no confusing intRoute and int (parameter), just int.

    There is no need for noMatch either, if it is not provided, you don't get an error anymore!

    At always, you can try out the sample at: https://routing.softwork.app

    Source code(tar.gz)
    Source code(zip)
  • v0.0.31(Sep 28, 2021)

  • v0.0.30(Sep 14, 2021)

  • v0.0.29(Sep 13, 2021)

  • v0.0.27(Aug 27, 2021)

  • v0.0.26(Aug 25, 2021)

  • v0.0.25(Aug 17, 2021)

Owner
Philip Wedemann
Currently studying my master degree in computer science. Formerly worked in the Security Operations Center at Volkswagen AG
Philip Wedemann
Experimental Graphviz code generation POC built with Jetpack Compose compiler/runtime.

Compose Dot Experimental proof of concept to generate GraphViz dot code via Jetpack Compose's tree management. Valid dot file content can be generated

Arunkumar 29 Sep 14, 2022
Glance Experimental Tools aims to supplement Jetpack Glance with features that are commonly required by developers but not yet available.

Glance Experimental Tools ?? Work in-progress: artifacts not available yet This project aims to supplement Jetpack Glance with features that are commo

Google 96 Dec 25, 2022
OTPView is a view made in Jetpack compose. It is highly customisable and can be used to show OTP view with different length and shapes.

OTPView OTPView is a highly costumizable OTP view made in the Jetpack compose UI. Usage: CircleOtpView is a sample composable that calls the OtpView w

kunalsale 17 Aug 4, 2022
A feature flag framework for Android using Kotlin and Jetpack Compose

Feature Flags are essential for software development and release management

Rygel Louv 6 Aug 21, 2022
๐Ÿš€๐Ÿ“’๐Ÿ“ Indicators for Horizontal or Vertical Pager with different orientation, color, size options and optional touch feature.

Compose Pager Indicator Indicators for Horizontal or Vertical pager with different orientation, color, size options and optional touch feature. indica

Smart Tool Factory 5 Oct 7, 2022
Exercising Compose for Desktop and Compose for Web (Canvas)

Compose Counting Grid A simple application to check Compose for Desktop and Compose for Web (Canvas) drawing speeds when drawing grids (or tables) wit

null 6 Nov 11, 2022
This is a Compose for Web port of CompoSnake

Compose-Snake-Web This is a Compose for Web port of CompoSnake. I used the code from there and modified it, to make it work in web. You can try it HER

Jens Klingenberg 13 Apr 30, 2022
Resume of Louis CAD, made with Jetpack Compose. Supports the Web, Desktop, and Android.

ResumeComposition What This project is the source code of the resume/CV of Louis CAD. The latest PDF export is available here, it is ready to print. H

Louis CAD 22 Aug 14, 2022
A simple web app that shows holiday in Estonia

EstoHoli A simple android application that shows holiday in Estonia Built With Android Studio, Kotlin & XML Dependencies RXjava Gson Okhttp BootstrapA

ThankGod Richard 1 Nov 7, 2022
Kompose wrappers for material-components-web

Kompose Material Design Components (KMDC) A set of kotlin wrappers over [email protected] library providing Jetbrains Compose DSL for bui

Martynas Petuลกka 82 Jan 1, 2023
๐Ÿ“Š A web tool to visualise and compare your android benchmark results

benchart A web tool to visualise and compare your android benchmark result โœจ Demo Screen.Recording.2022-11-26.at.2.36.55.PM.mov โœ๏ธ Author ?? theapache

theapache64 65 Dec 20, 2022
Jetpack Compose Boids | Flocking Insect ๐Ÿœ. bird or Fish simulation using Jetpack Compose Desktop ๐Ÿš€, using Canvas API ๐ŸŽจ

?? ?? ?? Compose flocking Ants(boids) ?? ?? ?? Jetpack compose Boids | Flocking Insect. bird or Fish simulation using Jetpack Compose Desktop ?? , usi

Chetan Gupta 38 Sep 25, 2022
A collection of animations, compositions, UIs using Jetpack Compose. You can say Jetpack Compose cookbook or play-ground if you want!

Why Not Compose! A collection of animations, compositions, UIs using Jetpack Compose. You can say Jetpack Compose cookbook or play-ground if you want!

Md. Mahmudul Hasan Shohag 186 Jan 1, 2023
Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Androidโ€™s modern toolkit for building native UI.

Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Androidโ€™s modern toolkit for building native UI.

MindOrks 382 Jan 5, 2023
K5-compose is a sketchy port of p5.js for Jetpack Compose

k5-compose k5-compose is a sketchy port of P5.js for Jetpack Compose Desktop. This library provides you a playground to play with your sketches so you

Nikhil Chaudhari 176 Nov 22, 2022
Jetpack Compose based project, used to stress-testing compose features / integrations and explore non-trivial functionality

Project containing Jetpack Compose samples For pagination & network images it uses CATAAS. Known issues Navigation-Compose Issue with fast tapping on

Denis Rudenko 59 Dec 14, 2022
Pokedex Compose is an independent re-write of a demo application by the name of Pokedex, but written in jetpack compose.

Pokedex Compose Pokedex Compose is an independent re-write of a similar project by the name of Pokedex. I am recreating the UI but I am doing it using

Jose Patino 4 May 1, 2022
This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Compose.

JetBMICalculator This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Co

BHAVNA THACKER 3 Dec 31, 2022
Jetpack-Compose-Demo - Instagram Profile UI using Jetpack Compose

Jetpack-Compose-Demo Instagram Profile UI using Jetpack Compose

omar 1 Aug 11, 2022