https://kotlinlang.org logo
Join SlackCommunities
Powered by
# kweb
  • b

    blakelee

    08/06/2017, 6:41 PM
    I still don't know version control in a professional setting. In my projects I just mix everything into one. half features, full fixes, version updates, etc. But for yours I will add one thing and create a pull request for every feature
  • i

    Ian

    08/06/2017, 6:42 PM
    Yeah, that can be ok for a personal project, but you have to be more careful when you’re collaborating with others.
  • i

    Ian

    08/06/2017, 6:42 PM
    Even with a personal project though, it generally works out better if you try to keep things neatly organized
  • i

    Ian

    08/06/2017, 6:43 PM
    It often seems like it might be faster to be undisciplined, but it almost always comes back to bite you 🙂
  • b

    blakelee

    08/06/2017, 6:43 PM
    For me I just get stuck on something so I work on another feature. Next thing I know, everything is different
  • i

    Ian

    08/06/2017, 6:43 PM
    aka, “more haste, less speed” 🙂
    😃 1
  • i

    Ian

    08/06/2017, 6:44 PM
    if you keep each feature branch specific, then you can just merge changes to master into the feature branches to keep them up-to-date as you go along.
  • b

    blakelee

    08/06/2017, 6:45 PM
    I think this might be a problem a lot of junior developers run into. I tend to make code that is coupled together so changing one thing means I have to change more things than I want to.
  • i

    Ian

    08/06/2017, 6:46 PM
    Oh, absolutely. “more haste, less speed” is the easiest way to tell the difference between experienced developers and less experienced.
  • i

    Ian

    08/06/2017, 6:47 PM
    The faster you can internalize the idea of “do it right the first time”, the better a developer you’ll be, and the more successful you’ll be
  • i

    Ian

    08/06/2017, 6:47 PM
    (for reference, most developers take 5-10 years of working professionally before they really get this - and some people never do :)
  • b

    blakelee

    08/06/2017, 6:48 PM
    I've already started learning it in my android project. My first project is a mess.
  • b

    blakelee

    08/06/2017, 6:49 PM
    Should I add a comment to the img function that says it doesn't have internal routing so you have to use an external server? That way when they ctrl mouseover in their ide they can see it
  • i

    Ian

    08/06/2017, 6:49 PM
    hmm
  • b

    blakelee

    08/06/2017, 6:49 PM
    Right now just about everything is uncommented
  • i

    Ian

    08/06/2017, 6:50 PM
    hah, yes, as you can see, even fairly experienced developers don’t always follow their own advice of doing things right the first time 🙂
  • i

    Ian

    08/06/2017, 6:51 PM
    If you could hold-off on that commenting for now, I think the real solution to things like serving up images is a bigger problem.
  • i

    Ian

    08/06/2017, 6:52 PM
    Well, ok, actually, maybe do add that comment. It can’t hurt - and if this confused you, it will probably confuse others
  • a

    alostpacket

    07/07/2019, 2:21 AM
    anyone get an error like this?
    Copy code
    22:19:38.858 [qtp2129221032-26] ERROR io.kweb.WebBrowser - JavaScript message: 'Cannot read property 'parentNode' of null'
    Caused by executing: 'document.getElementById("Kg").parentNode.removeChild(document.getElementById("Kg"));':
            at io.kweb.Kweb.execute(Kweb.kt:323)
            at io.kweb.WebBrowser.execute(WebBrowser.kt:48)
            at io.kweb.dom.element.Element.execute(Element.kt:40)
            at io.kweb.dom.element.Element.delete(Element.kt:290)
  • a

    alostpacket

    07/07/2019, 2:24 AM
    for reference I am trying to do something like this
    Copy code
    render(boolKVar) {
      if (boolKVar.value) {
        div().new {
          p().text("Loaded.")
        }
      } else {
        div().new {
          p().text("Loading...")
        }
      }
    }
  • a

    alostpacket

    07/07/2019, 3:07 AM
    (decided to go with
    setAttribute("style", "visibility:hidden;display:none")
    as a work-around )
  • i

    Ian

    07/07/2019, 7:07 AM
    @alostpacket I replied on gitter
    👍 1
  • s

    SrSouza

    12/20/2019, 9:33 PM
    Hi guys, I was watching the close panel fron Kotlin conf and Leland, compose developer at Google, say that Will be cool if compose work in kweb, you guys look at the compose project? Any plan to try a port to kweb?
    👍 1
  • i

    Ian

    12/20/2019, 10:16 PM
    I've taken a look at Compose, it definitely has a lot of similarities in its approach to Kweb - however I'm not aware of anyone currently working on an integration.
  • p

    pabl0rg

    07/27/2020, 7:23 PM
    Hi @Ian would it be feasible to decouple kweb from ktor? I would like to start adding it into an http4k project, gradually replacing the frontend/backend split with a nice monolith.
  • p

    pabl0rg

    07/27/2020, 7:25 PM
    It might also make a nice addition to the Alpas Framework which seems to be the closest thing to rails we've got in the Kotlin world.
  • i

    Ian

    07/27/2020, 7:31 PM
    Hi @pabl0rg.  I'm not too familiar with HTTP4k but it should be possible, although it would require abstracting out the HTTP/WebSocket transport code, which isn't something I'd contemplated previously. Does HTTP4k have significant advantages over Ktor, or is it more that you're locked into it?
    p
    d
    • 3
    • 7
  • p

    pabl0rg

    08/05/2020, 6:30 PM
    Hi @Ian are there any examples of kweb projects with charts?
    i
    • 2
    • 1
  • h

    Hampus Londögård

    01/31/2021, 3:42 PM
    Hi, what's the big difference between Kweb and tools such as HTMX? :) Yes X
    p
    • 2
    • 1
  • m

    Matteo Mirk

    08/02/2021, 1:47 PM
    Hello, I fixed some demos, could you take a look? Thanks https://github.com/kwebio/kweb-demos/pull/7
    👍 1
    i
    • 2
    • 1